Rapport-Mobileapp/dist/assets/index-CQwTocWK.js

380 lines
3.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var lNe=Object.defineProperty;var cNe=(n,t,i)=>t in n?lNe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i;var sn=(n,t,i)=>(cNe(n,typeof t!="symbol"?t+"":t,i),i),JW=(n,t,i)=>{if(!t.has(n))throw TypeError("Cannot "+i)};var T=(n,t,i)=>(JW(n,t,"read from private field"),i?i.call(n):t.get(n)),ee=(n,t,i)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,i)},re=(n,t,i,s)=>(JW(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i);var ao=(n,t,i,s)=>({set _(l){re(n,t,l,i)},get _(){return T(n,t,s)}}),pe=(n,t,i)=>(JW(n,t,"access private method"),i);function dNe(n,t){for(var i=0;i<t.length;i++){const s=t[i];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in n)){const d=Object.getOwnPropertyDescriptor(s,l);d&&Object.defineProperty(n,l,d.get?d:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(l){const d={};return l.integrity&&(d.integrity=l.integrity),l.referrerPolicy&&(d.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?d.credentials="include":l.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(l){if(l.ep)return;l.ep=!0;const d=i(l);fetch(l.href,d)}})();var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mv(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Wpe(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var i=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var l=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(i,s,l.get?l:{enumerable:!0,get:function(){return n[s]}})}),i}var $pe={exports:{}},Mj={},Kpe={exports:{}},tr={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var DO=Symbol.for("react.element"),uNe=Symbol.for("react.portal"),hNe=Symbol.for("react.fragment"),fNe=Symbol.for("react.strict_mode"),pNe=Symbol.for("react.profiler"),mNe=Symbol.for("react.provider"),gNe=Symbol.for("react.context"),vNe=Symbol.for("react.forward_ref"),yNe=Symbol.for("react.suspense"),_Ne=Symbol.for("react.memo"),ENe=Symbol.for("react.lazy"),ede=Symbol.iterator;function wNe(n){return n===null||typeof n!="object"?null:(n=ede&&n[ede]||n["@@iterator"],typeof n=="function"?n:null)}var qpe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ype=Object.assign,Xpe={};function VR(n,t,i){this.props=n,this.context=t,this.refs=Xpe,this.updater=i||qpe}VR.prototype.isReactComponent={};VR.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};VR.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function Jpe(){}Jpe.prototype=VR.prototype;function $X(n,t,i){this.props=n,this.context=t,this.refs=Xpe,this.updater=i||qpe}var KX=$X.prototype=new Jpe;KX.constructor=$X;Ype(KX,VR.prototype);KX.isPureReactComponent=!0;var tde=Array.isArray,Qpe=Object.prototype.hasOwnProperty,qX={current:null},Zpe={key:!0,ref:!0,__self:!0,__source:!0};function eme(n,t,i){var s,l={},d=null,u=null;if(t!=null)for(s in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(d=""+t.key),t)Qpe.call(t,s)&&!Zpe.hasOwnProperty(s)&&(l[s]=t[s]);var p=arguments.length-2;if(p===1)l.children=i;else if(1<p){for(var g=Array(p),_=0;_<p;_++)g[_]=arguments[_+2];l.children=g}if(n&&n.defaultProps)for(s in p=n.defaultProps,p)l[s]===void 0&&(l[s]=p[s]);return{$$typeof:DO,type:n,key:d,ref:u,props:l,_owner:qX.current}}function SNe(n,t){return{$$typeof:DO,type:n.type,key:t,ref:n.ref,props:n.props,_owner:n._owner}}function YX(n){return typeof n=="object"&&n!==null&&n.$$typeof===DO}function bNe(n){var t={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(i){return t[i]})}var nde=/\/+/g;function QW(n,t){return typeof n=="object"&&n!==null&&n.key!=null?bNe(""+n.key):t.toString(36)}function Dk(n,t,i,s,l){var d=typeof n;(d==="undefined"||d==="boolean")&&(n=null);var u=!1;if(n===null)u=!0;else switch(d){case"string":case"number":u=!0;break;case"object":switch(n.$$typeof){case DO:case uNe:u=!0}}if(u)return u=n,l=l(u),n=s===""?"."+QW(u,0):s,tde(l)?(i="",n!=null&&(i=n.replace(nde,"$&/")+"/"),Dk(l,t,i,"",function(_){return _})):l!=null&&(YX(l)&&(l=SNe(l,i+(!l.key||u&&u.key===l.key?"":(""+l.key).replace(nde,"$&/")+"/")+n)),t.push(l)),1;if(u=0,s=s===""?".":s+":",tde(n))for(var p=0;p<n.length;p++){d=n[p];var g=s+QW(d,p);u+=Dk(d,t,i,g,l)}else if(g=wNe(n),typeof g=="function")for(n=g.call(n),p=0;!(d=n.next()).done;)d=d.value,g=s+QW(d,p++),u+=Dk(d,t,i,g,l);else if(d==="object")throw t=String(n),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function ek(n,t,i){if(n==null)return n;var s=[],l=0;return Dk(n,s,"","",function(d){return t.call(i,d,l++)}),s}function CNe(n){if(n._status===-1){var t=n._result;t=t(),t.then(function(i){(n._status===0||n._status===-1)&&(n._status=1,n._result=i)},function(i){(n._status===0||n._status===-1)&&(n._status=2,n._result=i)}),n._status===-1&&(n._status=0,n._result=t)}if(n._status===1)return n._result.default;throw n._result}var cc={current:null},kk={transition:null},TNe={ReactCurrentDispatcher:cc,ReactCurrentBatchConfig:kk,ReactCurrentOwner:qX};tr.Children={map:ek,forEach:function(n,t,i){ek(n,function(){t.apply(this,arguments)},i)},count:function(n){var t=0;return ek(n,function(){t++}),t},toArray:function(n){return ek(n,function(t){return t})||[]},only:function(n){if(!YX(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};tr.Component=VR;tr.Fragment=hNe;tr.Profiler=pNe;tr.PureComponent=$X;tr.StrictMode=fNe;tr.Suspense=yNe;tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TNe;tr.cloneElement=function(n,t,i){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var s=Ype({},n.props),l=n.key,d=n.ref,u=n._owner;if(t!=null){if(t.ref!==void 0&&(d=t.ref,u=qX.current),t.key!==void 0&&(l=""+t.key),n.type&&n.type.defaultProps)var p=n.type.defaultProps;for(g in t)Qpe.call(t,g)&&!Zpe.hasOwnProperty(g)&&(s[g]=t[g]===void 0&&p!==void 0?p[g]:t[g])}var g=arguments.length-2;if(g===1)s.children=i;else if(1<g){p=Array(g);for(var _=0;_<g;_++)p[_]=arguments[_+2];s.children=p}return{$$typeof:DO,type:n.type,key:l,ref:d,props:s,_owner:u}};tr.createContext=function(n){return n={$$typeof:gNe,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:mNe,_context:n},n.Consumer=n};tr.createElement=eme;tr.createFactory=function(n){var t=eme.bind(null,n);return t.type=n,t};tr.createRef=function(){return{current:null}};tr.forwardRef=function(n){return{$$typeof:vNe,render:n}};tr.isValidElement=YX;tr.lazy=function(n){return{$$typeof:ENe,_payload:{_status:-1,_result:n},_init:CNe}};tr.memo=function(n,t){return{$$typeof:_Ne,type:n,compare:t===void 0?null:t}};tr.startTransition=function(n){var t=kk.transition;kk.transition={};try{n()}finally{kk.transition=t}};tr.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};tr.useCallback=function(n,t){return cc.current.useCallback(n,t)};tr.useContext=function(n){return cc.current.useContext(n)};tr.useDebugValue=function(){};tr.useDeferredValue=function(n){return cc.current.useDeferredValue(n)};tr.useEffect=function(n,t){return cc.current.useEffect(n,t)};tr.useId=function(){return cc.current.useId()};tr.useImperativeHandle=function(n,t,i){return cc.current.useImperativeHandle(n,t,i)};tr.useInsertionEffect=function(n,t){return cc.current.useInsertionEffect(n,t)};tr.useLayoutEffect=function(n,t){return cc.current.useLayoutEffect(n,t)};tr.useMemo=function(n,t){return cc.current.useMemo(n,t)};tr.useReducer=function(n,t,i){return cc.current.useReducer(n,t,i)};tr.useRef=function(n){return cc.current.useRef(n)};tr.useState=function(n){return cc.current.useState(n)};tr.useSyncExternalStore=function(n,t,i){return cc.current.useSyncExternalStore(n,t,i)};tr.useTransition=function(){return cc.current.useTransition()};tr.version="18.2.0";Kpe.exports=tr;var k=Kpe.exports;const dn=Mv(k),RNe=dNe({__proto__:null,default:dn},[k]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var xNe=k,ANe=Symbol.for("react.element"),INe=Symbol.for("react.fragment"),NNe=Object.prototype.hasOwnProperty,ONe=xNe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PNe={key:!0,ref:!0,__self:!0,__source:!0};function tme(n,t,i){var s,l={},d=null,u=null;i!==void 0&&(d=""+i),t.key!==void 0&&(d=""+t.key),t.ref!==void 0&&(u=t.ref);for(s in t)NNe.call(t,s)&&!PNe.hasOwnProperty(s)&&(l[s]=t[s]);if(n&&n.defaultProps)for(s in t=n.defaultProps,t)l[s]===void 0&&(l[s]=t[s]);return{$$typeof:ANe,type:n,key:d,ref:u,props:l,_owner:ONe.current}}Mj.Fragment=INe;Mj.jsx=tme;Mj.jsxs=tme;$pe.exports=Mj;var h=$pe.exports,bK={},nme={exports:{}},Zd={},ime={exports:{}},rme={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function t(fe,me){var Ne=fe.length;fe.push(me);e:for(;0<Ne;){var Fe=Ne-1>>>1,je=fe[Fe];if(0<l(je,me))fe[Fe]=me,fe[Ne]=je,Ne=Fe;else break e}}function i(fe){return fe.length===0?null:fe[0]}function s(fe){if(fe.length===0)return null;var me=fe[0],Ne=fe.pop();if(Ne!==me){fe[0]=Ne;e:for(var Fe=0,je=fe.length,Ve=je>>>1;Fe<Ve;){var Re=2*(Fe+1)-1,Be=fe[Re],Xe=Re+1,we=fe[Xe];if(0>l(Be,Ne))Xe<je&&0>l(we,Be)?(fe[Fe]=we,fe[Xe]=Ne,Fe=Xe):(fe[Fe]=Be,fe[Re]=Ne,Fe=Re);else if(Xe<je&&0>l(we,Ne))fe[Fe]=we,fe[Xe]=Ne,Fe=Xe;else break e}}return me}function l(fe,me){var Ne=fe.sortIndex-me.sortIndex;return Ne!==0?Ne:fe.id-me.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var u=Date,p=u.now();n.unstable_now=function(){return u.now()-p}}var g=[],_=[],y=1,E=null,b=3,A=!1,N=!1,O=!1,D=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(fe){for(var me=i(_);me!==null;){if(me.callback===null)s(_);else if(me.startTime<=fe)s(_),me.sortIndex=me.expirationTime,t(g,me);else break;me=i(_)}}function V(fe){if(O=!1,M(fe),!N)if(i(g)!==null)N=!0,he(H);else{var me=i(_);me!==null&&Ce(V,me.startTime-fe)}}function H(fe,me){N=!1,O&&(O=!1,P(Y),Y=-1),A=!0;var Ne=b;try{for(M(me),E=i(g);E!==null&&(!(E.expirationTime>me)||fe&&!te());){var Fe=E.callback;if(typeof Fe=="function"){E.callback=null,b=E.priorityLevel;var je=Fe(E.expirationTime<=me);me=n.unstable_now(),typeof je=="function"?E.callback=je:E===i(g)&&s(g),M(me)}else s(g);E=i(g)}if(E!==null)var Ve=!0;else{var Re=i(_);Re!==null&&Ce(V,Re.startTime-me),Ve=!1}return Ve}finally{E=null,b=Ne,A=!1}}var $=!1,Q=null,Y=-1,le=5,ae=-1;function te(){return!(n.unstable_now()-ae<le)}function de(){if(Q!==null){var fe=n.unstable_now();ae=fe;var me=!0;try{me=Q(!0,fe)}finally{me?G():($=!1,Q=null)}}else $=!1}var G;if(typeof j=="function")G=function(){j(de)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,_e=ie.port2;ie.port1.onmessage=de,G=function(){_e.postMessage(null)}}else G=function(){D(de,0)};function he(fe){Q=fe,$||($=!0,G())}function Ce(fe,me){Y=D(function(){fe(n.unstable_now())},me)}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(fe){fe.callback=null},n.unstable_continueExecution=function(){N||A||(N=!0,he(H))},n.unstable_forceFrameRate=function(fe){0>fe||125<fe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<fe?Math.floor(1e3/fe):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_getFirstCallbackNode=function(){return i(g)},n.unstable_next=function(fe){switch(b){case 1:case 2:case 3:var me=3;break;default:me=b}var Ne=b;b=me;try{return fe()}finally{b=Ne}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(fe,me){switch(fe){case 1:case 2:case 3:case 4:case 5:break;default:fe=3}var Ne=b;b=fe;try{return me()}finally{b=Ne}},n.unstable_scheduleCallback=function(fe,me,Ne){var Fe=n.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?Fe+Ne:Fe):Ne=Fe,fe){case 1:var je=-1;break;case 2:je=250;break;case 5:je=1073741823;break;case 4:je=1e4;break;default:je=5e3}return je=Ne+je,fe={id:y++,callback:me,priorityLevel:fe,startTime:Ne,expirationTime:je,sortIndex:-1},Ne>Fe?(fe.sortIndex=Ne,t(_,fe),i(g)===null&&fe===i(_)&&(O?(P(Y),Y=-1):O=!0,Ce(V,Ne-Fe))):(fe.sortIndex=je,t(g,fe),N||A||(N=!0,he(H))),fe},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(fe){var me=b;return function(){var Ne=b;b=me;try{return fe.apply(this,arguments)}finally{b=Ne}}}})(rme);ime.exports=rme;var LNe=ime.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var sme=k,Xd=LNe;function on(n){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+n,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+n+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ame=new Set,E4={};function kE(n,t){SR(n,t),SR(n+"Capture",t)}function SR(n,t){for(E4[n]=t,n=0;n<t.length;n++)ame.add(t[n])}var Ig=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),CK=Object.prototype.hasOwnProperty,DNe=/^[: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]*$/,ide={},rde={};function kNe(n){return CK.call(rde,n)?!0:CK.call(ide,n)?!1:DNe.test(n)?rde[n]=!0:(ide[n]=!0,!1)}function MNe(n,t,i,s){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:i!==null?!i.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function jNe(n,t,i,s){if(t===null||typeof t>"u"||MNe(n,t,i,s))return!0;if(s)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function dc(n,t,i,s,l,d,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=l,this.mustUseProperty=i,this.propertyName=n,this.type=t,this.sanitizeURL=d,this.removeEmptyString=u}var Yo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Yo[n]=new dc(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var t=n[0];Yo[t]=new dc(t,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Yo[n]=new dc(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Yo[n]=new dc(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Yo[n]=new dc(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Yo[n]=new dc(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Yo[n]=new dc(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Yo[n]=new dc(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Yo[n]=new dc(n,5,!1,n.toLowerCase(),null,!1,!1)});var XX=/[\-:]([a-z])/g;function JX(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var t=n.replace(XX,JX);Yo[t]=new dc(t,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var t=n.replace(XX,JX);Yo[t]=new dc(t,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var t=n.replace(XX,JX);Yo[t]=new dc(t,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Yo[n]=new dc(n,1,!1,n.toLowerCase(),null,!1,!1)});Yo.xlinkHref=new dc("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Yo[n]=new dc(n,1,!1,n.toLowerCase(),null,!0,!0)});function QX(n,t,i,s){var l=Yo.hasOwnProperty(t)?Yo[t]:null;(l!==null?l.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(jNe(t,i,l,s)&&(i=null),s||l===null?kNe(t)&&(i===null?n.removeAttribute(t):n.setAttribute(t,""+i)):l.mustUseProperty?n[l.propertyName]=i===null?l.type===3?!1:"":i:(t=l.attributeName,s=l.attributeNamespace,i===null?n.removeAttribute(t):(l=l.type,i=l===3||l===4&&i===!0?"":""+i,s?n.setAttributeNS(s,t,i):n.setAttribute(t,i))))}var Dg=sme.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,tk=Symbol.for("react.element"),Qb=Symbol.for("react.portal"),Zb=Symbol.for("react.fragment"),ZX=Symbol.for("react.strict_mode"),TK=Symbol.for("react.profiler"),ome=Symbol.for("react.provider"),lme=Symbol.for("react.context"),eJ=Symbol.for("react.forward_ref"),RK=Symbol.for("react.suspense"),xK=Symbol.for("react.suspense_list"),tJ=Symbol.for("react.memo"),i1=Symbol.for("react.lazy"),cme=Symbol.for("react.offscreen"),sde=Symbol.iterator;function sI(n){return n===null||typeof n!="object"?null:(n=sde&&n[sde]||n["@@iterator"],typeof n=="function"?n:null)}var Hs=Object.assign,ZW;function CI(n){if(ZW===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ZW=t&&t[1]||""}return`
`+ZW+n}var e$=!1;function t$(n,t){if(!n||e$)return"";e$=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(_){var s=_}Reflect.construct(n,[],t)}else{try{t.call()}catch(_){s=_}n.call(t.prototype)}else{try{throw Error()}catch(_){s=_}n()}}catch(_){if(_&&s&&typeof _.stack=="string"){for(var l=_.stack.split(`
`),d=s.stack.split(`
`),u=l.length-1,p=d.length-1;1<=u&&0<=p&&l[u]!==d[p];)p--;for(;1<=u&&0<=p;u--,p--)if(l[u]!==d[p]){if(u!==1||p!==1)do if(u--,p--,0>p||l[u]!==d[p]){var g=`
`+l[u].replace(" at new "," at ");return n.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",n.displayName)),g}while(1<=u&&0<=p);break}}}finally{e$=!1,Error.prepareStackTrace=i}return(n=n?n.displayName||n.name:"")?CI(n):""}function UNe(n){switch(n.tag){case 5:return CI(n.type);case 16:return CI("Lazy");case 13:return CI("Suspense");case 19:return CI("SuspenseList");case 0:case 2:case 15:return n=t$(n.type,!1),n;case 11:return n=t$(n.type.render,!1),n;case 1:return n=t$(n.type,!0),n;default:return""}}function AK(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case Zb:return"Fragment";case Qb:return"Portal";case TK:return"Profiler";case ZX:return"StrictMode";case RK:return"Suspense";case xK:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case lme:return(n.displayName||"Context")+".Consumer";case ome:return(n._context.displayName||"Context")+".Provider";case eJ:var t=n.render;return n=n.displayName,n||(n=t.displayName||t.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case tJ:return t=n.displayName||null,t!==null?t:AK(n.type)||"Memo";case i1:t=n._payload,n=n._init;try{return AK(n(t))}catch{}}return null}function FNe(n){var t=n.type;switch(n.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=t.render,n=n.displayName||n.name||"",t.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return AK(t);case 8:return t===ZX?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Nv(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function dme(n){var t=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BNe(n){var t=dme(n)?"checked":"value",i=Object.getOwnPropertyDescriptor(n.constructor.prototype,t),s=""+n[t];if(!n.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var l=i.get,d=i.set;return Object.defineProperty(n,t,{configurable:!0,get:function(){return l.call(this)},set:function(u){s=""+u,d.call(this,u)}}),Object.defineProperty(n,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(u){s=""+u},stopTracking:function(){n._valueTracker=null,delete n[t]}}}}function nk(n){n._valueTracker||(n._valueTracker=BNe(n))}function ume(n){if(!n)return!1;var t=n._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return n&&(s=dme(n)?n.checked?"true":"false":n.value),n=s,n!==i?(t.setValue(n),!0):!1}function jM(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function IK(n,t){var i=t.checked;return Hs({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??n._wrapperState.initialChecked})}function ade(n,t){var i=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;i=Nv(t.value!=null?t.value:i),n._wrapperState={initialChecked:s,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function hme(n,t){t=t.checked,t!=null&&QX(n,"checked",t,!1)}function NK(n,t){hme(n,t);var i=Nv(t.value),s=t.type;if(i!=null)s==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+i):n.value!==""+i&&(n.value=""+i);else if(s==="submit"||s==="reset"){n.removeAttribute("value");return}t.hasOwnProperty("value")?OK(n,t.type,i):t.hasOwnProperty("defaultValue")&&OK(n,t.type,Nv(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(n.defaultChecked=!!t.defaultChecked)}function ode(n,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+n._wrapperState.initialValue,i||t===n.value||(n.value=t),n.defaultValue=t}i=n.name,i!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,i!==""&&(n.name=i)}function OK(n,t,i){(t!=="number"||jM(n.ownerDocument)!==n)&&(i==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+i&&(n.defaultValue=""+i))}var TI=Array.isArray;function gC(n,t,i,s){if(n=n.options,t){t={};for(var l=0;l<i.length;l++)t["$"+i[l]]=!0;for(i=0;i<n.length;i++)l=t.hasOwnProperty("$"+n[i].value),n[i].selected!==l&&(n[i].selected=l),l&&s&&(n[i].defaultSelected=!0)}else{for(i=""+Nv(i),t=null,l=0;l<n.length;l++){if(n[l].value===i){n[l].selected=!0,s&&(n[l].defaultSelected=!0);return}t!==null||n[l].disabled||(t=n[l])}t!==null&&(t.selected=!0)}}function PK(n,t){if(t.dangerouslySetInnerHTML!=null)throw Error(on(91));return Hs({},t,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function lde(n,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(on(92));if(TI(i)){if(1<i.length)throw Error(on(93));i=i[0]}t=i}t==null&&(t=""),i=t}n._wrapperState={initialValue:Nv(i)}}function fme(n,t){var i=Nv(t.value),s=Nv(t.defaultValue);i!=null&&(i=""+i,i!==n.value&&(n.value=i),t.defaultValue==null&&n.defaultValue!==i&&(n.defaultValue=i)),s!=null&&(n.defaultValue=""+s)}function cde(n){var t=n.textContent;t===n._wrapperState.initialValue&&t!==""&&t!==null&&(n.value=t)}function pme(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function LK(n,t){return n==null||n==="http://www.w3.org/1999/xhtml"?pme(t):n==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var ik,mme=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,i,s,l){MSApp.execUnsafeLocalFunction(function(){return n(t,i,s,l)})}:n}(function(n,t){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=t;else{for(ik=ik||document.createElement("div"),ik.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ik.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;t.firstChild;)n.appendChild(t.firstChild)}});function w4(n,t){if(t){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=t;return}}n.textContent=t}var r4={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},VNe=["Webkit","ms","Moz","O"];Object.keys(r4).forEach(function(n){VNe.forEach(function(t){t=t+n.charAt(0).toUpperCase()+n.substring(1),r4[t]=r4[n]})});function gme(n,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||r4.hasOwnProperty(n)&&r4[n]?(""+t).trim():t+"px"}function vme(n,t){n=n.style;for(var i in t)if(t.hasOwnProperty(i)){var s=i.indexOf("--")===0,l=gme(i,t[i],s);i==="float"&&(i="cssFloat"),s?n.setProperty(i,l):n[i]=l}}var zNe=Hs({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function DK(n,t){if(t){if(zNe[n]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(on(137,n));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(on(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(on(61))}if(t.style!=null&&typeof t.style!="object")throw Error(on(62))}}function kK(n,t){if(n.indexOf("-")===-1)return typeof t.is=="string";switch(n){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 MK=null;function nJ(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var jK=null,vC=null,yC=null;function dde(n){if(n=jO(n)){if(typeof jK!="function")throw Error(on(280));var t=n.stateNode;t&&(t=Vj(t),jK(n.stateNode,n.type,t))}}function yme(n){vC?yC?yC.push(n):yC=[n]:vC=n}function _me(){if(vC){var n=vC,t=yC;if(yC=vC=null,dde(n),t)for(n=0;n<t.length;n++)dde(t[n])}}function Eme(n,t){return n(t)}function wme(){}var n$=!1;function Sme(n,t,i){if(n$)return n(t,i);n$=!0;try{return Eme(n,t,i)}finally{n$=!1,(vC!==null||yC!==null)&&(wme(),_me())}}function S4(n,t){var i=n.stateNode;if(i===null)return null;var s=Vj(i);if(s===null)return null;i=s[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":(s=!s.disabled)||(n=n.type,s=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!s;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(on(231,t,typeof i));return i}var UK=!1;if(Ig)try{var aI={};Object.defineProperty(aI,"passive",{get:function(){UK=!0}}),window.addEventListener("test",aI,aI),window.removeEventListener("test",aI,aI)}catch{UK=!1}function HNe(n,t,i,s,l,d,u,p,g){var _=Array.prototype.slice.call(arguments,3);try{t.apply(i,_)}catch(y){this.onError(y)}}var s4=!1,UM=null,FM=!1,FK=null,GNe={onError:function(n){s4=!0,UM=n}};function WNe(n,t,i,s,l,d,u,p,g){s4=!1,UM=null,HNe.apply(GNe,arguments)}function $Ne(n,t,i,s,l,d,u,p,g){if(WNe.apply(this,arguments),s4){if(s4){var _=UM;s4=!1,UM=null}else throw Error(on(198));FM||(FM=!0,FK=_)}}function ME(n){var t=n,i=n;if(n.alternate)for(;t.return;)t=t.return;else{n=t;do t=n,t.flags&4098&&(i=t.return),n=t.return;while(n)}return t.tag===3?i:null}function bme(n){if(n.tag===13){var t=n.memoizedState;if(t===null&&(n=n.alternate,n!==null&&(t=n.memoizedState)),t!==null)return t.dehydrated}return null}function ude(n){if(ME(n)!==n)throw Error(on(188))}function KNe(n){var t=n.alternate;if(!t){if(t=ME(n),t===null)throw Error(on(188));return t!==n?null:n}for(var i=n,s=t;;){var l=i.return;if(l===null)break;var d=l.alternate;if(d===null){if(s=l.return,s!==null){i=s;continue}break}if(l.child===d.child){for(d=l.child;d;){if(d===i)return ude(l),n;if(d===s)return ude(l),t;d=d.sibling}throw Error(on(188))}if(i.return!==s.return)i=l,s=d;else{for(var u=!1,p=l.child;p;){if(p===i){u=!0,i=l,s=d;break}if(p===s){u=!0,s=l,i=d;break}p=p.sibling}if(!u){for(p=d.child;p;){if(p===i){u=!0,i=d,s=l;break}if(p===s){u=!0,s=d,i=l;break}p=p.sibling}if(!u)throw Error(on(189))}}if(i.alternate!==s)throw Error(on(190))}if(i.tag!==3)throw Error(on(188));return i.stateNode.current===i?n:t}function Cme(n){return n=KNe(n),n!==null?Tme(n):null}function Tme(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var t=Tme(n);if(t!==null)return t;n=n.sibling}return null}var Rme=Xd.unstable_scheduleCallback,hde=Xd.unstable_cancelCallback,qNe=Xd.unstable_shouldYield,YNe=Xd.unstable_requestPaint,fa=Xd.unstable_now,XNe=Xd.unstable_getCurrentPriorityLevel,iJ=Xd.unstable_ImmediatePriority,xme=Xd.unstable_UserBlockingPriority,BM=Xd.unstable_NormalPriority,JNe=Xd.unstable_LowPriority,Ame=Xd.unstable_IdlePriority,jj=null,Dp=null;function QNe(n){if(Dp&&typeof Dp.onCommitFiberRoot=="function")try{Dp.onCommitFiberRoot(jj,n,void 0,(n.current.flags&128)===128)}catch{}}var of=Math.clz32?Math.clz32:t5e,ZNe=Math.log,e5e=Math.LN2;function t5e(n){return n>>>=0,n===0?32:31-(ZNe(n)/e5e|0)|0}var rk=64,sk=4194304;function RI(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function VM(n,t){var i=n.pendingLanes;if(i===0)return 0;var s=0,l=n.suspendedLanes,d=n.pingedLanes,u=i&268435455;if(u!==0){var p=u&~l;p!==0?s=RI(p):(d&=u,d!==0&&(s=RI(d)))}else u=i&~l,u!==0?s=RI(u):d!==0&&(s=RI(d));if(s===0)return 0;if(t!==0&&t!==s&&!(t&l)&&(l=s&-s,d=t&-t,l>=d||l===16&&(d&4194240)!==0))return t;if(s&4&&(s|=i&16),t=n.entangledLanes,t!==0)for(n=n.entanglements,t&=s;0<t;)i=31-of(t),l=1<<i,s|=n[i],t&=~l;return s}function n5e(n,t){switch(n){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function i5e(n,t){for(var i=n.suspendedLanes,s=n.pingedLanes,l=n.expirationTimes,d=n.pendingLanes;0<d;){var u=31-of(d),p=1<<u,g=l[u];g===-1?(!(p&i)||p&s)&&(l[u]=n5e(p,t)):g<=t&&(n.expiredLanes|=p),d&=~p}}function BK(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Ime(){var n=rk;return rk<<=1,!(rk&4194240)&&(rk=64),n}function i$(n){for(var t=[],i=0;31>i;i++)t.push(n);return t}function kO(n,t,i){n.pendingLanes|=t,t!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,t=31-of(t),n[t]=i}function r5e(n,t){var i=n.pendingLanes&~t;n.pendingLanes=t,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=t,n.mutableReadLanes&=t,n.entangledLanes&=t,t=n.entanglements;var s=n.eventTimes;for(n=n.expirationTimes;0<i;){var l=31-of(i),d=1<<l;t[l]=0,s[l]=-1,n[l]=-1,i&=~d}}function rJ(n,t){var i=n.entangledLanes|=t;for(n=n.entanglements;i;){var s=31-of(i),l=1<<s;l&t|n[s]&t&&(n[s]|=t),i&=~l}}var Vr=0;function Nme(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var Ome,sJ,Pme,Lme,Dme,VK=!1,ak=[],yv=null,_v=null,Ev=null,b4=new Map,C4=new Map,o1=[],s5e="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fde(n,t){switch(n){case"focusin":case"focusout":yv=null;break;case"dragenter":case"dragleave":_v=null;break;case"mouseover":case"mouseout":Ev=null;break;case"pointerover":case"pointerout":b4.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":C4.delete(t.pointerId)}}function oI(n,t,i,s,l,d){return n===null||n.nativeEvent!==d?(n={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:d,targetContainers:[l]},t!==null&&(t=jO(t),t!==null&&sJ(t)),n):(n.eventSystemFlags|=s,t=n.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),n)}function a5e(n,t,i,s,l){switch(t){case"focusin":return yv=oI(yv,n,t,i,s,l),!0;case"dragenter":return _v=oI(_v,n,t,i,s,l),!0;case"mouseover":return Ev=oI(Ev,n,t,i,s,l),!0;case"pointerover":var d=l.pointerId;return b4.set(d,oI(b4.get(d)||null,n,t,i,s,l)),!0;case"gotpointercapture":return d=l.pointerId,C4.set(d,oI(C4.get(d)||null,n,t,i,s,l)),!0}return!1}function kme(n){var t=N_(n.target);if(t!==null){var i=ME(t);if(i!==null){if(t=i.tag,t===13){if(t=bme(i),t!==null){n.blockedOn=t,Dme(n.priority,function(){Pme(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Mk(n){if(n.blockedOn!==null)return!1;for(var t=n.targetContainers;0<t.length;){var i=zK(n.domEventName,n.eventSystemFlags,t[0],n.nativeEvent);if(i===null){i=n.nativeEvent;var s=new i.constructor(i.type,i);MK=s,i.target.dispatchEvent(s),MK=null}else return t=jO(i),t!==null&&sJ(t),n.blockedOn=i,!1;t.shift()}return!0}function pde(n,t,i){Mk(n)&&i.delete(t)}function o5e(){VK=!1,yv!==null&&Mk(yv)&&(yv=null),_v!==null&&Mk(_v)&&(_v=null),Ev!==null&&Mk(Ev)&&(Ev=null),b4.forEach(pde),C4.forEach(pde)}function lI(n,t){n.blockedOn===t&&(n.blockedOn=null,VK||(VK=!0,Xd.unstable_scheduleCallback(Xd.unstable_NormalPriority,o5e)))}function T4(n){function t(l){return lI(l,n)}if(0<ak.length){lI(ak[0],n);for(var i=1;i<ak.length;i++){var s=ak[i];s.blockedOn===n&&(s.blockedOn=null)}}for(yv!==null&&lI(yv,n),_v!==null&&lI(_v,n),Ev!==null&&lI(Ev,n),b4.forEach(t),C4.forEach(t),i=0;i<o1.length;i++)s=o1[i],s.blockedOn===n&&(s.blockedOn=null);for(;0<o1.length&&(i=o1[0],i.blockedOn===null);)kme(i),i.blockedOn===null&&o1.shift()}var _C=Dg.ReactCurrentBatchConfig,zM=!0;function l5e(n,t,i,s){var l=Vr,d=_C.transition;_C.transition=null;try{Vr=1,aJ(n,t,i,s)}finally{Vr=l,_C.transition=d}}function c5e(n,t,i,s){var l=Vr,d=_C.transition;_C.transition=null;try{Vr=4,aJ(n,t,i,s)}finally{Vr=l,_C.transition=d}}function aJ(n,t,i,s){if(zM){var l=zK(n,t,i,s);if(l===null)f$(n,t,s,HM,i),fde(n,s);else if(a5e(l,n,t,i,s))s.stopPropagation();else if(fde(n,s),t&4&&-1<s5e.indexOf(n)){for(;l!==null;){var d=jO(l);if(d!==null&&Ome(d),d=zK(n,t,i,s),d===null&&f$(n,t,s,HM,i),d===l)break;l=d}l!==null&&s.stopPropagation()}else f$(n,t,s,null,i)}}var HM=null;function zK(n,t,i,s){if(HM=null,n=nJ(s),n=N_(n),n!==null)if(t=ME(n),t===null)n=null;else if(i=t.tag,i===13){if(n=bme(t),n!==null)return n;n=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;n=null}else t!==n&&(n=null);return HM=n,null}function Mme(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(XNe()){case iJ:return 1;case xme:return 4;case BM:case JNe:return 16;case Ame:return 536870912;default:return 16}default:return 16}}var uv=null,oJ=null,jk=null;function jme(){if(jk)return jk;var n,t=oJ,i=t.length,s,l="value"in uv?uv.value:uv.textContent,d=l.length;for(n=0;n<i&&t[n]===l[n];n++);var u=i-n;for(s=1;s<=u&&t[i-s]===l[d-s];s++);return jk=l.slice(n,1<s?1-s:void 0)}function Uk(n){var t=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&t===13&&(n=13)):n=t,n===10&&(n=13),32<=n||n===13?n:0}function ok(){return!0}function mde(){return!1}function eu(n){function t(i,s,l,d,u){this._reactName=i,this._targetInst=l,this.type=s,this.nativeEvent=d,this.target=u,this.currentTarget=null;for(var p in n)n.hasOwnProperty(p)&&(i=n[p],this[p]=i?i(d):d[p]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?ok:mde,this.isPropagationStopped=mde,this}return Hs(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ok)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ok)},persist:function(){},isPersistent:ok}),t}var zR={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lJ=eu(zR),MO=Hs({},zR,{view:0,detail:0}),d5e=eu(MO),r$,s$,cI,Uj=Hs({},MO,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cJ,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==cI&&(cI&&n.type==="mousemove"?(r$=n.screenX-cI.screenX,s$=n.screenY-cI.screenY):s$=r$=0,cI=n),r$)},movementY:function(n){return"movementY"in n?n.movementY:s$}}),gde=eu(Uj),u5e=Hs({},Uj,{dataTransfer:0}),h5e=eu(u5e),f5e=Hs({},MO,{relatedTarget:0}),a$=eu(f5e),p5e=Hs({},zR,{animationName:0,elapsedTime:0,pseudoElement:0}),m5e=eu(p5e),g5e=Hs({},zR,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),v5e=eu(g5e),y5e=Hs({},zR,{data:0}),vde=eu(y5e),_5e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},E5e={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"},w5e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S5e(n){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(n):(n=w5e[n])?!!t[n]:!1}function cJ(){return S5e}var b5e=Hs({},MO,{key:function(n){if(n.key){var t=_5e[n.key]||n.key;if(t!=="Unidentified")return t}return n.type==="keypress"?(n=Uk(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?E5e[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cJ,charCode:function(n){return n.type==="keypress"?Uk(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Uk(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),C5e=eu(b5e),T5e=Hs({},Uj,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yde=eu(T5e),R5e=Hs({},MO,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cJ}),x5e=eu(R5e),A5e=Hs({},zR,{propertyName:0,elapsedTime:0,pseudoElement:0}),I5e=eu(A5e),N5e=Hs({},Uj,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),O5e=eu(N5e),P5e=[9,13,27,32],dJ=Ig&&"CompositionEvent"in window,a4=null;Ig&&"documentMode"in document&&(a4=document.documentMode);var L5e=Ig&&"TextEvent"in window&&!a4,Ume=Ig&&(!dJ||a4&&8<a4&&11>=a4),_de=" ",Ede=!1;function Fme(n,t){switch(n){case"keyup":return P5e.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bme(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var eC=!1;function D5e(n,t){switch(n){case"compositionend":return Bme(t);case"keypress":return t.which!==32?null:(Ede=!0,_de);case"textInput":return n=t.data,n===_de&&Ede?null:n;default:return null}}function k5e(n,t){if(eC)return n==="compositionend"||!dJ&&Fme(n,t)?(n=jme(),jk=oJ=uv=null,eC=!1,n):null;switch(n){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 Ume&&t.locale!=="ko"?null:t.data;default:return null}}var M5e={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 wde(n){var t=n&&n.nodeName&&n.nodeName.toLowerCase();return t==="input"?!!M5e[n.type]:t==="textarea"}function Vme(n,t,i,s){yme(s),t=GM(t,"onChange"),0<t.length&&(i=new lJ("onChange","change",null,i,s),n.push({event:i,listeners:t}))}var o4=null,R4=null;function j5e(n){Qme(n,0)}function Fj(n){var t=iC(n);if(ume(t))return n}function U5e(n,t){if(n==="change")return t}var zme=!1;if(Ig){var o$;if(Ig){var l$="oninput"in document;if(!l$){var Sde=document.createElement("div");Sde.setAttribute("oninput","return;"),l$=typeof Sde.oninput=="function"}o$=l$}else o$=!1;zme=o$&&(!document.documentMode||9<document.documentMode)}function bde(){o4&&(o4.detachEvent("onpropertychange",Hme),R4=o4=null)}function Hme(n){if(n.propertyName==="value"&&Fj(R4)){var t=[];Vme(t,R4,n,nJ(n)),Sme(j5e,t)}}function F5e(n,t,i){n==="focusin"?(bde(),o4=t,R4=i,o4.attachEvent("onpropertychange",Hme)):n==="focusout"&&bde()}function B5e(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Fj(R4)}function V5e(n,t){if(n==="click")return Fj(t)}function z5e(n,t){if(n==="input"||n==="change")return Fj(t)}function H5e(n,t){return n===t&&(n!==0||1/n===1/t)||n!==n&&t!==t}var uf=typeof Object.is=="function"?Object.is:H5e;function x4(n,t){if(uf(n,t))return!0;if(typeof n!="object"||n===null||typeof t!="object"||t===null)return!1;var i=Object.keys(n),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var l=i[s];if(!CK.call(t,l)||!uf(n[l],t[l]))return!1}return!0}function Cde(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Tde(n,t){var i=Cde(n);n=0;for(var s;i;){if(i.nodeType===3){if(s=n+i.textContent.length,n<=t&&s>=t)return{node:i,offset:t-n};n=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Cde(i)}}function Gme(n,t){return n&&t?n===t?!0:n&&n.nodeType===3?!1:t&&t.nodeType===3?Gme(n,t.parentNode):"contains"in n?n.contains(t):n.compareDocumentPosition?!!(n.compareDocumentPosition(t)&16):!1:!1}function Wme(){for(var n=window,t=jM();t instanceof n.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)n=t.contentWindow;else break;t=jM(n.document)}return t}function uJ(n){var t=n&&n.nodeName&&n.nodeName.toLowerCase();return t&&(t==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||t==="textarea"||n.contentEditable==="true")}function G5e(n){var t=Wme(),i=n.focusedElem,s=n.selectionRange;if(t!==i&&i&&i.ownerDocument&&Gme(i.ownerDocument.documentElement,i)){if(s!==null&&uJ(i)){if(t=s.start,n=s.end,n===void 0&&(n=t),"selectionStart"in i)i.selectionStart=t,i.selectionEnd=Math.min(n,i.value.length);else if(n=(t=i.ownerDocument||document)&&t.defaultView||window,n.getSelection){n=n.getSelection();var l=i.textContent.length,d=Math.min(s.start,l);s=s.end===void 0?d:Math.min(s.end,l),!n.extend&&d>s&&(l=s,s=d,d=l),l=Tde(i,d);var u=Tde(i,s);l&&u&&(n.rangeCount!==1||n.anchorNode!==l.node||n.anchorOffset!==l.offset||n.focusNode!==u.node||n.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),n.removeAllRanges(),d>s?(n.addRange(t),n.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),n.addRange(t)))}}for(t=[],n=i;n=n.parentNode;)n.nodeType===1&&t.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<t.length;i++)n=t[i],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var W5e=Ig&&"documentMode"in document&&11>=document.documentMode,tC=null,HK=null,l4=null,GK=!1;function Rde(n,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;GK||tC==null||tC!==jM(s)||(s=tC,"selectionStart"in s&&uJ(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),l4&&x4(l4,s)||(l4=s,s=GM(HK,"onSelect"),0<s.length&&(t=new lJ("onSelect","select",null,t,i),n.push({event:t,listeners:s}),t.target=tC)))}function lk(n,t){var i={};return i[n.toLowerCase()]=t.toLowerCase(),i["Webkit"+n]="webkit"+t,i["Moz"+n]="moz"+t,i}var nC={animationend:lk("Animation","AnimationEnd"),animationiteration:lk("Animation","AnimationIteration"),animationstart:lk("Animation","AnimationStart"),transitionend:lk("Transition","TransitionEnd")},c$={},$me={};Ig&&($me=document.createElement("div").style,"AnimationEvent"in window||(delete nC.animationend.animation,delete nC.animationiteration.animation,delete nC.animationstart.animation),"TransitionEvent"in window||delete nC.transitionend.transition);function Bj(n){if(c$[n])return c$[n];if(!nC[n])return n;var t=nC[n],i;for(i in t)if(t.hasOwnProperty(i)&&i in $me)return c$[n]=t[i];return n}var Kme=Bj("animationend"),qme=Bj("animationiteration"),Yme=Bj("animationstart"),Xme=Bj("transitionend"),Jme=new Map,xde="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function jv(n,t){Jme.set(n,t),kE(t,[n])}for(var d$=0;d$<xde.length;d$++){var u$=xde[d$],$5e=u$.toLowerCase(),K5e=u$[0].toUpperCase()+u$.slice(1);jv($5e,"on"+K5e)}jv(Kme,"onAnimationEnd");jv(qme,"onAnimationIteration");jv(Yme,"onAnimationStart");jv("dblclick","onDoubleClick");jv("focusin","onFocus");jv("focusout","onBlur");jv(Xme,"onTransitionEnd");SR("onMouseEnter",["mouseout","mouseover"]);SR("onMouseLeave",["mouseout","mouseover"]);SR("onPointerEnter",["pointerout","pointerover"]);SR("onPointerLeave",["pointerout","pointerover"]);kE("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));kE("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));kE("onBeforeInput",["compositionend","keypress","textInput","paste"]);kE("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));kE("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));kE("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xI="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(" "),q5e=new Set("cancel close invalid load scroll toggle".split(" ").concat(xI));function Ade(n,t,i){var s=n.type||"unknown-event";n.currentTarget=i,$Ne(s,t,void 0,n),n.currentTarget=null}function Qme(n,t){t=(t&4)!==0;for(var i=0;i<n.length;i++){var s=n[i],l=s.event;s=s.listeners;e:{var d=void 0;if(t)for(var u=s.length-1;0<=u;u--){var p=s[u],g=p.instance,_=p.currentTarget;if(p=p.listener,g!==d&&l.isPropagationStopped())break e;Ade(l,p,_),d=g}else for(u=0;u<s.length;u++){if(p=s[u],g=p.instance,_=p.currentTarget,p=p.listener,g!==d&&l.isPropagationStopped())break e;Ade(l,p,_),d=g}}}if(FM)throw n=FK,FM=!1,FK=null,n}function Es(n,t){var i=t[YK];i===void 0&&(i=t[YK]=new Set);var s=n+"__bubble";i.has(s)||(Zme(t,n,2,!1),i.add(s))}function h$(n,t,i){var s=0;t&&(s|=4),Zme(i,n,s,t)}var ck="_reactListening"+Math.random().toString(36).slice(2);function A4(n){if(!n[ck]){n[ck]=!0,ame.forEach(function(i){i!=="selectionchange"&&(q5e.has(i)||h$(i,!1,n),h$(i,!0,n))});var t=n.nodeType===9?n:n.ownerDocument;t===null||t[ck]||(t[ck]=!0,h$("selectionchange",!1,t))}}function Zme(n,t,i,s){switch(Mme(t)){case 1:var l=l5e;break;case 4:l=c5e;break;default:l=aJ}i=l.bind(null,t,i,n),l=void 0,!UK||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),s?l!==void 0?n.addEventListener(t,i,{capture:!0,passive:l}):n.addEventListener(t,i,!0):l!==void 0?n.addEventListener(t,i,{passive:l}):n.addEventListener(t,i,!1)}function f$(n,t,i,s,l){var d=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var u=s.tag;if(u===3||u===4){var p=s.stateNode.containerInfo;if(p===l||p.nodeType===8&&p.parentNode===l)break;if(u===4)for(u=s.return;u!==null;){var g=u.tag;if((g===3||g===4)&&(g=u.stateNode.containerInfo,g===l||g.nodeType===8&&g.parentNode===l))return;u=u.return}for(;p!==null;){if(u=N_(p),u===null)return;if(g=u.tag,g===5||g===6){s=d=u;continue e}p=p.parentNode}}s=s.return}Sme(function(){var _=d,y=nJ(i),E=[];e:{var b=Jme.get(n);if(b!==void 0){var A=lJ,N=n;switch(n){case"keypress":if(Uk(i)===0)break e;case"keydown":case"keyup":A=C5e;break;case"focusin":N="focus",A=a$;break;case"focusout":N="blur",A=a$;break;case"beforeblur":case"afterblur":A=a$;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":A=gde;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":A=h5e;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":A=x5e;break;case Kme:case qme:case Yme:A=m5e;break;case Xme:A=I5e;break;case"scroll":A=d5e;break;case"wheel":A=O5e;break;case"copy":case"cut":case"paste":A=v5e;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":A=yde}var O=(t&4)!==0,D=!O&&n==="scroll",P=O?b!==null?b+"Capture":null:b;O=[];for(var j=_,M;j!==null;){M=j;var V=M.stateNode;if(M.tag===5&&V!==null&&(M=V,P!==null&&(V=S4(j,P),V!=null&&O.push(I4(j,V,M)))),D)break;j=j.return}0<O.length&&(b=new A(b,N,null,i,y),E.push({event:b,listeners:O}))}}if(!(t&7)){e:{if(b=n==="mouseover"||n==="pointerover",A=n==="mouseout"||n==="pointerout",b&&i!==MK&&(N=i.relatedTarget||i.fromElement)&&(N_(N)||N[Ng]))break e;if((A||b)&&(b=y.window===y?y:(b=y.ownerDocument)?b.defaultView||b.parentWindow:window,A?(N=i.relatedTarget||i.toElement,A=_,N=N?N_(N):null,N!==null&&(D=ME(N),N!==D||N.tag!==5&&N.tag!==6)&&(N=null)):(A=null,N=_),A!==N)){if(O=gde,V="onMouseLeave",P="onMouseEnter",j="mouse",(n==="pointerout"||n==="pointerover")&&(O=yde,V="onPointerLeave",P="onPointerEnter",j="pointer"),D=A==null?b:iC(A),M=N==null?b:iC(N),b=new O(V,j+"leave",A,i,y),b.target=D,b.relatedTarget=M,V=null,N_(y)===_&&(O=new O(P,j+"enter",N,i,y),O.target=M,O.relatedTarget=D,V=O),D=V,A&&N)t:{for(O=A,P=N,j=0,M=O;M;M=Rb(M))j++;for(M=0,V=P;V;V=Rb(V))M++;for(;0<j-M;)O=Rb(O),j--;for(;0<M-j;)P=Rb(P),M--;for(;j--;){if(O===P||P!==null&&O===P.alternate)break t;O=Rb(O),P=Rb(P)}O=null}else O=null;A!==null&&Ide(E,b,A,O,!1),N!==null&&D!==null&&Ide(E,D,N,O,!0)}}e:{if(b=_?iC(_):window,A=b.nodeName&&b.nodeName.toLowerCase(),A==="select"||A==="input"&&b.type==="file")var H=U5e;else if(wde(b))if(zme)H=z5e;else{H=B5e;var $=F5e}else(A=b.nodeName)&&A.toLowerCase()==="input"&&(b.type==="checkbox"||b.type==="radio")&&(H=V5e);if(H&&(H=H(n,_))){Vme(E,H,i,y);break e}$&&$(n,b,_),n==="focusout"&&($=b._wrapperState)&&$.controlled&&b.type==="number"&&OK(b,"number",b.value)}switch($=_?iC(_):window,n){case"focusin":(wde($)||$.contentEditable==="true")&&(tC=$,HK=_,l4=null);break;case"focusout":l4=HK=tC=null;break;case"mousedown":GK=!0;break;case"contextmenu":case"mouseup":case"dragend":GK=!1,Rde(E,i,y);break;case"selectionchange":if(W5e)break;case"keydown":case"keyup":Rde(E,i,y)}var Q;if(dJ)e:{switch(n){case"compositionstart":var Y="onCompositionStart";break e;case"compositionend":Y="onCompositionEnd";break e;case"compositionupdate":Y="onCompositionUpdate";break e}Y=void 0}else eC?Fme(n,i)&&(Y="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Y="onCompositionStart");Y&&(Ume&&i.locale!=="ko"&&(eC||Y!=="onCompositionStart"?Y==="onCompositionEnd"&&eC&&(Q=jme()):(uv=y,oJ="value"in uv?uv.value:uv.textContent,eC=!0)),$=GM(_,Y),0<$.length&&(Y=new vde(Y,n,null,i,y),E.push({event:Y,listeners:$}),Q?Y.data=Q:(Q=Bme(i),Q!==null&&(Y.data=Q)))),(Q=L5e?D5e(n,i):k5e(n,i))&&(_=GM(_,"onBeforeInput"),0<_.length&&(y=new vde("onBeforeInput","beforeinput",null,i,y),E.push({event:y,listeners:_}),y.data=Q))}Qme(E,t)})}function I4(n,t,i){return{instance:n,listener:t,currentTarget:i}}function GM(n,t){for(var i=t+"Capture",s=[];n!==null;){var l=n,d=l.stateNode;l.tag===5&&d!==null&&(l=d,d=S4(n,i),d!=null&&s.unshift(I4(n,d,l)),d=S4(n,t),d!=null&&s.push(I4(n,d,l))),n=n.return}return s}function Rb(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Ide(n,t,i,s,l){for(var d=t._reactName,u=[];i!==null&&i!==s;){var p=i,g=p.alternate,_=p.stateNode;if(g!==null&&g===s)break;p.tag===5&&_!==null&&(p=_,l?(g=S4(i,d),g!=null&&u.unshift(I4(i,g,p))):l||(g=S4(i,d),g!=null&&u.push(I4(i,g,p)))),i=i.return}u.length!==0&&n.push({event:t,listeners:u})}var Y5e=/\r\n?/g,X5e=/\u0000|\uFFFD/g;function Nde(n){return(typeof n=="string"?n:""+n).replace(Y5e,`
`).replace(X5e,"")}function dk(n,t,i){if(t=Nde(t),Nde(n)!==t&&i)throw Error(on(425))}function WM(){}var WK=null,$K=null;function KK(n,t){return n==="textarea"||n==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qK=typeof setTimeout=="function"?setTimeout:void 0,J5e=typeof clearTimeout=="function"?clearTimeout:void 0,Ode=typeof Promise=="function"?Promise:void 0,Q5e=typeof queueMicrotask=="function"?queueMicrotask:typeof Ode<"u"?function(n){return Ode.resolve(null).then(n).catch(Z5e)}:qK;function Z5e(n){setTimeout(function(){throw n})}function p$(n,t){var i=t,s=0;do{var l=i.nextSibling;if(n.removeChild(i),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(s===0){n.removeChild(l),T4(t);return}s--}else i!=="$"&&i!=="$?"&&i!=="$!"||s++;i=l}while(i);T4(t)}function wv(n){for(;n!=null;n=n.nextSibling){var t=n.nodeType;if(t===1||t===3)break;if(t===8){if(t=n.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return n}function Pde(n){n=n.previousSibling;for(var t=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"){if(t===0)return n;t--}else i==="/$"&&t++}n=n.previousSibling}return null}var HR=Math.random().toString(36).slice(2),Np="__reactFiber$"+HR,N4="__reactProps$"+HR,Ng="__reactContainer$"+HR,YK="__reactEvents$"+HR,eOe="__reactListeners$"+HR,tOe="__reactHandles$"+HR;function N_(n){var t=n[Np];if(t)return t;for(var i=n.parentNode;i;){if(t=i[Ng]||i[Np]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(n=Pde(n);n!==null;){if(i=n[Np])return i;n=Pde(n)}return t}n=i,i=n.parentNode}return null}function jO(n){return n=n[Np]||n[Ng],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function iC(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(on(33))}function Vj(n){return n[N4]||null}var XK=[],rC=-1;function Uv(n){return{current:n}}function Ss(n){0>rC||(n.current=XK[rC],XK[rC]=null,rC--)}function cs(n,t){rC++,XK[rC]=n.current,n.current=t}var Ov={},wl=Uv(Ov),ed=Uv(!1),_E=Ov;function bR(n,t){var i=n.type.contextTypes;if(!i)return Ov;var s=n.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var l={},d;for(d in i)l[d]=t[d];return s&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=t,n.__reactInternalMemoizedMaskedChildContext=l),l}function td(n){return n=n.childContextTypes,n!=null}function $M(){Ss(ed),Ss(wl)}function Lde(n,t,i){if(wl.current!==Ov)throw Error(on(168));cs(wl,t),cs(ed,i)}function ege(n,t,i){var s=n.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return i;s=s.getChildContext();for(var l in s)if(!(l in t))throw Error(on(108,FNe(n)||"Unknown",l));return Hs({},i,s)}function KM(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Ov,_E=wl.current,cs(wl,n),cs(ed,ed.current),!0}function Dde(n,t,i){var s=n.stateNode;if(!s)throw Error(on(169));i?(n=ege(n,t,_E),s.__reactInternalMemoizedMergedChildContext=n,Ss(ed),Ss(wl),cs(wl,n)):Ss(ed),cs(ed,i)}var Mm=null,zj=!1,m$=!1;function tge(n){Mm===null?Mm=[n]:Mm.push(n)}function nOe(n){zj=!0,tge(n)}function Fv(){if(!m$&&Mm!==null){m$=!0;var n=0,t=Vr;try{var i=Mm;for(Vr=1;n<i.length;n++){var s=i[n];do s=s(!0);while(s!==null)}Mm=null,zj=!1}catch(l){throw Mm!==null&&(Mm=Mm.slice(n+1)),Rme(iJ,Fv),l}finally{Vr=t,m$=!1}}return null}var sC=[],aC=0,qM=null,YM=0,Ju=[],Qu=0,EE=null,Cg=1,Tg="";function g_(n,t){sC[aC++]=YM,sC[aC++]=qM,qM=n,YM=t}function nge(n,t,i){Ju[Qu++]=Cg,Ju[Qu++]=Tg,Ju[Qu++]=EE,EE=n;var s=Cg;n=Tg;var l=32-of(s)-1;s&=~(1<<l),i+=1;var d=32-of(t)+l;if(30<d){var u=l-l%5;d=(s&(1<<u)-1).toString(32),s>>=u,l-=u,Cg=1<<32-of(t)+l|i<<l|s,Tg=d+n}else Cg=1<<d|i<<l|s,Tg=n}function hJ(n){n.return!==null&&(g_(n,1),nge(n,1,0))}function fJ(n){for(;n===qM;)qM=sC[--aC],sC[aC]=null,YM=sC[--aC],sC[aC]=null;for(;n===EE;)EE=Ju[--Qu],Ju[Qu]=null,Tg=Ju[--Qu],Ju[Qu]=null,Cg=Ju[--Qu],Ju[Qu]=null}var qd=null,Gd=null,Ls=!1,rf=null;function ige(n,t){var i=eh(5,null,null,0);i.elementType="DELETED",i.stateNode=t,i.return=n,t=n.deletions,t===null?(n.deletions=[i],n.flags|=16):t.push(i)}function kde(n,t){switch(n.tag){case 5:var i=n.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(n.stateNode=t,qd=n,Gd=wv(t.firstChild),!0):!1;case 6:return t=n.pendingProps===""||t.nodeType!==3?null:t,t!==null?(n.stateNode=t,qd=n,Gd=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(i=EE!==null?{id:Cg,overflow:Tg}:null,n.memoizedState={dehydrated:t,treeContext:i,retryLane:1073741824},i=eh(18,null,null,0),i.stateNode=t,i.return=n,n.child=i,qd=n,Gd=null,!0):!1;default:return!1}}function JK(n){return(n.mode&1)!==0&&(n.flags&128)===0}function QK(n){if(Ls){var t=Gd;if(t){var i=t;if(!kde(n,t)){if(JK(n))throw Error(on(418));t=wv(i.nextSibling);var s=qd;t&&kde(n,t)?ige(s,i):(n.flags=n.flags&-4097|2,Ls=!1,qd=n)}}else{if(JK(n))throw Error(on(418));n.flags=n.flags&-4097|2,Ls=!1,qd=n}}}function Mde(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;qd=n}function uk(n){if(n!==qd)return!1;if(!Ls)return Mde(n),Ls=!0,!1;var t;if((t=n.tag!==3)&&!(t=n.tag!==5)&&(t=n.type,t=t!=="head"&&t!=="body"&&!KK(n.type,n.memoizedProps)),t&&(t=Gd)){if(JK(n))throw rge(),Error(on(418));for(;t;)ige(n,t),t=wv(t.nextSibling)}if(Mde(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(on(317));e:{for(n=n.nextSibling,t=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"){if(t===0){Gd=wv(n.nextSibling);break e}t--}else i!=="$"&&i!=="$!"&&i!=="$?"||t++}n=n.nextSibling}Gd=null}}else Gd=qd?wv(n.stateNode.nextSibling):null;return!0}function rge(){for(var n=Gd;n;)n=wv(n.nextSibling)}function CR(){Gd=qd=null,Ls=!1}function pJ(n){rf===null?rf=[n]:rf.push(n)}var iOe=Dg.ReactCurrentBatchConfig;function Bh(n,t){if(n&&n.defaultProps){t=Hs({},t),n=n.defaultProps;for(var i in n)t[i]===void 0&&(t[i]=n[i]);return t}return t}var XM=Uv(null),JM=null,oC=null,mJ=null;function gJ(){mJ=oC=JM=null}function vJ(n){var t=XM.current;Ss(XM),n._currentValue=t}function ZK(n,t,i){for(;n!==null;){var s=n.alternate;if((n.childLanes&t)!==t?(n.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),n===i)break;n=n.return}}function EC(n,t){JM=n,mJ=oC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&t&&(Zc=!0),n.firstContext=null)}function nh(n){var t=n._currentValue;if(mJ!==n)if(n={context:n,memoizedValue:t,next:null},oC===null){if(JM===null)throw Error(on(308));oC=n,JM.dependencies={lanes:0,firstContext:n}}else oC=oC.next=n;return t}var O_=null;function yJ(n){O_===null?O_=[n]:O_.push(n)}function sge(n,t,i,s){var l=t.interleaved;return l===null?(i.next=i,yJ(t)):(i.next=l.next,l.next=i),t.interleaved=i,Og(n,s)}function Og(n,t){n.lanes|=t;var i=n.alternate;for(i!==null&&(i.lanes|=t),i=n,n=n.return;n!==null;)n.childLanes|=t,i=n.alternate,i!==null&&(i.childLanes|=t),i=n,n=n.return;return i.tag===3?i.stateNode:null}var r1=!1;function _J(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function age(n,t){n=n.updateQueue,t.updateQueue===n&&(t.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function xg(n,t){return{eventTime:n,lane:t,tag:0,payload:null,callback:null,next:null}}function Sv(n,t,i){var s=n.updateQueue;if(s===null)return null;if(s=s.shared,wr&2){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,Og(n,i)}return l=s.interleaved,l===null?(t.next=t,yJ(s)):(t.next=l.next,l.next=t),s.interleaved=t,Og(n,i)}function Fk(n,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194240)!==0)){var s=t.lanes;s&=n.pendingLanes,i|=s,t.lanes=i,rJ(n,i)}}function jde(n,t){var i=n.updateQueue,s=n.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var l=null,d=null;if(i=i.firstBaseUpdate,i!==null){do{var u={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};d===null?l=d=u:d=d.next=u,i=i.next}while(i!==null);d===null?l=d=t:d=d.next=t}else l=d=t;i={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:d,shared:s.shared,effects:s.effects},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=t:n.next=t,i.lastBaseUpdate=t}function QM(n,t,i,s){var l=n.updateQueue;r1=!1;var d=l.firstBaseUpdate,u=l.lastBaseUpdate,p=l.shared.pending;if(p!==null){l.shared.pending=null;var g=p,_=g.next;g.next=null,u===null?d=_:u.next=_,u=g;var y=n.alternate;y!==null&&(y=y.updateQueue,p=y.lastBaseUpdate,p!==u&&(p===null?y.firstBaseUpdate=_:p.next=_,y.lastBaseUpdate=g))}if(d!==null){var E=l.baseState;u=0,y=_=g=null,p=d;do{var b=p.lane,A=p.eventTime;if((s&b)===b){y!==null&&(y=y.next={eventTime:A,lane:0,tag:p.tag,payload:p.payload,callback:p.callback,next:null});e:{var N=n,O=p;switch(b=t,A=i,O.tag){case 1:if(N=O.payload,typeof N=="function"){E=N.call(A,E,b);break e}E=N;break e;case 3:N.flags=N.flags&-65537|128;case 0:if(N=O.payload,b=typeof N=="function"?N.call(A,E,b):N,b==null)break e;E=Hs({},E,b);break e;case 2:r1=!0}}p.callback!==null&&p.lane!==0&&(n.flags|=64,b=l.effects,b===null?l.effects=[p]:b.push(p))}else A={eventTime:A,lane:b,tag:p.tag,payload:p.payload,callback:p.callback,next:null},y===null?(_=y=A,g=E):y=y.next=A,u|=b;if(p=p.next,p===null){if(p=l.shared.pending,p===null)break;b=p,p=b.next,b.next=null,l.lastBaseUpdate=b,l.shared.pending=null}}while(!0);if(y===null&&(g=E),l.baseState=g,l.firstBaseUpdate=_,l.lastBaseUpdate=y,t=l.shared.interleaved,t!==null){l=t;do u|=l.lane,l=l.next;while(l!==t)}else d===null&&(l.shared.lanes=0);SE|=u,n.lanes=u,n.memoizedState=E}}function Ude(n,t,i){if(n=t.effects,t.effects=null,n!==null)for(t=0;t<n.length;t++){var s=n[t],l=s.callback;if(l!==null){if(s.callback=null,s=i,typeof l!="function")throw Error(on(191,l));l.call(s)}}}var oge=new sme.Component().refs;function eq(n,t,i,s){t=n.memoizedState,i=i(s,t),i=i==null?t:Hs({},t,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Hj={isMounted:function(n){return(n=n._reactInternals)?ME(n)===n:!1},enqueueSetState:function(n,t,i){n=n._reactInternals;var s=ac(),l=Cv(n),d=xg(s,l);d.payload=t,i!=null&&(d.callback=i),t=Sv(n,d,l),t!==null&&(lf(t,n,l,s),Fk(t,n,l))},enqueueReplaceState:function(n,t,i){n=n._reactInternals;var s=ac(),l=Cv(n),d=xg(s,l);d.tag=1,d.payload=t,i!=null&&(d.callback=i),t=Sv(n,d,l),t!==null&&(lf(t,n,l,s),Fk(t,n,l))},enqueueForceUpdate:function(n,t){n=n._reactInternals;var i=ac(),s=Cv(n),l=xg(i,s);l.tag=2,t!=null&&(l.callback=t),t=Sv(n,l,s),t!==null&&(lf(t,n,s,i),Fk(t,n,s))}};function Fde(n,t,i,s,l,d,u){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(s,d,u):t.prototype&&t.prototype.isPureReactComponent?!x4(i,s)||!x4(l,d):!0}function lge(n,t,i){var s=!1,l=Ov,d=t.contextType;return typeof d=="object"&&d!==null?d=nh(d):(l=td(t)?_E:wl.current,s=t.contextTypes,d=(s=s!=null)?bR(n,l):Ov),t=new t(i,d),n.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Hj,n.stateNode=t,t._reactInternals=n,s&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=l,n.__reactInternalMemoizedMaskedChildContext=d),t}function Bde(n,t,i,s){n=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==n&&Hj.enqueueReplaceState(t,t.state,null)}function tq(n,t,i,s){var l=n.stateNode;l.props=i,l.state=n.memoizedState,l.refs=oge,_J(n);var d=t.contextType;typeof d=="object"&&d!==null?l.context=nh(d):(d=td(t)?_E:wl.current,l.context=bR(n,d)),l.state=n.memoizedState,d=t.getDerivedStateFromProps,typeof d=="function"&&(eq(n,t,d,i),l.state=n.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(t=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),t!==l.state&&Hj.enqueueReplaceState(l,l.state,null),QM(n,i,l,s),l.state=n.memoizedState),typeof l.componentDidMount=="function"&&(n.flags|=4194308)}function dI(n,t,i){if(n=i.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(on(309));var s=i.stateNode}if(!s)throw Error(on(147,n));var l=s,d=""+n;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===d?t.ref:(t=function(u){var p=l.refs;p===oge&&(p=l.refs={}),u===null?delete p[d]:p[d]=u},t._stringRef=d,t)}if(typeof n!="string")throw Error(on(284));if(!i._owner)throw Error(on(290,n))}return n}function hk(n,t){throw n=Object.prototype.toString.call(t),Error(on(31,n==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":n))}function Vde(n){var t=n._init;return t(n._payload)}function cge(n){function t(P,j){if(n){var M=P.deletions;M===null?(P.deletions=[j],P.flags|=16):M.push(j)}}function i(P,j){if(!n)return null;for(;j!==null;)t(P,j),j=j.sibling;return null}function s(P,j){for(P=new Map;j!==null;)j.key!==null?P.set(j.key,j):P.set(j.index,j),j=j.sibling;return P}function l(P,j){return P=Tv(P,j),P.index=0,P.sibling=null,P}function d(P,j,M){return P.index=M,n?(M=P.alternate,M!==null?(M=M.index,M<j?(P.flags|=2,j):M):(P.flags|=2,j)):(P.flags|=1048576,j)}function u(P){return n&&P.alternate===null&&(P.flags|=2),P}function p(P,j,M,V){return j===null||j.tag!==6?(j=S$(M,P.mode,V),j.return=P,j):(j=l(j,M),j.return=P,j)}function g(P,j,M,V){var H=M.type;return H===Zb?y(P,j,M.props.children,V,M.key):j!==null&&(j.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===i1&&Vde(H)===j.type)?(V=l(j,M.props),V.ref=dI(P,j,M),V.return=P,V):(V=Wk(M.type,M.key,M.props,null,P.mode,V),V.ref=dI(P,j,M),V.return=P,V)}function _(P,j,M,V){return j===null||j.tag!==4||j.stateNode.containerInfo!==M.containerInfo||j.stateNode.implementation!==M.implementation?(j=b$(M,P.mode,V),j.return=P,j):(j=l(j,M.children||[]),j.return=P,j)}function y(P,j,M,V,H){return j===null||j.tag!==7?(j=hE(M,P.mode,V,H),j.return=P,j):(j=l(j,M),j.return=P,j)}function E(P,j,M){if(typeof j=="string"&&j!==""||typeof j=="number")return j=S$(""+j,P.mode,M),j.return=P,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case tk:return M=Wk(j.type,j.key,j.props,null,P.mode,M),M.ref=dI(P,null,j),M.return=P,M;case Qb:return j=b$(j,P.mode,M),j.return=P,j;case i1:var V=j._init;return E(P,V(j._payload),M)}if(TI(j)||sI(j))return j=hE(j,P.mode,M,null),j.return=P,j;hk(P,j)}return null}function b(P,j,M,V){var H=j!==null?j.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return H!==null?null:p(P,j,""+M,V);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case tk:return M.key===H?g(P,j,M,V):null;case Qb:return M.key===H?_(P,j,M,V):null;case i1:return H=M._init,b(P,j,H(M._payload),V)}if(TI(M)||sI(M))return H!==null?null:y(P,j,M,V,null);hk(P,M)}return null}function A(P,j,M,V,H){if(typeof V=="string"&&V!==""||typeof V=="number")return P=P.get(M)||null,p(j,P,""+V,H);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case tk:return P=P.get(V.key===null?M:V.key)||null,g(j,P,V,H);case Qb:return P=P.get(V.key===null?M:V.key)||null,_(j,P,V,H);case i1:var $=V._init;return A(P,j,M,$(V._payload),H)}if(TI(V)||sI(V))return P=P.get(M)||null,y(j,P,V,H,null);hk(j,V)}return null}function N(P,j,M,V){for(var H=null,$=null,Q=j,Y=j=0,le=null;Q!==null&&Y<M.length;Y++){Q.index>Y?(le=Q,Q=null):le=Q.sibling;var ae=b(P,Q,M[Y],V);if(ae===null){Q===null&&(Q=le);break}n&&Q&&ae.alternate===null&&t(P,Q),j=d(ae,j,Y),$===null?H=ae:$.sibling=ae,$=ae,Q=le}if(Y===M.length)return i(P,Q),Ls&&g_(P,Y),H;if(Q===null){for(;Y<M.length;Y++)Q=E(P,M[Y],V),Q!==null&&(j=d(Q,j,Y),$===null?H=Q:$.sibling=Q,$=Q);return Ls&&g_(P,Y),H}for(Q=s(P,Q);Y<M.length;Y++)le=A(Q,P,Y,M[Y],V),le!==null&&(n&&le.alternate!==null&&Q.delete(le.key===null?Y:le.key),j=d(le,j,Y),$===null?H=le:$.sibling=le,$=le);return n&&Q.forEach(function(te){return t(P,te)}),Ls&&g_(P,Y),H}function O(P,j,M,V){var H=sI(M);if(typeof H!="function")throw Error(on(150));if(M=H.call(M),M==null)throw Error(on(151));for(var $=H=null,Q=j,Y=j=0,le=null,ae=M.next();Q!==null&&!ae.done;Y++,ae=M.next()){Q.index>Y?(le=Q,Q=null):le=Q.sibling;var te=b(P,Q,ae.value,V);if(te===null){Q===null&&(Q=le);break}n&&Q&&te.alternate===null&&t(P,Q),j=d(te,j,Y),$===null?H=te:$.sibling=te,$=te,Q=le}if(ae.done)return i(P,Q),Ls&&g_(P,Y),H;if(Q===null){for(;!ae.done;Y++,ae=M.next())ae=E(P,ae.value,V),ae!==null&&(j=d(ae,j,Y),$===null?H=ae:$.sibling=ae,$=ae);return Ls&&g_(P,Y),H}for(Q=s(P,Q);!ae.done;Y++,ae=M.next())ae=A(Q,P,Y,ae.value,V),ae!==null&&(n&&ae.alternate!==null&&Q.delete(ae.key===null?Y:ae.key),j=d(ae,j,Y),$===null?H=ae:$.sibling=ae,$=ae);return n&&Q.forEach(function(de){return t(P,de)}),Ls&&g_(P,Y),H}function D(P,j,M,V){if(typeof M=="object"&&M!==null&&M.type===Zb&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case tk:e:{for(var H=M.key,$=j;$!==null;){if($.key===H){if(H=M.type,H===Zb){if($.tag===7){i(P,$.sibling),j=l($,M.props.children),j.return=P,P=j;break e}}else if($.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===i1&&Vde(H)===$.type){i(P,$.sibling),j=l($,M.props),j.ref=dI(P,$,M),j.return=P,P=j;break e}i(P,$);break}else t(P,$);$=$.sibling}M.type===Zb?(j=hE(M.props.children,P.mode,V,M.key),j.return=P,P=j):(V=Wk(M.type,M.key,M.props,null,P.mode,V),V.ref=dI(P,j,M),V.return=P,P=V)}return u(P);case Qb:e:{for($=M.key;j!==null;){if(j.key===$)if(j.tag===4&&j.stateNode.containerInfo===M.containerInfo&&j.stateNode.implementation===M.implementation){i(P,j.sibling),j=l(j,M.children||[]),j.return=P,P=j;break e}else{i(P,j);break}else t(P,j);j=j.sibling}j=b$(M,P.mode,V),j.return=P,P=j}return u(P);case i1:return $=M._init,D(P,j,$(M._payload),V)}if(TI(M))return N(P,j,M,V);if(sI(M))return O(P,j,M,V);hk(P,M)}return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,j!==null&&j.tag===6?(i(P,j.sibling),j=l(j,M),j.return=P,P=j):(i(P,j),j=S$(M,P.mode,V),j.return=P,P=j),u(P)):i(P,j)}return D}var TR=cge(!0),dge=cge(!1),UO={},kp=Uv(UO),O4=Uv(UO),P4=Uv(UO);function P_(n){if(n===UO)throw Error(on(174));return n}function EJ(n,t){switch(cs(P4,t),cs(O4,n),cs(kp,UO),n=t.nodeType,n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:LK(null,"");break;default:n=n===8?t.parentNode:t,t=n.namespaceURI||null,n=n.tagName,t=LK(t,n)}Ss(kp),cs(kp,t)}function RR(){Ss(kp),Ss(O4),Ss(P4)}function uge(n){P_(P4.current);var t=P_(kp.current),i=LK(t,n.type);t!==i&&(cs(O4,n),cs(kp,i))}function wJ(n){O4.current===n&&(Ss(kp),Ss(O4))}var Bs=Uv(0);function ZM(n){for(var t=n;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break;for(;t.sibling===null;){if(t.return===null||t.return===n)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var g$=[];function SJ(){for(var n=0;n<g$.length;n++)g$[n]._workInProgressVersionPrimary=null;g$.length=0}var Bk=Dg.ReactCurrentDispatcher,v$=Dg.ReactCurrentBatchConfig,wE=0,zs=null,Ha=null,wo=null,e7=!1,c4=!1,L4=0,rOe=0;function dl(){throw Error(on(321))}function bJ(n,t){if(t===null)return!1;for(var i=0;i<t.length&&i<n.length;i++)if(!uf(n[i],t[i]))return!1;return!0}function CJ(n,t,i,s,l,d){if(wE=d,zs=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bk.current=n===null||n.memoizedState===null?lOe:cOe,n=i(s,l),c4){d=0;do{if(c4=!1,L4=0,25<=d)throw Error(on(301));d+=1,wo=Ha=null,t.updateQueue=null,Bk.current=dOe,n=i(s,l)}while(c4)}if(Bk.current=t7,t=Ha!==null&&Ha.next!==null,wE=0,wo=Ha=zs=null,e7=!1,t)throw Error(on(300));return n}function TJ(){var n=L4!==0;return L4=0,n}function tp(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wo===null?zs.memoizedState=wo=n:wo=wo.next=n,wo}function ih(){if(Ha===null){var n=zs.alternate;n=n!==null?n.memoizedState:null}else n=Ha.next;var t=wo===null?zs.memoizedState:wo.next;if(t!==null)wo=t,Ha=n;else{if(n===null)throw Error(on(310));Ha=n,n={memoizedState:Ha.memoizedState,baseState:Ha.baseState,baseQueue:Ha.baseQueue,queue:Ha.queue,next:null},wo===null?zs.memoizedState=wo=n:wo=wo.next=n}return wo}function D4(n,t){return typeof t=="function"?t(n):t}function y$(n){var t=ih(),i=t.queue;if(i===null)throw Error(on(311));i.lastRenderedReducer=n;var s=Ha,l=s.baseQueue,d=i.pending;if(d!==null){if(l!==null){var u=l.next;l.next=d.next,d.next=u}s.baseQueue=l=d,i.pending=null}if(l!==null){d=l.next,s=s.baseState;var p=u=null,g=null,_=d;do{var y=_.lane;if((wE&y)===y)g!==null&&(g=g.next={lane:0,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),s=_.hasEagerState?_.eagerState:n(s,_.action);else{var E={lane:y,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null};g===null?(p=g=E,u=s):g=g.next=E,zs.lanes|=y,SE|=y}_=_.next}while(_!==null&&_!==d);g===null?u=s:g.next=p,uf(s,t.memoizedState)||(Zc=!0),t.memoizedState=s,t.baseState=u,t.baseQueue=g,i.lastRenderedState=s}if(n=i.interleaved,n!==null){l=n;do d=l.lane,zs.lanes|=d,SE|=d,l=l.next;while(l!==n)}else l===null&&(i.lanes=0);return[t.memoizedState,i.dispatch]}function _$(n){var t=ih(),i=t.queue;if(i===null)throw Error(on(311));i.lastRenderedReducer=n;var s=i.dispatch,l=i.pending,d=t.memoizedState;if(l!==null){i.pending=null;var u=l=l.next;do d=n(d,u.action),u=u.next;while(u!==l);uf(d,t.memoizedState)||(Zc=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),i.lastRenderedState=d}return[d,s]}function hge(){}function fge(n,t){var i=zs,s=ih(),l=t(),d=!uf(s.memoizedState,l);if(d&&(s.memoizedState=l,Zc=!0),s=s.queue,RJ(gge.bind(null,i,s,n),[n]),s.getSnapshot!==t||d||wo!==null&&wo.memoizedState.tag&1){if(i.flags|=2048,k4(9,mge.bind(null,i,s,l,t),void 0,null),bo===null)throw Error(on(349));wE&30||pge(i,t,l)}return l}function pge(n,t,i){n.flags|=16384,n={getSnapshot:t,value:i},t=zs.updateQueue,t===null?(t={lastEffect:null,stores:null},zs.updateQueue=t,t.stores=[n]):(i=t.stores,i===null?t.stores=[n]:i.push(n))}function mge(n,t,i,s){t.value=i,t.getSnapshot=s,vge(t)&&yge(n)}function gge(n,t,i){return i(function(){vge(t)&&yge(n)})}function vge(n){var t=n.getSnapshot;n=n.value;try{var i=t();return!uf(n,i)}catch{return!0}}function yge(n){var t=Og(n,1);t!==null&&lf(t,n,1,-1)}function zde(n){var t=tp();return typeof n=="function"&&(n=n()),t.memoizedState=t.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:D4,lastRenderedState:n},t.queue=n,n=n.dispatch=oOe.bind(null,zs,n),[t.memoizedState,n]}function k4(n,t,i,s){return n={tag:n,create:t,destroy:i,deps:s,next:null},t=zs.updateQueue,t===null?(t={lastEffect:null,stores:null},zs.updateQueue=t,t.lastEffect=n.next=n):(i=t.lastEffect,i===null?t.lastEffect=n.next=n:(s=i.next,i.next=n,n.next=s,t.lastEffect=n)),n}function _ge(){return ih().memoizedState}function Vk(n,t,i,s){var l=tp();zs.flags|=n,l.memoizedState=k4(1|t,i,void 0,s===void 0?null:s)}function Gj(n,t,i,s){var l=ih();s=s===void 0?null:s;var d=void 0;if(Ha!==null){var u=Ha.memoizedState;if(d=u.destroy,s!==null&&bJ(s,u.deps)){l.memoizedState=k4(t,i,d,s);return}}zs.flags|=n,l.memoizedState=k4(1|t,i,d,s)}function Hde(n,t){return Vk(8390656,8,n,t)}function RJ(n,t){return Gj(2048,8,n,t)}function Ege(n,t){return Gj(4,2,n,t)}function wge(n,t){return Gj(4,4,n,t)}function Sge(n,t){if(typeof t=="function")return n=n(),t(n),function(){t(null)};if(t!=null)return n=n(),t.current=n,function(){t.current=null}}function bge(n,t,i){return i=i!=null?i.concat([n]):null,Gj(4,4,Sge.bind(null,t,n),i)}function xJ(){}function Cge(n,t){var i=ih();t=t===void 0?null:t;var s=i.memoizedState;return s!==null&&t!==null&&bJ(t,s[1])?s[0]:(i.memoizedState=[n,t],n)}function Tge(n,t){var i=ih();t=t===void 0?null:t;var s=i.memoizedState;return s!==null&&t!==null&&bJ(t,s[1])?s[0]:(n=n(),i.memoizedState=[n,t],n)}function Rge(n,t,i){return wE&21?(uf(i,t)||(i=Ime(),zs.lanes|=i,SE|=i,n.baseState=!0),t):(n.baseState&&(n.baseState=!1,Zc=!0),n.memoizedState=i)}function sOe(n,t){var i=Vr;Vr=i!==0&&4>i?i:4,n(!0);var s=v$.transition;v$.transition={};try{n(!1),t()}finally{Vr=i,v$.transition=s}}function xge(){return ih().memoizedState}function aOe(n,t,i){var s=Cv(n);if(i={lane:s,action:i,hasEagerState:!1,eagerState:null,next:null},Age(n))Ige(t,i);else if(i=sge(n,t,i,s),i!==null){var l=ac();lf(i,n,s,l),Nge(i,t,s)}}function oOe(n,t,i){var s=Cv(n),l={lane:s,action:i,hasEagerState:!1,eagerState:null,next:null};if(Age(n))Ige(t,l);else{var d=n.alternate;if(n.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var u=t.lastRenderedState,p=d(u,i);if(l.hasEagerState=!0,l.eagerState=p,uf(p,u)){var g=t.interleaved;g===null?(l.next=l,yJ(t)):(l.next=g.next,g.next=l),t.interleaved=l;return}}catch{}finally{}i=sge(n,t,l,s),i!==null&&(l=ac(),lf(i,n,s,l),Nge(i,t,s))}}function Age(n){var t=n.alternate;return n===zs||t!==null&&t===zs}function Ige(n,t){c4=e7=!0;var i=n.pending;i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t}function Nge(n,t,i){if(i&4194240){var s=t.lanes;s&=n.pendingLanes,i|=s,t.lanes=i,rJ(n,i)}}var t7={readContext:nh,useCallback:dl,useContext:dl,useEffect:dl,useImperativeHandle:dl,useInsertionEffect:dl,useLayoutEffect:dl,useMemo:dl,useReducer:dl,useRef:dl,useState:dl,useDebugValue:dl,useDeferredValue:dl,useTransition:dl,useMutableSource:dl,useSyncExternalStore:dl,useId:dl,unstable_isNewReconciler:!1},lOe={readContext:nh,useCallback:function(n,t){return tp().memoizedState=[n,t===void 0?null:t],n},useContext:nh,useEffect:Hde,useImperativeHandle:function(n,t,i){return i=i!=null?i.concat([n]):null,Vk(4194308,4,Sge.bind(null,t,n),i)},useLayoutEffect:function(n,t){return Vk(4194308,4,n,t)},useInsertionEffect:function(n,t){return Vk(4,2,n,t)},useMemo:function(n,t){var i=tp();return t=t===void 0?null:t,n=n(),i.memoizedState=[n,t],n},useReducer:function(n,t,i){var s=tp();return t=i!==void 0?i(t):t,s.memoizedState=s.baseState=t,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:t},s.queue=n,n=n.dispatch=aOe.bind(null,zs,n),[s.memoizedState,n]},useRef:function(n){var t=tp();return n={current:n},t.memoizedState=n},useState:zde,useDebugValue:xJ,useDeferredValue:function(n){return tp().memoizedState=n},useTransition:function(){var n=zde(!1),t=n[0];return n=sOe.bind(null,n[1]),tp().memoizedState=n,[t,n]},useMutableSource:function(){},useSyncExternalStore:function(n,t,i){var s=zs,l=tp();if(Ls){if(i===void 0)throw Error(on(407));i=i()}else{if(i=t(),bo===null)throw Error(on(349));wE&30||pge(s,t,i)}l.memoizedState=i;var d={value:i,getSnapshot:t};return l.queue=d,Hde(gge.bind(null,s,d,n),[n]),s.flags|=2048,k4(9,mge.bind(null,s,d,i,t),void 0,null),i},useId:function(){var n=tp(),t=bo.identifierPrefix;if(Ls){var i=Tg,s=Cg;i=(s&~(1<<32-of(s)-1)).toString(32)+i,t=":"+t+"R"+i,i=L4++,0<i&&(t+="H"+i.toString(32)),t+=":"}else i=rOe++,t=":"+t+"r"+i.toString(32)+":";return n.memoizedState=t},unstable_isNewReconciler:!1},cOe={readContext:nh,useCallback:Cge,useContext:nh,useEffect:RJ,useImperativeHandle:bge,useInsertionEffect:Ege,useLayoutEffect:wge,useMemo:Tge,useReducer:y$,useRef:_ge,useState:function(){return y$(D4)},useDebugValue:xJ,useDeferredValue:function(n){var t=ih();return Rge(t,Ha.memoizedState,n)},useTransition:function(){var n=y$(D4)[0],t=ih().memoizedState;return[n,t]},useMutableSource:hge,useSyncExternalStore:fge,useId:xge,unstable_isNewReconciler:!1},dOe={readContext:nh,useCallback:Cge,useContext:nh,useEffect:RJ,useImperativeHandle:bge,useInsertionEffect:Ege,useLayoutEffect:wge,useMemo:Tge,useReducer:_$,useRef:_ge,useState:function(){return _$(D4)},useDebugValue:xJ,useDeferredValue:function(n){var t=ih();return Ha===null?t.memoizedState=n:Rge(t,Ha.memoizedState,n)},useTransition:function(){var n=_$(D4)[0],t=ih().memoizedState;return[n,t]},useMutableSource:hge,useSyncExternalStore:fge,useId:xge,unstable_isNewReconciler:!1};function xR(n,t){try{var i="",s=t;do i+=UNe(s),s=s.return;while(s);var l=i}catch(d){l=`
Error generating stack: `+d.message+`
`+d.stack}return{value:n,source:t,stack:l,digest:null}}function E$(n,t,i){return{value:n,source:null,stack:i??null,digest:t??null}}function nq(n,t){try{console.error(t.value)}catch(i){setTimeout(function(){throw i})}}var uOe=typeof WeakMap=="function"?WeakMap:Map;function Oge(n,t,i){i=xg(-1,i),i.tag=3,i.payload={element:null};var s=t.value;return i.callback=function(){i7||(i7=!0,hq=s),nq(n,t)},i}function Pge(n,t,i){i=xg(-1,i),i.tag=3;var s=n.type.getDerivedStateFromError;if(typeof s=="function"){var l=t.value;i.payload=function(){return s(l)},i.callback=function(){nq(n,t)}}var d=n.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(i.callback=function(){nq(n,t),typeof s!="function"&&(bv===null?bv=new Set([this]):bv.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),i}function Gde(n,t,i){var s=n.pingCache;if(s===null){s=n.pingCache=new uOe;var l=new Set;s.set(t,l)}else l=s.get(t),l===void 0&&(l=new Set,s.set(t,l));l.has(i)||(l.add(i),n=TOe.bind(null,n,t,i),t.then(n,n))}function Wde(n){do{var t;if((t=n.tag===13)&&(t=n.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return n;n=n.return}while(n!==null);return null}function $de(n,t,i,s,l){return n.mode&1?(n.flags|=65536,n.lanes=l,n):(n===t?n.flags|=65536:(n.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(t=xg(-1,1),t.tag=2,Sv(i,t,1))),i.lanes|=1),n)}var hOe=Dg.ReactCurrentOwner,Zc=!1;function nc(n,t,i,s){t.child=n===null?dge(t,null,i,s):TR(t,n.child,i,s)}function Kde(n,t,i,s,l){i=i.render;var d=t.ref;return EC(t,l),s=CJ(n,t,i,s,d,l),i=TJ(),n!==null&&!Zc?(t.updateQueue=n.updateQueue,t.flags&=-2053,n.lanes&=~l,Pg(n,t,l)):(Ls&&i&&hJ(t),t.flags|=1,nc(n,t,s,l),t.child)}function qde(n,t,i,s,l){if(n===null){var d=i.type;return typeof d=="function"&&!kJ(d)&&d.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=d,Lge(n,t,d,s,l)):(n=Wk(i.type,null,s,t,t.mode,l),n.ref=t.ref,n.return=t,t.child=n)}if(d=n.child,!(n.lanes&l)){var u=d.memoizedProps;if(i=i.compare,i=i!==null?i:x4,i(u,s)&&n.ref===t.ref)return Pg(n,t,l)}return t.flags|=1,n=Tv(d,s),n.ref=t.ref,n.return=t,t.child=n}function Lge(n,t,i,s,l){if(n!==null){var d=n.memoizedProps;if(x4(d,s)&&n.ref===t.ref)if(Zc=!1,t.pendingProps=s=d,(n.lanes&l)!==0)n.flags&131072&&(Zc=!0);else return t.lanes=n.lanes,Pg(n,t,l)}return iq(n,t,i,s,l)}function Dge(n,t,i){var s=t.pendingProps,l=s.children,d=n!==null?n.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},cs(cC,Bd),Bd|=i;else{if(!(i&1073741824))return n=d!==null?d.baseLanes|i:i,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:n,cachePool:null,transitions:null},t.updateQueue=null,cs(cC,Bd),Bd|=n,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=d!==null?d.baseLanes:i,cs(cC,Bd),Bd|=s}else d!==null?(s=d.baseLanes|i,t.memoizedState=null):s=i,cs(cC,Bd),Bd|=s;return nc(n,t,l,i),t.child}function kge(n,t){var i=t.ref;(n===null&&i!==null||n!==null&&n.ref!==i)&&(t.flags|=512,t.flags|=2097152)}function iq(n,t,i,s,l){var d=td(i)?_E:wl.current;return d=bR(t,d),EC(t,l),i=CJ(n,t,i,s,d,l),s=TJ(),n!==null&&!Zc?(t.updateQueue=n.updateQueue,t.flags&=-2053,n.lanes&=~l,Pg(n,t,l)):(Ls&&s&&hJ(t),t.flags|=1,nc(n,t,i,l),t.child)}function Yde(n,t,i,s,l){if(td(i)){var d=!0;KM(t)}else d=!1;if(EC(t,l),t.stateNode===null)zk(n,t),lge(t,i,s),tq(t,i,s,l),s=!0;else if(n===null){var u=t.stateNode,p=t.memoizedProps;u.props=p;var g=u.context,_=i.contextType;typeof _=="object"&&_!==null?_=nh(_):(_=td(i)?_E:wl.current,_=bR(t,_));var y=i.getDerivedStateFromProps,E=typeof y=="function"||typeof u.getSnapshotBeforeUpdate=="function";E||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==s||g!==_)&&Bde(t,u,s,_),r1=!1;var b=t.memoizedState;u.state=b,QM(t,s,u,l),g=t.memoizedState,p!==s||b!==g||ed.current||r1?(typeof y=="function"&&(eq(t,i,y,s),g=t.memoizedState),(p=r1||Fde(t,i,p,s,b,g,_))?(E||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=g),u.props=s,u.state=g,u.context=_,s=p):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{u=t.stateNode,age(n,t),p=t.memoizedProps,_=t.type===t.elementType?p:Bh(t.type,p),u.props=_,E=t.pendingProps,b=u.context,g=i.contextType,typeof g=="object"&&g!==null?g=nh(g):(g=td(i)?_E:wl.current,g=bR(t,g));var A=i.getDerivedStateFromProps;(y=typeof A=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p!==E||b!==g)&&Bde(t,u,s,g),r1=!1,b=t.memoizedState,u.state=b,QM(t,s,u,l);var N=t.memoizedState;p!==E||b!==N||ed.current||r1?(typeof A=="function"&&(eq(t,i,A,s),N=t.memoizedState),(_=r1||Fde(t,i,_,s,b,N,g)||!1)?(y||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(s,N,g),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(s,N,g)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||p===n.memoizedProps&&b===n.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===n.memoizedProps&&b===n.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=N),u.props=s,u.state=N,u.context=g,s=_):(typeof u.componentDidUpdate!="function"||p===n.memoizedProps&&b===n.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||p===n.memoizedProps&&b===n.memoizedState||(t.flags|=1024),s=!1)}return rq(n,t,i,s,d,l)}function rq(n,t,i,s,l,d){kge(n,t);var u=(t.flags&128)!==0;if(!s&&!u)return l&&Dde(t,i,!1),Pg(n,t,d);s=t.stateNode,hOe.current=t;var p=u&&typeof i.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,n!==null&&u?(t.child=TR(t,n.child,null,d),t.child=TR(t,null,p,d)):nc(n,t,p,d),t.memoizedState=s.state,l&&Dde(t,i,!0),t.child}function Mge(n){var t=n.stateNode;t.pendingContext?Lde(n,t.pendingContext,t.pendingContext!==t.context):t.context&&Lde(n,t.context,!1),EJ(n,t.containerInfo)}function Xde(n,t,i,s,l){return CR(),pJ(l),t.flags|=256,nc(n,t,i,s),t.child}var sq={dehydrated:null,treeContext:null,retryLane:0};function aq(n){return{baseLanes:n,cachePool:null,transitions:null}}function jge(n,t,i){var s=t.pendingProps,l=Bs.current,d=!1,u=(t.flags&128)!==0,p;if((p=u)||(p=n!==null&&n.memoizedState===null?!1:(l&2)!==0),p?(d=!0,t.flags&=-129):(n===null||n.memoizedState!==null)&&(l|=1),cs(Bs,l&1),n===null)return QK(t),n=t.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(t.mode&1?n.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(u=s.children,n=s.fallback,d?(s=t.mode,d=t.child,u={mode:"hidden",children:u},!(s&1)&&d!==null?(d.childLanes=0,d.pendingProps=u):d=Kj(u,s,0,null),n=hE(n,s,i,null),d.return=t,n.return=t,d.sibling=n,t.child=d,t.child.memoizedState=aq(i),t.memoizedState=sq,n):AJ(t,u));if(l=n.memoizedState,l!==null&&(p=l.dehydrated,p!==null))return fOe(n,t,u,s,p,l,i);if(d){d=s.fallback,u=t.mode,l=n.child,p=l.sibling;var g={mode:"hidden",children:s.children};return!(u&1)&&t.child!==l?(s=t.child,s.childLanes=0,s.pendingProps=g,t.deletions=null):(s=Tv(l,g),s.subtreeFlags=l.subtreeFlags&14680064),p!==null?d=Tv(p,d):(d=hE(d,u,i,null),d.flags|=2),d.return=t,s.return=t,s.sibling=d,t.child=s,s=d,d=t.child,u=n.child.memoizedState,u=u===null?aq(i):{baseLanes:u.baseLanes|i,cachePool:null,transitions:u.transitions},d.memoizedState=u,d.childLanes=n.childLanes&~i,t.memoizedState=sq,s}return d=n.child,n=d.sibling,s=Tv(d,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=i),s.return=t,s.sibling=null,n!==null&&(i=t.deletions,i===null?(t.deletions=[n],t.flags|=16):i.push(n)),t.child=s,t.memoizedState=null,s}function AJ(n,t){return t=Kj({mode:"visible",children:t},n.mode,0,null),t.return=n,n.child=t}function fk(n,t,i,s){return s!==null&&pJ(s),TR(t,n.child,null,i),n=AJ(t,t.pendingProps.children),n.flags|=2,t.memoizedState=null,n}function fOe(n,t,i,s,l,d,u){if(i)return t.flags&256?(t.flags&=-257,s=E$(Error(on(422))),fk(n,t,u,s)):t.memoizedState!==null?(t.child=n.child,t.flags|=128,null):(d=s.fallback,l=t.mode,s=Kj({mode:"visible",children:s.children},l,0,null),d=hE(d,l,u,null),d.flags|=2,s.return=t,d.return=t,s.sibling=d,t.child=s,t.mode&1&&TR(t,n.child,null,u),t.child.memoizedState=aq(u),t.memoizedState=sq,d);if(!(t.mode&1))return fk(n,t,u,null);if(l.data==="$!"){if(s=l.nextSibling&&l.nextSibling.dataset,s)var p=s.dgst;return s=p,d=Error(on(419)),s=E$(d,s,void 0),fk(n,t,u,s)}if(p=(u&n.childLanes)!==0,Zc||p){if(s=bo,s!==null){switch(u&-u){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(s.suspendedLanes|u)?0:l,l!==0&&l!==d.retryLane&&(d.retryLane=l,Og(n,l),lf(s,n,l,-1))}return DJ(),s=E$(Error(on(421))),fk(n,t,u,s)}return l.data==="$?"?(t.flags|=128,t.child=n.child,t=ROe.bind(null,n),l._reactRetry=t,null):(n=d.treeContext,Gd=wv(l.nextSibling),qd=t,Ls=!0,rf=null,n!==null&&(Ju[Qu++]=Cg,Ju[Qu++]=Tg,Ju[Qu++]=EE,Cg=n.id,Tg=n.overflow,EE=t),t=AJ(t,s.children),t.flags|=4096,t)}function Jde(n,t,i){n.lanes|=t;var s=n.alternate;s!==null&&(s.lanes|=t),ZK(n.return,t,i)}function w$(n,t,i,s,l){var d=n.memoizedState;d===null?n.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:l}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=s,d.tail=i,d.tailMode=l)}function Uge(n,t,i){var s=t.pendingProps,l=s.revealOrder,d=s.tail;if(nc(n,t,s.children,i),s=Bs.current,s&2)s=s&1|2,t.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=t.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Jde(n,i,t);else if(n.tag===19)Jde(n,i,t);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}s&=1}if(cs(Bs,s),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(i=t.child,l=null;i!==null;)n=i.alternate,n!==null&&ZM(n)===null&&(l=i),i=i.sibling;i=l,i===null?(l=t.child,t.child=null):(l=i.sibling,i.sibling=null),w$(t,!1,l,i,d);break;case"backwards":for(i=null,l=t.child,t.child=null;l!==null;){if(n=l.alternate,n!==null&&ZM(n)===null){t.child=l;break}n=l.sibling,l.sibling=i,i=l,l=n}w$(t,!0,i,null,d);break;case"together":w$(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zk(n,t){!(t.mode&1)&&n!==null&&(n.alternate=null,t.alternate=null,t.flags|=2)}function Pg(n,t,i){if(n!==null&&(t.dependencies=n.dependencies),SE|=t.lanes,!(i&t.childLanes))return null;if(n!==null&&t.child!==n.child)throw Error(on(153));if(t.child!==null){for(n=t.child,i=Tv(n,n.pendingProps),t.child=i,i.return=t;n.sibling!==null;)n=n.sibling,i=i.sibling=Tv(n,n.pendingProps),i.return=t;i.sibling=null}return t.child}function pOe(n,t,i){switch(t.tag){case 3:Mge(t),CR();break;case 5:uge(t);break;case 1:td(t.type)&&KM(t);break;case 4:EJ(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,l=t.memoizedProps.value;cs(XM,s._currentValue),s._currentValue=l;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(cs(Bs,Bs.current&1),t.flags|=128,null):i&t.child.childLanes?jge(n,t,i):(cs(Bs,Bs.current&1),n=Pg(n,t,i),n!==null?n.sibling:null);cs(Bs,Bs.current&1);break;case 19:if(s=(i&t.childLanes)!==0,n.flags&128){if(s)return Uge(n,t,i);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),cs(Bs,Bs.current),s)break;return null;case 22:case 23:return t.lanes=0,Dge(n,t,i)}return Pg(n,t,i)}var Fge,oq,Bge,Vge;Fge=function(n,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};oq=function(){};Bge=function(n,t,i,s){var l=n.memoizedProps;if(l!==s){n=t.stateNode,P_(kp.current);var d=null;switch(i){case"input":l=IK(n,l),s=IK(n,s),d=[];break;case"select":l=Hs({},l,{value:void 0}),s=Hs({},s,{value:void 0}),d=[];break;case"textarea":l=PK(n,l),s=PK(n,s),d=[];break;default:typeof l.onClick!="function"&&typeof s.onClick=="function"&&(n.onclick=WM)}DK(i,s);var u;i=null;for(_ in l)if(!s.hasOwnProperty(_)&&l.hasOwnProperty(_)&&l[_]!=null)if(_==="style"){var p=l[_];for(u in p)p.hasOwnProperty(u)&&(i||(i={}),i[u]="")}else _!=="dangerouslySetInnerHTML"&&_!=="children"&&_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(E4.hasOwnProperty(_)?d||(d=[]):(d=d||[]).push(_,null));for(_ in s){var g=s[_];if(p=l!=null?l[_]:void 0,s.hasOwnProperty(_)&&g!==p&&(g!=null||p!=null))if(_==="style")if(p){for(u in p)!p.hasOwnProperty(u)||g&&g.hasOwnProperty(u)||(i||(i={}),i[u]="");for(u in g)g.hasOwnProperty(u)&&p[u]!==g[u]&&(i||(i={}),i[u]=g[u])}else i||(d||(d=[]),d.push(_,i)),i=g;else _==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,p=p?p.__html:void 0,g!=null&&p!==g&&(d=d||[]).push(_,g)):_==="children"?typeof g!="string"&&typeof g!="number"||(d=d||[]).push(_,""+g):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&(E4.hasOwnProperty(_)?(g!=null&&_==="onScroll"&&Es("scroll",n),d||p===g||(d=[])):(d=d||[]).push(_,g))}i&&(d=d||[]).push("style",i);var _=d;(t.updateQueue=_)&&(t.flags|=4)}};Vge=function(n,t,i,s){i!==s&&(t.flags|=4)};function uI(n,t){if(!Ls)switch(n.tailMode){case"hidden":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||n.tail===null?n.tail=null:n.tail.sibling=null:s.sibling=null}}function ul(n){var t=n.alternate!==null&&n.alternate.child===n.child,i=0,s=0;if(t)for(var l=n.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags&14680064,s|=l.flags&14680064,l.return=n,l=l.sibling;else for(l=n.child;l!==null;)i|=l.lanes|l.childLanes,s|=l.subtreeFlags,s|=l.flags,l.return=n,l=l.sibling;return n.subtreeFlags|=s,n.childLanes=i,t}function mOe(n,t,i){var s=t.pendingProps;switch(fJ(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ul(t),null;case 1:return td(t.type)&&$M(),ul(t),null;case 3:return s=t.stateNode,RR(),Ss(ed),Ss(wl),SJ(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(n===null||n.child===null)&&(uk(t)?t.flags|=4:n===null||n.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rf!==null&&(mq(rf),rf=null))),oq(n,t),ul(t),null;case 5:wJ(t);var l=P_(P4.current);if(i=t.type,n!==null&&t.stateNode!=null)Bge(n,t,i,s,l),n.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(on(166));return ul(t),null}if(n=P_(kp.current),uk(t)){s=t.stateNode,i=t.type;var d=t.memoizedProps;switch(s[Np]=t,s[N4]=d,n=(t.mode&1)!==0,i){case"dialog":Es("cancel",s),Es("close",s);break;case"iframe":case"object":case"embed":Es("load",s);break;case"video":case"audio":for(l=0;l<xI.length;l++)Es(xI[l],s);break;case"source":Es("error",s);break;case"img":case"image":case"link":Es("error",s),Es("load",s);break;case"details":Es("toggle",s);break;case"input":ade(s,d),Es("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!d.multiple},Es("invalid",s);break;case"textarea":lde(s,d),Es("invalid",s)}DK(i,d),l=null;for(var u in d)if(d.hasOwnProperty(u)){var p=d[u];u==="children"?typeof p=="string"?s.textContent!==p&&(d.suppressHydrationWarning!==!0&&dk(s.textContent,p,n),l=["children",p]):typeof p=="number"&&s.textContent!==""+p&&(d.suppressHydrationWarning!==!0&&dk(s.textContent,p,n),l=["children",""+p]):E4.hasOwnProperty(u)&&p!=null&&u==="onScroll"&&Es("scroll",s)}switch(i){case"input":nk(s),ode(s,d,!0);break;case"textarea":nk(s),cde(s);break;case"select":case"option":break;default:typeof d.onClick=="function"&&(s.onclick=WM)}s=l,t.updateQueue=s,s!==null&&(t.flags|=4)}else{u=l.nodeType===9?l:l.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=pme(i)),n==="http://www.w3.org/1999/xhtml"?i==="script"?(n=u.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof s.is=="string"?n=u.createElement(i,{is:s.is}):(n=u.createElement(i),i==="select"&&(u=n,s.multiple?u.multiple=!0:s.size&&(u.size=s.size))):n=u.createElementNS(n,i),n[Np]=t,n[N4]=s,Fge(n,t,!1,!1),t.stateNode=n;e:{switch(u=kK(i,s),i){case"dialog":Es("cancel",n),Es("close",n),l=s;break;case"iframe":case"object":case"embed":Es("load",n),l=s;break;case"video":case"audio":for(l=0;l<xI.length;l++)Es(xI[l],n);l=s;break;case"source":Es("error",n),l=s;break;case"img":case"image":case"link":Es("error",n),Es("load",n),l=s;break;case"details":Es("toggle",n),l=s;break;case"input":ade(n,s),l=IK(n,s),Es("invalid",n);break;case"option":l=s;break;case"select":n._wrapperState={wasMultiple:!!s.multiple},l=Hs({},s,{value:void 0}),Es("invalid",n);break;case"textarea":lde(n,s),l=PK(n,s),Es("invalid",n);break;default:l=s}DK(i,l),p=l;for(d in p)if(p.hasOwnProperty(d)){var g=p[d];d==="style"?vme(n,g):d==="dangerouslySetInnerHTML"?(g=g?g.__html:void 0,g!=null&&mme(n,g)):d==="children"?typeof g=="string"?(i!=="textarea"||g!=="")&&w4(n,g):typeof g=="number"&&w4(n,""+g):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(E4.hasOwnProperty(d)?g!=null&&d==="onScroll"&&Es("scroll",n):g!=null&&QX(n,d,g,u))}switch(i){case"input":nk(n),ode(n,s,!1);break;case"textarea":nk(n),cde(n);break;case"option":s.value!=null&&n.setAttribute("value",""+Nv(s.value));break;case"select":n.multiple=!!s.multiple,d=s.value,d!=null?gC(n,!!s.multiple,d,!1):s.defaultValue!=null&&gC(n,!!s.multiple,s.defaultValue,!0);break;default:typeof l.onClick=="function"&&(n.onclick=WM)}switch(i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ul(t),null;case 6:if(n&&t.stateNode!=null)Vge(n,t,n.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(on(166));if(i=P_(P4.current),P_(kp.current),uk(t)){if(s=t.stateNode,i=t.memoizedProps,s[Np]=t,(d=s.nodeValue!==i)&&(n=qd,n!==null))switch(n.tag){case 3:dk(s.nodeValue,i,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&dk(s.nodeValue,i,(n.mode&1)!==0)}d&&(t.flags|=4)}else s=(i.nodeType===9?i:i.ownerDocument).createTextNode(s),s[Np]=t,t.stateNode=s}return ul(t),null;case 13:if(Ss(Bs),s=t.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ls&&Gd!==null&&t.mode&1&&!(t.flags&128))rge(),CR(),t.flags|=98560,d=!1;else if(d=uk(t),s!==null&&s.dehydrated!==null){if(n===null){if(!d)throw Error(on(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(on(317));d[Np]=t}else CR(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ul(t),d=!1}else rf!==null&&(mq(rf),rf=null),d=!0;if(!d)return t.flags&65536?t:null}return t.flags&128?(t.lanes=i,t):(s=s!==null,s!==(n!==null&&n.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(n===null||Bs.current&1?$a===0&&($a=3):DJ())),t.updateQueue!==null&&(t.flags|=4),ul(t),null);case 4:return RR(),oq(n,t),n===null&&A4(t.stateNode.containerInfo),ul(t),null;case 10:return vJ(t.type._context),ul(t),null;case 17:return td(t.type)&&$M(),ul(t),null;case 19:if(Ss(Bs),d=t.memoizedState,d===null)return ul(t),null;if(s=(t.flags&128)!==0,u=d.rendering,u===null)if(s)uI(d,!1);else{if($a!==0||n!==null&&n.flags&128)for(n=t.child;n!==null;){if(u=ZM(n),u!==null){for(t.flags|=128,uI(d,!1),s=u.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=i,i=t.child;i!==null;)d=i,n=s,d.flags&=14680066,u=d.alternate,u===null?(d.childLanes=0,d.lanes=n,d.child=null,d.subtreeFlags=0,d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null,d.stateNode=null):(d.childLanes=u.childLanes,d.lanes=u.lanes,d.child=u.child,d.subtreeFlags=0,d.deletions=null,d.memoizedProps=u.memoizedProps,d.memoizedState=u.memoizedState,d.updateQueue=u.updateQueue,d.type=u.type,n=u.dependencies,d.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i=i.sibling;return cs(Bs,Bs.current&1|2),t.child}n=n.sibling}d.tail!==null&&fa()>AR&&(t.flags|=128,s=!0,uI(d,!1),t.lanes=4194304)}else{if(!s)if(n=ZM(u),n!==null){if(t.flags|=128,s=!0,i=n.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),uI(d,!0),d.tail===null&&d.tailMode==="hidden"&&!u.alternate&&!Ls)return ul(t),null}else 2*fa()-d.renderingStartTime>AR&&i!==1073741824&&(t.flags|=128,s=!0,uI(d,!1),t.lanes=4194304);d.isBackwards?(u.sibling=t.child,t.child=u):(i=d.last,i!==null?i.sibling=u:t.child=u,d.last=u)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=fa(),t.sibling=null,i=Bs.current,cs(Bs,s?i&1|2:i&1),t):(ul(t),null);case 22:case 23:return LJ(),s=t.memoizedState!==null,n!==null&&n.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Bd&1073741824&&(ul(t),t.subtreeFlags&6&&(t.flags|=8192)):ul(t),null;case 24:return null;case 25:return null}throw Error(on(156,t.tag))}function gOe(n,t){switch(fJ(t),t.tag){case 1:return td(t.type)&&$M(),n=t.flags,n&65536?(t.flags=n&-65537|128,t):null;case 3:return RR(),Ss(ed),Ss(wl),SJ(),n=t.flags,n&65536&&!(n&128)?(t.flags=n&-65537|128,t):null;case 5:return wJ(t),null;case 13:if(Ss(Bs),n=t.memoizedState,n!==null&&n.dehydrated!==null){if(t.alternate===null)throw Error(on(340));CR()}return n=t.flags,n&65536?(t.flags=n&-65537|128,t):null;case 19:return Ss(Bs),null;case 4:return RR(),null;case 10:return vJ(t.type._context),null;case 22:case 23:return LJ(),null;case 24:return null;default:return null}}var pk=!1,_l=!1,vOe=typeof WeakSet=="function"?WeakSet:Set,An=null;function lC(n,t){var i=n.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(s){Zs(n,t,s)}else i.current=null}function lq(n,t,i){try{i()}catch(s){Zs(n,t,s)}}var Qde=!1;function yOe(n,t){if(WK=zM,n=Wme(),uJ(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var l=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{i.nodeType,d.nodeType}catch{i=null;break e}var u=0,p=-1,g=-1,_=0,y=0,E=n,b=null;t:for(;;){for(var A;E!==i||l!==0&&E.nodeType!==3||(p=u+l),E!==d||s!==0&&E.nodeType!==3||(g=u+s),E.nodeType===3&&(u+=E.nodeValue.length),(A=E.firstChild)!==null;)b=E,E=A;for(;;){if(E===n)break t;if(b===i&&++_===l&&(p=u),b===d&&++y===s&&(g=u),(A=E.nextSibling)!==null)break;E=b,b=E.parentNode}E=A}i=p===-1||g===-1?null:{start:p,end:g}}else i=null}i=i||{start:0,end:0}}else i=null;for($K={focusedElem:n,selectionRange:i},zM=!1,An=t;An!==null;)if(t=An,n=t.child,(t.subtreeFlags&1028)!==0&&n!==null)n.return=t,An=n;else for(;An!==null;){t=An;try{var N=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(N!==null){var O=N.memoizedProps,D=N.memoizedState,P=t.stateNode,j=P.getSnapshotBeforeUpdate(t.elementType===t.type?O:Bh(t.type,O),D);P.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var M=t.stateNode.containerInfo;M.nodeType===1?M.textContent="":M.nodeType===9&&M.documentElement&&M.removeChild(M.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(on(163))}}catch(V){Zs(t,t.return,V)}if(n=t.sibling,n!==null){n.return=t.return,An=n;break}An=t.return}return N=Qde,Qde=!1,N}function d4(n,t,i){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&n)===n){var d=l.destroy;l.destroy=void 0,d!==void 0&&lq(t,i,d)}l=l.next}while(l!==s)}}function Wj(n,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&n)===n){var s=i.create;i.destroy=s()}i=i.next}while(i!==t)}}function cq(n){var t=n.ref;if(t!==null){var i=n.stateNode;switch(n.tag){case 5:n=i;break;default:n=i}typeof t=="function"?t(n):t.current=n}}function zge(n){var t=n.alternate;t!==null&&(n.alternate=null,zge(t)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(t=n.stateNode,t!==null&&(delete t[Np],delete t[N4],delete t[YK],delete t[eOe],delete t[tOe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Hge(n){return n.tag===5||n.tag===3||n.tag===4}function Zde(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Hge(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function dq(n,t,i){var s=n.tag;if(s===5||s===6)n=n.stateNode,t?i.nodeType===8?i.parentNode.insertBefore(n,t):i.insertBefore(n,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(n,i)):(t=i,t.appendChild(n)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=WM));else if(s!==4&&(n=n.child,n!==null))for(dq(n,t,i),n=n.sibling;n!==null;)dq(n,t,i),n=n.sibling}function uq(n,t,i){var s=n.tag;if(s===5||s===6)n=n.stateNode,t?i.insertBefore(n,t):i.appendChild(n);else if(s!==4&&(n=n.child,n!==null))for(uq(n,t,i),n=n.sibling;n!==null;)uq(n,t,i),n=n.sibling}var zo=null,nf=!1;function J0(n,t,i){for(i=i.child;i!==null;)Gge(n,t,i),i=i.sibling}function Gge(n,t,i){if(Dp&&typeof Dp.onCommitFiberUnmount=="function")try{Dp.onCommitFiberUnmount(jj,i)}catch{}switch(i.tag){case 5:_l||lC(i,t);case 6:var s=zo,l=nf;zo=null,J0(n,t,i),zo=s,nf=l,zo!==null&&(nf?(n=zo,i=i.stateNode,n.nodeType===8?n.parentNode.removeChild(i):n.removeChild(i)):zo.removeChild(i.stateNode));break;case 18:zo!==null&&(nf?(n=zo,i=i.stateNode,n.nodeType===8?p$(n.parentNode,i):n.nodeType===1&&p$(n,i),T4(n)):p$(zo,i.stateNode));break;case 4:s=zo,l=nf,zo=i.stateNode.containerInfo,nf=!0,J0(n,t,i),zo=s,nf=l;break;case 0:case 11:case 14:case 15:if(!_l&&(s=i.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){l=s=s.next;do{var d=l,u=d.destroy;d=d.tag,u!==void 0&&(d&2||d&4)&&lq(i,t,u),l=l.next}while(l!==s)}J0(n,t,i);break;case 1:if(!_l&&(lC(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=i.memoizedProps,s.state=i.memoizedState,s.componentWillUnmount()}catch(p){Zs(i,t,p)}J0(n,t,i);break;case 21:J0(n,t,i);break;case 22:i.mode&1?(_l=(s=_l)||i.memoizedState!==null,J0(n,t,i),_l=s):J0(n,t,i);break;default:J0(n,t,i)}}function eue(n){var t=n.updateQueue;if(t!==null){n.updateQueue=null;var i=n.stateNode;i===null&&(i=n.stateNode=new vOe),t.forEach(function(s){var l=xOe.bind(null,n,s);i.has(s)||(i.add(s),s.then(l,l))})}}function Dh(n,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];try{var d=n,u=t,p=u;e:for(;p!==null;){switch(p.tag){case 5:zo=p.stateNode,nf=!1;break e;case 3:zo=p.stateNode.containerInfo,nf=!0;break e;case 4:zo=p.stateNode.containerInfo,nf=!0;break e}p=p.return}if(zo===null)throw Error(on(160));Gge(d,u,l),zo=null,nf=!1;var g=l.alternate;g!==null&&(g.return=null),l.return=null}catch(_){Zs(l,t,_)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Wge(t,n),t=t.sibling}function Wge(n,t){var i=n.alternate,s=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Dh(t,n),Xf(n),s&4){try{d4(3,n,n.return),Wj(3,n)}catch(O){Zs(n,n.return,O)}try{d4(5,n,n.return)}catch(O){Zs(n,n.return,O)}}break;case 1:Dh(t,n),Xf(n),s&512&&i!==null&&lC(i,i.return);break;case 5:if(Dh(t,n),Xf(n),s&512&&i!==null&&lC(i,i.return),n.flags&32){var l=n.stateNode;try{w4(l,"")}catch(O){Zs(n,n.return,O)}}if(s&4&&(l=n.stateNode,l!=null)){var d=n.memoizedProps,u=i!==null?i.memoizedProps:d,p=n.type,g=n.updateQueue;if(n.updateQueue=null,g!==null)try{p==="input"&&d.type==="radio"&&d.name!=null&&hme(l,d),kK(p,u);var _=kK(p,d);for(u=0;u<g.length;u+=2){var y=g[u],E=g[u+1];y==="style"?vme(l,E):y==="dangerouslySetInnerHTML"?mme(l,E):y==="children"?w4(l,E):QX(l,y,E,_)}switch(p){case"input":NK(l,d);break;case"textarea":fme(l,d);break;case"select":var b=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!d.multiple;var A=d.value;A!=null?gC(l,!!d.multiple,A,!1):b!==!!d.multiple&&(d.defaultValue!=null?gC(l,!!d.multiple,d.defaultValue,!0):gC(l,!!d.multiple,d.multiple?[]:"",!1))}l[N4]=d}catch(O){Zs(n,n.return,O)}}break;case 6:if(Dh(t,n),Xf(n),s&4){if(n.stateNode===null)throw Error(on(162));l=n.stateNode,d=n.memoizedProps;try{l.nodeValue=d}catch(O){Zs(n,n.return,O)}}break;case 3:if(Dh(t,n),Xf(n),s&4&&i!==null&&i.memoizedState.isDehydrated)try{T4(t.containerInfo)}catch(O){Zs(n,n.return,O)}break;case 4:Dh(t,n),Xf(n);break;case 13:Dh(t,n),Xf(n),l=n.child,l.flags&8192&&(d=l.memoizedState!==null,l.stateNode.isHidden=d,!d||l.alternate!==null&&l.alternate.memoizedState!==null||(OJ=fa())),s&4&&eue(n);break;case 22:if(y=i!==null&&i.memoizedState!==null,n.mode&1?(_l=(_=_l)||y,Dh(t,n),_l=_):Dh(t,n),Xf(n),s&8192){if(_=n.memoizedState!==null,(n.stateNode.isHidden=_)&&!y&&n.mode&1)for(An=n,y=n.child;y!==null;){for(E=An=y;An!==null;){switch(b=An,A=b.child,b.tag){case 0:case 11:case 14:case 15:d4(4,b,b.return);break;case 1:lC(b,b.return);var N=b.stateNode;if(typeof N.componentWillUnmount=="function"){s=b,i=b.return;try{t=s,N.props=t.memoizedProps,N.state=t.memoizedState,N.componentWillUnmount()}catch(O){Zs(s,i,O)}}break;case 5:lC(b,b.return);break;case 22:if(b.memoizedState!==null){nue(E);continue}}A!==null?(A.return=b,An=A):nue(E)}y=y.sibling}e:for(y=null,E=n;;){if(E.tag===5){if(y===null){y=E;try{l=E.stateNode,_?(d=l.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"):(p=E.stateNode,g=E.memoizedProps.style,u=g!=null&&g.hasOwnProperty("display")?g.display:null,p.style.display=gme("display",u))}catch(O){Zs(n,n.return,O)}}}else if(E.tag===6){if(y===null)try{E.stateNode.nodeValue=_?"":E.memoizedProps}catch(O){Zs(n,n.return,O)}}else if((E.tag!==22&&E.tag!==23||E.memoizedState===null||E===n)&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===n)break e;for(;E.sibling===null;){if(E.return===null||E.return===n)break e;y===E&&(y=null),E=E.return}y===E&&(y=null),E.sibling.return=E.return,E=E.sibling}}break;case 19:Dh(t,n),Xf(n),s&4&&eue(n);break;case 21:break;default:Dh(t,n),Xf(n)}}function Xf(n){var t=n.flags;if(t&2){try{e:{for(var i=n.return;i!==null;){if(Hge(i)){var s=i;break e}i=i.return}throw Error(on(160))}switch(s.tag){case 5:var l=s.stateNode;s.flags&32&&(w4(l,""),s.flags&=-33);var d=Zde(n);uq(n,d,l);break;case 3:case 4:var u=s.stateNode.containerInfo,p=Zde(n);dq(n,p,u);break;default:throw Error(on(161))}}catch(g){Zs(n,n.return,g)}n.flags&=-3}t&4096&&(n.flags&=-4097)}function _Oe(n,t,i){An=n,$ge(n)}function $ge(n,t,i){for(var s=(n.mode&1)!==0;An!==null;){var l=An,d=l.child;if(l.tag===22&&s){var u=l.memoizedState!==null||pk;if(!u){var p=l.alternate,g=p!==null&&p.memoizedState!==null||_l;p=pk;var _=_l;if(pk=u,(_l=g)&&!_)for(An=l;An!==null;)u=An,g=u.child,u.tag===22&&u.memoizedState!==null?iue(l):g!==null?(g.return=u,An=g):iue(l);for(;d!==null;)An=d,$ge(d),d=d.sibling;An=l,pk=p,_l=_}tue(n)}else l.subtreeFlags&8772&&d!==null?(d.return=l,An=d):tue(n)}}function tue(n){for(;An!==null;){var t=An;if(t.flags&8772){var i=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:_l||Wj(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!_l)if(i===null)s.componentDidMount();else{var l=t.elementType===t.type?i.memoizedProps:Bh(t.type,i.memoizedProps);s.componentDidUpdate(l,i.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var d=t.updateQueue;d!==null&&Ude(t,d,s);break;case 3:var u=t.updateQueue;if(u!==null){if(i=null,t.child!==null)switch(t.child.tag){case 5:i=t.child.stateNode;break;case 1:i=t.child.stateNode}Ude(t,u,i)}break;case 5:var p=t.stateNode;if(i===null&&t.flags&4){i=p;var g=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":g.autoFocus&&i.focus();break;case"img":g.src&&(i.src=g.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var _=t.alternate;if(_!==null){var y=_.memoizedState;if(y!==null){var E=y.dehydrated;E!==null&&T4(E)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(on(163))}_l||t.flags&512&&cq(t)}catch(b){Zs(t,t.return,b)}}if(t===n){An=null;break}if(i=t.sibling,i!==null){i.return=t.return,An=i;break}An=t.return}}function nue(n){for(;An!==null;){var t=An;if(t===n){An=null;break}var i=t.sibling;if(i!==null){i.return=t.return,An=i;break}An=t.return}}function iue(n){for(;An!==null;){var t=An;try{switch(t.tag){case 0:case 11:case 15:var i=t.return;try{Wj(4,t)}catch(g){Zs(t,i,g)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var l=t.return;try{s.componentDidMount()}catch(g){Zs(t,l,g)}}var d=t.return;try{cq(t)}catch(g){Zs(t,d,g)}break;case 5:var u=t.return;try{cq(t)}catch(g){Zs(t,u,g)}}}catch(g){Zs(t,t.return,g)}if(t===n){An=null;break}var p=t.sibling;if(p!==null){p.return=t.return,An=p;break}An=t.return}}var EOe=Math.ceil,n7=Dg.ReactCurrentDispatcher,IJ=Dg.ReactCurrentOwner,th=Dg.ReactCurrentBatchConfig,wr=0,bo=null,xa=null,Ko=0,Bd=0,cC=Uv(0),$a=0,M4=null,SE=0,$j=0,NJ=0,u4=null,Jc=null,OJ=0,AR=1/0,Lm=null,i7=!1,hq=null,bv=null,mk=!1,hv=null,r7=0,h4=0,fq=null,Hk=-1,Gk=0;function ac(){return wr&6?fa():Hk!==-1?Hk:Hk=fa()}function Cv(n){return n.mode&1?wr&2&&Ko!==0?Ko&-Ko:iOe.transition!==null?(Gk===0&&(Gk=Ime()),Gk):(n=Vr,n!==0||(n=window.event,n=n===void 0?16:Mme(n.type)),n):1}function lf(n,t,i,s){if(50<h4)throw h4=0,fq=null,Error(on(185));kO(n,i,s),(!(wr&2)||n!==bo)&&(n===bo&&(!(wr&2)&&($j|=i),$a===4&&l1(n,Ko)),nd(n,s),i===1&&wr===0&&!(t.mode&1)&&(AR=fa()+500,zj&&Fv()))}function nd(n,t){var i=n.callbackNode;i5e(n,t);var s=VM(n,n===bo?Ko:0);if(s===0)i!==null&&hde(i),n.callbackNode=null,n.callbackPriority=0;else if(t=s&-s,n.callbackPriority!==t){if(i!=null&&hde(i),t===1)n.tag===0?nOe(rue.bind(null,n)):tge(rue.bind(null,n)),Q5e(function(){!(wr&6)&&Fv()}),i=null;else{switch(Nme(s)){case 1:i=iJ;break;case 4:i=xme;break;case 16:i=BM;break;case 536870912:i=Ame;break;default:i=BM}i=e0e(i,Kge.bind(null,n))}n.callbackPriority=t,n.callbackNode=i}}function Kge(n,t){if(Hk=-1,Gk=0,wr&6)throw Error(on(327));var i=n.callbackNode;if(wC()&&n.callbackNode!==i)return null;var s=VM(n,n===bo?Ko:0);if(s===0)return null;if(s&30||s&n.expiredLanes||t)t=s7(n,s);else{t=s;var l=wr;wr|=2;var d=Yge();(bo!==n||Ko!==t)&&(Lm=null,AR=fa()+500,uE(n,t));do try{bOe();break}catch(p){qge(n,p)}while(!0);gJ(),n7.current=d,wr=l,xa!==null?t=0:(bo=null,Ko=0,t=$a)}if(t!==0){if(t===2&&(l=BK(n),l!==0&&(s=l,t=pq(n,l))),t===1)throw i=M4,uE(n,0),l1(n,s),nd(n,fa()),i;if(t===6)l1(n,s);else{if(l=n.current.alternate,!(s&30)&&!wOe(l)&&(t=s7(n,s),t===2&&(d=BK(n),d!==0&&(s=d,t=pq(n,d))),t===1))throw i=M4,uE(n,0),l1(n,s),nd(n,fa()),i;switch(n.finishedWork=l,n.finishedLanes=s,t){case 0:case 1:throw Error(on(345));case 2:v_(n,Jc,Lm);break;case 3:if(l1(n,s),(s&130023424)===s&&(t=OJ+500-fa(),10<t)){if(VM(n,0)!==0)break;if(l=n.suspendedLanes,(l&s)!==s){ac(),n.pingedLanes|=n.suspendedLanes&l;break}n.timeoutHandle=qK(v_.bind(null,n,Jc,Lm),t);break}v_(n,Jc,Lm);break;case 4:if(l1(n,s),(s&4194240)===s)break;for(t=n.eventTimes,l=-1;0<s;){var u=31-of(s);d=1<<u,u=t[u],u>l&&(l=u),s&=~d}if(s=l,s=fa()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*EOe(s/1960))-s,10<s){n.timeoutHandle=qK(v_.bind(null,n,Jc,Lm),s);break}v_(n,Jc,Lm);break;case 5:v_(n,Jc,Lm);break;default:throw Error(on(329))}}}return nd(n,fa()),n.callbackNode===i?Kge.bind(null,n):null}function pq(n,t){var i=u4;return n.current.memoizedState.isDehydrated&&(uE(n,t).flags|=256),n=s7(n,t),n!==2&&(t=Jc,Jc=i,t!==null&&mq(t)),n}function mq(n){Jc===null?Jc=n:Jc.push.apply(Jc,n)}function wOe(n){for(var t=n;;){if(t.flags&16384){var i=t.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var s=0;s<i.length;s++){var l=i[s],d=l.getSnapshot;l=l.value;try{if(!uf(d(),l))return!1}catch{return!1}}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===n)break;for(;t.sibling===null;){if(t.return===null||t.return===n)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function l1(n,t){for(t&=~NJ,t&=~$j,n.suspendedLanes|=t,n.pingedLanes&=~t,n=n.expirationTimes;0<t;){var i=31-of(t),s=1<<i;n[i]=-1,t&=~s}}function rue(n){if(wr&6)throw Error(on(327));wC();var t=VM(n,0);if(!(t&1))return nd(n,fa()),null;var i=s7(n,t);if(n.tag!==0&&i===2){var s=BK(n);s!==0&&(t=s,i=pq(n,s))}if(i===1)throw i=M4,uE(n,0),l1(n,t),nd(n,fa()),i;if(i===6)throw Error(on(345));return n.finishedWork=n.current.alternate,n.finishedLanes=t,v_(n,Jc,Lm),nd(n,fa()),null}function PJ(n,t){var i=wr;wr|=1;try{return n(t)}finally{wr=i,wr===0&&(AR=fa()+500,zj&&Fv())}}function bE(n){hv!==null&&hv.tag===0&&!(wr&6)&&wC();var t=wr;wr|=1;var i=th.transition,s=Vr;try{if(th.transition=null,Vr=1,n)return n()}finally{Vr=s,th.transition=i,wr=t,!(wr&6)&&Fv()}}function LJ(){Bd=cC.current,Ss(cC)}function uE(n,t){n.finishedWork=null,n.finishedLanes=0;var i=n.timeoutHandle;if(i!==-1&&(n.timeoutHandle=-1,J5e(i)),xa!==null)for(i=xa.return;i!==null;){var s=i;switch(fJ(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&$M();break;case 3:RR(),Ss(ed),Ss(wl),SJ();break;case 5:wJ(s);break;case 4:RR();break;case 13:Ss(Bs);break;case 19:Ss(Bs);break;case 10:vJ(s.type._context);break;case 22:case 23:LJ()}i=i.return}if(bo=n,xa=n=Tv(n.current,null),Ko=Bd=t,$a=0,M4=null,NJ=$j=SE=0,Jc=u4=null,O_!==null){for(t=0;t<O_.length;t++)if(i=O_[t],s=i.interleaved,s!==null){i.interleaved=null;var l=s.next,d=i.pending;if(d!==null){var u=d.next;d.next=l,s.next=u}i.pending=s}O_=null}return n}function qge(n,t){do{var i=xa;try{if(gJ(),Bk.current=t7,e7){for(var s=zs.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}e7=!1}if(wE=0,wo=Ha=zs=null,c4=!1,L4=0,IJ.current=null,i===null||i.return===null){$a=1,M4=t,xa=null;break}e:{var d=n,u=i.return,p=i,g=t;if(t=Ko,p.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){var _=g,y=p,E=y.tag;if(!(y.mode&1)&&(E===0||E===11||E===15)){var b=y.alternate;b?(y.updateQueue=b.updateQueue,y.memoizedState=b.memoizedState,y.lanes=b.lanes):(y.updateQueue=null,y.memoizedState=null)}var A=Wde(u);if(A!==null){A.flags&=-257,$de(A,u,p,d,t),A.mode&1&&Gde(d,_,t),t=A,g=_;var N=t.updateQueue;if(N===null){var O=new Set;O.add(g),t.updateQueue=O}else N.add(g);break e}else{if(!(t&1)){Gde(d,_,t),DJ();break e}g=Error(on(426))}}else if(Ls&&p.mode&1){var D=Wde(u);if(D!==null){!(D.flags&65536)&&(D.flags|=256),$de(D,u,p,d,t),pJ(xR(g,p));break e}}d=g=xR(g,p),$a!==4&&($a=2),u4===null?u4=[d]:u4.push(d),d=u;do{switch(d.tag){case 3:d.flags|=65536,t&=-t,d.lanes|=t;var P=Oge(d,g,t);jde(d,P);break e;case 1:p=g;var j=d.type,M=d.stateNode;if(!(d.flags&128)&&(typeof j.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(bv===null||!bv.has(M)))){d.flags|=65536,t&=-t,d.lanes|=t;var V=Pge(d,p,t);jde(d,V);break e}}d=d.return}while(d!==null)}Jge(i)}catch(H){t=H,xa===i&&i!==null&&(xa=i=i.return);continue}break}while(!0)}function Yge(){var n=n7.current;return n7.current=t7,n===null?t7:n}function DJ(){($a===0||$a===3||$a===2)&&($a=4),bo===null||!(SE&268435455)&&!($j&268435455)||l1(bo,Ko)}function s7(n,t){var i=wr;wr|=2;var s=Yge();(bo!==n||Ko!==t)&&(Lm=null,uE(n,t));do try{SOe();break}catch(l){qge(n,l)}while(!0);if(gJ(),wr=i,n7.current=s,xa!==null)throw Error(on(261));return bo=null,Ko=0,$a}function SOe(){for(;xa!==null;)Xge(xa)}function bOe(){for(;xa!==null&&!qNe();)Xge(xa)}function Xge(n){var t=Zge(n.alternate,n,Bd);n.memoizedProps=n.pendingProps,t===null?Jge(n):xa=t,IJ.current=null}function Jge(n){var t=n;do{var i=t.alternate;if(n=t.return,t.flags&32768){if(i=gOe(i,t),i!==null){i.flags&=32767,xa=i;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{$a=6,xa=null;return}}else if(i=mOe(i,t,Bd),i!==null){xa=i;return}if(t=t.sibling,t!==null){xa=t;return}xa=t=n}while(t!==null);$a===0&&($a=5)}function v_(n,t,i){var s=Vr,l=th.transition;try{th.transition=null,Vr=1,COe(n,t,i,s)}finally{th.transition=l,Vr=s}return null}function COe(n,t,i,s){do wC();while(hv!==null);if(wr&6)throw Error(on(327));i=n.finishedWork;var l=n.finishedLanes;if(i===null)return null;if(n.finishedWork=null,n.finishedLanes=0,i===n.current)throw Error(on(177));n.callbackNode=null,n.callbackPriority=0;var d=i.lanes|i.childLanes;if(r5e(n,d),n===bo&&(xa=bo=null,Ko=0),!(i.subtreeFlags&2064)&&!(i.flags&2064)||mk||(mk=!0,e0e(BM,function(){return wC(),null})),d=(i.flags&15990)!==0,i.subtreeFlags&15990||d){d=th.transition,th.transition=null;var u=Vr;Vr=1;var p=wr;wr|=4,IJ.current=null,yOe(n,i),Wge(i,n),G5e($K),zM=!!WK,$K=WK=null,n.current=i,_Oe(i),YNe(),wr=p,Vr=u,th.transition=d}else n.current=i;if(mk&&(mk=!1,hv=n,r7=l),d=n.pendingLanes,d===0&&(bv=null),QNe(i.stateNode),nd(n,fa()),t!==null)for(s=n.onRecoverableError,i=0;i<t.length;i++)l=t[i],s(l.value,{componentStack:l.stack,digest:l.digest});if(i7)throw i7=!1,n=hq,hq=null,n;return r7&1&&n.tag!==0&&wC(),d=n.pendingLanes,d&1?n===fq?h4++:(h4=0,fq=n):h4=0,Fv(),null}function wC(){if(hv!==null){var n=Nme(r7),t=th.transition,i=Vr;try{if(th.transition=null,Vr=16>n?16:n,hv===null)var s=!1;else{if(n=hv,hv=null,r7=0,wr&6)throw Error(on(331));var l=wr;for(wr|=4,An=n.current;An!==null;){var d=An,u=d.child;if(An.flags&16){var p=d.deletions;if(p!==null){for(var g=0;g<p.length;g++){var _=p[g];for(An=_;An!==null;){var y=An;switch(y.tag){case 0:case 11:case 15:d4(8,y,d)}var E=y.child;if(E!==null)E.return=y,An=E;else for(;An!==null;){y=An;var b=y.sibling,A=y.return;if(zge(y),y===_){An=null;break}if(b!==null){b.return=A,An=b;break}An=A}}}var N=d.alternate;if(N!==null){var O=N.child;if(O!==null){N.child=null;do{var D=O.sibling;O.sibling=null,O=D}while(O!==null)}}An=d}}if(d.subtreeFlags&2064&&u!==null)u.return=d,An=u;else e:for(;An!==null;){if(d=An,d.flags&2048)switch(d.tag){case 0:case 11:case 15:d4(9,d,d.return)}var P=d.sibling;if(P!==null){P.return=d.return,An=P;break e}An=d.return}}var j=n.current;for(An=j;An!==null;){u=An;var M=u.child;if(u.subtreeFlags&2064&&M!==null)M.return=u,An=M;else e:for(u=j;An!==null;){if(p=An,p.flags&2048)try{switch(p.tag){case 0:case 11:case 15:Wj(9,p)}}catch(H){Zs(p,p.return,H)}if(p===u){An=null;break e}var V=p.sibling;if(V!==null){V.return=p.return,An=V;break e}An=p.return}}if(wr=l,Fv(),Dp&&typeof Dp.onPostCommitFiberRoot=="function")try{Dp.onPostCommitFiberRoot(jj,n)}catch{}s=!0}return s}finally{Vr=i,th.transition=t}}return!1}function sue(n,t,i){t=xR(i,t),t=Oge(n,t,1),n=Sv(n,t,1),t=ac(),n!==null&&(kO(n,1,t),nd(n,t))}function Zs(n,t,i){if(n.tag===3)sue(n,n,i);else for(;t!==null;){if(t.tag===3){sue(t,n,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(bv===null||!bv.has(s))){n=xR(i,n),n=Pge(t,n,1),t=Sv(t,n,1),n=ac(),t!==null&&(kO(t,1,n),nd(t,n));break}}t=t.return}}function TOe(n,t,i){var s=n.pingCache;s!==null&&s.delete(t),t=ac(),n.pingedLanes|=n.suspendedLanes&i,bo===n&&(Ko&i)===i&&($a===4||$a===3&&(Ko&130023424)===Ko&&500>fa()-OJ?uE(n,0):NJ|=i),nd(n,t)}function Qge(n,t){t===0&&(n.mode&1?(t=sk,sk<<=1,!(sk&130023424)&&(sk=4194304)):t=1);var i=ac();n=Og(n,t),n!==null&&(kO(n,t,i),nd(n,i))}function ROe(n){var t=n.memoizedState,i=0;t!==null&&(i=t.retryLane),Qge(n,i)}function xOe(n,t){var i=0;switch(n.tag){case 13:var s=n.stateNode,l=n.memoizedState;l!==null&&(i=l.retryLane);break;case 19:s=n.stateNode;break;default:throw Error(on(314))}s!==null&&s.delete(t),Qge(n,i)}var Zge;Zge=function(n,t,i){if(n!==null)if(n.memoizedProps!==t.pendingProps||ed.current)Zc=!0;else{if(!(n.lanes&i)&&!(t.flags&128))return Zc=!1,pOe(n,t,i);Zc=!!(n.flags&131072)}else Zc=!1,Ls&&t.flags&1048576&&nge(t,YM,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;zk(n,t),n=t.pendingProps;var l=bR(t,wl.current);EC(t,i),l=CJ(null,t,s,n,l,i);var d=TJ();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,td(s)?(d=!0,KM(t)):d=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,_J(t),l.updater=Hj,t.stateNode=l,l._reactInternals=t,tq(t,s,n,i),t=rq(null,t,s,!0,d,i)):(t.tag=0,Ls&&d&&hJ(t),nc(null,t,l,i),t=t.child),t;case 16:s=t.elementType;e:{switch(zk(n,t),n=t.pendingProps,l=s._init,s=l(s._payload),t.type=s,l=t.tag=IOe(s),n=Bh(s,n),l){case 0:t=iq(null,t,s,n,i);break e;case 1:t=Yde(null,t,s,n,i);break e;case 11:t=Kde(null,t,s,n,i);break e;case 14:t=qde(null,t,s,Bh(s.type,n),i);break e}throw Error(on(306,s,""))}return t;case 0:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Bh(s,l),iq(n,t,s,l,i);case 1:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Bh(s,l),Yde(n,t,s,l,i);case 3:e:{if(Mge(t),n===null)throw Error(on(387));s=t.pendingProps,d=t.memoizedState,l=d.element,age(n,t),QM(t,s,null,i);var u=t.memoizedState;if(s=u.element,d.isDehydrated)if(d={element:s,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){l=xR(Error(on(423)),t),t=Xde(n,t,s,i,l);break e}else if(s!==l){l=xR(Error(on(424)),t),t=Xde(n,t,s,i,l);break e}else for(Gd=wv(t.stateNode.containerInfo.firstChild),qd=t,Ls=!0,rf=null,i=dge(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(CR(),s===l){t=Pg(n,t,i);break e}nc(n,t,s,i)}t=t.child}return t;case 5:return uge(t),n===null&&QK(t),s=t.type,l=t.pendingProps,d=n!==null?n.memoizedProps:null,u=l.children,KK(s,l)?u=null:d!==null&&KK(s,d)&&(t.flags|=32),kge(n,t),nc(n,t,u,i),t.child;case 6:return n===null&&QK(t),null;case 13:return jge(n,t,i);case 4:return EJ(t,t.stateNode.containerInfo),s=t.pendingProps,n===null?t.child=TR(t,null,s,i):nc(n,t,s,i),t.child;case 11:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Bh(s,l),Kde(n,t,s,l,i);case 7:return nc(n,t,t.pendingProps,i),t.child;case 8:return nc(n,t,t.pendingProps.children,i),t.child;case 12:return nc(n,t,t.pendingProps.children,i),t.child;case 10:e:{if(s=t.type._context,l=t.pendingProps,d=t.memoizedProps,u=l.value,cs(XM,s._currentValue),s._currentValue=u,d!==null)if(uf(d.value,u)){if(d.children===l.children&&!ed.current){t=Pg(n,t,i);break e}}else for(d=t.child,d!==null&&(d.return=t);d!==null;){var p=d.dependencies;if(p!==null){u=d.child;for(var g=p.firstContext;g!==null;){if(g.context===s){if(d.tag===1){g=xg(-1,i&-i),g.tag=2;var _=d.updateQueue;if(_!==null){_=_.shared;var y=_.pending;y===null?g.next=g:(g.next=y.next,y.next=g),_.pending=g}}d.lanes|=i,g=d.alternate,g!==null&&(g.lanes|=i),ZK(d.return,i,t),p.lanes|=i;break}g=g.next}}else if(d.tag===10)u=d.type===t.type?null:d.child;else if(d.tag===18){if(u=d.return,u===null)throw Error(on(341));u.lanes|=i,p=u.alternate,p!==null&&(p.lanes|=i),ZK(u,i,t),u=d.sibling}else u=d.child;if(u!==null)u.return=d;else for(u=d;u!==null;){if(u===t){u=null;break}if(d=u.sibling,d!==null){d.return=u.return,u=d;break}u=u.return}d=u}nc(n,t,l.children,i),t=t.child}return t;case 9:return l=t.type,s=t.pendingProps.children,EC(t,i),l=nh(l),s=s(l),t.flags|=1,nc(n,t,s,i),t.child;case 14:return s=t.type,l=Bh(s,t.pendingProps),l=Bh(s.type,l),qde(n,t,s,l,i);case 15:return Lge(n,t,t.type,t.pendingProps,i);case 17:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Bh(s,l),zk(n,t),t.tag=1,td(s)?(n=!0,KM(t)):n=!1,EC(t,i),lge(t,s,l),tq(t,s,l,i),rq(null,t,s,!0,n,i);case 19:return Uge(n,t,i);case 22:return Dge(n,t,i)}throw Error(on(156,t.tag))};function e0e(n,t){return Rme(n,t)}function AOe(n,t,i,s){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function eh(n,t,i,s){return new AOe(n,t,i,s)}function kJ(n){return n=n.prototype,!(!n||!n.isReactComponent)}function IOe(n){if(typeof n=="function")return kJ(n)?1:0;if(n!=null){if(n=n.$$typeof,n===eJ)return 11;if(n===tJ)return 14}return 2}function Tv(n,t){var i=n.alternate;return i===null?(i=eh(n.tag,t,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=t,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&14680064,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,t=n.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i}function Wk(n,t,i,s,l,d){var u=2;if(s=n,typeof n=="function")kJ(n)&&(u=1);else if(typeof n=="string")u=5;else e:switch(n){case Zb:return hE(i.children,l,d,t);case ZX:u=8,l|=8;break;case TK:return n=eh(12,i,t,l|2),n.elementType=TK,n.lanes=d,n;case RK:return n=eh(13,i,t,l),n.elementType=RK,n.lanes=d,n;case xK:return n=eh(19,i,t,l),n.elementType=xK,n.lanes=d,n;case cme:return Kj(i,l,d,t);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case ome:u=10;break e;case lme:u=9;break e;case eJ:u=11;break e;case tJ:u=14;break e;case i1:u=16,s=null;break e}throw Error(on(130,n==null?n:typeof n,""))}return t=eh(u,i,t,l),t.elementType=n,t.type=s,t.lanes=d,t}function hE(n,t,i,s){return n=eh(7,n,s,t),n.lanes=i,n}function Kj(n,t,i,s){return n=eh(22,n,s,t),n.elementType=cme,n.lanes=i,n.stateNode={isHidden:!1},n}function S$(n,t,i){return n=eh(6,n,null,t),n.lanes=i,n}function b$(n,t,i){return t=eh(4,n.children!==null?n.children:[],n.key,t),t.lanes=i,t.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},t}function NOe(n,t,i,s,l){this.tag=t,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=i$(0),this.expirationTimes=i$(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=i$(0),this.identifierPrefix=s,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function MJ(n,t,i,s,l,d,u,p,g){return n=new NOe(n,t,i,p,g),t===1?(t=1,d===!0&&(t|=8)):t=0,d=eh(3,null,null,t),n.current=d,d.stateNode=n,d.memoizedState={element:s,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},_J(d),n}function OOe(n,t,i){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qb,key:s==null?null:""+s,children:n,containerInfo:t,implementation:i}}function t0e(n){if(!n)return Ov;n=n._reactInternals;e:{if(ME(n)!==n||n.tag!==1)throw Error(on(170));var t=n;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(td(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(on(171))}if(n.tag===1){var i=n.type;if(td(i))return ege(n,i,t)}return t}function n0e(n,t,i,s,l,d,u,p,g){return n=MJ(i,s,!0,n,l,d,u,p,g),n.context=t0e(null),i=n.current,s=ac(),l=Cv(i),d=xg(s,l),d.callback=t??null,Sv(i,d,l),n.current.lanes=l,kO(n,l,s),nd(n,s),n}function qj(n,t,i,s){var l=t.current,d=ac(),u=Cv(l);return i=t0e(i),t.context===null?t.context=i:t.pendingContext=i,t=xg(d,u),t.payload={element:n},s=s===void 0?null:s,s!==null&&(t.callback=s),n=Sv(l,t,u),n!==null&&(lf(n,l,u,d),Fk(n,l,u)),u}function a7(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function aue(n,t){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<t?i:t}}function jJ(n,t){aue(n,t),(n=n.alternate)&&aue(n,t)}function POe(){return null}var i0e=typeof reportError=="function"?reportError:function(n){console.error(n)};function UJ(n){this._internalRoot=n}Yj.prototype.render=UJ.prototype.render=function(n){var t=this._internalRoot;if(t===null)throw Error(on(409));qj(n,t,null,null)};Yj.prototype.unmount=UJ.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var t=n.containerInfo;bE(function(){qj(null,n,null,null)}),t[Ng]=null}};function Yj(n){this._internalRoot=n}Yj.prototype.unstable_scheduleHydration=function(n){if(n){var t=Lme();n={blockedOn:null,target:n,priority:t};for(var i=0;i<o1.length&&t!==0&&t<o1[i].priority;i++);o1.splice(i,0,n),i===0&&kme(n)}};function FJ(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function Xj(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function oue(){}function LOe(n,t,i,s,l){if(l){if(typeof s=="function"){var d=s;s=function(){var _=a7(u);d.call(_)}}var u=n0e(t,s,n,0,null,!1,!1,"",oue);return n._reactRootContainer=u,n[Ng]=u.current,A4(n.nodeType===8?n.parentNode:n),bE(),u}for(;l=n.lastChild;)n.removeChild(l);if(typeof s=="function"){var p=s;s=function(){var _=a7(g);p.call(_)}}var g=MJ(n,0,!1,null,null,!1,!1,"",oue);return n._reactRootContainer=g,n[Ng]=g.current,A4(n.nodeType===8?n.parentNode:n),bE(function(){qj(t,g,i,s)}),g}function Jj(n,t,i,s,l){var d=i._reactRootContainer;if(d){var u=d;if(typeof l=="function"){var p=l;l=function(){var g=a7(u);p.call(g)}}qj(t,u,n,l)}else u=LOe(i,t,n,l,s);return a7(u)}Ome=function(n){switch(n.tag){case 3:var t=n.stateNode;if(t.current.memoizedState.isDehydrated){var i=RI(t.pendingLanes);i!==0&&(rJ(t,i|1),nd(t,fa()),!(wr&6)&&(AR=fa()+500,Fv()))}break;case 13:bE(function(){var s=Og(n,1);if(s!==null){var l=ac();lf(s,n,1,l)}}),jJ(n,1)}};sJ=function(n){if(n.tag===13){var t=Og(n,134217728);if(t!==null){var i=ac();lf(t,n,134217728,i)}jJ(n,134217728)}};Pme=function(n){if(n.tag===13){var t=Cv(n),i=Og(n,t);if(i!==null){var s=ac();lf(i,n,t,s)}jJ(n,t)}};Lme=function(){return Vr};Dme=function(n,t){var i=Vr;try{return Vr=n,t()}finally{Vr=i}};jK=function(n,t,i){switch(t){case"input":if(NK(n,i),t=i.name,i.type==="radio"&&t!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==n&&s.form===n.form){var l=Vj(s);if(!l)throw Error(on(90));ume(s),NK(s,l)}}}break;case"textarea":fme(n,i);break;case"select":t=i.value,t!=null&&gC(n,!!i.multiple,t,!1)}};Eme=PJ;wme=bE;var DOe={usingClientEntryPoint:!1,Events:[jO,iC,Vj,yme,_me,PJ]},hI={findFiberByHostInstance:N_,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},kOe={bundleType:hI.bundleType,version:hI.version,rendererPackageName:hI.rendererPackageName,rendererConfig:hI.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Dg.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Cme(n),n===null?null:n.stateNode},findFiberByHostInstance:hI.findFiberByHostInstance||POe,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gk=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gk.isDisabled&&gk.supportsFiber)try{jj=gk.inject(kOe),Dp=gk}catch{}}Zd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=DOe;Zd.createPortal=function(n,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!FJ(t))throw Error(on(200));return OOe(n,t,null,i)};Zd.createRoot=function(n,t){if(!FJ(n))throw Error(on(299));var i=!1,s="",l=i0e;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(l=t.onRecoverableError)),t=MJ(n,1,!1,null,null,i,!1,s,l),n[Ng]=t.current,A4(n.nodeType===8?n.parentNode:n),new UJ(t)};Zd.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var t=n._reactInternals;if(t===void 0)throw typeof n.render=="function"?Error(on(188)):(n=Object.keys(n).join(","),Error(on(268,n)));return n=Cme(t),n=n===null?null:n.stateNode,n};Zd.flushSync=function(n){return bE(n)};Zd.hydrate=function(n,t,i){if(!Xj(t))throw Error(on(200));return Jj(null,n,t,!0,i)};Zd.hydrateRoot=function(n,t,i){if(!FJ(n))throw Error(on(405));var s=i!=null&&i.hydratedSources||null,l=!1,d="",u=i0e;if(i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(u=i.onRecoverableError)),t=n0e(t,null,n,1,i??null,l,!1,d,u),n[Ng]=t.current,A4(n),s)for(n=0;n<s.length;n++)i=s[n],l=i._getVersion,l=l(i._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[i,l]:t.mutableSourceEagerHydrationData.push(i,l);return new Yj(t)};Zd.render=function(n,t,i){if(!Xj(t))throw Error(on(200));return Jj(null,n,t,!1,i)};Zd.unmountComponentAtNode=function(n){if(!Xj(n))throw Error(on(40));return n._reactRootContainer?(bE(function(){Jj(null,null,n,!1,function(){n._reactRootContainer=null,n[Ng]=null})}),!0):!1};Zd.unstable_batchedUpdates=PJ;Zd.unstable_renderSubtreeIntoContainer=function(n,t,i,s){if(!Xj(i))throw Error(on(200));if(n==null||n._reactInternals===void 0)throw Error(on(38));return Jj(n,t,i,!1,s)};Zd.version="18.2.0-next-9e3b772b8-20220608";function r0e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r0e)}catch(n){console.error(n)}}r0e(),nme.exports=Zd;var BJ=nme.exports;const dC=Mv(BJ);var lue=BJ;bK.createRoot=lue.createRoot,bK.hydrateRoot=lue.hydrateRoot;Promise.withResolvers||(Promise.withResolvers=function(){let n,t;return{promise:new Promise((s,l)=>{n=s,t=l}),resolve:n,reject:t}});URL.parse||(URL.parse=function(n,t){try{return new URL(n,t)}catch(i){return console.log(i),console.log("Inside catch block on URL.parse "),null}});const Wo=globalThis||void 0||self;function MOe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var s0e={exports:{}},ga=s0e.exports={},ip,rp;function gq(){throw new Error("setTimeout has not been defined")}function vq(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ip=setTimeout:ip=gq}catch{ip=gq}try{typeof clearTimeout=="function"?rp=clearTimeout:rp=vq}catch{rp=vq}})();function a0e(n){if(ip===setTimeout)return setTimeout(n,0);if((ip===gq||!ip)&&setTimeout)return ip=setTimeout,setTimeout(n,0);try{return ip(n,0)}catch{try{return ip.call(null,n,0)}catch{return ip.call(this,n,0)}}}function jOe(n){if(rp===clearTimeout)return clearTimeout(n);if((rp===vq||!rp)&&clearTimeout)return rp=clearTimeout,clearTimeout(n);try{return rp(n)}catch{try{return rp.call(null,n)}catch{return rp.call(this,n)}}}var Rg=[],SC=!1,L_,$k=-1;function UOe(){!SC||!L_||(SC=!1,L_.length?Rg=L_.concat(Rg):$k=-1,Rg.length&&o0e())}function o0e(){if(!SC){var n=a0e(UOe);SC=!0;for(var t=Rg.length;t;){for(L_=Rg,Rg=[];++$k<t;)L_&&L_[$k].run();$k=-1,t=Rg.length}L_=null,SC=!1,jOe(n)}}ga.nextTick=function(n){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];Rg.push(new l0e(n,t)),Rg.length===1&&!SC&&a0e(o0e)};function l0e(n,t){this.fun=n,this.array=t}l0e.prototype.run=function(){this.fun.apply(null,this.array)};ga.title="browser";ga.browser=!0;ga.env={};ga.argv=[];ga.version="";ga.versions={};function kg(){}ga.on=kg;ga.addListener=kg;ga.once=kg;ga.off=kg;ga.removeListener=kg;ga.removeAllListeners=kg;ga.emit=kg;ga.prependListener=kg;ga.prependOnceListener=kg;ga.listeners=function(n){return[]};ga.binding=function(n){throw new Error("process.binding is not supported")};ga.cwd=function(){return"/"};ga.chdir=function(n){throw new Error("process.chdir is not supported")};ga.umask=function(){return 0};var FOe=s0e.exports;const ic=MOe(FOe);var VJ={},Qj={};Qj.byteLength=zOe;Qj.toByteArray=GOe;Qj.fromByteArray=KOe;var Op=[],Uu=[],BOe=typeof Uint8Array<"u"?Uint8Array:Array,C$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var xb=0,VOe=C$.length;xb<VOe;++xb)Op[xb]=C$[xb],Uu[C$.charCodeAt(xb)]=xb;Uu[45]=62;Uu[95]=63;function c0e(n){var t=n.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=n.indexOf("=");i===-1&&(i=t);var s=i===t?0:4-i%4;return[i,s]}function zOe(n){var t=c0e(n),i=t[0],s=t[1];return(i+s)*3/4-s}function HOe(n,t,i){return(t+i)*3/4-i}function GOe(n){var t,i=c0e(n),s=i[0],l=i[1],d=new BOe(HOe(n,s,l)),u=0,p=l>0?s-4:s,g;for(g=0;g<p;g+=4)t=Uu[n.charCodeAt(g)]<<18|Uu[n.charCodeAt(g+1)]<<12|Uu[n.charCodeAt(g+2)]<<6|Uu[n.charCodeAt(g+3)],d[u++]=t>>16&255,d[u++]=t>>8&255,d[u++]=t&255;return l===2&&(t=Uu[n.charCodeAt(g)]<<2|Uu[n.charCodeAt(g+1)]>>4,d[u++]=t&255),l===1&&(t=Uu[n.charCodeAt(g)]<<10|Uu[n.charCodeAt(g+1)]<<4|Uu[n.charCodeAt(g+2)]>>2,d[u++]=t>>8&255,d[u++]=t&255),d}function WOe(n){return Op[n>>18&63]+Op[n>>12&63]+Op[n>>6&63]+Op[n&63]}function $Oe(n,t,i){for(var s,l=[],d=t;d<i;d+=3)s=(n[d]<<16&16711680)+(n[d+1]<<8&65280)+(n[d+2]&255),l.push(WOe(s));return l.join("")}function KOe(n){for(var t,i=n.length,s=i%3,l=[],d=16383,u=0,p=i-s;u<p;u+=d)l.push($Oe(n,u,u+d>p?p:u+d));return s===1?(t=n[i-1],l.push(Op[t>>2]+Op[t<<4&63]+"==")):s===2&&(t=(n[i-2]<<8)+n[i-1],l.push(Op[t>>10]+Op[t>>4&63]+Op[t<<2&63]+"=")),l.join("")}var zJ={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */zJ.read=function(n,t,i,s,l){var d,u,p=l*8-s-1,g=(1<<p)-1,_=g>>1,y=-7,E=i?l-1:0,b=i?-1:1,A=n[t+E];for(E+=b,d=A&(1<<-y)-1,A>>=-y,y+=p;y>0;d=d*256+n[t+E],E+=b,y-=8);for(u=d&(1<<-y)-1,d>>=-y,y+=s;y>0;u=u*256+n[t+E],E+=b,y-=8);if(d===0)d=1-_;else{if(d===g)return u?NaN:(A?-1:1)*(1/0);u=u+Math.pow(2,s),d=d-_}return(A?-1:1)*u*Math.pow(2,d-s)};zJ.write=function(n,t,i,s,l,d){var u,p,g,_=d*8-l-1,y=(1<<_)-1,E=y>>1,b=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=s?0:d-1,N=s?1:-1,O=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(p=isNaN(t)?1:0,u=y):(u=Math.floor(Math.log(t)/Math.LN2),t*(g=Math.pow(2,-u))<1&&(u--,g*=2),u+E>=1?t+=b/g:t+=b*Math.pow(2,1-E),t*g>=2&&(u++,g/=2),u+E>=y?(p=0,u=y):u+E>=1?(p=(t*g-1)*Math.pow(2,l),u=u+E):(p=t*Math.pow(2,E-1)*Math.pow(2,l),u=0));l>=8;n[i+A]=p&255,A+=N,p/=256,l-=8);for(u=u<<l|p,_+=l;_>0;n[i+A]=u&255,A+=N,u/=256,_-=8);n[i+A-N]|=O*128};/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/(function(n){const t=Qj,i=zJ,s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=y,n.SlowBuffer=H,n.INSPECT_MAX_BYTES=50;const l=2147483647;n.kMaxLength=l;const{Uint8Array:d,ArrayBuffer:u,SharedArrayBuffer:p}=globalThis;y.TYPED_ARRAY_SUPPORT=g(),!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function g(){try{const ye=new d(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,d.prototype),Object.setPrototypeOf(ye,J),ye.foo()===42}catch{return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function _(ye){if(ye>l)throw new RangeError('The value "'+ye+'" is invalid for option "size"');const J=new d(ye);return Object.setPrototypeOf(J,y.prototype),J}function y(ye,J,ne){if(typeof ye=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return N(ye)}return E(ye,J,ne)}y.poolSize=8192;function E(ye,J,ne){if(typeof ye=="string")return O(ye,J);if(u.isView(ye))return P(ye);if(ye==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ye);if(St(ye,u)||ye&&St(ye.buffer,u)||typeof p<"u"&&(St(ye,p)||ye&&St(ye.buffer,p)))return j(ye,J,ne);if(typeof ye=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Se=ye.valueOf&&ye.valueOf();if(Se!=null&&Se!==ye)return y.from(Se,J,ne);const Ue=M(ye);if(Ue)return Ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ye[Symbol.toPrimitive]=="function")return y.from(ye[Symbol.toPrimitive]("string"),J,ne);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ye)}y.from=function(ye,J,ne){return E(ye,J,ne)},Object.setPrototypeOf(y.prototype,d.prototype),Object.setPrototypeOf(y,d);function b(ye){if(typeof ye!="number")throw new TypeError('"size" argument must be of type number');if(ye<0)throw new RangeError('The value "'+ye+'" is invalid for option "size"')}function A(ye,J,ne){return b(ye),ye<=0?_(ye):J!==void 0?typeof ne=="string"?_(ye).fill(J,ne):_(ye).fill(J):_(ye)}y.alloc=function(ye,J,ne){return A(ye,J,ne)};function N(ye){return b(ye),_(ye<0?0:V(ye)|0)}y.allocUnsafe=function(ye){return N(ye)},y.allocUnsafeSlow=function(ye){return N(ye)};function O(ye,J){if((typeof J!="string"||J==="")&&(J="utf8"),!y.isEncoding(J))throw new TypeError("Unknown encoding: "+J);const ne=$(ye,J)|0;let Se=_(ne);const Ue=Se.write(ye,J);return Ue!==ne&&(Se=Se.slice(0,Ue)),Se}function D(ye){const J=ye.length<0?0:V(ye.length)|0,ne=_(J);for(let Se=0;Se<J;Se+=1)ne[Se]=ye[Se]&255;return ne}function P(ye){if(St(ye,d)){const J=new d(ye);return j(J.buffer,J.byteOffset,J.byteLength)}return D(ye)}function j(ye,J,ne){if(J<0||ye.byteLength<J)throw new RangeError('"offset" is outside of buffer bounds');if(ye.byteLength<J+(ne||0))throw new RangeError('"length" is outside of buffer bounds');let Se;return J===void 0&&ne===void 0?Se=new d(ye):ne===void 0?Se=new d(ye,J):Se=new d(ye,J,ne),Object.setPrototypeOf(Se,y.prototype),Se}function M(ye){if(y.isBuffer(ye)){const J=V(ye.length)|0,ne=_(J);return ne.length===0||ye.copy(ne,0,0,J),ne}if(ye.length!==void 0)return typeof ye.length!="number"||Lt(ye.length)?_(0):D(ye);if(ye.type==="Buffer"&&Array.isArray(ye.data))return D(ye.data)}function V(ye){if(ye>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return ye|0}function H(ye){return+ye!=ye&&(ye=0),y.alloc(+ye)}y.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==y.prototype},y.compare=function(J,ne){if(St(J,d)&&(J=y.from(J,J.offset,J.byteLength)),St(ne,d)&&(ne=y.from(ne,ne.offset,ne.byteLength)),!y.isBuffer(J)||!y.isBuffer(ne))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===ne)return 0;let Se=J.length,Ue=ne.length;for(let tt=0,Te=Math.min(Se,Ue);tt<Te;++tt)if(J[tt]!==ne[tt]){Se=J[tt],Ue=ne[tt];break}return Se<Ue?-1:Ue<Se?1:0},y.isEncoding=function(J){switch(String(J).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(J,ne){if(!Array.isArray(J))throw new TypeError('"list" argument must be an Array of Buffers');if(J.length===0)return y.alloc(0);let Se;if(ne===void 0)for(ne=0,Se=0;Se<J.length;++Se)ne+=J[Se].length;const Ue=y.allocUnsafe(ne);let tt=0;for(Se=0;Se<J.length;++Se){let Te=J[Se];if(St(Te,d))tt+Te.length>Ue.length?(y.isBuffer(Te)||(Te=y.from(Te)),Te.copy(Ue,tt)):d.prototype.set.call(Ue,Te,tt);else if(y.isBuffer(Te))Te.copy(Ue,tt);else throw new TypeError('"list" argument must be an Array of Buffers');tt+=Te.length}return Ue};function $(ye,J){if(y.isBuffer(ye))return ye.length;if(u.isView(ye)||St(ye,u))return ye.byteLength;if(typeof ye!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ye);const ne=ye.length,Se=arguments.length>2&&arguments[2]===!0;if(!Se&&ne===0)return 0;let Ue=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return ne;case"utf8":case"utf-8":return dt(ye).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne*2;case"hex":return ne>>>1;case"base64":return We(ye).length;default:if(Ue)return Se?-1:dt(ye).length;J=(""+J).toLowerCase(),Ue=!0}}y.byteLength=$;function Q(ye,J,ne){let Se=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((ne===void 0||ne>this.length)&&(ne=this.length),ne<=0)||(ne>>>=0,J>>>=0,ne<=J))return"";for(ye||(ye="utf8");;)switch(ye){case"hex":return je(this,J,ne);case"utf8":case"utf-8":return Ce(this,J,ne);case"ascii":return Ne(this,J,ne);case"latin1":case"binary":return Fe(this,J,ne);case"base64":return he(this,J,ne);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ve(this,J,ne);default:if(Se)throw new TypeError("Unknown encoding: "+ye);ye=(ye+"").toLowerCase(),Se=!0}}y.prototype._isBuffer=!0;function Y(ye,J,ne){const Se=ye[J];ye[J]=ye[ne],ye[ne]=Se}y.prototype.swap16=function(){const J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ne=0;ne<J;ne+=2)Y(this,ne,ne+1);return this},y.prototype.swap32=function(){const J=this.length;if(J%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ne=0;ne<J;ne+=4)Y(this,ne,ne+3),Y(this,ne+1,ne+2);return this},y.prototype.swap64=function(){const J=this.length;if(J%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ne=0;ne<J;ne+=8)Y(this,ne,ne+7),Y(this,ne+1,ne+6),Y(this,ne+2,ne+5),Y(this,ne+3,ne+4);return this},y.prototype.toString=function(){const J=this.length;return J===0?"":arguments.length===0?Ce(this,0,J):Q.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(J){if(!y.isBuffer(J))throw new TypeError("Argument must be a Buffer");return this===J?!0:y.compare(this,J)===0},y.prototype.inspect=function(){let J="";const ne=n.INSPECT_MAX_BYTES;return J=this.toString("hex",0,ne).replace(/(.{2})/g,"$1 ").trim(),this.length>ne&&(J+=" ... "),"<Buffer "+J+">"},s&&(y.prototype[s]=y.prototype.inspect),y.prototype.compare=function(J,ne,Se,Ue,tt){if(St(J,d)&&(J=y.from(J,J.offset,J.byteLength)),!y.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(ne===void 0&&(ne=0),Se===void 0&&(Se=J?J.length:0),Ue===void 0&&(Ue=0),tt===void 0&&(tt=this.length),ne<0||Se>J.length||Ue<0||tt>this.length)throw new RangeError("out of range index");if(Ue>=tt&&ne>=Se)return 0;if(Ue>=tt)return-1;if(ne>=Se)return 1;if(ne>>>=0,Se>>>=0,Ue>>>=0,tt>>>=0,this===J)return 0;let Te=tt-Ue,Pe=Se-ne;const Qe=Math.min(Te,Pe),nt=this.slice(Ue,tt),$e=J.slice(ne,Se);for(let st=0;st<Qe;++st)if(nt[st]!==$e[st]){Te=nt[st],Pe=$e[st];break}return Te<Pe?-1:Pe<Te?1:0};function le(ye,J,ne,Se,Ue){if(ye.length===0)return-1;if(typeof ne=="string"?(Se=ne,ne=0):ne>2147483647?ne=2147483647:ne<-2147483648&&(ne=-2147483648),ne=+ne,Lt(ne)&&(ne=Ue?0:ye.length-1),ne<0&&(ne=ye.length+ne),ne>=ye.length){if(Ue)return-1;ne=ye.length-1}else if(ne<0)if(Ue)ne=0;else return-1;if(typeof J=="string"&&(J=y.from(J,Se)),y.isBuffer(J))return J.length===0?-1:ae(ye,J,ne,Se,Ue);if(typeof J=="number")return J=J&255,typeof d.prototype.indexOf=="function"?Ue?d.prototype.indexOf.call(ye,J,ne):d.prototype.lastIndexOf.call(ye,J,ne):ae(ye,[J],ne,Se,Ue);throw new TypeError("val must be string, number or Buffer")}function ae(ye,J,ne,Se,Ue){let tt=1,Te=ye.length,Pe=J.length;if(Se!==void 0&&(Se=String(Se).toLowerCase(),Se==="ucs2"||Se==="ucs-2"||Se==="utf16le"||Se==="utf-16le")){if(ye.length<2||J.length<2)return-1;tt=2,Te/=2,Pe/=2,ne/=2}function Qe($e,st){return tt===1?$e[st]:$e.readUInt16BE(st*tt)}let nt;if(Ue){let $e=-1;for(nt=ne;nt<Te;nt++)if(Qe(ye,nt)===Qe(J,$e===-1?0:nt-$e)){if($e===-1&&($e=nt),nt-$e+1===Pe)return $e*tt}else $e!==-1&&(nt-=nt-$e),$e=-1}else for(ne+Pe>Te&&(ne=Te-Pe),nt=ne;nt>=0;nt--){let $e=!0;for(let st=0;st<Pe;st++)if(Qe(ye,nt+st)!==Qe(J,st)){$e=!1;break}if($e)return nt}return-1}y.prototype.includes=function(J,ne,Se){return this.indexOf(J,ne,Se)!==-1},y.prototype.indexOf=function(J,ne,Se){return le(this,J,ne,Se,!0)},y.prototype.lastIndexOf=function(J,ne,Se){return le(this,J,ne,Se,!1)};function te(ye,J,ne,Se){ne=Number(ne)||0;const Ue=ye.length-ne;Se?(Se=Number(Se),Se>Ue&&(Se=Ue)):Se=Ue;const tt=J.length;Se>tt/2&&(Se=tt/2);let Te;for(Te=0;Te<Se;++Te){const Pe=parseInt(J.substr(Te*2,2),16);if(Lt(Pe))return Te;ye[ne+Te]=Pe}return Te}function de(ye,J,ne,Se){return bt(dt(J,ye.length-ne),ye,ne,Se)}function G(ye,J,ne,Se){return bt(it(J),ye,ne,Se)}function ie(ye,J,ne,Se){return bt(We(J),ye,ne,Se)}function _e(ye,J,ne,Se){return bt(Me(J,ye.length-ne),ye,ne,Se)}y.prototype.write=function(J,ne,Se,Ue){if(ne===void 0)Ue="utf8",Se=this.length,ne=0;else if(Se===void 0&&typeof ne=="string")Ue=ne,Se=this.length,ne=0;else if(isFinite(ne))ne=ne>>>0,isFinite(Se)?(Se=Se>>>0,Ue===void 0&&(Ue="utf8")):(Ue=Se,Se=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const tt=this.length-ne;if((Se===void 0||Se>tt)&&(Se=tt),J.length>0&&(Se<0||ne<0)||ne>this.length)throw new RangeError("Attempt to write outside buffer bounds");Ue||(Ue="utf8");let Te=!1;for(;;)switch(Ue){case"hex":return te(this,J,ne,Se);case"utf8":case"utf-8":return de(this,J,ne,Se);case"ascii":case"latin1":case"binary":return G(this,J,ne,Se);case"base64":return ie(this,J,ne,Se);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _e(this,J,ne,Se);default:if(Te)throw new TypeError("Unknown encoding: "+Ue);Ue=(""+Ue).toLowerCase(),Te=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function he(ye,J,ne){return J===0&&ne===ye.length?t.fromByteArray(ye):t.fromByteArray(ye.slice(J,ne))}function Ce(ye,J,ne){ne=Math.min(ye.length,ne);const Se=[];let Ue=J;for(;Ue<ne;){const tt=ye[Ue];let Te=null,Pe=tt>239?4:tt>223?3:tt>191?2:1;if(Ue+Pe<=ne){let Qe,nt,$e,st;switch(Pe){case 1:tt<128&&(Te=tt);break;case 2:Qe=ye[Ue+1],(Qe&192)===128&&(st=(tt&31)<<6|Qe&63,st>127&&(Te=st));break;case 3:Qe=ye[Ue+1],nt=ye[Ue+2],(Qe&192)===128&&(nt&192)===128&&(st=(tt&15)<<12|(Qe&63)<<6|nt&63,st>2047&&(st<55296||st>57343)&&(Te=st));break;case 4:Qe=ye[Ue+1],nt=ye[Ue+2],$e=ye[Ue+3],(Qe&192)===128&&(nt&192)===128&&($e&192)===128&&(st=(tt&15)<<18|(Qe&63)<<12|(nt&63)<<6|$e&63,st>65535&&st<1114112&&(Te=st))}}Te===null?(Te=65533,Pe=1):Te>65535&&(Te-=65536,Se.push(Te>>>10&1023|55296),Te=56320|Te&1023),Se.push(Te),Ue+=Pe}return me(Se)}const fe=4096;function me(ye){const J=ye.length;if(J<=fe)return String.fromCharCode.apply(String,ye);let ne="",Se=0;for(;Se<J;)ne+=String.fromCharCode.apply(String,ye.slice(Se,Se+=fe));return ne}function Ne(ye,J,ne){let Se="";ne=Math.min(ye.length,ne);for(let Ue=J;Ue<ne;++Ue)Se+=String.fromCharCode(ye[Ue]&127);return Se}function Fe(ye,J,ne){let Se="";ne=Math.min(ye.length,ne);for(let Ue=J;Ue<ne;++Ue)Se+=String.fromCharCode(ye[Ue]);return Se}function je(ye,J,ne){const Se=ye.length;(!J||J<0)&&(J=0),(!ne||ne<0||ne>Se)&&(ne=Se);let Ue="";for(let tt=J;tt<ne;++tt)Ue+=tn[ye[tt]];return Ue}function Ve(ye,J,ne){const Se=ye.slice(J,ne);let Ue="";for(let tt=0;tt<Se.length-1;tt+=2)Ue+=String.fromCharCode(Se[tt]+Se[tt+1]*256);return Ue}y.prototype.slice=function(J,ne){const Se=this.length;J=~~J,ne=ne===void 0?Se:~~ne,J<0?(J+=Se,J<0&&(J=0)):J>Se&&(J=Se),ne<0?(ne+=Se,ne<0&&(ne=0)):ne>Se&&(ne=Se),ne<J&&(ne=J);const Ue=this.subarray(J,ne);return Object.setPrototypeOf(Ue,y.prototype),Ue};function Re(ye,J,ne){if(ye%1!==0||ye<0)throw new RangeError("offset is not uint");if(ye+J>ne)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(J,ne,Se){J=J>>>0,ne=ne>>>0,Se||Re(J,ne,this.length);let Ue=this[J],tt=1,Te=0;for(;++Te<ne&&(tt*=256);)Ue+=this[J+Te]*tt;return Ue},y.prototype.readUintBE=y.prototype.readUIntBE=function(J,ne,Se){J=J>>>0,ne=ne>>>0,Se||Re(J,ne,this.length);let Ue=this[J+--ne],tt=1;for(;ne>0&&(tt*=256);)Ue+=this[J+--ne]*tt;return Ue},y.prototype.readUint8=y.prototype.readUInt8=function(J,ne){return J=J>>>0,ne||Re(J,1,this.length),this[J]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(J,ne){return J=J>>>0,ne||Re(J,2,this.length),this[J]|this[J+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(J,ne){return J=J>>>0,ne||Re(J,2,this.length),this[J]<<8|this[J+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},y.prototype.readBigUInt64LE=un(function(J){J=J>>>0,gn(J,"offset");const ne=this[J],Se=this[J+7];(ne===void 0||Se===void 0)&&It(J,this.length-8);const Ue=ne+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,tt=this[++J]+this[++J]*2**8+this[++J]*2**16+Se*2**24;return BigInt(Ue)+(BigInt(tt)<<BigInt(32))}),y.prototype.readBigUInt64BE=un(function(J){J=J>>>0,gn(J,"offset");const ne=this[J],Se=this[J+7];(ne===void 0||Se===void 0)&&It(J,this.length-8);const Ue=ne*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],tt=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+Se;return(BigInt(Ue)<<BigInt(32))+BigInt(tt)}),y.prototype.readIntLE=function(J,ne,Se){J=J>>>0,ne=ne>>>0,Se||Re(J,ne,this.length);let Ue=this[J],tt=1,Te=0;for(;++Te<ne&&(tt*=256);)Ue+=this[J+Te]*tt;return tt*=128,Ue>=tt&&(Ue-=Math.pow(2,8*ne)),Ue},y.prototype.readIntBE=function(J,ne,Se){J=J>>>0,ne=ne>>>0,Se||Re(J,ne,this.length);let Ue=ne,tt=1,Te=this[J+--Ue];for(;Ue>0&&(tt*=256);)Te+=this[J+--Ue]*tt;return tt*=128,Te>=tt&&(Te-=Math.pow(2,8*ne)),Te},y.prototype.readInt8=function(J,ne){return J=J>>>0,ne||Re(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},y.prototype.readInt16LE=function(J,ne){J=J>>>0,ne||Re(J,2,this.length);const Se=this[J]|this[J+1]<<8;return Se&32768?Se|4294901760:Se},y.prototype.readInt16BE=function(J,ne){J=J>>>0,ne||Re(J,2,this.length);const Se=this[J+1]|this[J]<<8;return Se&32768?Se|4294901760:Se},y.prototype.readInt32LE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},y.prototype.readInt32BE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},y.prototype.readBigInt64LE=un(function(J){J=J>>>0,gn(J,"offset");const ne=this[J],Se=this[J+7];(ne===void 0||Se===void 0)&&It(J,this.length-8);const Ue=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(Se<<24);return(BigInt(Ue)<<BigInt(32))+BigInt(ne+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24)}),y.prototype.readBigInt64BE=un(function(J){J=J>>>0,gn(J,"offset");const ne=this[J],Se=this[J+7];(ne===void 0||Se===void 0)&&It(J,this.length-8);const Ue=(ne<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(Ue)<<BigInt(32))+BigInt(this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+Se)}),y.prototype.readFloatLE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),i.read(this,J,!0,23,4)},y.prototype.readFloatBE=function(J,ne){return J=J>>>0,ne||Re(J,4,this.length),i.read(this,J,!1,23,4)},y.prototype.readDoubleLE=function(J,ne){return J=J>>>0,ne||Re(J,8,this.length),i.read(this,J,!0,52,8)},y.prototype.readDoubleBE=function(J,ne){return J=J>>>0,ne||Re(J,8,this.length),i.read(this,J,!1,52,8)};function Be(ye,J,ne,Se,Ue,tt){if(!y.isBuffer(ye))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Ue||J<tt)throw new RangeError('"value" argument is out of bounds');if(ne+Se>ye.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(J,ne,Se,Ue){if(J=+J,ne=ne>>>0,Se=Se>>>0,!Ue){const Pe=Math.pow(2,8*Se)-1;Be(this,J,ne,Se,Pe,0)}let tt=1,Te=0;for(this[ne]=J&255;++Te<Se&&(tt*=256);)this[ne+Te]=J/tt&255;return ne+Se},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(J,ne,Se,Ue){if(J=+J,ne=ne>>>0,Se=Se>>>0,!Ue){const Pe=Math.pow(2,8*Se)-1;Be(this,J,ne,Se,Pe,0)}let tt=Se-1,Te=1;for(this[ne+tt]=J&255;--tt>=0&&(Te*=256);)this[ne+tt]=J/Te&255;return ne+Se},y.prototype.writeUint8=y.prototype.writeUInt8=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,1,255,0),this[ne]=J&255,ne+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,2,65535,0),this[ne]=J&255,this[ne+1]=J>>>8,ne+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,2,65535,0),this[ne]=J>>>8,this[ne+1]=J&255,ne+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,4,4294967295,0),this[ne+3]=J>>>24,this[ne+2]=J>>>16,this[ne+1]=J>>>8,this[ne]=J&255,ne+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,4,4294967295,0),this[ne]=J>>>24,this[ne+1]=J>>>16,this[ne+2]=J>>>8,this[ne+3]=J&255,ne+4};function Xe(ye,J,ne,Se,Ue){Ht(J,Se,Ue,ye,ne,7);let tt=Number(J&BigInt(4294967295));ye[ne++]=tt,tt=tt>>8,ye[ne++]=tt,tt=tt>>8,ye[ne++]=tt,tt=tt>>8,ye[ne++]=tt;let Te=Number(J>>BigInt(32)&BigInt(4294967295));return ye[ne++]=Te,Te=Te>>8,ye[ne++]=Te,Te=Te>>8,ye[ne++]=Te,Te=Te>>8,ye[ne++]=Te,ne}function we(ye,J,ne,Se,Ue){Ht(J,Se,Ue,ye,ne,7);let tt=Number(J&BigInt(4294967295));ye[ne+7]=tt,tt=tt>>8,ye[ne+6]=tt,tt=tt>>8,ye[ne+5]=tt,tt=tt>>8,ye[ne+4]=tt;let Te=Number(J>>BigInt(32)&BigInt(4294967295));return ye[ne+3]=Te,Te=Te>>8,ye[ne+2]=Te,Te=Te>>8,ye[ne+1]=Te,Te=Te>>8,ye[ne]=Te,ne+8}y.prototype.writeBigUInt64LE=un(function(J,ne=0){return Xe(this,J,ne,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=un(function(J,ne=0){return we(this,J,ne,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(J,ne,Se,Ue){if(J=+J,ne=ne>>>0,!Ue){const Qe=Math.pow(2,8*Se-1);Be(this,J,ne,Se,Qe-1,-Qe)}let tt=0,Te=1,Pe=0;for(this[ne]=J&255;++tt<Se&&(Te*=256);)J<0&&Pe===0&&this[ne+tt-1]!==0&&(Pe=1),this[ne+tt]=(J/Te>>0)-Pe&255;return ne+Se},y.prototype.writeIntBE=function(J,ne,Se,Ue){if(J=+J,ne=ne>>>0,!Ue){const Qe=Math.pow(2,8*Se-1);Be(this,J,ne,Se,Qe-1,-Qe)}let tt=Se-1,Te=1,Pe=0;for(this[ne+tt]=J&255;--tt>=0&&(Te*=256);)J<0&&Pe===0&&this[ne+tt+1]!==0&&(Pe=1),this[ne+tt]=(J/Te>>0)-Pe&255;return ne+Se},y.prototype.writeInt8=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,1,127,-128),J<0&&(J=255+J+1),this[ne]=J&255,ne+1},y.prototype.writeInt16LE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,2,32767,-32768),this[ne]=J&255,this[ne+1]=J>>>8,ne+2},y.prototype.writeInt16BE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,2,32767,-32768),this[ne]=J>>>8,this[ne+1]=J&255,ne+2},y.prototype.writeInt32LE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,4,2147483647,-2147483648),this[ne]=J&255,this[ne+1]=J>>>8,this[ne+2]=J>>>16,this[ne+3]=J>>>24,ne+4},y.prototype.writeInt32BE=function(J,ne,Se){return J=+J,ne=ne>>>0,Se||Be(this,J,ne,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[ne]=J>>>24,this[ne+1]=J>>>16,this[ne+2]=J>>>8,this[ne+3]=J&255,ne+4},y.prototype.writeBigInt64LE=un(function(J,ne=0){return Xe(this,J,ne,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=un(function(J,ne=0){return we(this,J,ne,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(ye,J,ne,Se,Ue,tt){if(ne+Se>ye.length)throw new RangeError("Index out of range");if(ne<0)throw new RangeError("Index out of range")}function rt(ye,J,ne,Se,Ue){return J=+J,ne=ne>>>0,Ue||Ge(ye,J,ne,4),i.write(ye,J,ne,Se,23,4),ne+4}y.prototype.writeFloatLE=function(J,ne,Se){return rt(this,J,ne,!0,Se)},y.prototype.writeFloatBE=function(J,ne,Se){return rt(this,J,ne,!1,Se)};function pt(ye,J,ne,Se,Ue){return J=+J,ne=ne>>>0,Ue||Ge(ye,J,ne,8),i.write(ye,J,ne,Se,52,8),ne+8}y.prototype.writeDoubleLE=function(J,ne,Se){return pt(this,J,ne,!0,Se)},y.prototype.writeDoubleBE=function(J,ne,Se){return pt(this,J,ne,!1,Se)},y.prototype.copy=function(J,ne,Se,Ue){if(!y.isBuffer(J))throw new TypeError("argument should be a Buffer");if(Se||(Se=0),!Ue&&Ue!==0&&(Ue=this.length),ne>=J.length&&(ne=J.length),ne||(ne=0),Ue>0&&Ue<Se&&(Ue=Se),Ue===Se||J.length===0||this.length===0)return 0;if(ne<0)throw new RangeError("targetStart out of bounds");if(Se<0||Se>=this.length)throw new RangeError("Index out of range");if(Ue<0)throw new RangeError("sourceEnd out of bounds");Ue>this.length&&(Ue=this.length),J.length-ne<Ue-Se&&(Ue=J.length-ne+Se);const tt=Ue-Se;return this===J&&typeof d.prototype.copyWithin=="function"?this.copyWithin(ne,Se,Ue):d.prototype.set.call(J,this.subarray(Se,Ue),ne),tt},y.prototype.fill=function(J,ne,Se,Ue){if(typeof J=="string"){if(typeof ne=="string"?(Ue=ne,ne=0,Se=this.length):typeof Se=="string"&&(Ue=Se,Se=this.length),Ue!==void 0&&typeof Ue!="string")throw new TypeError("encoding must be a string");if(typeof Ue=="string"&&!y.isEncoding(Ue))throw new TypeError("Unknown encoding: "+Ue);if(J.length===1){const Te=J.charCodeAt(0);(Ue==="utf8"&&Te<128||Ue==="latin1")&&(J=Te)}}else typeof J=="number"?J=J&255:typeof J=="boolean"&&(J=Number(J));if(ne<0||this.length<ne||this.length<Se)throw new RangeError("Out of range index");if(Se<=ne)return this;ne=ne>>>0,Se=Se===void 0?this.length:Se>>>0,J||(J=0);let tt;if(typeof J=="number")for(tt=ne;tt<Se;++tt)this[tt]=J;else{const Te=y.isBuffer(J)?J:y.from(J,Ue),Pe=Te.length;if(Pe===0)throw new TypeError('The value "'+J+'" is invalid for argument "value"');for(tt=0;tt<Se-ne;++tt)this[tt+ne]=Te[tt%Pe]}return this};const Ze={};function Je(ye,J,ne){Ze[ye]=class extends ne{constructor(){super(),Object.defineProperty(this,"message",{value:J.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ye}]`,this.stack,delete this.name}get code(){return ye}set code(Ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Ue,writable:!0})}toString(){return`${this.name} [${ye}]: ${this.message}`}}}Je("ERR_BUFFER_OUT_OF_BOUNDS",function(ye){return ye?`${ye} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Je("ERR_INVALID_ARG_TYPE",function(ye,J){return`The "${ye}" argument must be of type number. Received type ${typeof J}`},TypeError),Je("ERR_OUT_OF_RANGE",function(ye,J,ne){let Se=`The value of "${ye}" is out of range.`,Ue=ne;return Number.isInteger(ne)&&Math.abs(ne)>2**32?Ue=_t(String(ne)):typeof ne=="bigint"&&(Ue=String(ne),(ne>BigInt(2)**BigInt(32)||ne<-(BigInt(2)**BigInt(32)))&&(Ue=_t(Ue)),Ue+="n"),Se+=` It must be ${J}. Received ${Ue}`,Se},RangeError);function _t(ye){let J="",ne=ye.length;const Se=ye[0]==="-"?1:0;for(;ne>=Se+4;ne-=3)J=`_${ye.slice(ne-3,ne)}${J}`;return`${ye.slice(0,ne)}${J}`}function Xt(ye,J,ne){gn(J,"offset"),(ye[J]===void 0||ye[J+ne]===void 0)&&It(J,ye.length-(ne+1))}function Ht(ye,J,ne,Se,Ue,tt){if(ye>ne||ye<J){const Te=typeof J=="bigint"?"n":"";let Pe;throw tt>3?J===0||J===BigInt(0)?Pe=`>= 0${Te} and < 2${Te} ** ${(tt+1)*8}${Te}`:Pe=`>= -(2${Te} ** ${(tt+1)*8-1}${Te}) and < 2 ** ${(tt+1)*8-1}${Te}`:Pe=`>= ${J}${Te} and <= ${ne}${Te}`,new Ze.ERR_OUT_OF_RANGE("value",Pe,ye)}Xt(Se,Ue,tt)}function gn(ye,J){if(typeof ye!="number")throw new Ze.ERR_INVALID_ARG_TYPE(J,"number",ye)}function It(ye,J,ne){throw Math.floor(ye)!==ye?(gn(ye,ne),new Ze.ERR_OUT_OF_RANGE(ne||"offset","an integer",ye)):J<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(ne||"offset",`>= ${ne?1:0} and <= ${J}`,ye)}const xt=/[^+/0-9A-Za-z-_]/g;function mt(ye){if(ye=ye.split("=")[0],ye=ye.trim().replace(xt,""),ye.length<2)return"";for(;ye.length%4!==0;)ye=ye+"=";return ye}function dt(ye,J){J=J||1/0;let ne;const Se=ye.length;let Ue=null;const tt=[];for(let Te=0;Te<Se;++Te){if(ne=ye.charCodeAt(Te),ne>55295&&ne<57344){if(!Ue){if(ne>56319){(J-=3)>-1&&tt.push(239,191,189);continue}else if(Te+1===Se){(J-=3)>-1&&tt.push(239,191,189);continue}Ue=ne;continue}if(ne<56320){(J-=3)>-1&&tt.push(239,191,189),Ue=ne;continue}ne=(Ue-55296<<10|ne-56320)+65536}else Ue&&(J-=3)>-1&&tt.push(239,191,189);if(Ue=null,ne<128){if((J-=1)<0)break;tt.push(ne)}else if(ne<2048){if((J-=2)<0)break;tt.push(ne>>6|192,ne&63|128)}else if(ne<65536){if((J-=3)<0)break;tt.push(ne>>12|224,ne>>6&63|128,ne&63|128)}else if(ne<1114112){if((J-=4)<0)break;tt.push(ne>>18|240,ne>>12&63|128,ne>>6&63|128,ne&63|128)}else throw new Error("Invalid code point")}return tt}function it(ye){const J=[];for(let ne=0;ne<ye.length;++ne)J.push(ye.charCodeAt(ne)&255);return J}function Me(ye,J){let ne,Se,Ue;const tt=[];for(let Te=0;Te<ye.length&&!((J-=2)<0);++Te)ne=ye.charCodeAt(Te),Se=ne>>8,Ue=ne%256,tt.push(Ue),tt.push(Se);return tt}function We(ye){return t.toByteArray(mt(ye))}function bt(ye,J,ne,Se){let Ue;for(Ue=0;Ue<Se&&!(Ue+ne>=J.length||Ue>=ye.length);++Ue)J[Ue+ne]=ye[Ue];return Ue}function St(ye,J){return ye instanceof J||ye!=null&&ye.constructor!=null&&ye.constructor.name!=null&&ye.constructor.name===J.name}function Lt(ye){return ye!==ye}const tn=function(){const ye="0123456789abcdef",J=new Array(256);for(let ne=0;ne<16;++ne){const Se=ne*16;for(let Ue=0;Ue<16;++Ue)J[Se+Ue]=ye[ne]+ye[Ue]}return J}();function un(ye){return typeof BigInt>"u"?an:ye}function an(){throw new Error("BigInt not supported")}})(VJ);const o7=VJ.Buffer,d0e=VJ.Buffer;/**
* @license agora-rtc-react
* @version 2.2.0
*
* Copyright (c) Agora, Inc.
*
* This source code is licensed under the MIT license.
*/var qOe=Object.create,HJ=Object.defineProperty,YOe=Object.getOwnPropertyDescriptor,XOe=Object.getOwnPropertyNames,JOe=Object.getPrototypeOf,QOe=Object.prototype.hasOwnProperty,ZOe=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),ePe=(n,t)=>{for(var i in t)HJ(n,i,{get:t[i],enumerable:!0})},u0e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of XOe(t))!QOe.call(n,l)&&l!==i&&HJ(n,l,{get:()=>t[l],enumerable:!(s=YOe(t,l))||s.enumerable});return n},tPe=(n,t,i)=>(u0e(n,t,"default"),i),jE=(n,t,i)=>(i=n!=null?qOe(JOe(n)):{},u0e(!n||!n.__esModule?HJ(i,"default",{value:n,enumerable:!0}):i,n)),UE=ZOe((n,t)=>{(function(i,s){typeof n=="object"&&typeof t<"u"?t.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis<"u"?globalThis:i||self).AgoraRTC=s()})(n,function(){function i(r,a){return a.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(c){if(c!=="default"&&!(c in r)){var f=Object.getOwnPropertyDescriptor(o,c);Object.defineProperty(r,c,f.get?f:{enumerable:!0,get:function(){return o[c]}})}})}),Object.freeze(r)}var s=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Wo<"u"?Wo:typeof self<"u"?self:{};function l(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var d=function(r){try{return!!r()}catch{return!0}},u=!d(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),p=u,g=Function.prototype,_=g.call,y=p&&g.bind.bind(_,_),E=p?y:function(r){return function(){return _.apply(r,arguments)}},b=E({}.isPrototypeOf),A=function(r){return r&&r.Math==Math&&r},N=A(typeof globalThis=="object"&&globalThis)||A(typeof window=="object"&&window)||A(typeof self=="object"&&self)||A(typeof s=="object"&&s)||function(){return this}()||s||Function("return this")(),O=u,D=Function.prototype,P=D.apply,j=D.call,M=typeof Reflect=="object"&&Reflect.apply||(O?j.bind(P):function(){return j.apply(P,arguments)}),V=E,H=V({}.toString),$=V("".slice),Q=function(r){return $(H(r),8,-1)},Y=Q,le=E,ae=function(r){if(Y(r)==="Function")return le(r)},te=typeof document=="object"&&document.all,de={all:te,IS_HTMLDDA:te===void 0&&te!==void 0},G=de.all,ie=de.IS_HTMLDDA?function(r){return typeof r=="function"||r===G}:function(r){return typeof r=="function"},_e={},he=!d(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Ce=u,fe=Function.prototype.call,me=Ce?fe.bind(fe):function(){return fe.apply(fe,arguments)},Ne={},Fe={}.propertyIsEnumerable,je=Object.getOwnPropertyDescriptor,Ve=je&&!Fe.call({1:2},1);Ne.f=Ve?function(r){var a=je(this,r);return!!a&&a.enumerable}:Fe;var Re,Be,Xe=function(r,a){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:a}},we=d,Ge=Q,rt=Object,pt=E("".split),Ze=we(function(){return!rt("z").propertyIsEnumerable(0)})?function(r){return Ge(r)=="String"?pt(r,""):rt(r)}:rt,Je=function(r){return r==null},_t=Je,Xt=TypeError,Ht=function(r){if(_t(r))throw Xt("Can't call method on "+r);return r},gn=Ze,It=Ht,xt=function(r){return gn(It(r))},mt=ie,dt=de.all,it=de.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:mt(r)||r===dt}:function(r){return typeof r=="object"?r!==null:mt(r)},Me={},We=Me,bt=N,St=ie,Lt=function(r){return St(r)?r:void 0},tn=function(r,a){return arguments.length<2?Lt(We[r])||Lt(bt[r]):We[r]&&We[r][a]||bt[r]&&bt[r][a]},un=typeof navigator<"u"&&String(navigator.userAgent)||"",an=N,ye=un,J=an.process,ne=an.Deno,Se=J&&J.versions||ne&&ne.version,Ue=Se&&Se.v8;Ue&&(Be=(Re=Ue.split("."))[0]>0&&Re[0]<4?1:+(Re[0]+Re[1])),!Be&&ye&&(!(Re=ye.match(/Edge\/(\d+)/))||Re[1]>=74)&&(Re=ye.match(/Chrome\/(\d+)/))&&(Be=+Re[1]);var tt=Be,Te=tt,Pe=d,Qe=N.String,nt=!!Object.getOwnPropertySymbols&&!Pe(function(){var r=Symbol();return!Qe(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Te&&Te<41}),$e=nt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",st=tn,_n=ie,Dt=b,nn=Object,en=$e?function(r){return typeof r=="symbol"}:function(r){var a=st("Symbol");return _n(a)&&Dt(a.prototype,nn(r))},qt=String,Jt=function(r){try{return qt(r)}catch{return"Object"}},mn=ie,Kn=Jt,Nn=TypeError,Tn=function(r){if(mn(r))return r;throw Nn(Kn(r)+" is not a function")},Ui=Tn,xr=Je,bi=function(r,a){var o=r[a];return xr(o)?void 0:Ui(o)},Ia=me,Sl=ie,mc=it,nu=TypeError,To={exports:{}},Fg=N,Bg=Object.defineProperty,Ka=function(r,a){try{Bg(Fg,r,{value:a,configurable:!0,writable:!0})}catch{Fg[r]=a}return a},ew="__core-js_shared__",$v=N[ew]||Ka(ew,{}),tw=$v;(To.exports=function(r,a){return tw[r]||(tw[r]=a!==void 0?a:{})})("versions",[]).push({version:"3.31.1",mode:"pure",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var mf=To.exports,sx=Ht,ax=Object,Ro=function(r){return ax(sx(r))},ox=Ro,Vg=E({}.hasOwnProperty),fs=Object.hasOwn||function(r,a){return Vg(ox(r),a)},lx=E,cx=0,nw=Math.random(),iw=lx(1 .toString),zg=function(r){return"Symbol("+(r===void 0?"":r)+")_"+iw(++cx+nw,36)},rw=mf,sw=fs,dx=zg,ah=nt,iu=$e,qa=N.Symbol,Hp=rw("wks"),Kv=iu?qa.for||qa:qa&&qa.withoutSetter||dx,Qi=function(r){return sw(Hp,r)||(Hp[r]=ah&&sw(qa,r)?qa[r]:Kv("Symbol."+r)),Hp[r]},qv=me,oh=it,gf=en,Hg=bi,Gg=function(r,a){var o,c;if(Sl(o=r.toString)&&!mc(c=Ia(o,r))||Sl(o=r.valueOf)&&!mc(c=Ia(o,r))||a!=="string")return c;throw nu("Can't convert object to primitive value")},Yv=TypeError,Wg=Qi("toPrimitive"),vf=function(r,a){if(!oh(r)||gf(r))return r;var o,c=Hg(r,Wg);if(c){if(o=qv(c,r,a),!oh(o)||gf(o))return o;throw Yv("Can't convert object to primitive value")}return Gg(r,a)},yf=en,ru=function(r){var a=vf(r,"string");return yf(a)?a:a+""},Gp=it,rd=N.document,$g=Gp(rd)&&Gp(rd.createElement),Wp=function(r){return $g?rd.createElement(r):{}},aw=Wp,ux=!he&&!d(function(){return Object.defineProperty(aw("div"),"a",{get:function(){return 7}}).a!=7}),uP=he,hP=me,fP=Ne,dF=Xe,uF=xt,hF=ru,pP=fs,fF=ux,mP=Object.getOwnPropertyDescriptor;_e.f=uP?mP:function(r,a){if(r=uF(r),a=hF(a),fF)try{return mP(r,a)}catch{}if(pP(r,a))return dF(!hP(fP.f,r,a),r[a])};var pF=d,mF=ie,hx=/#|\.prototype\./,Xv=function(r,a){var o=vF[gF(r)];return o==_F||o!=yF&&(mF(a)?pF(a):!!a)},gF=Xv.normalize=function(r){return String(r).replace(hx,".").toLowerCase()},vF=Xv.data={},yF=Xv.NATIVE="N",_F=Xv.POLYFILL="P",Gr=Xv,Wr=Tn,EF=u,wF=ae(ae.bind),_f=function(r,a){return Wr(r),a===void 0?r:EF?wF(r,a):function(){return r.apply(a,arguments)}},gc={},gP=he&&d(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),SF=it,vP=String,bF=TypeError,dr=function(r){if(SF(r))return r;throw bF(vP(r)+" is not an object")},fx=he,$p=ux,yP=gP,Kg=dr,bl=ru,_P=TypeError,ow=Object.defineProperty,EP=Object.getOwnPropertyDescriptor,lw="enumerable",cw="configurable",dw="writable";gc.f=fx?yP?function(r,a,o){if(Kg(r),a=bl(a),Kg(o),typeof r=="function"&&a==="prototype"&&"value"in o&&dw in o&&!o[dw]){var c=EP(r,a);c&&c[dw]&&(r[a]=o.value,o={configurable:cw in o?o[cw]:c[cw],enumerable:lw in o?o[lw]:c[lw],writable:!1})}return ow(r,a,o)}:ow:function(r,a,o){if(Kg(r),a=bl(a),Kg(o),$p)try{return ow(r,a,o)}catch{}if("get"in o||"set"in o)throw _P("Accessors not supported");return"value"in o&&(r[a]=o.value),r};var Cl=gc,CF=Xe,ta=he?function(r,a,o){return Cl.f(r,a,CF(1,o))}:function(r,a,o){return r[a]=o,r},uw=N,wP=M,Ef=ae,hw=ie,px=_e.f,ss=Gr,Tl=Me,mx=_f,qg=ta,fw=fs,TF=function(r){var a=function(o,c,f){if(this instanceof a){switch(arguments.length){case 0:return new r;case 1:return new r(o);case 2:return new r(o,c)}return new r(o,c,f)}return wP(r,this,arguments)};return a.prototype=r.prototype,a},Ni=function(r,a){var o,c,f,m,v,w,C,R,x,L=r.target,U=r.global,F=r.stat,Z=r.proto,W=U?uw:F?uw[L]:(uw[L]||{}).prototype,K=U?Tl:Tl[L]||qg(Tl,L,{})[L],oe=K.prototype;for(m in a)c=!(o=ss(U?m:L+(F?".":"#")+m,r.forced))&&W&&fw(W,m),w=K[m],c&&(C=r.dontCallGetSet?(x=px(W,m))&&x.value:W[m]),v=c&&C?C:a[m],c&&typeof w==typeof v||(R=r.bind&&c?mx(v,uw):r.wrap&&c?TF(v):Z&&hw(v)?Ef(v):v,(r.sham||v&&v.sham||w&&w.sham)&&qg(R,"sham",!0),qg(K,m,R),Z&&(fw(Tl,f=L+"Prototype")||qg(Tl,f,{}),qg(Tl[f],m,v),r.real&&oe&&(o||!oe[m])&&qg(oe,m,v)))},RF=Math.ceil,SP=Math.floor,pw=Math.trunc||function(r){var a=+r;return(a>0?SP:RF)(a)},Yg=pw,gx=function(r){var a=+r;return a!=a||a===0?0:Yg(a)},bP=gx,CP=Math.max,vx=Math.min,Jv=function(r,a){var o=bP(r);return o<0?CP(o+a,0):vx(o,a)},TP=gx,xF=Math.min,mw=function(r){return r>0?xF(TP(r),9007199254740991):0},yx=mw,lh=function(r){return yx(r.length)},RP=xt,Rl=Jv,_x=lh,Xg=function(r){return function(a,o,c){var f,m=RP(a),v=_x(m),w=Rl(c,v);if(r&&o!=o){for(;v>w;)if((f=m[w++])!=f)return!0}else for(;v>w;w++)if((r||w in m)&&m[w]===o)return r||w||0;return!r&&-1}},gw={includes:Xg(!0),indexOf:Xg(!1)},xP=gw.includes;Ni({target:"Array",proto:!0,forced:d(function(){return!Array(1).includes()})},{includes:function(r){return xP(this,r,arguments.length>1?arguments[1]:void 0)}});var AF=Me,vc=function(r){return AF[r+"Prototype"]},IF=vc("Array").includes,NF=it,OF=Q,Jg=Qi("match"),AP=function(r){var a;return NF(r)&&((a=r[Jg])!==void 0?!!a:OF(r)=="RegExp")},PF=AP,Ex=TypeError,wx={};wx[Qi("toStringTag")]="z";var su=String(wx)==="[object z]",vw=su,LF=ie,yw=Q,DF=Qi("toStringTag"),Qg=Object,sd=yw(function(){return arguments}())=="Arguments",ad=vw?yw:function(r){var a,o,c;return r===void 0?"Undefined":r===null?"Null":typeof(o=function(f,m){try{return f[m]}catch{}}(a=Qg(r),DF))=="string"?o:sd?yw(a):(c=yw(a))=="Object"&&LF(a.callee)?"Arguments":c},kF=ad,MF=String,xl=function(r){if(kF(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return MF(r)},jF=Qi("match"),UF=Ni,Zg=function(r){if(PF(r))throw Ex("The method doesn't accept regular expressions");return r},ot=Ht,Ot=xl,Et=function(r){var a=/./;try{"/./"[r](a)}catch{try{return a[jF]=!1,"/./"[r](a)}catch{}}return!1},Cn=E("".indexOf);UF({target:"String",proto:!0,forced:!Et("includes")},{includes:function(r){return!!~Cn(Ot(ot(this)),Ot(Zg(r)),arguments.length>1?arguments[1]:void 0)}});var di=vc("String").includes,ur=b,na=IF,Dr=di,Qv=Array.prototype,Sx=String.prototype,yc=function(r){var a=r.includes;return r===Qv||ur(Qv,r)&&a===Qv.includes?na:typeof r=="string"||r===Sx||ur(Sx,r)&&a===Sx.includes?Dr:a},Tt=l(yc),FF=Tn,e0=Ro,_w=Ze,Ew=lh,Tr=TypeError,IP=function(r){return function(a,o,c,f){FF(o);var m=e0(a),v=_w(m),w=Ew(m),C=r?w-1:0,R=r?-1:1;if(c<2)for(;;){if(C in v){f=v[C],C+=R;break}if(C+=R,r?C<0:w<=C)throw Tr("Reduce of empty array with no initial value")}for(;r?C>=0:w>C;C+=R)C in v&&(f=o(f,v[C],C,m));return f}},NP={left:IP(!1),right:IP(!0)},ww=d,Sw=function(r,a){var o=[][r];return!!o&&ww(function(){o.call(null,a||function(){return 1},1)})},Zv=typeof ic<"u"&&Q(ic)=="process",BF=NP.left;Ni({target:"Array",proto:!0,forced:!Zv&&tt>79&&tt<83||!Sw("reduce")},{reduce:function(r){var a=arguments.length;return BF(this,r,a,a>1?arguments[1]:void 0)}});var bw=vc("Array").reduce,wf=b,Cw=bw,Tw=Array.prototype,Rw=function(r){var a=r.reduce;return r===Tw||wf(Tw,r)&&a===Tw.reduce?Cw:a},bx=Rw,_c=l(bx);let ey=!0,Cx=!0;function Sf(r,a,o){let c=r.match(a);return c&&c.length>=o&&parseInt(c[o],10)}function Al(r,a,o){if(!r.RTCPeerConnection)return;let c=r.RTCPeerConnection.prototype,f=c.addEventListener;c.addEventListener=function(v,w){if(v!==a)return f.apply(this,arguments);let C=R=>{let x=o(R);x&&(w.handleEvent?w.handleEvent(x):w(x))};return this._eventMap=this._eventMap||{},this._eventMap[a]||(this._eventMap[a]=new Map),this._eventMap[a].set(w,C),f.apply(this,[v,C])};let m=c.removeEventListener;c.removeEventListener=function(v,w){if(v!==a||!this._eventMap||!this._eventMap[a])return m.apply(this,arguments);if(!this._eventMap[a].has(w))return m.apply(this,arguments);let C=this._eventMap[a].get(w);return this._eventMap[a].delete(w),this._eventMap[a].size===0&&delete this._eventMap[a],Object.keys(this._eventMap).length===0&&delete this._eventMap,m.apply(this,[v,C])},Object.defineProperty(c,"on"+a,{get(){return this["_on"+a]},set(v){this["_on"+a]&&(this.removeEventListener(a,this["_on"+a]),delete this["_on"+a]),v&&this.addEventListener(a,this["_on"+a]=v)},enumerable:!0,configurable:!0})}function xw(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(ey=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function VF(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Cx=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function OP(){if(typeof window=="object"){if(ey)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Tx(r,a){Cx&&console.warn(r+" is deprecated, please use "+a+" instead.")}function ty(r){return Object.prototype.toString.call(r)==="[object Object]"}function ny(r){var a;return ty(r)?_c(a=Object.keys(r)).call(a,function(o,c){let f=ty(r[c]),m=f?ny(r[c]):r[c],v=f&&!Object.keys(m).length;return m===void 0||v?o:Object.assign(o,{[c]:m})},{}):r}function iy(r,a,o){a&&!o.has(a.id)&&(o.set(a.id,a),Object.keys(a).forEach(c=>{c.endsWith("Id")?iy(r,r.get(a[c]),o):c.endsWith("Ids")&&a[c].forEach(f=>{iy(r,r.get(f),o)})}))}function PP(r,a,o){let c=o?"outbound-rtp":"inbound-rtp",f=new Map;if(a===null)return f;let m=[];return r.forEach(v=>{v.type==="track"&&v.trackIdentifier===a.id&&m.push(v)}),m.forEach(v=>{r.forEach(w=>{w.type===c&&w.trackId===v.id&&iy(r,w,f)})}),f}var LP=zg,DP=mf("keys"),Aw=function(r){return DP[r]||(DP[r]=LP(r))},ia=!d(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Ya=fs,zF=ie,HF=Ro,kP=ia,MP=Aw("IE_PROTO"),ry=Object,sy=ry.prototype,ay=kP?ry.getPrototypeOf:function(r){var a=HF(r);if(Ya(a,MP))return a[MP];var o=a.constructor;return zF(o)&&a instanceof o?o.prototype:a instanceof ry?sy:null},t0=E,oy=Tn,ly=ie,Iw=String,n0=TypeError,GF=function(r,a,o){try{return t0(oy(Object.getOwnPropertyDescriptor(r,a)[o]))}catch{}},WF=dr,$F=function(r){if(typeof r=="object"||ly(r))return r;throw n0("Can't set "+Iw(r)+" as a prototype")},KF=Object.setPrototypeOf||("__proto__"in{}?function(){var r,a=!1,o={};try{(r=GF(Object.prototype,"__proto__","set"))(o,[]),a=o instanceof Array}catch{}return function(c,f){return WF(c),$F(f),a?r(c,f):c.__proto__=f,c}}():void 0),Nw={},Kp={},qp=fs,jP=xt,be=gw.indexOf,i0=Kp,cy=E([].push),Il=function(r,a){var o,c=jP(r),f=0,m=[];for(o in c)!qp(i0,o)&&qp(c,o)&&cy(m,o);for(;a.length>f;)qp(c,o=a[f++])&&(~be(m,o)||cy(m,o));return m},Fi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qF=Il,YF=Fi.concat("length","prototype");Nw.f=Object.getOwnPropertyNames||function(r){return qF(r,YF)};var dy={};dy.f=Object.getOwnPropertySymbols;var Yp=tn,XF=Nw,JF=dy,QF=dr,ZF=E([].concat),eB=Yp("Reflect","ownKeys")||function(r){var a=XF.f(QF(r)),o=JF.f;return o?ZF(a,o(r)):a},au=fs,tB=eB,nB=_e,iB=gc,Rx={},rB=Il,ch=Fi,Ow=Object.keys||function(r){return rB(r,ch)},sB=he,aB=gP,oB=gc,lB=dr,Xp=xt,cB=Ow;Rx.f=sB&&!aB?Object.defineProperties:function(r,a){lB(r);for(var o,c=Xp(a),f=cB(a),m=f.length,v=0;m>v;)oB.f(r,o=f[v++],c[o]);return r};var Pw,Ec=tn("document","documentElement"),dB=dr,uB=Rx,UP=Fi,hB=Kp,fB=Ec,FP=Wp,Lw="prototype",xx="script",BP=Aw("IE_PROTO"),uy=function(){},r0=function(r){return"<"+xx+">"+r+"</"+xx+">"},hy=function(r){r.write(r0("")),r.close();var a=r.parentWindow.Object;return r=null,a},Dw=function(){try{Pw=new ActiveXObject("htmlfile")}catch{}var r,a,o;Dw=typeof document<"u"?document.domain&&Pw?hy(Pw):(a=FP("iframe"),o="java"+xx+":",a.style.display="none",fB.appendChild(a),a.src=String(o),(r=a.contentWindow.document).open(),r.write(r0("document.F=Object")),r.close(),r.F):hy(Pw);for(var c=UP.length;c--;)delete Dw[Lw][UP[c]];return Dw()};hB[BP]=!0;var s0=Object.create||function(r,a){var o;return r!==null?(uy[Lw]=dB(r),o=new uy,uy[Lw]=null,o[BP]=r):o=Dw(),a===void 0?o:uB.f(o,a)},pB=it,dh=ta,kw=Error,Jp=E("".replace),wc=String(kw("zxcasd").stack),VP=/\n\s*at [^:]*:[^\n]*/,zP=VP.test(wc),HP=Xe,fy=!d(function(){var r=Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",HP(1,7)),r.stack!==7)}),bf=ta,GP=function(r,a){if(zP&&typeof r=="string"&&!kw.prepareStackTrace)for(;a--;)r=Jp(r,VP,"");return r},mB=fy,py=Error.captureStackTrace,Qp={},WP=Qp,Na=Qi("iterator"),Ax=Array.prototype,Ix=function(r){return r!==void 0&&(WP.Array===r||Ax[Na]===r)},ou=ad,Mw=bi,jw=Je,Zp=Qp,$P=Qi("iterator"),_a=function(r){if(!jw(r))return Mw(r,$P)||Mw(r,"@@iterator")||Zp[ou(r)]},Nx=me,gB=Tn,vB=dr,yB=Jt,Ox=_a,_B=TypeError,em=function(r,a){var o=arguments.length<2?Ox(r):a;if(gB(o))return vB(Nx(o,r));throw _B(yB(r)+" is not iterable")},KP=me,qP=dr,EB=bi,a0=function(r,a,o){var c,f;qP(r);try{if(!(c=EB(r,"return"))){if(a==="throw")throw o;return o}c=KP(c,r)}catch(m){f=!0,c=m}if(a==="throw")throw o;if(f)throw c;return qP(c),o},wB=_f,SB=me,Px=dr,YP=Jt,bB=Ix,CB=lh,XP=b,JP=em,Lx=_a,QP=a0,Dx=TypeError,my=function(r,a){this.stopped=r,this.result=a},kx=my.prototype,o0=function(r,a,o){var c,f,m,v,w,C,R,x=o&&o.that,L=!(!o||!o.AS_ENTRIES),U=!(!o||!o.IS_RECORD),F=!(!o||!o.IS_ITERATOR),Z=!(!o||!o.INTERRUPTED),W=wB(a,x),K=function(ue){return c&&QP(c,"normal",ue),new my(!0,ue)},oe=function(ue){return L?(Px(ue),Z?W(ue[0],ue[1],K):W(ue[0],ue[1])):Z?W(ue,K):W(ue)};if(U)c=r.iterator;else if(F)c=r;else{if(!(f=Lx(r)))throw Dx(YP(r)+" is not iterable");if(bB(f)){for(m=0,v=CB(r);v>m;m++)if((w=oe(r[m]))&&XP(kx,w))return w;return new my(!1)}c=JP(r,f)}for(C=U?r.next:c.next;!(R=SB(C,c)).done;){try{w=oe(R.value)}catch(ue){QP(c,"throw",ue)}if(typeof w=="object"&&w&&XP(kx,w))return w}return new my(!1)},Uw=xl,TB=Ni,ZP=b,e6=ay,Fw=KF,t6=function(r,a,o){for(var c=tB(a),f=iB.f,m=nB.f,v=0;v<c.length;v++){var w=c[v];au(r,w)||o&&au(o,w)||f(r,w,m(a,w))}},n6=s0,gy=ta,Bw=Xe,Mx=function(r,a){pB(a)&&"cause"in a&&dh(r,"cause",a.cause)},RB=function(r,a,o,c){mB&&(py?py(r,a):bf(r,"stack",GP(o,c)))},jx=o0,Oi=function(r,a){return r===void 0?arguments.length<2?"":a:Uw(r)},xB=Qi("toStringTag"),Vw=Error,vy=[].push,tm=function(r,a){var o,c=ZP(Ux,this);Fw?o=Fw(Vw(),c?e6(this):Ux):(o=c?this:n6(Ux),gy(o,xB,"Error")),a!==void 0&&gy(o,"message",Oi(a)),RB(o,tm,o.stack,1),arguments.length>2&&Mx(o,arguments[2]);var f=[];return jx(r,vy,{that:f}),gy(o,"errors",f),o};Fw?Fw(tm,Vw):t6(tm,Vw,{name:!0});var Ux=tm.prototype=n6(Vw.prototype,{constructor:Bw(1,tm),message:Bw(1,""),name:Bw(1,"AggregateError")});TB({global:!0,constructor:!0,arity:2},{AggregateError:tm});var zw,Xa,Hw,Gw=ie,Ww=N.WeakMap,i6=Gw(Ww)&&/native code/.test(String(Ww)),Fx=N,Nl=it,Cf=ta,yy=fs,$w=$v,Kw=Aw,r6=Kp,qw="Object already initialized",Yw=Fx.TypeError,Bx=Fx.WeakMap;if(i6||$w.state){var Sc=$w.state||($w.state=new Bx);Sc.get=Sc.get,Sc.has=Sc.has,Sc.set=Sc.set,zw=function(r,a){if(Sc.has(r))throw Yw(qw);return a.facade=r,Sc.set(r,a),a},Xa=function(r){return Sc.get(r)||{}},Hw=function(r){return Sc.has(r)}}else{var Ol=Kw("state");r6[Ol]=!0,zw=function(r,a){if(yy(r,Ol))throw Yw(qw);return a.facade=r,Cf(r,Ol,a),a},Xa=function(r){return yy(r,Ol)?r[Ol]:{}},Hw=function(r){return yy(r,Ol)}}var nm,uh,Vx,Tf={set:zw,get:Xa,has:Hw,enforce:function(r){return Hw(r)?Xa(r):zw(r,{})},getterFor:function(r){return function(a){var o;if(!Nl(a)||(o=Xa(a)).type!==r)throw Yw("Incompatible receiver, "+r+" required");return o}}},_y=he,AB=fs,s6=Function.prototype,IB=_y&&Object.getOwnPropertyDescriptor,Xw=AB(s6,"name"),zx={EXISTS:Xw,PROPER:Xw&&(function(){}).name==="something",CONFIGURABLE:Xw&&(!_y||_y&&IB(s6,"name").configurable)},NB=ta,hh=function(r,a,o,c){return c&&c.enumerable?r[a]=o:NB(r,a,o),r},a6=d,Jo=ie,lu=it,OB=s0,o6=ay,Jw=hh,Rf=Qi("iterator"),Hx=!1;[].keys&&("next"in(Vx=[].keys())?(uh=o6(o6(Vx)))!==Object.prototype&&(nm=uh):Hx=!0);var l6=!lu(nm)||a6(function(){var r={};return nm[Rf].call(r)!==r});Jo((nm=l6?{}:OB(nm))[Rf])||Jw(nm,Rf,function(){return this});var c6={IteratorPrototype:nm,BUGGY_SAFARI_ITERATORS:Hx},d6=ad,l0=su?{}.toString:function(){return"[object "+d6(this)+"]"},Ey=su,PB=gc.f,u6=ta,h6=fs,Qw=l0,Gx=Qi("toStringTag"),od=function(r,a,o,c){if(r){var f=o?r:r.prototype;h6(f,Gx)||PB(f,Gx,{configurable:!0,value:a}),c&&!Ey&&u6(f,"toString",Qw)}},Wx=c6.IteratorPrototype,Zw=s0,LB=Xe,f6=od,eS=Qp,p6=function(){return this},wy=function(r,a,o,c){var f=a+" Iterator";return r.prototype=Zw(Wx,{next:LB(+!c,o)}),f6(r,f,!1,!0),eS[f]=p6,r},DB=Ni,m6=me,fh=zx,g6=wy,v6=ay,kB=od,$x=hh,y6=Qp,MB=c6,ph=fh.PROPER,c0=MB.BUGGY_SAFARI_ITERATORS,Sy=Qi("iterator"),tS="keys",im="values",rm="entries",Xn=function(){return this},by=function(r,a,o,c,f,m,v){g6(o,a,c);var w,C,R,x=function(oe){if(oe===f&&W)return W;if(!c0&&oe in F)return F[oe];switch(oe){case tS:case im:case rm:return function(){return new o(this,oe)}}return function(){return new o(this)}},L=a+" Iterator",U=!1,F=r.prototype,Z=F[Sy]||F["@@iterator"]||f&&F[f],W=!c0&&Z||x(f),K=a=="Array"&&F.entries||Z;if(K&&(w=v6(K.call(new r)))!==Object.prototype&&w.next&&(kB(w,L,!0,!0),y6[L]=Xn),ph&&f==im&&Z&&Z.name!==im&&(U=!0,W=function(){return m6(Z,this)}),f)if(C={values:x(im),keys:m?W:x(tS),entries:x(rm)},v)for(R in C)(c0||U||!(R in F))&&$x(F,R,C[R]);else DB({target:a,proto:!0,forced:c0||U},C);return v&&F[Sy]!==W&&$x(F,Sy,W,{name:f}),y6[a]=W,C},Cy=function(r,a){return{value:r,done:a}},sm=xt,_6=Qp,nS=Tf;gc.f;var E6=by,Oa=Cy,w6="Array Iterator",jB=nS.set,S6=nS.getterFor(w6);E6(Array,"Array",function(r,a){jB(this,{type:w6,target:sm(r),index:0,kind:a})},function(){var r=S6(this),a=r.target,o=r.kind,c=r.index++;return!a||c>=a.length?(r.target=void 0,Oa(void 0,!0)):Oa(o=="keys"?c:o=="values"?a[c]:[c,a[c]],!1)},"values"),_6.Arguments=_6.Array;var UB=gc,Ty=function(r,a,o){return UB.f(r,a,o)},FB=tn,BB=Ty,VB=he,cu=Qi("species"),xo=b,Kx=TypeError,qx=function(r,a){if(xo(a,r))return r;throw Kx("Incorrect invocation")},Yx=ie,Xx=$v,zB=E(Function.toString);Yx(Xx.inspectSource)||(Xx.inspectSource=function(r){return zB(r)});var d0=Xx.inspectSource,b6=E,C6=d,T6=ie,HB=ad,GB=d0,R6=function(){},x6=[],Jx=tn("Reflect","construct"),Qx=/^\s*(?:class|function)\b/,Zx=b6(Qx.exec),A6=!Qx.exec(R6),mh=function(r){if(!T6(r))return!1;try{return Jx(R6,x6,r),!0}catch{return!1}},iS=function(r){if(!T6(r))return!1;switch(HB(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return A6||!!Zx(Qx,GB(r))}catch{return!0}};iS.sham=!0;var u0,am,Ry,rS,Pl=!Jx||C6(function(){var r;return mh(mh.call)||!mh(Object)||!mh(function(){r=!0})||r})?iS:mh,om=Pl,WB=Jt,I6=TypeError,N6=dr,$B=function(r){if(om(r))return r;throw I6(WB(r)+" is not a constructor")},KB=Je,qB=Qi("species"),eA=function(r,a){var o,c=N6(r).constructor;return c===void 0||KB(o=N6(c)[qB])?a:$B(o)},tA=E([].slice),YB=TypeError,sS=function(r,a){if(r<a)throw YB("Not enough arguments");return r},O6=/(?:ipad|iphone|ipod).*applewebkit/i.test(un),Ll=N,XB=M,P6=_f,nA=ie,L6=fs,D6=d,k6=Ec,JB=tA,iA=Wp,QB=sS,ZB=O6,eV=Zv,rA=Ll.setImmediate,sA=Ll.clearImmediate,tV=Ll.process,Qo=Ll.Dispatch,nV=Ll.Function,M6=Ll.MessageChannel,iV=Ll.String,aS=0,xy={},j6="onreadystatechange";D6(function(){u0=Ll.location});var aA=function(r){if(L6(xy,r)){var a=xy[r];delete xy[r],a()}},oA=function(r){return function(){aA(r)}},oS=function(r){aA(r.data)},U6=function(r){Ll.postMessage(iV(r),u0.protocol+"//"+u0.host)};rA&&sA||(rA=function(r){QB(arguments.length,1);var a=nA(r)?r:nV(r),o=JB(arguments,1);return xy[++aS]=function(){XB(a,void 0,o)},am(aS),aS},sA=function(r){delete xy[r]},eV?am=function(r){tV.nextTick(oA(r))}:Qo&&Qo.now?am=function(r){Qo.now(oA(r))}:M6&&!ZB?(rS=(Ry=new M6).port2,Ry.port1.onmessage=oS,am=P6(rS.postMessage,rS)):Ll.addEventListener&&nA(Ll.postMessage)&&!Ll.importScripts&&u0&&u0.protocol!=="file:"&&!D6(U6)?(am=U6,Ll.addEventListener("message",oS,!1)):am=j6 in iA("script")?function(r){k6.appendChild(iA("script"))[j6]=function(){k6.removeChild(this),aA(r)}}:function(r){setTimeout(oA(r),0)});var F6={set:rA,clear:sA},B6=function(){this.head=null,this.tail=null};B6.prototype={add:function(r){var a={item:r,next:null},o=this.tail;o?o.next=a:this.head=a,this.tail=a},get:function(){var r=this.head;if(r)return(this.head=r.next)===null&&(this.tail=null),r.item}};var h0,lA,cA,dA,V6,z6=B6,rV=/ipad|iphone|ipod/i.test(un)&&typeof Pebble<"u",sV=/web0s(?!.*chrome)/i.test(un),lm=N,H6=_f,aV=_e.f,uA=F6.set,oV=z6,lV=O6,cV=rV,dV=sV,hA=Zv,lS=lm.MutationObserver||lm.WebKitMutationObserver,fA=lm.document,G6=lm.process,cS=lm.Promise,W6=aV(lm,"queueMicrotask"),pA=W6&&W6.value;if(!pA){var dS=new oV,uS=function(){var r,a;for(hA&&(r=G6.domain)&&r.exit();a=dS.get();)try{a()}catch(o){throw dS.head&&h0(),o}r&&r.enter()};lV||hA||dV||!lS||!fA?!cV&&cS&&cS.resolve?((dA=cS.resolve(void 0)).constructor=cS,V6=H6(dA.then,dA),h0=function(){V6(uS)}):hA?h0=function(){G6.nextTick(uS)}:(uA=H6(uA,lm),h0=function(){uA(uS)}):(lA=!0,cA=fA.createTextNode(""),new lS(uS).observe(cA,{characterData:!0}),h0=function(){cA.data=lA=!lA}),pA=function(r){dS.head||h0(),dS.add(r)}}var uV=pA,f0=function(r){try{return{error:!1,value:r()}}catch(a){return{error:!0,value:a}}},xf=N.Promise,$6=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",hS=!$6&&!Zv&&typeof window=="object"&&typeof document=="object",hV=N,Ay=xf,fV=ie,pV=Gr,mV=d0,gV=Qi,vV=hS,yV=$6,mA=tt,K6=Ay&&Ay.prototype,_V=gV("species"),q6=!1,Y6=fV(hV.PromiseRejectionEvent),EV=pV("Promise",function(){var r=mV(Ay),a=r!==String(Ay);if(!a&&mA===66||!K6.catch||!K6.finally)return!0;if(!mA||mA<51||!/native code/.test(r)){var o=new Ay(function(f){f(1)}),c=function(f){f(function(){},function(){})};if((o.constructor={})[_V]=c,!(q6=o.then(function(){})instanceof c))return!0}return!a&&(vV||yV)&&!Y6}),Iy={CONSTRUCTOR:EV,REJECTION_EVENT:Y6,SUBCLASSING:q6},du={},gA=Tn,X6=TypeError,wV=function(r){var a,o;this.promise=new r(function(c,f){if(a!==void 0||o!==void 0)throw X6("Bad Promise constructor");a=c,o=f}),this.resolve=gA(a),this.reject=gA(o)};du.f=function(r){return new wV(r)};var vA,J6,SV=Ni,cm=Zv,Af=N,Ny=me,bV=hh,CV=od,TV=function(r){var a=FB(r);VB&&a&&!a[cu]&&BB(a,cu,{configurable:!0,get:function(){return this}})},RV=Tn,yA=ie,xV=it,AV=qx,IV=eA,Q6=F6.set,p0=uV,NV=function(r,a){try{arguments.length==1?console.error(r):console.error(r,a)}catch{}},Z6=f0,eL=z6,fS=Tf,pS=xf,_A=Iy,EA=du,Oy="Promise",tL=_A.CONSTRUCTOR,OV=_A.REJECTION_EVENT,wA=fS.getterFor(Oy),mS=fS.set,gS=pS&&pS.prototype,Py=pS,SA=gS,vS=Af.TypeError,yS=Af.document,bA=Af.process,CA=EA.f,PV=CA,LV=!!(yS&&yS.createEvent&&Af.dispatchEvent),nL="unhandledrejection",iL=function(r){var a;return!(!xV(r)||!yA(a=r.then))&&a},rL=function(r,a){var o,c,f,m=a.value,v=a.state==1,w=v?r.ok:r.fail,C=r.resolve,R=r.reject,x=r.domain;try{w?(v||(a.rejection===2&&kV(a),a.rejection=1),w===!0?o=m:(x&&x.enter(),o=w(m),x&&(x.exit(),f=!0)),o===r.promise?R(vS("Promise-chain cycle")):(c=iL(o))?Ny(c,o,C,R):C(o)):R(m)}catch(L){x&&!f&&x.exit(),R(L)}},sL=function(r,a){r.notified||(r.notified=!0,p0(function(){for(var o,c=r.reactions;o=c.get();)rL(o,r);r.notified=!1,a&&!r.rejection&&DV(r)}))},aL=function(r,a,o){var c,f;LV?((c=yS.createEvent("Event")).promise=a,c.reason=o,c.initEvent(r,!1,!0),Af.dispatchEvent(c)):c={promise:a,reason:o},!OV&&(f=Af["on"+r])?f(c):r===nL&&NV("Unhandled promise rejection",o)},DV=function(r){Ny(Q6,Af,function(){var a,o=r.facade,c=r.value;if(oL(r)&&(a=Z6(function(){cm?bA.emit("unhandledRejection",c,o):aL(nL,o,c)}),r.rejection=cm||oL(r)?2:1,a.error))throw a.value})},oL=function(r){return r.rejection!==1&&!r.parent},kV=function(r){Ny(Q6,Af,function(){var a=r.facade;cm?bA.emit("rejectionHandled",a):aL("rejectionhandled",a,r.value)})},Ja=function(r,a,o){return function(c){r(a,c,o)}},m0=function(r,a,o){r.done||(r.done=!0,o&&(r=o),r.value=a,r.state=2,sL(r,!0))},TA=function(r,a,o){if(!r.done){r.done=!0,o&&(r=o);try{if(r.facade===a)throw vS("Promise can't be resolved itself");var c=iL(a);c?p0(function(){var f={done:!1};try{Ny(c,a,Ja(TA,f,r),Ja(m0,f,r))}catch(m){m0(f,m,r)}}):(r.value=a,r.state=1,sL(r,!1))}catch(f){m0({done:!1},f,r)}}};tL&&(SA=(Py=function(r){AV(this,SA),RV(r),Ny(vA,this);var a=wA(this);try{r(Ja(TA,a),Ja(m0,a))}catch(o){m0(a,o)}}).prototype,(vA=function(r){mS(this,{type:Oy,done:!1,notified:!1,parent:!1,reactions:new eL,rejection:!1,state:0,value:void 0})}).prototype=bV(SA,"then",function(r,a){var o=wA(this),c=CA(IV(this,Py));return o.parent=!0,c.ok=!yA(r)||r,c.fail=yA(a)&&a,c.domain=cm?bA.domain:void 0,o.state==0?o.reactions.add(c):p0(function(){rL(c,o)}),c.promise}),J6=function(){var r=new vA,a=wA(r);this.promise=r,this.resolve=Ja(TA,a),this.reject=Ja(m0,a)},EA.f=CA=function(r){return r===Py||r===void 0?new J6(r):PV(r)}),SV({global:!0,constructor:!0,wrap:!0,forced:tL},{Promise:Py}),CV(Py,Oy,!1,!0),TV(Oy);var If=Qi("iterator"),ui=!1;try{var MV=0,Ao={next:function(){return{done:!!MV++}},return:function(){ui=!0}};Ao[If]=function(){return this},Array.from(Ao,function(){throw 2})}catch{}var Ds=xf,jV=function(r,a){if(!ui)return!1;var o=!1;try{var c={};c[If]=function(){return{next:function(){return{done:o=!0}}}},r(c)}catch{}return o},ld=Iy.CONSTRUCTOR||!jV(function(r){Ds.all(r).then(void 0,function(){})}),UV=me,FV=Tn,BV=du,VV=f0,zV=o0;Ni({target:"Promise",stat:!0,forced:ld},{all:function(r){var a=this,o=BV.f(a),c=o.resolve,f=o.reject,m=VV(function(){var v=FV(a.resolve),w=[],C=0,R=1;zV(r,function(x){var L=C++,U=!1;R++,UV(v,a,x).then(function(F){U||(U=!0,w[L]=F,--R||c(w))},f)}),--R||c(w)});return m.error&&f(m.value),o.promise}});var RA=Ni,HV=Iy.CONSTRUCTOR;xf&&xf.prototype,RA({target:"Promise",proto:!0,forced:HV,real:!0},{catch:function(r){return this.then(void 0,r)}});var gh=me,lL=Tn,_S=du,ps=f0,bs=o0;Ni({target:"Promise",stat:!0,forced:ld},{race:function(r){var a=this,o=_S.f(a),c=o.reject,f=ps(function(){var m=lL(a.resolve);bs(r,function(v){gh(m,a,v).then(o.resolve,c)})});return f.error&&c(f.value),o.promise}});var cL=me,GV=du;Ni({target:"Promise",stat:!0,forced:Iy.CONSTRUCTOR},{reject:function(r){var a=GV.f(this);return cL(a.reject,void 0,r),a.promise}});var WV=dr,$V=it,KV=du,dL=function(r,a){if(WV(r),$V(a)&&a.constructor===r)return a;var o=KV.f(r);return(0,o.resolve)(a),o.promise},qV=Ni,uL=xf,Ly=Iy.CONSTRUCTOR,xA=dL,YV=tn("Promise"),hL=!Ly;qV({target:"Promise",stat:!0,forced:!0},{resolve:function(r){return xA(hL&&this===YV?uL:this,r)}});var ES=me,Dl=Tn,g0=du,XV=f0,JV=o0;Ni({target:"Promise",stat:!0,forced:ld},{allSettled:function(r){var a=this,o=g0.f(a),c=o.resolve,f=o.reject,m=XV(function(){var v=Dl(a.resolve),w=[],C=0,R=1;JV(r,function(x){var L=C++,U=!1;R++,ES(v,a,x).then(function(F){U||(U=!0,w[L]={status:"fulfilled",value:F},--R||c(w))},function(F){U||(U=!0,w[L]={status:"rejected",reason:F},--R||c(w))})}),--R||c(w)});return m.error&&f(m.value),o.promise}});var QV=me,ZV=Tn,ez=tn,fL=du,vh=f0,wi=o0,AA="No one promise resolved";Ni({target:"Promise",stat:!0,forced:ld},{any:function(r){var a=this,o=ez("AggregateError"),c=fL.f(a),f=c.resolve,m=c.reject,v=vh(function(){var w=ZV(a.resolve),C=[],R=0,x=1,L=!1;wi(r,function(U){var F=R++,Z=!1;x++,QV(w,a,U).then(function(W){Z||L||(L=!0,f(W))},function(W){Z||L||(Z=!0,C[F]=W,--x||m(new o(C,AA)))})}),--x||m(new o(C,AA))});return v.error&&m(v.value),c.promise}});var bc=Ni,wS=xf,tz=d,Sr=tn,nz=ie,pL=eA,Dy=dL,iz=wS&&wS.prototype;bc({target:"Promise",proto:!0,real:!0,forced:!!wS&&tz(function(){iz.finally.call({then:function(){}},function(){})})},{finally:function(r){var a=pL(this,Sr("Promise")),o=nz(r);return this.then(o?function(c){return Dy(a,r()).then(function(){return c})}:r,o?function(c){return Dy(a,r()).then(function(){throw c})}:r)}});var IA=E,rz=gx,sz=xl,az=Ht,oz=IA("".charAt),mL=IA("".charCodeAt),lz=IA("".slice),gL=function(r){return function(a,o){var c,f,m=sz(az(a)),v=rz(o),w=m.length;return v<0||v>=w?r?"":void 0:(c=mL(m,v))<55296||c>56319||v+1===w||(f=mL(m,v+1))<56320||f>57343?r?oz(m,v):c:r?lz(m,v,v+2):f-56320+(c-55296<<10)+65536}},NA={codeAt:gL(!1),charAt:gL(!0)},cz=NA.charAt,dz=xl,vL=Tf,OA=by,yL=Cy,SS="String Iterator",uz=vL.set,hz=vL.getterFor(SS);OA(String,"String",function(r){uz(this,{type:SS,string:dz(r),index:0})},function(){var r,a=hz(this),o=a.string,c=a.index;return c>=o.length?yL(void 0,!0):(r=cz(o,c),a.index+=r.length,yL(r,!1))});var fz=Me.Promise,Ea={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Zo=N,pz=ad,mz=ta,_L=Qp,PA=Qi("toStringTag");for(var LA in Ea){var EL=Zo[LA],DA=EL&&EL.prototype;DA&&pz(DA)!==PA&&mz(DA,PA,LA),_L[LA]=_L.Array}var kA=fz,Ct=l(kA);let wL=OP;function SL(r,a){let o=r&&r.navigator;if(!o.mediaDevices)return;let c=function(v){if(typeof v!="object"||v.mandatory||v.optional)return v;let w={};return Object.keys(v).forEach(C=>{if(C==="require"||C==="advanced"||C==="mediaSource")return;let R=typeof v[C]=="object"?v[C]:{ideal:v[C]};R.exact!==void 0&&typeof R.exact=="number"&&(R.min=R.max=R.exact);let x=function(L,U){return L?L+U.charAt(0).toUpperCase()+U.slice(1):U==="deviceId"?"sourceId":U};if(R.ideal!==void 0){w.optional=w.optional||[];let L={};typeof R.ideal=="number"?(L[x("min",C)]=R.ideal,w.optional.push(L),L={},L[x("max",C)]=R.ideal,w.optional.push(L)):(L[x("",C)]=R.ideal,w.optional.push(L))}R.exact!==void 0&&typeof R.exact!="number"?(w.mandatory=w.mandatory||{},w.mandatory[x("",C)]=R.exact):["min","max"].forEach(L=>{R[L]!==void 0&&(w.mandatory=w.mandatory||{},w.mandatory[x(L,C)]=R[L])})}),v.advanced&&(w.optional=(w.optional||[]).concat(v.advanced)),w},f=function(v,w){if(a.version>=61)return w(v);if((v=JSON.parse(JSON.stringify(v)))&&typeof v.audio=="object"){let C=function(R,x,L){x in R&&!(L in R)&&(R[L]=R[x],delete R[x])};C((v=JSON.parse(JSON.stringify(v))).audio,"autoGainControl","googAutoGainControl"),C(v.audio,"noiseSuppression","googNoiseSuppression"),v.audio=c(v.audio)}if(v&&typeof v.video=="object"){let C=v.video.facingMode;C=C&&(typeof C=="object"?C:{ideal:C});let R=a.version<66;if(C&&(C.exact==="user"||C.exact==="environment"||C.ideal==="user"||C.ideal==="environment")&&(!o.mediaDevices.getSupportedConstraints||!o.mediaDevices.getSupportedConstraints().facingMode||R)){let x;if(delete v.video.facingMode,C.exact==="environment"||C.ideal==="environment"?x=["back","rear"]:C.exact!=="user"&&C.ideal!=="user"||(x=["front"]),x)return o.mediaDevices.enumerateDevices().then(L=>{let U=(L=L.filter(F=>F.kind==="videoinput")).find(F=>x.some(Z=>{var W;return Tt(W=F.label.toLowerCase()).call(W,Z)}));return!U&&L.length&&Tt(x).call(x,"back")&&(U=L[L.length-1]),U&&(v.video.deviceId=C.exact?{exact:U.deviceId}:{ideal:U.deviceId}),v.video=c(v.video),wL("chrome: "+JSON.stringify(v)),w(v)})}v.video=c(v.video)}return wL("chrome: "+JSON.stringify(v)),w(v)},m=function(v){return a.version>=64?v:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[v.name]||v.name,message:v.message,constraint:v.constraint||v.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(o.getUserMedia=(function(v,w,C){f(v,R=>{o.webkitGetUserMedia(R,w,x=>{C&&C(m(x))})})}).bind(o),o.mediaDevices.getUserMedia){let v=o.mediaDevices.getUserMedia.bind(o.mediaDevices);o.mediaDevices.getUserMedia=function(w){return f(w,C=>v(C).then(R=>{if(C.audio&&!R.getAudioTracks().length||C.video&&!R.getVideoTracks().length)throw R.getTracks().forEach(x=>{x.stop()}),new DOMException("","NotFoundError");return R},R=>Ct.reject(m(R))))}}}function MA(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function jA(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(o){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=o)},enumerable:!0,configurable:!0});let a=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=o=>{o.stream.addEventListener("addtrack",c=>{let f;f=r.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(v=>v.track&&v.track.id===c.track.id):{track:c.track};let m=new Event("track");m.track=c.track,m.receiver=f,m.transceiver={receiver:f},m.streams=[o.stream],this.dispatchEvent(m)}),o.stream.getTracks().forEach(c=>{let f;f=r.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(v=>v.track&&v.track.id===c.id):{track:c};let m=new Event("track");m.track=c,m.receiver=f,m.transceiver={receiver:f},m.streams=[o.stream],this.dispatchEvent(m)})},this.addEventListener("addstream",this._ontrackpoly)),a.apply(this,arguments)}}else Al(r,"track",a=>(a.transceiver||Object.defineProperty(a,"transceiver",{value:{receiver:a.receiver}}),a))}function bL(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){let a=function(f,m){return{track:m,get dtmf(){return this._dtmf===void 0&&(m.kind==="audio"?this._dtmf=f.createDTMFSender(m):this._dtmf=null),this._dtmf},_pc:f}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let f=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(v,w){let C=f.apply(this,arguments);return C||(C=a(this,v),this._senders.push(C)),C};let m=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(v){m.apply(this,arguments);let w=this._senders.indexOf(v);w!==-1&&this._senders.splice(w,1)}}let o=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(f){this._senders=this._senders||[],o.apply(this,[f]),f.getTracks().forEach(m=>{this._senders.push(a(this,m))})};let c=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(f){this._senders=this._senders||[],c.apply(this,[f]),f.getTracks().forEach(m=>{let v=this._senders.find(w=>w.track===m);v&&this._senders.splice(this._senders.indexOf(v),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){let a=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){let o=a.apply(this,[]);return o.forEach(c=>c._pc=this),o},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function CL(r){if(!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){let[o,c,f]=arguments;if(arguments.length>0&&typeof o=="function")return a.apply(this,arguments);if(a.length===0&&(arguments.length===0||typeof o!="function"))return a.apply(this,[]);let m=function(w){let C={};return w.result().forEach(R=>{let x={id:R.id,timestamp:R.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[R.type]||R.type};R.names().forEach(L=>{x[L]=R.stat(L)}),C[x.id]=x}),C},v=function(w){return new Map(Object.keys(w).map(C=>[C,w[C]]))};if(arguments.length>=2){let w=function(C){c(v(m(C)))};return a.apply(this,[w,o])}return new Ct((w,C)=>{a.apply(this,[function(R){w(v(m(R)))},C])}).then(c,f)}}function TL(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){let o=r.RTCPeerConnection.prototype.getSenders;o&&(r.RTCPeerConnection.prototype.getSenders=function(){let f=o.apply(this,[]);return f.forEach(m=>m._pc=this),f});let c=r.RTCPeerConnection.prototype.addTrack;c&&(r.RTCPeerConnection.prototype.addTrack=function(){let f=c.apply(this,arguments);return f._pc=this,f}),r.RTCRtpSender.prototype.getStats=function(){let f=this;return this._pc.getStats().then(m=>PP(m,f.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){let o=r.RTCPeerConnection.prototype.getReceivers;o&&(r.RTCPeerConnection.prototype.getReceivers=function(){let c=o.apply(this,[]);return c.forEach(f=>f._pc=this),c}),Al(r,"track",c=>(c.receiver._pc=c.srcElement,c)),r.RTCRtpReceiver.prototype.getStats=function(){let c=this;return this._pc.getStats().then(f=>PP(f,c.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype)||!("getStats"in r.RTCRtpReceiver.prototype))return;let a=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){let o=arguments[0],c,f,m;return this.getSenders().forEach(v=>{v.track===o&&(c?m=!0:c=v)}),this.getReceivers().forEach(v=>(v.track===o&&(f?m=!0:f=v),v.track===o)),m||c&&f?Ct.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):c?c.getStats():f?f.getStats():Ct.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return a.apply(this,arguments)}}function RL(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(m=>this._shimmedLocalStreams[m][0])};let a=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(m,v){if(!v)return a.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let w=a.apply(this,arguments);return this._shimmedLocalStreams[v.id]?this._shimmedLocalStreams[v.id].indexOf(w)===-1&&this._shimmedLocalStreams[v.id].push(w):this._shimmedLocalStreams[v.id]=[v,w],w};let o=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(m){this._shimmedLocalStreams=this._shimmedLocalStreams||{},m.getTracks().forEach(C=>{if(this.getSenders().find(R=>R.track===C))throw new DOMException("Track already exists.","InvalidAccessError")});let v=this.getSenders();o.apply(this,arguments);let w=this.getSenders().filter(C=>v.indexOf(C)===-1);this._shimmedLocalStreams[m.id]=[m].concat(w)};let c=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(m){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[m.id],c.apply(this,arguments)};let f=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(m){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},m&&Object.keys(this._shimmedLocalStreams).forEach(v=>{let w=this._shimmedLocalStreams[v].indexOf(m);w!==-1&&this._shimmedLocalStreams[v].splice(w,1),this._shimmedLocalStreams[v].length===1&&delete this._shimmedLocalStreams[v]}),f.apply(this,arguments)}}function dm(r,a){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&a.version>=65)return RL(r);let o=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){let C=o.apply(this);return this._reverseStreams=this._reverseStreams||{},C.map(R=>this._reverseStreams[R.id])};let c=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(C){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},C.getTracks().forEach(R=>{if(this.getSenders().find(x=>x.track===R))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[C.id]){let R=new r.MediaStream(C.getTracks());this._streams[C.id]=R,this._reverseStreams[R.id]=C,C=R}c.apply(this,[C])};let f=r.RTCPeerConnection.prototype.removeStream;function m(C,R){let x=R.sdp;return Object.keys(C._reverseStreams||[]).forEach(L=>{let U=C._reverseStreams[L],F=C._streams[U.id];x=x.replace(new RegExp(F.id,"g"),U.id)}),new RTCSessionDescription({type:R.type,sdp:x})}r.RTCPeerConnection.prototype.removeStream=function(C){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},f.apply(this,[this._streams[C.id]||C]),delete this._reverseStreams[this._streams[C.id]?this._streams[C.id].id:C.id],delete this._streams[C.id]},r.RTCPeerConnection.prototype.addTrack=function(C,R){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");let x=[].slice.call(arguments,1);if(x.length!==1||!x[0].getTracks().find(U=>U===C))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(U=>U.track===C))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let L=this._streams[R.id];if(L)L.addTrack(C),Ct.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{let U=new r.MediaStream([C]);this._streams[R.id]=U,this._reverseStreams[U.id]=R,this.addStream(U)}return this.getSenders().find(U=>U.track===C)},["createOffer","createAnswer"].forEach(function(C){let R=r.RTCPeerConnection.prototype[C],x={[C](){let L=arguments;return arguments.length&&typeof arguments[0]=="function"?R.apply(this,[U=>{let F=m(this,U);L[0].apply(null,[F])},U=>{L[1]&&L[1].apply(null,U)},arguments[2]]):R.apply(this,arguments).then(U=>m(this,U))}};r.RTCPeerConnection.prototype[C]=x[C]});let v=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(C,R){let x=R.sdp;return Object.keys(C._reverseStreams||[]).forEach(L=>{let U=C._reverseStreams[L],F=C._streams[U.id];x=x.replace(new RegExp(U.id,"g"),F.id)}),new RTCSessionDescription({type:R.type,sdp:x})}(this,arguments[0]),v.apply(this,arguments)):v.apply(this,arguments)};let w=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){let C=w.get.apply(this);return C.type===""?C:m(this,C)}}),r.RTCPeerConnection.prototype.removeTrack=function(C){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!C._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(C._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let R;this._streams=this._streams||{},Object.keys(this._streams).forEach(x=>{this._streams[x].getTracks().find(L=>C.track===L)&&(R=this._streams[x])}),R&&(R.getTracks().length===1?this.removeStream(this._reverseStreams[R.id]):R.removeTrack(C.track),this.dispatchEvent(new Event("negotiationneeded")))}}function UA(r,a){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&a.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(o){let c=r.RTCPeerConnection.prototype[o],f={[o](){return arguments[0]=new(o==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),c.apply(this,arguments)}};r.RTCPeerConnection.prototype[o]=f[o]})}function xL(r,a){Al(r,"negotiationneeded",o=>{let c=o.target;if(!(a.version<72||c.getConfiguration&&c.getConfiguration().sdpSemantics==="plan-b")||c.signalingState==="stable")return o})}var AL=Object.freeze({__proto__:null,fixNegotiationNeeded:xL,shimAddTrackRemoveTrack:dm,shimAddTrackRemoveTrackWithNative:RL,shimGetDisplayMedia:function(r,a){r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices||r.navigator.mediaDevices&&(typeof a=="function"?r.navigator.mediaDevices.getDisplayMedia=function(o){return a(o).then(c=>{let f=o.video&&o.video.width,m=o.video&&o.video.height,v=o.video&&o.video.frameRate;return o.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:c,maxFrameRate:v||3}},f&&(o.video.mandatory.maxWidth=f),m&&(o.video.mandatory.maxHeight=m),r.navigator.mediaDevices.getUserMedia(o)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))},shimGetSendersWithDtmf:bL,shimGetStats:CL,shimGetUserMedia:SL,shimMediaStream:MA,shimOnTrack:jA,shimPeerConnection:UA,shimSenderReceiverGetStats:TL});function IL(r,a){let o=r&&r.navigator,c=r&&r.MediaStreamTrack;if(o.getUserMedia=function(f,m,v){Tx("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),o.mediaDevices.getUserMedia(f).then(m,v)},!(a.version>55&&"autoGainControl"in o.mediaDevices.getSupportedConstraints())){let f=function(v,w,C){w in v&&!(C in v)&&(v[C]=v[w],delete v[w])},m=o.mediaDevices.getUserMedia.bind(o.mediaDevices);if(o.mediaDevices.getUserMedia=function(v){return typeof v=="object"&&typeof v.audio=="object"&&(v=JSON.parse(JSON.stringify(v)),f(v.audio,"autoGainControl","mozAutoGainControl"),f(v.audio,"noiseSuppression","mozNoiseSuppression")),m(v)},c&&c.prototype.getSettings){let v=c.prototype.getSettings;c.prototype.getSettings=function(){let w=v.apply(this,arguments);return f(w,"mozAutoGainControl","autoGainControl"),f(w,"mozNoiseSuppression","noiseSuppression"),w}}if(c&&c.prototype.applyConstraints){let v=c.prototype.applyConstraints;c.prototype.applyConstraints=function(w){return this.kind==="audio"&&typeof w=="object"&&(w=JSON.parse(JSON.stringify(w)),f(w,"autoGainControl","mozAutoGainControl"),f(w,"noiseSuppression","mozNoiseSuppression")),v.apply(this,[w])}}}}function NL(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function bS(r,a){if(typeof r!="object"||!r.RTCPeerConnection&&!r.mozRTCPeerConnection)return;!r.RTCPeerConnection&&r.mozRTCPeerConnection&&(r.RTCPeerConnection=r.mozRTCPeerConnection),a.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(f){let m=r.RTCPeerConnection.prototype[f],v={[f](){return arguments[0]=new(f==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),m.apply(this,arguments)}};r.RTCPeerConnection.prototype[f]=v[f]});let o={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},c=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){let[f,m,v]=arguments;return c.apply(this,[f||null]).then(w=>{if(a.version<53&&!m)try{w.forEach(C=>{C.type=o[C.type]||C.type})}catch(C){if(C.name!=="TypeError")throw C;w.forEach((R,x)=>{w.set(x,Object.assign({},R,{type:o[R.type]||R.type}))})}return w}).then(m,v)}}function FA(r){if(typeof r!="object"||!r.RTCPeerConnection||!r.RTCRtpSender||r.RTCRtpSender&&"getStats"in r.RTCRtpSender.prototype)return;let a=r.RTCPeerConnection.prototype.getSenders;a&&(r.RTCPeerConnection.prototype.getSenders=function(){let c=a.apply(this,[]);return c.forEach(f=>f._pc=this),c});let o=r.RTCPeerConnection.prototype.addTrack;o&&(r.RTCPeerConnection.prototype.addTrack=function(){let c=o.apply(this,arguments);return c._pc=this,c}),r.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Ct.resolve(new Map)}}function OL(r){if(typeof r!="object"||!r.RTCPeerConnection||!r.RTCRtpSender||r.RTCRtpSender&&"getStats"in r.RTCRtpReceiver.prototype)return;let a=r.RTCPeerConnection.prototype.getReceivers;a&&(r.RTCPeerConnection.prototype.getReceivers=function(){let o=a.apply(this,[]);return o.forEach(c=>c._pc=this),o}),Al(r,"track",o=>(o.receiver._pc=o.srcElement,o)),r.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function PL(r){r.RTCPeerConnection&&!("removeStream"in r.RTCPeerConnection.prototype)&&(r.RTCPeerConnection.prototype.removeStream=function(a){Tx("removeStream","removeTrack"),this.getSenders().forEach(o=>{var c;o.track&&Tt(c=a.getTracks()).call(c,o.track)&&this.removeTrack(o)})})}function LL(r){r.DataChannel&&!r.RTCDataChannel&&(r.RTCDataChannel=r.DataChannel)}function DL(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.addTransceiver;a&&(r.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let o=arguments[1]&&arguments[1].sendEncodings;o===void 0&&(o=[]),o=[...o];let c=o.length>0;c&&o.forEach(m=>{if("rid"in m&&!/^[a-z0-9]{0,16}$/i.test(m.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in m&&!(parseFloat(m.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in m&&!(parseFloat(m.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});let f=a.apply(this,arguments);if(c){let{sender:m}=f,v=m.getParameters();(!("encodings"in v)||v.encodings.length===1&&Object.keys(v.encodings[0]).length===0)&&(v.encodings=o,m.sendEncodings=o,this.setParametersPromises.push(m.setParameters(v).then(()=>{delete m.sendEncodings}).catch(()=>{delete m.sendEncodings})))}return f})}function kL(r){if(typeof r!="object"||!r.RTCRtpSender)return;let a=r.RTCRtpSender.prototype.getParameters;a&&(r.RTCRtpSender.prototype.getParameters=function(){let o=a.apply(this,arguments);return"encodings"in o||(o.encodings=[].concat(this.sendEncodings||[{}])),o})}function ML(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Ct.all(this.setParametersPromises).then(()=>a.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):a.apply(this,arguments)}}function jL(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype.createAnswer;r.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Ct.all(this.setParametersPromises).then(()=>a.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):a.apply(this,arguments)}}var UL=Object.freeze({__proto__:null,shimAddTransceiver:DL,shimCreateAnswer:jL,shimCreateOffer:ML,shimGetDisplayMedia:function(r,a){r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices||r.navigator.mediaDevices&&(r.navigator.mediaDevices.getDisplayMedia=function(o){if(!o||!o.video){let c=new DOMException("getDisplayMedia without video constraints is undefined");return c.name="NotFoundError",c.code=8,Ct.reject(c)}return o.video===!0?o.video={mediaSource:a}:o.video.mediaSource=a,r.navigator.mediaDevices.getUserMedia(o)})},shimGetParameters:kL,shimGetUserMedia:IL,shimOnTrack:NL,shimPeerConnection:bS,shimRTCDataChannel:LL,shimReceiverGetStats:OL,shimRemoveStream:PL,shimSenderGetStats:FA});function FL(r){if(typeof r=="object"&&r.RTCPeerConnection){if("getLocalStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in r.RTCPeerConnection.prototype)){let a=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addStream=function(o){var c;this._localStreams||(this._localStreams=[]),Tt(c=this._localStreams).call(c,o)||this._localStreams.push(o),o.getAudioTracks().forEach(f=>a.call(this,f,o)),o.getVideoTracks().forEach(f=>a.call(this,f,o))},r.RTCPeerConnection.prototype.addTrack=function(o){for(var c=arguments.length,f=new Array(c>1?c-1:0),m=1;m<c;m++)f[m-1]=arguments[m];return f&&f.forEach(v=>{var w;this._localStreams?Tt(w=this._localStreams).call(w,v)||this._localStreams.push(v):this._localStreams=[v]}),a.apply(this,arguments)}}"removeStream"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.removeStream=function(a){this._localStreams||(this._localStreams=[]);let o=this._localStreams.indexOf(a);if(o===-1)return;this._localStreams.splice(o,1);let c=a.getTracks();this.getSenders().forEach(f=>{Tt(c).call(c,f.track)&&this.removeTrack(f)})})}}function BL(r){if(typeof r=="object"&&r.RTCPeerConnection&&("getRemoteStreams"in r.RTCPeerConnection.prototype||(r.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in r.RTCPeerConnection.prototype))){Object.defineProperty(r.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(o){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=o),this.addEventListener("track",this._onaddstreampoly=c=>{c.streams.forEach(f=>{var m;if(this._remoteStreams||(this._remoteStreams=[]),Tt(m=this._remoteStreams).call(m,f))return;this._remoteStreams.push(f);let v=new Event("addstream");v.stream=f,this.dispatchEvent(v)})})}});let a=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){let o=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(c){c.streams.forEach(f=>{if(o._remoteStreams||(o._remoteStreams=[]),o._remoteStreams.indexOf(f)>=0)return;o._remoteStreams.push(f);let m=new Event("addstream");m.stream=f,o.dispatchEvent(m)})}),a.apply(o,arguments)}}}function VL(r){if(typeof r!="object"||!r.RTCPeerConnection)return;let a=r.RTCPeerConnection.prototype,o=a.createOffer,c=a.createAnswer,f=a.setLocalDescription,m=a.setRemoteDescription,v=a.addIceCandidate;a.createOffer=function(C,R){let x=arguments.length>=2?arguments[2]:arguments[0],L=o.apply(this,[x]);return R?(L.then(C,R),Ct.resolve()):L},a.createAnswer=function(C,R){let x=arguments.length>=2?arguments[2]:arguments[0],L=c.apply(this,[x]);return R?(L.then(C,R),Ct.resolve()):L};let w=function(C,R,x){let L=f.apply(this,[C]);return x?(L.then(R,x),Ct.resolve()):L};a.setLocalDescription=w,w=function(C,R,x){let L=m.apply(this,[C]);return x?(L.then(R,x),Ct.resolve()):L},a.setRemoteDescription=w,w=function(C,R,x){let L=v.apply(this,[C]);return x?(L.then(R,x),Ct.resolve()):L},a.addIceCandidate=w}function zL(r){let a=r&&r.navigator;if(a.mediaDevices&&a.mediaDevices.getUserMedia){let o=a.mediaDevices,c=o.getUserMedia.bind(o);a.mediaDevices.getUserMedia=f=>c(HL(f))}!a.getUserMedia&&a.mediaDevices&&a.mediaDevices.getUserMedia&&(a.getUserMedia=(function(o,c,f){a.mediaDevices.getUserMedia(o).then(c,f)}).bind(a))}function HL(r){return r&&r.video!==void 0?Object.assign({},r,{video:ny(r.video)}):r}function GL(r){if(!r.RTCPeerConnection)return;let a=r.RTCPeerConnection;r.RTCPeerConnection=function(o,c){if(o&&o.iceServers){let f=[];for(let m=0;m<o.iceServers.length;m++){let v=o.iceServers[m];!v.hasOwnProperty("urls")&&v.hasOwnProperty("url")?(Tx("RTCIceServer.url","RTCIceServer.urls"),v=JSON.parse(JSON.stringify(v)),v.urls=v.url,delete v.url,f.push(v)):f.push(o.iceServers[m])}o.iceServers=f}return new a(o,c)},r.RTCPeerConnection.prototype=a.prototype,"generateCertificate"in a&&Object.defineProperty(r.RTCPeerConnection,"generateCertificate",{get:()=>a.generateCertificate})}function WL(r){typeof r=="object"&&r.RTCTrackEvent&&"receiver"in r.RTCTrackEvent.prototype&&!("transceiver"in r.RTCTrackEvent.prototype)&&Object.defineProperty(r.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function $L(r){let a=r.RTCPeerConnection.prototype.createOffer;r.RTCPeerConnection.prototype.createOffer=function(o){if(o){o.offerToReceiveAudio!==void 0&&(o.offerToReceiveAudio=!!o.offerToReceiveAudio);let c=this.getTransceivers().find(m=>m.receiver.track.kind==="audio");o.offerToReceiveAudio===!1&&c?c.direction==="sendrecv"?c.setDirection?c.setDirection("sendonly"):c.direction="sendonly":c.direction==="recvonly"&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive"):o.offerToReceiveAudio!==!0||c||this.addTransceiver("audio",{direction:"recvonly"}),o.offerToReceiveVideo!==void 0&&(o.offerToReceiveVideo=!!o.offerToReceiveVideo);let f=this.getTransceivers().find(m=>m.receiver.track.kind==="video");o.offerToReceiveVideo===!1&&f?f.direction==="sendrecv"?f.setDirection?f.setDirection("sendonly"):f.direction="sendonly":f.direction==="recvonly"&&(f.setDirection?f.setDirection("inactive"):f.direction="inactive"):o.offerToReceiveVideo!==!0||f||this.addTransceiver("video",{direction:"recvonly"})}return a.apply(this,arguments)}}function KL(r){typeof r!="object"||r.AudioContext||(r.AudioContext=r.webkitAudioContext)}var qL=Object.freeze({__proto__:null,shimAudioContext:KL,shimCallbacksAPI:VL,shimConstraints:HL,shimCreateOfferLegacy:$L,shimGetUserMedia:zL,shimLocalStreamsAPI:FL,shimRTCIceServerUrls:GL,shimRemoteStreamsAPI:BL,shimTrackEventTransceiver:WL}),YL=`
\v\f\r                 \u2028\u2029\uFEFF`,gz=Ht,vz=xl,BA=YL,XL=E("".replace),yz=RegExp("^["+BA+"]+"),_z=RegExp("(^|[^"+BA+"])["+BA+"]+$"),ky=function(r){return function(a){var o=vz(gz(a));return 1&r&&(o=XL(o,yz,"")),2&r&&(o=XL(o,_z,"$1")),o}},JL={start:ky(1),end:ky(2),trim:ky(3)},QL=zx.PROPER,Ez=d,ZL=YL,wz=JL.trim;Ni({target:"String",proto:!0,forced:function(r){return Ez(function(){return!!ZL[r]()||"​…᠎"[r]()!=="​…᠎"||QL&&ZL[r].name!==r})}("trim")},{trim:function(){return wz(this)}});var VA=vc("String").trim,Sz=b,bz=VA,zA=String.prototype,el=function(r){var a=r.trim;return typeof r=="string"||r===zA||Sz(zA,r)&&a===zA.trim?bz:a},ks=l(el),e8={exports:{}};(function(r){let a={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};a.localCName=a.generateIdentifier(),a.splitLines=function(o){return o.trim().split(`
`).map(c=>c.trim())},a.splitSections=function(o){return o.split(`
m=`).map((c,f)=>(f>0?"m="+c:c).trim()+`\r
`)},a.getDescription=function(o){let c=a.splitSections(o);return c&&c[0]},a.getMediaSections=function(o){let c=a.splitSections(o);return c.shift(),c},a.matchPrefix=function(o,c){return a.splitLines(o).filter(f=>f.indexOf(c)===0)},a.parseCandidate=function(o){let c;c=o.indexOf("a=candidate:")===0?o.substring(12).split(" "):o.substring(10).split(" ");let f={foundation:c[0],component:{1:"rtp",2:"rtcp"}[c[1]]||c[1],protocol:c[2].toLowerCase(),priority:parseInt(c[3],10),ip:c[4],address:c[4],port:parseInt(c[5],10),type:c[7]};for(let m=8;m<c.length;m+=2)switch(c[m]){case"raddr":f.relatedAddress=c[m+1];break;case"rport":f.relatedPort=parseInt(c[m+1],10);break;case"tcptype":f.tcpType=c[m+1];break;case"ufrag":f.ufrag=c[m+1],f.usernameFragment=c[m+1];break;default:f[c[m]]===void 0&&(f[c[m]]=c[m+1])}return f},a.writeCandidate=function(o){let c=[];c.push(o.foundation);let f=o.component;f==="rtp"?c.push(1):f==="rtcp"?c.push(2):c.push(f),c.push(o.protocol.toUpperCase()),c.push(o.priority),c.push(o.address||o.ip),c.push(o.port);let m=o.type;return c.push("typ"),c.push(m),m!=="host"&&o.relatedAddress&&o.relatedPort&&(c.push("raddr"),c.push(o.relatedAddress),c.push("rport"),c.push(o.relatedPort)),o.tcpType&&o.protocol.toLowerCase()==="tcp"&&(c.push("tcptype"),c.push(o.tcpType)),(o.usernameFragment||o.ufrag)&&(c.push("ufrag"),c.push(o.usernameFragment||o.ufrag)),"candidate:"+c.join(" ")},a.parseIceOptions=function(o){return o.substring(14).split(" ")},a.parseRtpMap=function(o){let c=o.substring(9).split(" "),f={payloadType:parseInt(c.shift(),10)};return c=c[0].split("/"),f.name=c[0],f.clockRate=parseInt(c[1],10),f.channels=c.length===3?parseInt(c[2],10):1,f.numChannels=f.channels,f},a.writeRtpMap=function(o){let c=o.payloadType;o.preferredPayloadType!==void 0&&(c=o.preferredPayloadType);let f=o.channels||o.numChannels||1;return"a=rtpmap:"+c+" "+o.name+"/"+o.clockRate+(f!==1?"/"+f:"")+`\r
`},a.parseExtmap=function(o){let c=o.substring(9).split(" ");return{id:parseInt(c[0],10),direction:c[0].indexOf("/")>0?c[0].split("/")[1]:"sendrecv",uri:c[1],attributes:c.slice(2).join(" ")}},a.writeExtmap=function(o){return"a=extmap:"+(o.id||o.preferredId)+(o.direction&&o.direction!=="sendrecv"?"/"+o.direction:"")+" "+o.uri+(o.attributes?" "+o.attributes:"")+`\r
`},a.parseFmtp=function(o){let c={},f,m=o.substring(o.indexOf(" ")+1).split(";");for(let v=0;v<m.length;v++)f=m[v].trim().split("="),c[f[0].trim()]=f[1];return c},a.writeFmtp=function(o){let c="",f=o.payloadType;if(o.preferredPayloadType!==void 0&&(f=o.preferredPayloadType),o.parameters&&Object.keys(o.parameters).length){let m=[];Object.keys(o.parameters).forEach(v=>{o.parameters[v]!==void 0?m.push(v+"="+o.parameters[v]):m.push(v)}),c+="a=fmtp:"+f+" "+m.join(";")+`\r
`}return c},a.parseRtcpFb=function(o){let c=o.substring(o.indexOf(" ")+1).split(" ");return{type:c.shift(),parameter:c.join(" ")}},a.writeRtcpFb=function(o){let c="",f=o.payloadType;return o.preferredPayloadType!==void 0&&(f=o.preferredPayloadType),o.rtcpFeedback&&o.rtcpFeedback.length&&o.rtcpFeedback.forEach(m=>{c+="a=rtcp-fb:"+f+" "+m.type+(m.parameter&&m.parameter.length?" "+m.parameter:"")+`\r
`}),c},a.parseSsrcMedia=function(o){let c=o.indexOf(" "),f={ssrc:parseInt(o.substring(7,c),10)},m=o.indexOf(":",c);return m>-1?(f.attribute=o.substring(c+1,m),f.value=o.substring(m+1)):f.attribute=o.substring(c+1),f},a.parseSsrcGroup=function(o){let c=o.substring(13).split(" ");return{semantics:c.shift(),ssrcs:c.map(f=>parseInt(f,10))}},a.getMid=function(o){let c=a.matchPrefix(o,"a=mid:")[0];if(c)return c.substring(6)},a.parseFingerprint=function(o){let c=o.substring(14).split(" ");return{algorithm:c[0].toLowerCase(),value:c[1].toUpperCase()}},a.getDtlsParameters=function(o,c){return{role:"auto",fingerprints:a.matchPrefix(o+c,"a=fingerprint:").map(a.parseFingerprint)}},a.writeDtlsParameters=function(o,c){let f="a=setup:"+c+`\r
`;return o.fingerprints.forEach(m=>{f+="a=fingerprint:"+m.algorithm+" "+m.value+`\r
`}),f},a.parseCryptoLine=function(o){let c=o.substring(9).split(" ");return{tag:parseInt(c[0],10),cryptoSuite:c[1],keyParams:c[2],sessionParams:c.slice(3)}},a.writeCryptoLine=function(o){return"a=crypto:"+o.tag+" "+o.cryptoSuite+" "+(typeof o.keyParams=="object"?a.writeCryptoKeyParams(o.keyParams):o.keyParams)+(o.sessionParams?" "+o.sessionParams.join(" "):"")+`\r
`},a.parseCryptoKeyParams=function(o){if(o.indexOf("inline:")!==0)return null;let c=o.substring(7).split("|");return{keyMethod:"inline",keySalt:c[0],lifeTime:c[1],mkiValue:c[2]?c[2].split(":")[0]:void 0,mkiLength:c[2]?c[2].split(":")[1]:void 0}},a.writeCryptoKeyParams=function(o){return o.keyMethod+":"+o.keySalt+(o.lifeTime?"|"+o.lifeTime:"")+(o.mkiValue&&o.mkiLength?"|"+o.mkiValue+":"+o.mkiLength:"")},a.getCryptoParameters=function(o,c){return a.matchPrefix(o+c,"a=crypto:").map(a.parseCryptoLine)},a.getIceParameters=function(o,c){let f=a.matchPrefix(o+c,"a=ice-ufrag:")[0],m=a.matchPrefix(o+c,"a=ice-pwd:")[0];return f&&m?{usernameFragment:f.substring(12),password:m.substring(10)}:null},a.writeIceParameters=function(o){let c="a=ice-ufrag:"+o.usernameFragment+`\r
a=ice-pwd:`+o.password+`\r
`;return o.iceLite&&(c+=`a=ice-lite\r
`),c},a.parseRtpParameters=function(o){let c={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},f=a.splitLines(o)[0].split(" ");c.profile=f[2];for(let v=3;v<f.length;v++){let w=f[v],C=a.matchPrefix(o,"a=rtpmap:"+w+" ")[0];if(C){let R=a.parseRtpMap(C),x=a.matchPrefix(o,"a=fmtp:"+w+" ");switch(R.parameters=x.length?a.parseFmtp(x[0]):{},R.rtcpFeedback=a.matchPrefix(o,"a=rtcp-fb:"+w+" ").map(a.parseRtcpFb),c.codecs.push(R),R.name.toUpperCase()){case"RED":case"ULPFEC":c.fecMechanisms.push(R.name.toUpperCase())}}}a.matchPrefix(o,"a=extmap:").forEach(v=>{c.headerExtensions.push(a.parseExtmap(v))});let m=a.matchPrefix(o,"a=rtcp-fb:* ").map(a.parseRtcpFb);return c.codecs.forEach(v=>{m.forEach(w=>{v.rtcpFeedback.find(C=>C.type===w.type&&C.parameter===w.parameter)||v.rtcpFeedback.push(w)})}),c},a.writeRtpDescription=function(o,c){let f="";f+="m="+o+" ",f+=c.codecs.length>0?"9":"0",f+=" "+(c.profile||"UDP/TLS/RTP/SAVPF")+" ",f+=c.codecs.map(v=>v.preferredPayloadType!==void 0?v.preferredPayloadType:v.payloadType).join(" ")+`\r
`,f+=`c=IN IP4 0.0.0.0\r
`,f+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,c.codecs.forEach(v=>{f+=a.writeRtpMap(v),f+=a.writeFmtp(v),f+=a.writeRtcpFb(v)});let m=0;return c.codecs.forEach(v=>{v.maxptime>m&&(m=v.maxptime)}),m>0&&(f+="a=maxptime:"+m+`\r
`),c.headerExtensions&&c.headerExtensions.forEach(v=>{f+=a.writeExtmap(v)}),f},a.parseRtpEncodingParameters=function(o){let c=[],f=a.parseRtpParameters(o),m=f.fecMechanisms.indexOf("RED")!==-1,v=f.fecMechanisms.indexOf("ULPFEC")!==-1,w=a.matchPrefix(o,"a=ssrc:").map(U=>a.parseSsrcMedia(U)).filter(U=>U.attribute==="cname"),C=w.length>0&&w[0].ssrc,R,x=a.matchPrefix(o,"a=ssrc-group:FID").map(U=>U.substring(17).split(" ").map(F=>parseInt(F,10)));x.length>0&&x[0].length>1&&x[0][0]===C&&(R=x[0][1]),f.codecs.forEach(U=>{if(U.name.toUpperCase()==="RTX"&&U.parameters.apt){let F={ssrc:C,codecPayloadType:parseInt(U.parameters.apt,10)};C&&R&&(F.rtx={ssrc:R}),c.push(F),m&&(F=JSON.parse(JSON.stringify(F)),F.fec={ssrc:C,mechanism:v?"red+ulpfec":"red"},c.push(F))}}),c.length===0&&C&&c.push({ssrc:C});let L=a.matchPrefix(o,"b=");return L.length&&(L=L[0].indexOf("b=TIAS:")===0?parseInt(L[0].substring(7),10):L[0].indexOf("b=AS:")===0?1e3*parseInt(L[0].substring(5),10)*.95-16e3:void 0,c.forEach(U=>{U.maxBitrate=L})),c},a.parseRtcpParameters=function(o){let c={},f=a.matchPrefix(o,"a=ssrc:").map(w=>a.parseSsrcMedia(w)).filter(w=>w.attribute==="cname")[0];f&&(c.cname=f.value,c.ssrc=f.ssrc);let m=a.matchPrefix(o,"a=rtcp-rsize");c.reducedSize=m.length>0,c.compound=m.length===0;let v=a.matchPrefix(o,"a=rtcp-mux");return c.mux=v.length>0,c},a.writeRtcpParameters=function(o){let c="";return o.reducedSize&&(c+=`a=rtcp-rsize\r
`),o.mux&&(c+=`a=rtcp-mux\r
`),o.ssrc!==void 0&&o.cname&&(c+="a=ssrc:"+o.ssrc+" cname:"+o.cname+`\r
`),c},a.parseMsid=function(o){let c,f=a.matchPrefix(o,"a=msid:");if(f.length===1)return c=f[0].substring(7).split(" "),{stream:c[0],track:c[1]};let m=a.matchPrefix(o,"a=ssrc:").map(v=>a.parseSsrcMedia(v)).filter(v=>v.attribute==="msid");return m.length>0?(c=m[0].value.split(" "),{stream:c[0],track:c[1]}):void 0},a.parseSctpDescription=function(o){let c=a.parseMLine(o),f=a.matchPrefix(o,"a=max-message-size:"),m;f.length>0&&(m=parseInt(f[0].substring(19),10)),isNaN(m)&&(m=65536);let v=a.matchPrefix(o,"a=sctp-port:");if(v.length>0)return{port:parseInt(v[0].substring(12),10),protocol:c.fmt,maxMessageSize:m};let w=a.matchPrefix(o,"a=sctpmap:");if(w.length>0){let C=w[0].substring(10).split(" ");return{port:parseInt(C[0],10),protocol:C[1],maxMessageSize:m}}},a.writeSctpDescription=function(o,c){let f=[];return f=o.protocol!=="DTLS/SCTP"?["m="+o.kind+" 9 "+o.protocol+" "+c.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+c.port+`\r
`]:["m="+o.kind+" 9 "+o.protocol+" "+c.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+c.port+" "+c.protocol+` 65535\r
`],c.maxMessageSize!==void 0&&f.push("a=max-message-size:"+c.maxMessageSize+`\r
`),f.join("")},a.generateSessionId=function(){return Math.random().toString().substr(2,22)},a.writeSessionBoilerplate=function(o,c,f){let m,v=c!==void 0?c:2;return m=o||a.generateSessionId(),`v=0\r
o=`+(f||"thisisadapterortc")+" "+m+" "+v+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`},a.getDirection=function(o,c){let f=a.splitLines(o);for(let m=0;m<f.length;m++)switch(f[m]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return f[m].substring(2)}return c?a.getDirection(c):"sendrecv"},a.getKind=function(o){return a.splitLines(o)[0].split(" ")[0].substring(2)},a.isRejected=function(o){return o.split(" ",2)[1]==="0"},a.parseMLine=function(o){let c=a.splitLines(o)[0].substring(2).split(" ");return{kind:c[0],port:parseInt(c[1],10),protocol:c[2],fmt:c.slice(3).join(" ")}},a.parseOLine=function(o){let c=a.matchPrefix(o,"o=")[0].substring(2).split(" ");return{username:c[0],sessionId:c[1],sessionVersion:parseInt(c[2],10),netType:c[3],addressType:c[4],address:c[5]}},a.isValidSDP=function(o){if(typeof o!="string"||o.length===0)return!1;let c=a.splitLines(o);for(let f=0;f<c.length;f++)if(c[f].length<2||c[f].charAt(1)!=="=")return!1;return!0},r.exports=a})(e8);var t8=e8.exports,v0=l(t8),Cz=i({__proto__:null,default:v0},[t8]);function y0(r){if(!r.RTCIceCandidate||r.RTCIceCandidate&&"foundation"in r.RTCIceCandidate.prototype)return;let a=r.RTCIceCandidate;r.RTCIceCandidate=function(o){if(typeof o=="object"&&o.candidate&&o.candidate.indexOf("a=")===0&&((o=JSON.parse(JSON.stringify(o))).candidate=o.candidate.substr(2)),o.candidate&&o.candidate.length){let c=new a(o),f=v0.parseCandidate(o.candidate),m=Object.assign(c,f);return m.toJSON=function(){return{candidate:m.candidate,sdpMid:m.sdpMid,sdpMLineIndex:m.sdpMLineIndex,usernameFragment:m.usernameFragment}},m}return new a(o)},r.RTCIceCandidate.prototype=a.prototype,Al(r,"icecandidate",o=>(o.candidate&&Object.defineProperty(o,"candidate",{value:new r.RTCIceCandidate(o.candidate),writable:"false"}),o))}function HA(r){!r.RTCIceCandidate||r.RTCIceCandidate&&"relayProtocol"in r.RTCIceCandidate.prototype||Al(r,"icecandidate",a=>{if(a.candidate){let o=v0.parseCandidate(a.candidate.candidate);o.type==="relay"&&(a.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[o.priority>>24])}return a})}function _0(r,a){if(!r.RTCPeerConnection)return;"sctp"in r.RTCPeerConnection.prototype||Object.defineProperty(r.RTCPeerConnection.prototype,"sctp",{get(){return this._sctp===void 0?null:this._sctp}});let o=function(w){if(!w||!w.sdp)return!1;let C=v0.splitSections(w.sdp);return C.shift(),C.some(R=>{let x=v0.parseMLine(R);return x&&x.kind==="application"&&x.protocol.indexOf("SCTP")!==-1})},c=function(w){let C=w.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(C===null||C.length<2)return-1;let R=parseInt(C[1],10);return R!=R?-1:R},f=function(w){let C=65536;return a.browser==="firefox"&&(C=a.version<57?w===-1?16384:2147483637:a.version<60?a.version===57?65535:65536:2147483637),C},m=function(w,C){let R=65536;a.browser==="firefox"&&a.version===57&&(R=65535);let x=v0.matchPrefix(w.sdp,"a=max-message-size:");return x.length>0?R=parseInt(x[0].substr(19),10):a.browser==="firefox"&&C!==-1&&(R=2147483637),R},v=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,a.browser==="chrome"&&a.version>=76){let{sdpSemantics:w}=this.getConfiguration();w==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(o(arguments[0])){let w=c(arguments[0]),C=f(w),R=m(arguments[0],w),x;x=C===0&&R===0?Number.POSITIVE_INFINITY:C===0||R===0?Math.max(C,R):Math.min(C,R);let L={};Object.defineProperty(L,"maxMessageSize",{get:()=>x}),this._sctp=L}return v.apply(this,arguments)}}function CS(r){if(!r.RTCPeerConnection||!("createDataChannel"in r.RTCPeerConnection.prototype))return;function a(c,f){let m=c.send;c.send=function(){let v=arguments[0],w=v.length||v.size||v.byteLength;if(c.readyState==="open"&&f.sctp&&w>f.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+f.sctp.maxMessageSize+" bytes)");return m.apply(c,arguments)}}let o=r.RTCPeerConnection.prototype.createDataChannel;r.RTCPeerConnection.prototype.createDataChannel=function(){let c=o.apply(this,arguments);return a(c,this),c},Al(r,"datachannel",c=>(a(c.channel,c.target),c))}function GA(r){if(!r.RTCPeerConnection||"connectionState"in r.RTCPeerConnection.prototype)return;let a=r.RTCPeerConnection.prototype;Object.defineProperty(a,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(a,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(o){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),o&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=o)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(o=>{let c=a[o];a[o]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=f=>{let m=f.target;if(m._lastConnectionState!==m.connectionState){m._lastConnectionState=m.connectionState;let v=new Event("connectionstatechange",f);m.dispatchEvent(v)}return f},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),c.apply(this,arguments)}})}function WA(r,a){if(!r.RTCPeerConnection||a.browser==="chrome"&&a.version>=71||a.browser==="safari"&&a.version>=605)return;let o=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(c){if(c&&c.sdp&&c.sdp.indexOf(`
a=extmap-allow-mixed`)!==-1){let f=c.sdp.split(`
`).filter(m=>ks(m).call(m)!=="a=extmap-allow-mixed").join(`
`);r.RTCSessionDescription&&c instanceof r.RTCSessionDescription?arguments[0]=new r.RTCSessionDescription({type:c.type,sdp:f}):c.sdp=f}return o.apply(this,arguments)}}function TS(r,a){if(!r.RTCPeerConnection||!r.RTCPeerConnection.prototype)return;let o=r.RTCPeerConnection.prototype.addIceCandidate;o&&o.length!==0&&(r.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(a.browser==="chrome"&&a.version<78||a.browser==="firefox"&&a.version<68||a.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Ct.resolve():o.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Ct.resolve())})}function My(r,a){if(!r.RTCPeerConnection||!r.RTCPeerConnection.prototype)return;let o=r.RTCPeerConnection.prototype.setLocalDescription;o&&o.length!==0&&(r.RTCPeerConnection.prototype.setLocalDescription=function(){let c=arguments[0]||{};if(typeof c!="object"||c.type&&c.sdp)return o.apply(this,arguments);if(c={type:c.type,sdp:c.sdp},!c.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":c.type="offer";break;default:c.type="answer"}return c.sdp||c.type!=="offer"&&c.type!=="answer"?o.apply(this,[c]):(c.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(f=>o.apply(this,[f]))})}var Tz=Object.freeze({__proto__:null,removeExtmapAllowMixed:WA,shimAddIceCandidateNullOrEmpty:TS,shimConnectionState:GA,shimMaxMessageSize:_0,shimParameterlessSetLocalDescription:My,shimRTCIceCandidate:y0,shimRTCIceCandidateRelayProtocol:HA,shimSendThrowTypeError:CS});(function(){let{window:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0},o=OP,c=function(m){let v={browser:null,version:null};if(m===void 0||!m.navigator)return v.browser="Not a browser.",v;let{navigator:w}=m;if(w.mozGetUserMedia)v.browser="firefox",v.version=Sf(w.userAgent,/Firefox\/(\d+)\./,1);else if(w.webkitGetUserMedia||m.isSecureContext===!1&&m.webkitRTCPeerConnection)v.browser="chrome",v.version=Sf(w.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!m.RTCPeerConnection||!w.userAgent.match(/AppleWebKit\/(\d+)\./))return v.browser="Not a supported browser.",v;v.browser="safari",v.version=Sf(w.userAgent,/AppleWebKit\/(\d+)\./,1),v.supportsUnifiedPlan=m.RTCRtpTransceiver&&"currentDirection"in m.RTCRtpTransceiver.prototype}return v}(r),f={browserDetails:c,commonShim:Tz,extractVersion:Sf,disableLog:xw,disableWarnings:VF,sdp:Cz};switch(c.browser){case"chrome":if(!AL||!UA||!a.shimChrome)return o("Chrome shim is not included in this adapter release."),f;if(c.version===null)return o("Chrome shim can not determine version, not shimming."),f;o("adapter.js shimming chrome."),f.browserShim=AL,TS(r,c),My(r),SL(r,c),MA(r),UA(r,c),jA(r),dm(r,c),bL(r),CL(r),TL(r),xL(r,c),y0(r),HA(r),GA(r),_0(r,c),CS(r),WA(r,c);break;case"firefox":if(!UL||!bS||!a.shimFirefox)return o("Firefox shim is not included in this adapter release."),f;o("adapter.js shimming firefox."),f.browserShim=UL,TS(r,c),My(r),IL(r,c),bS(r,c),NL(r),PL(r),FA(r),OL(r),LL(r),DL(r),kL(r),ML(r),jL(r),y0(r),GA(r),_0(r,c),CS(r);break;case"safari":if(!qL||!a.shimSafari)return o("Safari shim is not included in this adapter release."),f;o("adapter.js shimming safari."),f.browserShim=qL,TS(r,c),My(r),GL(r),$L(r),VL(r),FL(r),BL(r),WL(r),zL(r),KL(r),y0(r),HA(r),_0(r,c),CS(r),WA(r,c);break;default:o("Unsupported browser!")}})({window:typeof window>"u"?void 0:window});var Rz=vc("Array").keys,xz=ad,$A=fs,KA=b,Az=Rz,qA=Array.prototype,Iz={DOMTokenList:!0,NodeList:!0},Nz=function(r){var a=r.keys;return r===qA||KA(qA,r)&&a===qA.keys||$A(Iz,xz(r))?Az:a},tl=l(Nz),n8=Jt,Oz=TypeError,Pz=ru,Lz=gc,Dz=Xe,RS=function(r,a,o){var c=Pz(a);c in r?Lz.f(r,c,Dz(0,o)):r[c]=o},i8=Jv,kz=lh,Mz=RS,jz=Array,Uz=Math.max,YA=function(r,a,o){for(var c=kz(r),f=i8(a,c),m=i8(o===void 0?c:o,c),v=jz(Uz(m-f,0)),w=0;f<m;f++,w++)Mz(v,w,r[f]);return v.length=w,v},r8=YA,Fz=Math.floor,XA=function(r,a){var o=r.length,c=Fz(o/2);return o<8?Bz(r,a):S(r,XA(r8(r,0,c),a),XA(r8(r,c),a),a)},Bz=function(r,a){for(var o,c,f=r.length,m=1;m<f;){for(c=m,o=r[m];c&&a(r[c-1],o)>0;)r[c]=r[--c];c!==m++&&(r[c]=o)}return r},S=function(r,a,o,c){for(var f=a.length,m=o.length,v=0,w=0;v<f||w<m;)r[v+w]=v<f&&w<m?c(a[v],o[w])<=0?a[v++]:o[w++]:v<f?a[v++]:o[w++];return r},I=XA,B=un.match(/firefox\/(\d+)/i),se=!!B&&+B[1],ge=/MSIE|Trident/.test(un),Ie=un.match(/AppleWebKit\/(\d+)\./),ze=!!Ie&&+Ie[1],Ye=Ni,ct=E,jt=Tn,Ft=Ro,Yt=lh,yn=function(r,a){if(!delete r[a])throw Oz("Cannot delete property "+n8(a)+" of "+n8(r))},Pn=xl,qn=d,Ci=I,ei=Sw,Bi=se,Yi=ge,nl=tt,Qa=ze,Gs=[],Cs=ct(Gs.sort),cd=ct(Gs.push),yh=qn(function(){Gs.sort(void 0)}),s8=qn(function(){Gs.sort(null)}),Ebe=ei("sort"),ZZ=!qn(function(){if(nl)return nl<70;if(!(Bi&&Bi>3)){if(Yi)return!0;if(Qa)return Qa<603;var r,a,o,c,f="";for(r=65;r<76;r++){switch(a=String.fromCharCode(r),r){case 66:case 69:case 70:case 72:o=3;break;case 68:case 71:o=4;break;default:o=2}for(c=0;c<47;c++)Gs.push({k:a+c,v:o})}for(Gs.sort(function(m,v){return v.v-m.v}),c=0;c<Gs.length;c++)a=Gs[c].k.charAt(0),f.charAt(f.length-1)!==a&&(f+=a);return f!=="DGBEFHACIJK"}});Ye({target:"Array",proto:!0,forced:yh||!s8||!Ebe||!ZZ},{sort:function(r){r!==void 0&&jt(r);var a=Ft(this);if(ZZ)return r===void 0?Cs(a):Cs(a,r);var o,c,f=[],m=Yt(a);for(c=0;c<m;c++)c in a&&cd(f,a[c]);for(Ci(f,function(v){return function(w,C){return C===void 0?-1:w===void 0?1:v!==void 0?+v(w,C)||0:Pn(w)>Pn(C)?1:-1}}(r)),o=Yt(f),c=0;c<o;)a[c]=f[c++];for(;c<m;)yn(a,c++);return a}});var wbe=vc("Array").sort,Sbe=b,bbe=wbe,Vz=Array.prototype,Cbe=function(r){var a=r.sort;return r===Vz||Sbe(Vz,r)&&a===Vz.sort?bbe:a},JA=l(Cbe),zz={exports:{}};(function(r,a){(function(o,c){var f="function",m="undefined",v="object",w="string",C="major",R="model",x="name",L="type",U="vendor",F="version",Z="architecture",W="console",K="mobile",oe="tablet",ue="smarttv",xe="wearable",Oe="embedded",ke="Amazon",He="Apple",lt="ASUS",ut="BlackBerry",ft="Browser",zt="Chrome",$n="Firefox",hi="Google",Gi="Huawei",Ur="LG",mr="Microsoft",Ou="Motorola",at="Opera",yt="Samsung",Vt="Sharp",Rn="Sony",oi="Xiaomi",Rt="Zebra",q="Facebook",Ee="Chromium OS",Ae="Mac OS",gt=function(Pr){for(var Xr={},er=0;er<Pr.length;er++)Xr[Pr[er].toUpperCase()]=Pr[er];return Xr},bn=function(Pr,Xr){return typeof Pr===w&&ji(Xr).indexOf(ji(Pr))!==-1},ji=function(Pr){return Pr.toLowerCase()},os=function(Pr,Xr){if(typeof Pr===w)return Pr=Pr.replace(/^\s\s*/,""),typeof Xr===m?Pr:Pr.substring(0,350)},ll=function(Pr,Xr){for(var er,Bl,Yf,Lr,li,cl,X0=0;X0<Xr.length&&!li;){var Lh=Xr[X0],Zce=Xr[X0+1];for(er=Bl=0;er<Lh.length&&!li&&Lh[er];)if(li=Lh[er++].exec(Pr))for(Yf=0;Yf<Zce.length;Yf++)cl=li[++Bl],typeof(Lr=Zce[Yf])===v&&Lr.length>0?Lr.length===2?typeof Lr[1]==f?this[Lr[0]]=Lr[1].call(this,cl):this[Lr[0]]=Lr[1]:Lr.length===3?typeof Lr[1]!==f||Lr[1].exec&&Lr[1].test?this[Lr[0]]=cl?cl.replace(Lr[1],Lr[2]):c:this[Lr[0]]=cl?Lr[1].call(this,cl,Lr[2]):c:Lr.length===4&&(this[Lr[0]]=cl?Lr[3].call(this,cl.replace(Lr[1],Lr[2])):c):this[Lr]=cl||c;X0+=2}},Rm=function(Pr,Xr){for(var er in Xr)if(typeof Xr[er]===v&&Xr[er].length>0){for(var Bl=0;Bl<Xr[er].length;Bl++)if(bn(Xr[er][Bl],Pr))return er==="?"?c:er}else if(bn(Xr[er],Pr))return er==="?"?c:er;return Pr},QD={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ZD={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[F,[x,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[F,[x,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[x,F],[/opios[\/ ]+([\w\.]+)/i],[F,[x,at+" Mini"]],[/\bopr\/([\w\.]+)/i],[F,[x,at]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[x,F],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[F,[x,"UC"+ft]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[F,[x,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[F,[x,"WeChat"]],[/konqueror\/([\w\.]+)/i],[F,[x,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[F,[x,"IE"]],[/yabrowser\/([\w\.]+)/i],[F,[x,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[x,/(.+)/,"$1 Secure "+ft],F],[/\bfocus\/([\w\.]+)/i],[F,[x,$n+" Focus"]],[/\bopt\/([\w\.]+)/i],[F,[x,at+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[F,[x,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[F,[x,"Dolphin"]],[/coast\/([\w\.]+)/i],[F,[x,at+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[F,[x,"MIUI "+ft]],[/fxios\/([-\w\.]+)/i],[F,[x,$n]],[/\bqihu|(qi?ho?o?|360)browser/i],[[x,"360 "+ft]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[x,/(.+)/,"$1 "+ft],F],[/(comodo_dragon)\/([\w\.]+)/i],[[x,/_/g," "],F],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[x,F],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[x],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[x,q],F],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[x,F],[/\bgsa\/([\w\.]+) .*safari\//i],[F,[x,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[F,[x,zt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[x,zt+" WebView"],F],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[F,[x,"Android "+ft]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[x,F],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[F,[x,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[F,x],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[x,[F,Rm,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[x,F],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[x,"Netscape"],F],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[F,[x,$n+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[x,F],[/(cobalt)\/([\w\.]+)/i],[x,[F,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[Z,"amd64"]],[/(ia32(?=;))/i],[[Z,ji]],[/((?:i[346]|x)86)[;\)]/i],[[Z,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[Z,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[Z,"armhf"]],[/windows (ce|mobile); ppc;/i],[[Z,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[Z,/ower/,"",ji]],[/(sun4\w)[;\)]/i],[[Z,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[Z,ji]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[R,[U,yt],[L,oe]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[R,[U,yt],[L,K]],[/\((ip(?:hone|od)[\w ]*);/i],[R,[U,He],[L,K]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[R,[U,He],[L,oe]],[/(macintosh);/i],[R,[U,He]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[R,[U,Vt],[L,K]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[R,[U,Gi],[L,oe]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[R,[U,Gi],[L,K]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[R,/_/g," "],[U,oi],[L,K]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[R,/_/g," "],[U,oi],[L,oe]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[R,[U,"OPPO"],[L,K]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[R,[U,"Vivo"],[L,K]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[R,[U,"Realme"],[L,K]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[R,[U,Ou],[L,K]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[R,[U,Ou],[L,oe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[R,[U,Ur],[L,oe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[R,[U,Ur],[L,K]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[R,[U,"Lenovo"],[L,oe]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[R,/_/g," "],[U,"Nokia"],[L,K]],[/(pixel c)\b/i],[R,[U,hi],[L,oe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[R,[U,hi],[L,K]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[R,[U,Rn],[L,K]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[R,"Xperia Tablet"],[U,Rn],[L,oe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[R,[U,"OnePlus"],[L,K]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[R,[U,ke],[L,oe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[R,/(.+)/g,"Fire Phone $1"],[U,ke],[L,K]],[/(playbook);[-\w\),; ]+(rim)/i],[R,U,[L,oe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[R,[U,ut],[L,K]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[R,[U,lt],[L,oe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[R,[U,lt],[L,K]],[/(nexus 9)/i],[R,[U,"HTC"],[L,oe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[U,[R,/_/g," "],[L,K]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[R,[U,"Acer"],[L,oe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[R,[U,"Meizu"],[L,K]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[U,R,[L,K]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[U,R,[L,oe]],[/(surface duo)/i],[R,[U,mr],[L,oe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[R,[U,"Fairphone"],[L,K]],[/(u304aa)/i],[R,[U,"AT&T"],[L,K]],[/\bsie-(\w*)/i],[R,[U,"Siemens"],[L,K]],[/\b(rct\w+) b/i],[R,[U,"RCA"],[L,oe]],[/\b(venue[\d ]{2,7}) b/i],[R,[U,"Dell"],[L,oe]],[/\b(q(?:mv|ta)\w+) b/i],[R,[U,"Verizon"],[L,oe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[R,[U,"Barnes & Noble"],[L,oe]],[/\b(tm\d{3}\w+) b/i],[R,[U,"NuVision"],[L,oe]],[/\b(k88) b/i],[R,[U,"ZTE"],[L,oe]],[/\b(nx\d{3}j) b/i],[R,[U,"ZTE"],[L,K]],[/\b(gen\d{3}) b.+49h/i],[R,[U,"Swiss"],[L,K]],[/\b(zur\d{3}) b/i],[R,[U,"Swiss"],[L,oe]],[/\b((zeki)?tb.*\b) b/i],[R,[U,"Zeki"],[L,oe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[U,"Dragon Touch"],R,[L,oe]],[/\b(ns-?\w{0,9}) b/i],[R,[U,"Insignia"],[L,oe]],[/\b((nxa|next)-?\w{0,9}) b/i],[R,[U,"NextBook"],[L,oe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[U,"Voice"],R,[L,K]],[/\b(lvtel\-)?(v1[12]) b/i],[[U,"LvTel"],R,[L,K]],[/\b(ph-1) /i],[R,[U,"Essential"],[L,K]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[R,[U,"Envizen"],[L,oe]],[/\b(trio[-\w\. ]+) b/i],[R,[U,"MachSpeed"],[L,oe]],[/\btu_(1491) b/i],[R,[U,"Rotor"],[L,oe]],[/(shield[\w ]+) b/i],[R,[U,"Nvidia"],[L,oe]],[/(sprint) (\w+)/i],[U,R,[L,K]],[/(kin\.[onetw]{3})/i],[[R,/\./g," "],[U,mr],[L,K]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[R,[U,Rt],[L,oe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[R,[U,Rt],[L,K]],[/smart-tv.+(samsung)/i],[U,[L,ue]],[/hbbtv.+maple;(\d+)/i],[[R,/^/,"SmartTV"],[U,yt],[L,ue]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[U,Ur],[L,ue]],[/(apple) ?tv/i],[U,[R,He+" TV"],[L,ue]],[/crkey/i],[[R,zt+"cast"],[U,hi],[L,ue]],[/droid.+aft(\w)( bui|\))/i],[R,[U,ke],[L,ue]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[R,[U,Vt],[L,ue]],[/(bravia[\w ]+)( bui|\))/i],[R,[U,Rn],[L,ue]],[/(mitv-\w{5}) bui/i],[R,[U,oi],[L,ue]],[/Hbbtv.*(technisat) (.*);/i],[U,R,[L,ue]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[U,os],[R,os],[L,ue]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[L,ue]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[U,R,[L,W]],[/droid.+; (shield) bui/i],[R,[U,"Nvidia"],[L,W]],[/(playstation [345portablevi]+)/i],[R,[U,Rn],[L,W]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[R,[U,mr],[L,W]],[/((pebble))app/i],[U,R,[L,xe]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[R,[U,He],[L,xe]],[/droid.+; (glass) \d/i],[R,[U,hi],[L,xe]],[/droid.+; (wt63?0{2,3})\)/i],[R,[U,Rt],[L,xe]],[/(quest( 2| pro)?)/i],[R,[U,q],[L,xe]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[U,[L,Oe]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[R,[L,K]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[R,[L,oe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[L,oe]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[L,K]],[/(android[-\w\. ]{0,9});.+buil/i],[R,[U,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[F,[x,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[F,[x,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[x,F],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[F,x]],os:[[/microsoft (windows) (vista|xp)/i],[x,F],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[x,[F,Rm,QD]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[x,"Windows"],[F,Rm,QD]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[F,/_/g,"."],[x,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[x,Ae],[F,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[F,x],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[x,F],[/\(bb(10);/i],[F,[x,ut]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[F,[x,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[F,[x,$n+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[F,[x,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[F,[x,"watchOS"]],[/crkey\/([\d\.]+)/i],[F,[x,zt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[x,Ee],F],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[x,F],[/(sunos) ?([\w\.\d]*)/i],[[x,"Solaris"],F],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[x,F]]},_d=function(Pr,Xr){if(typeof Pr===v&&(Xr=Pr,Pr=c),!(this instanceof _d))return new _d(Pr,Xr).getResult();var er=typeof o!==m&&o.navigator?o.navigator:c,Bl=Pr||(er&&er.userAgent?er.userAgent:""),Yf=er&&er.userAgentData?er.userAgentData:c,Lr=Xr?function(li,cl){var X0={};for(var Lh in li)cl[Lh]&&cl[Lh].length%2==0?X0[Lh]=cl[Lh].concat(li[Lh]):X0[Lh]=li[Lh];return X0}(ZD,Xr):ZD;return this.getBrowser=function(){var li={};return li[x]=c,li[F]=c,ll.call(li,Bl,Lr.browser),li[C]=function(cl){return typeof cl===w?cl.replace(/[^\d\.]/g,"").split(".")[0]:c}(li[F]),er&&er.brave&&typeof er.brave.isBrave==f&&(li[x]="Brave"),li},this.getCPU=function(){var li={};return li[Z]=c,ll.call(li,Bl,Lr.cpu),li},this.getDevice=function(){var li={};return li[U]=c,li[R]=c,li[L]=c,ll.call(li,Bl,Lr.device),!li[L]&&Yf&&Yf.mobile&&(li[L]=K),li[R]=="Macintosh"&&er&&typeof er.standalone!==m&&er.maxTouchPoints&&er.maxTouchPoints>2&&(li[R]="iPad",li[L]=oe),li},this.getEngine=function(){var li={};return li[x]=c,li[F]=c,ll.call(li,Bl,Lr.engine),li},this.getOS=function(){var li={};return li[x]=c,li[F]=c,ll.call(li,Bl,Lr.os),!li[x]&&Yf&&Yf.platform!="Unknown"&&(li[x]=Yf.platform.replace(/chrome os/i,Ee).replace(/macos/i,Ae)),li},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Bl},this.setUA=function(li){return Bl=typeof li===w&&li.length>350?os(li,350):li,this},this.setUA(Bl),this};_d.VERSION="0.7.34",_d.BROWSER=gt([x,F,C]),_d.CPU=gt([Z]),_d.DEVICE=gt([R,U,L,W,K,ue,oe,xe,Oe]),_d.ENGINE=_d.OS=gt([x,F]),r.exports&&(a=r.exports=_d),a.UAParser=_d;var Y0=typeof o!==m&&(o.jQuery||o.Zepto);if(Y0&&!Y0.ua){var Tb=new _d;Y0.ua=Tb.getResult(),Y0.ua.get=function(){return Tb.getUA()},Y0.ua.set=function(Pr){Tb.setUA(Pr);var Xr=Tb.getResult();for(var er in Xr)Y0.ua[er]=Xr[er]}}})(typeof window=="object"?window:s)})(zz,zz.exports);var Tbe=l(zz.exports),Rbe=ad,xbe=fs,Abe=Je,Ibe=Qp,Nbe=Qi("iterator"),Obe=Object,Pbe=function(r){if(Abe(r))return!1;var a=Obe(r);return a[Nbe]!==void 0||"@@iterator"in a||xbe(Ibe,Rbe(a))},Lbe=l(Pbe),Hz=N;Ni({global:!0,forced:Hz.globalThis!==Hz},{globalThis:Hz});var eee=l(N);function tee(r,a){return function(){return r.apply(a,arguments)}}let{toString:Dbe}=Object.prototype,{getPrototypeOf:Gz}=Object,a8=(Wz=Object.create(null),r=>{let a=Dbe.call(r);return Wz[a]||(Wz[a]=a.slice(8,-1).toLowerCase())});var Wz;let Nf=r=>(r=r.toLowerCase(),a=>a8(a)===r),o8=r=>a=>typeof a===r,{isArray:xS}=Array,QA=o8("undefined"),nee=Nf("ArrayBuffer"),kbe=o8("string"),uu=o8("function"),iee=o8("number"),l8=r=>r!==null&&typeof r=="object",c8=r=>{if(a8(r)!=="object")return!1;let a=Gz(r);return!(a!==null&&a!==Object.prototype&&Object.getPrototypeOf(a)!==null||Symbol.toStringTag in r||Lbe(r))},Mbe=Nf("Date"),jbe=Nf("File"),Ube=Nf("Blob"),Fbe=Nf("FileList"),Bbe=Nf("URLSearchParams");function ZA(r,a){let o,c,{allOwnKeys:f=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(r!=null)if(typeof r!="object"&&(r=[r]),xS(r))for(o=0,c=r.length;o<c;o++)a.call(null,r[o],o,r);else{let m=f?Object.getOwnPropertyNames(r):Object.keys(r),v=m.length,w;for(o=0;o<v;o++)w=m[o],a.call(null,r[w],w,r)}}function ree(r,a){a=a.toLowerCase();let o=Object.keys(r),c,f=o.length;for(;f-- >0;)if(c=o[f],a===c.toLowerCase())return c;return null}let see=eee!==void 0?eee:typeof self<"u"?self:typeof window<"u"?window:Wo,aee=r=>!QA(r)&&r!==see,Vbe=($z=typeof Uint8Array<"u"&&Gz(Uint8Array),r=>$z&&r instanceof $z);var $z;let zbe=Nf("HTMLFormElement"),oee=(r=>{let{hasOwnProperty:a}=r;return(o,c)=>a.call(o,c)})(Object.prototype),Hbe=Nf("RegExp"),lee=(r,a)=>{let o=Object.getOwnPropertyDescriptors(r),c={};ZA(o,(f,m)=>{let v;(v=a(f,m,r))!==!1&&(c[m]=v||f)}),Object.defineProperties(r,c)},Kz="abcdefghijklmnopqrstuvwxyz",cee="0123456789",dee={DIGIT:cee,ALPHA:Kz,ALPHA_DIGIT:Kz+Kz.toUpperCase()+cee},Gbe=Nf("AsyncFunction");var Bt={isArray:xS,isArrayBuffer:nee,isBuffer:function(r){return r!==null&&!QA(r)&&r.constructor!==null&&!QA(r.constructor)&&uu(r.constructor.isBuffer)&&r.constructor.isBuffer(r)},isFormData:r=>{let a;return r&&(typeof FormData=="function"&&r instanceof FormData||uu(r.append)&&((a=a8(r))==="formdata"||a==="object"&&uu(r.toString)&&r.toString()==="[object FormData]"))},isArrayBufferView:function(r){let a;return a=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&nee(r.buffer),a},isString:kbe,isNumber:iee,isBoolean:r=>r===!0||r===!1,isObject:l8,isPlainObject:c8,isUndefined:QA,isDate:Mbe,isFile:jbe,isBlob:Ube,isRegExp:Hbe,isFunction:uu,isStream:r=>l8(r)&&uu(r.pipe),isURLSearchParams:Bbe,isTypedArray:Vbe,isFileList:Fbe,forEach:ZA,merge:function r(){let{caseless:a}=aee(this)&&this||{},o={},c=(f,m)=>{let v=a&&ree(o,m)||m;c8(o[v])&&c8(f)?o[v]=r(o[v],f):c8(f)?o[v]=r({},f):xS(f)?o[v]=f.slice():o[v]=f};for(let f=0,m=arguments.length;f<m;f++)arguments[f]&&ZA(arguments[f],c);return o},extend:function(r,a,o){let{allOwnKeys:c}=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return ZA(a,(f,m)=>{o&&uu(f)?r[m]=tee(f,o):r[m]=f},{allOwnKeys:c}),r},trim:r=>ks(r)?ks(r).call(r):r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),inherits:(r,a,o,c)=>{r.prototype=Object.create(a.prototype,c),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:a.prototype}),o&&Object.assign(r.prototype,o)},toFlatObject:(r,a,o,c)=>{let f,m,v,w={};if(a=a||{},r==null)return a;do{for(f=Object.getOwnPropertyNames(r),m=f.length;m-- >0;)v=f[m],c&&!c(v,r,a)||w[v]||(a[v]=r[v],w[v]=!0);r=o!==!1&&Gz(r)}while(r&&(!o||o(r,a))&&r!==Object.prototype);return a},kindOf:a8,kindOfTest:Nf,endsWith:(r,a,o)=>{r=String(r),(o===void 0||o>r.length)&&(o=r.length),o-=a.length;let c=r.indexOf(a,o);return c!==-1&&c===o},toArray:r=>{if(!r)return null;if(xS(r))return r;let a=r.length;if(!iee(a))return null;let o=new Array(a);for(;a-- >0;)o[a]=r[a];return o},forEachEntry:(r,a)=>{let o=(r&&r[Symbol.iterator]).call(r),c;for(;(c=o.next())&&!c.done;){let f=c.value;a.call(r,f[0],f[1])}},matchAll:(r,a)=>{let o,c=[];for(;(o=r.exec(a))!==null;)c.push(o);return c},isHTMLForm:zbe,hasOwnProperty:oee,hasOwnProp:oee,reduceDescriptors:lee,freezeMethods:r=>{lee(r,(a,o)=>{if(uu(r)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let c=r[o];uu(c)&&(a.enumerable=!1,"writable"in a?a.writable=!1:a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))})},toObjectSet:(r,a)=>{let o={},c=f=>{f.forEach(m=>{o[m]=!0})};return xS(r)?c(r):c(String(r).split(a)),o},toCamelCase:r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,o,c){return o.toUpperCase()+c}),noop:()=>{},toFiniteNumber:(r,a)=>(r=+r,Number.isFinite(r)?r:a),findKey:ree,global:see,isContextDefined:aee,ALPHABET:dee,generateString:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dee.ALPHA_DIGIT,o="",{length:c}=a;for(;r--;)o+=a[Math.random()*c|0];return o},isSpecCompliantForm:function(r){return!!(r&&uu(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])},toJSONObject:r=>{let a=new Array(10),o=(c,f)=>{if(l8(c)){if(a.indexOf(c)>=0)return;if(!("toJSON"in c)){a[f]=c;let m=xS(c)?[]:{};return ZA(c,(v,w)=>{let C=o(v,f+1);!QA(C)&&(m[w]=C)}),a[f]=void 0,m}}return c};return o(r,0)},isAsyncFn:Gbe,isThenable:r=>r&&(l8(r)||uu(r))&&uu(r.then)&&uu(r.catch)};function hr(r,a,o,c,f){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",a&&(this.code=a),o&&(this.config=o),c&&(this.request=c),f&&(this.response=f)}Bt.inherits(hr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Bt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let uee=hr.prototype,hee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{hee[r]={value:r}}),Object.defineProperties(hr,hee),Object.defineProperty(uee,"isAxiosError",{value:!0}),hr.from=(r,a,o,c,f,m)=>{let v=Object.create(uee);return Bt.toFlatObject(r,v,function(w){return w!==Error.prototype},w=>w!=="isAxiosError"),hr.call(v,r.message,a,o,c,f),v.cause=r,v.name=r.name,m&&Object.assign(v,m),v};function qz(r){return Bt.isPlainObject(r)||Bt.isArray(r)}function fee(r){return Bt.endsWith(r,"[]")?r.slice(0,-2):r}function pee(r,a,o){return r?r.concat(a).map(function(c,f){return c=fee(c),!o&&f?"["+c+"]":c}).join(o?".":""):a}let Wbe=Bt.toFlatObject(Bt,{},null,function(r){return/^is[A-Z]/.test(r)});function d8(r,a,o){if(!Bt.isObject(r))throw new TypeError("target must be an object");a=a||new FormData;let c=(o=Bt.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(U,F){return!Bt.isUndefined(F[U])})).metaTokens,f=o.visitor||R,m=o.dots,v=o.indexes,w=(o.Blob||typeof Blob<"u"&&Blob)&&Bt.isSpecCompliantForm(a);if(!Bt.isFunction(f))throw new TypeError("visitor must be a function");function C(U){if(U===null)return"";if(Bt.isDate(U))return U.toISOString();if(!w&&Bt.isBlob(U))throw new hr("Blob is not supported. Use a Buffer instead.");return Bt.isArrayBuffer(U)||Bt.isTypedArray(U)?w&&typeof Blob=="function"?new Blob([U]):o7.from(U):U}function R(U,F,Z){let W=U;if(U&&!Z&&typeof U=="object"){if(Bt.endsWith(F,"{}"))F=c?F:F.slice(0,-2),U=JSON.stringify(U);else if(Bt.isArray(U)&&function(K){return Bt.isArray(K)&&!K.some(qz)}(U)||(Bt.isFileList(U)||Bt.endsWith(F,"[]"))&&(W=Bt.toArray(U)))return F=fee(F),W.forEach(function(K,oe){!Bt.isUndefined(K)&&K!==null&&a.append(v===!0?pee([F],oe,m):v===null?F:F+"[]",C(K))}),!1}return!!qz(U)||(a.append(pee(Z,F,m),C(U)),!1)}let x=[],L=Object.assign(Wbe,{defaultVisitor:R,convertValue:C,isVisitable:qz});if(!Bt.isObject(r))throw new TypeError("data must be an object");return function U(F,Z){if(!Bt.isUndefined(F)){if(x.indexOf(F)!==-1)throw Error("Circular reference detected in "+Z.join("."));x.push(F),Bt.forEach(F,function(W,K){(!(Bt.isUndefined(W)||W===null)&&f.call(a,W,Bt.isString(K)?ks(K).call(K):K,Z,L))===!0&&U(W,Z?Z.concat(K):[K])}),x.pop()}}(r),a}function mee(r){let a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(o){return a[o]})}function Yz(r,a){this._pairs=[],r&&d8(r,this,a)}let gee=Yz.prototype;function $be(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function vee(r,a,o){if(!a)return r;let c=o&&o.encode||$be,f=o&&o.serialize,m;if(m=f?f(a,o):Bt.isURLSearchParams(a)?a.toString():new Yz(a,o).toString(c),m){let v=r.indexOf("#");v!==-1&&(r=r.slice(0,v)),r+=(r.indexOf("?")===-1?"?":"&")+m}return r}gee.append=function(r,a){this._pairs.push([r,a])},gee.toString=function(r){let a=r?function(o){return r.call(this,o,mee)}:mee;return this._pairs.map(function(o){return a(o[0])+"="+a(o[1])},"").join("&")};var yee=class{constructor(){this.handlers=[]}use(r,a,o){return this.handlers.push({fulfilled:r,rejected:a,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Bt.forEach(this.handlers,function(a){a!==null&&r(a)})}},_ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Eee={exports:{}},Kbe=Ni,qbe=he,wee=gc.f;Kbe({target:"Object",stat:!0,forced:Object.defineProperty!==wee,sham:!qbe},{defineProperty:wee});var See=Me.Object,Ybe=Eee.exports=function(r,a,o){return See.defineProperty(r,a,o)};See.defineProperty.sham&&(Ybe.sham=!0);var bee=l(Eee.exports),Xbe=Q,e3=Array.isArray||function(r){return Xbe(r)=="Array"},Jbe=TypeError,Cee=e3,Qbe=Pl,Zbe=it,eCe=Qi("species"),Tee=Array,tCe=function(r){var a;return Cee(r)&&(a=r.constructor,(Qbe(a)&&(a===Tee||Cee(a.prototype))||Zbe(a)&&(a=a[eCe])===null)&&(a=void 0)),a===void 0?Tee:a},Ree=function(r,a){return new(tCe(r))(a===0?0:a)},nCe=d,iCe=tt,rCe=Qi("species"),xee=function(r){return iCe>=51||!nCe(function(){var a=[];return(a.constructor={})[rCe]=function(){return{foo:1}},a[r](Boolean).foo!==1})},sCe=Ni,aCe=d,oCe=e3,lCe=it,cCe=Ro,dCe=lh,Aee=function(r){if(r>9007199254740991)throw Jbe("Maximum allowed index exceeded");return r},Iee=RS,uCe=Ree,hCe=xee,fCe=tt,Nee=Qi("isConcatSpreadable"),pCe=fCe>=51||!aCe(function(){var r=[];return r[Nee]=!1,r.concat()[0]!==r}),mCe=function(r){if(!lCe(r))return!1;var a=r[Nee];return a!==void 0?!!a:oCe(r)};sCe({target:"Array",proto:!0,arity:1,forced:!pCe||!hCe("concat")},{concat:function(r){var a,o,c,f,m,v=cCe(this),w=uCe(v,0),C=0;for(a=-1,c=arguments.length;a<c;a++)if(mCe(m=a===-1?v:arguments[a]))for(f=dCe(m),Aee(C+f),o=0;o<f;o++,C++)o in m&&Iee(w,C,m[o]);else Aee(C+1),Iee(w,C++,m);return w.length=C,w}});var Oee={},gCe=Q,vCe=xt,Pee=Nw.f,yCe=YA,Lee=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Oee.f=function(r){return Lee&&gCe(r)=="Window"?function(a){try{return Pee(a)}catch{return yCe(Lee)}}(r):Pee(vCe(r))};var AS={},_Ce=Qi;AS.f=_Ce;var Dee=Me,ECe=fs,wCe=AS,SCe=gc.f,Ws=function(r){var a=Dee.Symbol||(Dee.Symbol={});ECe(a,r)||SCe(a,r,{value:wCe.f(r)})},bCe=me,CCe=tn,TCe=Qi,RCe=hh,kee=function(){var r=CCe("Symbol"),a=r&&r.prototype,o=a&&a.valueOf,c=TCe("toPrimitive");a&&!a[c]&&RCe(a,c,function(f){return bCe(o,this)},{arity:1})},xCe=_f,ACe=Ze,ICe=Ro,NCe=lh,OCe=Ree,Mee=E([].push),E0=function(r){var a=r==1,o=r==2,c=r==3,f=r==4,m=r==6,v=r==7,w=r==5||m;return function(C,R,x,L){for(var U,F,Z=ICe(C),W=ACe(Z),K=xCe(R,x),oe=NCe(W),ue=0,xe=L||OCe,Oe=a?xe(C,oe):o||v?xe(C,0):void 0;oe>ue;ue++)if((w||ue in W)&&(F=K(U=W[ue],ue,Z),r))if(a)Oe[ue]=F;else if(F)switch(r){case 3:return!0;case 5:return U;case 6:return ue;case 2:Mee(Oe,U)}else switch(r){case 4:return!1;case 7:Mee(Oe,U)}return m?-1:c||f?f:Oe}},jee={forEach:E0(0),map:E0(1),filter:E0(2),some:E0(3),every:E0(4),find:E0(5),findIndex:E0(6),filterReject:E0(7)},u8=Ni,Xz=N,Jz=me,PCe=E,IS=he,NS=nt,LCe=d,Za=fs,DCe=b,Qz=dr,h8=xt,Zz=ru,kCe=xl,eH=Xe,t3=s0,Uee=Ow,MCe=Nw,Fee=Oee,jCe=dy,Bee=_e,Vee=gc,UCe=Rx,zee=Ne,Hee=hh,FCe=Ty,tH=mf,Gee=Kp,Wee=zg,BCe=Qi,VCe=AS,zCe=Ws,HCe=kee,GCe=od,$ee=Tf,f8=jee.forEach,Cc=Aw("hidden"),p8="Symbol",n3="prototype",WCe=$ee.set,Kee=$ee.getterFor(p8),_h=Object[n3],jy=Xz.Symbol,m8=jy&&jy[n3],$Ce=Xz.TypeError,nH=Xz.QObject,qee=Bee.f,Uy=Vee.f,Yee=Fee.f,KCe=zee.f,Xee=PCe([].push),um=tH("symbols"),i3=tH("op-symbols"),qCe=tH("wks"),iH=!nH||!nH[n3]||!nH[n3].findChild,rH=IS&&LCe(function(){return t3(Uy({},"a",{get:function(){return Uy(this,"a",{value:7}).a}})).a!=7})?function(r,a,o){var c=qee(_h,a);c&&delete _h[a],Uy(r,a,o),c&&r!==_h&&Uy(_h,a,c)}:Uy,sH=function(r,a){var o=um[r]=t3(m8);return WCe(o,{type:p8,tag:r,description:a}),IS||(o.description=a),o},g8=function(r,a,o){r===_h&&g8(i3,a,o),Qz(r);var c=Zz(a);return Qz(o),Za(um,c)?(o.enumerable?(Za(r,Cc)&&r[Cc][c]&&(r[Cc][c]=!1),o=t3(o,{enumerable:eH(0,!1)})):(Za(r,Cc)||Uy(r,Cc,eH(1,{})),r[Cc][c]=!0),rH(r,c,o)):Uy(r,c,o)},aH=function(r,a){Qz(r);var o=h8(a),c=Uee(o).concat(ete(o));return f8(c,function(f){IS&&!Jz(Jee,o,f)||g8(r,f,o[f])}),r},Jee=function(r){var a=Zz(r),o=Jz(KCe,this,a);return!(this===_h&&Za(um,a)&&!Za(i3,a))&&(!(o||!Za(this,a)||!Za(um,a)||Za(this,Cc)&&this[Cc][a])||o)},Qee=function(r,a){var o=h8(r),c=Zz(a);if(o!==_h||!Za(um,c)||Za(i3,c)){var f=qee(o,c);return!f||!Za(um,c)||Za(o,Cc)&&o[Cc][c]||(f.enumerable=!0),f}},Zee=function(r){var a=Yee(h8(r)),o=[];return f8(a,function(c){Za(um,c)||Za(Gee,c)||Xee(o,c)}),o},ete=function(r){var a=r===_h,o=Yee(a?i3:h8(r)),c=[];return f8(o,function(f){!Za(um,f)||a&&!Za(_h,f)||Xee(c,um[f])}),c};NS||(jy=function(){if(DCe(m8,this))throw $Ce("Symbol is not a constructor");var r=arguments.length&&arguments[0]!==void 0?kCe(arguments[0]):void 0,a=Wee(r),o=function(c){this===_h&&Jz(o,i3,c),Za(this,Cc)&&Za(this[Cc],a)&&(this[Cc][a]=!1),rH(this,a,eH(1,c))};return IS&&iH&&rH(_h,a,{configurable:!0,set:o}),sH(a,r)},Hee(m8=jy[n3],"toString",function(){return Kee(this).tag}),Hee(jy,"withoutSetter",function(r){return sH(Wee(r),r)}),zee.f=Jee,Vee.f=g8,UCe.f=aH,Bee.f=Qee,MCe.f=Fee.f=Zee,jCe.f=ete,VCe.f=function(r){return sH(BCe(r),r)},IS&&FCe(m8,"description",{configurable:!0,get:function(){return Kee(this).description}})),u8({global:!0,constructor:!0,wrap:!0,forced:!NS,sham:!NS},{Symbol:jy}),f8(Uee(qCe),function(r){zCe(r)}),u8({target:p8,stat:!0,forced:!NS},{useSetter:function(){iH=!0},useSimple:function(){iH=!1}}),u8({target:"Object",stat:!0,forced:!NS,sham:!IS},{create:function(r,a){return a===void 0?t3(r):aH(t3(r),a)},defineProperty:g8,defineProperties:aH,getOwnPropertyDescriptor:Qee}),u8({target:"Object",stat:!0,forced:!NS},{getOwnPropertyNames:Zee}),HCe(),GCe(jy,p8),Gee[Cc]=!0;var tte=nt&&!!Symbol.for&&!!Symbol.keyFor,YCe=Ni,XCe=tn,JCe=fs,QCe=xl,nte=mf,ZCe=tte,oH=nte("string-to-symbol-registry"),eTe=nte("symbol-to-string-registry");YCe({target:"Symbol",stat:!0,forced:!ZCe},{for:function(r){var a=QCe(r);if(JCe(oH,a))return oH[a];var o=XCe("Symbol")(a);return oH[a]=o,eTe[o]=a,o}});var tTe=Ni,nTe=fs,iTe=en,rTe=Jt,sTe=tte,ite=mf("symbol-to-string-registry");tTe({target:"Symbol",stat:!0,forced:!sTe},{keyFor:function(r){if(!iTe(r))throw TypeError(rTe(r)+" is not a symbol");if(nTe(ite,r))return ite[r]}});var rte=e3,aTe=ie,ste=Q,oTe=xl,ate=E([].push),lTe=Ni,ote=tn,lte=M,cTe=me,r3=E,cte=d,dte=ie,ute=en,hte=tA,dTe=function(r){if(aTe(r))return r;if(rte(r)){for(var a=r.length,o=[],c=0;c<a;c++){var f=r[c];typeof f=="string"?ate(o,f):typeof f!="number"&&ste(f)!="Number"&&ste(f)!="String"||ate(o,oTe(f))}var m=o.length,v=!0;return function(w,C){if(v)return v=!1,C;if(rte(this))return C;for(var R=0;R<m;R++)if(o[R]===w)return C}}},uTe=nt,hTe=String,w0=ote("JSON","stringify"),v8=r3(/./.exec),fte=r3("".charAt),fTe=r3("".charCodeAt),pTe=r3("".replace),mTe=r3(1 .toString),gTe=/[\uD800-\uDFFF]/g,pte=/^[\uD800-\uDBFF]$/,mte=/^[\uDC00-\uDFFF]$/,gte=!uTe||cte(function(){var r=ote("Symbol")();return w0([r])!="[null]"||w0({a:r})!="{}"||w0(Object(r))!="{}"}),vte=cte(function(){return w0("\uDF06\uD834")!=='"\\udf06\\ud834"'||w0("\uDEAD")!=='"\\udead"'}),vTe=function(r,a){var o=hte(arguments),c=dTe(a);if(dte(c)||r!==void 0&&!ute(r))return o[1]=function(f,m){if(dte(c)&&(m=cTe(c,this,hTe(f),m)),!ute(m))return m},lte(w0,null,o)},yTe=function(r,a,o){var c=fte(o,a-1),f=fte(o,a+1);return v8(pte,r)&&!v8(mte,f)||v8(mte,r)&&!v8(pte,c)?"\\u"+mTe(fTe(r,0),16):r};w0&&lTe({target:"JSON",stat:!0,arity:3,forced:gte||vte},{stringify:function(r,a,o){var c=hte(arguments),f=lte(gte?vTe:w0,null,c);return vte&&typeof f=="string"?pTe(f,gTe,yTe):f}});var yte=dy,_Te=Ro;Ni({target:"Object",stat:!0,forced:!nt||d(function(){yte.f(1)})},{getOwnPropertySymbols:function(r){var a=yte.f;return a?a(_Te(r)):[]}}),Ws("asyncIterator"),Ws("hasInstance"),Ws("isConcatSpreadable"),Ws("iterator"),Ws("match"),Ws("matchAll"),Ws("replace"),Ws("search"),Ws("species"),Ws("split");var ETe=kee;Ws("toPrimitive"),ETe();var wTe=tn,STe=od;Ws("toStringTag"),STe(wTe("Symbol"),"Symbol"),Ws("unscopables"),od(N.JSON,"JSON",!0);var bTe=Me.Symbol,CTe=Qi,TTe=gc.f,_te=CTe("metadata"),Ete=Function.prototype;Ete[_te]===void 0&&TTe(Ete,_te,{value:null}),Ws("dispose"),Ws("metadata");var RTe=bTe;Ws("asyncDispose");var xTe=E,lH=tn("Symbol"),ATe=lH.keyFor,ITe=xTe(lH.prototype.valueOf),wte=lH.isRegisteredSymbol||function(r){try{return ATe(ITe(r))!==void 0}catch{return!1}};Ni({target:"Symbol",stat:!0},{isRegisteredSymbol:wte});for(var NTe=mf,Ste=tn,OTe=E,PTe=en,LTe=Qi,y8=Ste("Symbol"),bte=y8.isWellKnownSymbol,Cte=Ste("Object","getOwnPropertyNames"),DTe=OTe(y8.prototype.valueOf),Tte=NTe("wks"),cH=0,Rte=Cte(y8),kTe=Rte.length;cH<kTe;cH++)try{var xte=Rte[cH];PTe(y8[xte])&&LTe(xte)}catch{}var Ate=function(r){if(bte&&bte(r))return!0;try{for(var a=DTe(r),o=0,c=Cte(Tte),f=c.length;o<f;o++)if(Tte[c[o]]==a)return!0}catch{}return!1};Ni({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:Ate}),Ws("matcher"),Ws("observable"),Ni({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:wte}),Ni({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:Ate}),Ws("metadataKey"),Ws("patternMatch"),Ws("replaceAll");var OS=l(RTe),Ite=l(AS.f("iterator"));function s3(r){return s3=typeof OS=="function"&&typeof Ite=="symbol"?function(a){return typeof a}:function(a){return a&&typeof OS=="function"&&a.constructor===OS&&a!==OS.prototype?"symbol":typeof a},s3(r)}var MTe=l(AS.f("toPrimitive"));function jTe(r){var a=function(o,c){if(s3(o)!=="object"||o===null)return o;var f=o[MTe];if(f!==void 0){var m=f.call(o,c||"default");if(s3(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(o)}(r,"string");return s3(a)==="symbol"?a:String(a)}function X(r,a,o){return(a=jTe(a))in r?bee(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}var UTe=d,FTe=Qi("iterator"),dH=!UTe(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),a=r.searchParams,o=new URLSearchParams("a=1&a=2"),c="";return r.pathname="c%20d",a.forEach(function(f,m){a.delete("b"),c+=m+f}),o.delete("a",2),!r.toJSON||!o.has("a",1)||o.has("a",2)||!a.size&&!0||!a.sort||r.href!=="http://a/c%20d?a=1&c=3"||a.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!a[FTe]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||c!=="a1c3"||new URL("http://x",void 0).host!=="x"}),BTe=hh,uH=Ni,PS=N,_8=me,Of=E,LS=he,Nte=dH,Ote=hh,VTe=Ty,zTe=function(r,a,o){for(var c in a)o&&o.unsafe&&r[c]?r[c]=a[c]:BTe(r,c,a[c],o);return r},HTe=od,GTe=wy,hH=Tf,Pte=qx,fH=ie,WTe=fs,$Te=_f,KTe=ad,qTe=dr,Lte=it,kl=xl,YTe=s0,Dte=Xe,pH=em,XTe=_a,DS=sS,JTe=I,QTe=Qi("iterator"),a3="URLSearchParams",kte=a3+"Iterator",Mte=hH.set,hu=hH.getterFor(a3),ZTe=hH.getterFor(kte),eRe=Object.getOwnPropertyDescriptor,mH=function(r){if(!LS)return PS[r];var a=eRe(PS,r);return a&&a.value},jte=mH("fetch"),E8=mH("Request"),o3=mH("Headers"),gH=E8&&E8.prototype,Ute=o3&&o3.prototype,tRe=PS.RegExp,nRe=PS.TypeError,Fte=PS.decodeURIComponent,iRe=PS.encodeURIComponent,rRe=Of("".charAt),Bte=Of([].join),Fy=Of([].push),vH=Of("".replace),sRe=Of([].shift),Vte=Of([].splice),zte=Of("".split),aRe=Of("".slice),oRe=/\+/g,Hte=Array(4),lRe=function(r){return Hte[r-1]||(Hte[r-1]=tRe("((?:%[\\da-f]{2}){"+r+"})","gi"))},cRe=function(r){try{return Fte(r)}catch{return r}},Gte=function(r){var a=vH(r,oRe," "),o=4;try{return Fte(a)}catch{for(;o;)a=vH(a,lRe(o--),cRe);return a}},dRe=/[!'()~]|%20/g,uRe={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},hRe=function(r){return uRe[r]},Wte=function(r){return vH(iRe(r),dRe,hRe)},yH=GTe(function(r,a){Mte(this,{type:kte,iterator:pH(hu(r).entries),kind:a})},"Iterator",function(){var r=ZTe(this),a=r.kind,o=r.iterator.next(),c=o.value;return o.done||(o.value=a==="keys"?c.key:a==="values"?c.value:[c.key,c.value]),o},!0),$te=function(r){this.entries=[],this.url=null,r!==void 0&&(Lte(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?rRe(r,0)==="?"?aRe(r,1):r:kl(r)))};$te.prototype={type:a3,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var a,o,c,f,m,v,w,C=XTe(r);if(C)for(o=(a=pH(r,C)).next;!(c=_8(o,a)).done;){if(m=(f=pH(qTe(c.value))).next,(v=_8(m,f)).done||(w=_8(m,f)).done||!_8(m,f).done)throw nRe("Expected sequence with length 2");Fy(this.entries,{key:kl(v.value),value:kl(w.value)})}else for(var R in r)WTe(r,R)&&Fy(this.entries,{key:R,value:kl(r[R])})},parseQuery:function(r){if(r)for(var a,o,c=zte(r,"&"),f=0;f<c.length;)(a=c[f++]).length&&(o=zte(a,"="),Fy(this.entries,{key:Gte(sRe(o)),value:Gte(Bte(o,"="))}))},serialize:function(){for(var r,a=this.entries,o=[],c=0;c<a.length;)r=a[c++],Fy(o,Wte(r.key)+"="+Wte(r.value));return Bte(o,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var w8=function(){Pte(this,kS);var r=Mte(this,new $te(arguments.length>0?arguments[0]:void 0));LS||(this.size=r.entries.length)},kS=w8.prototype;if(zTe(kS,{append:function(r,a){var o=hu(this);DS(arguments.length,2),Fy(o.entries,{key:kl(r),value:kl(a)}),LS||this.length++,o.updateURL()},delete:function(r){for(var a=hu(this),o=DS(arguments.length,1),c=a.entries,f=kl(r),m=o<2?void 0:arguments[1],v=m===void 0?m:kl(m),w=0;w<c.length;){var C=c[w];if(C.key!==f||v!==void 0&&C.value!==v)w++;else if(Vte(c,w,1),v!==void 0)break}LS||(this.size=c.length),a.updateURL()},get:function(r){var a=hu(this).entries;DS(arguments.length,1);for(var o=kl(r),c=0;c<a.length;c++)if(a[c].key===o)return a[c].value;return null},getAll:function(r){var a=hu(this).entries;DS(arguments.length,1);for(var o=kl(r),c=[],f=0;f<a.length;f++)a[f].key===o&&Fy(c,a[f].value);return c},has:function(r){for(var a=hu(this).entries,o=DS(arguments.length,1),c=kl(r),f=o<2?void 0:arguments[1],m=f===void 0?f:kl(f),v=0;v<a.length;){var w=a[v++];if(w.key===c&&(m===void 0||w.value===m))return!0}return!1},set:function(r,a){var o=hu(this);DS(arguments.length,1);for(var c,f=o.entries,m=!1,v=kl(r),w=kl(a),C=0;C<f.length;C++)(c=f[C]).key===v&&(m?Vte(f,C--,1):(m=!0,c.value=w));m||Fy(f,{key:v,value:w}),LS||(this.size=f.length),o.updateURL()},sort:function(){var r=hu(this);JTe(r.entries,function(a,o){return a.key>o.key?1:-1}),r.updateURL()},forEach:function(r){for(var a,o=hu(this).entries,c=$Te(r,arguments.length>1?arguments[1]:void 0),f=0;f<o.length;)c((a=o[f++]).value,a.key,this)},keys:function(){return new yH(this,"keys")},values:function(){return new yH(this,"values")},entries:function(){return new yH(this,"entries")}},{enumerable:!0}),Ote(kS,QTe,kS.entries,{name:"entries"}),Ote(kS,"toString",function(){return hu(this).serialize()},{enumerable:!0}),LS&&VTe(kS,"size",{get:function(){return hu(this).entries.length},configurable:!0,enumerable:!0}),HTe(w8,a3),uH({global:!0,constructor:!0,forced:!Nte},{URLSearchParams:w8}),!Nte&&fH(o3)){var fRe=Of(Ute.has),pRe=Of(Ute.set),Kte=function(r){if(Lte(r)){var a,o=r.body;if(KTe(o)===a3)return a=r.headers?new o3(r.headers):new o3,fRe(a,"content-type")||pRe(a,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),YTe(r,{body:Dte(0,kl(o)),headers:Dte(0,a)})}return r};if(fH(jte)&&uH({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(r){return jte(r,arguments.length>1?Kte(arguments[1]):{})}}),fH(E8)){var _H=function(r){return Pte(this,gH),new E8(r,arguments.length>1?Kte(arguments[1]):{})};gH.constructor=_H,_H.prototype=gH,uH({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_H})}}var mRe={URLSearchParams:w8,getState:hu},qte=l(Me.URLSearchParams),gRe={isBrowser:!0,classes:{URLSearchParams:qte!==void 0?qte:Yz,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};let Yte=typeof window<"u"&&typeof document<"u",vRe=(Xte=typeof navigator<"u"&&navigator.product,Yte&&["ReactNative","NativeScript","NS"].indexOf(Xte)<0);var Xte;let yRe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";function Jte(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Qte(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Jte(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Jte(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}var Pf=Qte(Qte({},Object.freeze({__proto__:null,hasBrowserEnv:Yte,hasStandardBrowserEnv:vRe,hasStandardBrowserWebWorkerEnv:yRe})),gRe),_Re=dr,ERe=me,wRe=fs,SRe=b,bRe=function(){var r=_Re(this),a="";return r.hasIndices&&(a+="d"),r.global&&(a+="g"),r.ignoreCase&&(a+="i"),r.multiline&&(a+="m"),r.dotAll&&(a+="s"),r.unicode&&(a+="u"),r.unicodeSets&&(a+="v"),r.sticky&&(a+="y"),a},Zte=RegExp.prototype,ene=function(r){var a=r.flags;return a!==void 0||"flags"in Zte||wRe(r,"flags")||!SRe(Zte,r)?a:ERe(bRe,r)},CRe=NA.charAt,tne=me,TRe=dr,RRe=ie,xRe=Q,ARe=/./.exec,IRe=TypeError,NRe=Ni,nne=me,ine=ae,ORe=wy,S8=Cy,rne=Ht,sne=mw,l3=xl,PRe=dr,LRe=Je,DRe=Q,kRe=AP,ane=ene,MRe=bi,jRe=d,URe=eA,FRe=function(r,a,o){return a+(o?CRe(r,a).length:1)},BRe=function(r,a){var o=r.exec;if(RRe(o)){var c=tne(o,r,a);return c!==null&&TRe(c),c}if(xRe(r)==="RegExp")return tne(ARe,r,a);throw IRe("RegExp#exec called on incompatible receiver")},one=Tf,VRe=Qi("matchAll"),lne="RegExp String",cne=lne+" Iterator",zRe=one.set,HRe=one.getterFor(cne),GRe=TypeError,EH=ine("".indexOf),b8=ine("".matchAll),wH=!!b8&&!jRe(function(){b8("a",/./)}),WRe=ORe(function(r,a,o,c){zRe(this,{type:cne,regexp:r,string:a,global:o,unicode:c,done:!1})},lne,function(){var r=HRe(this);if(r.done)return S8(void 0,!0);var a=r.regexp,o=r.string,c=BRe(a,o);return c===null?(r.done=!0,S8(void 0,!0)):r.global?(l3(c[0])===""&&(a.lastIndex=FRe(o,sne(a.lastIndex),r.unicode)),S8(c,!1)):(r.done=!0,S8(c,!1))}),dne=function(r){var a,o,c,f=PRe(this),m=l3(r),v=URe(f,RegExp),w=l3(ane(f));return a=new v(v===RegExp?f.source:f,w),o=!!~EH(w,"g"),c=!!~EH(w,"u"),a.lastIndex=sne(f.lastIndex),new WRe(a,m,o,c)};NRe({target:"String",proto:!0,forced:wH},{matchAll:function(r){var a,o,c,f,m=rne(this);if(LRe(r)){if(wH)return b8(m,r)}else{if(kRe(r)&&(a=l3(rne(ane(r))),!~EH(a,"g")))throw GRe("`.matchAll` does not allow non-global regexes");if(wH)return b8(m,r);if((c=MRe(r,VRe))===void 0&&DRe(r)=="RegExp"&&(c=dne),c)return nne(c,r,m)}return o=l3(m),f=new RegExp(r,"g"),nne(dne,f,o)}});var $Re=vc("String").matchAll,KRe=b,qRe=$Re,SH=String.prototype,YRe=function(r){var a=r.matchAll;return typeof r=="string"||r===SH||KRe(SH,r)&&a===SH.matchAll?qRe:a},XRe=l(YRe);function une(r){function a(o,c,f,m){let v=o[m++];if(v==="__proto__")return!0;let w=Number.isFinite(+v),C=m>=o.length;return v=!v&&Bt.isArray(f)?f.length:v,C?(Bt.hasOwnProp(f,v)?f[v]=[f[v],c]:f[v]=c,!w):(f[v]&&Bt.isObject(f[v])||(f[v]=[]),a(o,c,f[v],m)&&Bt.isArray(f[v])&&(f[v]=function(R){let x={},L=Object.keys(R),U,F=L.length,Z;for(U=0;U<F;U++)Z=L[U],x[Z]=R[Z];return x}(f[v])),!w)}if(Bt.isFormData(r)&&Bt.isFunction(r.entries)){let o={};return Bt.forEachEntry(r,(c,f)=>{a(function(m){return XRe(Bt).call(Bt,/\w+|\[(\w*)]/g,m).map(v=>v[0]==="[]"?"":v[1]||v[0])}(c),f,o,0)}),o}return null}let bH={transitional:_ee,adapter:["xhr","http"],transformRequest:[function(r,a){let o=a.getContentType()||"",c=o.indexOf("application/json")>-1,f=Bt.isObject(r);if(f&&Bt.isHTMLForm(r)&&(r=new FormData(r)),Bt.isFormData(r))return c?JSON.stringify(une(r)):r;if(Bt.isArrayBuffer(r)||Bt.isBuffer(r)||Bt.isStream(r)||Bt.isFile(r)||Bt.isBlob(r))return r;if(Bt.isArrayBufferView(r))return r.buffer;if(Bt.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let m;if(f){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(v,w){return d8(v,new Pf.classes.URLSearchParams,Object.assign({visitor:function(C,R,x,L){return Pf.isNode&&Bt.isBuffer(C)?(this.append(R,C.toString("base64")),!1):L.defaultVisitor.apply(this,arguments)}},w))}(r,this.formSerializer).toString();if((m=Bt.isFileList(r))||o.indexOf("multipart/form-data")>-1){let v=this.env&&this.env.FormData;return d8(m?{"files[]":r}:r,v&&new v,this.formSerializer)}}return f||c?(a.setContentType("application/json",!1),function(v,w,C){if(Bt.isString(v))try{return(w||JSON.parse)(v),ks(Bt).call(Bt,v)}catch(R){if(R.name!=="SyntaxError")throw R}return(0,JSON.stringify)(v)}(r)):r}],transformResponse:[function(r){let a=this.transitional||bH.transitional,o=a&&a.forcedJSONParsing,c=this.responseType==="json";if(r&&Bt.isString(r)&&(o&&!this.responseType||c)){let f=!(a&&a.silentJSONParsing)&&c;try{return JSON.parse(r)}catch(m){if(f)throw m.name==="SyntaxError"?hr.from(m,hr.ERR_BAD_RESPONSE,this,null,this.response):m}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pf.classes.FormData,Blob:Pf.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Bt.forEach(["delete","get","head","post","put","patch"],r=>{bH.headers[r]={}});var CH=bH;let JRe=Bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hne=Symbol("internals");function c3(r){var a;return r&&ks(a=String(r)).call(a).toLowerCase()}function C8(r){return r===!1||r==null?r:Bt.isArray(r)?r.map(C8):String(r)}function TH(r,a,o,c,f){return Bt.isFunction(c)?c.call(this,a,o):(f&&(a=o),Bt.isString(a)?Bt.isString(c)?a.indexOf(c)!==-1:Bt.isRegExp(c)?c.test(a):void 0:void 0)}class T8{constructor(a){a&&this.set(a)}set(a,o,c){let f=this;function m(C,R,x){let L=c3(R);if(!L)throw new Error("header name must be a non-empty string");let U=Bt.findKey(f,L);(!U||f[U]===void 0||x===!0||x===void 0&&f[U]!==!1)&&(f[U||R]=C8(C))}let v=(C,R)=>Bt.forEach(C,(x,L)=>m(x,L,R));var w;return Bt.isPlainObject(a)||a instanceof this.constructor?v(a,o):Bt.isString(a)&&(a=ks(a).call(a))&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(ks(w=a).call(w))?v((C=>{let R={},x,L,U;return C&&C.split(`
`).forEach(function(F){var Z,W;U=F.indexOf(":"),x=ks(Z=F.substring(0,U)).call(Z).toLowerCase(),L=ks(W=F.substring(U+1)).call(W),!x||R[x]&&JRe[x]||(x==="set-cookie"?R[x]?R[x].push(L):R[x]=[L]:R[x]=R[x]?R[x]+", "+L:L)}),R})(a),o):a!=null&&m(o,a,c),this}get(a,o){if(a=c3(a)){let c=Bt.findKey(this,a);if(c){let f=this[c];if(!o)return f;if(o===!0)return function(m){let v=Object.create(null),w=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,C;for(;C=w.exec(m);)v[C[1]]=C[2];return v}(f);if(Bt.isFunction(o))return o.call(this,f,c);if(Bt.isRegExp(o))return o.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,o){if(a=c3(a)){let c=Bt.findKey(this,a);return!(!c||this[c]===void 0||o&&!TH(0,this[c],c,o))}return!1}delete(a,o){let c=this,f=!1;function m(v){if(v=c3(v)){let w=Bt.findKey(c,v);!w||o&&!TH(0,c[w],w,o)||(delete c[w],f=!0)}}return Bt.isArray(a)?a.forEach(m):m(a),f}clear(a){let o=Object.keys(this),c=o.length,f=!1;for(;c--;){let m=o[c];a&&!TH(0,this[m],m,a,!0)||(delete this[m],f=!0)}return f}normalize(a){let o=this,c={};return Bt.forEach(this,(f,m)=>{var v;let w=Bt.findKey(c,m);if(w)return o[w]=C8(f),void delete o[m];let C=a?function(R){return ks(R).call(R).toLowerCase().replace(/([a-z\d])(\w*)/g,(x,L,U)=>L.toUpperCase()+U)}(m):ks(v=String(m)).call(v);C!==m&&delete o[m],o[C]=C8(f),c[C]=!0}),this}concat(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return this.constructor.concat(this,...o)}toJSON(a){let o=Object.create(null);return Bt.forEach(this,(c,f)=>{c!=null&&c!==!1&&(o[f]=a&&Bt.isArray(c)?c.join(", "):c)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(a=>{let[o,c]=a;return o+": "+c}).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a){let o=new this(a);for(var c=arguments.length,f=new Array(c>1?c-1:0),m=1;m<c;m++)f[m-1]=arguments[m];return f.forEach(v=>o.set(v)),o}static accessor(a){let o=(this[hne]=this[hne]={accessors:{}}).accessors,c=this.prototype;function f(m){let v=c3(m);o[v]||(function(w,C){let R=Bt.toCamelCase(" "+C);["get","set","has"].forEach(x=>{Object.defineProperty(w,x+R,{value:function(L,U,F){return this[x].call(this,C,L,U,F)},configurable:!0})})}(c,m),o[v]=!0)}return Bt.isArray(a)?a.forEach(f):f(a),this}}T8.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Bt.reduceDescriptors(T8.prototype,(r,a)=>{let{value:o}=r,c=a[0].toUpperCase()+a.slice(1);return{get:()=>o,set(f){this[c]=f}}}),Bt.freezeMethods(T8);var hm=T8;function RH(r,a){let o=this||CH,c=a||o,f=hm.from(c.headers),m=c.data;return Bt.forEach(r,function(v){m=v.call(o,m,f.normalize(),a?a.status:void 0)}),f.normalize(),m}function fne(r){return!(!r||!r.__CANCEL__)}function d3(r,a,o){hr.call(this,r??"canceled",hr.ERR_CANCELED,a,o),this.name="CanceledError"}Bt.inherits(d3,hr,{__CANCEL__:!0});var QRe=Pf.hasStandardBrowserEnv?{write(r,a,o,c,f,m){let v=[r+"="+encodeURIComponent(a)];Bt.isNumber(o)&&v.push("expires="+new Date(o).toGMTString()),Bt.isString(c)&&v.push("path="+c),Bt.isString(f)&&v.push("domain="+f),m===!0&&v.push("secure"),document.cookie=v.join("; ")},read(r){let a=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function pne(r,a){return r&&!function(o){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}(a)?function(o,c){return c?o.replace(/\/?\/$/,"")+"/"+c.replace(/^\/+/,""):o}(r,a):a}var ZRe=Pf.hasStandardBrowserEnv?function(){let r=/(msie|trident)/i.test(navigator.userAgent),a=document.createElement("a"),o;function c(f){let m=f;return r&&(a.setAttribute("href",m),m=a.href),a.setAttribute("href",m),{href:a.href,protocol:a.protocol?a.protocol.replace(/:$/,""):"",host:a.host,search:a.search?a.search.replace(/^\?/,""):"",hash:a.hash?a.hash.replace(/^#/,""):"",hostname:a.hostname,port:a.port,pathname:a.pathname.charAt(0)==="/"?a.pathname:"/"+a.pathname}}return o=c(window.location.href),function(f){let m=Bt.isString(f)?c(f):f;return m.protocol===o.protocol&&m.host===o.host}}():function(){return!0};function mne(r,a){let o=0,c=function(f,m){f=f||10;let v=new Array(f),w=new Array(f),C,R=0,x=0;return m=m!==void 0?m:1e3,function(L){let U=Date.now(),F=w[x];C||(C=U),v[R]=L,w[R]=U;let Z=x,W=0;for(;Z!==R;)W+=v[Z++],Z%=f;if(R=(R+1)%f,R===x&&(x=(x+1)%f),U-C<m)return;let K=F&&U-F;return K?Math.round(1e3*W/K):void 0}}(50,250);return f=>{let m=f.loaded,v=f.lengthComputable?f.total:void 0,w=m-o,C=c(w);o=m;let R={loaded:m,total:v,progress:v?m/v:void 0,bytes:w,rate:C||void 0,estimated:C&&v&&m<=v?(v-m)/C:void 0,event:f};R[a?"download":"upload"]=!0,r(R)}}var exe=typeof XMLHttpRequest<"u"&&function(r){return new Ct(function(a,o){let c=r.data,f=hm.from(r.headers).normalize(),m,v,{responseType:w,withXSRFToken:C}=r;function R(){r.cancelToken&&r.cancelToken.unsubscribe(m),r.signal&&r.signal.removeEventListener("abort",m)}if(Bt.isFormData(c)){if(Pf.hasStandardBrowserEnv||Pf.hasStandardBrowserWebWorkerEnv)f.setContentType(!1);else if((v=f.getContentType())!==!1){let[Z,...W]=v?v.split(";").map(K=>ks(K).call(K)).filter(Boolean):[];f.setContentType([Z||"multipart/form-data",...W].join("; "))}}let x=new XMLHttpRequest;if(r.auth){let Z=r.auth.username||"",W=r.auth.password?unescape(encodeURIComponent(r.auth.password)):"";f.set("Authorization","Basic "+btoa(Z+":"+W))}let L=pne(r.baseURL,r.url);function U(){if(!x)return;let Z=hm.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders());(function(W,K,oe){let ue=oe.config.validateStatus;oe.status&&ue&&!ue(oe.status)?K(new hr("Request failed with status code "+oe.status,[hr.ERR_BAD_REQUEST,hr.ERR_BAD_RESPONSE][Math.floor(oe.status/100)-4],oe.config,oe.request,oe)):W(oe)})(function(W){a(W),R()},function(W){o(W),R()},{data:w&&w!=="text"&&w!=="json"?x.response:x.responseText,status:x.status,statusText:x.statusText,headers:Z,config:r,request:x}),x=null}if(x.open(r.method.toUpperCase(),vee(L,r.params,r.paramsSerializer),!0),x.timeout=r.timeout,"onloadend"in x?x.onloadend=U:x.onreadystatechange=function(){x&&x.readyState===4&&(x.status!==0||x.responseURL&&x.responseURL.indexOf("file:")===0)&&setTimeout(U)},x.onabort=function(){x&&(o(new hr("Request aborted",hr.ECONNABORTED,r,x)),x=null)},x.onerror=function(){o(new hr("Network Error",hr.ERR_NETWORK,r,x)),x=null},x.ontimeout=function(){let Z=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",W=r.transitional||_ee;r.timeoutErrorMessage&&(Z=r.timeoutErrorMessage),o(new hr(Z,W.clarifyTimeoutError?hr.ETIMEDOUT:hr.ECONNABORTED,r,x)),x=null},Pf.hasStandardBrowserEnv&&(C&&Bt.isFunction(C)&&(C=C(r)),C||C!==!1&&ZRe(L))){let Z=r.xsrfHeaderName&&r.xsrfCookieName&&QRe.read(r.xsrfCookieName);Z&&f.set(r.xsrfHeaderName,Z)}c===void 0&&f.setContentType(null),"setRequestHeader"in x&&Bt.forEach(f.toJSON(),function(Z,W){x.setRequestHeader(W,Z)}),Bt.isUndefined(r.withCredentials)||(x.withCredentials=!!r.withCredentials),w&&w!=="json"&&(x.responseType=r.responseType),typeof r.onDownloadProgress=="function"&&x.addEventListener("progress",mne(r.onDownloadProgress,!0)),typeof r.onUploadProgress=="function"&&x.upload&&x.upload.addEventListener("progress",mne(r.onUploadProgress)),(r.cancelToken||r.signal)&&(m=Z=>{x&&(o(!Z||Z.type?new d3(null,r,x):Z),x.abort(),x=null)},r.cancelToken&&r.cancelToken.subscribe(m),r.signal&&(r.signal.aborted?m():r.signal.addEventListener("abort",m)));let F=function(Z){let W=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Z);return W&&W[1]||""}(L);F&&Pf.protocols.indexOf(F)===-1?o(new hr("Unsupported protocol "+F+":",hr.ERR_BAD_REQUEST,r)):x.send(c||null)})};let xH={http:null,xhr:exe};Bt.forEach(xH,(r,a)=>{if(r){try{Object.defineProperty(r,"name",{value:a})}catch{}Object.defineProperty(r,"adapterName",{value:a})}});let gne=r=>"- ".concat(r),txe=r=>Bt.isFunction(r)||r===null||r===!1;var vne={getAdapter:r=>{r=Bt.isArray(r)?r:[r];let{length:a}=r,o,c,f={};for(let m=0;m<a;m++){let v;if(o=r[m],c=o,!txe(o)&&(c=xH[(v=String(o)).toLowerCase()],c===void 0))throw new hr("Unknown adapter '".concat(v,"'"));if(c)break;f[v||"#"+m]=c}if(!c){let m=Object.entries(f).map(v=>{let[w,C]=v;return"adapter ".concat(w," ")+(C===!1?"is not supported by the environment":"is not available in the build")});throw new hr("There is no suitable adapter to dispatch the request "+(a?m.length>1?`since :
`+m.map(gne).join(`
`):" "+gne(m[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return c},adapters:xH};function AH(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new d3(null,r)}function yne(r){return AH(r),r.headers=hm.from(r.headers),r.data=RH.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),vne.getAdapter(r.adapter||CH.adapter)(r).then(function(a){return AH(r),a.data=RH.call(r,r.transformResponse,a),a.headers=hm.from(a.headers),a},function(a){return fne(a)||(AH(r),a&&a.response&&(a.response.data=RH.call(r,r.transformResponse,a.response),a.response.headers=hm.from(a.response.headers))),Ct.reject(a)})}function _ne(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}let Ene=r=>r instanceof hm?function(a){for(var o=1;o<arguments.length;o++){var c=arguments[o]!=null?arguments[o]:{};o%2?_ne(Object(c),!0).forEach(function(f){X(a,f,c[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):_ne(Object(c)).forEach(function(f){Object.defineProperty(a,f,Object.getOwnPropertyDescriptor(c,f))})}return a}({},r):r;function MS(r,a){a=a||{};let o={};function c(R,x,L){return Bt.isPlainObject(R)&&Bt.isPlainObject(x)?Bt.merge.call({caseless:L},R,x):Bt.isPlainObject(x)?Bt.merge({},x):Bt.isArray(x)?x.slice():x}function f(R,x,L){return Bt.isUndefined(x)?Bt.isUndefined(R)?void 0:c(void 0,R,L):c(R,x,L)}function m(R,x){if(!Bt.isUndefined(x))return c(void 0,x)}function v(R,x){return Bt.isUndefined(x)?Bt.isUndefined(R)?void 0:c(void 0,R):c(void 0,x)}function w(R,x,L){return L in a?c(R,x):L in r?c(void 0,R):void 0}let C={url:m,method:m,data:m,baseURL:v,transformRequest:v,transformResponse:v,paramsSerializer:v,timeout:v,timeoutMessage:v,withCredentials:v,withXSRFToken:v,adapter:v,responseType:v,xsrfCookieName:v,xsrfHeaderName:v,onUploadProgress:v,onDownloadProgress:v,decompress:v,maxContentLength:v,maxBodyLength:v,beforeRedirect:v,transport:v,httpAgent:v,httpsAgent:v,cancelToken:v,socketPath:v,responseEncoding:v,validateStatus:w,headers:(R,x)=>f(Ene(R),Ene(x),!0)};return Bt.forEach(Object.keys(Object.assign({},r,a)),function(R){let x=C[R]||f,L=x(r[R],a[R],R);Bt.isUndefined(L)&&x!==w||(o[R]=L)}),o}let wne="1.6.8",IH={};["object","boolean","number","function","string","symbol"].forEach((r,a)=>{IH[r]=function(o){return typeof o===r||"a"+(a<1?"n ":" ")+r}});let Sne={};IH.transitional=function(r,a,o){function c(f,m){return"[Axios v"+wne+"] Transitional option '"+f+"'"+m+(o?". "+o:"")}return(f,m,v)=>{if(r===!1)throw new hr(c(m," has been removed"+(a?" in "+a:"")),hr.ERR_DEPRECATED);return a&&!Sne[m]&&(Sne[m]=!0,console.warn(c(m," has been deprecated since v"+a+" and will be removed in the near future"))),!r||r(f,m,v)}};var NH={assertOptions:function(r,a,o){if(typeof r!="object")throw new hr("options must be an object",hr.ERR_BAD_OPTION_VALUE);let c=Object.keys(r),f=c.length;for(;f-- >0;){let m=c[f],v=a[m];if(v){let w=r[m],C=w===void 0||v(w,m,r);if(C!==!0)throw new hr("option "+m+" must be "+C,hr.ERR_BAD_OPTION_VALUE)}else if(o!==!0)throw new hr("Unknown option "+m,hr.ERR_BAD_OPTION)}},validators:IH};let S0=NH.validators,R8=class{constructor(r){this.defaults=r,this.interceptors={request:new yee,response:new yee}}async request(r,a){try{return await this._request(r,a)}catch(o){if(o instanceof Error){let c;Error.captureStackTrace?Error.captureStackTrace(c={}):c=new Error;let f=c.stack?c.stack.replace(/^.+\n/,""):"";o.stack?f&&!String(o.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(o.stack+=`
`+f):o.stack=f}throw o}}_request(r,a){typeof r=="string"?(a=a||{}).url=r:a=r||{},a=MS(this.defaults,a);let{transitional:o,paramsSerializer:c,headers:f}=a;o!==void 0&&NH.assertOptions(o,{silentJSONParsing:S0.transitional(S0.boolean),forcedJSONParsing:S0.transitional(S0.boolean),clarifyTimeoutError:S0.transitional(S0.boolean)},!1),c!=null&&(Bt.isFunction(c)?a.paramsSerializer={serialize:c}:NH.assertOptions(c,{encode:S0.function,serialize:S0.function},!0)),a.method=(a.method||this.defaults.method||"get").toLowerCase();let m=f&&Bt.merge(f.common,f[a.method]);f&&Bt.forEach(["delete","get","head","post","put","patch","common"],F=>{delete f[F]}),a.headers=hm.concat(m,f);let v=[],w=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(a)===!1||(w=w&&F.synchronous,v.unshift(F.fulfilled,F.rejected))});let C=[],R;this.interceptors.response.forEach(function(F){C.push(F.fulfilled,F.rejected)});let x,L=0;if(!w){let F=[yne.bind(this),void 0];for(F.unshift.apply(F,v),F.push.apply(F,C),x=F.length,R=Ct.resolve(a);L<x;)R=R.then(F[L++],F[L++]);return R}x=v.length;let U=a;for(L=0;L<x;){let F=v[L++],Z=v[L++];try{U=F(U)}catch(W){Z.call(this,W);break}}try{R=yne.call(this,U)}catch(F){return Ct.reject(F)}for(L=0,x=C.length;L<x;)R=R.then(C[L++],C[L++]);return R}getUri(r){return vee(pne((r=MS(this.defaults,r)).baseURL,r.url),r.params,r.paramsSerializer)}};Bt.forEach(["delete","get","head","options"],function(r){R8.prototype[r]=function(a,o){return this.request(MS(o||{},{method:r,url:a,data:(o||{}).data}))}}),Bt.forEach(["post","put","patch"],function(r){function a(o){return function(c,f,m){return this.request(MS(m||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:c,data:f}))}}R8.prototype[r]=a(),R8.prototype[r+"Form"]=a(!0)});var x8=R8;class OH{constructor(a){if(typeof a!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Ct(function(f){o=f});let c=this;this.promise.then(f=>{if(!c._listeners)return;let m=c._listeners.length;for(;m-- >0;)c._listeners[m](f);c._listeners=null}),this.promise.then=f=>{let m,v=new Ct(w=>{c.subscribe(w),m=w}).then(f);return v.cancel=function(){c.unsubscribe(m)},v},a(function(f,m,v){c.reason||(c.reason=new d3(f,m,v),o(c.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(a){this.reason?a(this.reason):this._listeners?this._listeners.push(a):this._listeners=[a]}unsubscribe(a){if(!this._listeners)return;let o=this._listeners.indexOf(a);o!==-1&&this._listeners.splice(o,1)}static source(){let a;return{token:new OH(function(o){a=o}),cancel:a}}}var nxe=OH;let PH={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(PH).forEach(r=>{let[a,o]=r;PH[o]=a});var ixe=PH;let wa=function r(a){let o=new x8(a),c=tee(x8.prototype.request,o);return Bt.extend(c,x8.prototype,o,{allOwnKeys:!0}),Bt.extend(c,o,null,{allOwnKeys:!0}),c.create=function(f){return r(MS(a,f))},c}(CH);wa.Axios=x8,wa.CanceledError=d3,wa.CancelToken=nxe,wa.isCancel=fne,wa.VERSION=wne,wa.toFormData=d8,wa.AxiosError=hr,wa.Cancel=wa.CanceledError,wa.all=function(r){return Ct.all(r)},wa.spread=function(r){return function(a){return r.apply(null,a)}},wa.isAxiosError=function(r){return Bt.isObject(r)&&r.isAxiosError===!0},wa.mergeConfig=MS,wa.AxiosHeaders=hm,wa.formToJSON=r=>une(Bt.isHTMLForm(r)?new FormData(r):r),wa.getAdapter=vne.getAdapter,wa.HttpStatusCode=ixe,wa.default=wa;var Io=wa;let rxe=()=>{};function u3(){let r={promise:void 0,isResolved:!1,isRejected:!1,isFinished:!1,resolve:void 0,reject:void 0,cancel:rxe};return r.promise=new Ct((a,o)=>{r.resolve=c=>{r.isFinished||(r.isResolved=!0,r.isFinished=!0,a(c),r.value=c)},r.reject=c=>{r.isFinished||(r.isRejected=!0,r.isFinished=!0,o(c))}}),r}let A8=new Map,I8=new Map,Lf=new Map,ms=function(r){return r.WIN_10="Windows 10",r.WIN_81="Windows 8.1",r.WIN_8="Windows 8",r.WIN_7="Windows 7",r.WIN_VISTA="Windows Vista",r.WIN_SERVER_2003="Windows Server 2003",r.WIN_XP="Windows XP",r.WIN_2000="Windows 2000",r.ANDROID="Android",r.HARMONY_OS="HarmonyOS",r.OPEN_BSD="Open BSD",r.SUN_OS="Sun OS",r.LINUX="Linux",r.IOS="iOS",r.MAC_OS="Mac OS",r.CHROMIUM_OS="Chromium OS",r.QNX="QNX",r.UNIX="UNIX",r.BEOS="BeOS",r.OS_2="OS/2",r.SEARCH_BOT="Search Bot",r}({}),fi=function(r){return r.CHROME="Chrome",r.SAFARI="Safari",r.EDGE="Edge",r.FIREFOX="Firefox",r.OPERA="OPR",r.QQ="QQBrowser",r.WECHAT="MicroMessenger",r}({}),bne=new Tbe,Eh=bne.getResult(),LH=null;function ni(r){if(!LH){Eh=bne.getResult();let a=function(w){if(w.engine.name==="Blink"&&w.browser.name!=="WeChat")return fi.CHROME;switch(w.browser.name){case"Chrome Headless":case"Chrome":case"Chromium":return fi.CHROME;case"Safari":case"Mobile Safari":return fi.SAFARI;case"Edge":return fi.EDGE;case"Firefox":return fi.FIREFOX;case"QQ":case"QQBrowser":return fi.QQ;case"Opera":return fi.OPERA;case"WeChat":return fi.WECHAT;default:return w.browser.name||""}}(Eh),o=Cne(Eh),c=function(w){return w.os.name==="Windows"?w.os.version?w.os.name+" "+w.os.version:w.os.name:w.os.name||""}(Eh),f=Eh.os.version,m=Cne(Eh,!1),v=Eh.device.type;if(!(a&&o&&c&&f))return{name:a,version:o,os:c,osVersion:f,browserVersion:m,deviceType:v};LH={name:a,version:o,os:c,osVersion:f,browserVersion:m,deviceType:v}}return LH}function Cne(r){let a,o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return a=r.engine.name==="Blink"?r.engine.version||"":r.browser.version||"",o?a.split(".")[0]:a}function N8(){return ni().os}function Tne(){let r=ni();return"".concat(r.os," ").concat(r.osVersion)}function O8(){let r=ni();return!!(Eh.engine.name==="WebKit"&&r.os===ms.MAC_OS&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0&&r.name!==fi.SAFARI||ra()&&r.name!==fi.SAFARI)}function b0(){return ni().name===fi.CHROME}function gs(){return ni().name===fi.SAFARI}function Rne(){return ni().name===fi.EDGE}function Pi(){return ni().name===fi.FIREFOX}function ra(){return ni().os===ms.IOS}function DH(r){let a=ni();return!(a.name!==fi.CHROME||!a.osVersion)&&Number(a.version)>=r}function xne(r){let a=ni();return!(a.name!==fi.EDGE||!a.osVersion)&&Number(a.version)>=r}function Ane(r){let a=ni();return!(a.name!==fi.SAFARI||!a.osVersion)&&Number(a.version)>=r}function Ine(r,a,o){let c=ni();if(c.os!==ms.IOS||!c.osVersion)return!1;let f=c.osVersion.split(".");return a&&Number(f[0])===r&&Number(f[1])<a||Number(f[0])<r}function Nne(r,a,o){let c=ni();if(c.name!==fi.SAFARI||!c.osVersion||!c.browserVersion)return!1;let f=c.browserVersion.split(".");return a&&Number(f[0])===r&&Number(f[1])<a||Number(f[0])<r}function One(r){let a=ni();return!(a.name!==fi.OPERA||!a.osVersion)&&Number(a.version)>=r}function Pne(){let r=ni();return!(r.name!==fi.CHROME||!r.osVersion)&&Number(r.version)<=90}function Lne(){let r=ni();if(r.os!==ms.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])<14||Number(a[0])===14&&Number(a[1])<=6}function jS(){let r=ni();if(r.os!==ms.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===15}function kH(){let r=ni();if(r.os!==ms.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===16}function Dne(){let r=ni();if(r.os!==ms.IOS||!r.osVersion)return!1;let a=r.osVersion.split(".");return Number(a[0])===15&&Number(a[1])>=1}function fu(){return gs()&&navigator.maxTouchPoints>0}function kne(){return ni().name===fi.WECHAT}function Mne(){return window.navigator.appVersion&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)!==null&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)[1]<=35}function MH(){let r=N8();return function(){let{deviceType:a}=ni();return a==="mobile"||a==="tablet"}()||r===ms.ANDROID||r===ms.IOS||r===ms.HARMONY_OS}function C0(){let r=ni();return r.name!==fi.EDGE&&r.name!==fi.SAFARI&&!!navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]./i)}function P8(){return N8()===ms.ANDROID}function h3(){let r=ni();return P8()&&(r.name===fi.CHROME||r.name===fi.WECHAT||/chrome|chromium/i.test(navigator.userAgent))}function jne(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Kt(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?jne(Object(o),!0).forEach(function(c){Zi(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):jne(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Zi(r,a,o){return(a=function(c){var f=function(m,v){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var C=w.call(m,"string");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}let ce=function(r){return r.UNEXPECTED_ERROR="UNEXPECTED_ERROR",r.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",r.TIMEOUT="TIMEOUT",r.INVALID_PARAMS="INVALID_PARAMS",r.NOT_READABLE="NOT_READABLE",r.NOT_SUPPORTED="NOT_SUPPORTED",r.INVALID_OPERATION="INVALID_OPERATION",r.OPERATION_ABORTED="OPERATION_ABORTED",r.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",r.EXCHANGE_SDP_FAILED="EXCHANGE_SDP_FAILED",r.ADD_CANDIDATE_FAILED="ADD_CANDIDATE_FAILED",r.DATACHANNEL_FAILED="DATACHANNEL_FAILED",r.NETWORK_ERROR="NETWORK_ERROR",r.NETWORK_TIMEOUT="NETWORK_TIMEOUT",r.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",r.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",r.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",r.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",r.ELECTRON_IS_NULL="ELECTRON_IS_NULL",r.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",r.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",r.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",r.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",r.PERMISSION_DENIED="PERMISSION_DENIED",r.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",r.TRACK_IS_DISABLED="TRACK_IS_DISABLED",r.GET_VIDEO_ELEMENT_VISIBLE_ERROR="GET_VIDEO_ELEMENT_VISIBLE_ERROR",r.SHARE_AUDIO_NOT_ALLOWED="SHARE_AUDIO_NOT_ALLOWED",r.LOW_STREAM_ENCODING_ERROR="LOW_STREAM_ENCODING_ERROR",r.SET_ENCODING_PARAMETER_ERROR="SET_ENCODING_PARAMETER_ERROR",r.TRACK_STATE_UNREACHABLE="TRACK_STATE_UNREACHABLE",r.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",r.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",r.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",r.VOID_GATEWAY_ADDRESS="VOID_GATEWAY_ADDRESS",r.UID_CONFLICT="UID_CONFLICT",r.MULTI_UNILBS_RESPONSE_ERROR="MULTI_UNILBS_RESPONSE_ERROR",r.UPDATE_TICKET_FAILED="UPDATE_TICKET_FAILED",r.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",r.INVALID_TRACK="INVALID_TRACK",r.SENDER_NOT_FOUND="SENDER_NOT_FOUND",r.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",r.SET_ANSWER_FAILED="SET_ANSWER_FAILED",r.ICE_FAILED="ICE_FAILED",r.PC_CLOSED="PC_CLOSED",r.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",r.GET_LOCAL_CAPABILITIES_FAILED="GET_LOCAL_CAPABILITIES_FAILED",r.GET_LOCAL_CONNECTION_PARAMS_FAILED="GET_LOCAL_CONNECTION_PARAMS_FAILED",r.SUBSCRIBE_FAILED="SUBSCRIBE_FAILED",r.UNSUBSCRIBE_FAILED="UNSUBSCRIBE_FAILED",r.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",r.NO_ICE_CANDIDATE="NO_ICE_CANDIDATE",r.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",r.EXIST_DISABLED_VIDEO_TRACK="EXIST_DISABLED_VIDEO_TRACK",r.INVALID_REMOTE_USER="INVALID_REMOTE_USER",r.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED",r.CUSTOM_REPORT_SEND_FAILED="CUSTOM_REPORT_SEND_FAILED",r.CUSTOM_REPORT_FREQUENCY_TOO_HIGH="CUSTOM_REPORT_FREQUENCY_TOO_HIGH",r.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",r.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",r.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",r.WS_ABORT="WS_ABORT",r.WS_DISCONNECT="WS_DISCONNECT",r.WS_ERR="WS_ERR",r.EXTERNAL_SIGNAL_ABORT="EXTERNAL_SIGNAL_ABORT",r.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",r.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",r.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",r.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",r.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",r.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",r.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM",r.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",r.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",r.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST",r.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",r.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",r.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",r.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",r.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",r.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",r.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE",r.METADATA_OUT_OF_RANGE="METADATA_OUT_OF_RANGE",r.LOCAL_AEC_ERROR="LOCAL_AEC_ERROR",r.INVALID_PLUGIN="INVALID_PLUGIN",r.DISCONNECT_P2P="DISCONNECT_P2P",r.INIT_WEBSOCKET_TIMEOUT="INIT_WEBSOCKET_TIMEOUT",r.CONVERTING_IMAGEDATA_TO_BLOB_FAILED="CONVERTING_IMAGEDATA_TO_BLOB_FAILED",r.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED="CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED",r.INIT_DATACHANNEL_TIMEOUT="INIT_DATACHANNEL_TIMEOUT",r.CREATE_DATACHANNEL_ERROR="CREATE_DATACHANNEL_ERROR",r.DATACHANNEL_CONNECTION_TIMEOUT="DATACHANNEL_CONNECTION_TIMEOUT",r.PROHIBITED_OPERATION="PROHIBITED_OPERATION",r.IMAGE_MODERATION_UPLOAD_FAILED="IMAGE_MODERATION_UPLOAD_FAILED",r.P2P_MESSAGE_FAILED="P2P_MESSAGE_FAILED",r}({});class Ke extends Error{constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",c=arguments.length>2?arguments[2]:void 0;super(o),Zi(this,"code",void 0),Zi(this,"message",void 0),Zi(this,"data",void 0),Zi(this,"name","AgoraRTCException"),this.code=a,this.message="AgoraRTCError ".concat(this.code,": ").concat(o),this.data=c}toString(){return this.data?"data: ".concat(JSON.stringify(this.data),`
`).concat(this.stack):"".concat(this.stack)}print(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error",o=arguments.length>1?arguments[1]:void 0;return a==="error"&&(o||console).error(this.toString()),a==="warning"&&(o||console).warn(this.toString()),this}throw(a){throw this.print("error",a),this}}function fm(r,a){if(typeof r!="boolean")throw new Ke(ce.INVALID_PARAMS,"Invalid ".concat(a,": The value is of the boolean type."))}function as(r,a,o){if(!Tt(o).call(o,r))throw new Ke(ce.INVALID_PARAMS,"".concat(a," can only be set as ").concat(JSON.stringify(o)))}function Ti(r,a){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e4;if(r<o||r>c||(!(arguments.length>4&&arguments[4]!==void 0)||arguments[4])&&!function(f){return typeof f=="number"&&f%1==0}(r))throw new Ke(ce.INVALID_PARAMS,"invalid ".concat(a,": the value range is [").concat(o,", ").concat(c,"]. integer only"))}function jH(r,a){if(typeof r!="number"){if(!(r.min||r.max||r.ideal||r.exact))throw new Ke(ce.INVALID_PARAMS,"".concat(a," is not a valid ConstrainLong"));r.min!==void 0&&Ti(r.min,"".concat(a,".min"),0,1/0),r.max!==void 0&&Ti(r.max,"".concat(a,".max"),1,1/0),r.exact!==void 0&&Ti(r.exact,"".concat(a,".exact"),1,1/0),r.ideal!==void 0&&Ti(r.ideal,"".concat(a,".ideal"),1,1/0)}else Ti(r,a,1,1/0)}function Ms(r,a){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:255,f=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];if(r==null)throw new Ke(ce.INVALID_PARAMS,"".concat(a||"param"," cannot be empty"));if(!Une(r,o,c,f))throw new Ke(ce.INVALID_PARAMS,"Invalid ".concat(a||"string param",": Length of the string: [").concat(o,",").concat(c,"].").concat(f?" ASCII characters only.":""))}function pm(r,a){if(!Array.isArray(r))throw new Ke(ce.INVALID_PARAMS,"".concat(a," should be an array"))}function gr(r){return r==null}function Une(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:255,c=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3];return typeof r=="string"&&r.length<=o&&r.length>=a&&(!c||function(f){if(typeof f!="string")return!1;for(let m=0;m<f.length;m+=1){let v=f.charCodeAt(m);if(v<0||v>255)return!1}return!0}(r))}function Fne(r,a,o){if("getBigUint64"in DataView.prototype)return r.getBigUint64(a,o);let c=r.getUint32(a,o),f=r.getUint32(a+4,o),m=+!!o,v=+!o;return BigInt(c*v+f*m)<<BigInt(32)|BigInt(c*m+f*v)}function Bne(r,a,o,c){if("setBigUint64"in DataView.prototype)return r.setBigUint64(a,o,c);let f=Number(o>>BigInt(32)),m=Number(o&BigInt(4294967295));r.setUint32(a,f,c),r.setUint32(a+4,m,c)}var f3=function(r){return r.COVERED="COVERED",r.POSITION="POSITION",r.SIZE="SIZE",r.STYLE="STYLE",r}(f3||{}),UH=function(r){return r.UNMOUNTED="UNMOUNTED",r.INVALID_HTML_ELEMENT="INVALID_HTML_ELEMENT",r}(UH||{});let Vne=new class{constructor(){Zi(this,"_clientSize",null),Zi(this,"getClientWidth",()=>document.documentElement?document.documentElement.clientWidth:document.body.clientWidth),Zi(this,"getClientHeight",()=>document.documentElement?document.documentElement.clientHeight:document.body.clientHeight),Zi(this,"getStyle",r=>window.getComputedStyle(r,null)),Zi(this,"checkCssVisibleProperty",r=>{var a;let o=!0,c=this.getStyle(r),{display:f,visibility:m,opacity:v,filter:w}=c;return(f==="none"||Tt(a=["hidden","collapse"]).call(a,m)||Number(v)<.1)&&(o=!1),!!o&&(w&&w.split(" ").filter(C=>{var R;let x=C.split("(")[0];return Tt(R=["brightness","blur","opacity"]).call(R,x)}).map(C=>{let[R,x]=C.split(/\(|\)/);return[R,Number(x.match(/^[0-9\.]+/))]}).forEach(C=>{let[R,x]=C;switch(R){case"brightness":(x<.1||x>3)&&(o=!1);break;case"blur":x>3&&(o=!1);break;case"opacity":x<.1&&(o=!1)}}),o)}),Zi(this,"checkPropertyUpToAllParentNodes",(r,a)=>{let o=!0,c=!0,f=v=>a(v),m=r;for(;m&&c;)f(m)||(o=!1,c=!1),m=m.parentElement,m||(c=!1);return o}),Zi(this,"checkActualCssVisibleIncludeInherit",r=>this.checkPropertyUpToAllParentNodes(r,this.checkCssVisibleProperty)),Zi(this,"getSizeAboutClient",r=>{let{width:a,height:o,left:c,right:f,top:m,bottom:v}=r.getBoundingClientRect(),w=this.getClientWidth(),C=this.getClientHeight();return{width:a,height:o,left:c,right:f,top:m,bottom:v,clientWidth:w,clientHeight:C,clientMin:Math.min(w,C)}}),Zi(this,"checkActualSize",()=>{let{width:r,height:a,clientMin:o}=this._clientSize;return this.checkSizeIsVisible(r,a,o)}),Zi(this,"elementFromPoint",(r,a)=>document.elementFromPoint?document.elementFromPoint(r,a):null),Zi(this,"checkCoverForAPoint",(r,a,o)=>{let c=this.elementFromPoint(r,a);return c!==null&&c!==o}),Zi(this,"getPointPositionList",()=>{let{width:r,height:a,left:o,top:c}=this._clientSize,f=r/6,m=a/6,v=[],w=10**6;for(let C=0;C<5;C++)for(let R=0;R<5;R++){let x=(o*w+(C===0?.1:C===4?(f*C*w-1e5)/w:f*C)*w)/w,L=(c*w+(R===0?.1:R===4?(m*R*w-1e5)/w:m*R)*w)/w;v.push({x,y:L})}return[...v]}),Zi(this,"checkElementCover",r=>this.getPointPositionList().map(a=>this.checkCoverForAPoint(a.x,a.y,r)).filter(a=>!!a).length>6),Zi(this,"checkSizeIsVisible",(r,a,o)=>(r>50||o/r<=10)&&(a>50||o/a<=10)),Zi(this,"checkSizeOfPartInClient",()=>{let{left:r,right:a,top:o,bottom:c,clientHeight:f,clientWidth:m,clientMin:v}=this._clientSize,w,C,R,x;if(r<0)w=0;else{if(!(r<m))return!1;w=r}if(a<0)return!1;if(C=a<m?a:m,o<0)R=0;else{if(!(o<f))return!1;R=o}if(c<0)return!1;x=c<f?c:f;let L=C-w,U=x-R;return this.checkSizeIsVisible(L,U,v)}),Zi(this,"returnHiddenResult",r=>(this._clientSize=null,{visible:!1,reason:r})),Zi(this,"checkOneElementVisible",r=>{if(r instanceof HTMLElement){if(this.checkElementIsMountedOnDom(r)){if(this.checkActualCssVisibleIncludeInherit(r)){if(this._clientSize=this.getSizeAboutClient(r),this.checkElementCover(r))return this.returnHiddenResult(f3.COVERED);{let a=this.checkActualSize(),o=this.checkSizeOfPartInClient();return a&&!o?this.returnHiddenResult(f3.POSITION):a?(this._clientSize=null,{visible:!0}):this.returnHiddenResult(f3.SIZE)}}return this.returnHiddenResult(f3.STYLE)}return this.returnHiddenResult(UH.UNMOUNTED)}return this.returnHiddenResult(UH.INVALID_HTML_ELEMENT)}),Zi(this,"checkElementIsMountedOnDom",r=>this.checkPropertyUpToAllParentNodes(r,a=>a.nodeName.toUpperCase()!=="HTML"?a.parentElement!==null:!!document.documentElement))}};function FH(r){return new TextEncoder().encode(r)}let zne=function(r,a){let o=new Uint8Array(r.byteLength+a.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(a),r.byteLength),o},BH=async r=>function(a,o){let c="";return new Uint8Array(a).forEach(f=>{c+=f.toString(o).padStart(2,"0")}),c}(await crypto.subtle.digest("SHA-256",FH(r)),16),nr=class{constructor(){Zi(this,"_events",{}),Zi(this,"addListener",this.on)}getListeners(r){return this._events[r]?this._events[r].map(a=>a.listener):[]}on(r,a){this._events[r]||(this._events[r]=[]);let o=this._events[r];this._indexOfListener(o,a)===-1&&o.push({listener:a,once:!1})}once(r,a){this._events[r]||(this._events[r]=[]);let o=this._events[r];this._indexOfListener(o,a)===-1&&o.push({listener:a,once:!0})}off(r,a){if(!this._events[r])return;let o=this._events[r],c=this._indexOfListener(o,a);c!==-1&&o.splice(c,1),this._events[r].length===0&&delete this._events[r]}removeAllListeners(r){r?delete this._events[r]:this._events={}}emit(r){this._events[r]||(this._events[r]=[]);let a=this._events[r].map(m=>m);for(var o=arguments.length,c=new Array(o>1?o-1:0),f=1;f<o;f++)c[f-1]=arguments[f];for(let m=0;m<a.length;m+=1){let v=a[m];v.once&&this.off(r,v.listener),v.listener.apply(this,c||[])}}safeEmit(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),c=1;c<a;c++)o[c-1]=arguments[c];[...this._events[r]||[]].forEach(f=>{f.once&&this.off(r,f.listener);try{f.listener.apply(this,o)}catch(m){console.error("safeEmit event:".concat(r," error ").concat(m==null?void 0:m.toString()))}})}_indexOfListener(r,a){let o=r.length;for(;o--;)if(r[o].listener===a)return o;return-1}},p3=null;function Hne(){if(p3)return p3;if(window.electron)return p3=window.electron;if(!window.require)return null;try{return p3=window.require("electron"),p3}catch{return null}}let $r=function(r){return r.CREATE_CLIENT="createClient",r.CHECK_SYSTEM_REQUIREMENTS="checkSystemRequirements",r.SET_AREA="setArea",r.PRELOAD="PRELOAD",r.CHECK_VIDEO_TRACK_IS_ACTIVE="checkVideoTrackIsActive",r.CHECK_AUDIO_TRACK_IS_ACTIVE="checkAudioTrackIsActive",r.CREATE_MIC_AUDIO_TRACK="createMicrophoneAudioTrack",r.CREATE_CUSTOM_AUDIO_TRACK="createCustomAudioTrack",r.CREATE_BUFFER_AUDIO_TRACK="createBufferSourceAudioTrack",r.CREATE_CAM_VIDEO_TRACK="createCameraVideoTrack",r.CREATE_CUSTOM_VIDEO_TRACK="createCustomVideoTrack",r.CREATE_MIC_AND_CAM_TRACKS="createMicrophoneAndCameraTracks",r.CREATE_SCREEN_VIDEO_TRACK="createScreenVideoTrack",r.SET_ENCRYPTION_CONFIG="Client.setEncryptionConfig",r.START_PROXY_SERVER="Client.startProxyServer",r.STOP_PROXY_SERVER="Client.stopProxyServer",r.SET_PROXY_SERVER="Client.setProxyServer",r.SET_TURN_SERVER="Client.setTurnServer",r.SET_CLIENT_ROLE="Client.setClientRole",r.SET_LOW_STREAM_PARAMETER="Client.setLowStreamParameter",r.ENABLE_DUAL_STREAM="Client.enableDualStream",r.DISABLE_DUAL_STREAM="Client.disableDualStream",r.JOIN="Client.join",r.LEAVE="Client.leave",r.PUBLISH="Client.publish",r.UNPUBLISH="Client.unpublish",r.SUBSCRIBE="Client.subscribe",r.MASS_SUBSCRIBE="Client.massSubscribe",r.MASS_UNSUBSCRIBE="Client.massUnsubscribe",r.UNSUBSCRIBE="Client.unsubscribe",r.RENEW_TOKEN="Client.renewToken",r.SET_REMOTE_VIDEO_STREAM_TYPE="Client.setRemoteVideoStreamType",r.SET_STREAM_FALLBACK_OPTION="Client.setStreamFallbackOption",r.ENABLE_AUDIO_VOLUME_INDICATOR="Client.enableAudioVolumeIndicator",r.SEND_CUSTOM_REPORT_MESSAGE="Client.sendCustomReportMessage",r.INSPECT_VIDEO_CONTENT="Client.inspectVideoContent",r.STOP_INSPECT_VIDEO_CONTENT="Client.stopInspectVideoContent",r.JOIN_FALLBACK_TO_PROXY="Client._joinFallbackToProxy",r.DATACHANNEL_FAILBACK="Client._datachannelFailback",r.ON_LIVE_STREAM_WARNING="Client.onLiveStreamWarning",r.ON_LIVE_STREAM_ERROR="Client.onLiveStreamingError",r.START_LIVE_STREAMING="Client.startLiveStreaming",r.SET_LIVE_TRANSCODING="Client.setLiveTranscoding",r.STOP_LIVE_STREAMING="Client.stopLiveStreaming",r.START_CHANNEL_MEDIA_RELAY="Client.startChannelMediaRelay",r.UPDATE_CHANNEL_MEDIA_RELAY="Client.updateChannelMediaRelay",r.STOP_CHANNEL_MEDIA_RELAY="Client.stopChannelMediaRelay",r.REQUEST_CONFIG_DISTRIBUTE="_config-distribute-request",r.SET_CONFIG_DISTRIBUTE="_configDistribute",r.LOCAL_TRACK_SET_MUTED="LocalTrack.setMute",r.LOCAL_AUDIO_TRACK_PLAY="LocalAudioTrack.play",r.LOCAL_AUDIO_TRACK_PLAY_IN_ELEMENT="LocalAudioTrack.playInElement",r.LOCAL_AUDIO_TRACK_STOP="LocalAudioTrack.stop",r.LOCAL_AUDIO_TRACK_SET_VOLUME="LocalAudioTrack.setVolume",r.MIC_AUDIO_TRACK_SET_DEVICE="MicrophoneAudioTrack.setDevice",r.BUFFER_AUDIO_TRACK_START="BufferSourceAudioTrack.startProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_STOP="BufferSourceAudioTrack.stopProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_PAUSE="BufferSourceAudioTrack.pauseProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_RESUME="BufferSourceAudioTrack.resumeProcessAudioBuffer",r.BUFFER_AUDIO_TRACK_SEEK="BufferSourceAudioTrack.seekAudioBuffer",r.LOCAL_VIDEO_TRACK_PLAY="LocalVideoTrack.play",r.LOCAL_VIDEO_TRACK_STOP="LocalVideoTrack.stop",r.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE="LocalVideoTrack.getVideoElementVisibleStatus",r.LOCAL_VIDEO_TRACK_BEAUTY="LocalVideoTrack.setBeautyEffect",r.LOCAL_VIDEO_SEND_SEI_DATA="LocalVideoTrack.sendSeiData",r.CAM_VIDEO_TRACK_SET_DEVICE="CameraVideoTrack.setDevice",r.CAM_VIDEO_TRACK_SET_ENCODER_CONFIG="CameraVideoTrack.setEncoderConfiguration",r.REMOTE_VIDEO_TRACK_PLAY="RemoteVideoTrack.play",r.REMOTE_VIDEO_TRACK_STOP="RemoteVideoTrack.stop",r.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE="RemoteVideoTrack.getVideoElementVisibleStatus",r.REMOTE_AUDIO_TRACK_PLAY="RemoteAudioTrack.play",r.REMOTE_AUDIO_TRACK_STOP="RemoteAudioTrack.stop",r.REMOTE_AUDIO_SET_VOLUME="RemoteAudioTrack.setVolume",r.REMOTE_AUDIO_SET_OUTPUT_DEVICE="RemoteAudioTrack.setOutputDevice",r.GET_MEDIA_STREAM_TRACK="Track.getMediaStreamTrack",r.STREAM_TYPE_CHANGE="streamTypeChange",r.CONNECTION_STATE_CHANGE="connectionStateChange",r.LOAD_CONFIG_FROM_LOCALSTORAGE="loadConfigFromLocalStorage",r.IMAGE_MODERATION_UPLOAD="imageModerationUpload",r}({}),vr=function(r){return r.TRACER="tracer",r}({});function Gne(r){return Ti(r.timeout,"config.timeout",0,1e5),Ti(r.timeoutFactor,"config.timeoutFactor",0,100,!1),Ti(r.maxRetryCount,"config.maxRetryConfig",0,1/0),Ti(r.maxRetryTimeout,"config.maxRetryTimeout",0,1/0),!0}let sxe=function(r){return r[r.AUDIENCE_LEVEL_LOW_LATENCY=1]="AUDIENCE_LEVEL_LOW_LATENCY",r[r.AUDIENCE_LEVEL_ULTRA_LOW_LATENCY=2]="AUDIENCE_LEVEL_ULTRA_LOW_LATENCY",r[r.AUDIENCE_LEVEL_SYNC_LATENCY=3]="AUDIENCE_LEVEL_SYNC_LATENCY",r}({}),Hn=function(r){return r.LEAVE="LEAVE",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.UID_BANNED="UID_BANNED",r.IP_BANNED="IP_BANNED",r.CHANNEL_BANNED="CHANNEL_BANNED",r.FALLBACK="FALLBACK",r.LICENSE_MISSING="LICENSE_MISSING",r.LICENSE_EXPIRED="LICENSE_EXPIRED",r.LICENSE_MINUTES_EXCEEDED="LICENSE_MINUTES_EXCEEDED",r.LICENSE_PERIOD_INVALID="LICENSE_PERIOD_INVALID",r.LICENSE_MULTIPLE_SDK_SERVICE="LICENSE_MULTIPLE_SDK_SERVICE",r.LICENSE_ILLEGAL="LICENSE_ILLEGAL",r.TOKEN_EXPIRE="TOKEN_EXPIRE",r}({});function US(r){if(!Array.isArray(r)||r.length<1)return!1;try{r.forEach(a=>{if(!a.urls)throw Error()})}catch{return!1}return!0}function Wne(r){return Ms(r.turnServerURL,"turnServerURL"),Ms(r.username,"username"),Ms(r.password,"password"),r.udpport&&Ti(r.udpport,"udpport",1,99999,!0),r.forceturn&&fm(r.forceturn,"forceturn"),r.security&&fm(r.security,"security"),r.tcpport&&Ti(r.tcpport,"tcpport",1,99999,!0),!0}function $ne(r){return r.level!==void 0&&as(r.level,"level",[1,2,3]),r.delay!==void 0&&Ti(r.delay,"delay",0,3e3,!0),!0}let Gn=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.MEDIA_RECONNECT_START="media-reconnect-start",r.MEDIA_RECONNECT_END="media-reconnect-end",r.IS_USING_CLOUD_PROXY="is-using-cloud-proxy",r.USER_JOINED="user-joined",r.USER_LEAVED="user-left",r.USER_PUBLISHED="user-published",r.USER_UNPUBLISHED="user-unpublished",r.USER_INFO_UPDATED="user-info-updated",r.CLIENT_BANNED="client-banned",r.CHANNEL_MEDIA_RELAY_STATE="channel-media-relay-state",r.CHANNEL_MEDIA_RELAY_EVENT="channel-media-relay-event",r.VOLUME_INDICATOR="volume-indicator",r.CRYPT_ERROR="crypt-error",r.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="token-privilege-will-expire",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="token-privilege-did-expire",r.NETWORK_QUALITY="network-quality",r.STREAM_TYPE_CHANGED="stream-type-changed",r.STREAM_FALLBACK="stream-fallback",r.RECEIVE_METADATA="receive-metadata",r.STREAM_MESSAGE="stream-message",r.LIVE_STREAMING_ERROR="live-streaming-error",r.LIVE_STREAMING_WARNING="live-streaming-warning",r.INJECT_STREAM_STATUS="stream-inject-status",r.EXCEPTION="exception",r.ERROR="error",r.P2P_LOST="p2p_lost",r.JOIN_FALLBACK_TO_PROXY="join-fallback-to-proxy",r.CHANNEL_FALLBACK_TO_WEBSOCKET="channel-fallback-to-websocket",r.MEDIA_CONNECTION_TYPE_CHANGE="media-connection-type-change",r.PUBLISHED_USER_LIST="published-user-list",r.CONTENT_INSPECT_CONNECTION_STATE_CHANGE="content-inspect-connection-state-change",r.CONTENT_INSPECT_ERROR="content-inspect-error",r.CONTENT_INSPECT_RESULT="content-inspect-result",r.IMAGE_MODERATION_CONNECTION_STATE_CHANGE="image-moderation-connection-state-change",r}({}),$s=function(r){return r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.MULTI_IP="MULTI_IP",r.TIMEOUT="TIMEOUT",r.OFFLINE="OFFLINE",r.LEAVE="LEAVE",r.P2P_FAILED="P2P_FAILED",r.FALLBACK="FALLBACK",r}({}),eo=function(r){return r.ONLINE="ONLINE",r.OFFLINE="OFFLINE",r}({}),By=function(r){return r.NETWORK_STATE_CHANGE="NETWORK_STATE_CHANGE",r.ONLINE="ONLINE",r.OFFLINE="OFFLINE",r}({});function Kr(r,a){for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return r.getListeners(a).length===0?Ct.reject(new Ke(ce.UNEXPECTED_ERROR,"can not emit promise")):new Ct((m,v)=>{r.emit(a,...c,m,v)})}function Li(r,a){if(r.getListeners(a).length===0)return Ct.resolve();for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return Kr(r,a,...c)}function Ml(r,a){if(r.getListeners(a).length===0)return null;for(var o=arguments.length,c=new Array(o>2?o-2:0),f=2;f<o;f++)c[f-2]=arguments[f];return Vy(r,a,...c)}function Vy(r,a){let o=null,c=null;for(var f=arguments.length,m=new Array(f>2?f-2:0),v=2;v<f;v++)m[v-2]=arguments[v];if(r.emit(a,...m,w=>{o=w},w=>{c=w}),c!==null)throw c;if(o===null)throw new Ke(ce.UNEXPECTED_ERROR,"handler is not sync");return o}let yr=new class extends nr{set networkState(r){this.emit(By.NETWORK_STATE_CHANGE,r,this._networkState),r===eo.ONLINE?this.emit(By.ONLINE):r===eo.OFFLINE&&(this.onlineWaiter=new Ct(a=>{this.once(By.ONLINE,()=>{this.onlineWaiter=void 0,a(eo.ONLINE)})}),this.emit(By.OFFLINE)),this._networkState=r}get networkState(){return this._networkState}get isOnline(){return this._networkState===eo.ONLINE}constructor(){super(),Zi(this,"_moduleName","network-indicator"),Zi(this,"_networkState",eo.ONLINE),Zi(this,"onlineWaiter",void 0),window.addEventListener("online",()=>{this.networkState=eo.ONLINE}),window.addEventListener("offline",()=>{this.networkState=eo.OFFLINE})}};function L8(r,a){let o=r.indexOf(a);o!==-1&&r.splice(o,1)}function FS(r){let a=[];return r.forEach(o=>{a.indexOf(o)===-1&&a.push(o)}),a}function D8(r){Ct!==void 0?Ct.resolve().then(r):setTimeout(r,0)}function zi(r){return JSON.parse(JSON.stringify(r))}function zy(r){try{return zi(r)}catch{return r}}let Kne={};function T0(r,a){Kne[a]||(Kne[a]=!0,r())}function Hy(r){let a=window.atob(r),o=new Uint8Array(new ArrayBuffer(a.length));for(let c=0;c<a.length;c+=1)o[c]=a.charCodeAt(c);return o}function R0(r){let a="";for(let o=0;o<r.length;o+=1)a+=String.fromCharCode(r[o]);return window.btoa(a)}function qne(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,o=new TextEncoder().encode(r);if(o.length>a)o=o.slice(0,a);else if(o.length<a){let c=new Uint8Array(a);c.set(o),o=c}return o}function Yne(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=_c(a).call(a,(v,w)=>v+w.length,0),f=new Uint8Array(new ArrayBuffer(c)),m=0;return a.forEach(v=>{f.set(v,m),m+=v.length}),f}function Df(r){return window.TextEncoder?new TextEncoder().encode(r).length:r.length}function Xne(r){let a=0;return(/DingTalk/i.test(navigator.userAgent)||/AliApp/i.test(navigator.userAgent))&&r.realFormData&&(r=r.realFormData),r.forEach(o=>{a+=typeof o=="string"?Df(o):o.size}),a+138}function axe(r){let a=new Ke(ce.TIMEOUT,"timeout");return new Ct((o,c)=>{window.setTimeout(()=>c(a),r)})}function vs(r){return new Ct(a=>{window.setTimeout(a,r)})}function Di(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:7,a=arguments.length>1?arguments[1]:void 0,o=Math.random().toString(16).substr(2,r).toLowerCase();return o.length===r?"".concat(a).concat(o):"".concat(a).concat(o)+Di(r-o.length,"")}function m3(){return Di(32,"").toUpperCase()}let k8=()=>{},Jne=new class{constructor(){Zi(this,"fnMap",new Map)}throttleByKey(r,a,o,c){for(var f=arguments.length,m=new Array(f>4?f-4:0),v=4;v<f;v++)m[v-4]=arguments[v];if(this.fnMap.has(a)){let w=this.fnMap.get(a);if(w.threshold!==o){w.fn(...w.args),clearTimeout(w.timer);let C=window.setTimeout(()=>{let R=this.fnMap.get(a);R&&R.fn(...R.args),this.fnMap.delete(a)},o);this.fnMap.set(a,{fn:r,threshold:o,timer:C,args:m,skipFn:c})}else w.skipFn&&w.skipFn(...w.args),this.fnMap.set(a,Kt(Kt({},w),{},{fn:r,args:m,skipFn:c}))}else{let w=window.setTimeout(()=>{let C=this.fnMap.get(a);C&&C.fn(...C.args),this.fnMap.delete(a)},o);this.fnMap.set(a,{fn:r,threshold:o,timer:w,args:m,skipFn:c})}}},Qne=Jne.throttleByKey.bind(Jne);function Zne(r){return typeof r=="object"&&r!==null&&!(r instanceof RegExp)}function VH(r,a){if(!Zne(r)||!Zne(a)||Array.isArray(r)&&!Array.isArray(a)||!Array.isArray(r)&&Array.isArray(a))return a;if(Array.isArray(a)&&Array.isArray(r)){let o=[...r];for(let c=0;c<a.length;c++)o[c]=VH(r[c],a[c]);return o}{let o=Kt({},r);for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(Object.prototype.hasOwnProperty.call(r,c)?o[c]=VH(r[c],a[c]):o[c]=a[c]);return o}}function eie(r,a){let o=[0];if(o=new Array(a).fill(0),r===0)return o;let c=0;for(;r>0&&(o[c]=255&r,r>>=8,c++,c!==a););return o}function zH(r){return typeof r=="number"?r:r.exact||r.ideal||r.max||r.min||0}function tie(r){let a="0123456789abcdef";function o(xe){let Oe,ke="";for(Oe=0;Oe<=3;Oe++)ke+=a.charAt(xe>>8*Oe+4&15)+a.charAt(xe>>8*Oe&15);return ke}function c(xe,Oe){let ke=(65535&xe)+(65535&Oe);return(xe>>16)+(Oe>>16)+(ke>>16)<<16|65535&ke}function f(xe,Oe,ke,He,lt,ut){return c(function(ft,zt){return ft<<zt|ft>>>32-zt}(c(c(Oe,xe),c(He,ut)),lt),ke)}function m(xe,Oe,ke,He,lt,ut,ft){return f(Oe&ke|~Oe&He,xe,Oe,lt,ut,ft)}function v(xe,Oe,ke,He,lt,ut,ft){return f(Oe&He|ke&~He,xe,Oe,lt,ut,ft)}function w(xe,Oe,ke,He,lt,ut,ft){return f(Oe^ke^He,xe,Oe,lt,ut,ft)}function C(xe,Oe,ke,He,lt,ut,ft){return f(ke^(Oe|~He),xe,Oe,lt,ut,ft)}let R=function(xe){let Oe,ke=1+(xe.length+8>>6),He=new Array(16*ke);for(Oe=0;Oe<16*ke;Oe++)He[Oe]=0;for(Oe=0;Oe<xe.length;Oe++)He[Oe>>2]|=xe.charCodeAt(Oe)<<Oe%4*8;return He[Oe>>2]|=128<<Oe%4*8,He[16*ke-2]=8*xe.length,He}(r),x,L,U,F,Z,W=1732584193,K=-271733879,oe=-1732584194,ue=271733878;for(x=0;x<R.length;x+=16)L=W,U=K,F=oe,Z=ue,W=m(W,K,oe,ue,R[x+0],7,-680876936),ue=m(ue,W,K,oe,R[x+1],12,-389564586),oe=m(oe,ue,W,K,R[x+2],17,606105819),K=m(K,oe,ue,W,R[x+3],22,-1044525330),W=m(W,K,oe,ue,R[x+4],7,-176418897),ue=m(ue,W,K,oe,R[x+5],12,1200080426),oe=m(oe,ue,W,K,R[x+6],17,-1473231341),K=m(K,oe,ue,W,R[x+7],22,-45705983),W=m(W,K,oe,ue,R[x+8],7,1770035416),ue=m(ue,W,K,oe,R[x+9],12,-1958414417),oe=m(oe,ue,W,K,R[x+10],17,-42063),K=m(K,oe,ue,W,R[x+11],22,-1990404162),W=m(W,K,oe,ue,R[x+12],7,1804603682),ue=m(ue,W,K,oe,R[x+13],12,-40341101),oe=m(oe,ue,W,K,R[x+14],17,-1502002290),K=m(K,oe,ue,W,R[x+15],22,1236535329),W=v(W,K,oe,ue,R[x+1],5,-165796510),ue=v(ue,W,K,oe,R[x+6],9,-1069501632),oe=v(oe,ue,W,K,R[x+11],14,643717713),K=v(K,oe,ue,W,R[x+0],20,-373897302),W=v(W,K,oe,ue,R[x+5],5,-701558691),ue=v(ue,W,K,oe,R[x+10],9,38016083),oe=v(oe,ue,W,K,R[x+15],14,-660478335),K=v(K,oe,ue,W,R[x+4],20,-405537848),W=v(W,K,oe,ue,R[x+9],5,568446438),ue=v(ue,W,K,oe,R[x+14],9,-1019803690),oe=v(oe,ue,W,K,R[x+3],14,-187363961),K=v(K,oe,ue,W,R[x+8],20,1163531501),W=v(W,K,oe,ue,R[x+13],5,-1444681467),ue=v(ue,W,K,oe,R[x+2],9,-51403784),oe=v(oe,ue,W,K,R[x+7],14,1735328473),K=v(K,oe,ue,W,R[x+12],20,-1926607734),W=w(W,K,oe,ue,R[x+5],4,-378558),ue=w(ue,W,K,oe,R[x+8],11,-2022574463),oe=w(oe,ue,W,K,R[x+11],16,1839030562),K=w(K,oe,ue,W,R[x+14],23,-35309556),W=w(W,K,oe,ue,R[x+1],4,-1530992060),ue=w(ue,W,K,oe,R[x+4],11,1272893353),oe=w(oe,ue,W,K,R[x+7],16,-155497632),K=w(K,oe,ue,W,R[x+10],23,-1094730640),W=w(W,K,oe,ue,R[x+13],4,681279174),ue=w(ue,W,K,oe,R[x+0],11,-358537222),oe=w(oe,ue,W,K,R[x+3],16,-722521979),K=w(K,oe,ue,W,R[x+6],23,76029189),W=w(W,K,oe,ue,R[x+9],4,-640364487),ue=w(ue,W,K,oe,R[x+12],11,-421815835),oe=w(oe,ue,W,K,R[x+15],16,530742520),K=w(K,oe,ue,W,R[x+2],23,-995338651),W=C(W,K,oe,ue,R[x+0],6,-198630844),ue=C(ue,W,K,oe,R[x+7],10,1126891415),oe=C(oe,ue,W,K,R[x+14],15,-1416354905),K=C(K,oe,ue,W,R[x+5],21,-57434055),W=C(W,K,oe,ue,R[x+12],6,1700485571),ue=C(ue,W,K,oe,R[x+3],10,-1894986606),oe=C(oe,ue,W,K,R[x+10],15,-1051523),K=C(K,oe,ue,W,R[x+1],21,-2054922799),W=C(W,K,oe,ue,R[x+8],6,1873313359),ue=C(ue,W,K,oe,R[x+15],10,-30611744),oe=C(oe,ue,W,K,R[x+6],15,-1560198380),K=C(K,oe,ue,W,R[x+13],21,1309151649),W=C(W,K,oe,ue,R[x+4],6,-145523070),ue=C(ue,W,K,oe,R[x+11],10,-1120210379),oe=C(oe,ue,W,K,R[x+2],15,718787259),K=C(K,oe,ue,W,R[x+9],21,-343485551),W=c(W,L),K=c(K,U),oe=c(oe,F),ue=c(ue,Z);return o(W)+o(K)+o(oe)+o(ue)}let oxe=1,M8=console,Ts=class{static setLogger(r){M8=r}constructor(r){Zi(this,"lockingPromise",Ct.resolve()),Zi(this,"locks",0),Zi(this,"name",""),Zi(this,"lockId",void 0),this.lockId=oxe++,r&&(this.name=r),M8.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is created."))}get isLocked(){return this.locks>0}lock(r){let a;this.locks+=1,M8.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is locked, current queue ").concat(this.locks,". ").concat(typeof r=="string"?r:""));let o=new Ct(f=>{a=()=>{this.locks-=1,M8.debug("[lock-".concat(this.name,"-").concat(this.lockId,"] is not locked, current queue ").concat(this.locks,". ").concat(typeof r=="string"?r:"")),f()}}),c=this.lockingPromise.then(()=>a);return this.lockingPromise=this.lockingPromise.then(()=>o),c}};function BS(r,a){return function(o,c,f){let m=f.value;if(typeof m!="function")throw new Error("Cannot use mutex on object property.");return f.value=async function(){let v=this[a];if(!v)throw new Error("mutex property key ".concat(a," doesn't exist on ").concat(r));let w=await v.lock("From ".concat(r,".").concat(c));try{for(var C=arguments.length,R=new Array(C),x=0;x<C;x++)R[x]=arguments[x];return await m.apply(this,R)}finally{w()}},f}}let kr={timeout:500,timeoutFactor:1.5,maxRetryCount:1/0,maxRetryTimeout:1e4};function j8(r,a){let o=Math.floor(a.timeout*Math.pow(a.timeoutFactor,r));return Math.min(a.maxRetryTimeout,o)}function wh(r,a,o,c){let f=Object.assign({},kr,c),m=f.timeout,v=async()=>{await function(R){return new Ct(x=>{window.setTimeout(x,R)})}(m),m*=f.timeoutFactor,m=Math.min(f.maxRetryTimeout,m)},w=!1,C=new Ct(async(R,x)=>{a=a||(()=>!1),o=o||(()=>!0);for(let L=0;L<f.maxRetryCount;L+=1){if(w)return x(new Ke(ce.OPERATION_ABORTED));try{let U=await r();if(!a(U,L)||L+1===f.maxRetryCount)return R(U);await v()}catch(U){if(!o(U,L)||L+1===f.maxRetryCount)return x(U);await v()}}});return C.cancel=()=>w=!0,C}class HH{constructor(a){Zi(this,"input",[]),Zi(this,"size",void 0),this.size=a}add(a){this.input.push(a),this.input.length>this.size&&this.input.splice(0,1)}mean(){var a;return this.input.length===0?0:_c(a=this.input).call(a,(o,c)=>o+c)/this.input.length}}let U8,F8=0,GH=0;function WH(r,a,o,c){return new Ct((f,m)=>{a.responseType=a.responseType||"json",a.data&&!o?(a.data=JSON.stringify(a.data),F8+=Df(a.data)):o&&(a.data.size?F8+=a.data.size:a.data instanceof FormData?F8+=Xne(a.data):F8+=Df(JSON.stringify(a.data))),a.headers=a.headers||{},a.headers["Content-Type"]=a.headers["Content-Type"]||"application/json",a.method="POST",a.url=r,Io.request(a).then(v=>{typeof v.data=="string"?GH+=Df(v.data):v.data instanceof ArrayBuffer||v.data instanceof Uint8Array?GH+=v.data.byteLength:GH+=Df(JSON.stringify(v.data)),f(v.data)}).catch(v=>{Io.isCancel(v)?m(new Ke(ce.OPERATION_ABORTED,"cancel token canceled")):v.code==="ECONNABORTED"?m(new Ke(ce.NETWORK_TIMEOUT,v.message)):v.response?m(new Ke(ce.NETWORK_RESPONSE_ERROR,v.response.status)):m(new Ke(ce.NETWORK_ERROR,v.message))})})}async function lxe(r,a){let o=new Blob([a.data],{type:"buffer"});return await WH(r,Kt(Kt({},a),{},{data:o,headers:{"Content-Type":"application/octet-stream"}}),!0)}let nie=()=>window.isSecureContext!==void 0,dd=function(r){if(r.match(/[0-9]+\.[0-9]+\.[0-9]+$/))return r;let a=r.match(/([0-9]+\.[0-9]+\.[0-9]+)\-alpha\.([0-9]+)/);if(a&&a[1]&&a[2]){let c=a[1],f=a[2];return"".concat(c,".").concat(f)}let o=r.match(/([0-9]+\.[0-9]+\.[0-9]+)\-special\.([0-9]+)/);if(o&&o[1]&&o[2]){let c=o[1],f=o[2];return"".concat(c,".").concat(100*(Number(f)+1))}return"4.0.0.999"}("4.21.0"),$H=function(){try{return JSON.parse("true")===!0}catch{return!0}}(),Gy=function(r){return r.Default="default",r.Auto="auto",r.Relay="relay",r.SdRtn="sd-rtn",r}({}),KH={MIN_FRAME_RATE:1,MAX_FRAME_RATE:30,MAX_THRESHOLD_FRAMERATE:30,BITRATE_MIN_THRESHOLD:100,BITRATE_MAX_THRESHOLD:100,MAX_SCALE:5,BWE_SCALE_UP_THRESHOLD:.6,BWE_SCALE_DOWN_THRESHOLD:.6,PERF_SCALE_UP_THRESHOLD:.7,PERF_SCALE_DOWN_THRESHOLD:.6,MOTION_RESOLUTION_FACTOR:.8,MOTION_BITRATE_FACTOR:.6,DETAIL_FRAMERATE_FACTOR:.8,DETAIL_BITRATE_FACTOR:.6,BALANCE_RESOLUTION_FACTOR:.9,BALANCE_FRAMERATE_FACTOR:.9,BALANCE_BITRATE_FACTOR:.6,OVERUSE_TIMES_THRESHOLD:10,UNDERUSE_TIMES_THRESHOLD:40},qH="v4.21.0-0-g16fdae2c-dirty(6/3/2024, 2:55:18 PM)",es={PROCESS_ID:"",ENCRYPT_AES:!0,AREAS:["CHINA","GLOBAL"],WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io","webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io","webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-web-2.ap.sd-rtn.com","cds-ap-web-3.agora.io","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-web-2.ap.sd-rtn.com","sua-ap-web-3.agora.io","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-ap-web-1.agora.io","uap-web-2.ap.sd-rtn.com","uap-ap-web-3.agora.io","uap-web-4.ap.sd-rtn.com"],LOG_UPLOAD_SERVER:"logservice.agora.io",EVENT_REPORT_DOMAIN:"statscollector-1.agora.io",EVENT_REPORT_BACKUP_DOMAIN:"web-2.statscollector.sd-rtn.com",ENABLE_EVENT_REPORT:!0,GATEWAY_ADDRESS:[],GATEWAY_WSS_ADDRESS:"",LIVE_STREAMING_ADDRESS:"",HTTP_CONNECT_TIMEOUT:5e3,SIGNAL_REQUEST_TIMEOUT:1e4,REPORT_STATS:!0,UPLOAD_LOG:!1,NOT_REPORT_EVENT:[],SUBSCRIBE_TWCC:!0,PUBLISH_TWCC:!1,PING_PONG_TIME_OUT:10,WEBSOCKET_TIMEOUT_MIN:1e4,EVENT_REPORT_SEND_INTERVAL:3e3,CONFIG_DISTRIBUTE_INTERVAL:3e5,ENABLE_CONFIG_DISTRIBUTE:!0,CANDIDATE_TIMEOUT:5e3,SHOW_REPORT_INVOKER_LOG:!1,JOIN_EXTEND:"",PUB_EXTEND:"",SUB_EXTEND:"",FORCE_TURN:!1,TURN_ENABLE_TCP:!0,TURN_ENABLE_UDP:!0,MAX_UPLOAD_CACHE:50,UPLOAD_CACHE_INTERVAL:2e3,AJAX_REQUEST_CONCURRENT:3,REPORT_APP_SCENARIO:void 0,GATEWAY_DOMAINS:["edge.agora.io","edge.sd-rtn.com"],CONNECT_GATEWAY_WITHOUT_DOMAIN:!1,WORKER_DOMAIN:"edge.agora.io",TURN_DOMAIN:"edge.agora.io",EVENT_REPORT_RETRY:!0,CHROME_FORCE_PLAN_B:!1,AUDIO_SOURCE_VOLUME_UPDATE_INTERVAL:400,AUDIO_SOURCE_AVG_VOLUME_DURATION:3e3,AUDIO_VOLUME_INDICATION_INTERVAL:2e3,VOLUME_VOICE_WEIGHT:10,GET_VOLUME_OF_MUTED_AUDIO_TRACK:!1,STATS_UPDATE_INTERVAL:250,NORMAL_EVENT_QUEUE_CAPACITY:100,CUSTOM_REPORT:!0,CUSTOM_REPORT_LIMIT:20,PROXY_SERVER_TYPE2:"webnginx-proxy.agora.io",PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com","webrtc-cloud-proxy.agora.io"],CUSTOM_PUB_ANSWER_MODIFIER:null,CUSTOM_SUB_ANSWER_MODIFIER:null,CUSTOM_PUB_OFFER_MODIFIER:null,CUSTOM_SUB_OFFER_MODIFIER:null,DSCP_TYPE:"high",REMOVE_NEW_CODECS:!0,FRAGEMENT_LENGTH:3,WEBSOCKET_COMPRESS:!1,SIMULCAST:!1,PRELOAD_MEDIA_COUNT:0,USE_PUB_RTX:!0,USE_SUB_RTX:!0,USE_XR:!0,ENABLE_LOSSBASED_BWE:!0,ENABLE_AUT_CC:void 0,ENABLE_CC_FALLBACK:void 0,CHECK_VIDEO_VISIBLE_INTERVAL:3e4,CHECK_LOCAL_STATS_INTERVAL:250,PROFILE_SWITCH_INTERVAL:2e3,UNSUPPORTED_VIDEO_CODEC:[],ENUMERATE_DEVICES_INTERVAL:!1,ENUMERATE_DEVICES_INTERVAL_TIME:1e4,USE_NEW_TOKEN:!1,CLOSE_AFB_FOR_LOCAL_AP:!0,JOIN_MAX_CONCURRENCY:6,JOIN_WITH_FALLBACK_SIGNAL_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY:!0,JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE:!1,JOIN_GATEWAY_TRY_443PORT_DURATION:2e3,JOIN_GATEWAY_USE_443PORT_ONLY:!1,JOIN_GATEWAY_USE_DUAL_DOMAIN:!0,JOIN_GATEWAY_FALLBACK_PORT:443,USE_TURN_SERVER_OF_GATEWAY:!1,H264_PROFILE_LEVEL_ID:"",USE_NEW_LOG:!1,LOG_VERSION:3,MEDIA_DEVICE_CONSTRAINTS:null,ENCRYPT_PROXY_USERNAME_AND_PSW:!0,SDP_LOGGING:!1,CSP_DETECTED_HOSTNAME_LIST:["agora.io","sd-rtn.com"],REMOTE_AUDIO_TRACK_USES_WEB_AUDIO:!1,LOCAL_AUDIO_TRACK_USES_WEB_AUDIO:!1,BITRATE_ADAPTER_TYPE:"STANDARD_BITRATE",AI_DENOISER_PARAMETERS:{excludedLinks:[]},ADJUST_3A_FROM_PLUGINS:!0,RAISE_H264_BASELINE_PRIORITY:!0,FILTER_SEND_H264_BASELINE:!1,ENABLE_PUBLISHED_USER_LIST:!0,MAX_SUBSCRIPTION:50,X_GOOGLE_START_BITRATE:void 0,NEW_REPORT_SERVER:!1,NEW_REPORT_SERVER_DOMAINS:["data-reporting.agora.io","data-reporting.agora.io"],VIDEO_INSPECT_WORKER_MESSAGE_LENGTH_LIMIT:3e5,VIDEO_INSPECT_INTERVAL_MINIMUM:1e3,VIDEO_INSPECT_QUALITY_RATIO:.9,VIDEO_INSPECT_WORKER_MANAGER_HOST:"edge.agora.io",VIDEO_INSPECT_WORKER_MANAGER_PORT:"",VIDEO_INSPECT_WORKER_PORT:"",SHOW_VIDEO_INSPECT_WORKER_MESSAGE:!1,STATS_COLLECTOR_PORT:443,FORCE_TURN_TCP:!1,SUBSCRIBE_AUDIO_FILTER_TOPN:void 0,ENABLE_PUBLISH_AUDIO_FILTER:void 0,DISABLE_FEC:void 0,WEBAUDIO_INIT_OPTIONS:void 0,FILTER_VIDEO_FEC:!0,FILTER_AUDIO_FEC:!1,CHROME_DUAL_STREAM_USE_ENCODING:!0,DISABLE_DUAL_STREAM_USE_ENCODING:!1,EXTENSION_USAGE_UPLOAD_INTERVAL:1e4,ICE_RESTART:!0,ICE_RESTART_INTERVAL:1e4,NEW_ICE_RESTART:!1,ENABLE_USER_LICENSE_CHECK:!0,SIGNAL_CHANNEL:0,TRANSMITTER_INITIAL_RTT:30,TRANSMITTER_INITIAL_RTO:30,TRANSMITTER_MAX_BATCH_ACK_COUNT:2,TRANSMITTER_MAX_RTO:500,DATACHANNEL_COMPRESS:!1,FINGERPRINT:null,DC_JOIN_WITH_FAILBACK:5e3,ENABLE_VIDEO_FRAME_CALLBACK:!0,VIDEO_FREEZE_DURATION:500,SPATIALIZER_PARAMETERS:{},UPLOAD_LOG_INTERVAL:3e3,UPLOAD_LOG_REQUEST_RETRY_INTERVAL:2e3,UPLOAD_LOG_REQUEST_MAX_RETRY_INTERVAL:2e4,UPLOAD_LOG_TRY_INTERVAL_WHILE_OFF:5e3,UPLOAD_LOG_RETRY_INTERVAL_V1:1e4,UPLOAD_LOG_TWICE_RETRY_INTERVAL_V1:200,UPLOAD_LOG_LENGTH_EACH_TIME:10,APP_TYPE:0,DISABLE_WEBAUDIO:!1,CHANNEL_MEDIA_RELAY_SERVERS:void 0,KEEP_LAST_FRAME:!0,FORWARD_P2P_CREATION:!0,SYNC_GROUP:!0,BLOCK_LOCAL_CLIENT:!1,AP_AREA:!0,SVC:[],ENABLE_ENCODED_TRANSFORM:!1,ENABLE_VIDEO_SEI:!1,IMAGE_MODERATION_WORKER_HOST:"edge.agora.io",IMAGE_MODERATION_WORKER_MESSAGE_LENGTH_LIMIT:3e5,IMAGE_MODERATION_INTERVAL_MINIMUM:1e3,SHOW_IMAGE_MODERATION_WORKER_MESSAGE:!1,IMAGE_MODERATION_QUALITY_RATIO:.9,IMAGE_MODERATION_UPLOAD_REPORT_INTERVAL:5e3,SHOW_GLOBAL_CLIENT_LIST:!1,ENABLE_DATASTREAM_2:!1,DATASTREAM_MAX_RETRANSMITS:10,ENABLE_USER_AUTO_REBALANCE_CHECK:!0,ENABLE_INSTANT_VIDEO:!1,ENABLE_NTP_REPORT:!1,TCP_CANDIDATE_ONLY:!1,EXTERNAL_SIGNAL_REQUEST_TIMEOUT:3e3,SHOW_P2P_LOG:!1,MAX_P2P_TIMEOUT:3e4,P2P_TOKEN_INTERVAL:1e3,SHOW_DATASTREAM2_LOG:!1,RESTRICTION_SET_PLAYBACK_DEVICE:!0,USE_PURE_ENCRYPTION_MASTER_KEY:!1,ACCOUNT_REGISTER_RETRY_TIMEOUT:1,ACCOUNT_REGISTER_RETRY_RATIO:2,ACCOUNT_REGISTER_RETRY_TIMEOUT_MAX:6e4,ACCOUNT_REGISTER_RETRY_COUNT_MAX:1e5,AUDIO_CONTEXT:null,WEBCS_BACKUP_CONNECT_TIMEOUT:6e3,PLAYER_STATE_DEFER:2e3,SIGNAL_REQUEST_WATCH_INTERVAL:1e3,FILEPATH_LENMAX:255,DUALSTREAM_OPERATION_CHECK:!0,MEDIA_ELEMENT_EXISTS_DEPTH:3,SHIM_CANDIDATE:!1,LEAVE_MSG_TIMEOUT:2e3,STATS_FILTER:{transportId:!0,googTrackId:!0},FILTER_VIDEO_CODEC:[],USE_NEW_NETWORK_CONFIG:!1,AUTO_RESET_AUDIO_ROUTE:!1,PLUGIN_INFO:[],OVERUSE_DETECTOR_PARAMS:KH,ENABLE_AG_ADAPTATION:!0,FORCE_AG_HIGH_FRAMERATE:!1,FORCE_SUPPORT_AG_ADAPTATION:!1,CUSTOM_ADAPTATION_DEFAULT_MODE:"",ENCODER_CONFIG_LIMIT:{},CAMERA_CAPTURE_CONFIG:void 0,HIDE_NO_POSTER:!1,AP_CACHE_NUM:10,AP_UPDATE_INTERVAL:12e4,AP_CACHE_LIFETIME:12e4,MAX_PRELOAD_ASYNC_LENGTH:3,ENABLE_PRELOAD:!0};function Ri(r,a,o){var c,f,m;Tt(c=Object.keys(es)).call(c,r)&&(!o&&Tt(f=Object.keys(x0)).call(f,r)||(es[r]=a,r==="ENABLE_VIDEO_SEI"&&a===!0&&(es.ENABLE_ENCODED_TRANSFORM=!0),r==="USE_NEW_NETWORK_CONFIG"&&a&&(m=!!a,es.USE_NEW_NETWORK_CONFIG=m,m&&(es.WEBCS_DOMAIN=["webrtc2-2.ap.sd-rtn.com"],es.WEBCS_DOMAIN_BACKUP_LIST=["webrtc2-4.ap.sd-rtn.com"],es.CDS_AP=["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],es.ACCOUNT_REGISTER=["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],es.EVENT_REPORT_DOMAIN="web-2.statscollector.sd-rtn.com",es.EVENT_REPORT_BACKUP_DOMAIN="statscollector-1.agora.io",es.GATEWAY_DOMAINS=["edge.sd-rtn.com"]))))}function ve(r){return es[r]}let x0={};var Bn=function(r){return r.SET_SESSION_ID="SET_SESSION_ID",r.SET_P2P_ID="SET_P2P_id",r.SET_DC_ID="SET_DC_id",r.SET_UID="SET_UID",r.SET_INT_UID="SET_INT_UID",r.SET_PUB_ID="SET_PUB_ID",r.SET_CLOUD_PROXY_SERVER_MODE="SET_CLOUD_PROXY_SERVER_MODE",r.KEY_METRIC_CLIENT_CREATED="KEY_METRIC_CLIENT_CREATED",r.KEY_METRIC_JOIN_START="KEY_METRIC_JOIN_START",r.AVOID_JOIN_START="AVOID_JOIN_START",r.KEY_METRIC_JOIN_END="KEY_METRIC_JOIN_END",r.KEY_METRIC_REQUEST_AP_START="KEY_METRIC_REQUEST_AP_START",r.KEY_METRIC_REQUEST_AP_END="KEY_METRIC_REQUEST_AP_END",r.KEY_METRIC_JOIN_GATEWAY_START="KEY_METRIC_JOIN_GATEWAY_START",r.KEY_METRIC_JOIN_GATEWAY_END="KEY_METRIC_JOIN_GATEWAY_END",r.KEY_METRIC_PEER_CONNECTION_START="KEY_METRIC_PEER_CONNECTION_START",r.KEY_METRIC_PEER_CONNECTION_END="KEY_METRIC_PEER_CONNECTION_END",r.KEY_METRIC_DESCRIPTION_START="KEY_METRIC_DESCRIPTION_START",r.KEY_METRIC_ICE_CONNECTION_END="KEY_METRIC_ICE_CONNECTION_END",r.KEY_METRIC_SIGNAL_CHANNEL_OPEN="KEY_METRIC_SIGNAL_CHANNEL_OPEN",r.KEY_METRIC_PUBLISH="KEY_METRIC_PUBLISH",r.KEY_METRIC_SUBSCRIBE="KEY_METRIC_SUBSCRIBE",r.RECORD_JOIN_CHANNEL_SERVICE="RECORD_JOIN_CHANNEL_SERVICE",r.RESET_JOIN_CHANNEL_SERVICE_RECORDS="RESET_JOIN_CHANNEL_SERVICE_RECORDS",r.RESET_KEY_METRICS="RESET_KEY_METRICS",r.SET_USE_DATACHANNEL="SET_USE_DATACHANNEL",r.SET_USE_P2P="SET_USE_P2P",r.SET_TRANSPORT_TYPE="SET_TRANSPORT_TYPE",r}(Bn||{});class cxe{constructor(a,o,c,f){Zi(this,"state",void 0),this.state={codec:a,audioCodec:o,mode:c,clientId:f,sessionId:null,p2pId:0,dcId:0,pubId:0,subId:0,avoidJoinStart:0,keyMetrics:{publish:[],subscribe:[]},joinChannelServiceRecords:[],cloudProxyServerMode:"disabled",useDataChannel:!1,useP2P:!1,p2pTransport:Gy.Default}}dispatch(a){this.state=function(o,c){switch(c.type){case Bn.SET_SESSION_ID:return Kt(Kt({},o),{},{sessionId:c.sessionId});case Bn.SET_P2P_ID:return Kt(Kt({},o),{},{p2pId:c.p2pId});case Bn.SET_UID:return Kt(Kt({},o),{},{uid:c.uid});case Bn.SET_INT_UID:return Kt(Kt({},o),{},{intUid:c.intUid});case Bn.SET_PUB_ID:return Kt(Kt({},o),{},{pubId:c.pubId});case Bn.KEY_METRIC_CLIENT_CREATED:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{clientCreated:c.metric})});case Bn.KEY_METRIC_JOIN_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinStart:c.metric})});case Bn.AVOID_JOIN_START:return Kt(Kt({},o),{},{avoidJoinStart:c.avoidJoinStart});case Bn.KEY_METRIC_JOIN_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinEnd:c.metric})});case Bn.KEY_METRIC_REQUEST_AP_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{requestAPStart:c.metric})});case Bn.KEY_METRIC_REQUEST_AP_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{requestAPEnd:c.metric})});case Bn.KEY_METRIC_JOIN_GATEWAY_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinGatewayStart:c.metric})});case Bn.KEY_METRIC_JOIN_GATEWAY_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{joinGatewayEnd:c.metric})});case Bn.KEY_METRIC_PEER_CONNECTION_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{peerConnectionStart:c.metric})});case Bn.KEY_METRIC_PEER_CONNECTION_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{peerConnectionEnd:c.metric})});case Bn.KEY_METRIC_DESCRIPTION_START:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{descriptionStart:c.metric})});case Bn.KEY_METRIC_SIGNAL_CHANNEL_OPEN:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{signalChannelOpen:c.metric})});case Bn.KEY_METRIC_ICE_CONNECTION_END:return Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{iceConnectionEnd:c.metric})});case Bn.KEY_METRIC_PUBLISH:{let f=o.keyMetrics.publish,m=f.findIndex(v=>v.trackId===c.metric.trackId);return m!==-1?(f[m]=Kt(Kt({},f[m]),c.metric),Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{publish:[...f]})})):Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{publish:[...o.keyMetrics.publish,c.metric]})})}case Bn.KEY_METRIC_SUBSCRIBE:{let f=o.keyMetrics.subscribe,m=f.findIndex(v=>v.userId===c.metric.userId&&v.type===c.metric.type);return m!==-1?(f[m]=Kt(Kt({},f[m]),c.metric),Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{subscribe:[...f]})})):Kt(Kt({},o),{},{keyMetrics:Kt(Kt({},o.keyMetrics),{},{subscribe:[...o.keyMetrics.subscribe,c.metric]})})}case Bn.SET_CLOUD_PROXY_SERVER_MODE:return o.cloudProxyServerMode=c.mode,o;case Bn.RECORD_JOIN_CHANNEL_SERVICE:return typeof c.index!="number"?o.joinChannelServiceRecords=[...o.joinChannelServiceRecords,c.record]:(o.joinChannelServiceRecords[c.index]=Kt(Kt({},o.joinChannelServiceRecords[c.index]),c.record),o.joinChannelServiceRecords=[...o.joinChannelServiceRecords]),o;case Bn.RESET_JOIN_CHANNEL_SERVICE_RECORDS:return o.joinChannelServiceRecords=[],o;case Bn.RESET_KEY_METRICS:return o.keyMetrics={publish:[],subscribe:[]},o;case Bn.SET_USE_DATACHANNEL:return Kt(Kt({},o),{},{useDataChannel:c.val});case Bn.SET_USE_P2P:return Kt(Kt({},o),{},{useP2P:c.val});case Bn.SET_TRANSPORT_TYPE:return Kt(Kt({},o),{},{p2pTransport:c.val});default:return o}}(this.state,a)}set sessionId(a){this.dispatch({type:Bn.SET_SESSION_ID,sessionId:a})}get sessionId(){return this.state.sessionId}set codec(a){this.state.codec=a}get codec(){return this.state.codec}get mode(){return this.state.mode}get audioCodec(){return this.state.audioCodec}get clientId(){return this.state.clientId}set p2pId(a){this.dispatch({type:Bn.SET_P2P_ID,p2pId:a})}get p2pId(){return this.state.p2pId}set dcId(a){this.dispatch({type:Bn.SET_DC_ID,dcId:a})}get dcId(){return this.state.dcId}set uid(a){this.dispatch({type:Bn.SET_UID,uid:a})}get uid(){return this.state.uid}set intUid(a){this.dispatch({type:Bn.SET_INT_UID,intUid:a})}get intUid(){return this.state.intUid}set pubId(a){this.dispatch({type:Bn.SET_PUB_ID,pubId:a})}get pubId(){return this.state.pubId}set cloudProxyServerMode(a){this.dispatch({type:Bn.SET_CLOUD_PROXY_SERVER_MODE,mode:a})}get cloudProxyServerMode(){return this.state.cloudProxyServerMode}set useDataChannel(a){this.dispatch({type:Bn.SET_USE_DATACHANNEL,val:a})}get useDataChannel(){return this.state.useDataChannel}set useP2P(a){this.dispatch({type:Bn.SET_USE_P2P,val:a})}get useP2P(){return this.state.useP2P}set p2pTransport(a){this.dispatch({type:Bn.SET_TRANSPORT_TYPE,val:a})}get p2pTransport(){return this.state.p2pTransport}clientCreated(){this.dispatch({type:Bn.KEY_METRIC_CLIENT_CREATED,metric:Date.now()})}joinStart(){this.dispatch({type:Bn.KEY_METRIC_JOIN_START,metric:Date.now()})}joinEnd(){this.dispatch({type:Bn.KEY_METRIC_JOIN_END,metric:Date.now()})}requestAPStart(){this.dispatch({type:Bn.KEY_METRIC_REQUEST_AP_START,metric:Date.now()})}requestAPEnd(){this.dispatch({type:Bn.KEY_METRIC_REQUEST_AP_END,metric:Date.now()})}joinGatewayStart(){this.dispatch({type:Bn.KEY_METRIC_JOIN_GATEWAY_START,metric:Date.now()})}joinGatewayEnd(){this.dispatch({type:Bn.KEY_METRIC_JOIN_GATEWAY_END,metric:Date.now()})}peerConnectionStart(){this.dispatch({type:Bn.KEY_METRIC_PEER_CONNECTION_START,metric:Date.now()})}peerConnectionEnd(){this.dispatch({type:Bn.KEY_METRIC_PEER_CONNECTION_END,metric:Date.now()})}descriptionStart(){this.dispatch({type:Bn.KEY_METRIC_DESCRIPTION_START,metric:Date.now()})}signalChannelOpen(){this.dispatch({type:Bn.KEY_METRIC_SIGNAL_CHANNEL_OPEN,metric:Date.now()})}iceConnectionEnd(){this.dispatch({type:Bn.KEY_METRIC_ICE_CONNECTION_END,metric:Date.now()})}publish(a,o,c,f){this.dispatch({type:Bn.KEY_METRIC_PUBLISH,metric:Kt(Kt({trackId:a,type:o},c&&{publishStart:c}),f&&{publishEnd:f})})}subscribe(a,o,c,f,m,v,w){this.dispatch({type:Bn.KEY_METRIC_SUBSCRIBE,metric:Kt(Kt(Kt(Kt(Kt({userId:a,type:o},c&&{subscribeStart:c}),f&&{subscribeEnd:f}),m&&{firstFrame:m}),v&&{streamAdded:v}),w&&{firstDecoded:w})})}massSubscribe(a,o,c,f){a.forEach(m=>{this.dispatch({type:Bn.KEY_METRIC_SUBSCRIBE,metric:Kt(Kt(Kt({userId:m.userId,type:m.type},o&&{subscribeStart:o}),c&&{subscribeEnd:c}),f&&{firstFrame:f})})})}get keyMetrics(){return this.state.keyMetrics}recordJoinChannelService(a,o){a.service==="gateway"&&Array.isArray(a.urls)&&(a.urls=a.urls.map(c=>c.replace(/(\d+)-\d+-\d+-(\d+)/,"$1-*-*-$2")));try{return typeof o!="number"?(this.dispatch({type:Bn.RECORD_JOIN_CHANNEL_SERVICE,record:Kt(Kt({},a),{},{sessionId:this.sessionId,cloudProxyMode:this.cloudProxyServerMode,uid:this.uid})}),this.state.joinChannelServiceRecords.length-1):(o<0||o>=this.state.joinChannelServiceRecords.length||this.dispatch({type:Bn.RECORD_JOIN_CHANNEL_SERVICE,record:a,index:o}),o)}catch{return 0}}resetJoinChannelServiceRecords(){this.dispatch({type:Bn.RESET_JOIN_CHANNEL_SERVICE_RECORDS})}resetKeyMetrics(){this.dispatch({type:Bn.RESET_KEY_METRICS})}get joinChannelServiceRecords(){try{return this.state.joinChannelServiceRecords}catch{return[]}}get avoidJoinStart(){return this.state.avoidJoinStart}set avoidJoinStart(a){this.dispatch({type:Bn.AVOID_JOIN_START,avoidJoinStart:a})}}let VS=function(r){return r.h264="h264",r.h265="h265",r.vp8="vp8",r.vp9="vp9",r.av1="av1",r}({});(function(r){r.opus="opus",r.pcma="pcma",r.pcmu="pcmu",r.g722="g722"})({});let iie=128,dxe=96,rie=1e3,zS=10,uxe=0;function sie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Ln(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?sie(Object(o),!0).forEach(function(c){Ar(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):sie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Ar(r,a,o){return(a=function(c){var f=function(m,v){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var C=w.call(m,"string");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}let aie=new class extends nr{constructor(){super(...arguments),Ar(this,"currentUploadLogID",0)}reportLogUploadError(r){let{errorRange:a}=r;a[a.length-1]&&a[a.length-1]>this.currentUploadLogID&&(this.currentUploadLogID=a[a.length-1],this.emit("REPORT_LOG_UPLOAD",r))}};class hxe{constructor(a){Ar(this,"logger",void 0),Ar(this,"prefixLists",[]),this.logger=a}debug(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.debug(...this.prefixLists,...o)}info(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.info(...this.prefixLists,...o)}warning(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.warning(...this.prefixLists,...o)}error(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];this.logger.error(...this.prefixLists,...o)}prefix(a){return this.prefixLists.push(a),this}popPrefix(){return this.prefixLists.pop(),this}}function YH(){let r=new Date;return r.toTimeString().split(" ")[0]+":"+r.getMilliseconds()}function oie(){let r=new Date,a=/((\d+:){2}\d+)/.exec(new Date().toUTCString());return a?(a==null?void 0:a[0])+":"+r.getUTCMilliseconds():r.toTimeString().split(" ")[0]+":"+r.getMilliseconds()}let ud={DEBUG:0,INFO:1,WARNING:2,ERROR:3,NONE:4},B8=Date.now(),g3=r=>{for(let a in ud)if(Object.prototype.hasOwnProperty.call(ud,a)&&ud[a]===r)return a;return"DEFAULT"},z=new class{constructor(){Ar(this,"proxyServerURL",void 0),Ar(this,"logLevel",ud.DEBUG),Ar(this,"uploadState","collecting"),Ar(this,"uploadLogWaitingList",[]),Ar(this,"uploadLogUploadingList",[]),Ar(this,"uploadErrorCount",0),Ar(this,"currentLogID",0),Ar(this,"url",void 0),Ar(this,"extLog",(r,a)=>{this.appendLogToWaitingList(r,...a)})}debug(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[ud.DEBUG].concat(a);this.log.apply(this,c)}info(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[ud.INFO].concat(a);this.log.apply(this,c)}warning(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[ud.WARNING].concat(a);this.log.apply(this,c)}warn(){this.warning(...arguments)}error(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[ud.ERROR].concat(a);this.log.apply(this,c)}upload(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];let c=[ud.DEBUG].concat(a);this.uploadLog.apply(this,c)}setLogLevel(r){r=Math.min(Math.max(0,r),4),this.logLevel=r}enableLogUpload(){Ri("UPLOAD_LOG",!0)}disableLogUpload(){Ri("UPLOAD_LOG",!1),this.uploadLogUploadingList=[],this.uploadLogWaitingList=[]}setProxyServer(r){this.proxyServerURL=r}prefix(r){return new hxe(this).prefix(r)}log(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(Date.now()-B8<100)return void setTimeout(()=>{this.log(...a)},Date.now()-B8);let c=Math.max(0,Math.min(4,a[0]));if(a[0]=YH()+" Agora-SDK [".concat(g3(c),"]:"),this.appendLogToWaitingList(c,...a),c<this.logLevel)return;let f=YH()+" %cAgora-SDK [".concat(g3(c),"]:"),m=[];if(!ve("USE_NEW_LOG"))switch(c){case ud.DEBUG:m=[f,"color: #64B5F6;"].concat(a.slice(1)),console.log.apply(console,m);break;case ud.INFO:m=[f,"color: #1E88E5; font-weight: bold;"].concat(a.slice(1)),console.log.apply(console,m);break;case ud.WARNING:m=[f,"color: #FB8C00; font-weight: bold;"].concat(a.slice(1)),console.warn.apply(console,m);break;case ud.ERROR:m=[f,"color: #B00020; font-weight: bold;"].concat(a.slice(1)),console.error.apply(console,m)}}uploadLog(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(Date.now()-B8<100)return void setTimeout(()=>{this.uploadLog(...a)},Date.now()-B8);let c=Math.max(0,Math.min(4,a[0]));a[0]=YH()+" Agora-SDK [".concat(g3(c),"]:"),this.appendLogToWaitingList(c,...a)}appendLogToWaitingList(r){if(!ve("UPLOAD_LOG"))return;for(var a=arguments.length,o=new Array(a>1?a-1:0),c=1;c<a;c++)o[c-1]=arguments[c];Array.isArray(o[0])?o[0][0]=oie()+" Agora-SDK [".concat(g3(r),"]:"):o[0]=oie()+" Agora-SDK [".concat(g3(r),"]:");let f="";o.forEach(m=>{typeof m=="object"&&(m=JSON.stringify(m)),f+="".concat(m," ")}),this.uploadLogWaitingList.push({payload_str:f,log_level:r,log_item_id:this.currentLogID++}),this.uploadState==="uploading"&&this.uploadLogUploadingList.length===0&&this.uploadLogInterval()}startUpload(){this.uploadState="uploading",this.uploadLogUploadingList.length===0&&this.uploadLogInterval()}async uploadLogs(){let r=this.uploadLogUploadingList,a={sdk_version:dd,process_id:ve("PROCESS_ID"),payload:JSON.stringify(r)};return wh(async()=>{let o=await Io.post(this.url||(this.proxyServerURL?"https://".concat(this.proxyServerURL,"/ls/?h=").concat(ve("LOG_UPLOAD_SERVER"),"&p=443&d=upload/v1"):"https://".concat(ve("LOG_UPLOAD_SERVER"),"/upload/v1")),a,{responseType:"text"});if(o.data!=="OK"){let c=new Error("unexpected upload log response");throw c.response=o,c}},()=>(this.uploadLogUploadingList=[],!1),o=>{let c={status:-1,message:o.message,errorRange:r.map(f=>f.log_item_id)};return o.response?(c.status=o.response.status,c.data=o.response.data,c.headers=o.response.headers):o.request&&(c.status=o.request.status),aie.reportLogUploadError(c),!0},{timeout:ve("UPLOAD_LOG_REQUEST_RETRY_INTERVAL"),maxRetryTimeout:ve("UPLOAD_LOG_REQUEST_MAX_RETRY_INTERVAL")})}uploadLogInterval(){this.uploadLogUploadingList.length===0&&this.uploadLogWaitingList.length===0||(this.uploadLogUploadingList.length===0&&(this.uploadLogUploadingList=this.uploadLogWaitingList.splice(0,ve("UPLOAD_LOG_LENGTH_EACH_TIME"))),this.uploadLogs().then(()=>{this.uploadErrorCount=0,this.uploadLogWaitingList.length>0&&window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_INTERVAL"))}).catch(r=>{this.uploadErrorCount+=1,this.uploadErrorCount<2?window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_TWICE_RETRY_INTERVAL_V1")):window.setTimeout(()=>this.uploadLogInterval(),ve("UPLOAD_LOG_RETRY_INTERVAL_V1"))}))}};var lie;function fxe(r){return Ms(r.reportId,"params.reportId",0,100,!1),Ms(r.category,"params.category",0,100,!1),Ms(r.event,"params.event",0,100,!1),Ms(r.label,"params.label",0,100,!1),Ti(r.value,"params.value",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,!1),!0}(lie={}).FREE="free",lie.UPLOADING="uploading",function(r){r[r.MISC=0]="MISC",r[r.INTERNAL_EVENT=1]="INTERNAL_EVENT",r[r.PUBLIC_EVENT=2]="PUBLIC_EVENT",r[r.WEB_EVENT=3]="WEB_EVENT",r[r.INTERNAL_API=4]="INTERNAL_API",r[r.WEB_API=5]="WEB_API",r[r.PUBLIC_API=6]="PUBLIC_API"}({});let pxe={sid:"",lts:0,success:null,cname:null,uid:null,peer:null,cid:null,elapse:null,extend:null,vid:0},Rs=function(r){return r.PUBLISH="publish",r.SUBSCRIBE="subscribe",r.WS_COMPRESSOR_INIT="ws_compressor_init",r.SESSION_INIT="session_init",r.JOIN_CHOOSE_SERVER="join_choose_server",r.REQ_USER_ACCOUNT="req_user_account",r.JOIN_GATEWAY="join_gateway",r.REJOIN_GATEWAY="rejoin_gateway",r.STREAM_SWITCH="stream_switch",r.REQUEST_PROXY_WORKER_MANAGER="request_proxy_worker_manager",r.REQUEST_PROXY_APPCENTER="request_proxy_appcenter",r.FIRST_VIDEO_RECEIVED="first_video_received",r.FIRST_AUDIO_RECEIVED="first_audio_received",r.FIRST_VIDEO_DECODE="first_video_decode",r.FIRST_AUDIO_DECODE="first_audio_decode",r.ON_ADD_AUDIO_STREAM="on_add_audio_stream",r.ON_ADD_VIDEO_STREAM="on_add_video_stream",r.ON_UPDATE_STREAM="on_update_stream",r.ON_REMOVE_STREAM="on_remove_stream",r.USER_ANALYTICS="req_user_analytics",r.PC_STATS="pc_stats",r.UPDATE_REMOTE_RTPCAPABILITIES="update_remote_rtpCapabilities",r}({}),fr=function(r){return r.SESSION="io.agora.pb.Wrtc.Session",r.JOIN_CHOOSE_SERVER="io.agora.pb.Wrtc.JoinChooseServer",r.REQ_USER_ACCOUNT="io.agora.pb.Wrtc.ReqUserAccount",r.JOIN_GATEWAY="io.agora.pb.Wrtc.JoinGateway",r.RE_JOIN_GATEWAY="io.agora.pb.Wrtc.ReJoinGateway",r.PUBLISH="io.agora.pb.Wrtc.Publish",r.SUBSCRIBE="io.agora.pb.Wrtc.Subscribe",r.WS_COMPRESSOR_INIT="io.agora.pb.Wrtc.WsCompressorInit",r.STREAM_SWITCH="io.agora.pb.Wrtc.StreamSwitch",r.AUDIO_SENDING_STOPPED="io.agora.pb.Wrtc.AudioSendingStopped",r.VIDEO_SENDING_STOPPED="io.agora.pb.Wrtc.VideoSendingStopped",r.REQUEST_PROXY_APPCENTER="io.agora.pb.Wrtc.RequestProxyAppCenter",r.REQUEST_PROXY_WORKER_MANAGER="io.agora.pb.Wrtc.RequestProxyWorkerManager",r.API_INVOKE="io.agora.pb.Wrtc.ApiInvoke",r.FIRST_VIDEO_RECEIVED="io.agora.pb.Wrtc.FirstVideoReceived",r.FIRST_AUDIO_RECEIVED="io.agora.pb.Wrtc.FirstAudioReceived",r.FIRST_VIDEO_DECODE="io.agora.pb.Wrtc.FirstVideoDecode",r.FIRST_AUDIO_DECODE="io.agora.pb.Wrtc.FirstAudioDecode",r.ON_ADD_AUDIO_STREAM="io.agora.pb.Wrtc.OnAddAudioStream",r.ON_ADD_VIDEO_STREAM="io.agora.pb.Wrtc.OnAddVideoStream",r.ON_UPDATE_STREAM="io.agora.pb.Wrtc.OnUpdateStream",r.ON_REMOVE_STREAM="io.agora.pb.Wrtc.OnRemoveStream",r.JOIN_CHANNEL_TIMEOUT="io.agora.pb.Wrtc.JoinChannelTimeout",r.PEER_PUBLISH_STATUS="io.agora.pb.Wrtc.PeerPublishStatus",r.WORKER_EVENT="io.agora.pb.Wrtc.WorkerEvent",r.AP_WORKER_EVENT="io.agora.pb.Wrtc.APWorkerEvent",r.JOIN_WEB_PROXY_AP="io.agora.pb.Wrtc.JoinWebProxyAP",r.WEBSOCKET_QUIT="io.agora.pb.Wrtc.WebSocketQuit",r.USER_ANALYTICS="io.agora.pb.Wrtc.UserAnalytics",r.AUTOPLAY_FAILED="io.agora.pb.Wrtc.AutoplayFailed",r.PC_STATS="io.agora.pb.Wrtc.PCStats",r.UPDATE_REMOTE_RTPCAPABILITIES="io.agora.pb.Wrtc.UpdateRemoteRTPCapabilities",r}({});(function(r){r[r.WORKER_EVENT=156]="WORKER_EVENT",r[r.AP_WORKER_EVENT=160]="AP_WORKER_EVENT"})({}),function(r){r[r.SESSION=26]="SESSION",r[r.JOIN_CHOOSE_SERVER=27]="JOIN_CHOOSE_SERVER",r[r.REQ_USER_ACCOUNT=196]="REQ_USER_ACCOUNT",r[r.JOIN_GATEWAY=28]="JOIN_GATEWAY",r[r.PUBLISH=30]="PUBLISH",r[r.SUBSCRIBE=29]="SUBSCRIBE",r[r.WS_COMPRESSOR_INIT=9430]="WS_COMPRESSOR_INIT",r[r.STREAM_SWITCH=32]="STREAM_SWITCH",r[r.AUDIO_SENDING_STOPPED=33]="AUDIO_SENDING_STOPPED",r[r.VIDEO_SENDING_STOPPED=34]="VIDEO_SENDING_STOPPED",r[r.REQUEST_PROXY_APPCENTER=35]="REQUEST_PROXY_APPCENTER",r[r.REQUEST_PROXY_WORKER_MANAGER=36]="REQUEST_PROXY_WORKER_MANAGER",r[r.API_INVOKE=41]="API_INVOKE",r[r.FIRST_VIDEO_RECEIVED=348]="FIRST_VIDEO_RECEIVED",r[r.FIRST_AUDIO_RECEIVED=349]="FIRST_AUDIO_RECEIVED",r[r.FIRST_VIDEO_DECODE=350]="FIRST_VIDEO_DECODE",r[r.FIRST_AUDIO_DECODE=351]="FIRST_AUDIO_DECODE",r[r.ON_ADD_AUDIO_STREAM=352]="ON_ADD_AUDIO_STREAM",r[r.ON_ADD_VIDEO_STREAM=353]="ON_ADD_VIDEO_STREAM",r[r.ON_UPDATE_STREAM=356]="ON_UPDATE_STREAM",r[r.ON_REMOVE_STREAM=355]="ON_REMOVE_STREAM",r[r.JOIN_CHANNEL_TIMEOUT=407]="JOIN_CHANNEL_TIMEOUT",r[r.PEER_PUBLISH_STATUS=408]="PEER_PUBLISH_STATUS",r[r.WORKER_EVENT=156]="WORKER_EVENT",r[r.AP_WORKER_EVENT=160]="AP_WORKER_EVENT",r[r.JOIN_WEB_PROXY_AP=700]="JOIN_WEB_PROXY_AP",r[r.WEBSOCKET_QUIT=671]="WEBSOCKET_QUIT",r[r.USER_ANALYTICS=1e4]="USER_ANALYTICS",r[r.AUTOPLAY_FAILED=9178]="AUTOPLAY_FAILED"}({});class v3{constructor(){Ar(this,"baseInfoMap",new Map),Ar(this,"proxyServer",void 0),Ar(this,"eventUploadTimer",void 0),Ar(this,"setSessionIdTimer",void 0),Ar(this,"url",void 0),Ar(this,"backupUrl",void 0),Ar(this,"_appId",void 0),Ar(this,"keyEventUploadPendingItems",[]),Ar(this,"normalEventUploadPendingItems",[]),Ar(this,"apiInvokeUploadPendingItems",[]),Ar(this,"apiInvokeCount",0),Ar(this,"ltsList",[]),Ar(this,"lastSendNormalEventTime",Date.now()),Ar(this,"customReportCounterTimer",void 0),Ar(this,"customReportCount",0),Ar(this,"extApiInvoke",async a=>{for(let o of a){let c=Ln(Ln({},o),{},{sid:null,invokeId:++this.apiInvokeCount,tag:vr.TRACER});this.sendApiInvoke(c)}}),this.eventUploadTimer=window.setInterval(this.doSend.bind(this),ve("EVENT_REPORT_SEND_INTERVAL")),this.setSessionIdTimer=window.setInterval(this.appendSessionId.bind(this),ve("EVENT_REPORT_SEND_INTERVAL"))}getBaseInfoBySessionId(a){return this.baseInfoMap.get(a)}adjustSessionStartTime(a){if(!this.baseInfoMap.has(a)&&!this.baseInfoMap.get(a))return void z.error("adjust session ".concat(a," start time, sid is not exist or info is undefined"));let o=this.baseInfoMap.get(a),c=Date.now(),f=o.startTime;o.startTime=c,z.debug("rewrite session ".concat(a," startTime: ").concat(c," , ").concat(c-f,"ms")),this.baseInfoMap.set(a,o)}setAppId(a){this._appId=a}reportApiInvoke(a,o,c){o.timeout=o.timeout||6e4,o.reportResult=o.reportResult===void 0||o.reportResult;let f=Date.now();this.apiInvokeCount+=1;let m=this.apiInvokeCount,v=()=>({tag:o.tag,invokeId:m,sid:a,name:o.name,apiInvokeTime:f,options:o.options,states:o.states||null}),w=!!ve("SHOW_REPORT_INVOKER_LOG");w&&z.info("".concat(o.name," start"),o.options);let C=!1;vs(o.timeout).then(()=>{C||(this.sendApiInvoke(Ln(Ln({},v()),{},{error:ce.API_INVOKE_TIMEOUT,success:!1})),z.debug("".concat(o.name," timeout")))});let R=new Ke(ce.UNEXPECTED_ERROR,"".concat(o.name,": this api invoke is end"));return{onSuccess:x=>{let L=()=>{if(C)throw R;return C=!0,this.sendApiInvoke(Ln(Ln({},v()),{},{success:!0},o.reportResult&&{result:x})),w&&z.info("".concat(o.name," onSuccess")),x};return c?Qne(L,o.name+"Success",c,()=>C=!0):L()},onError:x=>{let L=()=>{if(C)throw x;C=!0,this.sendApiInvoke(Ln(Ln({},v()),{},{success:!1,error:x})),w&&z.info("".concat(o.name," onFailure"),x.toString())};return c?Qne(L,o.name+"Error",c,()=>C=!0):L()}}}sessionInit(a,o){if(this.baseInfoMap.has(a))return;let c=Date.now(),f=this.createBaseInfo(a,c);f.cname=o.cname;let m=Object.assign({},{willUploadConsoleLog:ve("UPLOAD_LOG"),maxTouchPoints:navigator.maxTouchPoints,areaVersion:$H?"global":"oversea",areas:ve("AREAS")&&ve("AREAS").join(",")},o.extend),{stringUid:v,channelProfile:w,channelMode:C,isABTestSuccess:R,lsid:x,clientRole:L}=o,U=Date.now(),F=Ln(Ln({},f),{},{eventType:Rs.SESSION_INIT,appid:o.appid,browser:navigator.userAgent,buildFormat:o.buildFormat,build:qH,lts:U,elapse:U-c,extend:JSON.stringify(m),mode:o.mode,process:ve("PROCESS_ID"),appType:ve("APP_TYPE"),success:!0,version:dd,stringUid:v,channelProfile:w,channelMode:C,isABTestSuccess:R,lsid:x,clientType:20,clientRole:L,serviceId:ve("PROCESS_ID"),extensionID:ve("PLUGIN_INFO").join(",")||"",preload:o.preload?1:0});this.send({type:fr.SESSION,data:F},!0)}joinChooseServer(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.JOIN_CHOOSE_SERVER,lts:m,eventElapse:o.elapse||m-o.lts,chooseServerAddr:o.csAddr,errorCode:o.ec,elapse:m-c.startTime,success:o.succ,chooseServerAddrList:JSON.stringify(o.serverList),uid:o.uid?parseInt(o.uid):null,cid:o.cid?parseInt(o.cid):null,chooseServerIp:o.csIp||"",opid:o.opid,unilbsServerIds:o.unilbsServerIds,extend:o.extend||void 0,isHttp3:o.isHttp3});this.send({type:fr.JOIN_CHOOSE_SERVER,data:v},!0)}reqUserAccount(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.REQ_USER_ACCOUNT,lts:m,success:o.success,serverAddress:o.serverAddr,stringUid:o.stringUid,uid:o.uid,errorCode:o.errorCode,elapse:o.elapse||m-c.startTime,eventElapse:m-o.lts,extend:JSON.stringify(o.extend)});this.send({type:fr.REQ_USER_ACCOUNT,data:v},!0)}joinGateway(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info;o.vid&&(f.vid=o.vid),f.uid=o.uid,f.cid=o.cid;let m=Date.now(),{firstSuccess:v,avoidJoinStartTime:w,isProxy:C,addr:R}=o,x=m-(v&&w?w:c.startTime),L=Ln(Ln({},f),{},{eventType:Rs.JOIN_GATEWAY,lts:m,gatewayAddr:o.addr,success:o.succ,errorCode:o.ec,elapse:x,eventElapse:m-o.lts,firstSuccess:v,signalChannel:o.signalChannel}),U=L.success?1:0;if(o.succ&&(c.lastJoinSuccessTime=m),v)this.send({type:fr.JOIN_GATEWAY,data:L},!0);else{let F;if(R)if(C){let W=R.match(/h=(\d{1,3}-){3}\d{1,3}/g),K=R.match(/p=[0-9]{1,6}/g);F={isSuccess:U,gatewayIp:W&&W.length?W[0].split("=")[1].replace(/-/g,"."):"",port:K&&K.length?K[0].split("=")[1]:"",isProxy:C?1:0}}else{let W=R.match(/wss:\/\/(\d{1,3}-){3}\d{1,3}/g),K=R.match(/(:|p=)[0-9]{1,6}/g);F={isSuccess:U,gatewayIp:W&&W.length?W[0].split("//")[1].replace(/-/g,"."):"",port:K&&K.length?K[0].split(/:|p=/g)[1]:"",isProxy:C?1:0}}else F={isSuccess:U,gatewayIp:"",port:"",isProxy:C?1:0};delete L.success,delete L.eventType,delete L.firstSuccess,L.vid=Number(L.vid);let Z=Object.assign({},L,F,{eventType:Rs.REJOIN_GATEWAY});this.send({type:fr.RE_JOIN_GATEWAY,data:Z},!0)}}joinChannelTimeout(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=Date.now(),m=Ln(Ln({},c.info),{},{lts:f,timeout:o,elapse:f-c.startTime});this.send({type:fr.JOIN_CHANNEL_TIMEOUT,data:m},!0)}publish(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.PUBLISH,lts:m,eventElapse:o.eventElapse,elapse:m-c.startTime,success:o.succ,errorCode:o.ec,videoName:o.videoName,audioName:o.audioName,screenName:o.screenName,screenshare:o.screenshare,audio:o.audio,video:o.video,p2pid:o.p2pid,publishRequestid:o.publishRequestid});this.send({type:fr.PUBLISH,data:v},!0)}subscribe(a,o,c){let f=this.baseInfoMap.get(a);if(!f)return;let m=f.info,v=Date.now(),w=Ln(Ln({},m),{},{eventType:Rs.SUBSCRIBE,lts:v,eventElapse:o.eventElapse,elapse:v-f.startTime,success:o.succ,errorCode:o.ec,video:o.video,audio:o.audio,subscribeRequestid:o.subscribeRequestid,p2pid:o.p2pid},c&&{extend:JSON.stringify({isMassSubscribe:!0})});typeof o.peerid=="string"?w.peerSuid=o.peerid:w.peer=o.peerid,this.send({type:fr.SUBSCRIBE,data:w},!0)}wsCompressorInit(a){var o;let c=[...tl(o=this.baseInfoMap).call(o)],f=c.length?c[0]:"UnableToGetSid",m=this.baseInfoMap.get(f);if(!m)return;let v=m.info,w=Date.now(),C=Ln(Ln({},v),{},{eventType:Rs.WS_COMPRESSOR_INIT,lts:w,eventElapse:a.eventElapse,elapse:w-m.startTime,status:a.status?1:2});this.send({type:fr.WS_COMPRESSOR_INIT,data:C},!0)}firstRemoteVideoDecode(a,o,c,f){let m=this.baseInfoMap.get(a);if(!m)return;let v=m.info,w=Date.now(),C=Ln(Ln(Ln({},v),f),{},{elapse:w-m.startTime,eventType:o,lts:w,firstDecodeFrame:Math.max(w-m.startTime,0),apEnd:Math.max(f.apEnd-m.startTime,0),apStart:Math.max(f.apStart-m.startTime,0),joinGwEnd:Math.max(f.joinGwEnd-m.startTime,0),joinGwStart:Math.max(f.joinGwStart-m.startTime,0),pcEnd:Math.max(f.pcEnd-m.startTime,0),pcStart:Math.max(f.pcStart-m.startTime,0),subscriberEnd:Math.max(f.subscriberEnd-m.startTime,0),subscriberStart:Math.max(f.subscriberStart-m.startTime,0),videoAddNotify:Math.max(f.videoAddNotify-m.startTime,0)});this.send({type:c,data:C},!0)}firstRemoteFrame(a,o,c,f){let m=this.baseInfoMap.get(a);if(!m)return;let v=m.info,w=Date.now(),C=Ln(Ln(Ln({},v),f),{},{elapse:w-m.startTime,eventType:o,lts:w});this.send({type:c,data:C},!0)}pcStats(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln(Ln({},f),o),{},{vid:f.vid===void 0?0:Number(f.vid),elapse:m-c.startTime,eventType:Rs.PC_STATS,lts:m});this.send({type:fr.PC_STATS,data:v},!0)}updateRemoteRTPCapabilities(a,o){if(a){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln(Ln({},f),o),{},{vid:f.vid===void 0?0:Number(f.vid),eventType:Rs.UPDATE_REMOTE_RTPCAPABILITIES,lts:m});this.send({type:fr.UPDATE_REMOTE_RTPCAPABILITIES,data:v},!0)}}onGatewayStream(a,o,c,f){let m=this.baseInfoMap.get(a);if(!m)return;let v=m.info,w=Date.now(),C=Ln(Ln(Ln({},v),f),{},{eventType:o,lts:w});this.send({type:c,data:C},!0)}streamSwitch(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.STREAM_SWITCH,lts:m,isDual:o.isdual,elapse:m-c.startTime,success:o.succ});this.send({type:fr.STREAM_SWITCH,data:v},!0)}requestProxyAppCenter(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.REQUEST_PROXY_APPCENTER,lts:m,eventElapse:m-o.lts,elapse:m-c.startTime,APAddr:o.APAddr,workerManagerList:o.workerManagerList,response:o.response,errorCode:o.ec,success:o.succ});this.send({type:fr.REQUEST_PROXY_APPCENTER,data:v},!0)}requestProxyWorkerManager(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{eventType:Rs.REQUEST_PROXY_WORKER_MANAGER,lts:m,eventElapse:m-o.lts,elapse:m-c.startTime,workerManagerAddr:o.workerManagerAddr,response:o.response,errorCode:o.ec,success:o.succ});this.send({type:fr.REQUEST_PROXY_WORKER_MANAGER,data:v},!0)}setProxyServer(a){this.proxyServer=a,a?z.debug("reportProxyServerurl: ".concat(a)):z.debug("disable reportProxyServerurl: ".concat(a))}peerPublishStatus(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln({},f),{},{subscribeElapse:o.subscribeElapse,peer:o.peer,peerPublishDuration:Math.max(o.audioPublishDuration,o.videoPublishDuration),audiotag:o.audioPublishDuration>0?1:-1,videotag:o.videoPublishDuration>0?1:-1,lts:m,elapse:m-c.startTime,joinChannelSuccessElapse:m-(c.lastJoinSuccessTime||m),peerPublishDurationVideo:o.videoPublishDuration,peerPublishDurationAudio:o.audioPublishDuration});this.send({type:fr.PEER_PUBLISH_STATUS,data:v},!0)}workerEvent(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now();(function(v,w,C){let R=v[w];if(!R||typeof R!="string")return[v];v[w]="";let x=Df(JSON.stringify(v)),L=0,U=[],F=0;for(let Z=0;Z<R.length;Z++)F+=R.charCodeAt(Z)<=127?1:3,F<=C-x||(U[U.length]=Kt(Kt({},v),{},{[w]:R.substring(L,Z)}),L=Z,F=R.charCodeAt(Z)<=127?1:3);return L!==R.length-1&&(U[U.length]=Kt(Kt({},v),{},{[w]:R.substring(L)})),U})(Ln(Ln(Ln({},f),o),{},{elapse:m-c.startTime,lts:m,productType:"WebRTC"}),"payload",1300).forEach(v=>this.send({type:fr.WORKER_EVENT,data:v},!0))}apworkerEvent(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:m-c.startTime,lts:m});this.send({type:fr.AP_WORKER_EVENT,data:v},!0)}joinWebProxyAP(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:m-c.startTime,lts:m,extend:o.extend||void 0});this.send({type:fr.JOIN_WEB_PROXY_AP,data:v},!0)}WebSocketQuit(a,o){let c=this.baseInfoMap.get(a);if(!c)return;let f=c.info,m=Date.now(),v=Ln(Ln(Ln({},f),o),{},{elapse:m-c.startTime,lts:m});this.send({type:fr.WEBSOCKET_QUIT,data:v},!0)}async sendCustomReportMessage(a,o){if(this.customReportCount+=o.length,this.customReportCount>ve("CUSTOM_REPORT_LIMIT"))throw new Ke(ce.CUSTOM_REPORT_FREQUENCY_TOO_HIGH);this.customReportCounterTimer||(this.customReportCounterTimer=window.setInterval(()=>{this.customReportCount=0},5e3));let c=Date.now(),f=o.map(m=>({type:fr.USER_ANALYTICS,data:Ln(Ln({sid:a},m),{},{lts:c})}));try{ve("NEW_REPORT_SERVER")?await this.postDataToStatsCollector2(f):await this.postDataToStatsCollector(f)}catch(m){throw z.error("send custom report message failed",m.toString()),new Ke(ce.CUSTOM_REPORT_SEND_FAILED,m.message)}}sendApiInvoke(a){let o=ve("NOT_REPORT_EVENT");if(a.tag&&Tt(o)&&Tt(o).call(o,a.tag))return!1;if(a.sid===null)return this.apiInvokeUploadPendingItems.push(a),!1;let c=this.baseInfoMap.get(a.sid);if(!c)return this.apiInvokeUploadPendingItems.push(a),!1;let{cname:f,uid:m,cid:v}=c.info,w;if(a.lts=a.lts||Date.now(),a.error)if(a.error instanceof Ke){let{code:R,message:x}=a.error;w=R||x||a.error.toString()}else w=a.error.toString();let C={invokeId:a.invokeId,sid:a.sid,cname:f,cid:v,uid:m,lts:a.lts,success:a.success,elapse:a.lts-c.startTime,execElapse:a.lts-a.apiInvokeTime,apiName:a.name,options:a.options?JSON.stringify(a.options):void 0,execStates:a.states?JSON.stringify(a.states):void 0,execResult:a.result?JSON.stringify(a.result):void 0,errorCode:a.error?w:void 0,errorMsg:a.error?JSON.stringify(a.error):void 0};return this.send({type:fr.API_INVOKE,data:C},!1),!0}appendSessionId(){v3.__CLIENT_LIST__.forEach(a=>{if(a._sessionId){let o=this.apiInvokeUploadPendingItems.length;for(let c=0;c<o;c++){let f=this.apiInvokeUploadPendingItems.shift();f&&(f.sid=a._sessionId,this.sendApiInvoke(Object.assign({},f)))}}})}send(a,o){if(o)return this.keyEventUploadPendingItems.push(a),void this.sendItems(this.keyEventUploadPendingItems,!0);this.normalEventUploadPendingItems.push(a),this.normalEventUploadPendingItems.length>ve("NORMAL_EVENT_QUEUE_CAPACITY")&&this.normalEventUploadPendingItems.splice(0,1),this.normalEventUploadPendingItems.length>=10&&this.sendItems(this.normalEventUploadPendingItems,!1)}doSend(){this.keyEventUploadPendingItems.length>0&&this.sendItems(this.keyEventUploadPendingItems,!0),this.normalEventUploadPendingItems.length>0&&Date.now()-this.lastSendNormalEventTime>=5e3&&this.sendItems(this.normalEventUploadPendingItems,!1)}sendItems(a,o){let c=[],f=[];for(;a.length;){let v=a.shift();c.length<20?c.push(v):f.push(v)}a.push(...f);for(let v of[...c]){var m;this.ltsList.indexOf(v.data.lts)!==-1?(v.data.lts=this.ltsList[this.ltsList.length-1]+1,this.ltsList.push(v.data.lts)):(this.ltsList.push(v.data.lts),JA(m=this.ltsList).call(m,(w,C)=>w-C))}return o||(this.lastSendNormalEventTime=Date.now()),ve("ENABLE_EVENT_REPORT")&&c.length&&(ve("NEW_REPORT_SERVER")?this.postDataToStatsCollector2(c):this.postDataToStatsCollector(c)).catch((v=>w=>{ve("EVENT_REPORT_RETRY")&&(o?this.keyEventUploadPendingItems=this.keyEventUploadPendingItems.concat(v):(this.normalEventUploadPendingItems=this.normalEventUploadPendingItems.concat(v),this.normalEventUploadPendingItems.length>ve("NORMAL_EVENT_QUEUE_CAPACITY")&&(this.normalEventUploadPendingItems.splice(0,this.normalEventUploadPendingItems.length-ve("NORMAL_EVENT_QUEUE_CAPACITY")),z.warning("report: drop normal events"))))})(c)),a}async postDataToStatsCollector2(a){yr.networkState===eo.OFFLINE&&await Ct.race([yr.onlineWaiter,vs(2*kr.maxRetryTimeout)]);let o=m=>{let v=new Uint8Array;return m.forEach(w=>{let C=FH(JSON.stringify(w.data)),R=new ArrayBuffer(5),x=(U=>{let F=0;return Object.entries(fr).forEach(Z=>{let[W,K]=Z;K===U.type&&(F=EventNameToID[W])}),F})(w),L=new DataView(R);L.setUint16(0,C.byteLength,!0),L.setUint8(2,255&x),L.setUint8(3,x>>>8&255),L.setUint8(4,x>>>16&255),v=zne(v,new Uint8Array(R)),v=zne(v,C)}),v},c="event",f=this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("NEW_REPORT_SERVER_DOMAINS")[0],"&p=443&d=").concat(c):"https://".concat(ve("NEW_REPORT_SERVER_DOMAINS")[0],"/").concat(c);for(let m=0;m<2;m+=1){m===1&&(f=this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("NEW_REPORT_SERVER_DOMAINS")[1],"&p=443&d=").concat(c):"https://".concat(ve("NEW_REPORT_SERVER_DOMAINS")[1],"/").concat(c));try{await WH(f,{timeout:1e4,data:o(a),headers:Ln(Ln({biz:"webrtc",sendts:Math.round(Date.now()/1e3),debug:"false"},this._appId&&{appid:this._appId}),{},{"Content-Type":"application/octet-stream"})},!0)}catch(v){if(m===1)throw v;continue}return}}async postDataToStatsCollector(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1],c={msgType:"EventMessages",sentTs:Math.round(Date.now()/1e3),payloads:a.map(v=>JSON.stringify(v)),vid:(v=>{let w=v&&v.data.sid&&this.baseInfoMap.get(v.data.sid);return w&&w.info.vid&&+w.info.vid||0})(a[0])};yr.networkState===eo.OFFLINE&&await Ct.race([yr.onlineWaiter,vs(2*kr.maxRetryTimeout)]);let f=o?"/events/proto-raws":"/events/messages",m=this.url||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("EVENT_REPORT_DOMAIN"),"&p=").concat(ve("STATS_COLLECTOR_PORT"),"&d=").concat(f):"https://".concat(ve("EVENT_REPORT_DOMAIN"),":").concat(ve("STATS_COLLECTOR_PORT")).concat(f));for(let v=0;v<2;v+=1){v===1&&(m=this.backupUrl||(this.proxyServer?"https://".concat(this.proxyServer,"/rs/?h=").concat(ve("EVENT_REPORT_BACKUP_DOMAIN"),"&p=").concat(ve("STATS_COLLECTOR_PORT"),"&d=").concat(f):"https://".concat(ve("EVENT_REPORT_BACKUP_DOMAIN"),":").concat(ve("STATS_COLLECTOR_PORT")).concat(f)));try{o?await lxe(m,{timeout:1e4,data:c}):await WH(m,{timeout:1e4,data:c})}catch(w){if(v===1)throw w;continue}return}}createBaseInfo(a,o){let c=Object.assign({},pxe);return c.sid=a,this.baseInfoMap.set(a,{info:c,startTime:o}),c}reportResourceTiming(a,o){let c=performance.getEntriesByName(a),f=c[c.length-1];f&&this.reportApiInvoke(o,{name:"Client.resourceTiming",options:f,tag:vr.TRACER}).onSuccess()}}function hn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function(a,o,c){let f=c.value;if(typeof f=="function"){let m=r.className||a.__className__||(a.constructor.name==="AgoraRTCClient"?"Client":a.constructor.name);c.value=function(){for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];let R=w;if(r.argsMap)try{R=r.argsMap(this,...w)}catch(L){z.warning(L),R=[]}try{JSON.stringify(R)}catch{z.warning("arguments for method ".concat(m,".").concat(String(o)," not serializable for apiInvoke.")),R=[]}let x=(r.report||$t).reportApiInvoke(this._sessionId||null,{name:"".concat(m,".").concat(String(o)),options:R,tag:vr.TRACER,reportResult:r.reportResult},r.throttleTime);try{let L=f.apply(this,w);return L instanceof Ct?L.then(U=>(x.onSuccess(r.reportResult&&U),U)).catch(U=>{throw x.onError(U),U}):(x.onSuccess(r.reportResult&&L),L)}catch(L){throw x.onError(L),L}}}return c}}Ar(v3,"__CLIENT_LIST__",[]);let $t=new v3;aie.on("REPORT_LOG_UPLOAD",r=>{r.networkState=yr.networkState,$t.reportApiInvoke(null,{name:"logUploadError",options:r,tag:vr.TRACER}).onSuccess("logUploadError")});let mxe=["CHINA","GLOBAL"],Ks=function(){let r="us".concat("erna","me"),a="pa".concat("sswo","rd"),o=["t","s","t"];o.splice(1,0,"e");let c=o.join(""),f=[];for(let w=0;w<6;w++)f.push("1");let m=f.join(""),v={};return v[r]=c,v[a]=m,Object.assign(v,{turnServerURL:"",tcpport:3433,udpport:3478,forceturn:!1})}();window.DEFAULT_TURN_CONFIG=Ks,$H||(es.WEBCS_DOMAIN=["ap-web-1-oversea.agora.io","ap-web-1-north-america.agora.io"],es.WEBCS_DOMAIN_BACKUP_LIST=["ap-web-2-oversea.agora.io","ap-web-2-north-america.agora.io"],es.PROXY_CS=["proxy-ap-web-oversea.agora.io","proxy-ap-web-america.agora.io"],es.CDS_AP=["cds-ap-web-oversea.agora.io","cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],es.ACCOUNT_REGISTER=["sua-ap-web-oversea.agora.io","sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],es.UAP_AP=["uap-ap-web-oversea.agora.io","uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],es.LOG_UPLOAD_SERVER="logservice-oversea.agora.io",es.EVENT_REPORT_DOMAIN="statscollector-1-oversea.agora.io",es.EVENT_REPORT_BACKUP_DOMAIN="statscollector-2-oversea.agora.io",es.PROXY_SERVER_TYPE3="webrtc-cloud-proxy.agora.io",es.AREAS=["NORTH_AMERICA","OVERSEA"]);let cie=[[0,1,2,3,4,5,5],[0,2,2,3,4,5,5],[0,3,3,3,4,5,5],[0,4,4,4,4,5,5],[0,5,5,5,5,5,5]],A0=[];function Wy(r,a){return!!a&&A0.some(o=>o.uid===r&&o.channelName===a)}v3.__CLIENT_LIST__=A0;var gxe=jee.forEach,die=Sw("forEach")?[].forEach:function(r){return gxe(this,r,arguments.length>1?arguments[1]:void 0)};Ni({target:"Array",proto:!0,forced:[].forEach!=die},{forEach:die});var vxe=vc("Array").forEach,yxe=ad,_xe=fs,Exe=b,wxe=vxe,XH=Array.prototype,Sxe={DOMTokenList:!0,NodeList:!0},bxe=function(r){var a=r.forEach;return r===XH||Exe(XH,r)&&a===XH.forEach||_xe(Sxe,yxe(r))?wxe:a},Cxe=l(bxe),Txe=Ro,uie=Ow;Ni({target:"Object",stat:!0,forced:d(function(){uie(1)})},{keys:function(r){return uie(Txe(r))}});var hie=l(Me.Object.keys),Rxe=l(bx),xxe=Ni,Axe=e3,Ixe=E([].reverse),fie=[1,2];xxe({target:"Array",proto:!0,forced:String(fie)===String(fie.reverse())},{reverse:function(){return Axe(this)&&(this.length=this.length),Ixe(this)}});var Nxe=vc("Array").reverse,Oxe=b,Pxe=Nxe,JH=Array.prototype,Lxe=function(r){var a=r.reverse;return r===JH||Oxe(JH,r)&&a===JH.reverse?Pxe:a},pie=Lxe,Dxe=l(pie),kxe=Ni,mie=e3,Mxe=Pl,jxe=it,gie=Jv,Uxe=lh,Fxe=xt,Bxe=RS,Vxe=Qi,zxe=tA,Hxe=xee("slice"),Gxe=Vxe("species"),QH=Array,Wxe=Math.max;kxe({target:"Array",proto:!0,forced:!Hxe},{slice:function(r,a){var o,c,f,m=Fxe(this),v=Uxe(m),w=gie(r,v),C=gie(a===void 0?v:a,v);if(mie(m)&&(o=m.constructor,(Mxe(o)&&(o===QH||mie(o.prototype))||jxe(o)&&(o=o[Gxe])===null)&&(o=void 0),o===QH||o===void 0))return zxe(m,w,C);for(c=new(o===void 0?QH:o)(Wxe(C-w,0)),f=0;w<C;w++,f++)w in m&&Bxe(c,f,m[w]);return c.length=f,c}});var $xe=vc("Array").slice,Kxe=b,qxe=$xe,ZH=Array.prototype,Yxe=function(r){var a=r.slice;return r===ZH||Kxe(ZH,r)&&a===ZH.slice?qxe:a},Xxe=l(Yxe);function vt(r,a,o,c,f){var m,v,w,C={};return Cxe(m=hie(c)).call(m,function(R){C[R]=c[R]}),C.enumerable=!!C.enumerable,C.configurable=!!C.configurable,("value"in C||C.initializer)&&(C.writable=!0),C=Rxe(v=Dxe(w=Xxe(o).call(o)).call(w)).call(v,function(R,x){return x(r,a,R)||R},C),f&&C.initializer!==void 0&&(C.value=C.initializer?C.initializer.call(f):void 0,C.initializer=void 0),C.initializer===void 0&&(bee(r,a,C),C=null),C}var Jxe=vc("Array").values,Qxe=ad,Zxe=fs,eAe=b,tAe=Jxe,eG=Array.prototype,nAe={DOMTokenList:!0,NodeList:!0},iAe=function(r){var a=r.values;return r===eG||eAe(eG,r)&&a===eG.values||Zxe(nAe,Qxe(r))?tAe:a},Sh=l(iAe);let rAe=function(r){return r.L1T1="L1T1",r.L1T2="L1T2",r.L1T3="L1T3",r.L2T1_KEY="L2T1_KEY",r.L2T2_KEY="L2T2_KEY",r.L2T3_KEY="L2T3_KEY",r.L3T1_KEY="L3T1_KEY",r.L3T2_KEY="L3T2_KEY",r.L3T3_KEY="L3T3_KEY",r}({}),Tc=function(r){return r.CERTIFICATE="certificate",r.CODEC="codec",r.CANDIDATE_PAIR="candidate-pair",r.LOCAL_CANDIDATE="local-candidate",r.REMOTE_CANDIDATE="remote-candidate",r.INBOUND="inbound-rtp",r.TRACK="track",r.OUTBOUND="outbound-rtp",r.PC="peer-connection",r.REMOTE_INBOUND="remote-inbound-rtp",r.REMOTE_OUTBOUND="remote-outbound-rtp",r.TRANSPORT="transport",r.CSRC="csrc",r.DATA_CHANNEL="data-channel",r.STREAM="stream",r.SENDER="sender",r.RECEIVER="receiver",r}({}),V8=function(r){return r[r.ACCESS_POINT=101]="ACCESS_POINT",r[r.UNILBS=201]="UNILBS",r[r.STRING_UID_ALLOCATOR=901]="STRING_UID_ALLOCATOR",r}({}),tG=function(r){return r[r.IIIEGAL_APPID=1]="IIIEGAL_APPID",r[r.IIIEGAL_UID=2]="IIIEGAL_UID",r[r.INTERNAL_ERROR=3]="INTERNAL_ERROR",r}({}),pu=function(r){return r[r.INVALID_VENDOR_KEY=5]="INVALID_VENDOR_KEY",r[r.INVALID_CHANNEL_NAME=7]="INVALID_CHANNEL_NAME",r[r.INTERNAL_ERROR=8]="INTERNAL_ERROR",r[r.NO_AUTHORIZED=9]="NO_AUTHORIZED",r[r.DYNAMIC_KEY_TIMEOUT=10]="DYNAMIC_KEY_TIMEOUT",r[r.NO_ACTIVE_STATUS=11]="NO_ACTIVE_STATUS",r[r.DYNAMIC_KEY_EXPIRED=13]="DYNAMIC_KEY_EXPIRED",r[r.STATIC_USE_DYNAMIC_KEY=14]="STATIC_USE_DYNAMIC_KEY",r[r.DYNAMIC_USE_STATIC_KEY=15]="DYNAMIC_USE_STATIC_KEY",r[r.USER_OVERLOAD=16]="USER_OVERLOAD",r[r.FORBIDDEN_REGION=18]="FORBIDDEN_REGION",r[r.CANNOT_MEET_AREA_DEMAND=19]="CANNOT_MEET_AREA_DEMAND",r}({}),to=function(r){return r[r.NO_FLAG_SET=100]="NO_FLAG_SET",r[r.FLAG_SET_BUT_EMPTY=101]="FLAG_SET_BUT_EMPTY",r[r.INVALID_FALG_SET=102]="INVALID_FALG_SET",r[r.FLAG_SET_BUT_NO_RE=103]="FLAG_SET_BUT_NO_RE",r[r.INVALID_SERVICE_ID=104]="INVALID_SERVICE_ID",r[r.NO_SERVICE_AVAILABLE=200]="NO_SERVICE_AVAILABLE",r[r.NO_SERVICE_AVAILABLE_P2P=201]="NO_SERVICE_AVAILABLE_P2P",r[r.NO_SERVICE_AVAILABLE_VOICE=202]="NO_SERVICE_AVAILABLE_VOICE",r[r.NO_SERVICE_AVAILABLE_WEBRTC=203]="NO_SERVICE_AVAILABLE_WEBRTC",r[r.NO_SERVICE_AVAILABLE_CDS=204]="NO_SERVICE_AVAILABLE_CDS",r[r.NO_SERVICE_AVAILABLE_CDN=205]="NO_SERVICE_AVAILABLE_CDN",r[r.NO_SERVICE_AVAILABLE_TDS=206]="NO_SERVICE_AVAILABLE_TDS",r[r.NO_SERVICE_AVAILABLE_REPORT=207]="NO_SERVICE_AVAILABLE_REPORT",r[r.NO_SERVICE_AVAILABLE_APP_CENTER=208]="NO_SERVICE_AVAILABLE_APP_CENTER",r[r.NO_SERVICE_AVAILABLE_ENV0=209]="NO_SERVICE_AVAILABLE_ENV0",r[r.NO_SERVICE_AVAILABLE_VOET=210]="NO_SERVICE_AVAILABLE_VOET",r[r.NO_SERVICE_AVAILABLE_STRING_UID=211]="NO_SERVICE_AVAILABLE_STRING_UID",r[r.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS=212]="NO_SERVICE_AVAILABLE_WEBRTC_UNILBS",r[r.NO_SERVICE_AVAILABLE_UNILBS_FLV=213]="NO_SERVICE_AVAILABLE_UNILBS_FLV",r}({}),ln=function(r){return r[r.K_TIMESTAMP_EXPIRED=2]="K_TIMESTAMP_EXPIRED",r[r.K_CHANNEL_PERMISSION_INVALID=3]="K_CHANNEL_PERMISSION_INVALID",r[r.K_CERTIFICATE_INVALID=4]="K_CERTIFICATE_INVALID",r[r.K_CHANNEL_NAME_EMPTY=5]="K_CHANNEL_NAME_EMPTY",r[r.K_CHANNEL_NOT_FOUND=6]="K_CHANNEL_NOT_FOUND",r[r.K_TICKET_INVALID=7]="K_TICKET_INVALID",r[r.K_CHANNEL_CONFLICTED=8]="K_CHANNEL_CONFLICTED",r[r.K_SERVICE_NOT_READY=9]="K_SERVICE_NOT_READY",r[r.K_SERVICE_TOO_HEAVY=10]="K_SERVICE_TOO_HEAVY",r[r.K_UID_BANNED=14]="K_UID_BANNED",r[r.K_IP_BANNED=15]="K_IP_BANNED",r[r.K_CHANNEL_BANNED=16]="K_CHANNEL_BANNED",r[r.K_AUTO_REBALANCE=28]="K_AUTO_REBALANCE",r[r.WARN_NO_AVAILABLE_CHANNEL=103]="WARN_NO_AVAILABLE_CHANNEL",r[r.WARN_LOOKUP_CHANNEL_TIMEOUT=104]="WARN_LOOKUP_CHANNEL_TIMEOUT",r[r.WARN_LOOKUP_CHANNEL_REJECTED=105]="WARN_LOOKUP_CHANNEL_REJECTED",r[r.WARN_OPEN_CHANNEL_TIMEOUT=106]="WARN_OPEN_CHANNEL_TIMEOUT",r[r.WARN_OPEN_CHANNEL_REJECTED=107]="WARN_OPEN_CHANNEL_REJECTED",r[r.WARN_REQUEST_DEFERRED=108]="WARN_REQUEST_DEFERRED",r[r.ERR_DYNAMIC_KEY_TIMEOUT=109]="ERR_DYNAMIC_KEY_TIMEOUT",r[r.ERR_NO_AUTHORIZED=110]="ERR_NO_AUTHORIZED",r[r.ERR_VOM_SERVICE_UNAVAILABLE=111]="ERR_VOM_SERVICE_UNAVAILABLE",r[r.ERR_NO_CHANNEL_AVAILABLE_CODE=112]="ERR_NO_CHANNEL_AVAILABLE_CODE",r[r.ERR_MASTER_VOCS_UNAVAILABLE=114]="ERR_MASTER_VOCS_UNAVAILABLE",r[r.ERR_INTERNAL_ERROR=115]="ERR_INTERNAL_ERROR",r[r.ERR_NO_ACTIVE_STATUS=116]="ERR_NO_ACTIVE_STATUS",r[r.ERR_INVALID_UID=117]="ERR_INVALID_UID",r[r.ERR_DYNAMIC_KEY_EXPIRED=118]="ERR_DYNAMIC_KEY_EXPIRED",r[r.ERR_STATIC_USE_DYANMIC_KE=119]="ERR_STATIC_USE_DYANMIC_KE",r[r.ERR_DYNAMIC_USE_STATIC_KE=120]="ERR_DYNAMIC_USE_STATIC_KE",r[r.ERR_NO_VOCS_AVAILABLE=2e3]="ERR_NO_VOCS_AVAILABLE",r[r.ERR_NO_VOS_AVAILABLE=2001]="ERR_NO_VOS_AVAILABLE",r[r.ERR_JOIN_CHANNEL_TIMEOUT=2002]="ERR_JOIN_CHANNEL_TIMEOUT",r[r.ERR_REPEAT_JOIN_CHANNEL=2003]="ERR_REPEAT_JOIN_CHANNEL",r[r.ERR_JOIN_BY_MULTI_IP=2004]="ERR_JOIN_BY_MULTI_IP",r[r.ERR_NOT_JOINED=2011]="ERR_NOT_JOINED",r[r.ERR_REPEAT_JOIN_REQUEST=2012]="ERR_REPEAT_JOIN_REQUEST",r[r.ERR_INVALID_VENDOR_KEY=2013]="ERR_INVALID_VENDOR_KEY",r[r.ERR_INVALID_CHANNEL_NAME=2014]="ERR_INVALID_CHANNEL_NAME",r[r.ERR_INVALID_STRINGUID=2015]="ERR_INVALID_STRINGUID",r[r.ERR_TOO_MANY_USERS=2016]="ERR_TOO_MANY_USERS",r[r.ERR_SET_CLIENT_ROLE_TIMEOUT=2017]="ERR_SET_CLIENT_ROLE_TIMEOUT",r[r.ERR_SET_CLIENT_ROLE_NO_PERMISSION=2018]="ERR_SET_CLIENT_ROLE_NO_PERMISSION",r[r.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE=2019]="ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",r[r.ERR_PUBLISH_REQUEST_INVALID=2020]="ERR_PUBLISH_REQUEST_INVALID",r[r.ERR_SUBSCRIBE_REQUEST_INVALID=2021]="ERR_SUBSCRIBE_REQUEST_INVALID",r[r.ERR_NOT_SUPPORTED_MESSAGE=2022]="ERR_NOT_SUPPORTED_MESSAGE",r[r.ERR_ILLEAGAL_PLUGIN=2023]="ERR_ILLEAGAL_PLUGIN",r[r.ERR_REJOIN_TOKEN_INVALID=2024]="ERR_REJOIN_TOKEN_INVALID",r[r.ERR_REJOIN_USER_NOT_JOINED=2025]="ERR_REJOIN_USER_NOT_JOINED",r[r.ERR_INVALID_OPTIONAL_INFO=2027]="ERR_INVALID_OPTIONAL_INFO",r[r.ILLEGAL_AES_PASSWORD=2028]="ILLEGAL_AES_PASSWORD",r[r.ILLEGAL_CLIENT_ROLE_LEVEL=2029]="ILLEGAL_CLIENT_ROLE_LEVEL",r[r.ERR_TOO_MANY_BROADCASTERS=2031]="ERR_TOO_MANY_BROADCASTERS",r[r.ERR_TOO_MANY_SUBSCRIBERS=2032]="ERR_TOO_MANY_SUBSCRIBERS",r[r.ERR_LICENSE_MISSING=32769]="ERR_LICENSE_MISSING",r[r.ERR_LICENSE_EXPIRED=32771]="ERR_LICENSE_EXPIRED",r[r.ERR_LICENSE_MINUTES_EXCEEDED=32773]="ERR_LICENSE_MINUTES_EXCEEDED",r[r.ERR_LICENSE_PERIOD_INVALID=32774]="ERR_LICENSE_PERIOD_INVALID",r[r.ERR_LICENSE_MULTIPLE_SDK_SERVICE=32778]="ERR_LICENSE_MULTIPLE_SDK_SERVICE",r[r.ERR_LICENSE_ILLEGAL=32783]="ERR_LICENSE_ILLEGAL",r[r.ERR_TEST_RECOVER=9e3]="ERR_TEST_RECOVER",r[r.ERR_TEST_TRYNEXT=9001]="ERR_TEST_TRYNEXT",r[r.ERR_TEST_RETRY=9002]="ERR_TEST_RETRY",r}({}),Vn=function(r){return r.CONNECTING="connecting",r.CONNECTED="connected",r.RECONNECTING="reconnecting",r.CLOSED="closed",r}({}),Ut=function(r){return r.WS_CONNECTED="ws_connected",r.WS_RECONNECTING="ws_reconnecting",r.WS_CLOSED="ws_closed",r.WS_RECONNECT_WAITTING_FINISH="ws_reconnect_waitting_finish",r.WS_RECONNECT_CREATE_CONNECTION="ws_reconnect_create_connection",r.ON_BINARY_DATA="on_binary_data",r.REQUEST_RECOVER="request_recover",r.REQUEST_JOIN_INFO="request_join_info",r.REQUEST_REJOIN_INFO="req_rejoin_info",r.IS_P2P_DISCONNECTED="is_p2p_dis",r.DISCONNECT_P2P="dis_p2p",r.ABORT_P2P_EXECUTION="abort_p2p_execution",r.NEED_RENEW_SESSION="need-sid",r.REPORT_JOIN_GATEWAY="report_join_gateway",r.REQUEST_TIMEOUT="request_timeout",r.REQUEST_SUCCESS="request_success",r.JOIN_RESPONSE="join_response",r.DATACHANNEL_PRECONNECT="datachannel_preconnect",r.DATACHANNEL_CONNECTING="datachannel_connecting",r.DATACHANNEL_FAILBACK="datachannel_failback",r.P2P_CONNECTION="p2p_connection",r.P2P_REMOTE_CANDIDATE_UPDATE="p2p_remote_candidate_update",r.P2P_SUBSCRIBE="p2p_subscribe",r.P2P_UNSUBSCRIBE="p2p_unsubscribe",r.P2P_EXCHANGE_SDP="p2p_exchange_sdp",r.P2P_ON_ADD_VIDEO_STREAM="p2p_on_add_video_stream",r.P2P_ON_ADD_AUDIO_STREAM="p2p_on_add_audio_stream",r}({}),rn=function(r){return r.PING="ping",r.PING_BACK="ping_back",r.JOIN="join_v3",r.REJOIN="rejoin_v3",r.LEAVE="leave",r.SET_CLIENT_ROLE="set_client_role",r.PUBLISH="publish",r.PUBLISH_DATASTREAM="publish_datastream",r.UNPUBLISH="unpublish",r.UNPUBLISH_DATASTREAM="unpublish_datastream",r.SUBSCRIBE="subscribe",r.PRE_SUBSCRIBE="pre_subscribe",r.SUBSCRIBE_DATASTREAM="subscribe_datastream",r.SUBSCRIBE_STREAMS="subscribe_streams",r.UNSUBSCRIBE="unsubscribe",r.UNSUBSCRIBE_DATASTREAM="unsubscribe_datastream",r.UNSUBSCRIBE_STREAMS="unsubscribe_streams",r.SUBSCRIBE_CHANGE="subscribe_change",r.TRAFFIC_STATS="traffic_stats",r.RENEW_TOKEN="renew_token",r.SWITCH_VIDEO_STREAM="switch_video_stream",r.DEFAULT_VIDEO_STREAM="default_video_stream",r.SET_FALLBACK_OPTION="set_fallback_option",r.GATEWAY_INFO="gateway_info",r.CONTROL="control",r.SEND_METADATA="send_metadata",r.DATA_STREAM="data_stream",r.PICK_SVC_LAYER="pick_svc_layer",r.RESTART_ICE="restart_ice",r.CONNECT_PC="connect_pc",r.SET_VIDEO_PROFILE="set_video_profile",r.SET_PARAMETER="set_parameter",r.SET_RTM2_FLAG="set_rtm2_flag",r}({}),$y=function(r){return r.WRTC_STATS="wrtc_stats",r.WS_INFLATE_DATA_LENGTH="ws_inflate_data_length",r.DENOISER_STATS="denoiser_stats",r.EXTENSION_USAGE_STATS="extension_usage_stats",r}({}),Sn=function(r){return r.ON_USER_ONLINE="on_user_online",r.ON_USER_OFFLINE="on_user_offline",r.ON_STREAM_FALLBACK_UPDATE="on_stream_fallback_update",r.ON_PUBLISH_STREAM="on_publish_stream",r.ON_UPLINK_STATS="on_uplink_stats",r.ON_P2P_LOST="on_p2p_lost",r.ON_REMOVE_STREAM="on_remove_stream",r.ON_ADD_AUDIO_STREAM="on_add_audio_stream",r.ON_ADD_VIDEO_STREAM="on_add_video_stream",r.ON_TOKEN_PRIVILEGE_WILL_EXPIRE="on_token_privilege_will_expire",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="on_token_privilege_did_expire",r.ON_USER_BANNED="on_user_banned",r.ON_USER_LICENSE_BANNED="on_user_license_banned",r.ON_NOTIFICATION="on_notification",r.ON_CRYPT_ERROR="on_crypt_error",r.MUTE_AUDIO="mute_audio",r.MUTE_VIDEO="mute_video",r.UNMUTE_AUDIO="unmute_audio",r.UNMUTE_VIDEO="unmute_video",r.ON_P2P_OK="on_p2p_ok",r.RECEIVE_METADATA="receive_metadata",r.ON_DATA_STREAM="on_data_stream",r.ON_RTP_CAPABILITY_CHANGE="on_rtp_capability_change",r.ON_REMOTE_DATASTREAM_UPDATE="on_remote_datastream_update",r.ON_REMOTE_FULL_DATASTREAM_INFO="on_remote_full_datastream_info",r.ENABLE_LOCAL_VIDEO="enable_local_video",r.DISABLE_LOCAL_VIDEO="disable_local_video",r.ENABLE_LOCAL_AUDIO="enable_local_audio",r.DISABLE_LOCAL_AUDIO="disable_local_audio",r.ON_PUBLISHED_USER_LIST="on_published_user_list",r}({}),no=function(r){return r.SEND_ONLY="SEND_ONLY",r.RECEIVE_ONLY="RECEIVE_ONLY",r}({}),En=function(r){return r.CONNECTED="websocket:connected",r.RECONNECTING="websocket:reconnecting",r.WILL_RECONNECT="websocket:will_reconnect",r.CLOSED="websocket:closed",r.FAILED="websocket:failed",r.ON_MESSAGE="websocket:on_message",r.REQUEST_NEW_URLS="websocket:request_new_urls",r.RECONNECT_WAITTING_FINISH="websocket:reconnect_waitting_finish",r.RECONNECT_CREATE_CONNECTION="websocket:reconnect_create_connection",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="websocket:on_token_privilege_did_expire",r}({});class De extends Ke{constructor(a){super(a,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",arguments.length>2?arguments[2]:void 0),X(this,"name","AgoraRTCException")}print(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"error";return super.print(a,z)}throw(){super.throw(z)}}function z8(r){if(typeof r!="string"||!/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/.test(r))throw z.error("Invalid Channel Name ".concat(r)),new De(ce.INVALID_PARAMS,"The length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,")}function H8(r){if(!function(a){return typeof a=="number"&&Math.floor(a)===a&&0<=a&&a<=4294967295}(r)&&!Une(r,1,255))throw new De(ce.INVALID_PARAMS,"[String uid] Length of the string: [1,255]. ASCII characters only. [Number uid] The value range is [0,10000]");typeof r=="string"&&z.warn("You input a string as the user ID, to ensure better end-user experience, Agora highly suggests not using a string as the user ID.")}let xs=function(r){return r.TRANSCODE="mix_streaming",r.RAW="raw_streaming",r.INJECT="inject_streaming",r}({}),HS=function(r){return r[r.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",r[r.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",r[r.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",r[r.INJECT_STREAM_STATUS_START_TIMEOUT=3]="INJECT_STREAM_STATUS_START_TIMEOUT",r[r.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",r[r.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",r[r.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",r[r.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",r[r.INJECT_STREAM_STATUS_STOP_TIMEOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEOUT",r[r.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",r[r.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN",r}({}),sAe={alpha:1,height:640,width:360,x:0,y:0,zOrder:0,audioChannel:0},nG={x:0,y:0,width:160,height:160,zOrder:255,alpha:1};function iG(r,a){Ms(r.url,"".concat(a,".url"),1,1e3,!1),gr(r.x)||Ti(r.x,"".concat(a,".x"),0,1e4),gr(r.y)||Ti(r.y,"".concat(a,".y"),0,1e4),gr(r.width)||Ti(r.width,"".concat(a,".width"),0,1e4),gr(r.height)||Ti(r.height,"".concat(a,".height"),0,1e4),gr(r.zOrder)||Ti(r.zOrder,"".concat(a,".zOrder"),0,255),gr(r.alpha)||Ti(r.alpha,"".concat(a,".alpha"),0,1,!1)}let aAe={audioBitrate:48,audioChannels:1,audioSampleRate:48e3,backgroundColor:0,height:360,lowLatency:!1,videoBitrate:400,videoCodecProfile:100,videoCodecType:1,videoFrameRate:15,videoGop:30,width:640,images:[],userConfigs:[],userConfigExtraInfo:""},oAe={audioBitrate:48,audioChannels:2,audioVolume:100,audioSampleRate:48e3,height:0,width:0,videoBitrate:400,videoFramerate:15,videoGop:30},kf=function(r){return r.WARNING="@live_uap-warning",r.ERROR="@line_uap-error",r.PUBLISH_STREAM_STATUS="@live_uap-publish-status",r.INJECT_STREAM_STATUS="@live_uap-inject-status",r.WORKER_STATUS="@live_uap-worker-status",r.REQUEST_NEW_ADDRESS="@live_uap-request-address",r}({}),G8=function(r){return r.REQUEST_WORKER_MANAGER_LIST="@live_req_worker_manager",r}({}),ts=function(r){return r[r.LIVE_STREAM_RESPONSE_SUCCEED=200]="LIVE_STREAM_RESPONSE_SUCCEED",r[r.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM=454]="LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM",r[r.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR=450]="LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR",r[r.LIVE_STREAM_RESPONSE_BAD_STREAM=451]="LIVE_STREAM_RESPONSE_BAD_STREAM",r[r.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR=400]="LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR",r[r.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST=404]="LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST",r[r.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED=456]="LIVE_STREAM_RESPONSE_NOT_AUTHORIZED",r[r.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE=457]="LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE",r[r.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN=429]="LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN",r[r.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH=452]="LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH",r[r.LIVE_STREAM_RESPONSE_NOT_SUPPORTED=453]="LIVE_STREAM_RESPONSE_NOT_SUPPORTED",r[r.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM=455]="LIVE_STREAM_RESPONSE_MAX_STREAM_NUM",r[r.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR=500]="LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR",r[r.LIVE_STREAM_RESPONSE_WORKER_LOST=501]="LIVE_STREAM_RESPONSE_WORKER_LOST",r[r.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT=502]="LIVE_STREAM_RESPONSE_RESOURCE_LIMIT",r[r.LIVE_STREAM_RESPONSE_WORKER_QUIT=503]="LIVE_STREAM_RESPONSE_WORKER_QUIT",r[r.ERROR_FAIL_SEND_MESSAGE=504]="ERROR_FAIL_SEND_MESSAGE",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE=30]="PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT=31]="PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT",r[r.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH=32]="PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH",r[r.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN=33]="PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN",r}({});function vie(r){if(!r.channelName)throw new De(ce.INVALID_PARAMS,"invalid channelName in info");if(typeof r.uid!="number")throw new De(ce.INVALID_PARAMS,"invalid uid in info, uid must be a number");return r.token&&Ms(r.token,"info.token",1,2047),H8(r.uid),z8(r.channelName),!0}let io=function(r){return r[r.SetSdkProfile=0]="SetSdkProfile",r[r.SetSourceChannel=1]="SetSourceChannel",r[r.SetSourceUserId=2]="SetSourceUserId",r[r.SetDestChannel=3]="SetDestChannel",r[r.StartPacketTransfer=4]="StartPacketTransfer",r[r.StopPacketTransfer=5]="StopPacketTransfer",r[r.UpdateDestChannel=6]="UpdateDestChannel",r[r.Reconnect=7]="Reconnect",r[r.SetVideoProfile=8]="SetVideoProfile",r}({}),mm=function(r){return r.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",r.NETWORK_CONNECTED="NETWORK_CONNECTED",r.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",r.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",r.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",r.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",r.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",r.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",r.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED",r.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",r}({}),il=function(r){return r.RELAY_STATE_IDLE="RELAY_STATE_IDLE",r.RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",r.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING",r.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE",r}({}),GS=function(r){return r.RELAY_OK="RELAY_OK",r.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",r.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED",r.DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED",r}({}),pi=function(r){return r.High="high",r.Low="low",r.Audio="audio",r.Screen="screen",r.ScreenLow="screen_low",r}({}),Ir=function(r){return r.DISCONNECT="disconnect",r.CONNECTION_STATE_CHANGE="connection-state-change",r.NETWORK_QUALITY="network-quality",r.STREAM_TYPE_CHANGE="stream-type-change",r.IS_P2P_DISCONNECTED="is-p2p-dis",r.DISCONNECT_P2P="dis-p2p",r.REQUEST_NEW_GATEWAY_LIST="req-gate-url",r.NEED_RENEW_SESSION="need-sid",r.REQUEST_P2P_CONNECTION_PARAMS="request-p2p-connection-params",r.JOIN_RESPONSE="join-response",r.REQUEST_DC_CONNECTION_PARAMS="request-dc-connection-params",r.RESET_CONNECTION_EVENTS="reset-connection-events",r.DATACHANNEL_PRECONNECT="datachannel_preconnect",r.DATACHANNEL_FAILBACK="datachannel_failback",r.RESET_SIGNAL="reset-signal",r}({}),y3=function(r){return r.P2P_DISCONNECTED="P2P_DISCONNECTED",r.A_ROUND_WS_FAILED="A_ROUND_WS_FAILED",r.TIMEOUT="TIMEOUT",r.UNKNOWN_REASON="UNKNOWN_REASON",r}({}),ys=function(r){return r[r.Nothing=0]="Nothing",r[r.Audio=1]="Audio",r[r.LwoVideo=2]="LwoVideo",r[r.Video=4]="Video",r[r.Data=8]="Data",r[r.DataStream0=256]="DataStream0",r[r.DataStream1=512]="DataStream1",r[r.DataStream2=1024]="DataStream2",r[r.DataStream3=2048]="DataStream3",r[r.DataStream4=4096]="DataStream4",r[r.DataStream5=8192]="DataStream5",r[r.DataStream6=16384]="DataStream6",r[r.DataStream7=32768]="DataStream7",r}({}),yie=function(r){return r[r.websocket=0]="websocket",r[r.datachannel=1]="datachannel",r}({}),ai=function(r){return r.CHINA="CHINA",r.ASIA="ASIA",r.NORTH_AMERICA="NORTH_AMERICA",r.EUROPE="EUROPE",r.JAPAN="JAPAN",r.INDIA="INDIA",r.KOREA="KOREA",r.HKMC="HKMC",r.US="US",r.OCEANIA="OCEANIA",r.SOUTH_AMERICA="SOUTH_AMERICA",r.AFRICA="AFRICA",r.OVERSEA="OVERSEA",r.GLOBAL="GLOBAL",r.EXTENSIONS="EXTENSIONS",r}({}),_ie=[ai.AFRICA,ai.ASIA,ai.CHINA,ai.EUROPE,ai.GLOBAL,ai.INDIA,ai.JAPAN,ai.NORTH_AMERICA,ai.OCEANIA,ai.OVERSEA,ai.SOUTH_AMERICA],sa=function(r){return r.CHINA="CN",r.ASIA="AS",r.NORTH_AMERICA="NA",r.EUROPE="EU",r.JAPAN="JP",r.INDIA="IN",r.KOREA="KR",r.HKMC="HK",r.US="US",r.OCEANIA="OC",r.SOUTH_AMERICA="SA",r.AFRICA="AF",r.OVERSEA="OVERSEA",r.GLOBAL="GLOBAL",r.EXTENSIONS="GLOBAL",r}({}),W8={CHINA:{},ASIA:{CODE:sa.ASIA,WEBCS_DOMAIN:["ap-web-1-asia.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-asia.agora.io"],PROXY_CS:["proxy-ap-web-asia.agora.io"],CDS_AP:["cds-ap-web-asia.agora.io","cds-ap-web-asia2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-asia.agora.io","sua-ap-web-asia2.agora.io"],UAP_AP:["uap-ap-web-asia.agora.io","uap-ap-web-asia2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-asia.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-asia.agora.io"],LOG_UPLOAD_SERVER:["logservice-asia.agora.io"],PROXY_SERVER_TYPE3:["southeast-asia.webrtc-cloud-proxy.sd-rtn.com"]},NORTH_AMERICA:{CODE:sa.NORTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-north-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-north-america.agora.io"],PROXY_CS:["proxy-ap-web-america.agora.io"],CDS_AP:["cds-ap-web-america.agora.io","cds-ap-web-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-america.agora.io","sua-ap-web-america2.agora.io"],UAP_AP:["uap-ap-web-america.agora.io","uap-ap-web-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-north-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-north-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-north-america.agora.io"],PROXY_SERVER_TYPE3:["east-usa.webrtc-cloud-proxy.sd-rtn.com"]},EUROPE:{CODE:sa.EUROPE,WEBCS_DOMAIN:["ap-web-1-europe.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-europe.agora.io"],PROXY_CS:["proxy-ap-web-europe.agora.io"],CDS_AP:["cds-ap-web-europe.agora.io","cds-ap-web-europe2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-europe.agora.io","sua-ap-web-europe.agora.io"],UAP_AP:["uap-ap-web-europe.agora.io","uap-ap-web-europe2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-europe.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-europe.agora.io"],LOG_UPLOAD_SERVER:["logservice-europe.agora.io"],PROXY_SERVER_TYPE3:["europe.webrtc-cloud-proxy.sd-rtn.com"]},JAPAN:{CODE:sa.JAPAN,WEBCS_DOMAIN:["ap-web-1-japan.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-japan.agora.io"],PROXY_CS:["proxy-ap-web-japan.agora.io"],CDS_AP:["cds-ap-web-japan.agora.io","cds-ap-web-japan2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-japan.agora.io","sua-ap-web-japan2.agora.io"],UAP_AP:["uap-ap-web-japan.agora.io","uap-ap-web-japan2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-japan.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-japan.agora.io"],LOG_UPLOAD_SERVER:["logservice-japan.agora.io"],PROXY_SERVER_TYPE3:["japan.webrtc-cloud-proxy.sd-rtn.com"]},INDIA:{CODE:sa.INDIA,WEBCS_DOMAIN:["ap-web-1-india.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-india.agora.io"],PROXY_CS:["proxy-ap-web-india.agora.io"],CDS_AP:["cds-ap-web-india.agora.io","cds-ap-web-india2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-india.agora.io","sua-ap-web-india2.agora.io"],UAP_AP:["uap-ap-web-india.agora.io","uap-ap-web-india2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-india.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-india.agora.io"],LOG_UPLOAD_SERVER:["logservice-india.agora.io"],PROXY_SERVER_TYPE3:["india.webrtc-cloud-proxy.sd-rtn.com"]},KOREA:{CODE:sa.KOREA,WEBCS_DOMAIN:["ap-web-1-korea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-korea.agora.io"],PROXY_CS:["proxy-ap-web-korea.agora.io"],CDS_AP:["cds-ap-web-korea.agora.io","cds-ap-web-korea2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-korea.agora.io","sua-ap-web-korea2.agora.io"],UAP_AP:["uap-ap-web-korea.agora.io","uap-ap-web-korea2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-korea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-korea.agora.io"],LOG_UPLOAD_SERVER:["logservice-korea.agora.io"],PROXY_SERVER_TYPE3:["korea.webrtc-cloud-proxy.sd-rtn.com"]},HKMC:{CODE:sa.HKMC,WEBCS_DOMAIN:["ap-web-1-hkmc.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-hkmc.agora.io"],PROXY_CS:["proxy-ap-web-hkmc.agora.io"],CDS_AP:["cds-ap-web-hkmc.agora.io","cds-ap-web-hkmc2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-hkmc.agora.io","sua-ap-web-hkmc2.agora.io"],UAP_AP:["uap-ap-web-hkmc.agora.io","uap-ap-web-hkmc2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-hkmc.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-hkmc.agora.io"],LOG_UPLOAD_SERVER:["logservice-hkmc.agora.io"],PROXY_SERVER_TYPE3:["hkmc.webrtc-cloud-proxy.sd-rtn.com"]},US:{CODE:sa.US,WEBCS_DOMAIN:["ap-web-1-us.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-us.agora.io"],PROXY_CS:["proxy-ap-web-us.agora.io"],CDS_AP:["cds-ap-web-us.agora.io","cds-ap-web-us2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-us.agora.io","sua-ap-web-us2.agora.io"],UAP_AP:["uap-ap-web-us.agora.io","uap-ap-web-us2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-us.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-us.agora.io"],LOG_UPLOAD_SERVER:["logservice-us.agora.io"],PROXY_SERVER_TYPE3:["us.webrtc-cloud-proxy.sd-rtn.com"]},OVERSEA:{CODE:sa.OVERSEA,WEBCS_DOMAIN:["ap-web-1-oversea.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oversea.agora.io"],PROXY_CS:["proxy-ap-web-oversea.agora.io"],CDS_AP:["cds-ap-web-oversea.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oversea.agora.io"],UAP_AP:["uap-ap-web-oversea.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oversea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oversea.agora.io"],LOG_UPLOAD_SERVER:["logservice-oversea.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.agora.io"]},GLOBAL:{CODE:sa.GLOBAL,WEBCS_DOMAIN:["webrtc2-ap-web-1.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-ap-web-3.agora.io"],PROXY_CS:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],CDS_AP:["cds-ap-web-1.agora.io","cds-ap-web-3.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-1.agora.io","sua-ap-web-3.agora.io"],UAP_AP:["uap-ap-web-1.agora.io","uap-ap-web-3.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2.agora.io"],LOG_UPLOAD_SERVER:["logservice.agora.io"],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy.sd-rtn.com"]},OCEANIA:{CODE:sa.OCEANIA,WEBCS_DOMAIN:["ap-web-1-oceania.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-oceania.agora.io"],PROXY_CS:["proxy-ap-web-oceania.agora.io"],CDS_AP:["cds-ap-web-oceania.agora.io","cds-ap-web-oceania2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-oceania.agora.io","sua-ap-web-oceania2.agora.io"],UAP_AP:["uap-ap-web-oceania.agora.io","uap-ap-web-oceania2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oceania.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oceania.agora.io"],LOG_UPLOAD_SERVER:["logservice-oceania.agora.io"],PROXY_SERVER_TYPE3:["oceania.webrtc-cloud-proxy.sd-rtn.com"]},SOUTH_AMERICA:{CODE:sa.SOUTH_AMERICA,WEBCS_DOMAIN:["ap-web-1-south-america.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-south-america.agora.io"],PROXY_CS:["proxy-ap-web-south-america.agora.io"],CDS_AP:["cds-ap-web-south-america.agora.io","cds-ap-web-south-america2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-south-america.agora.io","sua-ap-web-south-america2.agora.io"],UAP_AP:["uap-ap-web-south-america.agora.io","uap-ap-web-south-america2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-south-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-south-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-america.agora.io"],PROXY_SERVER_TYPE3:["south-america.webrtc-cloud-proxy.sd-rtn.com"]},AFRICA:{CODE:sa.AFRICA,WEBCS_DOMAIN:["ap-web-1-africa.agora.io"],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-africa.agora.io"],PROXY_CS:["proxy-ap-web-africa.agora.io"],CDS_AP:["cds-ap-web-africa.agora.io","cds-ap-web-africa2.agora.io"],ACCOUNT_REGISTER:["sua-ap-web-africa.agora.io","sua-ap-web-africa2.agora.io"],UAP_AP:["uap-ap-web-africa.agora.io","uap-ap-web-africa2.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-africa.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-africa.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-africa.agora.io"],PROXY_SERVER_TYPE3:["africa.webrtc-cloud-proxy.sd-rtn.com"]},EXTENSIONS:{}};$H&&(W8.CHINA={CODE:sa.CHINA,WEBCS_DOMAIN:["webrtc2-2.ap.sd-rtn.com"],WEBCS_DOMAIN_BACKUP_LIST:["webrtc2-4.ap.sd-rtn.com"],PROXY_CS:["proxy-web.ap.sd-rtn.com"],CDS_AP:["cds-web-2.ap.sd-rtn.com","cds-web-4.ap.sd-rtn.com"],ACCOUNT_REGISTER:["sua-web-2.ap.sd-rtn.com","sua-web-4.ap.sd-rtn.com"],UAP_AP:["uap-web-2.ap.sd-rtn.com","uap-web-4.ap.sd-rtn.com"],EVENT_REPORT_DOMAIN:["web-3.statscollector.sd-rtn.com"],EVENT_REPORT_BACKUP_DOMAIN:["web-4.statscollector.sd-rtn.com"],LOG_UPLOAD_SERVER:["logservice-china.agora.io"],PROXY_SERVER_TYPE3:["east-cn.webrtc-cloud-proxy.sd-rtn.com"]});let rG=function(r){return r.UPDATE_BITRATE_LIMIT="update_bitrate_limit",r}({});class Eie extends nr{constructor(a,o){super(),X(this,"onICEConnectionStateChange",void 0),X(this,"onConnectionStateChange",void 0),X(this,"onDTLSTransportStateChange",void 0),X(this,"onDTLSTransportError",void 0),X(this,"onICETransportStateChange",void 0),X(this,"onFirstAudioReceived",void 0),X(this,"onFirstVideoReceived",void 0),X(this,"onFirstAudioDecoded",void 0),X(this,"onFirstVideoDecoded",void 0),X(this,"onFirstVideoDecodedTimeout",void 0),X(this,"onSelectedLocalCandidateChanged",void 0),X(this,"onSelectedRemoteCandidateChanged",void 0),X(this,"getLocalVideoStats",void 0)}}class $8 extends Eie{constructor(a,o){super(a,o),X(this,"establishPromise",void 0)}}let Wt=function(r){return r.VIDEO="video",r.AUDIO="audio",r}({}),Pa=function(r){return r[r.UDP=0]="UDP",r[r.TCP=1]="TCP",r[r.RELAY=2]="RELAY",r}({}),gm=function(r){return r[r.FIRST_CONNECTION=0]="FIRST_CONNECTION",r[r.TCP_RESTART=1]="TCP_RESTART",r[r.RELAY_RESTART=2]="RELAY_RESTART",r[r.OLD_FIRST_CONNECTION=10]="OLD_FIRST_CONNECTION",r[r.OLD_RESTART=11]="OLD_RESTART",r[r.DISCONNECTED_OR_FAILED=20]="DISCONNECTED_OR_FAILED",r}({}),ht=function(r){return r.LocalVideoTrack="videoTrack",r.LocalAudioTrack="audioTrack",r.LocalVideoLowTrack="videoLowTrack",r}({}),gi=function(r){return r.New="new",r.Connected="connected",r.Reconnecting="reconnecting",r.Disconnected="disconnected",r}({}),pn=function(r){return r.StateChange="stateChange",r.IceConnectionStateChange="iceConnectionStateChange",r.RequestMuteLocal="requestMuteLocal",r.RequestUnmuteLocal="requestUnmuteLocal",r.RequestRePublish="requestRePublish",r.RequestRePublishDataChannel="requestRePublishDataChannel",r.RequestReSubscribe="requestReSubscribe",r.RequestUploadStats="requestUploadStats",r.RequestUpload="requestUpload",r.MediaReconnectStart="MediaReconnectStart",r.MediaReconnectEnd="MediaReconnectEnd",r.NeedSignalRTT="NeedSignalRTT",r.RequestRestartICE="RequestRestartIce",r.PeerConnectionStateChange="PeerConnectionStateChange",r.RequestReconnect="RequestReconnect",r.RequestReconnectPC="RequestReconnectPC",r.RequestUnpublishForReconnectPC="RequestUnpublishForReconnectPC",r.P2PLost="P2PLost",r.UpdateVideoEncoder="UpdateVideoEncoder",r.ConnectionTypeChange="ConnectionTypeChange",r.RequestLowStreamParameter="RequestLowStreamParameter",r.QueryClientConnectionState="QueryClientConnectionState",r.LocalCandidate="LocalCandidate",r.RequestP2PMuteLocal="requestP2PMuteLocal",r.RequestP2PUnPublish="RequestP2PUnPublish",r.RequestP2PUnmuteRemote="RequestP2PUnmuteRemote",r.RequestP2PMuteRemote="RequestP2PMuteRemote",r.RequestP2PRestartICE="RequestP2PRestartICE",r}({}),mu=function(r){return r.CONNECTING="CONNECTING",r.RECONNECTING="RECONNECTING",r.CONNECTED="CONNECTED",r.CLOSED="CLOSED",r}({}),gu=function(r){return r[r.CONNECT_AP=0]="CONNECT_AP",r[r.AP_CONNECTED=1]="AP_CONNECTED",r[r.CONNECT_WORKER_MANAGER=2]="CONNECT_WORKER_MANAGER",r[r.WORKER_MANAGER_CONNECTED=3]="WORKER_MANAGER_CONNECTED",r[r.GET_WORKER_MANAGER_RESPONSE=4]="GET_WORKER_MANAGER_RESPONSE",r[r.CONNECT_WORKER=5]="CONNECT_WORKER",r[r.WORKER_CONNECTED=6]="WORKER_CONNECTED",r[r.CLOSED=7]="CLOSED",r}({}),As=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.STATE_CHANGE="state-change",r.INSPECT_RESULT="inspect-result",r.CLIENT_LOCAL_VIDEO_TRACK="client-local-video-track",r.REQUEST_NEW_WORKER_URL="request-new-worker-url",r}({}),I0=function(r){return r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.MULTI_IP="MULTI_IP",r.TIMEOUT="TIMEOUT",r.OFFLINE="OFFLINE",r.LEAVE="LEAVE",r.P2P_FAILED="P2P_FAILED",r.FALLBACK="FALLBACK",r}({}),qr=function(r){return r.CONNECTED="transmitter:connected",r.RECONNECTING="transmitter:reconnecting",r.WILL_RECONNECT="transmitter:will_reconnect",r.CLOSED="transmitter:closed",r.FAILED="transmitter:failed",r.ON_MESSAGE="transmitter:on_message",r.REQUEST_NEW_URLS="transmitter:request_new_urls",r.RECONNECT_WAITTING_FINISH="transmitter:reconnect_waitting_finish",r.RECONNECT_CREATE_CONNECTION="transmitter:reconnect_create_connection",r.ON_TOKEN_PRIVILEGE_DID_EXPIRE="transmitter:on_token_privilege_did_expire",r.TO_CONNECT_DATACHANNEL="transmitter:to_connect_datachannel",r.FAILBACK="transmitter:failback",r}({}),Mf=function(r){return r.CAMERA_CHANGED="camera-changed",r.MICROPHONE_CHANGED="microphone-changed",r.PLAYBACK_DEVICE_CHANGED="playback-device-changed",r.AUDIO_AUTOPLAY_FAILED="audio-autoplay-failed",r.AUTOPLAY_FAILED="autoplay-failed",r.AUDIO_CONTEXT_STATE_CHANGED="audio-context-state-changed",r.SECURITY_POLICY_VIOLATION="security-policy-violation",r}({}),hd=function(r){return r.CONNECTING="CONNECTING",r.RECONNECTING="RECONNECTING",r.CONNECTED="CONNECTED",r.CLOSED="CLOSED",r}({}),bh=function(r){return r.CONNECTION_STATE_CHANGE="connection-state-change",r.STATE_CHANGE="state-change",r.INSPECT_RESULT="inspect-result",r.CLIENT_LOCAL_VIDEO_TRACK="client-local-video-track",r.REQUEST_NEW_WORKER_URL="request-new-worker-url",r}({}),WS=function(r){return r[r.CONNECT_AP=0]="CONNECT_AP",r[r.AP_CONNECTED=1]="AP_CONNECTED",r[r.CONNECT_WORKER_MANAGER=2]="CONNECT_WORKER_MANAGER",r[r.WORKER_MANAGER_CONNECTED=3]="WORKER_MANAGER_CONNECTED",r[r.GET_WORKER_MANAGER_RESPONSE=4]="GET_WORKER_MANAGER_RESPONSE",r[r.CONNECT_WORKER=5]="CONNECT_WORKER",r[r.WORKER_CONNECTED=6]="WORKER_CONNECTED",r[r.CLOSED=7]="CLOSED",r}({}),Nr=function(r){return r.CALL="call",r.CANDIDATE="candidate",r.PUBLISH="publish",r.UNPUBLISH="unpublish",r.CONTROL="control",r.RESTART_ICE="restart_ice",r.ACK="ack",r.RESPONSE="response",r.JOIN="join",r.CHECK="check",r}({}),$S=function(r){return r.ABORT="abort",r}({}),N0=function(r){return r.MUTE_LOCAL_AUDIO="mute_local_audio",r.MUTE_LOCAL_VIDEO="mute_local_video",r.UNMUTE_LOCAL_AUDIO="unmute_local_audio",r.UNMUTE_LOCAL_VIDEO="unmute_local_video",r}({}),lAe=function(r){return r.P2P_TOKEN_TIMEOUT="p2p_token_timeout",r.P2P_TOKEN_CHANGED="p2p_token_changed",r}({}),cAe={[V8.ACCESS_POINT]:{[to.NO_FLAG_SET]:{desc:"flag is zero",retry:!1},[to.FLAG_SET_BUT_EMPTY]:{desc:"flag is empty",retry:!1},[to.INVALID_FALG_SET]:{desc:"invalid flag",retry:!1},[to.FLAG_SET_BUT_NO_RE]:{desc:"flag set unilbs but no request",retry:!1},[to.INVALID_SERVICE_ID]:{desc:"invalid service id",retry:!1},[to.NO_SERVICE_AVAILABLE]:{desc:"no service available",retry:!0},[to.NO_SERVICE_AVAILABLE_P2P]:{desc:"no unilbs p2p service available",retry:!0},[to.NO_SERVICE_AVAILABLE_VOICE]:{desc:"no unilbs voice service available",retry:!0},[to.NO_SERVICE_AVAILABLE_WEBRTC]:{desc:"no unilbs webrtc service available",retry:!0},[to.NO_SERVICE_AVAILABLE_CDS]:{desc:"no cds service available",retry:!0},[to.NO_SERVICE_AVAILABLE_CDN]:{desc:"no cdn dispatcher service available",retry:!0},[to.NO_SERVICE_AVAILABLE_TDS]:{desc:"no tds service available",retry:!0},[to.NO_SERVICE_AVAILABLE_REPORT]:{desc:"no unilbs report service available",retry:!0},[to.NO_SERVICE_AVAILABLE_APP_CENTER]:{desc:"no app center service available",retry:!0},[to.NO_SERVICE_AVAILABLE_ENV0]:{desc:"no unilbs sig env0 service available",retry:!0},[to.NO_SERVICE_AVAILABLE_VOET]:{desc:"no unilbs voet service available",retry:!0},[to.NO_SERVICE_AVAILABLE_STRING_UID]:{desc:"no string uid service available",retry:!0},[to.NO_SERVICE_AVAILABLE_WEBRTC_UNILBS]:{desc:"no webrtc unilbs service available",retry:!0}},[V8.UNILBS]:{[pu.INVALID_VENDOR_KEY]:{desc:"invalid vendor key, can not find appid",retry:!1},[pu.INVALID_CHANNEL_NAME]:{desc:"invalid channel name",retry:!1},[pu.INTERNAL_ERROR]:{desc:"unilbs internal error",retry:!1},[pu.NO_AUTHORIZED]:{desc:"invalid token, authorized failed",retry:!1},[pu.DYNAMIC_KEY_TIMEOUT]:{desc:"dynamic key or token timeout",retry:!1},[pu.NO_ACTIVE_STATUS]:{desc:"no active status",retry:!1},[pu.DYNAMIC_KEY_EXPIRED]:{desc:"dynamic key expired",retry:!1},[pu.STATIC_USE_DYNAMIC_KEY]:{desc:"static use dynamic key",retry:!1},[pu.DYNAMIC_USE_STATIC_KEY]:{desc:"dynamic use static key",retry:!1},[pu.USER_OVERLOAD]:{desc:"amount of users over load",retry:!1},[pu.FORBIDDEN_REGION]:{desc:"the request is forbidden in this area",retry:!1},[pu.CANNOT_MEET_AREA_DEMAND]:{desc:"unable to allocate services in this area",retry:!1}},[V8.STRING_UID_ALLOCATOR]:{[tG.IIIEGAL_APPID]:{desc:"invalid appid",retry:!1},[tG.IIIEGAL_UID]:{desc:"invalid string uid",retry:!1},[tG.INTERNAL_ERROR]:{desc:"string uid allocator internal error",retry:!0}}};function KS(r){let a=cAe[Math.floor(r/1e4)];if(!a)return{desc:"unknown error",retry:!1};let o=a[r%1e4];if(!o){if(Math.floor(r/1e4)===V8.ACCESS_POINT){let c=r%1e4;if(c.toString()[0]==="1")return{desc:r.toString(),retry:!1};if(c.toString()[0]==="2")return{desc:r.toString(),retry:!0}}return{desc:"unknown error",retry:!1}}return o}let dAe={[ln.K_TIMESTAMP_EXPIRED]:{desc:"K_TIMESTAMP_EXPIRED",action:"failed"},[ln.K_CHANNEL_PERMISSION_INVALID]:{desc:"K_CHANNEL_PERMISSION_INVALID",action:"failed"},[ln.K_CERTIFICATE_INVALID]:{desc:"K_CERTIFICATE_INVALID",action:"failed"},[ln.K_CHANNEL_NAME_EMPTY]:{desc:"K_CHANNEL_NAME_EMPTY",action:"failed"},[ln.K_CHANNEL_NOT_FOUND]:{desc:"K_CHANNEL_NOT_FOUND",action:"failed"},[ln.K_TICKET_INVALID]:{desc:"K_TICKET_INVALID",action:"failed"},[ln.K_CHANNEL_CONFLICTED]:{desc:"K_CHANNEL_CONFLICTED",action:"failed"},[ln.K_SERVICE_NOT_READY]:{desc:"K_SERVICE_NOT_READY",action:"tryNext"},[ln.K_SERVICE_TOO_HEAVY]:{desc:"K_SERVICE_TOO_HEAVY",action:"tryNext"},[ln.K_UID_BANNED]:{desc:"K_UID_BANNED",action:"failed"},[ln.K_IP_BANNED]:{desc:"K_IP_BANNED",action:"failed"},[ln.K_AUTO_REBALANCE]:{desc:"k_AUTO_REBALANCE",action:"recover"},[ln.ERR_INVALID_VENDOR_KEY]:{desc:"ERR_INVALID_VENDOR_KEY",action:"failed"},[ln.ERR_INVALID_CHANNEL_NAME]:{desc:"ERR_INVALID_CHANNEL_NAME",action:"failed"},[ln.WARN_NO_AVAILABLE_CHANNEL]:{desc:"WARN_NO_AVAILABLE_CHANNEL",action:"failed"},[ln.WARN_LOOKUP_CHANNEL_TIMEOUT]:{desc:"WARN_LOOKUP_CHANNEL_TIMEOUT",action:"tryNext"},[ln.WARN_LOOKUP_CHANNEL_REJECTED]:{desc:"WARN_LOOKUP_CHANNEL_REJECTED",action:"failed"},[ln.WARN_OPEN_CHANNEL_TIMEOUT]:{desc:"WARN_OPEN_CHANNEL_TIMEOUT",action:"tryNext"},[ln.WARN_OPEN_CHANNEL_REJECTED]:{desc:"WARN_OPEN_CHANNEL_REJECTED",action:"failed"},[ln.WARN_REQUEST_DEFERRED]:{desc:"WARN_REQUEST_DEFERRED",action:"failed"},[ln.ERR_DYNAMIC_KEY_TIMEOUT]:{desc:"ERR_DYNAMIC_KEY_TIMEOUT",action:"failed"},[ln.ERR_NO_AUTHORIZED]:{desc:"ERR_NO_AUTHORIZED",action:"failed"},[ln.ERR_VOM_SERVICE_UNAVAILABLE]:{desc:"ERR_VOM_SERVICE_UNAVAILABLE",action:"tryNext"},[ln.ERR_NO_CHANNEL_AVAILABLE_CODE]:{desc:"ERR_NO_CHANNEL_AVAILABLE_CODE",action:"failed"},[ln.ERR_MASTER_VOCS_UNAVAILABLE]:{desc:"ERR_MASTER_VOCS_UNAVAILABLE",action:"tryNext"},[ln.ERR_INTERNAL_ERROR]:{desc:"ERR_INTERNAL_ERROR",action:"tryNext"},[ln.ERR_NO_ACTIVE_STATUS]:{desc:"ERR_NO_ACTIVE_STATUS",action:"failed"},[ln.ERR_INVALID_UID]:{desc:"ERR_INVALID_UID",action:"failed"},[ln.ERR_DYNAMIC_KEY_EXPIRED]:{desc:"ERR_DYNAMIC_KEY_EXPIRED",action:"failed"},[ln.ERR_STATIC_USE_DYANMIC_KE]:{desc:"ERR_STATIC_USE_DYANMIC_KE",action:"failed"},[ln.ERR_DYNAMIC_USE_STATIC_KE]:{desc:"ERR_DYNAMIC_USE_STATIC_KE",action:"failed"},[ln.ERR_NO_VOCS_AVAILABLE]:{desc:"ERR_NO_VOCS_AVAILABLE",action:"tryNext"},[ln.ERR_NO_VOS_AVAILABLE]:{desc:"ERR_NO_VOS_AVAILABLE",action:"tryNext"},[ln.ERR_JOIN_CHANNEL_TIMEOUT]:{desc:"ERR_JOIN_CHANNEL_TIMEOUT",action:"tryNext"},[ln.ERR_JOIN_BY_MULTI_IP]:{desc:"ERR_JOIN_BY_MULTI_IP",action:"recover"},[ln.ERR_NOT_JOINED]:{desc:"ERR_NOT_JOINED",action:"failed"},[ln.ERR_REPEAT_JOIN_REQUEST]:{desc:"ERR_REPEAT_JOIN_REQUEST",action:"quit"},[ln.ERR_REPEAT_JOIN_CHANNEL]:{desc:"ERR_REPEAT_JOIN_CHANNEL",action:"quit"},[ln.ERR_INVALID_STRINGUID]:{desc:"ERR_INVALID_STRINGUID",action:"failed"},[ln.ERR_TOO_MANY_USERS]:{desc:"ERR_TOO_MANY_USERS",action:"tryNext"},[ln.ERR_SET_CLIENT_ROLE_TIMEOUT]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[ln.ERR_SET_CLIENT_ROLE_NO_PERMISSION]:{desc:"ERR_SET_CLIENT_ROLE_TIMEOUT",action:"failed"},[ln.ERR_SET_CLIENT_ROLE_ALREADY_IN_USE]:{desc:"ERR_SET_CLIENT_ROLE_ALREADY_IN_USE",action:"success"},[ln.ERR_PUBLISH_REQUEST_INVALID]:{desc:"ERR_PUBLISH_REQUEST_INVALID",action:"failed"},[ln.ERR_SUBSCRIBE_REQUEST_INVALID]:{desc:"ERR_SUBSCRIBE_REQUEST_INVALID",action:"failed"},[ln.ERR_NOT_SUPPORTED_MESSAGE]:{desc:"ERR_NOT_SUPPORTED_MESSAGE",action:"failed"},[ln.ERR_ILLEAGAL_PLUGIN]:{desc:"ERR_ILLEAGAL_PLUGIN",action:"failed"},[ln.ILLEGAL_CLIENT_ROLE_LEVEL]:{desc:"ILLEGAL_CLIENT_ROLE_LEVEL",action:"failed"},[ln.ERR_REJOIN_TOKEN_INVALID]:{desc:"ERR_REJOIN_TOKEN_INVALID",action:"failed"},[ln.ERR_REJOIN_USER_NOT_JOINED]:{desc:"ERR_REJOIN_NOT_JOINED",action:"failed"},[ln.ERR_INVALID_OPTIONAL_INFO]:{desc:"ERR_INVALID_OPTIONAL_INFO",action:"quit"},[ln.ERR_TEST_RECOVER]:{desc:"ERR_TEST_RECOVER",action:"recover"},[ln.ERR_TEST_TRYNEXT]:{desc:"ERR_TEST_TRYNEXT",action:"recover"},[ln.ERR_TEST_RETRY]:{desc:"ERR_TEST_RETRY",action:"recover"},[ln.ILLEGAL_AES_PASSWORD]:{desc:"ERR_TEST_RETRY",action:"failed"},[ln.ERR_TOO_MANY_BROADCASTERS]:{desc:"ERR_TOO_MANY_BROADCASTERS",action:"failed"},[ln.ERR_TOO_MANY_SUBSCRIBERS]:{desc:"ERR_TOO_MANY_SUBSCRIBERS",action:"failed"},[ln.ERR_LICENSE_ILLEGAL]:{desc:"ERR_LICENSE_ILLEGAL",action:"quit"},[ln.ERR_LICENSE_MISSING]:{desc:"ERR_LICENSE_MISSING",action:"quit"},[ln.ERR_LICENSE_EXPIRED]:{desc:"ERR_LICENSE_EXPIRED",action:"quit"},[ln.ERR_LICENSE_MINUTES_EXCEEDED]:{desc:"ERR_LICENSE_MINUTES_EXCEEDED",action:"quit"},[ln.ERR_LICENSE_PERIOD_INVALID]:{desc:"ERR_LICENSE_PERIOD_INVALID",action:"quit"},[ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE]:{desc:"ERR_LICENSE_MULTIPLE_SDK_SERVICE",action:"quit"}};function Ky(r){return dAe[r]||{desc:"UNKNOW_ERROR_".concat(r),action:"failed"}}function wie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function sG(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?wie(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):wie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Sie(r){return r.every(a=>a.readyState===WebSocket.CLOSED||a.readyState===WebSocket.CLOSING)}function bie(r,a){if(typeof r=="string")return r;let{proxy:o,host:c,port:f}=r;if(a){let m=ve("JOIN_GATEWAY_FALLBACK_PORT")||443;return m===443?"wss://".concat(c,"/ws/?p=").concat(Number(f)+150):"wss://".concat(c,":").concat(m,"/ws/?p=").concat(Number(f)+150)}return o?"wss://".concat(o,"/ws/?h=").concat(c,"&p=").concat(f):"wss://".concat(c,":").concat(f)}let uAe=/wss:\/\/(.+)\/ws\/\?h=(.+)&p=([0-9]+)\/?/,hAe=/wss:\/\/(.+)\/ws\/\?p=([0-9]+)\/?/,fAe=/wss:\/\/(.+):([0-9]+)\/?/,pAe=/wss:\/\/(.[^\/]+)\/?/,mAe=0;class gAe{constructor(a,o){X(this,"id",0),X(this,"store",void 0),X(this,"recordIndex",void 0),X(this,"websockets",[]),X(this,"try443PortDuration",2e3),X(this,"forceCloseWSDuration",5e3),X(this,"try443PortTimeout",null),X(this,"forceCloseTimeout",null),X(this,"isTry443PortFailed",!1),X(this,"isNormalPortFailed",!1),X(this,"useDoubleDomain",!1),X(this,"useProxy",!1),X(this,"startTime",Date.now()),this.id=++mAe,this.try443PortDuration=ve("JOIN_GATEWAY_TRY_443PORT_DURATION")||2e3,this.forceCloseWSDuration=a||5e3,this.store=o}closeAllWebsockets(){this.websockets.forEach(a=>{a.onopen=null,a.onclose=null,a.onmessage=null,a.close()}),this.websockets.length=0}clearTimeout(){this.forceCloseTimeout&&clearTimeout(this.forceCloseTimeout),this.try443PortTimeout&&clearTimeout(this.try443PortTimeout)}logger(){var a;let o=Date.now()-this.startTime;for(var c=arguments.length,f=new Array(c),m=0;m<c;m++)f[m]=arguments[m];z.debug("[choose-best-ws ".concat((a=this.store)===null||a===void 0?void 0:a.clientId," ").concat(this.id,"] ").concat(o,"ms:"),...f)}createWebSocket(a,o,c){this.logger("createWebSocket:",a,{isTry443Port:o,hasTimeoutDetection:c});let f=ve("GATEWAY_DOMAINS"),m=Date.now(),v=[],w=f.find(x=>{var L;return Tt(L=a.host).call(L,x)});w||(this.useDoubleDomain=!1);let C=[];if(this.useDoubleDomain)f.forEach(x=>{C.push(bie(sG(sG({},a),{},{host:a.host.replace(w,x)}),o))});else{let x=sG({},a);if(o&&w){let L=f.find(U=>U!==w);L&&(x.host=x.host.replace(w,L))}C.push(bie(x,o))}try{C.forEach(x=>{let L=new WebSocket(x);L.binaryType="arraybuffer",v.push(L),this.logger("ws is connecting:",L.url)})}catch(x){if(this.logger("ws create failed"),v.forEach(L=>L.close()),v.length=0,this.useDoubleDomain)return this.useDoubleDomain=!1,this.createWebSocket(a,o,c);if(!o&&Number(a.port)!==443)return this.createWebSocket(a,!0,c);throw new De(ce.WS_ERR,"init websocket failed! Error: ".concat(x.toString()))}let R=u3();return this.store&&this.store.recordJoinChannelService({urls:v.map(x=>x.url),service:"gateway"},this.recordIndex),v.forEach(x=>{x.onopen=()=>{this.logger("onopen: ws ".concat(x.url," open cost ").concat(Date.now()-m,"ms")),this.websockets.forEach(L=>{L!==x&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.close(),this.logger("close backup websocket: ".concat(L.url)))}),this.websockets.length=0,R.resolve(x)},x.onclose=L=>{this.logger("onclose: ws ".concat(x.url," closed cost ").concat(Date.now()-m,"ms state: ").concat(x.readyState)),o?this.isTry443PortFailed=Sie(v):this.isNormalPortFailed=Sie(v),this.logger("443: ".concat(this.useProxy?"not try":this.isTry443PortFailed?"failed":"trying"," 47xx: ").concat(this.isNormalPortFailed?"failed":"trying")),(o&&this.isTry443PortFailed||!o&&(this.isTry443PortFailed||this.useProxy)&&this.isNormalPortFailed)&&(this.logger("onclose: all websocket is closed, ".concat(L.reason)),R.reject({code:L.code,reason:y3.A_ROUND_WS_FAILED}))},x.onmessage=L=>this.logger("".concat(x.url," onmessage: ").concat(L.data))}),this.websockets.push(...v),c||(()=>{let x=()=>{this.logger("5s timeout close un-opens, isWebsocket created: ",R.isResolved),this.websockets.forEach(L=>L.readyState!==WebSocket.OPEN&&L.close())};if(o||this.useProxy)return this.logger("add 5s timeout at ".concat(o?"try-443":"proxy"," condition")),this.forceCloseTimeout=window.setTimeout(x,this.forceCloseWSDuration);this.try443PortTimeout=window.setTimeout(()=>{if(this.logger("2s timeout, isWebsocket created: ",R.isResolved),R.isResolved)return x();ni().os===ms.MAC_OS&&Pi()&&x(),this.createWebSocket(a,!0,!0).then(L=>R.resolve(L)).catch(L=>{this.isNormalPortFailed&&R.reject(L),this.logger("try 443 port to create ws failed")}),this.forceCloseTimeout=window.setTimeout(x,this.forceCloseWSDuration)},this.try443PortDuration)})(),R.promise}chooseBestWebsocket(a,o,c,f){return this.useDoubleDomain=!!o,typeof a=="string"&&(a=function(m){let v,w,C;return[,v,w,C]=m.match(uAe)||[],v||([,w,C]=m.match(hAe)||[]),w&&C||([,w,C]=m.match(fAe)||[]),w&&C||([,w]=m.match(pAe)||[]),w||z.warning("un-destructible url: ",m),{proxy:v,host:w,port:C||"443"}}(a)),this.recordIndex=f,this.useProxy=!!a.proxy,c&&this.useProxy&&(z.warn("cannot use 443 only when use proxy"),c=!1),this.createWebSocket(a,!!c,!1).finally(()=>this.clearTimeout())}}function Cie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class Tie extends nr{get url(){return this.websocket&&this.websocket.url||null}get reconnectMode(){return this._reconnectMode}set reconnectMode(a){var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.resetReconnectCount(a),this._reconnectMode=a}get state(){return this._state}set state(a){a!==this._state&&(this._state=a,this._state==="reconnecting"?this.emit(En.RECONNECTING,this.reconnectReason):this._state==="connected"?this.emit(En.CONNECTED):this._state==="closed"?this.emit(En.CLOSED):this._state==="failed"&&this.emit(En.FAILED))}resetReconnectCount(a){z.debug("websocket reset reconnect count, reason: "+a),this.reconnectCount=0}constructor(a,o){let c=arguments.length>2&&arguments[2]!==void 0&&arguments[2],f=arguments.length>3&&arguments[3]!==void 0&&arguments[3],m=arguments.length>4&&arguments[4]!==void 0&&arguments[4],v=arguments.length>5?arguments[5]:void 0;super(),X(this,"connectionID",0),X(this,"currentURLIndex",0),X(this,"urls",[]),X(this,"_reconnectMode","tryNext"),X(this,"reconnectReason",void 0),X(this,"_initMutex",new Ts("websocket")),X(this,"name",void 0),X(this,"_state","closed"),X(this,"reconnectInterrupter",void 0),X(this,"websocket",void 0),X(this,"retryConfig",void 0),X(this,"reconnectCount",0),X(this,"forceCloseTimeout",5e3),X(this,"onlineReconnectListener",void 0),X(this,"useCompress",void 0),X(this,"tryDoubleDomain",!1),X(this,"use443PortOnly",!1),X(this,"wsInflateLength",0),X(this,"wsDeflateLength",0),X(this,"closeEstablishingWs",()=>{}),X(this,"store",void 0),X(this,"joinGatewayRecordIndex",void 0),this.store=v,this.name=a,this.retryConfig=function(L){for(var U=1;U<arguments.length;U++){var F=arguments[U]!=null?arguments[U]:{};U%2?Cie(Object(F),!0).forEach(function(Z){X(L,Z,F[Z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors(F)):Cie(Object(F)).forEach(function(Z){Object.defineProperty(L,Z,Object.getOwnPropertyDescriptor(F,Z))})}return L}({},o),this.useCompress=c,this.tryDoubleDomain=f,this.use443PortOnly=m;let{timeout:w,timeoutFactor:C}=o,R=Math.max(300,Math.floor(3*w/5)),x=Math.max(1.2,Math.floor(8*C)/10);eo.ONLINE&&(this.retryConfig.timeout=R,this.retryConfig.timeoutFactor=x),yr.on(By.NETWORK_STATE_CHANGE,(L,U)=>{L!==U&&(this.resetReconnectCount("network state change: ".concat(U," -> ").concat(L)),L===eo.ONLINE?(this.retryConfig.timeout=R,this.retryConfig.timeoutFactor=x):(this.retryConfig.timeout=w,this.retryConfig.timeoutFactor=C))})}getConnection(){return this.websocket||void 0}async init(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,c=await this._initMutex.lock();this.forceCloseTimeout=o,this.urls=a,this.state="connecting";try{let f=u3(),m=this.urls[this.currentURLIndex];this.createWebSocketConnection(m).then(f.resolve).catch(f.reject),this.once(En.CLOSED,()=>{f.reject(new Ke(ce.WS_DISCONNECT))}),this.once(En.CONNECTED,f.resolve),await f.promise}catch{}finally{c()}}close(a,o){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this.reconnectInterrupter&&this.reconnectInterrupter(),this.websocket){this.websocket.onclose=null,this.websocket.onopen=null,this.websocket.onmessage=null;let c=this.websocket;o?setTimeout(()=>c.close(),500):c.close(),this.websocket=void 0}this.state=a?"failed":"closed",this.closeEstablishingWs&&this.closeEstablishingWs()}reconnect(a,o){if(!this.websocket)return void z.warning("[".concat(this.name,"] can not reconnect, no websocket"));a!==void 0&&(this.reconnectMode=a),z.debug("[".concat(this.name,"] reconnect is triggered initiative")),typeof this.joinGatewayRecordIndex=="number"&&this.store&&this.store.recordJoinChannelService({status:"error",errors:[new Error(o)]},this.joinGatewayRecordIndex);let c=this.websocket.onclose;this.websocket.onclose=null,this.websocket.close(),c&&c.bind(this.websocket)({code:9999,reason:o})}sendMessage(a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Ke(ce.WS_ABORT,"websocket is not ready");try{o||(a=JSON.stringify(a)),this.websocket.send(a)}catch(c){throw new Ke(ce.WS_ERR,"send websocket message error"+c.toString())}}setWsInflateData(a){this.wsDeflateLength=this.wsDeflateLength+a.originLength,this.wsInflateLength=this.wsInflateLength+a.compressedLength}getWsInflateData(){let a=this.wsInflateLength,o=this.wsDeflateLength;return this.clearWsInflateData(),{wsInflateLength:a,wsDeflateLength:o}}clearWsInflateData(){this.wsInflateLength=0,this.wsDeflateLength=0}async createWebSocketConnection(a){var o;let c=u3();this.connectionID+=1,this.joinGatewayRecordIndex=void 0;let f=x=>{var L;(L=this.store)===null||L===void 0||L.signalChannelOpen(),z.debug("[".concat(this.name,"] websocket opened:"),x),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),c.resolve()},m=async x=>{var L;if(z.debug("[".concat(this.name,"] websocket close ").concat((L=this.websocket)===null||L===void 0?void 0:L.url,", code: ").concat(x.code,", reason: ").concat(x.reason,", current mode: ").concat(this.reconnectMode)),this.reconnectCount>=this.retryConfig.maxRetryCount)c.reject(new Ke(ce.WS_DISCONNECT,"websocket close: ".concat(x.code))),this.close();else{this.state==="connected"&&(this.reconnectReason=x.reason,this.state="reconnecting");let U=Ml(this,En.WILL_RECONNECT,this.reconnectMode,x.reason)||this.reconnectMode,F=await this.reconnectWithAction(U);if(this.state==="closed")return void z.debug("[".concat(this.connectionID,"] ws is closed, no need to reconnect"));if(!F)return c.reject(new Ke(ce.WS_DISCONNECT,"websocket reconnect failed: ".concat(x.code))),this.close(!0);c.resolve()}},v=x=>{this.emit(En.ON_MESSAGE,x)},w=x=>{z.warn("[".concat(this.connectionID,"] ws open error ").concat(x))};this.websocket&&(this.websocket.onclose=null,this.websocket.close()),ve("GATEWAY_WSS_ADDRESS")&&this.name.startsWith("gateway")&&(a=ve("GATEWAY_WSS_ADDRESS")),z.debug("[".concat(this.name,"] start connect, url:"),a);let C=(o=this.store)===null||o===void 0?void 0:o.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"gateway"});try{var R;let x=await this.chooseBestWebsocketConnection(a);this.websocket=x,f&&f(this.websocket.url),this.websocket.onclose=m,this.websocket.onmessage=v,this.websocket.onerror=w,(R=this.store)===null||R===void 0||R.recordJoinChannelService({endTs:Date.now(),status:"success"},C),this.joinGatewayRecordIndex=C}catch(x){let L=this.state==="closed",U=x instanceof Ke,F=U&&x.code===ce.WS_ABORT,Z=U&&x.code===ce.WS_ERR,W=U?x.message:x&&(x.reason||x.toString());z.warning("[choose-best-ws] chooseBestWebsocket error: ".concat(W)),this.store&&this.store.recordJoinChannelService({endTs:Date.now(),status:F?"aborted":"error",errors:[x]},C),L||Z?(c.reject(L?new Ke(ce.WS_DISCONNECT,"websocket is closed: ".concat(W)):new Ke(ce.WS_ERR,"init websocket failed: ".concat(W))),Z&&z.error("[".concat(this.name,"] init websocket failed: ").concat(W))):m&&m(x)}return c.promise}async reconnectWithAction(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this.reconnectCount>=this.retryConfig.maxRetryCount||this.urls.length===0||this.state==="closed")return!1;z.warning("[choose-best-ws] action: =>",a),this.onlineReconnectListener||yr.isOnline||!yr.onlineWaiter||(this.onlineReconnectListener=yr.onlineWaiter.then(()=>{this.onlineReconnectListener=void 0}));let c=!0;if(this.reconnectInterrupter=()=>c=!1,o){let v=j8(this.reconnectCount,this.retryConfig);z.debug("[".concat(this.name,"] wait ").concat(v,"ms to reconnect websocket, mode: ").concat(a)),await Ct.race([vs(v),this.onlineReconnectListener||new Ct(()=>{})])}if(this._state==="closed"||!c)return!1;this.reconnectCount+=1;let f=async(v,w)=>{this.emit(En.RECONNECT_CREATE_CONNECTION,w),await this.createWebSocketConnection(v)};try{if(a==="retry")this.emit(En.RECONNECT_WAITTING_FINISH,a),await f(this.urls[this.currentURLIndex],a);else if(a==="tryNext"){if(this.currentURLIndex+=1,this.currentURLIndex>=this.urls.length)return this.reconnectWithAction("recover",!1);z.debug("[".concat(this.name,"] websocket url length: ").concat(this.urls.length," current index: ").concat(this.currentURLIndex)),this.emit(En.RECONNECT_WAITTING_FINISH,a),await f(this.urls[this.currentURLIndex],a)}else a==="recover"&&(z.debug("[".concat(this.name,"] request new urls")),this.resetReconnectCount("recover mode"),this.emit(En.RECONNECT_WAITTING_FINISH,a),this.urls=await Kr(this,En.REQUEST_NEW_URLS),this.currentURLIndex=0,await f(this.urls[this.currentURLIndex],a))}catch(v){var m;z.error("[".concat(this.name,"] reconnect failed ").concat(v&&v.toString()));let w=v==null||(m=v.data)===null||m===void 0?void 0:m.desc;return Array.isArray(w)&&Tt(w).call(w,"dynamic key expired")?(this.emit(En.ON_TOKEN_PRIVILEGE_DID_EXPIRE),!1):this.reconnectWithAction(a,o)}return!0}}class _3 extends Tie{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments.length>4&&arguments[4]!==void 0&&arguments[4],arguments.length>5?arguments[5]:void 0)}async chooseBestWebsocketConnection(a,o){let c=u3(),f=function(v,w){return new gAe(v,w)}(this.forceCloseTimeout,this.store);this.closeEstablishingWs=()=>{z.debug("[choose-best-ws] close establishing websockets"),f.closeAllWebsockets(),c.reject(new Ke(ce.WS_ABORT,"choose best websocket aborted"))};let m=ve("GATEWAY_DOMAINS");return z.debug("[choose-best-ws] currentDomain: ",a,", domains: ",m,"total: ".concat(this.urls.length),"current: ".concat(this.currentURLIndex+1)),f.chooseBestWebsocket(a,this.tryDoubleDomain,this.use443PortOnly,o).then(c.resolve).catch(c.reject),c.promise.finally(()=>{this.closeEstablishingWs=void 0})}}class E3 extends Tie{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3&&arguments[3]!==void 0&&arguments[3],arguments.length>4&&arguments[4]!==void 0&&arguments[4],arguments.length>5?arguments[5]:void 0)}async chooseBestWebsocketConnection(a,o){return new Ct((c,f)=>{let m=!1,v=[];this.closeEstablishingWs=()=>{z.debug("[choose-best-ws] close establishing websockets"),v.forEach(Z=>{Z.onclose=null,Z.onopen=null,Z.onmessage=null,Z.close()}),f(new Ke(ce.WS_ABORT,"choose best websocket aborted"))};let w=ve("GATEWAY_DOMAINS"),C,R=a.indexOf("?h="),x=w.find(Z=>R!==-1?Tt(a).call(a,Z,R):Tt(a).call(a,Z));z.debug("[choose-best-ws] currentDomain: ",x,", domains: ",w);let L=!this.tryDoubleDomain||!x;if(!L&&x){var U;let Z=Date.now();try{w.forEach(W=>{let K=R===-1?a.replace(x,W):a.substr(0,R)+a.substr(R).replace(x,W),oe=new WebSocket(K);oe.binaryType="arraybuffer",v.push(oe),z.debug("[choose-best-ws] ws is connecting:",oe.url)})}catch{for(z.debug("[choose-best-ws] ws create failed, fallback to single url"),v.forEach(W=>W.close());v.length;)v.pop();L=!0}(U=this.store)===null||U===void 0||U.recordJoinChannelService({urls:v.map(W=>W.url),service:"gateway"},o),v.forEach(W=>{W.onopen=()=>{if(m)return;let K=Date.now()-Z;z.debug("[choose-best-ws] ws open cost ".concat(K,"ms")),v.filter(oe=>oe!==W).forEach(oe=>{z.debug("[choose-best-ws]close backup websocket: ".concat(oe.url)),oe.close()}),m=!0,c(W)},W.onclose=K=>{C=K,!m&&(v.find(oe=>!(oe.readyState===WebSocket.CLOSED||oe.readyState===WebSocket.CLOSING))||(z.debug("[choose-best-ws] all websocket is closed"),m=!0,f(C)))},W.onmessage=K=>{z.debug("[choose-best-ws]".concat(W.url," onmessage: ").concat(K.data))}}),vs(this.forceCloseTimeout).then(()=>{v.forEach(W=>{W.readyState!==WebSocket.OPEN&&W.close()})})}if(L){var F;let Z;z.debug("[choose-best-ws] use single url: ",a),(F=this.store)===null||F===void 0||F.recordJoinChannelService({urls:[a],service:"gateway"},o);try{Z=new WebSocket(a),v.push(Z),Z.binaryType="arraybuffer"}catch(W){let K=new Ke(ce.WS_ERR,"init websocket failed! Error: ".concat(W.toString()));return z.error("[".concat(this.name,"]").concat(K)),void f(K)}Z.onopen=()=>{c(Z)},Z.onclose=W=>{f(W)},Z.onmessage=W=>{z.debug("[choose-best-ws]".concat(Z.url," onmessage: ").concat(W.data))},vs(this.forceCloseTimeout).then(()=>{Z&&Z.readyState!==WebSocket.OPEN&&Z.close()})}}).then(c=>(this.closeEstablishingWs=void 0,c)).catch(c=>{throw this.closeEstablishingWs=void 0,c})}}class Rie extends nr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===Vn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===Vn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===Vn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket&&this.websocket.url||null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",Vn.CLOSED),X(this,"reconnectToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new HH(5)),X(this,"pingpongTimer",void 0),X(this,"wsInflateDataTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"onWebsocketMessage",c=>{if(c.data instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c.data);let f=JSON.parse(c.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let m="res-@".concat(f._id);this.emit(m,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")){if(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED)switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}if(f._type===Sn.ON_USER_LICENSE_BANNED)switch(f._message.error_code){case ln.ERR_LICENSE_MISSING:this.close(Hn.LICENSE_MISSING);break;case ln.ERR_LICENSE_EXPIRED:this.close(Hn.LICENSE_EXPIRED);break;case ln.ERR_LICENSE_MINUTES_EXCEEDED:this.close(Hn.LICENSE_MINUTES_EXCEEDED);break;case ln.ERR_LICENSE_PERIOD_INVALID:this.close(Hn.LICENSE_PERIOD_INVALID);break;case ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE:this.close(Hn.LICENSE_MULTIPLE_SDK_SERVICE);break;case ln.ERR_LICENSE_ILLEGAL:this.close(Hn.LICENSE_ILLEGAL);break;default:this.close()}}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new _3("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===Vn.CONNECTED&&this.reconnect("retry",$s.OFFLINE)})}async request(a,o,c,f){let m=Di(6,""),v={_id:m,_type:a,_message:o},w=this.websocket.connectionID,C=()=>new Ct((Z,W)=>{if(this.connectionState===Vn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new De(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe),a!==rn.PUBLISH&&a!==rn.PUBLISH_DATASTREAM&&a!==rn.SUBSCRIBE&&a!==rn.SUBSCRIBE_DATASTREAM&&a!==rn.UNSUBSCRIBE&&a!==rn.UNSUBSCRIBE_DATASTREAM&&a!==rn.UNPUBLISH&&a!==rn.UNPUBLISH_DATASTREAM&&a!==rn.CONTROL&&a!==rn.RESTART_ICE||this.once(Ut.DISCONNECT_P2P,()=>{W(new De(ce.DISCONNECT_P2P))}),a!==rn.PUBLISH&&a!==rn.RESTART_ICE||this.once(Ut.ABORT_P2P_EXECUTION,()=>{W(new De(ce.DISCONNECT_P2P))})});if(this.connectionState!==Vn.CONNECTING&&this.connectionState!==Vn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await C(),this.websocket.sendMessage(v,!0),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Oe)=>{K=!0,Z({isSuccess:xe==="success",message:Oe||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(m),oe);let ue=()=>{W(new De(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(m),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),vs(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("[".concat(this.clientId,"] ws request timeout, type: ").concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),x=null;try{x=await R}catch(Z){if(this.connectionState===Vn.CLOSED||a===rn.LEAVE)throw new De(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await C(),await this.request(a,o))}if(x.isSuccess)return x.message;let L=Number(x.message.error_code||x.message.code),U=Ky(L),F=new De(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(x.message.error_str),{code:L,data:x.message});return U.action==="success"?x.message:(z.warning("[".concat(this.clientId,"] [").concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=x.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",$s.MULTI_IP)):this.reconnect(U.action,$s.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=m=>{(!o||o(m))&&(this.off(a,f),c(m))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload($y.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==Vn.CONNECTED)return;let m=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(m._type,m._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}init(a,o){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((c,f)=>{this.once(Ut.WS_CONNECTED,()=>c(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>f(this.initError||new De(ce.WS_ABORT))),this.connectionState=Vn.CONNECTING,this.websocket.init(a).catch(f),this.wsInflateDataTimer&&window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=window.setInterval(()=>{this.handleWsInflateData()},2e4)})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.wsInflateDataTimer&&(this.handleWsInflateData(),window.clearInterval(this.wsInflateDataTimer),this.wsInflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=a||Hn.LEAVE,this.connectionState=Vn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new _3("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),this.store),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Kr(this,Ut.REQUEST_JOIN_INFO),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,y3.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=Vn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new De(ce.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");let a=Vy(this,Ut.REQUEST_REJOIN_INFO);a.token=this.reconnectToken;let o=await this.request(rn.REJOIN,a);return!!o&&(this.connectionState=Vn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),o.peers&&o.peers.forEach(c=>{this.emit(Sn.ON_USER_ONLINE,{uid:c.uid}),c.audio&&this.emit(Sn.ON_ADD_AUDIO_STREAM,{uid:c.uid,uint_id:c.uint_id,audio:!0,ssrcId:c.audio_ssrc}),c.video&&this.emit(Sn.ON_ADD_VIDEO_STREAM,{uid:c.uid,uint_id:c.uint_id,video:!0,ssrcId:c.video_ssrc}),c.audio_mute?this.emit(Sn.MUTE_AUDIO,{uid:c.uid}):this.emit(Sn.UNMUTE_AUDIO,{uid:c.uid}),c.video_mute?this.emit(Sn.MUTE_VIDEO,{uid:c.uid}):this.emit(Sn.UNMUTE_VIDEO,{uid:c.uid}),c.audio_enable_local?this.emit(Sn.ENABLE_LOCAL_AUDIO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_AUDIO,{uid:c.uid}),c.video_enable_local?this.emit(Sn.ENABLE_LOCAL_VIDEO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_VIDEO,{uid:c.uid}),c.audio||c.video||this.emit(Sn.ON_REMOVE_STREAM,{uid:c.uid,uint_id:c.uint_id})}),!0)}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=Ky(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,$s.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("[".concat(this.clientId,"] PING-PONG Timeout. Last Socket Message: ").concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",$s.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleWsInflateData(){let{wsInflateLength:a,wsDeflateLength:o}=this.websocket.getWsInflateData();a!==0&&o!==0&&this.upload($y.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:o,ws_inflate_length:a})}handleWebsocketEvents(){this.websocket.on(En.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(En.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(En.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(En.CLOSED,()=>{this.connectionState=Vn.CLOSED}),this.websocket.on(En.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=Vn.CLOSED}),this.websocket.on(En.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===Vn.CONNECTED?this.connectionState=Vn.RECONNECTING:this.connectionState=Vn.CONNECTING}),this.websocket.on(En.WILL_RECONNECT,(a,o,c)=>{let f=Vy(this,Ut.IS_P2P_DISCONNECTED),m=f||a!=="retry";f&&a==="retry"&&(z.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),a="tryNext",o=y3.P2P_DISCONNECTED),m&&(z.debug("".concat(this.clientId," will renewSession, reconnect mode: ").concat(a)),this.emit(Ut.REPORT_JOIN_GATEWAY,o||y3.UNKNOWN_REASON,this.url||""),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION,this.websocket.currentURLIndex>=this.websocket.urls.length-1?"recover":a),this.emit(Ut.DISCONNECT_P2P)),c(a)}),this.websocket.on(En.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch(a=>{z.warning("[".concat(this.clientId,"] rejoin failed ").concat(a)),this.reconnect("tryNext",$s.SERVER_ERROR)}):this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code||y3.UNKNOWN_REASON,this.url||""),a instanceof De){if(a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return this.initError=new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"AgoraRTCError CAN_NOT_GET_GATEWAY_SERVER: dynamic key expired"),z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",$s.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",$s.SERVER_ERROR):(this.initError=a,this.close())}})}),this.websocket.on(En.REQUEST_NEW_URLS,(a,o)=>{Kr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(En.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)})}}let Mr=function(r){return r[r.CHOOSE_SERVER=11]="CHOOSE_SERVER",r[r.CLOUD_PROXY=18]="CLOUD_PROXY",r[r.CLOUD_PROXY_5=20]="CLOUD_PROXY_5",r[r.CLOUD_PROXY_FALLBACK=26]="CLOUD_PROXY_FALLBACK",r}({});function xie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function K8(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?xie(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):xie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function O0(r){return r.match(/^[\.\:\d]+$/)?"".concat(r.replace(/[^\d]/g,"-"),".").concat(ve("TURN_DOMAIN")):(z.info("Unidentified as ip: ".concat(r,", use as host")),r)}function aG(r,a){r.addresses||(r.addresses=[]);let o=function(m,v){if(ve("CONNECT_GATEWAY_WITHOUT_DOMAIN"))return m.map(R=>{let{ip:x,port:L}=R;return{address:"".concat(x,":").concat(L)}});let w=ve("GATEWAY_DOMAINS"),C=w[1]&&Tt(v).call(v,w[1])?1:0;return m.map(R=>{let{domain_prefix:x,port:L,ip:U}=R;if(x)return{address:"".concat(x,".").concat(w[C++%w.length],":").concat(L)};let F=/^[\.\:\d]+$/.test(U),Z=F?"".concat(U.replace(/[^\d]/g,"-"),".").concat(w[C++%w.length],":").concat(L):"".concat(U,":").concat(L);return F||z.info("Unidentified as ip: ".concat(U,", use as host")),{ip:U,port:L,address:Z}})}(r.addresses,a),c=Array.isArray(r.detail)&&r.detail[18];if(c&&typeof c=="string"){let m=c.split(";");for(let v=0;v<m.length;v++){var f;let w=ks(f=m[v]).call(f);o[v]&&w&&(o[v].ip6=w)}}return{gatewayAddrs:o,uid:r.uid,cid:r.cid,cert:r.cert,vid:r.detail&&r.detail[8],uni_lbs_ip:r.detail&&r.detail[1],res:r,csIp:r.detail&&r.detail[502]}}function rl(r){return typeof r=="number"?r:r.exact||r.ideal||r.max||r.min||0}function Aie(r){let a=r._encoderConfig;if(!a)return{};let o={resolution:a.width&&a.height?"".concat(rl(a.width),"x").concat(rl(a.height)):void 0,maxVideoBW:a.bitrateMax,minVideoBW:a.bitrateMin};return typeof a.frameRate=="number"?(o.maxFrameRate=a.frameRate,o.minFrameRate=a.frameRate):a.frameRate&&(o.maxFrameRate=a.frameRate.max||a.frameRate.ideal||a.frameRate.exact||a.frameRate.min,o.minFrameRate=a.frameRate.min||a.frameRate.ideal||a.frameRate.exact||a.frameRate.max),o}function Iie(r){return r>=0&&r<.17?1:r>=.17&&r<.36?2:r>=.36&&r<.59?3:r>=.59&&r<=1?4:r>1?5:0}function w3(r,a){let o,c,f;switch(a){case Mr.CHOOSE_SERVER:c=4096,f="choose server";break;case Mr.CLOUD_PROXY:c=1048576,f="proxy";break;case Mr.CLOUD_PROXY_5:c=4194304,f="proxy5";break;case Mr.CLOUD_PROXY_FALLBACK:c=4194310,f="proxy fallback";break;default:throw new De(ce.UNEXPECTED_ERROR,"multi unlibs response transformer get unknown service id",{csIp:r.detail&&r.detail[502],retry:!1})}if(r.response_body.forEach(m=>{m.buffer&&m.buffer.flag===c&&(o={code:m.buffer.code,addresses:(m.buffer.edges_services||[]).map(v=>K8(K8({},v),{},{ticket:m.buffer.cert})),server_ts:r.enter_ts,uid:m.buffer.uid,cid:m.buffer.cid,cname:m.buffer.cname,detail:K8(K8({},m.buffer.detail),r.detail),flag:m.buffer.flag,opid:r.opid,cert:m.buffer.cert})}),!o)throw new De(ce.MULTI_UNILBS_RESPONSE_ERROR,"cannot parse response ".concat(f," from multi unilbs response"),{csIp:r.detail&&r.detail[502]});return o}async function Nie(r,a){return await Ct.all(r.addresses.map(async o=>({address:O0(o.ip),tcpport:o.port,udpport:o.port,username:a&&ve("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?a.toString():Ks.username,password:a&&ve("ENCRYPT_PROXY_USERNAME_AND_PSW")&&window.isSecureContext?await BH(a.toString()):Ks.password})))}function oG(r,a){let o=a.getMediaStreamTrack(!0).getSettings(),c=a.videoHeight||o.height,f=a.videoWidth||o.width;return c&&f?Math.max(Math.min(c,f)/Math.min(rl(r.height),rl(r.width)),1):(z.warning("can't get ori-track's height, default scale down 4 times for low stream"),4)}function P0(r){let{candidateType:a,relayProtocol:o,type:c,address:f,port:m,protocol:v}=r;return c==="local-candidate"?{candidateType:a,relayProtocol:o,protocol:v}:{candidateType:a,relayProtocol:o,address:f,port:m,protocol:v}}function Oie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class vAe extends nr{get url(){return this._url?this._url:null}get reconnectMode(){return this._reconnectMode}set reconnectMode(a){var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.resetReconnectCount(a),this._reconnectMode=a}get state(){return this._state}set state(a){a!==this._state&&(this._state=a,this._state==="reconnecting"?this.emit(qr.RECONNECTING,this.reconnectReason):this._state==="connected"?this.emit(qr.CONNECTED):this._state==="closed"?this.emit(qr.CLOSED):this._state==="failed"&&this.emit(qr.FAILED))}constructor(a,o,c,f){super(),X(this,"connectionID",0),X(this,"currentURLIndex",0),X(this,"reconnectReason",void 0),X(this,"_reconnectMode","tryNext"),X(this,"_initMutex",void 0),X(this,"_name",void 0),X(this,"_state","closed"),X(this,"_reconnectInterrupter",void 0),X(this,"_url",void 0),X(this,"_retryConfig",void 0),X(this,"_reconnectCount",0),X(this,"_forceCloseTimeout",5e3),X(this,"_onlineReconnectListener",void 0),X(this,"_closeEstablishingTransmitter",()=>{}),X(this,"_store",void 0),X(this,"_joinChannelServiceRecordIndex",void 0),X(this,"_transmitter",void 0),X(this,"_useCompress",void 0),X(this,"_inflateLength",0),X(this,"_deflateLength",0),this._store=f,this._name=a,this._retryConfig=function(m){for(var v=1;v<arguments.length;v++){var w=arguments[v]!=null?arguments[v]:{};v%2?Oie(Object(w),!0).forEach(function(C){X(m,C,w[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(w)):Oie(Object(w)).forEach(function(C){Object.defineProperty(m,C,Object.getOwnPropertyDescriptor(w,C))})}return m}({},o),this._useCompress=c}resetReconnectCount(a){z.debug("".concat(this._name," reset reconnect count, reason: ").concat(a)),this._reconnectCount=0}close(a,o){if(this.currentURLIndex=0,this.resetReconnectCount("close"),this._reconnectInterrupter&&this._reconnectInterrupter(),this._transmitter){this._transmitter.onclose=null,this._transmitter.onopen=null,this._transmitter.onmessage=null;let c=this._transmitter;o?setTimeout(()=>c.close(),500):c.close(),this._transmitter=void 0}this.state=a?"failed":"closed",this._closeEstablishingTransmitter&&this._closeEstablishingTransmitter()}reconnect(a,o){if(!this._transmitter)return void z.warning("[".concat(this._name,"] can not reconnect, no websocket"));var c;a!==void 0&&(this.reconnectMode=a),z.debug("[".concat(this._name,"] reconnect is triggered initiative")),typeof this._joinChannelServiceRecordIndex=="number"&&((c=this._store)===null||c===void 0||c.recordJoinChannelService({status:"error",errors:[new Error(o)]},this._joinChannelServiceRecordIndex));let f=this._transmitter.onclose;this._transmitter.onclose=null,this._transmitter.close(),f&&f.bind(this._transmitter)({code:9999,reason:o})}getInflateData(){let a=this._inflateLength,o=this._deflateLength;return this.clearInflateData(),{inflateLength:a,deflateLength:o}}setInflateData(a){this._deflateLength=this._deflateLength+a.originLength,this._inflateLength=this._inflateLength+a.compressedLength}clearInflateData(){this._inflateLength=0,this._deflateLength=0}}let Ch=function(r){return r[r.Default=0]="Default",r[r.Ack=1]="Ack",r}({});class yAe{constructor(a,o,c){X(this,"version",1),X(this,"initialRTO",void 0),X(this,"maxBatchAckCount",void 0),X(this,"maxRTO",void 0),X(this,"initialRTT",void 0),X(this,"ID",void 0),X(this,"rtt",void 0),X(this,"packetNumber",1),X(this,"rtoRatioMap",new Map),X(this,"timeoutMap",new Map),X(this,"unorderedPacketQueue",[]),X(this,"batchAckPacketQueue",[]),X(this,"lastOrderedPacketNumber",0),X(this,"batchAckTimer",void 0),X(this,"sendImpl",void 0),X(this,"receiveImpl",void 0),this.sendImpl=a,this.receiveImpl=o,this.ID=Di(7,"transmitter-"),this.initialRTO=(c==null?void 0:c.initialRTO)!==void 0?c.initialRTO:ve("TRANSMITTER_INITIAL_RTO"),this.initialRTT=(c==null?void 0:c.initialRTT)!==void 0?c.initialRTT:ve("TRANSMITTER_INITIAL_RTT"),this.rtt=(c==null?void 0:c.initialRTT)!==void 0?c.initialRTT:ve("TRANSMITTER_INITIAL_RTT"),this.maxBatchAckCount=(c==null?void 0:c.maxBatchAckCount)!==void 0?c.maxBatchAckCount:ve("TRANSMITTER_MAX_BATCH_ACK_COUNT"),this.maxRTO=(c==null?void 0:c.maxRTO)!==void 0?c.maxRTO:ve("TRANSMITTER_MAX_RTO")}packetize(a,o){return{type:Ch.Default,version:this.version,packetNumber:o,payload:a}}serialize(a){switch(a.type){case Ch.Default:{let o;typeof a.payload=="string"?o=new TextEncoder().encode(a.payload):o=a.payload;let c=new ArrayBuffer(o.length+15),f=new DataView(c);return f.setUint16(0,a.version),f.setUint8(2,a.type),f.setUint32(3,a.packetNumber),Bne(f,7,BigInt(a.sendTs)),new Uint8Array(f.buffer).set(o,15),c}case Ch.Ack:{let o=new ArrayBuffer(16),c=new DataView(o);return c.setUint16(0,a.version),c.setUint8(2,a.type),c.setUint32(3,a.maxAckPacketNumber),c.setUint8(7,a.shift),Bne(c,8,BigInt(a.ackSendTs)),o}}}deserialize(a){let o=new DataView(a),c=o.getUint16(0),f=o.getUint8(2);switch(f){case Ch.Default:{let m=o.getUint32(3),v=Fne(o,7),w=a.slice(15),C=new TextDecoder().decode(w);return{version:c,type:f,packetNumber:m,sendTs:Number(v),payload:C}}case Ch.Ack:{let m=o.getUint32(3),v=o.getUint8(7),w=Fne(o,8);return{version:c,type:f,maxAckPacketNumber:m,shift:v,ackSendTs:Number(w)}}default:throw z.error("[".concat(this.ID,"] Unrecognized packet type ").concat(f)),new Error("Unrecognized packet type ".concat(f))}}sendMessage(a){let o=this.packetize(a,this.packetNumber);this.packetNumber=this.packetNumber===4294967295?1:this.packetNumber+1;let c=this.calculateRTO(o),f=window.setTimeout(()=>{this.resendMessage(o)},c);this.timeoutMap.set(o.packetNumber,f),this.sendPacket(o)}onData(a){let o=this.deserialize(a);o.type===Ch.Default?this.ack(o):o.type===Ch.Ack&&(this.updateRTT(o,Math.round(performance.now())),this.clearRTO(o))}close(){this.rtt=this.initialRTT,this.packetNumber=1,Array.from(this.timeoutMap.entries()).forEach(a=>{let[o,c]=a;window.clearTimeout(c)}),this.timeoutMap=new Map,this.rtoRatioMap=new Map,this.unorderedPacketQueue=[],this.batchAckPacketQueue=[],this.lastOrderedPacketNumber=0,this.batchAckTimer!==void 0&&window.clearTimeout(this.batchAckTimer)}resendMessage(a){let o=this.calculateRTO(a),c=window.setTimeout(()=>{this.resendMessage(a)},o);this.timeoutMap.set(a.packetNumber,c),this.sendPacket(a)}calculateRTO(a){let o=this.rtoRatioMap.get(a.packetNumber);if(o===void 0)return this.rtoRatioMap.set(a.packetNumber,1),this.initialRTO;{let c=9*this.rtt/8*o;return this.rtoRatioMap.set(a.packetNumber,o+1),c>this.maxRTO?this.maxRTO:c}}updateRTT(a,o){let c=a.ackSendTs;this.rtt=this.rtt*(7/8)+(o-c-this.rtt)/8}ack(a){if(a.packetNumber===this.lastOrderedPacketNumber+1)for(this.batchAckPacketQueue.length>=this.maxBatchAckCount&&this.batchAck(),this.batchAckTimer?this.batchAckPacketQueue.push(a):(this.batchAckPacketQueue.push(a),this.batchAckTimer=window.setTimeout(()=>{this.batchAck()},this.rtt/8)),this.lastOrderedPacketNumber+=1,this.receiveImpl(a.payload);;){let o=this.unorderedPacketQueue[0];if(!o){this.unorderedPacketQueue.shift();break}this.batchAckTimer&&this.batchAck(),this.receiveImpl(o.payload),this.unorderedPacketQueue.shift(),this.lastOrderedPacketNumber+=1}else if(a.packetNumber<=this.lastOrderedPacketNumber){let o={ackSendTs:a.sendTs,maxAckPacketNumber:a.packetNumber,shift:0,type:Ch.Ack,version:this.version};this.sendPacket(o)}else if(a.packetNumber>this.lastOrderedPacketNumber){this.unorderedPacketQueue[a.packetNumber-this.lastOrderedPacketNumber-2]=a;let o={ackSendTs:a.sendTs,maxAckPacketNumber:a.packetNumber,shift:0,type:Ch.Ack,version:this.version};this.sendPacket(o)}}batchAck(){window.clearTimeout(this.batchAckTimer),this.batchAckTimer=void 0;let a={ackSendTs:this.batchAckPacketQueue[this.batchAckPacketQueue.length-1].sendTs,maxAckPacketNumber:this.batchAckPacketQueue[this.batchAckPacketQueue.length-1].packetNumber,shift:this.batchAckPacketQueue.length-1,type:Ch.Ack,version:this.version};this.sendPacket(a),this.batchAckPacketQueue=[]}sendPacket(a){a.type===Ch.Default&&(a.sendTs=Math.round(performance.now()));let o=this.serialize(a);this.sendImpl(o)}clearRTO(a){for(let o=a.maxAckPacketNumber-a.shift;o<=a.maxAckPacketNumber;o++){let c=this.timeoutMap.get(o);c!==void 0&&window.clearTimeout(c),this.timeoutMap.delete(o),this.rtoRatioMap.delete(o)}}}class Pie extends vAe{constructor(a,o){super(a,o,arguments.length>2&&arguments[2]!==void 0&&arguments[2],arguments.length>3?arguments[3]:void 0),X(this,"_initMutex",void 0),X(this,"_reconnectInterrupter",void 0),X(this,"_url",void 0),X(this,"_transmitter",void 0),X(this,"_addresses",void 0),X(this,"_reliableTransmission",void 0),this._initMutex=new Ts("datachannel");let{timeout:c,timeoutFactor:f}=o,m=Math.max(300,Math.floor(3*c/5)),v=Math.max(1.2,Math.floor(8*f)/10);eo.ONLINE&&(this._retryConfig.timeout=m,this._retryConfig.timeoutFactor=v),yr.on(By.NETWORK_STATE_CHANGE,(w,C)=>{w!==C&&(this.resetReconnectCount("network state change: ".concat(C," -> ").concat(w)),w===eo.ONLINE?(this._retryConfig.timeout=m,this._retryConfig.timeoutFactor=v):(this._retryConfig.timeout=c,this._retryConfig.timeoutFactor=f))})}getConnection(){if(this._reliableTransmission)return this._reliableTransmission}async init(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3;this._forceCloseTimeout=o;let c=(f,m)=>{this._addresses=a,this.currentURLIndex=this._addresses.findIndex(w=>w.fingerprint||ve("FINGERPRINT"));let v=this._addresses[this.currentURLIndex];this.state="connecting",this.createTransmitterConnection(v).then(f).catch(m),this.once(qr.CLOSED,()=>m(new De(ce.WS_DISCONNECT))),this.once(qr.CONNECTED,()=>f())};return this._initMutex.lock().then(f=>new Ct((m,v)=>{c(m,v)}).then(()=>{f()}).catch(()=>{f()}))}sendMessage(a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!this._transmitter||!this._reliableTransmission)throw new De(ce.WS_ABORT,"datachannel is not ready");try{o||(a=JSON.stringify(a)),this._reliableTransmission.sendMessage(a)}catch(c){throw new De(ce.WS_ERR,"send datachannel signal message error"+c.toString())}}unbindDcCloseEventListener(){this._transmitter&&(this._transmitter.onclose=null)}sendMessageWithJSON(a){let o=JSON.stringify(a);return{compressed:o,compressedLength:o.length,origin:a}}sendMessageWithUint8Array(a){return{compressed:a,compressedLength:a.byteLength,origin:a}}createTransmitterConnection(a){return this.connectionID+=1,this._joinChannelServiceRecordIndex=void 0,this._url="dc://".concat(a.ip,":").concat(a.port),new Ct((o,c)=>{var f;let m=()=>{z.debug("[".concat(this._name,"] datachannel opened:"),this._url),this.reconnectMode="retry",this.state="connected",this.resetReconnectCount("opened"),o()},v=async x=>{var L;if((L=this._closeEstablishingTransmitter)===null||L===void 0||L.call(this),z.debug("[".concat(this._name,"] datachannel close ").concat(this._url,", code: ").concat(x.code,", reason: ").concat(x.reason,", current mode: ").concat(this.reconnectMode)),this._reconnectCount<this._retryConfig.maxRetryCount){this.state==="connected"&&(this.reconnectReason=x.reason,this.state="reconnecting");let U=Ml(this,qr.WILL_RECONNECT,this.reconnectMode)||this.reconnectMode,F=await this.reconnectWithAction(U);if(this.state==="closed")return void z.debug("[".concat(this.connectionID,"] dc is closed, no need to reconnect"));if(!F)return c(new De(ce.WS_DISCONNECT,"datachannel reconnect failed: ".concat(x.code))),void this.close(!0);o()}else c(new De(ce.WS_DISCONNECT,"datachannel close: ".concat(x.code))),this.close()},w=x=>{var L;(L=this._reliableTransmission)===null||L===void 0||L.onData(x.data)};this._transmitter&&(this._transmitter.onclose=null,this._transmitter.close()),this._reliableTransmission&&(this._reliableTransmission.close(),this._reliableTransmission=void 0),z.debug("[".concat(this._name,"] start connect, address: ").concat(JSON.stringify(a)));let C=(f=this._store)===null||f===void 0?void 0:f.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"gateway"}),R=Date.now();Kr(this,qr.TO_CONNECT_DATACHANNEL,a).then(x=>{var L,U;if(!x)throw new Error("transmissonInfo not exist yet");let{transmitter:F,close:Z}=x;this._transmitter=F,(L=this._store)===null||L===void 0||L.signalChannelOpen();let W=Date.now()-R;z.debug("[choose dc] dc open cost ".concat(W,"ms")),this._reliableTransmission=new yAe(K=>{var oe;this._transmitter&&this._transmitter.readyState==="open"&&((oe=this._transmitter)===null||oe===void 0||oe.send(K))},K=>{typeof K=="string"&&this.emit(qr.ON_MESSAGE,K)}),this._closeEstablishingTransmitter=()=>{var K;(K=this._reliableTransmission)===null||K===void 0||K.close(),this._reliableTransmission=void 0,Z()},m&&m(),F.onclose=v,F.onmessage=w,(U=this._store)===null||U===void 0||U.recordJoinChannelService({endTs:Date.now(),status:"success"},C),this._joinChannelServiceRecordIndex=C}).catch(x=>{var L;if((L=this._store)===null||L===void 0||L.recordJoinChannelService({endTs:Date.now(),status:x instanceof De&&x.code===ce.WS_ABORT?"aborted":"error",errors:[x]},C),this.state!=="closed"){if(x instanceof De&&x.code===ce.WS_ERR){let U=new De(ce.WS_ERR,"init datachannel failed! Error: ".concat(x.toString()));return z.error("[".concat(this._name,"]").concat(U)),void c(U)}v&&v(x)}else c(new De(ce.WS_DISCONNECT,"datachannel is closed: ".concat(x.toString())))})})}async reconnectWithAction(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(this._reconnectCount>=this._retryConfig.maxRetryCount||!this._addresses||this.state==="closed")return!1;this._onlineReconnectListener||yr.networkState!==eo.OFFLINE||(this._onlineReconnectListener=yr.onlineWaiter&&yr.onlineWaiter.then(()=>{this._onlineReconnectListener=void 0}));let c=!0;if(this._reconnectInterrupter=()=>{c=!1},o){let w=j8(this._reconnectCount,this._retryConfig);z.debug("[".concat(this._name,"] wait ").concat(w,"ms to reconnect datachannel, mode: ").concat(a)),await Ct.race([vs(w),this._onlineReconnectListener||new Ct(()=>{})])}if(this.state==="closed"||!c)return!1;this._reconnectCount+=1;let f=async(w,C)=>{this.emit(qr.RECONNECT_CREATE_CONNECTION,C),await this.createTransmitterConnection(w)};try{if(a==="retry"){let w=this._addresses[this.currentURLIndex];this.emit(qr.RECONNECT_WAITTING_FINISH,a),await f(w,a)}else if(a==="tryNext"){this.currentURLIndex+=1;for(let C=this.currentURLIndex;C<this._addresses.length;C++){if(this._addresses[C].fingerprint||ve("FINGERPRINT")){this.currentURLIndex=C;break}this.currentURLIndex+=1}if(this.currentURLIndex>=this._addresses.length)return z.debug("[".concat(this._name,"] the available addresses are exhausted, change to recover")),await this.reconnectWithAction("recover",!1);z.debug("[".concat(this._name,"] datachannel url length: ").concat(this._addresses.length," current index: ").concat(this.currentURLIndex));let w=this._addresses[this.currentURLIndex];this.emit(qr.RECONNECT_WAITTING_FINISH,a),await f(w,a)}else a==="recover"&&(z.debug("[".concat(this._name,"] start to failback to websocket")),this.resetReconnectCount("recover mode"),this.emit(qr.RECONNECT_WAITTING_FINISH,a),this.emit(qr.FAILBACK));return!0}catch(w){var m,v;return z.error("[".concat(this._name,"] reconnect failed"),w.toString()),w!=null&&(m=w.data)!==null&&m!==void 0&&m.desc&&Array.isArray(w.data.desc)&&w.data.desc.length&&Tt(v=w.data.desc).call(v,"dynamic key expired")?(this.emit(qr.ON_TOKEN_PRIVILEGE_DID_EXPIRE),!1):await this.reconnectWithAction(a,o)}}}class vm extends nr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===Vn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===Vn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===Vn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket?this.websocket.url:null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",Vn.CLOSED),X(this,"reconnectToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new HH(5)),X(this,"pingpongTimer",void 0),X(this,"inflateDataTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"onWebsocketMessage",c=>{if(c instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c);let f=JSON.parse(c);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let m="res-@".concat(f._id);this.emit(m,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")&&(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED))switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new Pie("gateway-".concat(this.clientId),this.spec.retryConfig,!0,o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===Vn.CONNECTED&&this.reconnect("retry",I0.OFFLINE)})}async request(a,o,c,f){let m=Di(6,""),v={_id:m,_type:a,_message:o},w=this.websocket.connectionID,C=()=>new Ct((Z,W)=>{if(this.connectionState===Vn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new De(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe),a!==rn.PUBLISH&&a!==rn.SUBSCRIBE&&a!==rn.UNSUBSCRIBE&&a!==rn.UNPUBLISH&&a!==rn.CONTROL&&a!==rn.RESTART_ICE||this.once(Ut.DISCONNECT_P2P,()=>{W(new De(ce.DISCONNECT_P2P))}),a!==rn.PUBLISH&&a!==rn.RESTART_ICE||this.once(Ut.ABORT_P2P_EXECUTION,()=>{W(new De(ce.DISCONNECT_P2P))})});if(this.connectionState!==Vn.CONNECTING&&this.connectionState!==Vn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await C(),a===rn.LEAVE&&(this.websocket.unbindDcCloseEventListener(),f=!0),this.websocket.sendMessage(v,!0,!1),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Oe)=>{K=!0,Z({isSuccess:xe==="success",message:Oe||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(m),oe);let ue=()=>{W(new De(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(m),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),vs(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("dc request timeout, type: ".concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),x=null;try{x=await R}catch(Z){if(this.connectionState===Vn.CLOSED||a===rn.LEAVE)throw new De(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await C(),await this.request(a,o))}if(x.isSuccess)return x.message;let L=Number(x.message.error_code||x.message.code),U=Ky(L),F=new De(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(x.message.error_str),{code:L,data:x.message});return U.action==="success"?x.message:(z.warning("[".concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=x.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",I0.MULTI_IP)):this.reconnect(U.action,I0.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=m=>{(!o||o(m))&&(this.off(a,f),c(m))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload($y.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==Vn.CONNECTED)return;let m=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(m._type,m._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}init(a,o){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((c,f)=>{this.once(Ut.WS_CONNECTED,()=>c(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>f(this.initError||new De(ce.WS_ABORT))),this.connectionState=Vn.CONNECTING,this.websocket.init(a).catch(f),this.websocket.once(qr.FAILBACK,()=>{this.openConnectionTime===void 0&&f(new De(ce.INIT_DATACHANNEL_TIMEOUT))}),this.inflateDataTimer&&window.clearInterval(this.inflateDataTimer),this.inflateDataTimer=window.setInterval(()=>{this.handleInflateData()},2e4),setTimeout(()=>{o&&this.openConnectionTime===void 0&&(z.debug("[".concat(this.clientId,"] init datachannel timeout while join with failback to websocket")),f(new De(ce.INIT_DATACHANNEL_TIMEOUT)))},ve("DC_JOIN_WITH_FAILBACK"))})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.inflateDataTimer&&(this.handleInflateData(),window.clearInterval(this.inflateDataTimer),this.inflateDataTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._disconnectedReason=a||Hn.LEAVE,this.connectionState=Vn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close datachannel in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new Pie("gateway-".concat(this.clientId),this.spec.retryConfig,!0,this.store),this.handleWebsocketEvents())}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Kr(this,Ut.DATACHANNEL_CONNECTING),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,ce.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=Vn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}async rejoin(){if(!this.reconnectToken)throw new De(ce.UNEXPECTED_ERROR,"can not rejoin, no rejoin token");let a=Vy(this,Ut.REQUEST_REJOIN_INFO);a.token=this.reconnectToken;let o=await this.request(rn.REJOIN,a);return!!o&&(this.connectionState=Vn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),o.peers&&o.peers.forEach(c=>{this.emit(Sn.ON_USER_ONLINE,{uid:c.uid}),c.audio&&this.emit(Sn.ON_ADD_AUDIO_STREAM,{uid:c.uid,uint_id:c.uint_id,audio:!0,ssrcId:c.audio_ssrc}),c.video&&this.emit(Sn.ON_ADD_VIDEO_STREAM,{uid:c.uid,uint_id:c.uint_id,video:!0,ssrcId:c.video_ssrc}),c.audio_mute?this.emit(Sn.MUTE_AUDIO,{uid:c.uid}):this.emit(Sn.UNMUTE_AUDIO,{uid:c.uid}),c.video_mute?this.emit(Sn.MUTE_VIDEO,{uid:c.uid}):this.emit(Sn.UNMUTE_VIDEO,{uid:c.uid}),c.audio_enable_local?this.emit(Sn.ENABLE_LOCAL_AUDIO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_AUDIO,{uid:c.uid}),c.video_enable_local?this.emit(Sn.ENABLE_LOCAL_VIDEO,{uid:c.uid}):this.emit(Sn.DISABLE_LOCAL_VIDEO,{uid:c.uid}),c.audio||c.video||this.emit(Sn.ON_REMOVE_STREAM,{uid:c.uid,uint_id:c.uint_id})}),!0)}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=Ky(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,I0.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("PINGPONG Timeout. Last Socket Message: ".concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",I0.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleInflateData(){let{inflateLength:a,deflateLength:o}=this.websocket.getInflateData();a!==0&&o!==0&&this.upload($y.WS_INFLATE_DATA_LENGTH,{ws_deflate_length:o,ws_inflate_length:a})}handleWebsocketEvents(){this.websocket.on(qr.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(qr.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(qr.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(qr.CLOSED,()=>{this.connectionState=Vn.CLOSED}),this.websocket.on(qr.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=Vn.CLOSED}),this.websocket.on(qr.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===Vn.CONNECTED?this.connectionState=Vn.RECONNECTING:this.connectionState=Vn.CONNECTING}),this.websocket.on(qr.WILL_RECONNECT,(a,o)=>{if(Vy(this,Ut.IS_P2P_DISCONNECTED)&&a==="retry")return z.debug("".concat(this.clientId," reconnect mode is retry, but p2p lost, change to tryNext")),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION),this.emit(Ut.DISCONNECT_P2P),o("tryNext");a!=="retry"&&(z.debug("".concat(this.clientId," websockt will_connect event, renewSession reconnectMode is ").concat(a)),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION),this.emit(Ut.DISCONNECT_P2P)),o(a)}),this.websocket.on(qr.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.reconnectToken?this.rejoin().catch(a=>{z.warning("[".concat(this.clientId,"] rejoin failed ").concat(a)),this.reconnect("tryNext",I0.SERVER_ERROR)}):this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code,this.url||""),a instanceof De&&a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",I0.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",I0.SERVER_ERROR):(this.initError=a,this.close())})}),this.websocket.on(qr.REQUEST_NEW_URLS,(a,o)=>{Kr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(qr.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)}),this.websocket.on(qr.TO_CONNECT_DATACHANNEL,async(a,o,c)=>Kr(this,Ut.DATACHANNEL_PRECONNECT,a).then(o).catch(c)),this.websocket.on(qr.FAILBACK,()=>{this.openConnectionTime!==void 0&&this.emit(Ut.DATACHANNEL_FAILBACK)})}}class qy extends nr{constructor(a,o){super(),X(this,"signal",void 0),X(this,"token",void 0),X(this,"tokenTimeout",void 0),X(this,"tokenInterval",void 0),X(this,"_sequence",0),X(this,"userMap",new Map),X(this,"encoder",new TextEncoder),this.signal=a,this.token=o;let c=()=>{this.signal.connectionState===Vn.CONNECTED&&this.check(),this.userMap.size===0?this.tokenInterval=window.setTimeout(c,1e3):this.tokenInterval=window.setTimeout(c,3*ve("P2P_TOKEN_INTERVAL"))};c()}async send(a,o,c,f,m){var v,w,C;if(this.userMap.size===0)return;let R=Array.from(Sh(v=this.userMap).call(v))[0].token;typeof o!="string"&&(o=JSON.stringify(o)),f=(w=f)!==null&&w!==void 0?w:Di(6,""),m=(C=m)!==null&&C!==void 0?C:this._sequence++;let x={_id:f,_type:a,_seq:m,_message:o,token:"".concat(this.token,"_").concat(R)};ve("SHOW_P2P_LOG")&&z.debug("send message",x,"noNeedResponse : ".concat(c)),this.splitMessage(JSON.stringify(x)).forEach(U=>{this.signal.request(rn.DATA_STREAM,{payload:R0(this.encoder.encode(U))})});let L=new Ct((U,F)=>{let Z=window.setTimeout(()=>{this.off("res-@".concat(f,"_ack"),W),this.off("res-@".concat(f),oe),this.off($S.ABORT,K),z.debug("[external-signal] request timeout, type: ".concat(a,", requestId: ").concat(f)),this.userMap.size===0?F(new Ke(ce.INVALID_REMOTE_USER)):F(new Ke(ce.TIMEOUT))},ve("EXTERNAL_SIGNAL_REQUEST_TIMEOUT")),W=()=>{Z&&window.clearTimeout(Z),this.off($S.ABORT,K),c&&U()},K=()=>{Z&&window.clearTimeout(Z),this.off("res-@".concat(f,"_ack"),W),this.off("res-@".concat(f),oe),F(new Ke(ce.EXTERNAL_SIGNAL_ABORT,"type: ".concat(a,", requestId: ").concat(f)))};this.once($S.ABORT,K),this.once("res-@".concat(f,"_ack"),W);let oe=(xe,Oe)=>{ue=!0,Z&&window.clearTimeout(Z),this.off("res-@".concat(f,"_ack"),W),this.off($S.ABORT,K),xe==="success"?U(Oe):F(new Ke(ce.P2P_MESSAGE_FAILED,"request ".concat(a," failed, requestId: ").concat(f)))},ue=!1;c||(this.once("res-@".concat(f),oe),vs(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{ue||z.warning("external_signal request timeout, type: ".concat(a,", requestId: ").concat(f,", ").concat(x))}))});try{return await L}catch(U){if(U.code===ce.TIMEOUT)return await this.send(a,o,c,f,m);throw U}}onMessage(a){var o;let{_uid:c}=a,f,m=this.userMap.get(c);if(m)f=m.splitMessageMap;else{if(this.userMap.size>0||!("_type"in a)||a._type!==Nr.CHECK)return;let{token:R}=a;f=new Map,m={uid:c,isStart:!0,token:R,splitMessageMap:f,nextExpectedSequenceNumber:0,receivedMessagesMap:new Map},this.userMap.set(c,m),this.signal.emit(Sn.ON_USER_ONLINE,{uid:c}),this.handleUserOnline()}if("id"in a&&"total"in a){var v;let{id:R,total:x}=a,L=(v=f.get(R))!==null&&v!==void 0?v:[];if(L.push(a),f.has(R)||f.set(R,L),L.length!==x)return;{let U=JA(L).call(L,(F,Z)=>F.index-Z.index).map(F=>F.payload).join("");f.delete(R),(a=JSON.parse(U))._uid=c}}let{_type:w,token:C}=a;if(Tt(o=[Nr.ACK,Nr.CHECK]).call(o,w))return w===Nr.CHECK&&this.handleCheckToken(m,C),void this.receiveMessage(a);C==="".concat(m.token,"_").concat(this.token)?this.handleReceivedMessage(a):z.debug('Receive unexpected message", '.concat(C,", cur_token: ").concat(m.token,"_").concat(this.token),a)}check(){let a={_id:Di(6,""),token:this.token,_type:Nr.CHECK};ve("SHOW_P2P_LOG")&&z.debug("send message",a),this.signal.request(rn.DATA_STREAM,{payload:R0(this.encoder.encode(JSON.stringify(a)))})}ack(a){let o={_id:a,_type:Nr.ACK,token:this.token};ve("SHOW_P2P_LOG")&&z.debug("send message",o),this.signal.request(rn.DATA_STREAM,{payload:R0(this.encoder.encode(JSON.stringify(o)))})}response(a,o,c){this.send(Nr.RESPONSE,JSON.stringify({success:!c,message:o}),!0,a)}handleReceivedMessage(a){let o=()=>{this.userMap.forEach(R=>{let{receivedMessagesMap:x,nextExpectedSequenceNumber:L}=R;for(;x.has(L);){let U=x.get(L);x.delete(L),this.receiveMessage(U),R.nextExpectedSequenceNumber++}})};if(!a)return void o();let{_uid:c,_seq:f}=a,m=this.userMap.get(c),{receivedMessagesMap:v,isStart:w,nextExpectedSequenceNumber:C}=m;if(f<C)return this.ack(a._id),void z.debug("[external-signal] receive old message, seq: ".concat(f,", ").concat(a._message));v.set(f,a),w&&f===C&&(this.receiveMessage(a),v.delete(C),m.nextExpectedSequenceNumber++,o())}receiveMessage(a){let{_id:o,_type:c,_message:f,_uid:m}=a;if(ve("SHOW_P2P_LOG")&&z.debug("receive message",a),o){let v;switch(a._type!==Nr.ACK&&(f&&(v=JSON.parse(f)),this.ack(a._id)),a._type){case Nr.CANDIDATE:case Nr.CONTROL:this.signal.emit(c,v,m);break;case Nr.PUBLISH:case Nr.UNPUBLISH:case Nr.RESTART_ICE:case Nr.CALL:v.uid=m,Kr(this.signal,c,v).then(w=>{this.response(a._id,w)}).catch(()=>{this.response(a._id,void 0,!0)});break;case Nr.ACK:this.getListeners("res-@".concat(o,"_ack")).length>0&&this.emit("res-@".concat(o,"_ack"));break;case Nr.RESPONSE:{let{success:w,message:C}=v;this.emit("res-@".concat(o),w?"success":"failed",C);break}}}}splitMessage(a){if(a.length<qy.MAX_MESSAGE_SIZE)return[a];let o=[],{remoteToken:c}=JSON.parse(a),f=Di(6,""),m=0,v=800,w=Math.ceil(a.length/v);for(;a.length>0;){m++;let C={id:f,index:m,total:w,payload:a.slice(0,v),token:"".concat(this.token,"_").concat(c)};JSON.stringify(C).length>qy.MAX_MESSAGE_SIZE?v-=50:(o.push(C),a=a.slice(v))}return o.map(C=>JSON.stringify(C))}handleCheckToken(a,o){return a.token!==o?(z.debug("token changed, from ".concat(a.token," to ").concat(o)),this.reset(a.uid,o),!1):(this.tokenTimeout&&(window.clearTimeout(this.tokenTimeout),this.tokenTimeout=void 0),this.tokenTimeout=window.setTimeout(()=>{z.debug("token timeout, ".concat(o)),this.reset(a.uid)},ve("MAX_P2P_TIMEOUT")),!0)}async handleUserOnline(){let a=await Kr(this.signal,Nr.CALL,void 0),o=await this.send(Nr.CALL,a);this.signal.emit(Ut.P2P_CONNECTION,o,!0)}async reset(a,o){let c=this.userMap.get(a);c&&(this.emit($S.ABORT),this.signal.emit(Sn.ON_USER_OFFLINE,{uid:c.uid,reason:lAe.P2P_TOKEN_CHANGED}),this._sequence=0,this.userMap.clear(),o||(z.debug("change local token from ".concat(o," to ").concat(o)),this.token=Di(6,"")))}clear(){this._sequence=0,this.userMap.clear(),this.tokenInterval&&window.clearTimeout(this.tokenInterval),this.tokenInterval=void 0,this.tokenTimeout&&window.clearTimeout(this.tokenTimeout),this.tokenTimeout=void 0,this.emit($S.ABORT)}}X(qy,"MAX_SIZE",1),X(qy,"MAX_MESSAGE_SIZE",1024);class Lie extends nr{get connectionState(){return this._connectionState}set connectionState(a){a!==this._connectionState&&(this._connectionState=a,a===Vn.CONNECTED?this.emit(Ut.WS_CONNECTED):a===Vn.RECONNECTING?this.emit(Ut.WS_RECONNECTING,this._websocketReconnectReason):a===Vn.CLOSED&&this.emit(Ut.WS_CLOSED,this._disconnectedReason))}get currentURLIndex(){return this.websocket.currentURLIndex}get url(){return this.websocket&&this.websocket.url||null}get rtt(){return this.rttRolling.mean()}constructor(a,o){super(),X(this,"_disconnectedReason",void 0),X(this,"_websocketReconnectReason",void 0),X(this,"_connectionState",Vn.CLOSED),X(this,"reconnectToken",void 0),X(this,"p2pToken",void 0),X(this,"websocket",void 0),X(this,"openConnectionTime",void 0),X(this,"clientId",void 0),X(this,"lastMsgTime",Date.now()),X(this,"uploadCache",[]),X(this,"uploadCacheInterval",void 0),X(this,"rttRolling",new HH(5)),X(this,"pingpongTimer",void 0),X(this,"pingpongTimeoutCount",0),X(this,"joinResponse",void 0),X(this,"multiIpOption",void 0),X(this,"initError",void 0),X(this,"spec",void 0),X(this,"store",void 0),X(this,"_external_signal",void 0),X(this,"onWebsocketMessage",c=>{if(c.data instanceof ArrayBuffer)return void this.emit(Ut.ON_BINARY_DATA,c.data);let f=JSON.parse(c.data);if(this.lastMsgTime=Date.now(),Object.prototype.hasOwnProperty.call(f,"_id")){let m="res-@".concat(f._id);this.emit(m,f._result,f._message)}else if(Object.prototype.hasOwnProperty.call(f,"_type")){switch(f._type){case Sn.ON_DATA_STREAM:return void this.handleDataStream(f._message);case Sn.MUTE_AUDIO:case Sn.MUTE_VIDEO:case Sn.ON_P2P_LOST:case Sn.ON_USER_ONLINE:return;case Sn.ON_USER_OFFLINE:let{uid:m}=f._message;return z.debug("[".concat(this.clientId,"] user-offline uid: ").concat(m)),void this._external_signal.reset(m)}if(this.emit(f._type,f._message),f._type===Sn.ON_NOTIFICATION&&this.handleNotification(f._message),f._type===Sn.ON_USER_BANNED)switch(f._message.error_code){case 14:this.close(Hn.UID_BANNED);break;case 15:this.close(Hn.IP_BANNED);break;case 16:this.close(Hn.CHANNEL_BANNED)}if(f._type===Sn.ON_USER_LICENSE_BANNED)switch(f._message.error_code){case ln.ERR_LICENSE_MISSING:this.close(Hn.LICENSE_MISSING);break;case ln.ERR_LICENSE_EXPIRED:this.close(Hn.LICENSE_EXPIRED);break;case ln.ERR_LICENSE_MINUTES_EXCEEDED:this.close(Hn.LICENSE_MINUTES_EXCEEDED);break;case ln.ERR_LICENSE_PERIOD_INVALID:this.close(Hn.LICENSE_PERIOD_INVALID);break;case ln.ERR_LICENSE_MULTIPLE_SDK_SERVICE:this.close(Hn.LICENSE_MULTIPLE_SDK_SERVICE);break;case ln.ERR_LICENSE_ILLEGAL:this.close(Hn.LICENSE_ILLEGAL);break;default:this.close()}}}),this.clientId=a.clientId,this.spec=a,this.store=o,this.websocket=new _3("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),o),this.handleWebsocketEvents(),window.addEventListener("offline",()=>{this.connectionState===Vn.CONNECTED&&this.reconnect("retry",$s.OFFLINE)}),this.p2pToken=Di(6,""),this._external_signal=new qy(this,this.p2pToken)}async request(a,o,c,f){let m=Di(6,""),v={_id:m,_type:a,_message:o},w=this.websocket.connectionID,C=()=>new Ct((Z,W)=>{if(this.connectionState===Vn.CONNECTED)return Z();let K=()=>{this.off(Ut.WS_CLOSED,oe),Z()},oe=()=>{this.off(Ut.WS_CONNECTED,K),W(new Ke(ce.WS_ABORT))};this.once(Ut.WS_CONNECTED,K),this.once(Ut.WS_CLOSED,oe)});if(this.connectionState!==Vn.CONNECTING&&this.connectionState!==Vn.RECONNECTING||a===rn.JOIN||a===rn.REJOIN||await C(),this.websocket.sendMessage(v,!0),f)return;let R=new Ct((Z,W)=>{let K=!1,oe=(xe,Oe)=>{K=!0,Z({isSuccess:xe==="success",message:Oe||{}}),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.emit(Ut.REQUEST_SUCCESS,a,o)};this.once("res-@".concat(m),oe);let ue=()=>{W(new Ke(ce.WS_ABORT,"type: ".concat(a))),this.off(Ut.WS_CLOSED,ue),this.off(Ut.WS_RECONNECTING,ue),this.off("res-@".concat(m),oe)};this.once(Ut.WS_CLOSED,ue),this.once(Ut.WS_RECONNECTING,ue),vs(ve("SIGNAL_REQUEST_TIMEOUT")).then(()=>{this.websocket.connectionID!==w||K||(z.warning("[".concat(this.clientId,"] ws request timeout, type: ").concat(a)),this.emit(Ut.REQUEST_TIMEOUT,a,o))})}),x=null;try{x=await R}catch(Z){if(this.connectionState===Vn.CLOSED||a===rn.LEAVE)throw new Ke(ce.WS_ABORT);return!this.spec.forceWaitGatewayResponse||c?Z.throw():a===rn.JOIN||a===rn.REJOIN?null:(await C(),await this.request(a,o))}if(x.isSuccess)return x.message;let L=Number(x.message.error_code||x.message.code),U=Ky(L),F=new Ke(ce.UNEXPECTED_RESPONSE,"".concat(U.desc,": ").concat(x.message.error_str),{code:L,data:x.message});return U.action==="success"?x.message:(z.warning("[".concat(this.clientId,"] [").concat(this.websocket.connectionID,"] unexpected response from type ").concat(a,", error_code: ").concat(L,", message: ").concat(U.desc,", action: ").concat(U.action)),L===ln.ERR_TOO_MANY_BROADCASTERS?((a===rn.JOIN||a===rn.REJOIN)&&(this.initError=F,this.close()),F.throw()):U.action==="failed"?F.throw():U.action==="quit"?(this.initError=F,this.close(),F.throw()):(L===ln.ERR_JOIN_BY_MULTI_IP?(this.multiIpOption=x.message.option,z.warning("[".concat(this.clientId,"] detect multi ip, recover")),this.reconnect("recover",$s.MULTI_IP)):this.reconnect(U.action,$s.SERVER_ERROR),a===rn.JOIN||a===rn.REJOIN?null:await this.request(a,o)))}waitMessage(a,o){return new Ct(c=>{let f=m=>{(!o||o(m))&&(this.off(a,f),c(m))};this.on(a,f)})}uploadWRTCStats(a){if(!this.store.sessionId)return void z.warn("[".concat(this.clientId,"] no session id when upload wrtc stats"));let o={lts:Date.now(),sid:this.store.sessionId,uid:this.store.intUid,stats:a};this.upload($y.WRTC_STATS,o)}upload(a,o){let c={_type:a,_message:o};try{this.websocket.sendMessage(c)}catch{let f=ve("MAX_UPLOAD_CACHE")||50;this.uploadCache.push(c),this.uploadCache.length>f&&this.uploadCache.splice(0,1),this.uploadCache.length>0&&!this.uploadCacheInterval&&(this.uploadCacheInterval=window.setInterval(()=>{if(this.connectionState!==Vn.CONNECTED)return;let m=this.uploadCache.splice(0,1)[0];this.uploadCache.length===0&&(window.clearInterval(this.uploadCacheInterval),this.uploadCacheInterval=void 0),this.upload(m._type,m._message)},ve("UPLOAD_CACHE_INTERVAL")||2e3))}}send(a,o){let c={_type:a,_message:o};this.websocket.sendMessage(c)}async sendExtensionMessage(a,o,c){return await this._external_signal.send(a,o,c)}init(a){return this.initError=void 0,this.multiIpOption=void 0,this.joinResponse=void 0,this.reconnectToken=void 0,this.openConnectionTime=void 0,new Ct((o,c)=>{this.once(Ut.WS_CONNECTED,()=>o(this.joinResponse)),this.once(Ut.WS_CLOSED,()=>c(this.initError||new Ke(ce.WS_ABORT))),this.connectionState=Vn.CONNECTING,this.websocket.init(a).catch(c)})}close(a){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.reconnectToken=void 0,this.joinResponse=void 0,this._external_signal.clear(),this._disconnectedReason=a||Hn.LEAVE,this.connectionState=Vn.CLOSED,z.debug("[".concat(this.clientId,"] ")+"will close websocket in signal"),this.websocket.close(),a===Hn.FALLBACK&&(this.websocket.removeAllListeners(),this.websocket=new _3("gateway-".concat(this.clientId),this.spec.retryConfig,!0,ve("JOIN_GATEWAY_USE_DUAL_DOMAIN"),ve("JOIN_GATEWAY_USE_443PORT_ONLY"),this.store),this.handleWebsocketEvents()),this.p2pToken=Di(6,""),this._external_signal.clear(),this._external_signal=new qy(this,this.p2pToken)}async join(){if(!this.joinResponse){this.emit(Ut.ABORT_P2P_EXECUTION);let a=await Kr(this,Ut.REQUEST_JOIN_INFO),o=await this.request(rn.JOIN,a);if(!o)return this.emit(Ut.REPORT_JOIN_GATEWAY,ce.TIMEOUT,this.url||""),!1;this.joinResponse=o,this.emit(Ut.JOIN_RESPONSE,this.joinResponse),this.reconnectToken=this.joinResponse.rejoin_token}return this.connectionState=Vn.CONNECTED,this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(this.handlePingPong.bind(this),3e3),!0}reconnect(a,o){this.pingpongTimer&&(this.pingpongTimeoutCount=0,window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0),this.websocket.reconnect(a,o)}handleDataStream(a){try{var o;let c=Hy(a.payload),f=new TextDecoder().decode(c),m=JSON.parse(f);"total"in m&&"id"in m||Tt(o=Object.values(Nr)).call(o,m._type)?(m._uid=a.uid,this._external_signal.onMessage(m)):this.emit(Sn.ON_DATA_STREAM,a)}catch{this.emit(Sn.ON_DATA_STREAM,a)}}handleNotification(a){z.debug("[".concat(this.clientId,"] receive notification: "),a);let o=Ky(a.code);if(o.action!=="success"){if(o.action!=="failed")return o.action==="quit"?(o.desc==="ERR_REPEAT_JOIN_CHANNEL"&&this.close(Hn.UID_BANNED),void this.close()):void this.reconnect(o.action,$s.SERVER_ERROR);z.error("[".concat(this.clientId,"] ignore error: "),o.desc)}}handlePingPong(){if(!this.websocket||this.websocket.state!=="connected")return;this.pingpongTimeoutCount>0&&this.rttRolling.add(3e3),this.pingpongTimeoutCount+=1;let a=ve("PING_PONG_TIME_OUT"),o=Date.now();this.pingpongTimeoutCount>=a&&(z.warning("[".concat(this.clientId,"] PINGPONG Timeout. Last Socket Message: ").concat(o-this.lastMsgTime,"ms")),o-this.lastMsgTime>ve("WEBSOCKET_TIMEOUT_MIN"))?this.reconnect("retry",$s.TIMEOUT):this.request(rn.PING,void 0,!0).then(()=>{this.pingpongTimeoutCount=0;let c=Date.now()-o;this.rttRolling.add(c),ve("REPORT_STATS")&&this.send(rn.PING_BACK,{pingpongElapse:c})}).catch(c=>{})}handleWebsocketEvents(){this.websocket.on(En.RECONNECT_WAITTING_FINISH,a=>{this.emit(Ut.WS_RECONNECT_WAITTING_FINISH,a)}),this.websocket.on(En.RECONNECT_CREATE_CONNECTION,a=>{this.emit(Ut.WS_RECONNECT_CREATE_CONNECTION,a)}),this.websocket.on(En.ON_MESSAGE,this.onWebsocketMessage),this.websocket.on(En.CLOSED,()=>{this.connectionState=Vn.CLOSED}),this.websocket.on(En.FAILED,()=>{this._disconnectedReason=Hn.NETWORK_ERROR,this.connectionState=Vn.CLOSED}),this.websocket.on(En.RECONNECTING,a=>{this._websocketReconnectReason=a,this.joinResponse=void 0,this.connectionState===Vn.CONNECTED?this.connectionState=Vn.RECONNECTING:this.connectionState=Vn.CONNECTING}),this.websocket.on(En.WILL_RECONNECT,(a,o,c)=>{a!=="retry"?(z.debug("".concat(this.clientId," websocket will_connect event, renewSession reconnectMode is ").concat(a)),this.reconnectToken=void 0,this.emit(Ut.NEED_RENEW_SESSION)):z.debug("".concat(this.clientId," reconnect mode is retry, no need to renew session")),c(a)}),this.websocket.on(En.CONNECTED,()=>{this.openConnectionTime=Date.now(),this.join().catch(a=>{if(this.emit(Ut.REPORT_JOIN_GATEWAY,a.message||a.code,this.url||""),a instanceof Ke&&a.code===ce.UNEXPECTED_RESPONSE&&a.data.code===ln.ERR_NO_AUTHORIZED)return z.warning("[".concat(this.clientId,"] reconnect no authorized, recover")),void this.reconnect("recover",$s.SERVER_ERROR);z.error("[".concat(this.clientId,"] join gateway request failed"),a.toString()),this.spec.forceWaitGatewayResponse?this.reconnect("tryNext",$s.SERVER_ERROR):(this.initError=a,this.close())})}),this.websocket.on(En.REQUEST_NEW_URLS,(a,o)=>{Kr(this,Ut.REQUEST_RECOVER,this.multiIpOption).then(a).catch(o)}),this.websocket.on(En.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{this.emit(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE)})}}function Die(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function vu(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Die(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Die(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let lG=new Map;class _Ae extends nr{get state(){return this._state}set state(a){if(a===this._state)return;let o=this._state;this._state=a,a==="DISCONNECTED"&&this._disconnectedReason?this.emit(Ir.CONNECTION_STATE_CHANGE,a,o,this._disconnectedReason):this.emit(Ir.CONNECTION_STATE_CHANGE,a,o)}get joinGatewayStartTime(){return this._joinGatewayStartTime}set joinGatewayStartTime(a){z.debug("[".concat(this.store.clientId,"] set joinGatewayStartTime at ").concat(a)),this._joinGatewayStartTime=a}constructor(a,o){super(),X(this,"store",void 0),X(this,"joinInfo",void 0),X(this,"key",void 0),X(this,"ntpOffset",0),X(this,"signal",void 0),X(this,"role",void 0),X(this,"inChannelInfo",{joinAt:null,duration:0}),X(this,"spec",void 0),X(this,"_state","DISCONNECTED"),X(this,"_statsCollector",void 0),X(this,"_disconnectedReason",void 0),X(this,"isSignalRecover",!1),X(this,"hasChangeBGPAddress",!1),X(this,"trafficStatsInterval",void 0),X(this,"networkQualityInterval",void 0),X(this,"_joinGatewayStartTime",0),X(this,"_signalTimeout",!1),X(this,"_clientRoleOptions",void 0),X(this,"_isProactiveJoin",!1),this.store=a,this.spec=o,this.signal=this.store.useP2P?new Lie(vu(vu({},o),{},{retryConfig:o.websocketRetryConfig}),a):this.store.useDataChannel?new vm(vu(vu({},o),{},{retryConfig:o.websocketRetryConfig}),a):new Rie(vu(vu({},o),{},{retryConfig:o.websocketRetryConfig}),a),this._statsCollector=o.statsCollector,this.role=o.role||"audience",this._clientRoleOptions=o.clientRoleOptions,this.handleSignalEvents()}async join(a,o,c){if(this.signal instanceof vm){let C=!1;a.cloudProxyServer!=="disabled"?(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because cloudProxyServer are not supported (").concat(a.cloudProxyServer,")")),C=!0):"".concat(a.apResponse.cid,"_").concat(a.apResponse.cert).length>255||"".concat(a.apResponse.cid,"_").concat(a.apResponse.cert).length<22?(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because ticket length is incorrect, it has to be between 22 and 255")),C=!0):a.apResponse.addresses.some(R=>R.fingerprint)||ve("FINGERPRINT")||(z.debug("[".concat(this.store.clientId,"] Dc is not supported, because fingerprint does not exist")),C=!0),C&&this.resetSignal()}this.store.joinGatewayStart(),a.cloudProxyServer!=="disabled"&&(this.hasChangeBGPAddress=!0);let f=Date.now(),m=lG.get(a.cname);if(m||(m=new Map,lG.set(a.cname,m)),this._isProactiveJoin=!0,m.has(a.uid)){let C=new De(ce.UID_CONFLICT);throw $t.joinGateway(a.sid,{lts:f,succ:!1,ec:C.message,addr:null,uid:a.uid,cid:a.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!a.proxyServer,signalChannel:this.signal instanceof vm?"1":"0"}),this._isProactiveJoin=!1,C}m.set(a.uid,!0),this.joinInfo=a,this.key=o;let v=0;this.joinGatewayStartTime=f;let w=a.proxyServer;try{let C;if(z.debug("[".concat(this.store.clientId,"] use ").concat(this.signal instanceof vm?"datachannel":"websocket"," join uid ").concat(v)),this.signal instanceof vm)C=await this.signal.init(a.apResponse.addresses,c);else{let R=a.gatewayAddrs.map(x=>{let{address:L}=x,[U,F]=L.split(":"),Z={host:U,port:F};return a.proxyServer&&(Z.proxy=a.proxyServer),Z});C=await this.signal.init(R,c)}v=C.uid,z.debug("[".concat(this.store.clientId,"] ").concat(this.signal instanceof vm?"datachannel":"websocket"," join uid ").concat(v," cost ").concat(Date.now()-this.joinGatewayStartTime))}catch(C){throw C&&C.code===ce.INIT_WEBSOCKET_TIMEOUT?(z.warning("[".concat(this.store.clientId,"] User join failed"),C.toString()),C):C&&C.code===ce.INIT_DATACHANNEL_TIMEOUT?(z.warning("[".concat(this.store.clientId,"] User join datachannel failed"),C.toString()),this.resetSignal(),C):(z.error("[".concat(this.store.clientId,"] User join failed"),C.toString()),$t.joinGateway(a.sid,{lts:f,succ:!1,ec:C.message,addr:this.signal.url,uid:a.uid,cid:a.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!w,signalChannel:this.signal instanceof vm?"1":"0"}),this._isProactiveJoin=!1,m.delete(a.uid),this.signal.close(),C)}return this.state="CONNECTED",this.inChannelInfo.joinAt=Date.now(),z.debug("[".concat(this.store.clientId,"] Connected to gateway server")),this.trafficStatsInterval=window.setInterval(()=>{this.updateTrafficStats().catch(C=>{z.warning("[".concat(this.store.clientId,"] get traffic stats error"),C.toString())})},3e3),this.networkQualityInterval=window.setInterval(()=>{navigator&&navigator.onLine!==void 0&&!navigator.onLine?this.emit(Ir.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6}):this._signalTimeout?this.emit(Ir.NETWORK_QUALITY,{downlinkNetworkQuality:5,uplinkNetworkQuality:5}):this.state==="CONNECTED"&&this._statsCollector.trafficStats?this.emit(Ir.NETWORK_QUALITY,{uplinkNetworkQuality:Iie(this._statsCollector.trafficStats.B_unq),downlinkNetworkQuality:Iie(this._statsCollector.trafficStats.B_dnq)}):this.emit(Ir.NETWORK_QUALITY,{uplinkNetworkQuality:0,downlinkNetworkQuality:0})},2e3),this.store.joinGatewayEnd(),v}async leave(){let a=arguments.length>0&&arguments[0]!==void 0&&arguments[0],o=arguments.length>1?arguments[1]:void 0;if(this.state!=="DISCONNECTED"){o!==Hn.FALLBACK&&(this.state="DISCONNECTING");try{a||this.signal.connectionState!==Vn.CONNECTED||await function(c,f){return f===1/0?c:Ct.race([c,axe(f)])}(this.signal.request(rn.LEAVE,void 0,!0),3e3)}catch(c){z.warning("[".concat(this.store.clientId,"] leave request failed, ignore"),c)}this.signal.close(o),o!==Hn.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}}async publish(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));let f={state:"offer",p2p_id:this.store.p2pId,ortc:o,mode:this.spec.mode,extend:ve("PUB_EXTEND"),twcc:!!ve("PUBLISH_TWCC"),rtx:!!ve("USE_PUB_RTX")};try{return(await this.signal.request(rn.PUBLISH,f,!0))._message}catch(m){if(c&&m.data&&m.data.code===ln.ERR_PUBLISH_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receive publish error code, retry"),m.toString()),await this.tryUnpubBeforeRepub(a,o),this.publish(a,o,!1);throw m}}async publishDataChannel(a,o,c){var f;if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));let m={stream_id:o.streamId,ordered:o.ordered?1:0,max_retrans_times:(f=o.maxRetransmits)!==null&&f!==void 0?f:10,channel_id:o.channelId,metadata:o.metadata};try{await this.signal.request(rn.PUBLISH_DATASTREAM,m,!0)}catch(v){if(c&&v.data&&v.data.code===ln.ERR_PUBLISH_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receive publish datachannels error code, retry"),v.toString()),await this.tryUnpubDataChannelBeforeRepub(a,o),this.publishDataChannel(a,o,!1);throw v}}async unpublish(a,o){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await this.signal.request(rn.UNPUBLISH,{stream_id:o,ortc:a},!0)}catch(c){z.warning("[".concat(this.store.clientId,"] unpublish warning: "),c)}}async unpublishDataChannel(a){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await Ct.all(a.map(o=>this.signal.request(rn.UNPUBLISH_DATASTREAM,{channel_id:o},!0)))}catch(o){z.warning("unpublish datachannels warning: ",o)}}async presubscribe(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not presubscribe when connection state is ".concat(this.state));let f={stream_id:a,stream_type:o,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,twcc:!!ve("SUBSCRIBE_TWCC"),rtx:!!ve("USE_SUB_RTX")||void 0,extend:ve("SUB_EXTEND"),svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return await this.signal.request(rn.PRE_SUBSCRIBE,f,!0)}catch(m){if(c&&m.data&&m.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] pre-subscribe error, retry"),m.toString()),this.presubscribe(a,o,!1);throw m}}async subscribe(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not subscribe when connection state is ".concat(this.state));let f={stream_id:a,stream_type:o.stream_type,mode:this.spec.mode,codec:this.spec.codec,p2p_id:this.store.p2pId,twcc:!!ve("SUBSCRIBE_TWCC"),rtx:!!ve("USE_SUB_RTX"),extend:ve("SUB_EXTEND"),ssrcId:o.ssrcId,svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return(await this.signal.request(rn.SUBSCRIBE,f,!0))._message}catch(m){if(c&&m.data&&m.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver subscribe error code, retry"),m.toString()),await this.tryUnsubBeforeResub(a,o),await this.subscribe(a,o,!1);throw m}}async subscribeDataChannel(a,o,c){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not subscribe datachannel when connection state is ".concat(this.state));let f={uid:a,stream_id:o.id,channel_id:o.datachannelId};try{return void await this.signal.request(rn.SUBSCRIBE_DATASTREAM,f,!0)}catch(m){if(c&&m.data&&m.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver subscribe datachannel error code, retry"),m.toString()),await this.tryUnsubDataChannelBeforeResub(a,o),await this.subscribeDataChannel(a,o,!1);throw m}}async subscribeAll(a,o){if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not massSubscribe when connection state is ".concat(this.state));let c={p2p_id:this.store.p2pId,users:a,dtx:!1,rtx:!!ve("USE_SUB_RTX"),twcc:!!ve("SUBSCRIBE_TWCC"),svc:Array.isArray(ve("SVC"))&&ve("SVC").length!==0?ve("SVC"):void 0};try{return await this.signal.request(rn.SUBSCRIBE_STREAMS,c,!0)}catch(f){if(o&&f.data&&f.data.code===ln.ERR_SUBSCRIBE_REQUEST_INVALID)return z.warning("[".concat(this.store.clientId,"] receiver massSubscribe error code, retry"),f.toString()),await this.tryMassUnsubBeforeResub(a),await this.subscribeAll(a,!1);throw f}}async setVideoProfile(a){let o=function(c){if(!(c.bitrateMax&&c.bitrateMin&&c.frameRate&&c.height&&c.width))return;let f=c.frameRate,m=c.width,v=c.height,w=!0;return typeof f!="number"&&(f=f.exact||f.ideal||f.max||f.min||0,f||(w=!1)),typeof m!="number"&&(m=m.exact||m.ideal||m.max||m.min||0,m||(w=!1)),typeof v!="number"&&(v=v.exact||v.ideal||v.max||v.min||0,f||(w=!1)),w?{stream_type:0,width:m,height:v,fps:f,start_bps:1e3*c.bitrateMax,min_bps:1e3*c.bitrateMin,target_bps:1e3*c.bitrateMax}:void 0}(a);if(o)return this.signal.request(rn.SET_VIDEO_PROFILE,o);z.debug("[".concat(this.store.clientId,"] encoder config is not complete, do not report to gateway"))}async unsubscribe(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{p2p_id:this.store.p2pId,ortc:a,stream_id:o},!0)}catch(c){z.warning("[".concat(this.store.clientId,"] unsubscribe warning: "),c)}}async unsubscribeDataChannel(a,o){try{if(this.state!=="CONNECTED"&&this.state!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish when connection state is ".concat(this.state));await Ct.all(a.map(c=>this.signal.request(rn.UNSUBSCRIBE_DATASTREAM,{stream_id:c,uid:o},!0)))}catch(c){z.warning("unsubscribeDataChannel warning: ",c)}}async massUnsubscribe(a){try{await this.signal.request(rn.UNSUBSCRIBE_STREAMS,a,!0)}catch(o){z.warning("[".concat(this.store.clientId,"] massUnsubscribeAll warning: "),o)}}async reconnectPC(a){let{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}=a;return{gatewayEstablishParams:await this.signal.request(rn.CONNECT_PC,{p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}},!0),gatewayAddress:this.getCurrentGatewayAddress()}}getGatewayInfo(){return this.signal.request(rn.GATEWAY_INFO)}async renewToken(a){await this.signal.request(rn.RENEW_TOKEN,a),this.key=a.token}async setClientRole(a,o){if(o&&(this._clientRoleOptions=Object.assign({},o)),this.state!=="CONNECTED")return void(this.role=a);let c,f=0;a==="audience"?this._clientRoleOptions&&this._clientRoleOptions.delay?(c=this._clientRoleOptions.delay,f=1):f=this._clientRoleOptions&&this._clientRoleOptions.level?this._clientRoleOptions.level:2:f=0,await this.signal.request(rn.SET_CLIENT_ROLE,{role:a,level:f,delay:c,client_ts:Date.now()}),this.role=a}async setRemoteVideoStreamType(a,o){await this.signal.request(rn.SWITCH_VIDEO_STREAM,{stream_id:a,stream_type:o})}async setDefaultRemoteVideoStreamType(a){await this.signal.request(rn.DEFAULT_VIDEO_STREAM,{stream_type:a})}async setStreamFallbackOption(a,o){await this.signal.request(rn.SET_FALLBACK_OPTION,{stream_id:a,fallback_type:o})}async pickSVCLayer(a,o){await this.signal.request(rn.PICK_SVC_LAYER,{stream_id:a,spatial_layer:o.spatialLayer,temporal_layer:o.temporalLayer})}async setRTM2Flag(a){await this.signal.request(rn.SET_RTM2_FLAG,{rtm2_flag:a})}async sendExtensionMessage(a,o,c){if(this.signal instanceof Lie)return this.signal.sendExtensionMessage(a,o,c)}getInChannelInfo(){return this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt),vu({},this.inChannelInfo)}async getGatewayVersion(){return(await this.signal.request(rn.GATEWAY_INFO)).version}reset(){if(this.inChannelInfo.joinAt&&(this.inChannelInfo.duration=Date.now()-this.inChannelInfo.joinAt,this.inChannelInfo.joinAt=null),this.trafficStatsInterval&&(window.clearInterval(this.trafficStatsInterval),this.trafficStatsInterval=void 0),this.joinInfo){let a=lG.get(this.joinInfo.cname);a&&a.delete(this.joinInfo.uid)}this.joinInfo=void 0,this.key=void 0,this.networkQualityInterval&&(window.clearInterval(this.networkQualityInterval),this.networkQualityInterval=void 0)}updateTurnConfigFromSignal(){if(!this.joinInfo)return;let a=function(o){let c;return c=o.startsWith("dc")?o.match(/(dc\:\/\/)?([^:]+):(\d+)/):o.match(/(wss\:\/\/)?([^:]+):(\d+)/),c?{username:Ks.username,password:Ks.password,turnServerURL:c[2],tcpport:parseInt(c[3])+30,udpport:parseInt(c[3])+30,forceturn:!1}:null}((this.joinInfo.cloudProxyServer==="disabled"?this.signal.url:this.joinInfo.gatewayAddrs[this.signal.currentURLIndex].address)||"");this.joinInfo.turnServer.serversFromGateway=[],a&&this.joinInfo.turnServer.mode!=="off"&&this.joinInfo.cloudProxyServer==="disabled"&&this.joinInfo.turnServer.serversFromGateway.push(vu(vu({},Ks),{},{turnServerURL:a.turnServerURL,tcpport:a.tcpport,udpport:a.udpport,username:this.joinInfo.uid.toString(),password:this.joinInfo.token}))}async updateTrafficStats(){if(this.state!=="CONNECTED")return;let a=await this.signal.request(rn.TRAFFIC_STATS,void 0,!0);a.timestamp=Date.now(),a.ntp_offset!=null&&(this.ntpOffset=a.ntp_offset),a.peer_delay.forEach(o=>{let c=this._statsCollector.trafficStats&&this._statsCollector.trafficStats.peer_delay.find(f=>f.peer_uid===o.peer_uid);c&&c.B_st!==o.B_st&&D8(()=>{this.emit(Ir.STREAM_TYPE_CHANGE,o.peer_uid,o.B_st)})}),this._statsCollector.updateTrafficStats(a)}getJoinMessage(a){if(!this.joinInfo||!this.key)throw new De(ce.UNEXPECTED_ERROR,"can not generate join message, no join info");let o=Object.assign({},this.joinInfo.apResponse),c=ve("REPORT_APP_SCENARIO");if(typeof c!="string")try{c=JSON.stringify(c)}catch{c=void 0}c&&c.length>128&&(c=void 0);let f=vu({license:this.joinInfo.license,p2p_id:this.store.p2pId,session_id:this.joinInfo.sid,app_id:this.joinInfo.appId,channel_key:this.key,channel_name:this.joinInfo.cname,sdk_version:dd,browser:navigator.userAgent,process_id:ve("PROCESS_ID"),mode:this.store.useP2P?"p2p":this.spec.mode,codec:this.spec.codec,role:this.role,has_changed_gateway:this.hasChangeBGPAddress,ap_response:o,extend:ve("JOIN_EXTEND"),details:{6:this.joinInfo.stringUid,cservice_map:this.joinInfo.cloudProxyServer==="proxy3"?"1":this.joinInfo.cloudProxyServer==="proxy5"?"2":void 0},features:{rejoin:!0},optionalInfo:this.joinInfo.optionalInfo,appScenario:c,attributes:{userAttributes:{enablePublishedUserList:ve("ENABLE_PUBLISHED_USER_LIST"),maxSubscription:ve("MAX_SUBSCRIPTION"),subscribeAudioFilterTopN:typeof ve("SUBSCRIBE_AUDIO_FILTER_TOPN")=="number"?ve("SUBSCRIBE_AUDIO_FILTER_TOPN"):void 0,enablePublishAudioFilter:typeof ve("ENABLE_PUBLISH_AUDIO_FILTER")=="boolean"?ve("ENABLE_PUBLISH_AUDIO_FILTER"):void 0,enableUserLicenseCheck:typeof ve("ENABLE_USER_LICENSE_CHECK")=="boolean"?ve("ENABLE_USER_LICENSE_CHECK"):void 0,enableRTX:ve("USE_PUB_RTX")===!0||ve("USE_SUB_RTX")===!0||void 0,disableFEC:ve("DISABLE_FEC"),enableNTPReport:!!ve("ENABLE_NTP_REPORT")||void 0,enableInstantVideo:!!ve("ENABLE_INSTANT_VIDEO")||void 0,enableDataStream2:typeof ve("ENABLE_DATASTREAM_2")=="boolean"?ve("ENABLE_DATASTREAM_2"):void 0,rtm2Flag:typeof this.joinInfo.rtmFlag=="number"?this.joinInfo.rtmFlag:void 0,enableUserAutoRebalanceCheck:!!ve("ENABLE_USER_AUTO_REBALANCE_CHECK"),enableXR:typeof ve("USE_XR")=="boolean"?ve("USE_XR"):void 0,enableLossbasedBwe:typeof ve("ENABLE_LOSSBASED_BWE")=="boolean"?ve("ENABLE_LOSSBASED_BWE"):void 0,enableAutCC:typeof ve("ENABLE_AUT_CC")=="boolean"?ve("ENABLE_AUT_CC"):void 0,enableCCFallback:typeof ve("ENABLE_CC_FALLBACK")=="boolean"?ve("ENABLE_CC_FALLBACK"):void 0}},join_ts:this.joinGatewayStartTime},a);return this.joinInfo.stringUid&&(f.string_uid=this.joinInfo.stringUid),this.joinInfo.aesmode&&this.joinInfo.aespassword&&(f.aes_mode=this.joinInfo.aesmode,ve("ENCRYPT_AES")?(f.aes_secret=this.joinInfo.aespassword,f.aes_encrypt=!0):f.aes_secret=this.joinInfo.aespassword,this.joinInfo.aessalt&&(f.aes_salt=this.joinInfo.aessalt)),o.addresses[this.signal.websocket.currentURLIndex]&&(f.ap_response.ticket=o.addresses[this.signal.websocket.currentURLIndex].ticket,delete o.addresses),this.joinInfo.defaultVideoStream!==void 0&&(f.default_video_stream=this.joinInfo.defaultVideoStream),f}getRejoinMessage(){if(!this.joinInfo)throw new De(ce.UNEXPECTED_ERROR,"can not generate rejoin message, no join info");return{session_id:this.joinInfo.sid,channel_name:this.joinInfo.cname,cid:this.joinInfo.cid,uid:this.joinInfo.uid,vid:Number(this.joinInfo.vid)}}handleSignalEvents(){this.signal.on(Ut.WS_RECONNECT_WAITTING_FINISH,a=>{var o;Tt(o=["tryNext","recover"]).call(o,a)&&this.joinInfo&&$t.adjustSessionStartTime(this.joinInfo.sid)}),this.signal.on(Ut.WS_RECONNECT_CREATE_CONNECTION,a=>{this.joinGatewayStartTime=Date.now()}),this.signal.on(Ut.WS_RECONNECTING,a=>{this.joinInfo&&$t.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:a||$s.NETWORK_ERROR}),this.joinInfo&&(this.state="RECONNECTING",$t.sessionInit(this.joinInfo.sid,{lts:new Date().getTime(),extend:this.isSignalRecover?{recover:!0}:{rejoin:!0},cname:this.joinInfo.cname,appid:this.joinInfo.appId,mode:this.spec.mode,stringUid:this.joinInfo.stringUid,channelProfile:this.spec.mode==="live"?1:0,channelMode:0,lsid:this.joinInfo.sid,clientRole:this.role==="audience"?2:1,buildFormat:1}),this.isSignalRecover=!1,this.joinGatewayStartTime=Date.now())}),this.signal.on(Ut.WS_CLOSED,a=>{let o;switch(a){case Hn.LEAVE:o=$s.LEAVE;break;case Hn.UID_BANNED:case Hn.IP_BANNED:case Hn.CHANNEL_BANNED:case Hn.SERVER_ERROR:o=$s.SERVER_ERROR;break;case Hn.FALLBACK:o=$s.FALLBACK;break;case Hn.LICENSE_MISSING:case Hn.LICENSE_EXPIRED:case Hn.LICENSE_MINUTES_EXCEEDED:case Hn.LICENSE_PERIOD_INVALID:case Hn.LICENSE_MULTIPLE_SDK_SERVICE:case Hn.LICENSE_ILLEGAL:case Hn.TOKEN_EXPIRE:o=a;break;default:o=$s.NETWORK_ERROR}z.debug("[".concat(this.store.clientId,"] [signal] websocket closed, reason: ").concat(o||"undefined -> "+$s.NETWORK_ERROR)),this.joinInfo&&$t.WebSocketQuit(this.joinInfo.sid,{lts:Date.now(),succ:a===Hn.LEAVE?1:-1,cname:this.joinInfo.cname,uid:this.joinInfo.uid,cid:this.joinInfo.cid,errorCode:o}),this._disconnectedReason=a,a!==Hn.FALLBACK&&(this.state="DISCONNECTED"),this.reset()}),this.signal.on(Ut.WS_CONNECTED,()=>{if(this.updateTurnConfigFromSignal(),this.state="CONNECTED",this.joinInfo&&(this.role==="audience"&&this._clientRoleOptions&&(this._clientRoleOptions.level||this._clientRoleOptions.delay)&&(z.debug("[".concat(this.store.clientId,"] patch to send set client role, role: ").concat(this.role,", mode: ").concat(this.spec.mode,", level: ").concat(this._clientRoleOptions.level,", delay: ").concat(this._clientRoleOptions.delay)),this.setClientRole(this.role,this._clientRoleOptions)),$t.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!0,ec:null,vid:this.joinInfo.vid,addr:this.signal.url,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer,signalChannel:this.signal instanceof vm?"1":"0"}),this._isProactiveJoin=!1,this.joinInfo.useLocalAccessPoint&&this.joinInfo.setLocalAPVersion===1)){let a=this.signal.url&&this.signal.url.match(/wss\:\/\/([^:]+):(\d+)/);if(!a)return void z.error("[".concat(this.store.clientId,"] set local access point after joined failed: ").concat(a));Ri("EVENT_REPORT_DOMAIN",a[1]),Ri("EVENT_REPORT_BACKUP_DOMAIN",a[1]),Ri("LOG_UPLOAD_SERVER","".concat(a[1],":6444"))}}),this.signal.on(Sn.ON_UPLINK_STATS,a=>{this._statsCollector.updateUplinkStats(a)}),this.signal.on(Ut.REQUEST_RECOVER,(a,o,c)=>{if(!this.joinInfo)return c(new De(ce.UNEXPECTED_ERROR,"gateway: can not recover, no join info"));a&&(this.joinInfo.multiIP=a,this.hasChangeBGPAddress=!0),this.isSignalRecover=!0,Kr(this,Ir.REQUEST_NEW_GATEWAY_LIST).then(o).catch(c)}),this.signal.on(Ut.REQUEST_JOIN_INFO,async a=>{var o;if(this.updateTurnConfigFromSignal(),this.store.useP2P)return void a(this.getJoinMessage({ortc:{}}));let{iceParameters:c,dtlsParameters:f,rtpCapabilities:m}=await Kr(this,Ir.REQUEST_P2P_CONNECTION_PARAMS,{turnServer:(o=this.joinInfo)===null||o===void 0?void 0:o.turnServer});a(this.getJoinMessage({ortc:{iceParameters:c,dtlsParameters:f,rtpCapabilities:m,version:"2"}}))}),this.signal.on(Ut.REQUEST_REJOIN_INFO,a=>{a(this.getRejoinMessage())}),this.signal.on(Ut.REPORT_JOIN_GATEWAY,(a,o)=>{this.joinInfo&&($t.joinGateway(this.joinInfo.sid,{lts:this.joinGatewayStartTime,succ:!1,ec:a,addr:o,uid:this.joinInfo.uid,cid:this.joinInfo.cid,firstSuccess:this._isProactiveJoin,avoidJoinStartTime:this.store.avoidJoinStart,isProxy:!!this.joinInfo.proxyServer,signalChannel:this.signal instanceof vm?"1":"0"}),this._isProactiveJoin=!1)}),this.signal.on(Ut.IS_P2P_DISCONNECTED,a=>{a(Vy(this,Ir.IS_P2P_DISCONNECTED))}),this.signal.on(Ut.DISCONNECT_P2P,()=>{this.emit(Ir.DISCONNECT_P2P)}),this.signal.on(Ut.NEED_RENEW_SESSION,a=>{this.emit(Ir.NEED_RENEW_SESSION,a)}),this.signal.on(Ut.REQUEST_SUCCESS,()=>{this._signalTimeout=!1}),this.signal.on(Ut.REQUEST_TIMEOUT,()=>{this._signalTimeout=!0}),this.signal.on(Ut.JOIN_RESPONSE,a=>{let o=this.getCurrentGatewayAddress();this.emit(Ir.JOIN_RESPONSE,a,o)}),this.signal.on(Ut.DATACHANNEL_PRECONNECT,async(a,o,c)=>{this.updateTurnConfigFromSignal();let f=this.getCurrentGatewayAddress();return Kr(this,Ir.DATACHANNEL_PRECONNECT,a,f).then(o).catch(c)}),this.signal.on(Ut.DATACHANNEL_CONNECTING,async a=>{let{iceParameters:o,dtlsParameters:c,rtpCapabilities:f}=await Kr(this,Ir.REQUEST_DC_CONNECTION_PARAMS);a(this.getJoinMessage({ortc:{iceParameters:o,dtlsParameters:c,rtpCapabilities:f,version:"2"}}))}),this.signal.on(Ut.DATACHANNEL_FAILBACK,()=>{z.warning("[".concat(this.store.clientId,"] User join datachannel failed")),this.reset(),this.resetSignal(),this.emit(Ir.DATACHANNEL_FAILBACK)})}async tryUnsubBeforeResub(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{p2p_id:this.store.p2pId,stream_id:a,ortc:[o]},!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryUnsubBeforeResub warning"),c),c}}async tryUnsubDataChannelBeforeResub(a,o){try{await this.signal.request(rn.UNSUBSCRIBE,{stream_id:o.id},!0)}catch(c){throw z.warning("unsubscribe datachannel warning",c),c}}async tryUnpubBeforeRepub(a,o){try{await this.signal.request(rn.UNPUBLISH,{stream_id:a,ortc:o},!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryUnpubBeforeRepub warning: "),c),c}}async tryUnpubDataChannelBeforeRepub(a,o){try{await this.signal.request(rn.UNPUBLISH_DATASTREAM,{channnel_id:o.channelId},!0)}catch(c){throw z.warning("unpublish datastream warning: ",c),c}}async tryMassUnsubBeforeResub(a){let o={users:a.map(c=>({stream_id:c.stream_id,stream_type:c.stream_type}))};try{await this.signal.request(rn.UNSUBSCRIBE_STREAMS,o,!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] tryMassUnsubBeforeResub warning"),c),c}}async muteLocal(a,o){let c={action:a.find(f=>f.stream_type===pi.Audio)?"mute_local_audio":"mute_local_video",p2p_id:this.store.p2pId,ortc:a,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway muteLocal warning: "),f),f}}async unmuteLocal(a,o){let c={action:a.find(f=>f.stream_type===pi.Audio)?"unmute_local_audio":"unmute_local_video",p2p_id:this.store.p2pId,ortc:a,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway unmuteLocal warning: "),f),f}}async muteRemote(a,o){let c={action:a===Wt.AUDIO?"mute_remote_audio":"mute_remote_video",p2p_id:this.store.p2pId,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway muteRemote warning: "),f),f}}async unmuteRemote(a,o){let c={action:a===Wt.AUDIO?"unmute_remote_audio":"unmute_remote_video",p2p_id:this.store.p2pId,stream_id:o};try{await this.signal.request(rn.CONTROL,c,!0,!0)}catch(f){throw z.warning("[".concat(this.store.clientId,"] gateway unmuteRemote warning: "),f),f}}uploadWRTCStats(a){this.signal.uploadWRTCStats(a)}upload(a,o){this.signal.upload(a,o)}getSignalRTT(){return this.signal.rtt}async restartICE(a){let o={p2p_id:this.store.p2pId,stream_id:this.store.uid,ortc:a};try{return await this.signal.request(rn.RESTART_ICE,o,!0)}catch(c){throw z.warning("[".concat(this.store.clientId,"] P2PChannel.restartICE warning: "),c),c}}reconnect(){this.state==="CONNECTED"&&this.signal.reconnect(void 0,$s.P2P_FAILED)}getCurrentGatewayAddress(){var a;if(!ve("GATEWAY_WSS_ADDRESS"))return(a=this.joinInfo)!==null&&a!==void 0&&a.gatewayAddrs?this.joinInfo.gatewayAddrs[this.signal.currentURLIndex]:void 0}async setPublishAudioFilterEnabled(a){await this.signal.request(rn.SET_PARAMETER,{enablePublishAudioFilter:a})}resetSignal(){this.signal&&(this.signal.removeAllListeners(),this.signal.close(Hn.FALLBACK)),this.store.useDataChannel=!1,this.signal=new Rie(vu(vu({},this.spec),{},{retryConfig:this.spec.websocketRetryConfig}),this.store),this.handleSignalEvents(),this.emit(Ir.RESET_SIGNAL,yie.websocket)}}let q8=0,cG=0;function Th(r,a,o,c){return new Ct((f,m)=>{a.timeout=a.timeout||ve("HTTP_CONNECT_TIMEOUT"),a.responseType=a.responseType||"json",a.data&&!o?(a.data=JSON.stringify(a.data),q8+=Df(a.data)):o&&(a.data.size?q8+=a.data.size:a.data instanceof FormData?q8+=Xne(a.data):q8+=Df(JSON.stringify(a.data))),a.headers=a.headers||{},a.headers["Content-Type"]=a.headers["Content-Type"]||"application/json",a.method="POST",a.url=r,Io.request(a).then(v=>{typeof v.data=="string"?cG+=Df(v.data):v.data instanceof ArrayBuffer||v.data instanceof Uint8Array?cG+=v.data.byteLength:cG+=Df(JSON.stringify(v.data)),c&&f({data:v.data,headers:v.headers}),f(v.data)}).catch(v=>{Io.isCancel(v)?m(new De(ce.OPERATION_ABORTED,"cancel token canceled")):v.code==="ECONNABORTED"?m(new De(ce.NETWORK_TIMEOUT,v.message)):v.response?m(new De(ce.NETWORK_RESPONSE_ERROR,v.response.status)):m(new De(ce.NETWORK_ERROR,v.message))})})}(function(){var r;function a(at){var yt=0;return function(){return yt<at.length?{done:!1,value:at[yt++]}:{done:!0}}}var o=typeof Object.defineProperties=="function"?Object.defineProperty:function(at,yt,Vt){return at==Array.prototype||at==Object.prototype||(at[yt]=Vt.value),at},c,f=function(at){at=[typeof globalThis=="object"&&globalThis,at,typeof window=="object"&&window,typeof self=="object"&&self,typeof s=="object"&&s];for(var yt=0;yt<at.length;++yt){var Vt=at[yt];if(Vt&&Vt.Math==Math)return Vt}throw Error("Cannot find global object")}(this);function m(at,yt){if(yt)e:{var Vt=f;at=at.split(".");for(var Rn=0;Rn<at.length-1;Rn++){var oi=at[Rn];if(!(oi in Vt))break e;Vt=Vt[oi]}(yt=yt(Rn=Vt[at=at[at.length-1]]))!=Rn&&yt!=null&&o(Vt,at,{configurable:!0,writable:!0,value:yt})}}function v(at){return(at={next:at})[Symbol.iterator]=function(){return this},at}function w(at){var yt=typeof Symbol<"u"&&Symbol.iterator&&at[Symbol.iterator];return yt?yt.call(at):{next:a(at)}}if(m("Symbol",function(at){function yt(oi,Rt){this.A=oi,o(this,"description",{configurable:!0,writable:!0,value:Rt})}if(at)return at;yt.prototype.toString=function(){return this.A};var Vt="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",Rn=0;return function oi(Rt){if(this instanceof oi)throw new TypeError("Symbol is not a constructor");return new yt(Vt+(Rt||"")+"_"+Rn++,Rt)}}),m("Symbol.iterator",function(at){if(at)return at;at=Symbol("Symbol.iterator");for(var yt="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),Vt=0;Vt<yt.length;Vt++){var Rn=f[yt[Vt]];typeof Rn=="function"&&typeof Rn.prototype[at]!="function"&&o(Rn.prototype,at,{configurable:!0,writable:!0,value:function(){return v(a(this))}})}return at}),typeof Object.setPrototypeOf=="function")c=Object.setPrototypeOf;else{var C;e:{var R={};try{R.__proto__={a:!0},C=R.a;break e}catch{}C=!1}c=C?function(at,yt){if(at.__proto__=yt,at.__proto__!==yt)throw new TypeError(at+" is not extensible");return at}:null}var x=c;function L(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function U(at){if(at.m)throw new TypeError("Generator is already running");at.m=!0}function F(at,yt){return at.h=3,{value:yt}}function Z(at){this.g=new L,this.G=at}function W(at,yt,Vt,Rn){try{var oi=yt.call(at.g.j,Vt);if(!(oi instanceof Object))throw new TypeError("Iterator result "+oi+" is not an object");if(!oi.done)return at.g.m=!1,oi;var Rt=oi.value}catch(q){return at.g.j=null,at.g.s(q),K(at)}return at.g.j=null,Rn.call(at.g,Rt),K(at)}function K(at){for(;at.g.h;)try{var yt=at.G(at.g);if(yt)return at.g.m=!1,{value:yt.value,done:!1}}catch(Vt){at.g.v=void 0,at.g.s(Vt)}if(at.g.m=!1,at.g.l){if(yt=at.g.l,at.g.l=null,yt.F)throw yt.D;return{value:yt.return,done:!0}}return{value:void 0,done:!0}}function oe(at){this.next=function(yt){return at.o(yt)},this.throw=function(yt){return at.s(yt)},this.return=function(yt){return function(Vt,Rn){U(Vt.g);var oi=Vt.g.j;return oi?W(Vt,"return"in oi?oi.return:function(Rt){return{value:Rt,done:!0}},Rn,Vt.g.return):(Vt.g.return(Rn),K(Vt))}(at,yt)},this[Symbol.iterator]=function(){return this}}function ue(at,yt){return yt=new oe(new Z(yt)),x&&at.prototype&&x(yt,at.prototype),yt}if(L.prototype.o=function(at){this.v=at},L.prototype.s=function(at){this.l={D:at,F:!0},this.h=this.C||this.u},L.prototype.return=function(at){this.l={return:at},this.h=this.u},Z.prototype.o=function(at){return U(this.g),this.g.j?W(this,this.g.j.next,at,this.g.o):(this.g.o(at),K(this))},Z.prototype.s=function(at){return U(this.g),this.g.j?W(this,this.g.j.throw,at,this.g.o):(this.g.s(at),K(this))},m("Array.prototype.entries",function(at){return at||function(){return function(yt,Vt){yt instanceof String&&(yt+="");var Rn=0,oi=!1,Rt={next:function(){if(!oi&&Rn<yt.length){var q=Rn++;return{value:Vt(q,yt[q]),done:!1}}return oi=!0,{done:!0,value:void 0}}};return Rt[Symbol.iterator]=function(){return Rt},Rt}(this,function(yt,Vt){return[yt,Vt]})}}),typeof Blob<"u"&&(typeof FormData>"u"||!FormData.prototype.keys)){var xe=function(at,yt){for(var Vt=0;Vt<at.length;Vt++)yt(at[Vt])},Oe=function(at){return at.replace(/\r?\n|\r/g,`\r
`)},ke=function(at,yt,Vt){return yt instanceof Blob?(Vt=Vt!==void 0?Vt+"":typeof yt.name=="string"?yt.name:"blob",yt.name===Vt&&Object.prototype.toString.call(yt)!=="[object Blob]"||(yt=new File([yt],Vt)),[String(at),yt]):[String(at),String(yt)]},He=function(at,yt){if(at.length<yt)throw new TypeError(yt+" argument required, but only "+at.length+" present.")},lt=typeof globalThis=="object"?globalThis:typeof window=="object"?window:typeof self=="object"?self:this,ut=lt.FormData,ft=lt.XMLHttpRequest&&lt.XMLHttpRequest.prototype.send,zt=lt.Request&&lt.fetch,$n=lt.navigator&&lt.navigator.sendBeacon,hi=lt.Element&&lt.Element.prototype,Gi=lt.Symbol&&Symbol.toStringTag;Gi&&(Blob.prototype[Gi]||(Blob.prototype[Gi]="Blob"),"File"in lt&&!File.prototype[Gi]&&(File.prototype[Gi]="File"));try{new File([],"")}catch{lt.File=function(at,yt,Vt){return at=new Blob(at,Vt||{}),Object.defineProperties(at,{name:{value:yt},lastModified:{value:+(Vt&&Vt.lastModified!==void 0?new Date(Vt.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),Gi&&Object.defineProperty(at,Gi,{value:"File"}),at}}var Ur=function(at){return at.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},mr=function(at){this.i=[];var yt=this;at&&xe(at.elements,function(Vt){if(Vt.name&&!Vt.disabled&&Vt.type!=="submit"&&Vt.type!=="button"&&!Vt.matches("form fieldset[disabled] *"))if(Vt.type==="file"){var Rn=Vt.files&&Vt.files.length?Vt.files:[new File([],"",{type:"application/octet-stream"})];xe(Rn,function(oi){yt.append(Vt.name,oi)})}else Vt.type==="select-multiple"||Vt.type==="select-one"?xe(Vt.options,function(oi){!oi.disabled&&oi.selected&&yt.append(Vt.name,oi.value)}):Vt.type==="checkbox"||Vt.type==="radio"?Vt.checked&&yt.append(Vt.name,Vt.value):(Rn=Vt.type==="textarea"?Oe(Vt.value):Vt.value,yt.append(Vt.name,Rn))})};if((r=mr.prototype).append=function(at,yt,Vt){He(arguments,2),this.i.push(ke(at,yt,Vt))},r.delete=function(at){He(arguments,1);var yt=[];at=String(at),xe(this.i,function(Vt){Vt[0]!==at&&yt.push(Vt)}),this.i=yt},r.entries=function at(){var yt,Vt=this;return ue(at,function(Rn){if(Rn.h==1&&(yt=0),Rn.h!=3)return yt<Vt.i.length?Rn=F(Rn,Vt.i[yt]):(Rn.h=0,Rn=void 0),Rn;yt++,Rn.h=2})},r.forEach=function(at,yt){He(arguments,1);for(var Vt=w(this),Rn=Vt.next();!Rn.done;Rn=Vt.next()){var oi=w(Rn.value);Rn=oi.next().value,oi=oi.next().value,at.call(yt,oi,Rn,this)}},r.get=function(at){He(arguments,1);var yt=this.i;at=String(at);for(var Vt=0;Vt<yt.length;Vt++)if(yt[Vt][0]===at)return yt[Vt][1];return null},r.getAll=function(at){He(arguments,1);var yt=[];return at=String(at),xe(this.i,function(Vt){Vt[0]===at&&yt.push(Vt[1])}),yt},r.has=function(at){He(arguments,1),at=String(at);for(var yt=0;yt<this.i.length;yt++)if(this.i[yt][0]===at)return!0;return!1},r.keys=function at(){var yt,Vt,Rn,oi,Rt=this;return ue(at,function(q){if(q.h==1&&(yt=w(Rt),Vt=yt.next()),q.h!=3)return Vt.done?void(q.h=0):(Rn=Vt.value,oi=w(Rn),F(q,oi.next().value));Vt=yt.next(),q.h=2})},r.set=function(at,yt,Vt){He(arguments,2),at=String(at);var Rn=[],oi=ke(at,yt,Vt),Rt=!0;xe(this.i,function(q){q[0]===at?Rt&&(Rt=!Rn.push(oi)):Rn.push(q)}),Rt&&Rn.push(oi),this.i=Rn},r.values=function at(){var yt,Vt,Rn,oi,Rt=this;return ue(at,function(q){if(q.h==1&&(yt=w(Rt),Vt=yt.next()),q.h!=3)return Vt.done?void(q.h=0):(Rn=Vt.value,(oi=w(Rn)).next(),F(q,oi.next().value));Vt=yt.next(),q.h=2})},mr.prototype._asNative=function(){for(var at=new ut,yt=w(this),Vt=yt.next();!Vt.done;Vt=yt.next()){var Rn=w(Vt.value);Vt=Rn.next().value,Rn=Rn.next().value,at.append(Vt,Rn)}return at},mr.prototype._blob=function(){var at="----formdata-polyfill-"+Math.random(),yt=[],Vt="--"+at+`\r
Content-Disposition: form-data; name="`;return this.forEach(function(Rn,oi){return typeof Rn=="string"?yt.push(Vt+Ur(Oe(oi))+`"\r
\r
`+Oe(Rn)+`\r
`):yt.push(Vt+Ur(Oe(oi))+'"; filename="'+Ur(Rn.name)+`"\r
Content-Type: `+(Rn.type||"application/octet-stream")+`\r
\r
`,Rn,`\r
`)}),yt.push("--"+at+"--"),new Blob(yt,{type:"multipart/form-data; boundary="+at})},mr.prototype[Symbol.iterator]=function(){return this.entries()},mr.prototype.toString=function(){return"[object FormData]"},hi&&!hi.matches&&(hi.matches=hi.matchesSelector||hi.mozMatchesSelector||hi.msMatchesSelector||hi.oMatchesSelector||hi.webkitMatchesSelector||function(at){for(var yt=(at=(this.document||this.ownerDocument).querySelectorAll(at)).length;0<=--yt&&at.item(yt)!==this;);return-1<yt}),Gi&&(mr.prototype[Gi]="FormData"),ft){var Ou=lt.XMLHttpRequest.prototype.setRequestHeader;lt.XMLHttpRequest.prototype.setRequestHeader=function(at,yt){Ou.call(this,at,yt),at.toLowerCase()==="content-type"&&(this.B=!0)},lt.XMLHttpRequest.prototype.send=function(at){at instanceof mr?(at=at._blob(),this.B||this.setRequestHeader("Content-Type",at.type),ft.call(this,at)):ft.call(this,at)}}zt&&(lt.fetch=function(at,yt){return yt&&yt.body&&yt.body instanceof mr&&(yt.body=yt.body._blob()),zt.call(this,at,yt)}),$n&&(lt.navigator.sendBeacon=function(at,yt){return yt instanceof mr&&(yt=yt._asNative()),$n.call(this,at,yt)}),lt.FormData=mr}})();let S3=()=>{let r=ve("AREAS");return r.length===0&&r.push(ai.GLOBAL),_c(r).call(r,(a,o,c)=>{let f=kie(o);return f?c===0?f:"".concat(a,",").concat(f):a},"")},kie=r=>r===ai.OVERSEA?"".concat(sa.ASIA,",").concat(sa.EUROPE,",").concat(sa.AFRICA,",").concat(sa.NORTH_AMERICA,",").concat(sa.SOUTH_AMERICA,",").concat(sa.OCEANIA):sa[r],EAe=r=>{let a={CODE:"",WEBCS_DOMAIN:[],WEBCS_DOMAIN_BACKUP_LIST:[],PROXY_CS:[],CDS_AP:[],ACCOUNT_REGISTER:[],UAP_AP:[],EVENT_REPORT_DOMAIN:[],EVENT_REPORT_BACKUP_DOMAIN:[],LOG_UPLOAD_SERVER:[],PROXY_SERVER_TYPE3:[]};return r.map(o=>{let c=W8[o],f=Object.keys(c);f&&f.map(m=>{m!=="CODE"&&(a[m]=a[m].concat(c[m]))})}),a},Y8={GLOBAL:{ASIA:[ai.CHINA,ai.JAPAN,ai.INDIA,ai.KOREA,ai.HKMC],EUROPE:[],NORTH_AMERICA:[ai.US],SOUTH_AMERICA:[],OCEANIA:[],AFRICA:[]}},X8=Object.keys(Y8[ai.GLOBAL]),dG=[ai.CHINA,ai.NORTH_AMERICA,ai.EUROPE,ai.ASIA,ai.JAPAN,ai.INDIA,ai.OCEANIA,ai.SOUTH_AMERICA,ai.AFRICA,ai.KOREA,ai.HKMC,ai.US],wAe=function(r,a){let o=[];if(Tt(r).call(r,ai.GLOBAL)){let m=[ai.GLOBAL,ai.OVERSEA],v=Object.keys(W8);if(a===ai.GLOBAL)throw new De(ce.INVALID_PARAMS,"GLOBAL is an invalid excludedArea value");if(a===ai.CHINA)o=[ai.OVERSEA];else if(f=a,Tt(X8).call(X8,f)){let w=(c=a,Y8[ai.GLOBAL][c]||[]),C=[...m,a,...w];o=v.filter(R=>!Tt(C).call(C,R))}else if(function(w){let C=!1;return X8.forEach(R=>{var x;Tt(x=Y8[ai.GLOBAL][R]).call(x,w)&&(C=!0)}),C}(a)){let w=function(R){let x;return X8.forEach(L=>{var U;Tt(U=Y8[ai.GLOBAL][L]).call(U,R)&&(x=L)}),x}(a),C=[...m,w,a];o=v.filter(R=>!Tt(C).call(C,R))}else o=r;o=function(w){let C=[];return dG.forEach(R=>{Tt(w).call(w,R)&&C.push(R)}),C.concat(w.filter(R=>!Tt(dG).call(dG,R)))}(o)}else o=r;var c,f;return o};function Mie(r){var a,o;if(!r&&Tt(a=ve("AREAS")).call(a,ai.EXTENSIONS))return z.debug("update area from ap : reset"),void uG(mxe,!0);if(!Tt(o=ve("AREAS")).call(o,ai.GLOBAL)||!r)return;let c=W8.EXTENSIONS;c&&(c={CODE:kie(ai.EXTENSIONS),WEBCS_DOMAIN:["ap-web-1-".concat(r,".agora.io")],WEBCS_DOMAIN_BACKUP_LIST:["ap-web-2-".concat(r,".ap.sd-rtn.com")],PROXY_CS:["proxy-ap-web-".concat(r,".agora.io")],CDS_AP:["cds-ap-web-1-".concat(r,".agora.io"),"cds-ap-web-2-".concat(r,".ap.sd-rtn.com")],ACCOUNT_REGISTER:["sua-ap-web-1-".concat(r,".agora.io"),"sua-ap-web-2-".concat(r,".ap.sd-rtn.com")],UAP_AP:["uap-ap-web-1-".concat(r,".agora.io"),"uap-ap-web-2-".concat(r,".ap.sd-rtn.com")],EVENT_REPORT_DOMAIN:["statscollector-1-".concat(r,".agora.io")],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-".concat(r,".agora.io")],LOG_UPLOAD_SERVER:["logservice-".concat(r,".agora.io")],PROXY_SERVER_TYPE3:["webrtc-cloud-proxy-".concat(r,".agora.io")]},z.debug("update area from ap success: ".concat(r,",config is "),c),Ri("AREAS",[ai.EXTENSIONS],!0),Object.keys(c).map(f=>{f==="LOG_UPLOAD_SERVER"||f==="EVENT_REPORT_DOMAIN"||f==="EVENT_REPORT_BACKUP_DOMAIN"||f==="PROXY_SERVER_TYPE3"?Ri(f,c[f][0]):Ri(f,c[f])}))}function uG(r){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1],o=$t.reportApiInvoke(null,{name:$r.SET_AREA,options:r,tag:vr.TRACER});try{let c=[];if(typeof r=="string"&&(c=[r]),Array.isArray(r)&&(r.forEach(m=>{if(!Tt(_ie).call(_ie,m))throw new De(ce.INVALID_PARAMS,"invalid area code")}),c=r),Object.prototype.toString.call(r)==="[object Object]"){let{areaCode:m,excludedArea:v}=r;if(!m)throw new De(ce.INVALID_PARAMS,"area code is needed");let w=m;typeof m=="string"&&(w=[m]),c=v?wAe(w,v):w}if(!a){if(x0.AREAS){let m=new De(ce.PROHIBITED_OPERATION,"setArea is prohibited because of config-distribute");return o.onError(m),void z.warning("setArea is prohibited because of config-distribute")}if(Tt(c).call(c,ai.GLOBAL)&&ve("AREAS")===ai.EXTENSIONS){let m=new De(ce.PROHIBITED_OPERATION,"setArea is prohibited because of ap extensions");return o.onError(m),void z.warning("setArea is prohibited because of ap extensions")}}Ri("AREAS",c,a);let f=EAe(c);Object.keys(f).map(m=>{m==="LOG_UPLOAD_SERVER"||m==="EVENT_REPORT_DOMAIN"||m==="EVENT_REPORT_BACKUP_DOMAIN"||m==="PROXY_SERVER_TYPE3"?Ri(m,f[m][0]):Ri(m,f[m])}),z.debug("set area success:",c.join(","))}catch(c){throw o.onError(c),c}o.onSuccess()}function jie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function hG(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?jie(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):jie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let fG=1;function SAe(r,a,o,c,f){fG+=1;let m={sid:o.sid,command:"convergeAllocateEdge",uid:"666",appId:o.appId,ts:Math.floor(Date.now()/1e3),seq:fG,requestId:fG,version:dd,cname:o.cname},v={service_name:a,json_body:JSON.stringify(m)},w,C,R=r[0];return wh(async()=>{w=Date.now();let x=await Th(R,{data:v,cancelToken:c,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"}});if(C=Date.now()-w,x.code!==0){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming ap error, code"+x.code,{retry:!0,responseTime:C});throw z.error(F.toString()),F}let L=JSON.parse(x.json_body);if(L.code!==200){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming app center error, code: ".concat(L.code,", reason: ").concat(L.reason),{code:L.code,responseTime:C});throw z.error(F.toString()),F}if(!L.servers||L.servers.length===0){let F=new De(ce.UNEXPECTED_RESPONSE,"live streaming app center empty server",{code:L.code,responseTime:C});throw z.error(F.toString()),F}let U=function(F,Z){return{addressList:F.servers.map(W=>"wss://".concat(W.address.replace(/\./g,"-"),".").concat(ve("WORKER_DOMAIN"),":").concat(W.wss,"?serviceName=").concat(encodeURIComponent(Z))),workerToken:F.workerToken,vid:F.vid}}(L,a);return ve("LIVE_STREAMING_ADDRESS")&&(U.addressList=ve("LIVE_STREAMING_ADDRESS")instanceof Array?ve("LIVE_STREAMING_ADDRESS"):[ve("LIVE_STREAMING_ADDRESS")]),hG(hG({},U),{},{responseTime:C})},(x,L)=>($t.apworkerEvent(o.sid,{success:!0,sc:200,serviceName:a,responseDetail:JSON.stringify(x.addressList),firstSuccess:L===0,responseTime:C,serverIp:r[L%r.length]}),!1),(x,L)=>($t.apworkerEvent(o.sid,{success:!1,sc:x.data&&x.data.code||200,serviceName:a,responseTime:C,serverIp:r[L%r.length]}),!!(x.code!==ce.OPERATION_ABORTED&&x.code!==ce.UNEXPECTED_RESPONSE||x.data&&x.data.retry)&&(R=r[(L+1)%r.length],!0)),f)}let pG=1;function Uie(r,a,o,c){let{url:f,areaCode:m}=r,{clientId:v,sid:w}=a,C=Date.now(),R,[x,L]=gG(a,m,[Mr.CHOOSE_SERVER]),U=yr.networkState;return wh(async()=>{U&&yr.networkState===eo.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,vs(c&&c.maxRetryTimeout||kr.maxRetryTimeout)]),U=yr.networkState;let{data:F,headers:Z}=await Th(f,{data:x,cancelToken:o,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);R=Z.http3==="1"?1:-1,$t.reportResourceTiming(f,w),Bie(F,f,a,C,[Mr.CHOOSE_SERVER],R);let W=w3(F,Mr.CHOOSE_SERVER);return mG(W),aG(W,f)},F=>(F&&$t.joinChooseServer(w,{lts:C,succ:!0,csAddr:f,opid:L,serverList:F.gatewayAddrs.map(Z=>Z.address),ec:null,cid:F.cid.toString(),uid:F.uid.toString(),csIp:F.csIp,unilbsServerIds:[Mr.CHOOSE_SERVER].toString(),isHttp3:R}),!1),F=>F.code!==ce.OPERATION_ABORTED&&(F.code===ce.CAN_NOT_GET_GATEWAY_SERVER?F.data.retry:($t.joinChooseServer(w,{lts:C,succ:!1,csAddr:f,serverList:null,opid:L,ec:F.code,csIp:F.data&&F.data.csIp,unilbsServerIds:[Mr.CHOOSE_SERVER].toString(),extend:JSON.stringify({networkState:U}),isHttp3:R}),z.warning("[".concat(v||"sid-".concat(w.slice(0,6)),"] Choose server network error, retry"),F),!0)),c)}function Fie(r,a,o,c){let f,{url:m,areaCode:v,serviceIds:w}=r,C=Date.now(),[R,x]=gG(a,v,w),L;return wh(async()=>{L&&yr.networkState===eo.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,vs(c&&c.maxRetryTimeout||kr.maxRetryTimeout)]),L=yr.networkState;let{data:U,headers:F}=await Th(m,{data:R,cancelToken:o,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);f=F.http3==="1"?1:-1,$t.reportResourceTiming(m,a.sid),Bie(U,m,a,C,w,f);let Z=w3(U,Mr.CHOOSE_SERVER),W=w3(U,a.cloudProxyServer==="proxy5"?Mr.CLOUD_PROXY_5:a.cloudProxyServer==="proxy3"||a.cloudProxyServer==="proxy4"?Mr.CLOUD_PROXY:Mr.CLOUD_PROXY_FALLBACK);return mG(Z),{gatewayInfo:aG(Z,m),proxyInfo:W,url:m}},U=>(U.gatewayInfo&&$t.joinChooseServer(a.sid,{lts:C,succ:!0,csAddr:m,serverList:U.gatewayInfo.gatewayAddrs.map(F=>F.address),ec:null,opid:x,cid:U.gatewayInfo.cid.toString(),uid:U.gatewayInfo.uid.toString(),csIp:U.gatewayInfo.csIp,unilbsServerIds:w.toString(),isHttp3:f}),U.proxyInfo&&$t.joinWebProxyAP(a.sid,{lts:C,sucess:1,apServerAddr:m,turnServerAddrList:U.proxyInfo.addresses.map(F=>F.ip).join(","),errorCode:null,eventType:a.cloudProxyServer,unilbsServerIds:w.toString()}),!1),U=>U.code!==ce.OPERATION_ABORTED&&(U.code===ce.CAN_NOT_GET_GATEWAY_SERVER?U.data.retry:($t.joinWebProxyAP(a.sid,{lts:C,sucess:0,apServerAddr:m,turnServerAddrList:null,errorCode:U.code,eventType:a.cloudProxyServer,unilbsServerIds:w.toString(),extend:JSON.stringify({networkState:L})}),z.warning("[".concat(a.clientId,"] multi unilbs network error, retry"),U),!0)),c)}let Bie=(r,a,o,c,f,m)=>{let{sid:v,clientId:w,cloudProxyServer:C}=o,R=[],x=L=>{L.flag===4096?$t.joinChooseServer(v,{lts:c,succ:!1,csAddr:a,opid:r.opid,serverList:null,ec:L.error.message,csIp:L.error.data&&L.error.data.csIp,unilbsServerIds:f.toString(),isHttp3:m}):L.flag!==1048576&&L.flag!==4194304&&L.flag!==4194310||$t.joinWebProxyAP(v,{lts:c,sucess:0,apServerAddr:a,turnServerAddrList:null,errorCode:L.error.code,eventType:C,unilbsServerIds:f.toString()})};if(r.response_body.forEach(L=>{let U=L.buffer.code;if(L.uri===23&&U===0&&!L.buffer.edges_services)if(L.buffer.flag===4194310)z.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers"),L.buffer.edges_services=[];else{let F={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:r.detail[502]}),flag:L.buffer.flag};R.push(F),x(F)}if(U!==0){let F=KS(U),Z={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,F.desc,{desc:F.desc,retry:F.retry,csIp:r.detail[502]}),flag:L.buffer.flag};L.buffer.flag===4194310?z.warning(Z.error.toString()):R.push(Z),x(Z)}}),R.length)throw z.warning("[".concat(w||"sid-".concat(v.slice(0,6)),"] multi unilbs ").concat(a," failed, ").concat(R.map(L=>"flag: ".concat(L.flag,", message: ").concat(L.error.message,", retry: ").concat(L.error.data.retry)).join(" | "))),new De(ce.CAN_NOT_GET_GATEWAY_SERVER,R.map(L=>"flag: ".concat(L.flag,", message: ").concat(L.error.message)).join(" | "),{retry:!!R.find(L=>L.error.data.retry),csIp:r.detail[502],desc:[...new Set(R.map(L=>{var U;return L==null||(U=L.error)===null||U===void 0||(U=U.data)===null||U===void 0?void 0:U.desc}).filter(L=>!!L))]})},mG=r=>{var a,o,c,f;if(r.addresses&&r.addresses.length===0&&r.code===0)throw new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"void gateway address",{retry:!0,csIp:r.detail&&r.detail[502]});if(ve("AP_AREA")&&((c=r.detail)!==null&&c!==void 0&&c[23]&&typeof((f=r.detail)===null||f===void 0?void 0:f[23])=="string"?Mie(r.detail[23].toLowerCase()):Mie()),(a=r.detail)!==null&&a!==void 0&&a[19]&&typeof((o=r.detail)===null||o===void 0?void 0:o[19])=="string"){let v=r.detail[19],w=v==null?void 0:v.split(";");for(let C=0;C<w.length;C++){var m;let R=ks(m=w[C]).call(m);r.addresses[C]&&w&&(r.addresses[C].fingerprint=R)}}if(ve("GATEWAY_ADDRESS")&&ve("GATEWAY_ADDRESS").length>0){z.debug("assign gateway address to",ve("GATEWAY_ADDRESS"));let v=ve("GATEWAY_ADDRESS").map(w=>{var C,R;let x=(C=(R=r.addresses.find(L=>L.ip===w.ip&&L.port===w.port))===null||R===void 0?void 0:R.fingerprint)!==null&&C!==void 0?C:"";return{ip:w.ip,port:w.port,ticket:r.addresses[0]&&r.addresses[0].ticket,fingerprint:x}});r.addresses=v}},bAe=(r,a)=>{if(r.response_body&&r.response_body.length){let o=r.response_body[0];if(o.buffer.code!==0){let c=KS(o.buffer.code);throw new De(ce.UPDATE_TICKET_FAILED,"[".concat(o.buffer.code,"]: ").concat(c.desc),{retry:c.retry})}return o.buffer.ticket}throw z.debug("update ticket request received ap response without response body:",a),new De(ce.UPDATE_TICKET_FAILED,"cannot find response body from ap response",{retry:!1})},gG=(r,a,o)=>{let c=Math.floor(Math.random()*1e12),f={appid:r.appId,client_ts:Date.now(),opid:c,sid:r.sid,request_bodies:[{uri:22,buffer:{cname:r.cname,detail:hG({6:r.stringUid,11:a,12:ve("USE_NEW_TOKEN")?"1":void 0,22:a},r.apRTM?{26:"RTM2"}:{}),key:r.token,service_ids:o,uid:r.uid||0}}]};f.request_bodies.forEach(v=>{r.multiIP&&r.multiIP.gateway_ip&&(v.buffer.detail[5]=JSON.stringify({vocs_ip:[r.multiIP.uni_lbs_ip],vos_ip:[r.multiIP.gateway_ip]}))});let m=new FormData;return m.append("request",JSON.stringify(f)),[m,c]},CAe=(r,a)=>{let o=Math.floor(Math.random()*1e12),c={appid:r.appId,client_ts:Date.now(),opid:o,sid:r.sid,request_bodies:[{uri:28,buffer:{cname:r.cname,detail:{1:"",6:r.stringUid,12:"1"},token:r.token,service_ids:a,uid:r.uid||0,edges_services:r.apResponse.addresses.map(m=>({ip:m.ip,port:m.port}))}}]},f=new FormData;return f.append("request",JSON.stringify(c)),[f,o]},qS=0;function YS(r){return Ct.all(r.map(a=>a.then(o=>{throw o},o=>o))).then(a=>{throw a},a=>a)}let b3=async r=>{let{fragementLength:a,referenceList:o,asyncMapHandler:c,allFailedhandler:f,promisesCollector:m}=r,v=0,w=a,C,R=0,x=async()=>{let L=(()=>{let U=v*w,F=U+w;return o.slice(U,F).map(c)})();m&&m.push(...L);try{C=await YS(L)}catch(U){if(R+=w,v++,!(R>=o.length))return void await x();f(U)}L.forEach(U=>U.cancel())};return await x(),C},Vie=async r=>{let{referenceList:a,asyncMapHandler:o,closeFn:c}=r,f=a.length,m=0,v=async()=>{let w=o(a.shift());try{return await w}catch(C){if(m++,m>=f||c!=null&&c(C))throw C;return v()}};return v()};async function vG(r,a,o,c){return{gatewayInfo:await async function(f,m,v,w){let C=null,R=[],x=async()=>{let U=ve("WEBCS_DOMAIN").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(W=>({url:f.proxyServer?"https://".concat(f.proxyServer,"/ap/?url=").concat(W+"/api/v2/transpond/webrtc?v=2"):"https://".concat(W,"/api/v2/transpond/webrtc?v=2"),areaCode:S3()})),F=w.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:U.map(W=>W.url)}),Z=await b3({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:U,asyncMapHandler:W=>(z.debug("[".concat(f.clientId,"] Connect to choose_server:"),W.url),Uie(W,f,m,v)),allFailedhandler:W=>{throw w.recordJoinChannelService({endTs:Date.now(),status:"error",errors:W},F),W[0]},promisesCollector:R});return w.recordJoinChannelService({endTs:Date.now(),status:"success"},F),Z},L=async()=>{if(await vs(1e3),C!==null)return C;let U=ve("WEBCS_DOMAIN_BACKUP_LIST").map(W=>({url:f.proxyServer?"https://".concat(f.proxyServer,"/ap/?url=").concat(W+"/api/v2/transpond/webrtc?v=2"):"https://".concat(W,"/api/v2/transpond/webrtc?v=2"),areaCode:S3()})),F=w.recordJoinChannelService({endTs:void 0,startTs:Date.now(),status:"pending",service:"chooseServer",urls:U.map(W=>W.url)}),Z=await b3({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:U,asyncMapHandler:W=>(z.debug("[".concat(f.clientId,"] Connect to backup choose_server:"),W.url),Uie(W,f,m,v)),allFailedhandler:W=>{throw w.recordJoinChannelService({endTs:Date.now(),status:"error",errors:W},F),W[0]},promisesCollector:R});return w.recordJoinChannelService({endTs:Date.now(),status:"success"},F),Z};try{return C=await YS([x(),L()]),R.length&&R.forEach(U=>U.cancel&&typeof U.cancel=="function"&&U.cancel()),C}catch(U){throw U[0]}}(r,a,o,c)}}async function zie(r,a,o,c,f){let m=r.cloudProxyServer;if(m==="disabled"){if(r.useLocalAccessPoint)return await vG(r,a,o,f);if(ve("JOIN_WITH_FALLBACK_MEDIA_PROXY")){let{gatewayInfo:U,proxyInfo:F}=await Wie(r,a,o,f);if(r.turnServer&&r.turnServer.mode!=="auto")return{gatewayInfo:U};let Z=F.map(W=>({turnServerURL:W.address,tcpport:W.tcpport||Ks.tcpport,udpport:W.udpport||Ks.udpport,username:W.username||Ks.username,password:W.password||Ks.password,forceturn:!1,security:!0}));if(f.useP2P){var v;let W=(v=r.uid)!==null&&v!==void 0?v:U.uid,K="glb:".concat(W.toString()),oe=await BH(K),ue=F.map(xe=>({turnServerURL:xe.address,tcpport:xe.tcpport||Ks.tcpport,udpport:xe.udpport||Ks.udpport,username:K,password:oe,forceturn:!1,security:!0}));Z.push(...ue)}return r.turnServer={mode:"manual",servers:Z},{gatewayInfo:U}}return await vG(r,a,o,f)}let{proxyInfo:w,gatewayInfo:C}=await Wie(r,a,o,f),R={gatewayInfo:C},x=w.map(U=>({turnServerURL:U.address,tcpport:m==="proxy3"?void 0:U.tcpport?U.tcpport:Ks.tcpport,udpport:m==="proxy4"?void 0:U.udpport?U.udpport:Ks.udpport,username:U.username||Ks.username,password:U.password||Ks.password,forceturn:m!=="proxy4",security:m==="proxy5"}));if(f.useP2P){var L;let U=(L=r.uid)!==null&&L!==void 0?L:C.uid,F="glb:".concat(U.toString()),Z=await BH(F),W=w.map(K=>({turnServerURL:K.address,tcpport:m==="proxy3"?void 0:K.tcpport||Ks.tcpport,udpport:m==="proxy4"?void 0:K.udpport||Ks.udpport,username:F,password:Z,forceturn:m!=="proxy4",security:m==="proxy5"}));x.push(...W)}return r.turnServer={mode:"manual",servers:x},z.debug("[".concat(r.clientId,"] set proxy server: ").concat(r.proxyServer,", mode: ").concat(m)),R}async function Hie(r,a,o,c,f){let m=ve("ACCOUNT_REGISTER").slice(0,ve("AJAX_REQUEST_CONCURRENT")),v=[];v=a.proxyServer?m.map(C=>"https://".concat(a.proxyServer,"/ap/?url=").concat(C+"/api/v1")):m.map(C=>"https://".concat(C,"/api/v1"));let w=f==null?void 0:f.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"stringUID",urls:v});try{let C=await async function(R,x,L,U,F){let Z=Date.now(),W={sid:L.sid,opid:10,appid:L.appId,string_uid:x},K=R[0],oe=await wh(()=>Th(K+"".concat(K.indexOf("?")===-1?"?":"&","action=stringuid"),{data:W,cancelToken:U,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}}),(ue,xe)=>{if(ue.code===0){if(ue.uid<=0||ue.uid>=Math.pow(2,32))throw z.error("Invalid Uint Uid ".concat(x," => ").concat(ue.uid),ue),$t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:ce.INVALID_UINT_UID_FROM_STRING_UID,extend:W}),new De(ce.INVALID_UINT_UID_FROM_STRING_UID);return $t.reqUserAccount(W.sid,{lts:Z,success:!0,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:null,extend:W}),!1}let Oe=KS(ue.code);return Oe.retry&&(K=R[(xe+1)%R.length]),$t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:ue.uid,errorCode:Oe.desc,extend:W}),Oe.retry},(ue,xe)=>ue.code!==ce.OPERATION_ABORTED&&($t.reqUserAccount(W.sid,{lts:Z,success:!1,serverAddr:K,stringUid:W.string_uid,uid:null,errorCode:ue.code,extend:W}),K=R[(xe+1)%R.length],!0),F);if(oe.code!==0){let ue=KS(oe.code);throw new De(ce.UNEXPECTED_RESPONSE,ue.desc)}return oe}(v,r,a,o,c);return f==null||f.recordJoinChannelService({status:"success",endTs:Date.now()},w),C.uid}catch(C){throw f==null||f.recordJoinChannelService({status:"error",endTs:Date.now(),errors:[C]},w),C}}async function TAe(r,a,o){let c=ve("ACCOUNT_REGISTER"),f=[];f=a.proxyServer?c.map(m=>"https://".concat(a.proxyServer,"/ap/?url=").concat(m+"/api/v1")):c.map(m=>"https://".concat(m,"/api/v1"));try{return await Vie({referenceList:f,asyncMapHandler:m=>async function(v,w,C,R){let x=Date.now(),L={sid:C.sid,opid:10,appid:C.appId,string_uid:w};try{let U=await Th(v+"".concat(v.indexOf("?")===-1?"?":"&","action=stringuid"),{data:L,cancelToken:R,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":72}});if(U.code!==0){let F=KS(U.code);throw new De(ce.UNEXPECTED_RESPONSE,"preload sua error:".concat(F.desc),F)}if(U.uid<=0||U.uid>=Math.pow(2,32))throw new De(ce.INVALID_UINT_UID_FROM_STRING_UID);return{requestTime:x,url:v,req:L,uid:U.uid,elapse:Date.now()-x}}catch(U){throw U}}(m,r,a,o),closeFn:m=>m.code===ce.OPERATION_ABORTED||m.code===ce.UNEXPECTED_RESPONSE&&!m.data.retry})}catch(m){throw m}}async function RAe(r,a,o){let c=ve("CDS_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(C=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(C+"/api/v1"):"https://".concat(C,"/api/v1?action=config")),f=c.map(C=>function(R,x,L,U){let F=ni(),Z={flag:64,cipher_method:0,features:{device:F.name,system:F.os,system_general:navigator.userAgent,vendor:x.appId,version:dd,cname:x.cname,sid:x.sid,session_id:x.sid,detail:"",proxyServer:x.proxyServer}};return wh(()=>Th(R,{data:Z,timeout:1e3,cancelToken:L,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":54}}),void 0,W=>W.code!==ce.OPERATION_ABORTED,U)}(C,r,a,o)),m=null,v=null,w={};try{m=await YS(f)}catch(C){if(C.code===ce.OPERATION_ABORTED)throw C;v=C}if(f.forEach(C=>C.cancel()),$t.reportApiInvoke(r.sid,{name:$r.REQUEST_CONFIG_DISTRIBUTE,options:{error:v,res:m}}).onSuccess(),m&&m.test_tags)try{w=function(C){if(!C.test_tags)return{};let R=C.test_tags,x=Object.keys(R),L={};return x.forEach(U=>{var F;let Z=ks(F=U.slice(4)).call(F),W=JSON.parse(R[U])[1];L[Z]=W}),L}(m)}catch{}return w}async function Gie(r,a){let o=ve("WEBCS_DOMAIN").concat(ve("WEBCS_DOMAIN_BACKUP_LIST")).map(c=>({url:"https://".concat(c,"/api/v2/transpond/webrtc?v=2"),areaCode:S3(),serviceIds:[Mr.CHOOSE_SERVER,Mr.CLOUD_PROXY_FALLBACK]}));try{return await Vie({referenceList:o,asyncMapHandler:c=>async function(f,m,v){let w,{url:C,areaCode:R,serviceIds:x}=f,L=Date.now(),[U,F]=gG(m,R,x),Z=yr.networkState;try{Z&&yr.networkState===eo.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,vs(kr.maxRetryTimeout)]),Z=yr.networkState;let{data:W,headers:K}=await Th(C,{data:U,cancelToken:v,headers:{"Content-Type":"multipart/form-data;"}},!0,!0);w=K.http3==="1"?1:-1,(xe=>{let Oe=[];if(xe.response_body.forEach(ke=>{let He=ke.buffer.code;if(ke.uri===23&&He===0&&!ke.buffer.edges_services)if(ke.buffer.flag===4194310)ke.buffer.edges_services=[];else{let lt={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,"no edge services in ap response",{retry:!0,csIp:xe.detail[502]}),flag:ke.buffer.flag};Oe.push(lt)}if(He!==0){let lt=KS(He),ut={error:new De(ce.CAN_NOT_GET_GATEWAY_SERVER,lt.desc,{desc:lt.desc,retry:lt.retry,csIp:xe.detail[502]}),flag:ke.buffer.flag};ke.buffer.flag===4194310?z.warning(ut.error.toString()):Oe.push(ut)}}),Oe.length)throw new De(ce.CAN_NOT_GET_GATEWAY_SERVER,Oe.map(ke=>"flag: ".concat(ke.flag,", message: ").concat(ke.error.message)).join(" | "),{retry:!!Oe.find(ke=>ke.error.data.retry),csIp:xe.detail[502],desc:[...new Set(Oe.map(ke=>{var He;return ke==null||(He=ke.error)===null||He===void 0||(He=He.data)===null||He===void 0?void 0:He.desc}).filter(ke=>!!ke))]})})(W);let oe=w3(W,Mr.CHOOSE_SERVER),ue=w3(W,Mr.CLOUD_PROXY_FALLBACK);return mG(oe),{gatewayInfo:aG(oe,C),proxyInfo:ue,opid:F,requestTime:L,url:C,isHttp3:w,elapse:Date.now()-L}}catch(W){throw W}}(c,r,a),closeFn:c=>c.code===ce.OPERATION_ABORTED||c.code===ce.CAN_NOT_GET_GATEWAY_SERVER&&!c.data.retry})}catch(c){throw c}}async function Wie(r,a,o,c){let f=ve("PROXY_SERVER_TYPE3"),m=(F,Z,W)=>{let K=W||f;return Array.isArray(K)&&(K=Z%2==0?f[1]:f[0]),"https://".concat(K,"/ap/?url=").concat(F)},v=null,w=[],C=async()=>{let F=ve("WEBCS_DOMAIN").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map((K,oe)=>{let ue;return ue=r.cloudProxyServer==="disabled"&&r.proxyServer?m("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe,r.proxyServer):r.cloudProxyServer==="disabled"||r.cloudProxyServer==="fallback"?"https://".concat(K,"/api/v2/transpond/webrtc?v=2"):m("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe),{url:ue,areaCode:S3(),serviceIds:[Mr.CHOOSE_SERVER,r.cloudProxyServer==="proxy5"?Mr.CLOUD_PROXY_5:r.cloudProxyServer==="proxy3"||r.cloudProxyServer==="proxy4"?Mr.CLOUD_PROXY:Mr.CLOUD_PROXY_FALLBACK]}}),Z=c.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:F.map(K=>K.url)}),W=await b3({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:F,asyncMapHandler:K=>(z.debug("[".concat(r.clientId,"] Connect to choose_server:"),K.url),Fie(K,r,a,o)),allFailedhandler:K=>{throw c.recordJoinChannelService({endTs:Date.now(),status:"error",errors:K},Z),K[0]},promisesCollector:w});return c.recordJoinChannelService({endTs:Date.now(),status:"success"},Z),W},R=async()=>{if(await vs(1e3),v!==null)return v;let F=ve("WEBCS_DOMAIN_BACKUP_LIST").map((K,oe)=>{let ue;return ue=r.cloudProxyServer==="disabled"&&r.proxyServer?m("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe,r.proxyServer):r.cloudProxyServer==="disabled"||r.cloudProxyServer==="fallback"?"https://".concat(K,"/api/v2/transpond/webrtc?v=2"):m("".concat(K,"/api/v2/transpond/webrtc?v=2"),oe),{url:ue,areaCode:S3(),serviceIds:[Mr.CHOOSE_SERVER,r.cloudProxyServer==="proxy5"?Mr.CLOUD_PROXY_5:r.cloudProxyServer==="proxy3"||r.cloudProxyServer==="proxy4"?Mr.CLOUD_PROXY:Mr.CLOUD_PROXY_FALLBACK]}}),Z=c.recordJoinChannelService({startTs:Date.now(),status:"pending",service:"chooseServer",urls:F.map(K=>K.url)}),W=await b3({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:F,asyncMapHandler:K=>(z.debug("[".concat(r.clientId,"] Connect to backup choose_server:"),K.url),Fie(K,r,a,o)),allFailedhandler:K=>{throw c.recordJoinChannelService({endTs:Date.now(),status:"error",errors:K},Z),K[0]},promisesCollector:w});return c.recordJoinChannelService({endTs:Date.now(),status:"success"},Z),W},x,L,U;try{({gatewayInfo:x,proxyInfo:L,url:U}=await YS([C(),R()]))}catch(F){throw F[0]}if(w.length&&w.forEach(F=>F.cancel&&typeof F.cancel=="function"&&F.cancel()),!x||!L)throw new De(ce.UNEXPECTED_ERROR,"missing gateway or proxy response").print();if(r.apUrl=U,r.cloudProxyServer!=="disabled"&&Array.isArray(f)&&U){let F=/^https?:\/\/(.+?)(\/.*)?$/.exec(U)[1];Tt(f).call(f,F)&&(r.proxyServer=F,z.setProxyServer(F),$t.setProxyServer(F))}return v={gatewayInfo:x,proxyInfo:await Nie(L,x.uid)},v}async function $ie(r,a,o,c){let f=ve("UAP_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(m=>a.proxyServer?"https://".concat(a.proxyServer,"/ap/?url=").concat(m+"/api/v1?action=uap"):"https://".concat(m,"/api/v1?action=uap"));return await SAe(f,r,a,o,c)}async function xAe(r,a,o){let c=ve("UAP_AP").slice(0,ve("AJAX_REQUEST_CONCURRENT")).map(m=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(m+"/api/v1?action=uap"):"https://".concat(m,"/api/v1?action=uap")),f=c.map(m=>function(v,w,C,R){let x={command:"convergeAllocateEdge",sid:w.sid,appId:w.appId,token:w.token,ts:Date.now(),version:dd,cname:w.cname,uid:w.uid.toString(),requestId:pG,seq:pG};pG+=1;let L={service_name:"tele_channel",json_body:JSON.stringify(x)};return wh(async()=>{let U=await Th(v,{data:L,cancelToken:C,headers:{"X-Packet-Service-Type":0,"X-Packet-URI":61}});if(U.code!==0){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel ap error, code"+U.code,{retry:!0});throw z.error(Z.toString()),Z}let F=JSON.parse(U.json_body);if(F.code!==200){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel app center error, code: ".concat(F.code,", reason: ").concat(F.reason));throw z.error(Z.toString()),Z}if(!F.servers||F.servers.length===0){let Z=new De(ce.UNEXPECTED_RESPONSE,"cross channel app center empty server");throw z.error(Z.toString()),Z}return{vid:F.vid,workerToken:F.workerToken,addressList:(ve("CHANNEL_MEDIA_RELAY_SERVERS")||F.servers).map(Z=>"wss://".concat(Z.address.replace(/\./g,"-"),".").concat(ve("WORKER_DOMAIN"),":").concat(Z.wss))}},void 0,U=>!!(U.code!==ce.OPERATION_ABORTED&&U.code!==ce.UNEXPECTED_RESPONSE||U.data&&U.data.retry),R)}(m,r,a,o));try{let m=await YS(f);return f.forEach(v=>v.cancel()),m}catch(m){throw m[0]}}async function AAe(r,a,o){let c=null,f=[],m=async v=>{let w=ve(v?"WEBCS_DOMAIN_BACKUP_LIST":"WEBCS_DOMAIN").map(C=>r.proxyServer?"https://".concat(r.proxyServer,"/ap/?url=").concat(C+"/api/v2/transpond/webrtc?v=2"):"https://".concat(C,"/api/v2/transpond/webrtc?v=2"));return v&&(await vs(1e3),c!==null)?c:await b3({fragementLength:ve("FRAGEMENT_LENGTH"),referenceList:w,asyncMapHandler:C=>(z.debug("[".concat(r.clientId,"] update ticket, Connect to ").concat(v?"backup":""," choose_server:"),C),function(R,x,L,U){let[F]=CAe(x,[Mr.CHOOSE_SERVER]),Z=yr.networkState;return wh(async()=>{Z&&yr.networkState===eo.OFFLINE&&yr.onlineWaiter&&await Ct.race([yr.onlineWaiter,vs(U&&U.maxRetryTimeout||kr.maxRetryTimeout)]),Z=yr.networkState;let W=await Th(R,{data:F,cancelToken:L,headers:{"Content-Type":"multipart/form-data;"}},!0);return bAe(W,R)},()=>!1,W=>W.code!==ce.OPERATION_ABORTED&&(W.code===ce.UPDATE_TICKET_FAILED?W.data.retry:(z.warning("[".concat(x.clientId,"] update ticket network error, retry"),W),!0)),U)}(C,r,a,o)),allFailedhandler:C=>{throw C[0]},promisesCollector:f})};try{return c=await YS([m(!1),m(!0)]),f.length&&f.forEach(v=>v.cancel&&typeof v.cancel=="function"&&v.cancel()),c}catch(v){throw v[0]}}function Kie(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function qie(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Kie(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Kie(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class IAe extends nr{get isSuccess(){return!!this.configs}constructor(){super(),X(this,"configs",void 0),X(this,"joinInfo",void 0),X(this,"cancelToken",void 0),X(this,"retryConfig",{timeout:3e3,timeoutFactor:1.5,maxRetryCount:1,maxRetryTimeout:1e4}),X(this,"interval",void 0),X(this,"mutex",new Ts("config-distribute")),X(this,"mutableParamsRead",!1)}startGetConfigDistribute(a,o){this.joinInfo=a,this.cancelToken=o,this.interval&&this.stopGetConfigDistribute(),ve("ENABLE_CONFIG_DISTRIBUTE")&&(this.updateConfigDistribute(),this.interval=window.setInterval(()=>{this.updateConfigDistribute()},ve("CONFIG_DISTRIBUTE_INTERVAL")))}stopGetConfigDistribute(){this.interval&&clearInterval(this.interval),this.interval=void 0,this.joinInfo=void 0,this.cancelToken=void 0}async awaitConfigDistributeComplete(){this.mutex.isLocked&&(await this.mutex.lock())()}async updateConfigDistribute(){if(this.mutableParamsRead||(this.mutableParamsRead=!0,$t.reportApiInvoke(null,{options:void 0,name:$r.LOAD_CONFIG_FROM_LOCALSTORAGE,tag:vr.TRACER}).onSuccess(JSON.stringify(x0))),!this.joinInfo||!this.cancelToken||!this.retryConfig)return void z.debug("[config-distribute] get config distribute interrupted have no joininfo");let a,o=await this.mutex.lock();try{a=await RAe(this.joinInfo,this.cancelToken,this.retryConfig),z.debug("[config-distribute] get config distribute",JSON.stringify(a)),a.limit_bitrate&&this.handleBitrateLimit(a.limit_bitrate),this.cacheGlobalParameterConfig(a),this.configs=a}catch(c){let f=new De(ce.NETWORK_RESPONSE_ERROR,c);z.warning("[config-distribute] ".concat(f.toString()))}finally{o()}}getBitrateLimit(){return this.configs?this.configs.limit_bitrate:void 0}handleBitrateLimit(a){var o;(o=a)&&o.uplink&&o.id&&o.uplink.max_bitrate!==void 0&&o.uplink.min_bitrate!==void 0&&(this.configs&&this.configs.limit_bitrate?this.configs&&this.configs.limit_bitrate&&this.configs.limit_bitrate.id!==a.id&&this.emit(rG.UPDATE_BITRATE_LIMIT,a):this.emit(rG.UPDATE_BITRATE_LIMIT,a))}getLowStreamConfigDistribute(){return this.configs&&this.configs.limit_bitrate&&qie({},this.configs.limit_bitrate.low_stream_uplink)}cacheGlobalParameterConfig(a){var o;let c=JA(o=Object.keys(a).filter(m=>/^webrtc_ng_global_parameter/.test(m))).call(o);for(let m=0;m<c.length;m++)for(let v=c.length-1;v>m;v--){let w=c[v];if(typeof a[w].__priority=="number"){let C=a[w].__priority,R=c[v-1];if(typeof a[R].__priority=="number"){if(!(C>a[R].__priority))continue;{let x=w;c[v]=c[v-1],c[v-1]=x}}else{let x=w;c[v]=c[v-1],c[v-1]=x}}}let f={};c.forEach(m=>{let v=a[m],w=v.__expires;Object.keys(v).forEach(C=>{C==="__priority"||C==="__expires"||Object.prototype.hasOwnProperty.call(f,C)||(f[C]=qie({value:v[C]},w&&{expires:w}))})});try{(function(w){try{let C=Date.now();Object.keys(w).forEach(R=>{switch(R){case"ENABLE_EVENT_REPORT":case"UPLOAD_LOG":case"ENABLE_AG_ADAPTATION":case"FORCE_AG_HIGH_FRAMERATE":case"FORCE_SUPPORT_AG_ADAPTATION":case"ENCODER_CONFIG_LIMIT":case"CAMERA_CAPTURE_CONFIG":case"ENABLE_PRELOAD":if(Object.prototype.hasOwnProperty.call(es,R)){let{value:x,expires:L}=w[R];if(L&&L<=C)return;x0[R]=x,es[R]=x,z.debug("Update global parameters from config distribute",R,x)}}})}catch(C){z.error("Error update config immediately: ".concat(w),C.message)}})(f);let m=JSON.stringify(f),v=window.btoa(m);window.localStorage.setItem("websdk_ng_global_parameter",v),z.debug("Caching global parameters ".concat(m))}catch(m){z.error("Error caching global parameters:",m.message)}}}var yu,NAe=l(pie),Yie=he,OAe=E,PAe=me,LAe=d,yG=Ow,DAe=dy,kAe=Ne,MAe=Ro,jAe=Ze,XS=Object.assign,Xie=Object.defineProperty,UAe=OAe([].concat),FAe=!XS||LAe(function(){if(Yie&&XS({b:1},XS(Xie({},"a",{enumerable:!0,get:function(){Xie(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},a={},o=Symbol(),c="abcdefghijklmnopqrst";return r[o]=7,c.split("").forEach(function(f){a[f]=f}),XS({},r)[o]!=7||yG(XS({},a)).join("")!=c})?function(r,a){for(var o=MAe(r),c=arguments.length,f=1,m=DAe.f,v=kAe.f;c>f;)for(var w,C=jAe(arguments[f++]),R=m?UAe(yG(C),m(C)):yG(C),x=R.length,L=0;x>L;)w=R[L++],Yie&&!PAe(v,C,w)||(o[w]=C[w]);return o}:XS,BAe=dr,VAe=a0,zAe=_f,HAe=me,GAe=Ro,WAe=function(r,a,o,c){try{return c?a(BAe(o)[0],o[1]):a(o)}catch(f){VAe(r,"throw",f)}},$Ae=Ix,KAe=Pl,qAe=lh,Jie=RS,YAe=em,XAe=_a,Qie=Array,Yy=E,_G=2147483647,JAe=/[^\0-\u007E]/,Zie=/[.\u3002\uFF0E\uFF61]/g,ere="Overflow: input needs wider integers to process",tre=RangeError,QAe=Yy(Zie.exec),JS=Math.floor,EG=String.fromCharCode,nre=Yy("".charCodeAt),ire=Yy([].join),L0=Yy([].push),ZAe=Yy("".replace),e3e=Yy("".split),t3e=Yy("".toLowerCase),rre=function(r){return r+22+75*(r<26)},n3e=function(r,a,o){var c=0;for(r=o?JS(r/700):r>>1,r+=JS(r/a);r>455;)r=JS(r/35),c+=36;return JS(c+36*r/(r+38))},i3e=function(r){var a=[];r=function(oe){for(var ue=[],xe=0,Oe=oe.length;xe<Oe;){var ke=nre(oe,xe++);if(ke>=55296&&ke<=56319&&xe<Oe){var He=nre(oe,xe++);(64512&He)==56320?L0(ue,((1023&ke)<<10)+(1023&He)+65536):(L0(ue,ke),xe--)}else L0(ue,ke)}return ue}(r);var o,c,f=r.length,m=128,v=0,w=72;for(o=0;o<r.length;o++)(c=r[o])<128&&L0(a,EG(c));var C=a.length,R=C;for(C&&L0(a,"-");R<f;){var x=_G;for(o=0;o<r.length;o++)(c=r[o])>=m&&c<x&&(x=c);var L=R+1;if(x-m>JS((_G-v)/L))throw tre(ere);for(v+=(x-m)*L,m=x,o=0;o<r.length;o++){if((c=r[o])<m&&++v>_G)throw tre(ere);if(c==m){for(var U=v,F=36;;){var Z=F<=w?1:F>=w+26?26:F-w;if(U<Z)break;var W=U-Z,K=36-Z;L0(a,EG(rre(Z+W%K))),U=JS(W/K),F+=36}L0(a,EG(rre(U))),w=n3e(v,L,R==C),v=0,R++}}v++,m++}return ire(a,"")},r3e=Ni,wG=he,s3e=dH,SG=N,sre=_f,_u=E,J8=hh,Eu=Ty,a3e=qx,bG=fs,CG=FAe,QS=function(r){var a=GAe(r),o=KAe(this),c=arguments.length,f=c>1?arguments[1]:void 0,m=f!==void 0;m&&(f=zAe(f,c>2?arguments[2]:void 0));var v,w,C,R,x,L,U=XAe(a),F=0;if(!U||this===Qie&&$Ae(U))for(v=qAe(a),w=o?new this(v):Qie(v);v>F;F++)L=m?f(a[F],F):a[F],Jie(w,F,L);else for(x=(R=YAe(a,U)).next,w=o?new this:[];!(C=HAe(x,R)).done;F++)L=m?WAe(R,f,[C.value,F],!0):C.value,Jie(w,F,L);return w.length=F,w},Rh=YA,o3e=NA.codeAt,l3e=function(r){var a,o,c=[],f=e3e(ZAe(t3e(r),Zie,"."),".");for(a=0;a<f.length;a++)o=f[a],L0(c,QAe(JAe,o)?"xn--"+i3e(o):o);return ire(c,".")},ym=xl,c3e=od,d3e=sS,are=mRe,ore=Tf,u3e=ore.set,Q8=ore.getterFor("URL"),h3e=are.URLSearchParams,f3e=are.getState,C3=SG.URL,TG=SG.TypeError,Z8=SG.parseInt,p3e=Math.floor,lre=Math.pow,wu=_u("".charAt),xh=_u(/./.exec),T3=_u([].join),m3e=_u(1 .toString),g3e=_u([].pop),ZS=_u([].push),RG=_u("".replace),v3e=_u([].shift),y3e=_u("".split),R3=_u("".slice),eD=_u("".toLowerCase),_3e=_u([].unshift),xG="Invalid scheme",x3="Invalid host",cre="Invalid port",dre=/[a-z]/i,E3e=/[\d+-.a-z]/i,AG=/\d/,w3e=/^0x/i,S3e=/^[0-7]+$/,b3e=/^\d+$/,ure=/^[\da-f]+$/i,C3e=/[\0\t\n\r #%/:<>?@[\\\]^|]/,T3e=/[\0\t\n\r #/:<>?@[\\\]^|]/,R3e=/^[\u0000-\u0020]+/,x3e=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,A3e=/[\t\n\r]/g,A3=function(r){var a,o,c,f;if(typeof r=="number"){for(a=[],o=0;o<4;o++)_3e(a,r%256),r=p3e(r/256);return T3(a,".")}if(typeof r=="object"){for(a="",c=function(m){for(var v=null,w=1,C=null,R=0,x=0;x<8;x++)m[x]!==0?(R>w&&(v=C,w=R),C=null,R=0):(C===null&&(C=x),++R);return R>w&&(v=C,w=R),v}(r),o=0;o<8;o++)f&&r[o]===0||(f&&(f=!1),c===o?(a+=o?":":"::",f=!0):(a+=m3e(r[o],16),o<7&&(a+=":")));return"["+a+"]"}return r},tD={},hre=CG({},tD,{" ":1,'"':1,"<":1,">":1,"`":1}),fre=CG({},hre,{"#":1,"?":1,"{":1,"}":1}),IG=CG({},fre,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),D0=function(r,a){var o=o3e(r,0);return o>32&&o<127&&!bG(a,r)?r:encodeURIComponent(r)},nD={ftp:21,file:null,http:80,https:443,ws:80,wss:443},I3=function(r,a){var o;return r.length==2&&xh(dre,wu(r,0))&&((o=wu(r,1))==":"||!a&&o=="|")},pre=function(r){var a;return r.length>1&&I3(R3(r,0,2))&&(r.length==2||(a=wu(r,2))==="/"||a==="\\"||a==="?"||a==="#")},I3e=function(r){return r==="."||eD(r)==="%2e"},NG={},mre={},OG={},gre={},vre={},PG={},yre={},_re={},iD={},rD={},LG={},DG={},kG={},MG={},Ere={},jG={},eb={},jf={},wre={},Xy={},_m={},UG=function(r,a,o){var c,f,m,v=ym(r);if(a){if(f=this.parse(v))throw TG(f);this.searchParams=null}else{if(o!==void 0&&(c=new UG(o,!0)),f=this.parse(v,null,c))throw TG(f);(m=f3e(new h3e)).bindURL(this),this.searchParams=m}};UG.prototype={type:"URL",parse:function(r,a,o){var c,f,m,v,w,C=this,R=a||NG,x=0,L="",U=!1,F=!1,Z=!1;for(r=ym(r),a||(C.scheme="",C.username="",C.password="",C.host=null,C.port=null,C.path=[],C.query=null,C.fragment=null,C.cannotBeABaseURL=!1,r=RG(r,R3e,""),r=RG(r,x3e,"$1")),r=RG(r,A3e,""),c=QS(r);x<=c.length;){switch(f=c[x],R){case NG:if(!f||!xh(dre,f)){if(a)return xG;R=OG;continue}L+=eD(f),R=mre;break;case mre:if(f&&(xh(E3e,f)||f=="+"||f=="-"||f=="."))L+=eD(f);else{if(f!=":"){if(a)return xG;L="",R=OG,x=0;continue}if(a&&(C.isSpecial()!=bG(nD,L)||L=="file"&&(C.includesCredentials()||C.port!==null)||C.scheme=="file"&&!C.host))return;if(C.scheme=L,a)return void(C.isSpecial()&&nD[C.scheme]==C.port&&(C.port=null));L="",C.scheme=="file"?R=MG:C.isSpecial()&&o&&o.scheme==C.scheme?R=gre:C.isSpecial()?R=_re:c[x+1]=="/"?(R=vre,x++):(C.cannotBeABaseURL=!0,ZS(C.path,""),R=wre)}break;case OG:if(!o||o.cannotBeABaseURL&&f!="#")return xG;if(o.cannotBeABaseURL&&f=="#"){C.scheme=o.scheme,C.path=Rh(o.path),C.query=o.query,C.fragment="",C.cannotBeABaseURL=!0,R=_m;break}R=o.scheme=="file"?MG:PG;continue;case gre:if(f!="/"||c[x+1]!="/"){R=PG;continue}R=iD,x++;break;case vre:if(f=="/"){R=rD;break}R=jf;continue;case PG:if(C.scheme=o.scheme,f==yu)C.username=o.username,C.password=o.password,C.host=o.host,C.port=o.port,C.path=Rh(o.path),C.query=o.query;else if(f=="/"||f=="\\"&&C.isSpecial())R=yre;else if(f=="?")C.username=o.username,C.password=o.password,C.host=o.host,C.port=o.port,C.path=Rh(o.path),C.query="",R=Xy;else{if(f!="#"){C.username=o.username,C.password=o.password,C.host=o.host,C.port=o.port,C.path=Rh(o.path),C.path.length--,R=jf;continue}C.username=o.username,C.password=o.password,C.host=o.host,C.port=o.port,C.path=Rh(o.path),C.query=o.query,C.fragment="",R=_m}break;case yre:if(!C.isSpecial()||f!="/"&&f!="\\"){if(f!="/"){C.username=o.username,C.password=o.password,C.host=o.host,C.port=o.port,R=jf;continue}R=rD}else R=iD;break;case _re:if(R=iD,f!="/"||wu(L,x+1)!="/")continue;x++;break;case iD:if(f!="/"&&f!="\\"){R=rD;continue}break;case rD:if(f=="@"){U&&(L="%40"+L),U=!0,m=QS(L);for(var W=0;W<m.length;W++){var K=m[W];if(K!=":"||Z){var oe=D0(K,IG);Z?C.password+=oe:C.username+=oe}else Z=!0}L=""}else if(f==yu||f=="/"||f=="?"||f=="#"||f=="\\"&&C.isSpecial()){if(U&&L=="")return"Invalid authority";x-=QS(L).length+1,L="",R=LG}else L+=f;break;case LG:case DG:if(a&&C.scheme=="file"){R=jG;continue}if(f!=":"||F){if(f==yu||f=="/"||f=="?"||f=="#"||f=="\\"&&C.isSpecial()){if(C.isSpecial()&&L=="")return x3;if(a&&L==""&&(C.includesCredentials()||C.port!==null))return;if(v=C.parseHost(L))return v;if(L="",R=eb,a)return;continue}f=="["?F=!0:f=="]"&&(F=!1),L+=f}else{if(L=="")return x3;if(v=C.parseHost(L))return v;if(L="",R=kG,a==DG)return}break;case kG:if(!xh(AG,f)){if(f==yu||f=="/"||f=="?"||f=="#"||f=="\\"&&C.isSpecial()||a){if(L!=""){var ue=Z8(L,10);if(ue>65535)return cre;C.port=C.isSpecial()&&ue===nD[C.scheme]?null:ue,L=""}if(a)return;R=eb;continue}return cre}L+=f;break;case MG:if(C.scheme="file",f=="/"||f=="\\")R=Ere;else{if(!o||o.scheme!="file"){R=jf;continue}if(f==yu)C.host=o.host,C.path=Rh(o.path),C.query=o.query;else if(f=="?")C.host=o.host,C.path=Rh(o.path),C.query="",R=Xy;else{if(f!="#"){pre(T3(Rh(c,x),""))||(C.host=o.host,C.path=Rh(o.path),C.shortenPath()),R=jf;continue}C.host=o.host,C.path=Rh(o.path),C.query=o.query,C.fragment="",R=_m}}break;case Ere:if(f=="/"||f=="\\"){R=jG;break}o&&o.scheme=="file"&&!pre(T3(Rh(c,x),""))&&(I3(o.path[0],!0)?ZS(C.path,o.path[0]):C.host=o.host),R=jf;continue;case jG:if(f==yu||f=="/"||f=="\\"||f=="?"||f=="#"){if(!a&&I3(L))R=jf;else if(L==""){if(C.host="",a)return;R=eb}else{if(v=C.parseHost(L))return v;if(C.host=="localhost"&&(C.host=""),a)return;L="",R=eb}continue}L+=f;break;case eb:if(C.isSpecial()){if(R=jf,f!="/"&&f!="\\")continue}else if(a||f!="?")if(a||f!="#"){if(f!=yu&&(R=jf,f!="/"))continue}else C.fragment="",R=_m;else C.query="",R=Xy;break;case jf:if(f==yu||f=="/"||f=="\\"&&C.isSpecial()||!a&&(f=="?"||f=="#")){if((w=eD(w=L))===".."||w==="%2e."||w===".%2e"||w==="%2e%2e"?(C.shortenPath(),f=="/"||f=="\\"&&C.isSpecial()||ZS(C.path,"")):I3e(L)?f=="/"||f=="\\"&&C.isSpecial()||ZS(C.path,""):(C.scheme=="file"&&!C.path.length&&I3(L)&&(C.host&&(C.host=""),L=wu(L,0)+":"),ZS(C.path,L)),L="",C.scheme=="file"&&(f==yu||f=="?"||f=="#"))for(;C.path.length>1&&C.path[0]==="";)v3e(C.path);f=="?"?(C.query="",R=Xy):f=="#"&&(C.fragment="",R=_m)}else L+=D0(f,fre);break;case wre:f=="?"?(C.query="",R=Xy):f=="#"?(C.fragment="",R=_m):f!=yu&&(C.path[0]+=D0(f,tD));break;case Xy:a||f!="#"?f!=yu&&(f=="'"&&C.isSpecial()?C.query+="%27":C.query+=f=="#"?"%23":D0(f,tD)):(C.fragment="",R=_m);break;case _m:f!=yu&&(C.fragment+=D0(f,hre))}x++}},parseHost:function(r){var a,o,c;if(wu(r,0)=="["){if(wu(r,r.length-1)!="]"||(a=function(f){var m,v,w,C,R,x,L,U=[0,0,0,0,0,0,0,0],F=0,Z=null,W=0,K=function(){return wu(f,W)};if(K()==":"){if(wu(f,1)!=":")return;W+=2,Z=++F}for(;K();){if(F==8)return;if(K()!=":"){for(m=v=0;v<4&&xh(ure,K());)m=16*m+Z8(K(),16),W++,v++;if(K()=="."){if(v==0||(W-=v,F>6))return;for(w=0;K();){if(C=null,w>0){if(!(K()=="."&&w<4))return;W++}if(!xh(AG,K()))return;for(;xh(AG,K());){if(R=Z8(K(),10),C===null)C=R;else{if(C==0)return;C=10*C+R}if(C>255)return;W++}U[F]=256*U[F]+C,++w!=2&&w!=4||F++}if(w!=4)return;break}if(K()==":"){if(W++,!K())return}else if(K())return;U[F++]=m}else{if(Z!==null)return;W++,Z=++F}}if(Z!==null)for(x=F-Z,F=7;F!=0&&x>0;)L=U[F],U[F--]=U[Z+x-1],U[Z+--x]=L;else if(F!=8)return;return U}(R3(r,1,-1)),!a))return x3;this.host=a}else if(this.isSpecial()){if(r=l3e(r),xh(C3e,r)||(a=function(f){var m,v,w,C,R,x,L,U=y3e(f,".");if(U.length&&U[U.length-1]==""&&U.length--,(m=U.length)>4)return f;for(v=[],w=0;w<m;w++){if((C=U[w])=="")return f;if(R=10,C.length>1&&wu(C,0)=="0"&&(R=xh(w3e,C)?16:8,C=R3(C,R==8?1:2)),C==="")x=0;else{if(!xh(R==10?b3e:R==8?S3e:ure,C))return f;x=Z8(C,R)}ZS(v,x)}for(w=0;w<m;w++)if(x=v[w],w==m-1){if(x>=lre(256,5-m))return null}else if(x>255)return null;for(L=g3e(v),w=0;w<v.length;w++)L+=v[w]*lre(256,3-w);return L}(r),a===null))return x3;this.host=a}else{if(xh(T3e,r))return x3;for(a="",o=QS(r),c=0;c<o.length;c++)a+=D0(o[c],tD);this.host=a}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return bG(nD,this.scheme)},shortenPath:function(){var r=this.path,a=r.length;!a||this.scheme=="file"&&a==1&&I3(r[0],!0)||r.length--},serialize:function(){var r=this,a=r.scheme,o=r.username,c=r.password,f=r.host,m=r.port,v=r.path,w=r.query,C=r.fragment,R=a+":";return f!==null?(R+="//",r.includesCredentials()&&(R+=o+(c?":"+c:"")+"@"),R+=A3(f),m!==null&&(R+=":"+m)):a=="file"&&(R+="//"),R+=r.cannotBeABaseURL?v[0]:v.length?"/"+T3(v,"/"):"",w!==null&&(R+="?"+w),C!==null&&(R+="#"+C),R},setHref:function(r){var a=this.parse(r);if(a)throw TG(a);this.searchParams.update()},getOrigin:function(){var r=this.scheme,a=this.port;if(r=="blob")try{return new tb(r.path[0]).origin}catch{return"null"}return r!="file"&&this.isSpecial()?r+"://"+A3(this.host)+(a!==null?":"+a:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(ym(r)+":",NG)},getUsername:function(){return this.username},setUsername:function(r){var a=QS(ym(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var o=0;o<a.length;o++)this.username+=D0(a[o],IG)}},getPassword:function(){return this.password},setPassword:function(r){var a=QS(ym(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var o=0;o<a.length;o++)this.password+=D0(a[o],IG)}},getHost:function(){var r=this.host,a=this.port;return r===null?"":a===null?A3(r):A3(r)+":"+a},setHost:function(r){this.cannotBeABaseURL||this.parse(r,LG)},getHostname:function(){var r=this.host;return r===null?"":A3(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,DG)},getPort:function(){var r=this.port;return r===null?"":ym(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||((r=ym(r))==""?this.port=null:this.parse(r,kG))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+T3(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,eb))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){(r=ym(r))==""?this.query=null:(wu(r,0)=="?"&&(r=R3(r,1)),this.query="",this.parse(r,Xy)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){(r=ym(r))!=""?(wu(r,0)=="#"&&(r=R3(r,1)),this.fragment="",this.parse(r,_m)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var tb=function(r){var a=a3e(this,jl),o=d3e(arguments.length,1)>1?arguments[1]:void 0,c=u3e(a,new UG(r,!1,o));wG||(a.href=c.serialize(),a.origin=c.getOrigin(),a.protocol=c.getProtocol(),a.username=c.getUsername(),a.password=c.getPassword(),a.host=c.getHost(),a.hostname=c.getHostname(),a.port=c.getPort(),a.pathname=c.getPathname(),a.search=c.getSearch(),a.searchParams=c.getSearchParams(),a.hash=c.getHash())},jl=tb.prototype,Su=function(r,a){return{get:function(){return Q8(this)[r]()},set:a&&function(o){return Q8(this)[a](o)},configurable:!0,enumerable:!0}};if(wG&&(Eu(jl,"href",Su("serialize","setHref")),Eu(jl,"origin",Su("getOrigin")),Eu(jl,"protocol",Su("getProtocol","setProtocol")),Eu(jl,"username",Su("getUsername","setUsername")),Eu(jl,"password",Su("getPassword","setPassword")),Eu(jl,"host",Su("getHost","setHost")),Eu(jl,"hostname",Su("getHostname","setHostname")),Eu(jl,"port",Su("getPort","setPort")),Eu(jl,"pathname",Su("getPathname","setPathname")),Eu(jl,"search",Su("getSearch","setSearch")),Eu(jl,"searchParams",Su("getSearchParams")),Eu(jl,"hash",Su("getHash","setHash"))),J8(jl,"toJSON",function(){return Q8(this).serialize()},{enumerable:!0}),J8(jl,"toString",function(){return Q8(this).serialize()},{enumerable:!0}),C3){var Sre=C3.createObjectURL,bre=C3.revokeObjectURL;Sre&&J8(tb,"createObjectURL",sre(Sre,C3)),bre&&J8(tb,"revokeObjectURL",sre(bre,C3))}c3e(tb,"URL"),r3e({global:!0,constructor:!0,forced:!s3e,sham:!wG},{URL:tb});var N3e=Ni,O3e=d,P3e=sS,Cre=xl,L3e=dH,Tre=tn("URL");N3e({target:"URL",stat:!0,forced:!(L3e&&O3e(function(){Tre.canParse()}))},{canParse:function(r){var a=P3e(arguments.length,1),o=Cre(r),c=a<2||arguments[1]===void 0?void 0:Cre(arguments[1]);try{return!!new Tre(o,c)}catch{return!1}}});var Rre=l(Me.URL),D3e=b,k3e=ene,xre=RegExp.prototype,M3e=function(r){return r===xre||D3e(xre,r)?k3e(r):r.flags},La=l(M3e);function nb(r){let a=r.length;for(;--a>=0;)r[a]=0}let FG=256,Are=286,N3=30,O3=15,BG=new Uint8Array([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]),sD=new Uint8Array([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]),j3e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ire=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Em=new Array(576);nb(Em);let P3=new Array(60);nb(P3);let L3=new Array(512);nb(L3);let D3=new Array(256);nb(D3);let VG=new Array(29);nb(VG);let aD=new Array(N3);function zG(r,a,o,c,f){this.static_tree=r,this.extra_bits=a,this.extra_base=o,this.elems=c,this.max_length=f,this.has_stree=r&&r.length}let Nre,Ore,Pre;function HG(r,a){this.dyn_tree=r,this.max_code=0,this.stat_desc=a}nb(aD);let Lre=r=>r<256?L3[r]:L3[256+(r>>>7)],k3=(r,a)=>{r.pending_buf[r.pending++]=255&a,r.pending_buf[r.pending++]=a>>>8&255},Rc=(r,a,o)=>{r.bi_valid>16-o?(r.bi_buf|=a<<r.bi_valid&65535,k3(r,r.bi_buf),r.bi_buf=a>>16-r.bi_valid,r.bi_valid+=o-16):(r.bi_buf|=a<<r.bi_valid&65535,r.bi_valid+=o)},Uf=(r,a,o)=>{Rc(r,o[2*a],o[2*a+1])},Dre=(r,a)=>{let o=0;do o|=1&r,r>>>=1,o<<=1;while(--a>0);return o>>>1},kre=(r,a,o)=>{let c=new Array(16),f,m,v=0;for(f=1;f<=O3;f++)v=v+o[f-1]<<1,c[f]=v;for(m=0;m<=a;m++){let w=r[2*m+1];w!==0&&(r[2*m]=Dre(c[w]++,w))}},Mre=r=>{let a;for(a=0;a<Are;a++)r.dyn_ltree[2*a]=0;for(a=0;a<N3;a++)r.dyn_dtree[2*a]=0;for(a=0;a<19;a++)r.bl_tree[2*a]=0;r.dyn_ltree[512]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},jre=r=>{r.bi_valid>8?k3(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},Ure=(r,a,o,c)=>{let f=2*a,m=2*o;return r[f]<r[m]||r[f]===r[m]&&c[a]<=c[o]},GG=(r,a,o)=>{let c=r.heap[o],f=o<<1;for(;f<=r.heap_len&&(f<r.heap_len&&Ure(a,r.heap[f+1],r.heap[f],r.depth)&&f++,!Ure(a,c,r.heap[f],r.depth));)r.heap[o]=r.heap[f],o=f,f<<=1;r.heap[o]=c},Fre=(r,a,o)=>{let c,f,m,v,w=0;if(r.sym_next!==0)do c=255&r.pending_buf[r.sym_buf+w++],c+=(255&r.pending_buf[r.sym_buf+w++])<<8,f=r.pending_buf[r.sym_buf+w++],c===0?Uf(r,f,a):(m=D3[f],Uf(r,m+FG+1,a),v=BG[m],v!==0&&(f-=VG[m],Rc(r,f,v)),c--,m=Lre(c),Uf(r,m,o),v=sD[m],v!==0&&(c-=aD[m],Rc(r,c,v)));while(w<r.sym_next);Uf(r,256,a)},WG=(r,a)=>{let o=a.dyn_tree,c=a.stat_desc.static_tree,f=a.stat_desc.has_stree,m=a.stat_desc.elems,v,w,C,R=-1;for(r.heap_len=0,r.heap_max=573,v=0;v<m;v++)o[2*v]!==0?(r.heap[++r.heap_len]=R=v,r.depth[v]=0):o[2*v+1]=0;for(;r.heap_len<2;)C=r.heap[++r.heap_len]=R<2?++R:0,o[2*C]=1,r.depth[C]=0,r.opt_len--,f&&(r.static_len-=c[2*C+1]);for(a.max_code=R,v=r.heap_len>>1;v>=1;v--)GG(r,o,v);C=m;do v=r.heap[1],r.heap[1]=r.heap[r.heap_len--],GG(r,o,1),w=r.heap[1],r.heap[--r.heap_max]=v,r.heap[--r.heap_max]=w,o[2*C]=o[2*v]+o[2*w],r.depth[C]=(r.depth[v]>=r.depth[w]?r.depth[v]:r.depth[w])+1,o[2*v+1]=o[2*w+1]=C,r.heap[1]=C++,GG(r,o,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],((x,L)=>{let U=L.dyn_tree,F=L.max_code,Z=L.stat_desc.static_tree,W=L.stat_desc.has_stree,K=L.stat_desc.extra_bits,oe=L.stat_desc.extra_base,ue=L.stat_desc.max_length,xe,Oe,ke,He,lt,ut,ft=0;for(He=0;He<=O3;He++)x.bl_count[He]=0;for(U[2*x.heap[x.heap_max]+1]=0,xe=x.heap_max+1;xe<573;xe++)Oe=x.heap[xe],He=U[2*U[2*Oe+1]+1]+1,He>ue&&(He=ue,ft++),U[2*Oe+1]=He,Oe>F||(x.bl_count[He]++,lt=0,Oe>=oe&&(lt=K[Oe-oe]),ut=U[2*Oe],x.opt_len+=ut*(He+lt),W&&(x.static_len+=ut*(Z[2*Oe+1]+lt)));if(ft!==0){do{for(He=ue-1;x.bl_count[He]===0;)He--;x.bl_count[He]--,x.bl_count[He+1]+=2,x.bl_count[ue]--,ft-=2}while(ft>0);for(He=ue;He!==0;He--)for(Oe=x.bl_count[He];Oe!==0;)ke=x.heap[--xe],ke>F||(U[2*ke+1]!==He&&(x.opt_len+=(He-U[2*ke+1])*U[2*ke],U[2*ke+1]=He),Oe--)}})(r,a),kre(o,R,r.bl_count)},Bre=(r,a,o)=>{let c,f,m=-1,v=a[1],w=0,C=7,R=4;for(v===0&&(C=138,R=3),a[2*(o+1)+1]=65535,c=0;c<=o;c++)f=v,v=a[2*(c+1)+1],++w<C&&f===v||(w<R?r.bl_tree[2*f]+=w:f!==0?(f!==m&&r.bl_tree[2*f]++,r.bl_tree[32]++):w<=10?r.bl_tree[34]++:r.bl_tree[36]++,w=0,m=f,v===0?(C=138,R=3):f===v?(C=6,R=3):(C=7,R=4))},Vre=(r,a,o)=>{let c,f,m=-1,v=a[1],w=0,C=7,R=4;for(v===0&&(C=138,R=3),c=0;c<=o;c++)if(f=v,v=a[2*(c+1)+1],!(++w<C&&f===v)){if(w<R)do Uf(r,f,r.bl_tree);while(--w!=0);else f!==0?(f!==m&&(Uf(r,f,r.bl_tree),w--),Uf(r,16,r.bl_tree),Rc(r,w-3,2)):w<=10?(Uf(r,17,r.bl_tree),Rc(r,w-3,3)):(Uf(r,18,r.bl_tree),Rc(r,w-11,7));w=0,m=f,v===0?(C=138,R=3):f===v?(C=6,R=3):(C=7,R=4)}},zre=!1,Hre=(r,a,o,c)=>{Rc(r,0+(c?1:0),3),jre(r),k3(r,o),k3(r,~o),o&&r.pending_buf.set(r.window.subarray(a,a+o),r.pending),r.pending+=o};var U3e=r=>{zre||((()=>{let a,o,c,f,m,v=new Array(16);for(c=0,f=0;f<28;f++)for(VG[f]=c,a=0;a<1<<BG[f];a++)D3[c++]=f;for(D3[c-1]=f,m=0,f=0;f<16;f++)for(aD[f]=m,a=0;a<1<<sD[f];a++)L3[m++]=f;for(m>>=7;f<N3;f++)for(aD[f]=m<<7,a=0;a<1<<sD[f]-7;a++)L3[256+m++]=f;for(o=0;o<=O3;o++)v[o]=0;for(a=0;a<=143;)Em[2*a+1]=8,a++,v[8]++;for(;a<=255;)Em[2*a+1]=9,a++,v[9]++;for(;a<=279;)Em[2*a+1]=7,a++,v[7]++;for(;a<=287;)Em[2*a+1]=8,a++,v[8]++;for(kre(Em,287,v),a=0;a<N3;a++)P3[2*a+1]=5,P3[2*a]=Dre(a,5);Nre=new zG(Em,BG,257,Are,O3),Ore=new zG(P3,sD,0,N3,O3),Pre=new zG(new Array(0),j3e,0,19,7)})(),zre=!0),r.l_desc=new HG(r.dyn_ltree,Nre),r.d_desc=new HG(r.dyn_dtree,Ore),r.bl_desc=new HG(r.bl_tree,Pre),r.bi_buf=0,r.bi_valid=0,Mre(r)},F3e=(r,a,o,c)=>{let f,m,v=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=(w=>{let C,R=4093624447;for(C=0;C<=31;C++,R>>>=1)if(1&R&&w.dyn_ltree[2*C]!==0)return 0;if(w.dyn_ltree[18]!==0||w.dyn_ltree[20]!==0||w.dyn_ltree[26]!==0)return 1;for(C=32;C<FG;C++)if(w.dyn_ltree[2*C]!==0)return 1;return 0})(r)),WG(r,r.l_desc),WG(r,r.d_desc),v=(w=>{let C;for(Bre(w,w.dyn_ltree,w.l_desc.max_code),Bre(w,w.dyn_dtree,w.d_desc.max_code),WG(w,w.bl_desc),C=18;C>=3&&w.bl_tree[2*Ire[C]+1]===0;C--);return w.opt_len+=3*(C+1)+5+5+4,C})(r),f=r.opt_len+3+7>>>3,m=r.static_len+3+7>>>3,m<=f&&(f=m)):f=m=o+5,o+4<=f&&a!==-1?Hre(r,a,o,c):r.strategy===4||m===f?(Rc(r,2+(c?1:0),3),Fre(r,Em,P3)):(Rc(r,4+(c?1:0),3),((w,C,R,x)=>{let L;for(Rc(w,C-257,5),Rc(w,R-1,5),Rc(w,x-4,4),L=0;L<x;L++)Rc(w,w.bl_tree[2*Ire[L]+1],3);Vre(w,w.dyn_ltree,C-1),Vre(w,w.dyn_dtree,R-1)})(r,r.l_desc.max_code+1,r.d_desc.max_code+1,v+1),Fre(r,r.dyn_ltree,r.dyn_dtree)),Mre(r),c&&jre(r)},B3e=(r,a,o)=>(r.pending_buf[r.sym_buf+r.sym_next++]=a,r.pending_buf[r.sym_buf+r.sym_next++]=a>>8,r.pending_buf[r.sym_buf+r.sym_next++]=o,a===0?r.dyn_ltree[2*o]++:(r.matches++,a--,r.dyn_ltree[2*(D3[o]+FG+1)]++,r.dyn_dtree[2*Lre(a)]++),r.sym_next===r.sym_end),V3e=r=>{Rc(r,2,3),Uf(r,256,Em),(a=>{a.bi_valid===16?(k3(a,a.bi_buf),a.bi_buf=0,a.bi_valid=0):a.bi_valid>=8&&(a.pending_buf[a.pending++]=255&a.bi_buf,a.bi_buf>>=8,a.bi_valid-=8)})(r)},z3e={_tr_init:U3e,_tr_stored_block:Hre,_tr_flush_block:F3e,_tr_tally:B3e,_tr_align:V3e},M3=(r,a,o,c)=>{let f=65535&r|0,m=r>>>16&65535|0,v=0;for(;o!==0;){v=o>2e3?2e3:o,o-=v;do f=f+a[c++]|0,m=m+f|0;while(--v);f%=65521,m%=65521}return f|m<<16|0};let H3e=new Uint32Array((()=>{let r,a=[];for(var o=0;o<256;o++){r=o;for(var c=0;c<8;c++)r=1&r?3988292384^r>>>1:r>>>1;a[o]=r}return a})());var ro=(r,a,o,c)=>{let f=H3e,m=c+o;r^=-1;for(let v=c;v<m;v++)r=r>>>8^f[255&(r^a[v])];return-1^r},Jy={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"},ib={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_MEM_ERROR:-4,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};let{_tr_init:G3e,_tr_stored_block:$G,_tr_flush_block:W3e,_tr_tally:k0,_tr_align:$3e}=z3e,{Z_NO_FLUSH:M0,Z_PARTIAL_FLUSH:K3e,Z_FULL_FLUSH:q3e,Z_FINISH:bu,Z_BLOCK:Gre,Z_OK:No,Z_STREAM_END:Wre,Z_STREAM_ERROR:Ff,Z_DATA_ERROR:Y3e,Z_BUF_ERROR:KG,Z_DEFAULT_COMPRESSION:X3e,Z_FILTERED:J3e,Z_HUFFMAN_ONLY:oD,Z_RLE:Q3e,Z_FIXED:Z3e,Z_DEFAULT_STRATEGY:eIe,Z_UNKNOWN:tIe,Z_DEFLATED:lD}=ib,qG=286,nIe=30,iIe=19,rIe=2*qG+1,sIe=15,Qy=258,Bf=262,rb=42,Zy=113,j3=666,e_=(r,a)=>(r.msg=Jy[a],a),$re=r=>2*r-(r>4?9:0),j0=r=>{let a=r.length;for(;--a>=0;)r[a]=0},aIe=r=>{let a,o,c,f=r.w_size;a=r.hash_size,c=a;do o=r.head[--c],r.head[c]=o>=f?o-f:0;while(--a);a=f,c=a;do o=r.prev[--c],r.prev[c]=o>=f?o-f:0;while(--a)},U0=(r,a,o)=>(a<<r.hash_shift^o)&r.hash_mask,fd=r=>{let a=r.state,o=a.pending;o>r.avail_out&&(o=r.avail_out),o!==0&&(r.output.set(a.pending_buf.subarray(a.pending_out,a.pending_out+o),r.next_out),r.next_out+=o,a.pending_out+=o,r.total_out+=o,r.avail_out-=o,a.pending-=o,a.pending===0&&(a.pending_out=0))},pd=(r,a)=>{W3e(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,a),r.block_start=r.strstart,fd(r.strm)},Rr=(r,a)=>{r.pending_buf[r.pending++]=a},U3=(r,a)=>{r.pending_buf[r.pending++]=a>>>8&255,r.pending_buf[r.pending++]=255&a},YG=(r,a,o,c)=>{let f=r.avail_in;return f>c&&(f=c),f===0?0:(r.avail_in-=f,a.set(r.input.subarray(r.next_in,r.next_in+f),o),r.state.wrap===1?r.adler=M3(r.adler,a,f,o):r.state.wrap===2&&(r.adler=ro(r.adler,a,f,o)),r.next_in+=f,r.total_in+=f,f)},Kre=(r,a)=>{let o,c,f=r.max_chain_length,m=r.strstart,v=r.prev_length,w=r.nice_match,C=r.strstart>r.w_size-Bf?r.strstart-(r.w_size-Bf):0,R=r.window,x=r.w_mask,L=r.prev,U=r.strstart+Qy,F=R[m+v-1],Z=R[m+v];r.prev_length>=r.good_match&&(f>>=2),w>r.lookahead&&(w=r.lookahead);do if(o=a,R[o+v]===Z&&R[o+v-1]===F&&R[o]===R[m]&&R[++o]===R[m+1]){m+=2,o++;do;while(R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&R[++m]===R[++o]&&m<U);if(c=Qy-(U-m),m=U-Qy,c>v){if(r.match_start=a,v=c,c>=w)break;F=R[m+v-1],Z=R[m+v]}}while((a=L[a&x])>C&&--f!=0);return v<=r.lookahead?v:r.lookahead},sb=r=>{let a=r.w_size,o,c,f;do{if(c=r.window_size-r.lookahead-r.strstart,r.strstart>=a+(a-Bf)&&(r.window.set(r.window.subarray(a,a+a-c),0),r.match_start-=a,r.strstart-=a,r.block_start-=a,r.insert>r.strstart&&(r.insert=r.strstart),aIe(r),c+=a),r.strm.avail_in===0)break;if(o=YG(r.strm,r.window,r.strstart+r.lookahead,c),r.lookahead+=o,r.lookahead+r.insert>=3)for(f=r.strstart-r.insert,r.ins_h=r.window[f],r.ins_h=U0(r,r.ins_h,r.window[f+1]);r.insert&&(r.ins_h=U0(r,r.ins_h,r.window[f+3-1]),r.prev[f&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=f,f++,r.insert--,!(r.lookahead+r.insert<3)););}while(r.lookahead<Bf&&r.strm.avail_in!==0)},qre=(r,a)=>{let o,c,f,m=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,v=0,w=r.strm.avail_in;do{if(o=65535,f=r.bi_valid+42>>3,r.strm.avail_out<f||(f=r.strm.avail_out-f,c=r.strstart-r.block_start,o>c+r.strm.avail_in&&(o=c+r.strm.avail_in),o>f&&(o=f),o<m&&(o===0&&a!==bu||a===M0||o!==c+r.strm.avail_in)))break;v=a===bu&&o===c+r.strm.avail_in?1:0,$G(r,0,0,v),r.pending_buf[r.pending-4]=o,r.pending_buf[r.pending-3]=o>>8,r.pending_buf[r.pending-2]=~o,r.pending_buf[r.pending-1]=~o>>8,fd(r.strm),c&&(c>o&&(c=o),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+c),r.strm.next_out),r.strm.next_out+=c,r.strm.avail_out-=c,r.strm.total_out+=c,r.block_start+=c,o-=c),o&&(YG(r.strm,r.strm.output,r.strm.next_out,o),r.strm.next_out+=o,r.strm.avail_out-=o,r.strm.total_out+=o)}while(v===0);return w-=r.strm.avail_in,w&&(w>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=w&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-w,r.strm.next_in),r.strstart),r.strstart+=w,r.insert+=w>r.w_size-r.insert?r.w_size-r.insert:w),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),v?4:a!==M0&&a!==bu&&r.strm.avail_in===0&&r.strstart===r.block_start?2:(f=r.window_size-r.strstart,r.strm.avail_in>f&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,f+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),f>r.strm.avail_in&&(f=r.strm.avail_in),f&&(YG(r.strm,r.window,r.strstart,f),r.strstart+=f,r.insert+=f>r.w_size-r.insert?r.w_size-r.insert:f),r.high_water<r.strstart&&(r.high_water=r.strstart),f=r.bi_valid+42>>3,f=r.pending_buf_size-f>65535?65535:r.pending_buf_size-f,m=f>r.w_size?r.w_size:f,c=r.strstart-r.block_start,(c>=m||(c||a===bu)&&a!==M0&&r.strm.avail_in===0&&c<=f)&&(o=c>f?f:c,v=a===bu&&r.strm.avail_in===0&&o===c?1:0,$G(r,r.block_start,o,v),r.block_start+=o,fd(r.strm)),v?3:1)},XG=(r,a)=>{let o,c;for(;;){if(r.lookahead<Bf){if(sb(r),r.lookahead<Bf&&a===M0)return 1;if(r.lookahead===0)break}if(o=0,r.lookahead>=3&&(r.ins_h=U0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),o!==0&&r.strstart-o<=r.w_size-Bf&&(r.match_length=Kre(r,o)),r.match_length>=3)if(c=k0(r,r.strstart-r.match_start,r.match_length-3),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=3){r.match_length--;do r.strstart++,r.ins_h=U0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!=0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=U0(r,r.ins_h,r.window[r.strstart+1]);else c=k0(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(c&&(pd(r,!1),r.strm.avail_out===0))return 1}return r.insert=r.strstart<2?r.strstart:2,a===bu?(pd(r,!0),r.strm.avail_out===0?3:4):r.sym_next&&(pd(r,!1),r.strm.avail_out===0)?1:2},ab=(r,a)=>{let o,c,f;for(;;){if(r.lookahead<Bf){if(sb(r),r.lookahead<Bf&&a===M0)return 1;if(r.lookahead===0)break}if(o=0,r.lookahead>=3&&(r.ins_h=U0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=2,o!==0&&r.prev_length<r.max_lazy_match&&r.strstart-o<=r.w_size-Bf&&(r.match_length=Kre(r,o),r.match_length<=5&&(r.strategy===J3e||r.match_length===3&&r.strstart-r.match_start>4096)&&(r.match_length=2)),r.prev_length>=3&&r.match_length<=r.prev_length){f=r.strstart+r.lookahead-3,c=k0(r,r.strstart-1-r.prev_match,r.prev_length-3),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=f&&(r.ins_h=U0(r,r.ins_h,r.window[r.strstart+3-1]),o=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!=0);if(r.match_available=0,r.match_length=2,r.strstart++,c&&(pd(r,!1),r.strm.avail_out===0))return 1}else if(r.match_available){if(c=k0(r,0,r.window[r.strstart-1]),c&&pd(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return 1}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(c=k0(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<2?r.strstart:2,a===bu?(pd(r,!0),r.strm.avail_out===0?3:4):r.sym_next&&(pd(r,!1),r.strm.avail_out===0)?1:2};function Vf(r,a,o,c,f){this.good_length=r,this.max_lazy=a,this.nice_length=o,this.max_chain=c,this.func=f}let F3=[new Vf(0,0,0,0,qre),new Vf(4,4,8,4,XG),new Vf(4,5,16,8,XG),new Vf(4,6,32,32,XG),new Vf(4,4,16,16,ab),new Vf(8,16,32,32,ab),new Vf(8,16,128,128,ab),new Vf(8,32,128,256,ab),new Vf(32,128,258,1024,ab),new Vf(32,258,258,4096,ab)];function oIe(){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=lD,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 Uint16Array(2*rIe),this.dyn_dtree=new Uint16Array(2*(2*nIe+1)),this.bl_tree=new Uint16Array(2*(2*iIe+1)),j0(this.dyn_ltree),j0(this.dyn_dtree),j0(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(sIe+1),this.heap=new Uint16Array(2*qG+1),j0(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*qG+1),j0(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}let B3=r=>{if(!r)return 1;let a=r.state;return!a||a.strm!==r||a.status!==rb&&a.status!==57&&a.status!==69&&a.status!==73&&a.status!==91&&a.status!==103&&a.status!==Zy&&a.status!==j3?1:0},Yre=r=>{if(B3(r))return e_(r,Ff);r.total_in=r.total_out=0,r.data_type=tIe;let a=r.state;return a.pending=0,a.pending_out=0,a.wrap<0&&(a.wrap=-a.wrap),a.status=a.wrap===2?57:a.wrap?rb:Zy,r.adler=a.wrap===2?0:1,a.last_flush=-2,G3e(a),No},Xre=r=>{let a=Yre(r);return a===No&&(o=>{o.window_size=2*o.w_size,j0(o.head),o.max_lazy_match=F3[o.level].max_lazy,o.good_match=F3[o.level].good_length,o.nice_match=F3[o.level].nice_length,o.max_chain_length=F3[o.level].max_chain,o.strstart=0,o.block_start=0,o.lookahead=0,o.insert=0,o.match_length=o.prev_length=2,o.match_available=0,o.ins_h=0})(r.state),a},Jre=(r,a,o,c,f,m)=>{if(!r)return Ff;let v=1;if(a===X3e&&(a=6),c<0?(v=0,c=-c):c>15&&(v=2,c-=16),f<1||f>9||o!==lD||c<8||c>15||a<0||a>9||m<0||m>Z3e||c===8&&v!==1)return e_(r,Ff);c===8&&(c=9);let w=new oIe;return r.state=w,w.strm=r,w.status=rb,w.wrap=v,w.gzhead=null,w.w_bits=c,w.w_size=1<<w.w_bits,w.w_mask=w.w_size-1,w.hash_bits=f+7,w.hash_size=1<<w.hash_bits,w.hash_mask=w.hash_size-1,w.hash_shift=~~((w.hash_bits+3-1)/3),w.window=new Uint8Array(2*w.w_size),w.head=new Uint16Array(w.hash_size),w.prev=new Uint16Array(w.w_size),w.lit_bufsize=1<<f+6,w.pending_buf_size=4*w.lit_bufsize,w.pending_buf=new Uint8Array(w.pending_buf_size),w.sym_buf=w.lit_bufsize,w.sym_end=3*(w.lit_bufsize-1),w.level=a,w.strategy=m,w.method=o,Xre(r)};var lIe=(r,a)=>{if(B3(r)||a>Gre||a<0)return r?e_(r,Ff):Ff;let o=r.state;if(!r.output||r.avail_in!==0&&!r.input||o.status===j3&&a!==bu)return e_(r,r.avail_out===0?KG:Ff);let c=o.last_flush;if(o.last_flush=a,o.pending!==0){if(fd(r),r.avail_out===0)return o.last_flush=-1,No}else if(r.avail_in===0&&$re(a)<=$re(c)&&a!==bu)return e_(r,KG);if(o.status===j3&&r.avail_in!==0)return e_(r,KG);if(o.status===rb&&o.wrap===0&&(o.status=Zy),o.status===rb){let f=lD+(o.w_bits-8<<4)<<8,m=-1;if(m=o.strategy>=oD||o.level<2?0:o.level<6?1:o.level===6?2:3,f|=m<<6,o.strstart!==0&&(f|=32),f+=31-f%31,U3(o,f),o.strstart!==0&&(U3(o,r.adler>>>16),U3(o,65535&r.adler)),r.adler=1,o.status=Zy,fd(r),o.pending!==0)return o.last_flush=-1,No}if(o.status===57){if(r.adler=0,Rr(o,31),Rr(o,139),Rr(o,8),o.gzhead)Rr(o,(o.gzhead.text?1:0)+(o.gzhead.hcrc?2:0)+(o.gzhead.extra?4:0)+(o.gzhead.name?8:0)+(o.gzhead.comment?16:0)),Rr(o,255&o.gzhead.time),Rr(o,o.gzhead.time>>8&255),Rr(o,o.gzhead.time>>16&255),Rr(o,o.gzhead.time>>24&255),Rr(o,o.level===9?2:o.strategy>=oD||o.level<2?4:0),Rr(o,255&o.gzhead.os),o.gzhead.extra&&o.gzhead.extra.length&&(Rr(o,255&o.gzhead.extra.length),Rr(o,o.gzhead.extra.length>>8&255)),o.gzhead.hcrc&&(r.adler=ro(r.adler,o.pending_buf,o.pending,0)),o.gzindex=0,o.status=69;else if(Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,0),Rr(o,o.level===9?2:o.strategy>=oD||o.level<2?4:0),Rr(o,3),o.status=Zy,fd(r),o.pending!==0)return o.last_flush=-1,No}if(o.status===69){if(o.gzhead.extra){let f=o.pending,m=(65535&o.gzhead.extra.length)-o.gzindex;for(;o.pending+m>o.pending_buf_size;){let w=o.pending_buf_size-o.pending;if(o.pending_buf.set(o.gzhead.extra.subarray(o.gzindex,o.gzindex+w),o.pending),o.pending=o.pending_buf_size,o.gzhead.hcrc&&o.pending>f&&(r.adler=ro(r.adler,o.pending_buf,o.pending-f,f)),o.gzindex+=w,fd(r),o.pending!==0)return o.last_flush=-1,No;f=0,m-=w}let v=new Uint8Array(o.gzhead.extra);o.pending_buf.set(v.subarray(o.gzindex,o.gzindex+m),o.pending),o.pending+=m,o.gzhead.hcrc&&o.pending>f&&(r.adler=ro(r.adler,o.pending_buf,o.pending-f,f)),o.gzindex=0}o.status=73}if(o.status===73){if(o.gzhead.name){let f,m=o.pending;do{if(o.pending===o.pending_buf_size){if(o.gzhead.hcrc&&o.pending>m&&(r.adler=ro(r.adler,o.pending_buf,o.pending-m,m)),fd(r),o.pending!==0)return o.last_flush=-1,No;m=0}f=o.gzindex<o.gzhead.name.length?255&o.gzhead.name.charCodeAt(o.gzindex++):0,Rr(o,f)}while(f!==0);o.gzhead.hcrc&&o.pending>m&&(r.adler=ro(r.adler,o.pending_buf,o.pending-m,m)),o.gzindex=0}o.status=91}if(o.status===91){if(o.gzhead.comment){let f,m=o.pending;do{if(o.pending===o.pending_buf_size){if(o.gzhead.hcrc&&o.pending>m&&(r.adler=ro(r.adler,o.pending_buf,o.pending-m,m)),fd(r),o.pending!==0)return o.last_flush=-1,No;m=0}f=o.gzindex<o.gzhead.comment.length?255&o.gzhead.comment.charCodeAt(o.gzindex++):0,Rr(o,f)}while(f!==0);o.gzhead.hcrc&&o.pending>m&&(r.adler=ro(r.adler,o.pending_buf,o.pending-m,m))}o.status=103}if(o.status===103){if(o.gzhead.hcrc){if(o.pending+2>o.pending_buf_size&&(fd(r),o.pending!==0))return o.last_flush=-1,No;Rr(o,255&r.adler),Rr(o,r.adler>>8&255),r.adler=0}if(o.status=Zy,fd(r),o.pending!==0)return o.last_flush=-1,No}if(r.avail_in!==0||o.lookahead!==0||a!==M0&&o.status!==j3){let f=o.level===0?qre(o,a):o.strategy===oD?((m,v)=>{let w;for(;;){if(m.lookahead===0&&(sb(m),m.lookahead===0)){if(v===M0)return 1;break}if(m.match_length=0,w=k0(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++,w&&(pd(m,!1),m.strm.avail_out===0))return 1}return m.insert=0,v===bu?(pd(m,!0),m.strm.avail_out===0?3:4):m.sym_next&&(pd(m,!1),m.strm.avail_out===0)?1:2})(o,a):o.strategy===Q3e?((m,v)=>{let w,C,R,x,L=m.window;for(;;){if(m.lookahead<=Qy){if(sb(m),m.lookahead<=Qy&&v===M0)return 1;if(m.lookahead===0)break}if(m.match_length=0,m.lookahead>=3&&m.strstart>0&&(R=m.strstart-1,C=L[R],C===L[++R]&&C===L[++R]&&C===L[++R])){x=m.strstart+Qy;do;while(C===L[++R]&&C===L[++R]&&C===L[++R]&&C===L[++R]&&C===L[++R]&&C===L[++R]&&C===L[++R]&&C===L[++R]&&R<x);m.match_length=Qy-(x-R),m.match_length>m.lookahead&&(m.match_length=m.lookahead)}if(m.match_length>=3?(w=k0(m,1,m.match_length-3),m.lookahead-=m.match_length,m.strstart+=m.match_length,m.match_length=0):(w=k0(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++),w&&(pd(m,!1),m.strm.avail_out===0))return 1}return m.insert=0,v===bu?(pd(m,!0),m.strm.avail_out===0?3:4):m.sym_next&&(pd(m,!1),m.strm.avail_out===0)?1:2})(o,a):F3[o.level].func(o,a);if(f!==3&&f!==4||(o.status=j3),f===1||f===3)return r.avail_out===0&&(o.last_flush=-1),No;if(f===2&&(a===K3e?$3e(o):a!==Gre&&($G(o,0,0,!1),a===q3e&&(j0(o.head),o.lookahead===0&&(o.strstart=0,o.block_start=0,o.insert=0))),fd(r),r.avail_out===0))return o.last_flush=-1,No}return a!==bu?No:o.wrap<=0?Wre:(o.wrap===2?(Rr(o,255&r.adler),Rr(o,r.adler>>8&255),Rr(o,r.adler>>16&255),Rr(o,r.adler>>24&255),Rr(o,255&r.total_in),Rr(o,r.total_in>>8&255),Rr(o,r.total_in>>16&255),Rr(o,r.total_in>>24&255)):(U3(o,r.adler>>>16),U3(o,65535&r.adler)),fd(r),o.wrap>0&&(o.wrap=-o.wrap),o.pending!==0?No:Wre)},cIe=(r,a)=>{let o=a.length;if(B3(r))return Ff;let c=r.state,f=c.wrap;if(f===2||f===1&&c.status!==rb||c.lookahead)return Ff;if(f===1&&(r.adler=M3(r.adler,a,o,0)),c.wrap=0,o>=c.w_size){f===0&&(j0(c.head),c.strstart=0,c.block_start=0,c.insert=0);let C=new Uint8Array(c.w_size);C.set(a.subarray(o-c.w_size,o),0),a=C,o=c.w_size}let m=r.avail_in,v=r.next_in,w=r.input;for(r.avail_in=o,r.next_in=0,r.input=a,sb(c);c.lookahead>=3;){let C=c.strstart,R=c.lookahead-2;do c.ins_h=U0(c,c.ins_h,c.window[C+3-1]),c.prev[C&c.w_mask]=c.head[c.ins_h],c.head[c.ins_h]=C,C++;while(--R);c.strstart=C,c.lookahead=2,sb(c)}return c.strstart+=c.lookahead,c.block_start=c.strstart,c.insert=c.lookahead,c.lookahead=0,c.match_length=c.prev_length=2,c.match_available=0,r.next_in=v,r.input=w,r.avail_in=m,c.wrap=f,No},V3={deflateInit:(r,a)=>Jre(r,a,lD,15,8,eIe),deflateInit2:Jre,deflateReset:Xre,deflateResetKeep:Yre,deflateSetHeader:(r,a)=>B3(r)||r.state.wrap!==2?Ff:(r.state.gzhead=a,No),deflate:lIe,deflateEnd:r=>{if(B3(r))return Ff;let a=r.state.status;return r.state=null,a===Zy?e_(r,Y3e):No},deflateSetDictionary:cIe,deflateInfo:"pako deflate (from Nodeca project)"};let dIe=(r,a)=>Object.prototype.hasOwnProperty.call(r,a);var cD={assign:function(r){let a=Array.prototype.slice.call(arguments,1);for(;a.length;){let o=a.shift();if(o){if(typeof o!="object")throw new TypeError(o+"must be non-object");for(let c in o)dIe(o,c)&&(r[c]=o[c])}}return r},flattenChunks:r=>{let a=0;for(let c=0,f=r.length;c<f;c++)a+=r[c].length;let o=new Uint8Array(a);for(let c=0,f=0,m=r.length;c<m;c++){let v=r[c];o.set(v,f),f+=v.length}return o}};let Qre=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Qre=!1}let z3=new Uint8Array(256);for(let r=0;r<256;r++)z3[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;z3[254]=z3[254]=1;var H3={string2buf:r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let a,o,c,f,m,v=r.length,w=0;for(f=0;f<v;f++)o=r.charCodeAt(f),(64512&o)==55296&&f+1<v&&(c=r.charCodeAt(f+1),(64512&c)==56320&&(o=65536+(o-55296<<10)+(c-56320),f++)),w+=o<128?1:o<2048?2:o<65536?3:4;for(a=new Uint8Array(w),m=0,f=0;m<w;f++)o=r.charCodeAt(f),(64512&o)==55296&&f+1<v&&(c=r.charCodeAt(f+1),(64512&c)==56320&&(o=65536+(o-55296<<10)+(c-56320),f++)),o<128?a[m++]=o:o<2048?(a[m++]=192|o>>>6,a[m++]=128|63&o):o<65536?(a[m++]=224|o>>>12,a[m++]=128|o>>>6&63,a[m++]=128|63&o):(a[m++]=240|o>>>18,a[m++]=128|o>>>12&63,a[m++]=128|o>>>6&63,a[m++]=128|63&o);return a},buf2string:(r,a)=>{let o=a||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,a));let c,f,m=new Array(2*o);for(f=0,c=0;c<o;){let v=r[c++];if(v<128){m[f++]=v;continue}let w=z3[v];if(w>4)m[f++]=65533,c+=w-1;else{for(v&=w===2?31:w===3?15:7;w>1&&c<o;)v=v<<6|63&r[c++],w--;w>1?m[f++]=65533:v<65536?m[f++]=v:(v-=65536,m[f++]=55296|v>>10&1023,m[f++]=56320|1023&v)}}return((v,w)=>{if(w<65534&&v.subarray&&Qre)return String.fromCharCode.apply(null,v.length===w?v:v.subarray(0,w));let C="";for(let R=0;R<w;R++)C+=String.fromCharCode(v[R]);return C})(m,f)},utf8border:(r,a)=>{(a=a||r.length)>r.length&&(a=r.length);let o=a-1;for(;o>=0&&(192&r[o])==128;)o--;return o<0||o===0?a:o+z3[r[o]]>a?o:a}},Zre=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};let ese=Object.prototype.toString,{Z_NO_FLUSH:uIe,Z_SYNC_FLUSH:hIe,Z_FULL_FLUSH:fIe,Z_FINISH:pIe,Z_OK:dD,Z_STREAM_END:mIe,Z_DEFAULT_COMPRESSION:gIe,Z_DEFAULT_STRATEGY:vIe,Z_DEFLATED:yIe}=ib;function G3(r){this.options=cD.assign({level:gIe,method:yIe,chunkSize:16384,windowBits:15,memLevel:8,strategy:vIe},r||{});let a=this.options;a.raw&&a.windowBits>0?a.windowBits=-a.windowBits:a.gzip&&a.windowBits>0&&a.windowBits<16&&(a.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zre,this.strm.avail_out=0;let o=V3.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(o!==dD)throw new Error(Jy[o]);if(a.header&&V3.deflateSetHeader(this.strm,a.header),a.dictionary){let c;if(c=typeof a.dictionary=="string"?H3.string2buf(a.dictionary):ese.call(a.dictionary)==="[object ArrayBuffer]"?new Uint8Array(a.dictionary):a.dictionary,o=V3.deflateSetDictionary(this.strm,c),o!==dD)throw new Error(Jy[o]);this._dict_set=!0}}function JG(r,a){let o=new G3(a);if(o.push(r,!0),o.err)throw o.msg||Jy[o.err];return o.result}G3.prototype.push=function(r,a){let o=this.strm,c=this.options.chunkSize,f,m;if(this.ended)return!1;for(m=a===~~a?a:a===!0?pIe:uIe,typeof r=="string"?o.input=H3.string2buf(r):ese.call(r)==="[object ArrayBuffer]"?o.input=new Uint8Array(r):o.input=r,o.next_in=0,o.avail_in=o.input.length;;)if(o.avail_out===0&&(o.output=new Uint8Array(c),o.next_out=0,o.avail_out=c),(m===hIe||m===fIe)&&o.avail_out<=6)this.onData(o.output.subarray(0,o.next_out)),o.avail_out=0;else{if(f=V3.deflate(o,m),f===mIe)return o.next_out>0&&this.onData(o.output.subarray(0,o.next_out)),f=V3.deflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===dD;if(o.avail_out!==0){if(m>0&&o.next_out>0)this.onData(o.output.subarray(0,o.next_out)),o.avail_out=0;else if(o.avail_in===0)break}else this.onData(o.output)}return!0},G3.prototype.onData=function(r){this.chunks.push(r)},G3.prototype.onEnd=function(r){r===dD&&(this.result=cD.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};var _Ie={Deflate:G3,deflate:JG,deflateRaw:function(r,a){return(a=a||{}).raw=!0,JG(r,a)},gzip:function(r,a){return(a=a||{}).gzip=!0,JG(r,a)},constants:ib};let uD=16209;var EIe=function(r,a){let o,c,f,m,v,w,C,R,x,L,U,F,Z,W,K,oe,ue,xe,Oe,ke,He,lt,ut,ft,zt=r.state;o=r.next_in,ut=r.input,c=o+(r.avail_in-5),f=r.next_out,ft=r.output,m=f-(a-r.avail_out),v=f+(r.avail_out-257),w=zt.dmax,C=zt.wsize,R=zt.whave,x=zt.wnext,L=zt.window,U=zt.hold,F=zt.bits,Z=zt.lencode,W=zt.distcode,K=(1<<zt.lenbits)-1,oe=(1<<zt.distbits)-1;e:do{F<15&&(U+=ut[o++]<<F,F+=8,U+=ut[o++]<<F,F+=8),ue=Z[U&K];t:for(;;){if(xe=ue>>>24,U>>>=xe,F-=xe,xe=ue>>>16&255,xe===0)ft[f++]=65535&ue;else{if(!(16&xe)){if(!(64&xe)){ue=Z[(65535&ue)+(U&(1<<xe)-1)];continue t}if(32&xe){zt.mode=16191;break e}r.msg="invalid literal/length code",zt.mode=uD;break e}Oe=65535&ue,xe&=15,xe&&(F<xe&&(U+=ut[o++]<<F,F+=8),Oe+=U&(1<<xe)-1,U>>>=xe,F-=xe),F<15&&(U+=ut[o++]<<F,F+=8,U+=ut[o++]<<F,F+=8),ue=W[U&oe];n:for(;;){if(xe=ue>>>24,U>>>=xe,F-=xe,xe=ue>>>16&255,!(16&xe)){if(!(64&xe)){ue=W[(65535&ue)+(U&(1<<xe)-1)];continue n}r.msg="invalid distance code",zt.mode=uD;break e}if(ke=65535&ue,xe&=15,F<xe&&(U+=ut[o++]<<F,F+=8,F<xe&&(U+=ut[o++]<<F,F+=8)),ke+=U&(1<<xe)-1,ke>w){r.msg="invalid distance too far back",zt.mode=uD;break e}if(U>>>=xe,F-=xe,xe=f-m,ke>xe){if(xe=ke-xe,xe>R&&zt.sane){r.msg="invalid distance too far back",zt.mode=uD;break e}if(He=0,lt=L,x===0){if(He+=C-xe,xe<Oe){Oe-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}}else if(x<xe){if(He+=C+x-xe,xe-=x,xe<Oe){Oe-=xe;do ft[f++]=L[He++];while(--xe);if(He=0,x<Oe){xe=x,Oe-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}}}else if(He+=x-xe,xe<Oe){Oe-=xe;do ft[f++]=L[He++];while(--xe);He=f-ke,lt=ft}for(;Oe>2;)ft[f++]=lt[He++],ft[f++]=lt[He++],ft[f++]=lt[He++],Oe-=3;Oe&&(ft[f++]=lt[He++],Oe>1&&(ft[f++]=lt[He++]))}else{He=f-ke;do ft[f++]=ft[He++],ft[f++]=ft[He++],ft[f++]=ft[He++],Oe-=3;while(Oe>2);Oe&&(ft[f++]=ft[He++],Oe>1&&(ft[f++]=ft[He++]))}break}}break}}while(o<c&&f<v);Oe=F>>3,o-=Oe,F-=Oe<<3,U&=(1<<F)-1,r.next_in=o,r.next_out=f,r.avail_in=o<c?c-o+5:5-(o-c),r.avail_out=f<v?v-f+257:257-(f-v),zt.hold=U,zt.bits=F};let hD=15,wIe=new Uint16Array([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]),SIe=new Uint8Array([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]),bIe=new Uint16Array([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]),CIe=new Uint8Array([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]);var W3=(r,a,o,c,f,m,v,w)=>{let C=w.bits,R,x,L,U,F,Z,W=0,K=0,oe=0,ue=0,xe=0,Oe=0,ke=0,He=0,lt=0,ut=0,ft=null,zt=new Uint16Array(16),$n=new Uint16Array(16),hi,Gi,Ur,mr=null;for(W=0;W<=hD;W++)zt[W]=0;for(K=0;K<c;K++)zt[a[o+K]]++;for(xe=C,ue=hD;ue>=1&&zt[ue]===0;ue--);if(xe>ue&&(xe=ue),ue===0)return f[m++]=20971520,f[m++]=20971520,w.bits=1,0;for(oe=1;oe<ue&&zt[oe]===0;oe++);for(xe<oe&&(xe=oe),He=1,W=1;W<=hD;W++)if(He<<=1,He-=zt[W],He<0)return-1;if(He>0&&(r===0||ue!==1))return-1;for($n[1]=0,W=1;W<hD;W++)$n[W+1]=$n[W]+zt[W];for(K=0;K<c;K++)a[o+K]!==0&&(v[$n[a[o+K]]++]=K);if(r===0?(ft=mr=v,Z=20):r===1?(ft=wIe,mr=SIe,Z=257):(ft=bIe,mr=CIe,Z=0),ut=0,K=0,W=oe,F=m,Oe=xe,ke=0,L=-1,lt=1<<xe,U=lt-1,r===1&&lt>852||r===2&&lt>592)return 1;for(;;){hi=W-ke,v[K]+1<Z?(Gi=0,Ur=v[K]):v[K]>=Z?(Gi=mr[v[K]-Z],Ur=ft[v[K]-Z]):(Gi=96,Ur=0),R=1<<W-ke,x=1<<Oe,oe=x;do x-=R,f[F+(ut>>ke)+x]=hi<<24|Gi<<16|Ur|0;while(x!==0);for(R=1<<W-1;ut&R;)R>>=1;if(R!==0?(ut&=R-1,ut+=R):ut=0,K++,--zt[W]==0){if(W===ue)break;W=a[o+v[K]]}if(W>xe&&(ut&U)!==L){for(ke===0&&(ke=xe),F+=oe,Oe=W-ke,He=1<<Oe;Oe+ke<ue&&(He-=zt[Oe+ke],!(He<=0));)Oe++,He<<=1;if(lt+=1<<Oe,r===1&&lt>852||r===2&&lt>592)return 1;L=ut&U,f[L]=xe<<24|Oe<<16|F-m|0}}return ut!==0&&(f[F+ut]=W-ke<<24|64<<16|0),w.bits=xe,0};let{Z_FINISH:tse,Z_BLOCK:TIe,Z_TREES:fD,Z_OK:t_,Z_STREAM_END:RIe,Z_NEED_DICT:xIe,Z_STREAM_ERROR:Cu,Z_DATA_ERROR:nse,Z_MEM_ERROR:ise,Z_BUF_ERROR:AIe,Z_DEFLATED:rse}=ib,pD=16180,mD=16190,wm=16191,QG=16192,ZG=16194,gD=16199,vD=16200,eW=16206,Is=16209,sse=r=>(r>>>24&255)+(r>>>8&65280)+((65280&r)<<8)+((255&r)<<24);function IIe(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}let n_=r=>{if(!r)return 1;let a=r.state;return!a||a.strm!==r||a.mode<pD||a.mode>16211?1:0},ase=r=>{if(n_(r))return Cu;let a=r.state;return r.total_in=r.total_out=a.total=0,r.msg="",a.wrap&&(r.adler=1&a.wrap),a.mode=pD,a.last=0,a.havedict=0,a.flags=-1,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new Int32Array(852),a.distcode=a.distdyn=new Int32Array(592),a.sane=1,a.back=-1,t_},ose=r=>{if(n_(r))return Cu;let a=r.state;return a.wsize=0,a.whave=0,a.wnext=0,ase(r)},lse=(r,a)=>{let o;if(n_(r))return Cu;let c=r.state;return a<0?(o=0,a=-a):(o=5+(a>>4),a<48&&(a&=15)),a&&(a<8||a>15)?Cu:(c.window!==null&&c.wbits!==a&&(c.window=null),c.wrap=o,c.wbits=a,ose(r))},cse=(r,a)=>{if(!r)return Cu;let o=new IIe;r.state=o,o.strm=r,o.window=null,o.mode=pD;let c=lse(r,a);return c!==t_&&(r.state=null),c},tW,nW,dse=!0,NIe=r=>{if(dse){tW=new Int32Array(512),nW=new Int32Array(32);let a=0;for(;a<144;)r.lens[a++]=8;for(;a<256;)r.lens[a++]=9;for(;a<280;)r.lens[a++]=7;for(;a<288;)r.lens[a++]=8;for(W3(1,r.lens,0,288,tW,0,r.work,{bits:9}),a=0;a<32;)r.lens[a++]=5;W3(2,r.lens,0,32,nW,0,r.work,{bits:5}),dse=!1}r.lencode=tW,r.lenbits=9,r.distcode=nW,r.distbits=5},use=(r,a,o,c)=>{let f,m=r.state;return m.window===null&&(m.wsize=1<<m.wbits,m.wnext=0,m.whave=0,m.window=new Uint8Array(m.wsize)),c>=m.wsize?(m.window.set(a.subarray(o-m.wsize,o),0),m.wnext=0,m.whave=m.wsize):(f=m.wsize-m.wnext,f>c&&(f=c),m.window.set(a.subarray(o-c,o-c+f),m.wnext),(c-=f)?(m.window.set(a.subarray(o-c,o),0),m.wnext=c,m.whave=m.wsize):(m.wnext+=f,m.wnext===m.wsize&&(m.wnext=0),m.whave<m.wsize&&(m.whave+=f))),0};var OIe=(r,a)=>{let o,c,f,m,v,w,C,R,x,L,U,F,Z,W,K,oe,ue,xe,Oe,ke,He,lt,ut=0,ft=new Uint8Array(4),zt,$n,hi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(n_(r)||!r.output||!r.input&&r.avail_in!==0)return Cu;o=r.state,o.mode===wm&&(o.mode=QG),v=r.next_out,f=r.output,C=r.avail_out,m=r.next_in,c=r.input,w=r.avail_in,R=o.hold,x=o.bits,L=w,U=C,lt=t_;e:for(;;)switch(o.mode){case pD:if(o.wrap===0){o.mode=QG;break}for(;x<16;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(2&o.wrap&&R===35615){o.wbits===0&&(o.wbits=15),o.check=0,ft[0]=255&R,ft[1]=R>>>8&255,o.check=ro(o.check,ft,2,0),R=0,x=0,o.mode=16181;break}if(o.head&&(o.head.done=!1),!(1&o.wrap)||(((255&R)<<8)+(R>>8))%31){r.msg="incorrect header check",o.mode=Is;break}if((15&R)!==rse){r.msg="unknown compression method",o.mode=Is;break}if(R>>>=4,x-=4,He=8+(15&R),o.wbits===0&&(o.wbits=He),He>15||He>o.wbits){r.msg="invalid window size",o.mode=Is;break}o.dmax=1<<o.wbits,o.flags=0,r.adler=o.check=1,o.mode=512&R?16189:wm,R=0,x=0;break;case 16181:for(;x<16;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(o.flags=R,(255&La(o))!==rse){r.msg="unknown compression method",o.mode=Is;break}if(57344&La(o)){r.msg="unknown header flags set",o.mode=Is;break}o.head&&(o.head.text=R>>8&1),512&La(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=ro(o.check,ft,2,0)),R=0,x=0,o.mode=16182;case 16182:for(;x<32;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.head&&(o.head.time=R),512&La(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,ft[2]=R>>>16&255,ft[3]=R>>>24&255,o.check=ro(o.check,ft,4,0)),R=0,x=0,o.mode=16183;case 16183:for(;x<16;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.head&&(o.head.xflags=255&R,o.head.os=R>>8),512&La(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=ro(o.check,ft,2,0)),R=0,x=0,o.mode=16184;case 16184:if(1024&La(o)){for(;x<16;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.length=R,o.head&&(o.head.extra_len=R),512&La(o)&&4&o.wrap&&(ft[0]=255&R,ft[1]=R>>>8&255,o.check=ro(o.check,ft,2,0)),R=0,x=0}else o.head&&(o.head.extra=null);o.mode=16185;case 16185:if(1024&La(o)&&(F=o.length,F>w&&(F=w),F&&(o.head&&(He=o.head.extra_len-o.length,o.head.extra||(o.head.extra=new Uint8Array(o.head.extra_len)),o.head.extra.set(c.subarray(m,m+F),He)),512&La(o)&&4&o.wrap&&(o.check=ro(o.check,c,F,m)),w-=F,m+=F,o.length-=F),o.length))break e;o.length=0,o.mode=16186;case 16186:if(2048&La(o)){if(w===0)break e;F=0;do He=c[m+F++],o.head&&He&&o.length<65536&&(o.head.name+=String.fromCharCode(He));while(He&&F<w);if(512&La(o)&&4&o.wrap&&(o.check=ro(o.check,c,F,m)),w-=F,m+=F,He)break e}else o.head&&(o.head.name=null);o.length=0,o.mode=16187;case 16187:if(4096&La(o)){if(w===0)break e;F=0;do He=c[m+F++],o.head&&He&&o.length<65536&&(o.head.comment+=String.fromCharCode(He));while(He&&F<w);if(512&La(o)&&4&o.wrap&&(o.check=ro(o.check,c,F,m)),w-=F,m+=F,He)break e}else o.head&&(o.head.comment=null);o.mode=16188;case 16188:if(512&La(o)){for(;x<16;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(4&o.wrap&&R!==(65535&o.check)){r.msg="header crc mismatch",o.mode=Is;break}R=0,x=0}o.head&&(o.head.hcrc=La(o)>>9&1,o.head.done=!0),r.adler=o.check=0,o.mode=wm;break;case 16189:for(;x<32;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}r.adler=o.check=sse(R),R=0,x=0,o.mode=mD;case mD:if(o.havedict===0)return r.next_out=v,r.avail_out=C,r.next_in=m,r.avail_in=w,o.hold=R,o.bits=x,xIe;r.adler=o.check=1,o.mode=wm;case wm:if(a===TIe||a===fD)break e;case QG:if(o.last){R>>>=7&x,x-=7&x,o.mode=eW;break}for(;x<3;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}switch(o.last=1&R,R>>>=1,x-=1,3&R){case 0:o.mode=16193;break;case 1:if(NIe(o),o.mode=gD,a===fD){R>>>=2,x-=2;break e}break;case 2:o.mode=16196;break;case 3:r.msg="invalid block type",o.mode=Is}R>>>=2,x-=2;break;case 16193:for(R>>>=7&x,x-=7&x;x<32;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if((65535&R)!=(R>>>16^65535)){r.msg="invalid stored block lengths",o.mode=Is;break}if(o.length=65535&R,R=0,x=0,o.mode=ZG,a===fD)break e;case ZG:o.mode=16195;case 16195:if(F=o.length,F){if(F>w&&(F=w),F>C&&(F=C),F===0)break e;f.set(c.subarray(m,m+F),v),w-=F,m+=F,C-=F,v+=F,o.length-=F;break}o.mode=wm;break;case 16196:for(;x<14;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(o.nlen=257+(31&R),R>>>=5,x-=5,o.ndist=1+(31&R),R>>>=5,x-=5,o.ncode=4+(15&R),R>>>=4,x-=4,o.nlen>286||o.ndist>30){r.msg="too many length or distance symbols",o.mode=Is;break}o.have=0,o.mode=16197;case 16197:for(;o.have<o.ncode;){for(;x<3;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.lens[hi[o.have++]]=7&R,R>>>=3,x-=3}for(;o.have<19;)o.lens[hi[o.have++]]=0;if(o.lencode=o.lendyn,o.lenbits=7,zt={bits:o.lenbits},lt=W3(0,o.lens,0,19,o.lencode,0,o.work,zt),o.lenbits=zt.bits,lt){r.msg="invalid code lengths set",o.mode=Is;break}o.have=0,o.mode=16198;case 16198:for(;o.have<o.nlen+o.ndist;){for(;ut=o.lencode[R&(1<<o.lenbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=x);){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(ue<16)R>>>=K,x-=K,o.lens[o.have++]=ue;else{if(ue===16){for($n=K+2;x<$n;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(R>>>=K,x-=K,o.have===0){r.msg="invalid bit length repeat",o.mode=Is;break}He=o.lens[o.have-1],F=3+(3&R),R>>>=2,x-=2}else if(ue===17){for($n=K+3;x<$n;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}R>>>=K,x-=K,He=0,F=3+(7&R),R>>>=3,x-=3}else{for($n=K+7;x<$n;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}R>>>=K,x-=K,He=0,F=11+(127&R),R>>>=7,x-=7}if(o.have+F>o.nlen+o.ndist){r.msg="invalid bit length repeat",o.mode=Is;break}for(;F--;)o.lens[o.have++]=He}}if(o.mode===Is)break;if(o.lens[256]===0){r.msg="invalid code -- missing end-of-block",o.mode=Is;break}if(o.lenbits=9,zt={bits:o.lenbits},lt=W3(1,o.lens,0,o.nlen,o.lencode,0,o.work,zt),o.lenbits=zt.bits,lt){r.msg="invalid literal/lengths set",o.mode=Is;break}if(o.distbits=6,o.distcode=o.distdyn,zt={bits:o.distbits},lt=W3(2,o.lens,o.nlen,o.ndist,o.distcode,0,o.work,zt),o.distbits=zt.bits,lt){r.msg="invalid distances set",o.mode=Is;break}if(o.mode=gD,a===fD)break e;case gD:o.mode=vD;case vD:if(w>=6&&C>=258){r.next_out=v,r.avail_out=C,r.next_in=m,r.avail_in=w,o.hold=R,o.bits=x,EIe(r,U),v=r.next_out,f=r.output,C=r.avail_out,m=r.next_in,c=r.input,w=r.avail_in,R=o.hold,x=o.bits,o.mode===wm&&(o.back=-1);break}for(o.back=0;ut=o.lencode[R&(1<<o.lenbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=x);){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(oe&&!(240&oe)){for(xe=K,Oe=oe,ke=ue;ut=o.lencode[ke+((R&(1<<xe+Oe)-1)>>xe)],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(xe+K<=x);){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}R>>>=xe,x-=xe,o.back+=xe}if(R>>>=K,x-=K,o.back+=K,o.length=ue,oe===0){o.mode=16205;break}if(32&oe){o.back=-1,o.mode=wm;break}if(64&oe){r.msg="invalid literal/length code",o.mode=Is;break}o.extra=15&oe,o.mode=16201;case 16201:if(o.extra){for($n=o.extra;x<$n;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.length+=R&(1<<o.extra)-1,R>>>=o.extra,x-=o.extra,o.back+=o.extra}o.was=o.length,o.mode=16202;case 16202:for(;ut=o.distcode[R&(1<<o.distbits)-1],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(K<=x);){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(!(240&oe)){for(xe=K,Oe=oe,ke=ue;ut=o.distcode[ke+((R&(1<<xe+Oe)-1)>>xe)],K=ut>>>24,oe=ut>>>16&255,ue=65535&ut,!(xe+K<=x);){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}R>>>=xe,x-=xe,o.back+=xe}if(R>>>=K,x-=K,o.back+=K,64&oe){r.msg="invalid distance code",o.mode=Is;break}o.offset=ue,o.extra=15&oe,o.mode=16203;case 16203:if(o.extra){for($n=o.extra;x<$n;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}o.offset+=R&(1<<o.extra)-1,R>>>=o.extra,x-=o.extra,o.back+=o.extra}if(o.offset>o.dmax){r.msg="invalid distance too far back",o.mode=Is;break}o.mode=16204;case 16204:if(C===0)break e;if(F=U-C,o.offset>F){if(F=o.offset-F,F>o.whave&&o.sane){r.msg="invalid distance too far back",o.mode=Is;break}F>o.wnext?(F-=o.wnext,Z=o.wsize-F):Z=o.wnext-F,F>o.length&&(F=o.length),W=o.window}else W=f,Z=v-o.offset,F=o.length;F>C&&(F=C),C-=F,o.length-=F;do f[v++]=W[Z++];while(--F);o.length===0&&(o.mode=vD);break;case 16205:if(C===0)break e;f[v++]=o.length,C--,o.mode=vD;break;case eW:if(o.wrap){for(;x<32;){if(w===0)break e;w--,R|=c[m++]<<x,x+=8}if(U-=C,r.total_out+=U,o.total+=U,4&o.wrap&&U&&(r.adler=o.check=La(o)?ro(o.check,f,U,v-U):M3(o.check,f,U,v-U)),U=C,4&o.wrap&&(La(o)?R:sse(R))!==o.check){r.msg="incorrect data check",o.mode=Is;break}R=0,x=0}o.mode=16207;case 16207:if(o.wrap&&La(o)){for(;x<32;){if(w===0)break e;w--,R+=c[m++]<<x,x+=8}if(4&o.wrap&&R!==(4294967295&o.total)){r.msg="incorrect length check",o.mode=Is;break}R=0,x=0}o.mode=16208;case 16208:lt=RIe;break e;case Is:lt=nse;break e;case 16210:return ise;default:return Cu}return r.next_out=v,r.avail_out=C,r.next_in=m,r.avail_in=w,o.hold=R,o.bits=x,(o.wsize||U!==r.avail_out&&o.mode<Is&&(o.mode<eW||a!==tse))&&use(r,r.output,r.next_out,U-r.avail_out),L-=r.avail_in,U-=r.avail_out,r.total_in+=L,r.total_out+=U,o.total+=U,4&o.wrap&&U&&(r.adler=o.check=La(o)?ro(o.check,f,U,r.next_out-U):M3(o.check,f,U,r.next_out-U)),r.data_type=o.bits+(o.last?64:0)+(o.mode===wm?128:0)+(o.mode===gD||o.mode===ZG?256:0),(L===0&&U===0||a===tse)&&lt===t_&&(lt=AIe),lt},Sm={inflateReset:ose,inflateReset2:lse,inflateResetKeep:ase,inflateInit:r=>cse(r,15),inflateInit2:cse,inflate:OIe,inflateEnd:r=>{if(n_(r))return Cu;let a=r.state;return a.window&&(a.window=null),r.state=null,t_},inflateGetHeader:(r,a)=>{if(n_(r))return Cu;let o=r.state;return 2&o.wrap?(o.head=a,a.done=!1,t_):Cu},inflateSetDictionary:(r,a)=>{let o=a.length,c,f,m;return n_(r)?Cu:(c=r.state,c.wrap!==0&&c.mode!==mD?Cu:c.mode===mD&&(f=1,f=M3(f,a,o,0),f!==c.check)?nse:(m=use(r,a,o,o),m?(c.mode=16210,ise):(c.havedict=1,t_)))},inflateInfo:"pako inflate (from Nodeca project)"},PIe=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};let hse=Object.prototype.toString,{Z_NO_FLUSH:LIe,Z_FINISH:DIe,Z_OK:$3,Z_STREAM_END:iW,Z_NEED_DICT:rW,Z_STREAM_ERROR:kIe,Z_DATA_ERROR:fse,Z_MEM_ERROR:MIe}=ib;function K3(r){this.options=cD.assign({chunkSize:65536,windowBits:15,to:""},r||{});let a=this.options;a.raw&&a.windowBits>=0&&a.windowBits<16&&(a.windowBits=-a.windowBits,a.windowBits===0&&(a.windowBits=-15)),!(a.windowBits>=0&&a.windowBits<16)||r&&r.windowBits||(a.windowBits+=32),a.windowBits>15&&a.windowBits<48&&!(15&a.windowBits)&&(a.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zre,this.strm.avail_out=0;let o=Sm.inflateInit2(this.strm,a.windowBits);if(o!==$3)throw new Error(Jy[o]);if(this.header=new PIe,Sm.inflateGetHeader(this.strm,this.header),a.dictionary&&(typeof a.dictionary=="string"?a.dictionary=H3.string2buf(a.dictionary):hse.call(a.dictionary)==="[object ArrayBuffer]"&&(a.dictionary=new Uint8Array(a.dictionary)),a.raw&&(o=Sm.inflateSetDictionary(this.strm,a.dictionary),o!==$3)))throw new Error(Jy[o])}function sW(r,a){let o=new K3(a);if(o.push(r),o.err)throw o.msg||Jy[o.err];return o.result}K3.prototype.push=function(r,a){let o=this.strm,c=this.options.chunkSize,f=this.options.dictionary,m,v,w;if(this.ended)return!1;for(v=a===~~a?a:a===!0?DIe:LIe,hse.call(r)==="[object ArrayBuffer]"?o.input=new Uint8Array(r):o.input=r,o.next_in=0,o.avail_in=o.input.length;;){for(o.avail_out===0&&(o.output=new Uint8Array(c),o.next_out=0,o.avail_out=c),m=Sm.inflate(o,v),m===rW&&f&&(m=Sm.inflateSetDictionary(o,f),m===$3?m=Sm.inflate(o,v):m===fse&&(m=rW));o.avail_in>0&&m===iW&&o.state.wrap>0&&r[o.next_in]!==0;)Sm.inflateReset(o),m=Sm.inflate(o,v);switch(m){case kIe:case fse:case rW:case MIe:return this.onEnd(m),this.ended=!0,!1}if(w=o.avail_out,o.next_out&&(o.avail_out===0||m===iW))if(this.options.to==="string"){let C=H3.utf8border(o.output,o.next_out),R=o.next_out-C,x=H3.buf2string(o.output,C);o.next_out=R,o.avail_out=c-R,R&&o.output.set(o.output.subarray(C,C+R),0),this.onData(x)}else this.onData(o.output.length===o.next_out?o.output:o.output.subarray(0,o.next_out));if(m!==$3||w!==0){if(m===iW)return m=Sm.inflateEnd(this.strm),this.onEnd(m),this.ended=!0,!0;if(o.avail_in===0)break}}return!0},K3.prototype.onData=function(r){this.chunks.push(r)},K3.prototype.onEnd=function(r){r===$3&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=cD.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};var jIe={Inflate:K3,inflate:sW,inflateRaw:function(r,a){return(a=a||{}).raw=!0,sW(r,a)},ungzip:sW,constants:ib};let{Deflate:iat,deflate:UIe,deflateRaw:rat,gzip:sat}=_Ie,{Inflate:aat,inflate:FIe,inflateRaw:oat,ungzip:lat}=jIe;var BIe=UIe,VIe=FIe;let qs={getDisplayMedia:!1,getStreamFromExtension:!1,supportUnifiedPlan:!1,supportMinBitrate:!1,supportSetRtpSenderParameters:!1,supportDualStream:!0,webAudioMediaStreamDest:!1,supportReplaceTrack:!1,supportWebGL:!1,webAudioWithAEC:!1,supportRequestFrame:!1,supportShareAudio:!1,supportDualStreamEncoding:!1,supportDataChannel:!1,supportPCSetConfiguration:!1,supportWebRTCEncodedTransform:!1,supportWebRTCInsertableStream:!1,supportRequestVideoFrameCallback:!1,supportWebCrypto:!1};function Jn(){return qs}function pse(){return"setSinkId"in HTMLAudioElement.prototype&&(!ve("RESTRICTION_SET_PLAYBACK_DEVICE")||(b0()||Rne())&&!MH())}let js=function(r){return r.IOS_15_16_INTERRUPTION_START="ios15_16-interruption-start",r.IOS_15_16_INTERRUPTION_END="ios15_16-interruption-end",r.IOS_INTERRUPTION_START="ios-interruption-start",r.IOS_INTERRUPTION_END="ios-interruption-end",r.STATE_CHANGE="state-change",r}({});function ob(r,a,o){return{sampleRate:r,stereo:a,bitrate:o}}function ti(r,a,o,c,f){return{width:r,height:a,frameRate:o,bitrateMin:c,bitrateMax:f}}function Tu(r,a,o,c,f){return{width:{max:r},height:{max:a},frameRate:o,bitrateMin:c,bitrateMax:f}}function aW(r,a){return{numSpatialLayers:r,numTemporalLayers:a}}let zIe={"90p":ti(160,90),"90p_1":ti(160,90),"120p":ti(160,120,15,30,65),"120p_1":ti(160,120,15,30,65),"120p_3":ti(120,120,15,30,50),"120p_4":ti(212,120),"180p":ti(320,180,15,30,140),"180p_1":ti(320,180,15,30,140),"180p_3":ti(180,180,15,30,100),"180p_4":ti(240,180,15,30,120),"240p":ti(320,240,15,40,200),"240p_1":ti(320,240,15,40,200),"240p_3":ti(240,240,15,40,140),"240p_4":ti(424,240,15,40,220),"360p":ti(640,360,15,80,400),"360p_1":ti(640,360,15,80,400),"360p_3":ti(360,360,15,80,260),"360p_4":ti(640,360,30,80,600),"360p_6":ti(360,360,30,80,400),"360p_7":ti(480,360,15,80,320),"360p_8":ti(480,360,30,80,490),"360p_9":ti(640,360,15,80,800),"360p_10":ti(640,360,24,80,800),"360p_11":ti(640,360,24,80,1e3),"480p":ti(640,480,15,100,500),"480p_1":ti(640,480,15,100,500),"480p_2":ti(640,480,30,100,1e3),"480p_3":ti(480,480,15,100,400),"480p_4":ti(640,480,30,100,750),"480p_6":ti(480,480,30,100,600),"480p_8":ti(848,480,15,100,610),"480p_9":ti(848,480,30,100,930),"480p_10":ti(640,480,10,100,400),"720p":ti(1280,720,15,120,1130),"720p_auto":ti(1280,720,30,900,3e3),"720p_1":ti(1280,720,15,120,1130),"720p_2":ti(1280,720,30,120,2e3),"720p_3":ti(1280,720,30,120,1710),"720p_5":ti(960,720,15,120,910),"720p_6":ti(960,720,30,120,1380),"1080p":ti(1920,1080,15,120,2080),"1080p_1":ti(1920,1080,15,120,2080),"1080p_2":ti(1920,1080,30,120,3e3),"1080p_3":ti(1920,1080,30,120,3150),"1080p_5":ti(1920,1080,60,120,4780),"1440p":ti(2560,1440,30,120,4850),"1440p_1":ti(2560,1440,30,120,4850),"1440p_2":ti(2560,1440,60,120,7350),"4k":ti(3840,2160,30,120,8910),"4k_1":ti(3840,2160,30,120,8910),"4k_3":ti(3840,2160,60,120,13500)},yD=[{scaleResolutionDownBy:2,width:1280,height:720,frameRate:30,bitrateMin:300,bitrateMax:900},{scaleResolutionDownBy:1.333333,width:1280,height:720,frameRate:30,bitrateMin:600,bitrateMax:2e3},{scaleResolutionDownBy:1,width:1280,height:720,frameRate:30,bitrateMin:900,bitrateMax:3e3}],HIe={"480p":Tu(640,480,5),"480p_1":Tu(640,480,5),"480p_2":Tu(640,480,30),"480p_3":Tu(640,480,15),"720p":Tu(1280,720,5),"720p_auto":ti(1280,720,30,900,3e3),"720p_1":Tu(1280,720,5),"720p_2":Tu(1280,720,30),"720p_3":Tu(1280,720,15),"1080p":Tu(1920,1080,5),"1080p_1":Tu(1920,1080,5),"1080p_2":Tu(1920,1080,30),"1080p_3":Tu(1920,1080,15)},GIe={"1SL1TL":aW(1,1),"3SL3TL":aW(3,3),"2SL3TL":aW(2,3)};function zf(r){return r||(r="480p_1"),typeof r=="string"?Object.assign({},zIe[r]):r}function oW(r){return typeof r=="string"?Object.assign({},HIe[r]):r}function _D(r){return typeof r=="string"?Object.assign({},GIe[r]):r}let WIe={speech_low_quality:ob(16e3,!1),speech_standard:ob(32e3,!1,18),music_standard:ob(48e3,!1),standard_stereo:ob(48e3,!0,56),high_quality:ob(48e3,!1,128),high_quality_stereo:ob(48e3,!0,192)};function ED(r){return typeof r=="string"?Object.assign({},WIe[r]):r}let lb=[];function mse(r){return as(r,"mediaSource",["screen","window","application"]),!0}let Mt=function(r){return r.NEED_RENEGOTIATE="@need_renegotiate",r.NEED_REPLACE_TRACK="@need_replace_track",r.NEED_REPLACE_MIXING_TRACK="@need_replace_mixing_track",r.NEED_CLOSE="@need_close",r.NEED_ENABLE_TRACK="@need_enable_track",r.NEED_DISABLE_TRACK="@need_disable_track",r.NEED_SESSION_ID="@need_sid",r.SET_OPTIMIZATION_MODE="@set_optimization_mode",r.GET_STATS="@get_stats",r.GET_RTC_STATS="@get_rtc_stats",r.GET_LOW_VIDEO_TRACK="@get_low_video_track",r.NEED_RESET_REMOTE_SDP="@need_reset_remote_sdp",r.NEED_UPDATE_VIDEO_ENCODER="@need_update_video_encoder",r.NEED_UPDATE_VIDEO_SEND_PARAMETERS="@need_update_video_send_parameters",r.NEED_MUTE_TRACK="@need_mute_track",r.NEED_UNMUTE_TRACK="@need_unmute_track",r}({}),Hi=function(r){return r.SCREEN_TRACK="screen_track",r.CUSTOM_TRACK="custome_track",r.LOW_STREAM="low_stream",r}({}),cb=function(r){return r[r.HIGH_STREAM=0]="HIGH_STREAM",r[r.LOW_STREAM=1]="LOW_STREAM",r}({}),$Ie=function(r){return r[r.HIGH_STREAM=0]="HIGH_STREAM",r[r.LOW_STREAM=1]="LOW_STREAM",r}({}),KIe=function(r){return r[r.DISABLE=0]="DISABLE",r[r.LOW_STREAM=1]="LOW_STREAM",r[r.AUDIO_ONLY=2]="AUDIO_ONLY",r}({}),i_=function(r){return r.TRANSCEIVER_UPDATED="transceiver-updated",r.SEI_TO_SEND="sei-to-send",r.SEI_RECEIVED="sei-received",r.TRACK_UPDATED="track-updated",r}({}),db=function(r){return r.SOURCE_STATE_CHANGE="source-state-change",r.TRACK_ENDED="track-ended",r.BEAUTY_EFFECT_OVERLOAD="beauty-effect-overload",r.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",r.CLOSED="closed",r}({}),ub=function(r){return r.FIRST_FRAME_DECODED="first-frame-decoded",r.VIDEO_ELEMENT_VISIBLE_STATUS="video-element-visible-status",r.VIDEO_STATE_CHANGED="video-state-changed",r}({}),xc=function(r){return r.AUDIO_SOURCE_STATE_CHANGE="audio_source_state_change",r.RECEIVE_TRACK_BUFFER="receive_track_buffer",r.ON_AUDIO_BUFFER="on_audio_buffer",r.UPDATE_SOURCE="update_source",r}({});(function(r){r.UPDATE_TRACK_SOURCE="update-track-source"})({});let lW={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,sendJitterMs:0,sendRttMs:0,currentPacketLossRate:0},cW={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendJitterMs:0,sendRttMs:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,currentPacketLossRate:0},gse={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},qIe={uplinkNetworkQuality:0,downlinkNetworkQuality:0},vse={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0,currentPacketLossRate:0,publishDuration:-1},so=function(r){return r.ON_TRACK="on_track",r.ON_NODE="on_node",r}({}),Ac=function(r){return r.REQUEST_UPDATE_CONSTRAINTS="request_update_constraints",r.REQUEST_CONSTRAINTS="request_constraints",r}({}),q3=function(r){return r.IDLE="IDLE",r.INITING="INITING",r.INITEND="INITEND",r}({}),r_=function(r){return r.STATE_CHANGE="state_change",r.RECORDING_DEVICE_CHANGED="recordingDeviceChanged",r.PLAYOUT_DEVICE_CHANGED="playoutDeviceChanged",r.CAMERA_DEVICE_CHANGED="cameraDeviceChanged",r}({}),Da=function(r){return r.NONE="none",r.INIT="init",r.CANPLAY="canplay",r.PLAYING="playing",r.PAUSED="paused",r.SUSPEND="suspend",r.STALLED="stalled",r.WAITING="waiting",r.ERROR="error",r.DESTROYED="destroyed",r.ABORT="abort",r.ENDED="ended",r.EMPTIED="emptied",r.LOADEDDATA="loadeddata",r}({}),Hf=function(r){return r[r.VideoStateStopped=0]="VideoStateStopped",r[r.VideoStateStarting=1]="VideoStateStarting",r[r.VideoStateDecoding=2]="VideoStateDecoding",r[r.VideoStateFrozen=3]="VideoStateFrozen",r}({}),dW={uninit:100,none:110,init:120,loadeddata:130,canplay:200,playing:210,paused:220,suspend:300,stalled:310,waiting:320,error:330,destroyed:340,abort:350,ended:360,emptied:370},wD=function(r){return r.OPEN="open",r.MESSAGE="message",r.CLOSE="close",r.CLOSING="closing",r.ERROR="error",r}({});function yse(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function ir(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?yse(Object(o),!0).forEach(function(c){qe(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):yse(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function qe(r,a,o){return(a=function(c){var f=function(m,v){if(typeof m!="object"||m===null)return m;var w=m[Symbol.toPrimitive];if(w!==void 0){var C=w.call(m,"string");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)}(c);return typeof f=="symbol"?f:String(f)}(a))in r?Object.defineProperty(r,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[a]=o,r}function Qn(r,a,o,c,f){var m,v,w={};return Object.keys(c).forEach(function(C){w[C]=c[C]}),w.enumerable=!!w.enumerable,w.configurable=!!w.configurable,("value"in w||w.initializer)&&(w.writable=!0),w=_c(m=NAe(v=o.slice()).call(v)).call(m,function(C,R){return R(r,a,C)||C},w),f&&w.initializer!==void 0&&(w.value=w.initializer?w.initializer.call(f):void 0,w.initializer=void 0),w.initializer===void 0&&(Object.defineProperty(r,a,w),w=null),w}class _se extends nr{set _mediaStreamTrack(a){a!==this.mediaStreamTrack&&(this.safeEmit(i_.TRACK_UPDATED,a),this.mediaStreamTrack=a)}get _mediaStreamTrack(){return this.mediaStreamTrack}constructor(a,o){super(),qe(this,"trackMediaType",void 0),qe(this,"_ID",void 0),qe(this,"_rtpTransceiver",void 0),qe(this,"_lowRtpTransceiver",void 0),qe(this,"_hints",[]),qe(this,"_isClosed",!1),qe(this,"_originMediaStreamTrack",void 0),qe(this,"mediaStreamTrack",void 0),qe(this,"_external",{}),this._ID=o||Di(8,"track-"),this._originMediaStreamTrack=a,this.mediaStreamTrack=a,function(c){Tt(lb).call(lb,c)||lb.push(c)}(this)}toString(){return this._ID}getTrackId(){return this._ID}getMediaStreamTrack(a){return a||T0(()=>{var o;$t.reportApiInvoke(null,{name:$r.GET_MEDIA_STREAM_TRACK,options:[],tag:vr.TRACER}).onSuccess(((o=this._mediaStreamTrack)===null||o===void 0?void 0:o.label)||"")},this.mediaStreamTrack.id||this.getTrackId()),this._mediaStreamTrack}getRTCRtpTransceiver(a){return a===cb.LOW_STREAM?this._lowRtpTransceiver:this._rtpTransceiver}getMediaStreamTrackSettings(){return this.getMediaStreamTrack(!0).getSettings()}close(){this._isClosed=!0,this._lowRtpTransceiver=void 0,this._rtpTransceiver=void 0,function(a){let o=lb.indexOf(a);o!==-1&&lb.splice(o,1)}(this),this.emit(db.CLOSED),this.removeAllListeners(i_.SEI_RECEIVED)}_updateRtpTransceiver(a,o){if(o===cb.LOW_STREAM){if(this._lowRtpTransceiver===a)return;this._lowRtpTransceiver=a}else{if(this._rtpTransceiver===a)return;this._rtpTransceiver=a}this.emit(i_.TRANSCEIVER_UPDATED,a,o)}}class hb extends _se{get isExternalTrack(){return this._isExternalTrack}get muted(){return this._muted}get enabled(){return this._enabled}get processorContext(){return this._processorContext}constructor(a,o){super(a,o),qe(this,"_enabled",!0),qe(this,"_muted",!1),qe(this,"_isExternalTrack",!1),qe(this,"_isClosed",!1),qe(this,"_enabledMutex",void 0),qe(this,"processor",void 0),qe(this,"_processorContext",void 0),qe(this,"_handleTrackEnded",()=>{this.onTrackEnded()}),this._enabledMutex=new Ts("".concat(this.getTrackId())),a.addEventListener("ended",this._handleTrackEnded)}getTrackLabel(){var a,o;return(a=(o=this._originMediaStreamTrack)===null||o===void 0?void 0:o.label)!==null&&a!==void 0?a:""}close(){this._isClosed||(this.stop(),this._originMediaStreamTrack.stop(),this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack.stop(),this._mediaStreamTrack=null),this._originMediaStreamTrack=null,this._enabledMutex=null,z.debug("[".concat(this.getTrackId(),"] close")),this.emit(Mt.NEED_CLOSE),super.close())}async _updateOriginMediaStreamTrack(a,o){let c=arguments.length>2&&arguments[2]!==void 0&&arguments[2];this._isExternalTrack=c,a!==this._originMediaStreamTrack&&(this._originMediaStreamTrack&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),o&&this._originMediaStreamTrack.stop()),a.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=a,this._muted&&(this._originMediaStreamTrack.enabled=!1),this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Li(this,Mt.NEED_REPLACE_TRACK,this),this.processor&&this._processorContext&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this._processorContext}))}_getDefaultPlayerConfig(){return{}}onTrackEnded(){z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(db.TRACK_ENDED)}stateCheck(a,o){if(z.debug("check track state, [muted: ".concat(this._muted,", enabled: ").concat(this._enabled,"] to [").concat(a,": ").concat(o,"]")),fm(o,a),this._enabled&&this._muted&&a==="enabled"&&o===!1)throw new Ke(ce.TRACK_STATE_UNREACHABLE,"cannot set enabled while the track is muted").print("error",z);if(!this._enabled&&!this._muted&&a==="muted"&&o===!0)throw new Ke(ce.TRACK_STATE_UNREACHABLE,"cannot set muted while the track is disabled").print("error",z)}getProcessorStats(){return this._processorContext&&this._processorContext.gatherStats()||[]}getProcessorUsage(){return this._processorContext?this._processorContext.gatherUsage():Ct.resolve([])}}let Ese=window.AudioContext||window.webkitAudioContext,Ic=null,Si=new class extends nr{constructor(){super(...arguments),qe(this,"prevState",void 0),qe(this,"curState",void 0),qe(this,"currentTime",void 0),qe(this,"currentTimeStuckAt",void 0),qe(this,"interruptDetectorTrack",void 0),qe(this,"onLocalAudioTrackMute",()=>{z.info("ios15-interruption-start"),this.emit(js.IOS_15_16_INTERRUPTION_START)}),qe(this,"onLocalAudioTrackUnmute",async()=>{z.info("ios15-interruption-end"),this.curState!=="running"||this.duringInterruption?z.info("ios15-interruption-end-canceled"):(Ic&&await Ic.suspend(),this.emit(js.IOS_15_16_INTERRUPTION_END))})}get duringInterruption(){return this.prevState==="running"&&this.curState==="interrupted"}bindInterruptDetectorTrack(r){z.debug("webaudio bindInterruptDetectorTrack ".concat(r.getTrackId())),this.interruptDetectorTrack||(this.interruptDetectorTrack=r,this.interruptDetectorTrack._mediaStreamTrack.onmute=this.onLocalAudioTrackMute,this.interruptDetectorTrack._mediaStreamTrack.onunmute=this.onLocalAudioTrackUnmute)}unbindInterruptDetectorTrack(r){z.debug("webaudio unbindInterruptDetectorTrack ".concat(r.getTrackId())),this.interruptDetectorTrack&&this.interruptDetectorTrack===r&&(this.interruptDetectorTrack._mediaStreamTrack&&(this.interruptDetectorTrack._mediaStreamTrack.onmute=null,this.interruptDetectorTrack._mediaStreamTrack.onunmute=null),this.interruptDetectorTrack=void 0)}};function fb(){if(!Ic){if(function(){if(!Ese)return void z.error("your browser is not support web audio");z.info("create audio context");let r=ir({},ve("WEBAUDIO_INIT_OPTIONS"));z.debug("audio context init option:",JSON.stringify(r)),Ic=new Ese(r),Si.curState=Ic.state,Ic.onstatechange=()=>{Si.prevState=Si.curState,Si.curState=Ic?Ic.state:void 0;let{prevState:a,curState:o}=Si,c=o==="running",f=o==="interrupted",m=a==="running",v=a==="suspended",w=a==="interrupted",C=ni().osVersion;(ra()||fu())&&m&&f&&(z.info("ios".concat(C,"-interruption-start")),Si.emit(js.IOS_INTERRUPTION_START)),(ra()||fu())&&(v||w)&&c&&(z.info("ios".concat(C,"-interruption-end")),Si.emit(js.IOS_INTERRUPTION_END)),a!==o&&Si.emit(js.STATE_CHANGE,o,a)},setInterval(()=>{var a;let o=(a=Ic)===null||a===void 0?void 0:a.currentTime;Si.currentTime!==o?(Si.currentTimeStuckAt&&(z.debug("AudioContext current time resume at ".concat(o)),Si.currentTimeStuckAt=void 0),Si.currentTime=o):(o!==Si.currentTimeStuckAt&&($t.reportApiInvoke(null,{name:"WEB_AUDIO_CURRENT_TIME_STUCK",options:{currentTime:o},tag:vr.TRACER}).onSuccess(),z.warning("AudioContext current time stuck at ".concat(o))),Si.currentTimeStuckAt=o)},5e3),async function(a){let o=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","touchend","keydown","keyup"],c,f=!1,m=!1,v=!1;function w(W){a.state==="running"?C(!1):ra()||fu()?a.state==="suspended"&&(C(!0),W&&a.resume().then(R,R)):a.state!=="closed"&&(C(!0),W&&a.resume().then(R,R))}function C(W){if(f!==W){f=W;for(let K=0,oe=o;K<oe.length;K+=1){let ue=oe[K];W?window.addEventListener(ue,x,{capture:!0,passive:!0}):window.removeEventListener(ue,x,{capture:!0,passive:!0})}}}function R(){w(!1)}function x(){w(!0)}function L(W){if(!v)if(c.paused)if(W){let K;U(!1),v=!0;try{K=c.play(),K?K.then(F,F):(c.addEventListener("playing",F),c.addEventListener("abort",F),c.addEventListener("error",F))}catch{F()}}else U(!0);else U(!1)}function U(W){if(m!==W){m=W;for(let K=0,oe=o;K<oe.length;K++){let ue=oe[K];W?window.addEventListener(ue,Z,{capture:!0,passive:!0}):window.removeEventListener(ue,Z,{capture:!0,passive:!0})}}}function F(){c.removeEventListener("playing",F),c.removeEventListener("abort",F),c.removeEventListener("error",F),v=!1,L(!1)}function Z(){L(!0)}if(ra()){let W=a.createMediaStreamDestination(),K=document.createElement("div");K.innerHTML="<audio x-webkit-airplay='deny'></audio>",c=K.children.item(0),c.controls=!1,c.disableRemotePlayback=!0,c.preload="auto",c.srcObject=W.stream,L(!0)}Si.on(js.STATE_CHANGE,function(){w(!0)}),w(!1)}(Ic)}(),!Ic)throw new Ke(ce.NOT_SUPPORTED,"can not create audio context");return Ic}return Ic}function s_(r){if(function(){if(uW!==null)return uW;let c=fb(),f=c.createBufferSource(),m=c.createGain(),v=c.createGain();f.connect(m),f.connect(v),f.disconnect(m);let w=!1;try{f.disconnect(m)}catch{w=!0}return f.disconnect(),uW=w,w}())return;let a=r.connect,o=r.disconnect;r.connect=(c,f,m)=>{var v;return r._inputNodes||(r._inputNodes=[]),Tt(v=r._inputNodes).call(v,c)||(c instanceof AudioNode?(r._inputNodes.push(c),a.call(r,c,f,m)):a.call(r,c,f)),r},r.disconnect=(c,f,m)=>{o.call(r),c?L8(r._inputNodes,c):r._inputNodes=[];for(let v of r._inputNodes)a.call(r,v)}}let uW=null;function hW(r,a){let o=!1,c=1/a;if(ve("DISABLE_WEBAUDIO")){let f=window.setInterval(()=>{o?window.clearInterval(f):r(performance.now()/1e3)},1e3*c)}else{let f=fb(),m=f.createGain();m.gain.value=0,m.connect(f.destination);let v=()=>{if(o)return void(m=null);let w=f.createOscillator();w.onended=v,w.connect(m),w.start(0),w.stop(f.currentTime+c),r(f.currentTime)};v()}return()=>{o=!0}}class wse{constructor(){qe(this,"context",void 0),qe(this,"analyserNode",void 0),qe(this,"sourceNode",void 0),this.context=fb(),this.analyserNode=this.context.createAnalyser(),this.analyserNode.fftSize=2048,this.analyserNode.smoothingTimeConstant=.4}updateSource(a){if(a!==this.sourceNode){if(this.sourceNode)try{this.sourceNode.disconnect(this.analyserNode)}catch{}this.sourceNode=a,a==null||a.connect(this.analyserNode)}}getVolumeLevel(){if(!this.sourceNode||(!this.context||ra()||fu()||this.context.state!=="running"&&this.context.resume(),!this.analyserNode))return 0;let a=new Float32Array(this.analyserNode.fftSize);if(this.analyserNode.getFloatTimeDomainData)this.analyserNode.getFloatTimeDomainData(a);else{let c=new Uint8Array(this.analyserNode.fftSize);this.analyserNode.getByteTimeDomainData(c);for(let f=0;f<a.length;++f)a[f]=c[f]/128-1}let o=_c(a).call(a,(c,f)=>c+f*f,0)/a.length;return Math.max(10*Math.log10(o)+100,0)/100}getAnalyserNode(){return this.analyserNode}rebuildAnalyser(){try{var a,o;(a=this.sourceNode)===null||a===void 0||a.disconnect(this.analyserNode),this.analyserNode=this.context.createAnalyser(),this.analyserNode.fftSize=2048,this.analyserNode.smoothingTimeConstant=.4,(o=this.sourceNode)===null||o===void 0||o.connect(this.analyserNode)}catch{z.warning("rebuild analyser node failed.")}}destroy(){this.updateSource(void 0)}}class Sse extends nr{get processSourceNode(){return this.sourceNode}set processedNode(a){var o;if(!this.isDestroyed&&this._processedNode!==a){try{var c;(c=this.sourceNode)===null||c===void 0||c.disconnect(this.outputNode)}catch{}(o=this._processedNode)===null||o===void 0||o.disconnect(),this._processedNode=a,this.connect()}}get processedNode(){return this._processedNode}constructor(){super(),qe(this,"outputNode",void 0),qe(this,"outputTrack",void 0),qe(this,"isPlayed",!1),qe(this,"sourceNode",void 0),qe(this,"context",void 0),qe(this,"audioBufferNode",void 0),qe(this,"destNode",void 0),qe(this,"audioOutputLevel",0),qe(this,"volumeLevelAnalyser",void 0),qe(this,"_processedNode",void 0),qe(this,"playNode",void 0),qe(this,"isDestroyed",!1),qe(this,"onNoAudioInput",void 0),qe(this,"isNoAudioInput",!1),qe(this,"_noAudioInputCount",0),this.context=fb(),this.playNode=this.context.destination,this.outputNode=this.context.createGain(),s_(this.outputNode),this.volumeLevelAnalyser=new wse}startGetAudioBuffer(a){this.audioBufferNode||(this.audioBufferNode=this.context.createScriptProcessor(a),this.outputNode.connect(this.audioBufferNode),this.audioBufferNode.connect(this.context.destination),this.audioBufferNode.onaudioprocess=o=>{this.emit(xc.ON_AUDIO_BUFFER,function(c){for(let f=0;f<c.outputBuffer.numberOfChannels;f+=1){let m=c.outputBuffer.getChannelData(f);for(let v=0;v<m.length;v+=1)m[v]=0}return c.inputBuffer}(o))})}stopGetAudioBuffer(){this.audioBufferNode&&(this.audioBufferNode.onaudioprocess=null,this.outputNode.disconnect(this.audioBufferNode),this.audioBufferNode=void 0)}createOutputTrack(){if(!Jn().webAudioMediaStreamDest)throw new Ke(ce.NOT_SUPPORTED,"your browser is not support audio processor");return this.destNode&&this.outputTrack||(this.destNode=this.context.createMediaStreamDestination(),this.outputNode.connect(this.destNode),this.outputTrack=this.destNode.stream.getAudioTracks()[0]),this.outputTrack}play(a){this.context.state!=="running"&&D8(()=>{Si.emit("autoplay-failed")}),this.isPlayed=!0,this.playNode=a||this.context.destination,this.outputNode.connect(this.playNode)}stop(){if(this.isPlayed)try{this.outputNode.disconnect(this.playNode)}catch{}this.isPlayed=!1}getAccurateVolumeLevel(){return this.volumeLevelAnalyser.getVolumeLevel()}async checkHasAudioInput(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;if(a>5)return this.isNoAudioInput=!0,this.onNoAudioInput&&this.onNoAudioInput(),!1;ra()||fu()?this.context.state==="suspended"&&this.context.resume():this.context.state!=="running"&&this.context.resume();let o=this.volumeLevelAnalyser.getAnalyserNode(),c;o.getFloatTimeDomainData?(c=new Float32Array(o.fftSize),o.getFloatTimeDomainData(c)):(c=new Uint8Array(o.fftSize),o.getByteTimeDomainData(c));let f=!1;for(let m=0;m<c.length;m++)c[m]!==0&&(f=!0);return f?(this.isNoAudioInput=!1,!0):(await vs(200),await this.checkHasAudioInput(a?a+1:1)&&f)}getAudioVolume(){return this.outputNode.gain.value}setVolume(a){this.outputNode.gain.setValueAtTime(a,this.context.currentTime)}destroy(){this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0}disconnect(){var a,o;(a=this.processedNode)===null||a===void 0||a.disconnect(),(o=this.sourceNode)===null||o===void 0||o.disconnect(),this.outputNode&&this.outputNode.disconnect()}connect(){var a;this.processedNode?(a=this.processedNode)===null||a===void 0||a.connect(this.outputNode):this.sourceNode&&this.sourceNode.connect(this.outputNode),this.volumeLevelAnalyser.updateSource(this.outputNode)}}class bse extends Sse{get isFreeze(){return!1}constructor(a,o,c){var f;if(super(),qe(this,"sourceNode",void 0),qe(this,"track",void 0),qe(this,"clonedTrack",void 0),qe(this,"audioElement",void 0),qe(this,"isCurrentTrackCloned",!1),qe(this,"isRemoteTrack",!1),qe(this,"originVolumeLevelAnalyser",void 0),qe(this,"rebuildWebAudio",async()=>{if(z.debug("ready to rebuild web audio, state:",this.context.state),this.isNoAudioInput&&await this.checkHasAudioInput(),!this.isNoAudioInput||this.isDestroyed)return document.body.removeEventListener("click",this.rebuildWebAudio,!0),void z.debug("rebuild web audio success, current volume status",this.getAccurateVolumeLevel());this.context.resume().then(()=>z.info("resume success")),z.debug("rebuild web audio because of ios 12 bugs"),this.disconnect();let w=this.track;this.track=this.track.clone(),this.isCurrentTrackCloned?w.stop():this.isCurrentTrackCloned=!0;let C=new MediaStream([this.track]);this.sourceNode=this.context.createMediaStreamSource(C),s_(this.sourceNode),this.volumeLevelAnalyser.rebuildAnalyser();let R=this.outputNode.gain.value;this.outputNode=this.context.createGain(),this.outputNode.gain.setValueAtTime(R,this.context.currentTime),s_(this.outputNode),this.emit(xc.UPDATE_SOURCE),this.connect(),this.audioElement.srcObject=C,this.isPlayed&&this.play(this.playNode),this.checkHasAudioInput()}),a.kind!=="audio")throw new Ke(ce.UNEXPECTED_ERROR);this.track=a;let m=new MediaStream([this.track]);if(this.isRemoteTrack=!!o,this.sourceNode=this.context.createMediaStreamSource(m),s_(this.sourceNode),c){let w=c.clone();w.enabled=!0,this.clonedTrack=w,z.debug("create an unmuted track ".concat(w.id," from the original track ").concat(c.id," to get the volume"));let C=this.context.createMediaStreamSource(new MediaStream([w]));s_(C),this.originVolumeLevelAnalyser=new wse,this.originVolumeLevelAnalyser.updateSource(C)}this.connect(),this.audioElement=document.createElement("audio"),this.audioElement.srcObject=m;let v=ni();o&&v.os===ms.IOS&&Number((f=v.osVersion)===null||f===void 0?void 0:f.split(".")[0])<15&&(Si.on(js.STATE_CHANGE,()=>{this.context.state==="suspended"?document.body.addEventListener("click",this.rebuildWebAudio,!0):this.context.state==="running"&&this.rebuildWebAudio()}),this.checkHasAudioInput().then(w=>{w||document.body.addEventListener("click",this.rebuildWebAudio,!0)}))}updateTrack(a){this.sourceNode.disconnect(),this.track=a,this.isCurrentTrackCloned=!1;let o=new MediaStream([a]);this.sourceNode=this.context.createMediaStreamSource(o),s_(this.sourceNode),this.processedNode||this.sourceNode.connect(this.outputNode),this.emit(xc.UPDATE_SOURCE),this.audioElement.srcObject=o}destroy(){var a;this.audioElement.srcObject=null,this.audioElement.remove(),Si.off("state-change",this.rebuildWebAudio),(a=this.originVolumeLevelAnalyser)===null||a===void 0||a.destroy(),this.clonedTrack=void 0,super.destroy()}createMediaStreamSourceNode(a){return this.context.createMediaStreamSource(new MediaStream([a]))}updateOriginTrack(a){let o=a.clone();o.enabled=!0,this.clonedTrack&&(this.clonedTrack.stop(),this.clonedTrack=o),z.debug("create an unmuted track ".concat(o.id," from the original track ").concat(a.id," to get the volume"));let c=this.context.createMediaStreamSource(new MediaStream([o]));s_(c),this.originVolumeLevelAnalyser&&this.originVolumeLevelAnalyser.updateSource(c)}getOriginVolumeLevel(){return this.originVolumeLevelAnalyser?this.originVolumeLevelAnalyser.getVolumeLevel():this.getAccurateVolumeLevel()}}async function Cse(r,a,o){let c=(m,v)=>m?typeof m!="number"?m.max||m.exact||m.ideal||m.min||v:m:v,f={audio:!!o&&{mandatory:{chromeMediaSource:"desktop"}},video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:r,maxHeight:c(a.height,1080),maxWidth:c(a.width,1920)}}};return a.frameRate&&typeof a.frameRate!="number"?(f.video.mandatory.maxFrameRate=a.frameRate.max,f.video.mandatory.minFrameRate=a.frameRate.min):typeof a.frameRate=="number"&&(f.video.mandatory.maxFrameRate=a.frameRate),await navigator.mediaDevices.getUserMedia(f)}async function YIe(r,a){let o=await Tse(r.mediaSource),{sourceId:c,audio:f}=await function(m){let v=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return new Ct((w,C)=>{let R=document.createElement("div");R.innerText="share screen",R.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom: solid 1px #B9B8B9;");let x=document.createElement("div");x.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");let L=document.createElement("div");L.innerText="Agora Web Screensharing wants to share the contents of your screen with webdemo.agorabeckon.com. Choose what you'd like to share.",L.setAttribute("style","height: 12%;");let U=document.createElement("div");U.setAttribute("style","width: 100%; height: 80%; background: #FFF; border: solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");let F=document.createElement("div");F.setAttribute("style","display: flex; justify-content: space-between; padding: 16px 0;");let Z=document.createElement("button");Z.innerHTML="cancel",Z.setAttribute("style","width: 85px;"),Z.onclick=()=>{document.body.removeChild(oe);let ue=new Error("NotAllowedError");ue.name="NotAllowedError",C(ue)};let W=v,K=document.createElement("div");if(v){let ue=document.createElement("input");ue.setAttribute("type","checkbox");let xe=document.createElement("span");ue.setAttribute("style","margin-right: 6px;"),xe.innerText="Share audio",ue.checked=W,ue.onchange=()=>{W=ue.checked},K.appendChild(ue),K.appendChild(xe)}F.appendChild(K),F.appendChild(Z),x.appendChild(L),x.appendChild(U),x.appendChild(F);let oe=document.createElement("div");oe.setAttribute("style","position: fixed; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),oe.appendChild(R),oe.appendChild(x),document.body.appendChild(oe),m.map(ue=>{if(ue.id){let xe=document.createElement("div");xe.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;");let Oe=ue.thumbnail;try{let{width:ke}=Oe.getSize();ke>1920&&(Oe=Oe.resize({width:1920}))}catch(ke){throw ke&&ke.message.startsWith("Illegal invocation")&&console.error("Operate thumbnail error, please try to set contextIsolation: false. (https://github.com/electron/electron/issues/34953)"),ke}xe.innerHTML='<div style="height: 120px; display: table-cell; vertical-align: middle;"><img style="width: 100%; background: #333333; box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);" src='+Oe.toDataURL()+' /></div><span style=" height: 40px; line-height: 40px; display: inline-block; width: 70%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+ue.name.replace(/[\u00A0-\u9999<>\&]/g,function(ke){return"&#"+ke.charCodeAt(0)+";"})+"</span>",xe.onclick=()=>{document.body.removeChild(oe),w({sourceId:ue.id,audio:W})},U.appendChild(xe)}})})}(o,a);return await Cse(c,r,f)}async function Tse(r){let a=["window","screen"];r!=="application"&&r!=="window"||(a=["window"]),r==="screen"&&(a=["screen"]);let o=Hne();if(!o)throw console.error("failed to fetch electron, please mount it to window"),new Ke(ce.ELECTRON_IS_NULL);let c=null;try{var f;c=((f=o.desktopCapturer)===null||f===void 0?void 0:f.getSources({types:a}))||o.ipcRenderer.invoke("DESKTOP_CAPTURER_GET_SOURCES",{types:a})}catch{c=null}c&&c.then||(c=new Ct((m,v)=>{o.desktopCapturer.getSources({types:a},(w,C)=>{w?v(w):m(C)})}));try{return await c}catch(m){throw new Ke(ce.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR,m.toString())}}let fW=new Ts("safari"),Rse=!1,xse=!1;async function Nc(r,a){let o=0,c=null;for(;o<2;)try{c=await XIe(r,a,o>0);break}catch(f){if(f instanceof Ke)throw z.error("[".concat(a,"] ").concat(f.toString())),f;let m=SD(f.name||f.code||f,f.message);if(m.code===ce.MEDIA_OPTION_INVALID){z.debug("[".concat(a,"] detect media option invalid, retry")),o+=1,await vs(500);continue}throw z.error("[".concat(a,"] ").concat(m.toString())),m}if(!c)throw new Ke(ce.UNEXPECTED_ERROR,"can not find stream after getUserMedia");return c}async function XIe(r,a,o){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Ke(ce.NOT_SUPPORTED,"can not find getUserMedia");o&&(r.video&&(delete r.video.width,delete r.video.height),r.screen&&(delete r.screen.width,delete r.screen.height));let c=Jn(),f=new MediaStream;if(r.audioSource&&f.addTrack(r.audioSource),r.videoSource&&f.addTrack(r.videoSource),!r.audio&&!r.video&&!r.screen)return z.debug("Using Video Source/ Audio Source"),f;if(r.screen)if(Hne())r.screen.sourceId?pb(f,await Cse(r.screen.sourceId,r.screen,r.screenAudio)):pb(f,await YIe(r.screen,r.screenAudio));else if(b0()&&r.screen.extensionId&&r.screen.mandatory){if(!c.getStreamFromExtension)throw new Ke(ce.NOT_SUPPORTED,"This browser does not support screen sharing");z.debug("[".concat(a,'] Screen access on chrome stable, looking for extension"'));let U=await(v=r.screen.extensionId,w=a,new Ct((F,Z)=>{try{chrome.runtime.sendMessage(v,{getStream:!0},W=>{if(!W||!W.streamId)return z.error("[".concat(w,"] No response from Chrome Plugin. Plugin not installed properly"),W),void Z(new Ke(ce.CHROME_PLUGIN_NO_RESPONSE,"No response from Chrome Plugin. Plugin not installed properly"));F(W.streamId)})}catch(W){z.error("[".concat(w,"] AgoraRTC screensharing plugin is not accessible(").concat(v,")"),W.toString()),Z(new Ke(ce.CHROME_PLUGIN_NOT_INSTALL))}}));r.screen.mandatory.chromeMediaSourceId=U,pb(f,await navigator.mediaDevices.getUserMedia({video:{mandatory:r.screen.mandatory}}))}else if(c.getDisplayMedia){var m;r.screen.mediaSource&&mse(r.screen.mediaSource);let U={width:r.screen.width,height:r.screen.height,frameRate:r.screen.frameRate,displaySurface:(m=r.screen.displaySurface)!==null&&m!==void 0?m:r.screen.mediaSource==="screen"?"monitor":r.screen.mediaSource},{selfBrowserSurface:F,surfaceSwitching:Z,systemAudio:W}=r.screen,K={selfBrowserSurface:F,surfaceSwitching:Z,systemAudio:W};!F&&delete K.selfBrowserSurface,!Z&&delete K.surfaceSwitching,!W&&delete K.systemAudio,z.debug("[".concat(a,"] getDisplayMedia:"),JSON.stringify({video:U,audio:!!r.screenAudio,controls:K})),pb(f,await navigator.mediaDevices.getDisplayMedia(ir({video:U,audio:!!r.screenAudio},K)))}else{if(!Pi())throw z.error("[".concat(a,"] This browser does not support screenSharing")),new Ke(ce.NOT_SUPPORTED,"This browser does not support screen sharing");{r.screen.mediaSource&&mse(r.screen.mediaSource);let U={video:{mediaSource:r.screen.mediaSource,width:r.screen.width,height:r.screen.height,frameRate:r.screen.frameRate}};z.debug("[".concat(a,"] getUserMedia: ").concat(JSON.stringify(U))),pb(f,await navigator.mediaDevices.getUserMedia(U))}}var v,w;if(!r.video&&!r.audio)return f;let C={video:r.video,audio:r.audio},R=ve("MEDIA_DEVICE_CONSTRAINTS");if(R)try{typeof R=="string"&&(R=JSON.parse(R)),C=VH(C,R)}catch{}z.debug("[".concat(a,"] GetUserMedia"),JSON.stringify(C)),ni();let x,L=null;(gs()||ra()||O8())&&(L=await fW.lock());try{x=await navigator.mediaDevices.getUserMedia(C)}catch(U){throw L&&L(),U}return C.audio&&(Rse=!0),C.video&&(xse=!0),pb(f,x),L&&L(),f}function SD(r,a){switch(r){case"Starting video failed":case"OverconstrainedError":case"TrackStartError":return new Ke(ce.MEDIA_OPTION_INVALID,"".concat(r,": ").concat(a));case"NotFoundError":case"DevicesNotFoundError":return new Ke(ce.DEVICE_NOT_FOUND,"".concat(r,": ").concat(a));case"NotSupportedError":return new Ke(ce.NOT_SUPPORTED,"".concat(r,": ").concat(a));case"NotReadableError":return new Ke(ce.NOT_READABLE,"".concat(r,": ").concat(a));case"InvalidStateError":case"NotAllowedError":case"PERMISSION_DENIED":case"PermissionDeniedError":return new Ke(ce.PERMISSION_DENIED,"".concat(r,": ").concat(a));case"ConstraintNotSatisfiedError":return new Ke(ce.CONSTRAINT_NOT_SATISFIED,"".concat(r,": ").concat(a));default:return z.error("getUserMedia unexpected error",r),new Ke(ce.UNEXPECTED_ERROR,"".concat(r,": ").concat(a))}}function pb(r,a){let o=r.getVideoTracks()[0],c=r.getAudioTracks()[0],f=a.getVideoTracks()[0],m=a.getAudioTracks()[0];m&&(c&&r.removeTrack(c),r.addTrack(m)),f&&(o&&r.removeTrack(o),r.addTrack(f))}let Oc=new class extends nr{get state(){return this._state}set state(r){r!==this._state&&(this.emit(r_.STATE_CHANGE,r),this._state=r)}constructor(){super(),qe(this,"_state",q3.IDLE),qe(this,"isAccessMicrophonePermission",!1),qe(this,"isAccessCameraPermission",!1),qe(this,"lastAccessMicrophonePermission",!1),qe(this,"lastAccessCameraPermission",!1),qe(this,"checkdeviceMatched",!1),qe(this,"deviceInfoMap",new Map),this.init().then(()=>{navigator.mediaDevices.addEventListener&&navigator.mediaDevices.addEventListener("devicechange",this.updateDevicesInfo.bind(this)),window.setInterval(()=>{(ve("ENUMERATE_DEVICES_INTERVAL")||(P8()||N8()===ms.HARMONY_OS)&&C0())&&this.updateDevicesInfo()},ve("ENUMERATE_DEVICES_INTERVAL_TIME"))}).catch(r=>z.error(r.toString()))}async enumerateDevices(r,a){let o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return new Ke(ce.NOT_SUPPORTED,"enumerateDevices() not supported.").throw();let c=await navigator.mediaDevices.enumerateDevices(),f=this.checkMediaDeviceInfoIsOk(c),m=!this.isAccessMicrophonePermission&&r,v=!this.isAccessCameraPermission&&a;f.audio&&(m=!1),f.video&&(v=!1);let w=null,C=null,R=null;if(!o&&(m||v)){if(fW.isLocked&&(z.debug("[device manager] wait GUM lock"),(await fW.lock())(),z.debug("[device manager] GUM unlock")),Rse&&(m=!1,this.isAccessMicrophonePermission=!0),xse&&(v=!1,this.isAccessCameraPermission=!0),z.debug("[device manager] check media device permissions",r,a,m,v),m&&v){try{R=await navigator.mediaDevices.getUserMedia({audio:!0,video:!0})}catch(x){let L=SD(x.name||x.code||x,x.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessCameraPermission=!0,this.isAccessMicrophonePermission=!0}else if(m){try{w=await navigator.mediaDevices.getUserMedia({audio:r})}catch(x){let L=SD(x.name||x.code||x,x.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessMicrophonePermission=!0}else if(v){try{C=await navigator.mediaDevices.getUserMedia({video:a})}catch(x){let L=SD(x.name||x.code||x,x.message);if(L.code===ce.PERMISSION_DENIED)throw L;z.warning("getUserMedia failed in getDevices",L)}this.isAccessCameraPermission=!0}z.debug("[device manager] mic permission",r,"cam permission",a)}try{let x=await navigator.mediaDevices.enumerateDevices();return w&&w.getTracks().forEach(L=>L.stop()),C&&C.getTracks().forEach(L=>L.stop()),R&&R.getTracks().forEach(L=>L.stop()),w=null,C=null,R=null,x}catch(x){return w&&w.getTracks().forEach(L=>L.stop()),C&&C.getTracks().forEach(L=>L.stop()),R&&R.getTracks().forEach(L=>L.stop()),w=null,C=null,R=null,new Ke(ce.ENUMERATE_DEVICES_FAILED,x.toString()).throw()}}async getRecordingDevices(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!0,!1,r)).filter(a=>a.kind==="audioinput")}async getCamerasDevices(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!1,!0,r)).filter(a=>a.kind==="videoinput")}async getSpeakers(){let r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];return(await this.enumerateDevices(!0,!1,r)).filter(a=>a.kind==="audiooutput")}searchDeviceIdByName(r){let a=null;return this.deviceInfoMap.forEach(o=>{o.device.label===r&&(a=o.device.deviceId)}),a}async getDeviceById(r){let a=(await this.enumerateDevices(!0,!0,!0)).find(o=>o.deviceId===r);if(!a)throw new Ke(ce.DEVICE_NOT_FOUND,"deviceId: ".concat(r));return a}async init(){this.state=q3.INITING;try{await this.updateDevicesInfo(),this.state=q3.INITEND}catch(r){throw z.warning("Device Detection functionality cannot start properly.",r.toString()),this.state=q3.IDLE,(typeof isSecureContext=="boolean"?isSecureContext:location.protocol==="https:"||location.protocol==="file:"||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="::1")||new Ke(ce.WEB_SECURITY_RESTRICT,"Your context is limited by web security, please try using https protocol or localhost.").throw(),r}}async updateDevicesInfo(){let r=await this.enumerateDevices(!0,!0,!0),a=Date.now(),o=[];if(r[0]&&r[0].label&&this.checkdeviceMatched===!1){this.checkdeviceMatched=!0;let f=r.find(v=>v.kind==="audioinput"&&v.deviceId==="default"),m=r.find(v=>v.kind==="audiooutput"&&v.deviceId==="default");f&&m?m.groupId===f.groupId?z.debug("[device-check] default input ".concat(f.label," and output ").concat(m.label," is the same group")):z.warning("[device-check] default input ".concat(f.label," and output ").concat(m.label," is not the same group")):z.debug("[device-check] default input or output not found")}let c=this.checkMediaDeviceInfoIsOk(r);if(r.forEach(f=>{if(!f.deviceId)return;let m=this.deviceInfoMap.get("".concat(f.kind,"_").concat(f.deviceId));if((m?m.state:"INACTIVE")!=="ACTIVE"){let v={initAt:a,updateAt:a,device:f,state:"ACTIVE"};this.deviceInfoMap.set("".concat(f.kind,"_").concat(f.deviceId),v),o.push(v)}m&&(m.updateAt=a)}),this.deviceInfoMap.forEach((f,m)=>{f.state==="ACTIVE"&&f.updateAt!==a&&(f.state="INACTIVE",o.push(f))}),this.state!==q3.INITEND)return c.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),void(c.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0));o.forEach(f=>{switch(f.device.kind){case"audioinput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(r_.RECORDING_DEVICE_CHANGED,f);break;case"videoinput":this.lastAccessCameraPermission&&this.isAccessCameraPermission&&this.emit(r_.CAMERA_DEVICE_CHANGED,f);break;case"audiooutput":this.lastAccessMicrophonePermission&&this.isAccessMicrophonePermission&&this.emit(r_.PLAYOUT_DEVICE_CHANGED,f)}}),c.audio&&(this.lastAccessMicrophonePermission=!0,this.isAccessMicrophonePermission=!0),c.video&&(this.lastAccessCameraPermission=!0,this.isAccessCameraPermission=!0)}checkMediaDeviceInfoIsOk(r){let a=r.filter(f=>f.kind==="audioinput"),o=r.filter(f=>f.kind==="videoinput"),c={audio:!1,video:!1};for(let f of a)if(f.label&&f.deviceId){c.audio=!0;break}for(let f of o)if(f.label&&f.deviceId){c.video=!0;break}return c}},pW=!1,Pc=new class extends nr{constructor(){super(...arguments),qe(this,"onAutoplayFailed",void 0),qe(this,"onAudioAutoplayFailed",void 0)}};function Ase(){if(ni(),!pW){let r=a=>{a.preventDefault(),pW=!1,h3()?document.body.removeEventListener("click",r,!0):(document.body.removeEventListener("touchstart",r,!0),document.body.removeEventListener("mousedown",r,!0))};pW=!0,h3()?document.body.addEventListener("click",r,!0):(document.body.addEventListener("touchstart",r,!0),document.body.addEventListener("mousedown",r,!0)),z.info("detect media autoplay failed, document: https://docs.agora.io/cn/Voice/autoplay_policy_web_ng?platform=Web"),Pc.onAutoplayFailed?Pc.onAutoplayFailed():Pc.onAudioAutoplayFailed?z.warning(`AgoraRTC.onAudioAutoplayFailed has been deprecated in favor of AgoraRTC.onAutoplayFailed.
Please refer to the Agora document to migrate the newer API, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`):z.warning(`We have detected a media autoplay failed event, and found out that you haven't implemented AgoraRTC.onAutoplayFailed callback yet.
It will cause audio/video element not playing automatically on some browsers without user interaction, possibly hurting user experiences.
Please refer to the Agora document to properly handle autoplay failed event, https://docs.agora.io/en/Voice/autoplay_policy_web_ng?platform=Web .`),Pc.emit("autoplay-failed")}}function Ise(r,a,o,c){if(!r)return;let f=$t.getBaseInfoBySessionId(r);if(!f)return;let m=f.info,v=Date.now(),w=ir(ir({},m),{},{vid:m.vid===void 0?0:Number(m.vid),lts:v,elapse:v-f.startTime,cbRegistered:Pc.onAutoplayFailed||Pc.onAudioAutoplayFailed?1:-1,errorMsg:o,mediaType:a,trackId:c,extend:void 0});$t.send({type:fr.AUTOPLAY_FAILED,data:w},!0)}let JIe=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","error"],Oo=new class{constructor(){qe(this,"onAutoplayFailed",void 0),qe(this,"elementMap",new Map),qe(this,"elementStateMap",new Map),qe(this,"elementsNeedToResume",[]),qe(this,"sinkIdMap",new Map),qe(this,"autoResumeAfterInterruption",r=>{Array.from(this.elementMap.entries()).forEach(a=>{let[o,c]=a,f=this.elementStateMap.get(o),m=c.srcObject.getAudioTracks()[0],v=m&&m.readyState;if(z.debug("resume after interrupted, ele: ".concat(f," audio: ").concat(v," ").concat(r)),v==="live"){if(r)return c.pause(),void c.play();if(Si.curState==="running")return jS()?(c.pause(),void c.play()):void(f&&f==="paused"&&c.play())}})}),qe(this,"autoResumeAfterInterruptionOnIOS15_16",()=>{Array.from(this.elementMap.entries()).forEach(r=>{let[a,o]=r,c=o.srcObject.getAudioTracks()[0];c&&c.readyState==="live"&&(z.debug("auto resume after interruption inside autoResumeAfterInterruptionOnIOS15"),o.pause(),o.play())})}),this.autoResumeAudioElement(),Si.on(js.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.on(js.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),Si.on(js.STATE_CHANGE,()=>{ra()&&Si.prevState==="suspended"&&Si.curState==="running"&&this.autoResumeAfterInterruption()})}async setSinkID(r,a){let o=this.elementMap.get(r);if(this.sinkIdMap.set(r,a),o)try{await o.setSinkId(a)}catch(c){throw new Ke(ce.PERMISSION_DENIED,"can not set sink id: "+c.toString())}}play(r,a,o,c){if(this.elementMap.has(a))return;let f=document.createElement("audio");f.autoplay=!0,f.srcObject=new MediaStream([r]),this.bindAudioElementEvents(a,f),this.elementMap.set(a,f),this.elementStateMap.set(a,Da.INIT),this.setVolume(a,o);let m=this.sinkIdMap.get(a);if(m)try{f.setSinkId(m).catch(w=>{z.warning("[".concat(a,"] set sink id failed"),w.toString())})}catch(w){z.warning("[".concat(a,"] set sink id failed"),w.toString())}let v=f.play();v&&v.then&&v.catch(w=>{c&&Ise(c,"audio",w.message,a),z.warning("audio element play warning",w.toString()),this.elementMap.has(a)&&w.name==="NotAllowedError"&&(z.warning("detected audio element autoplay failed"),this.elementsNeedToResume.push(f),D8(()=>{this.onAutoplayFailed&&this.onAutoplayFailed(),Ase()}))})}updateTrack(r,a){let o=this.elementMap.get(r);o&&(o.srcObject=new MediaStream([a]))}isPlaying(r){return this.elementMap.has(r)&&this.elementStateMap.get(r)==="playing"}setVolume(r,a){let o=this.elementMap.get(r);o&&(a=Math.max(0,Math.min(100,a)),o.volume=a/100)}stop(r){let a=this.elementMap.get(r);if(this.sinkIdMap.delete(r),!a)return;let o=this.elementsNeedToResume.indexOf(a);this.elementsNeedToResume.splice(o,1),a.srcObject=null,a.remove(),this.elementMap.delete(r),this.elementStateMap.delete(r)}bindAudioElementEvents(r,a){JIe.forEach(o=>{a.addEventListener(o,c=>{let f=this.elementStateMap.get(r),m=c.type==="pause"?"paused":c.type;if(z.debug("[".concat(r,"] audio-element-status change ").concat(f," => ").concat(m)),c.type==="error"){let v=a==null?void 0:a.error;v&&z.error("[".concat(r,"] media error, code: ").concat(v.code,", message: ").concat(v.message))}this.elementStateMap.set(r,m)})})}getPlayerState(r){return this.elementStateMap.get(r)||"uninit"}autoResumeAudioElement(){let r=()=>{this.elementsNeedToResume.forEach(a=>{a.play().then(o=>{z.debug("Auto resume audio element success")}).catch(o=>{z.warning("Auto resume audio element failed!",o)})}),this.elementsNeedToResume=[]};new Ct(a=>{document.body?a():window.addEventListener("load",()=>a())}).then(()=>{h3()?document.body.addEventListener("click",r,!0):(document.body.addEventListener("touchstart",r,!0),document.body.addEventListener("mousedown",r,!0))})}};function Or(){return function(r,a,o){let c=o.value;return typeof c=="function"&&(o.value=function(){this._isClosed&&new Ke(ce.INVALID_OPERATION,"[".concat(this.getTrackId(),"] cannot operate a closed track")).print("warning",z);for(var f=arguments.length,m=new Array(f),v=0;v<f;v++)m[v]=arguments[v];let w=c.apply(this,m);return w instanceof Ct?new Ct((C,R)=>{w.then(C).catch(R)}):w}),o}}class Nse extends nr{constructor(a){super(),qe(this,"name","VideoProcessorDestination"),qe(this,"ID","0"),qe(this,"_source",void 0),qe(this,"videoContext",void 0),qe(this,"inputTrack",void 0),this.videoContext=a}get kind(){return"video"}get enabled(){return!0}pipe(){throw new Ke(ce.NOT_SUPPORTED,"VideoProcessor cannot pipe to any other Processor")}unpipe(){throw new Ke(ce.NOT_SUPPORTED,"VideoProcessor cannot unpipe to any other Processor")}enable(){}disable(){}updateInput(a){if(a.context!==this.videoContext)throw new Error(`ProcessorContext passed to VideoTrack.processorDestination doesn't match it's belonging VideoTrack's context.
Probably you are making pipeline like this:
videoTrack1.pipe(processor).pipe(videoTrack2.processorDestination).`);a.track&&a.track!==this.inputTrack&&(this.videoContext.chained=!0,this.inputTrack=a.track,this.emit(so.ON_TRACK,a.track))}reset(){this.inputTrack=void 0,this.videoContext.chained=!1,this.emit(so.ON_TRACK,void 0)}}class Ose extends nr{set chained(a){this._chained=a}get chained(){return this._chained}constructor(a,o){super(),qe(this,"constraintsMap",new Map),qe(this,"statsRegistry",[]),qe(this,"usageRegistry",[]),qe(this,"trackId",void 0),qe(this,"direction",void 0),qe(this,"_chained",!1),this.trackId=a,this.direction=o}async getConstraints(){return await Kr(this,Ac.REQUEST_CONSTRAINTS)}async requestApplyConstraints(a,o){var c;return z.info("processor ".concat(o.name," requestApplyConstraints for ").concat(this.trackId)),a&&this.constraintsMap.set(o,a),Li(this,Ac.REQUEST_UPDATE_CONSTRAINTS,Array.from(Sh(c=this.constraintsMap).call(c)))}async requestRevertConstraints(a){var o;if(this.constraintsMap.has(a))return z.info("processor ".concat(a.name," requestRevertConstraints for ").concat(this.trackId)),this.constraintsMap.delete(a),Li(this,Ac.REQUEST_UPDATE_CONSTRAINTS,Array.from(Sh(o=this.constraintsMap).call(o)))}registerStats(a,o,c){this.statsRegistry.find(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o)||this.statsRegistry.push({processorName:a.name,processorID:a.ID,type:o,cb:c})}unregisterStats(a,o){let c=this.statsRegistry.findIndex(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o);c!==-1&&this.statsRegistry.splice(c,1)}gatherStats(){let a=[];for(let{processorID:o,processorName:c,type:f,cb:m}of this.statsRegistry)try{let v=m();a.push({processorID:o,processorName:c,type:f,stats:v})}catch(v){z.error(new Ke(ce.UNEXPECTED_ERROR,v.message))}return a}registerUsage(a,o){this.usageRegistry.find(c=>c.processorID===a.ID&&c.processorName===a.name)||this.usageRegistry.push({processorID:a.ID,processorName:a.name,cb:o})}unregisterUsage(a){let o=this.usageRegistry.findIndex(c=>c.processorID===a.ID&&c.processorName===a.name);o!==-1&&this.usageRegistry.splice(o,1)}async gatherUsage(){let a=[];if(!this.chained)return[];for(let{cb:o}of this.usageRegistry)try{let c=o();c instanceof Ct&&(c=await c),a.push(ir(ir({},c),{},{direction:this.direction}))}catch(c){z.error("gather extension usage error",c)}return a}getDirection(){return this.direction}}class Pse extends nr{constructor(a){super(),qe(this,"name","AudioProcessorDestination"),qe(this,"ID","0"),qe(this,"inputTrack",void 0),qe(this,"inputNode",void 0),qe(this,"audioProcessorContext",void 0),qe(this,"_source",void 0),this.audioProcessorContext=a}get kind(){return"audio"}get enabled(){return!0}pipe(){throw new Ke(ce.NOT_SUPPORTED,"AudioProcessorDestination cannot pipe to any other Processor")}unpipe(){throw new Ke(ce.NOT_SUPPORTED,"AudioProcessor cannot unpipe to any other Processor")}enable(){}disable(){}reset(){this.inputTrack=void 0,this.inputNode=void 0,this.audioProcessorContext.chained=!1,this.emit(so.ON_TRACK,void 0),this.emit(so.ON_NODE,void 0)}updateInput(a){if(a.context!==this.audioProcessorContext)throw new Error(`ProcessorContext passed to AudioTrack.processorDestination doesn't match it's belonging AudioTrack's context.
Probably you are making pipeline like this: audioTrack1.pipe(processor).pipe(audioTrack2.processorDestination).`);a.track&&this.inputTrack!==a.track&&(this.audioProcessorContext.chained=!0,this.inputTrack=a.track,this.emit(so.ON_TRACK,this.inputTrack)),a.node&&this.inputNode!==a.node&&(this.audioProcessorContext.chained=!0,this.inputNode=a.node,this.emit(so.ON_NODE,this.inputNode))}}class Lse extends nr{set chained(a){this._chained=a}get chained(){return this._chained}constructor(a,o,c){super(),qe(this,"constraintsMap",new Map),qe(this,"statsRegistry",[]),qe(this,"audioContext",void 0),qe(this,"trackId",void 0),qe(this,"direction",void 0),qe(this,"usageRegistry",[]),qe(this,"_chained",!1),this.audioContext=a,this.trackId=o,this.direction=c}async getConstraints(){return Kr(this,Ac.REQUEST_CONSTRAINTS)}getAudioContext(){return this.audioContext}async requestApplyConstraints(a,o){var c;return z.info("processor ".concat(o.name," requestApplyConstraints for ").concat(this.trackId)),a&&this.constraintsMap.set(o,a),Li(this,Ac.REQUEST_UPDATE_CONSTRAINTS,Array.from(Sh(c=this.constraintsMap).call(c)))}async requestRevertConstraints(a){var o;if(this.constraintsMap.has(a))return this.constraintsMap.delete(a),Li(this,Ac.REQUEST_UPDATE_CONSTRAINTS,Array.from(Sh(o=this.constraintsMap).call(o)))}registerStats(a,o,c){this.statsRegistry.find(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o)||this.statsRegistry.push({processorName:a.name,processorID:a.ID,type:o,cb:c})}unregisterStats(a,o){let c=this.statsRegistry.findIndex(f=>f.processorID===a.ID&&f.processorName===a.name&&f.type===o);c!==-1&&this.statsRegistry.splice(c,1)}gatherStats(){let a=[];for(let{processorID:o,processorName:c,type:f,cb:m}of this.statsRegistry)try{let v=m();a.push({processorID:o,processorName:c,type:f,stats:v})}catch(v){z.error(new Ke(ce.UNEXPECTED_ERROR,v.message))}return a}registerUsage(a,o){this.usageRegistry.find(c=>c.processorID===a.ID&&c.processorName===a.name)||this.usageRegistry.push({processorID:a.ID,processorName:a.name,cb:o})}unregisterUsage(a){let o=this.usageRegistry.findIndex(c=>c.processorID===a.ID&&c.processorName===a.name);o!==-1&&this.usageRegistry.splice(o,1)}async gatherUsage(){let a=[];if(!this.chained)return[];for(let{cb:o}of this.usageRegistry)try{let c=o();c instanceof Ct&&(c=await c),a.push(ir(ir({},c),{},{direction:this.direction}))}catch(c){z.error("gather extension usage error",c)}return a}getDirection(){return this.direction}}class mW extends nr{get isPlayed(){return!0}get isFreeze(){return!1}constructor(){super(),qe(this,"context",void 0),qe(this,"processSourceNode",void 0),qe(this,"outputTrack",void 0),qe(this,"processedNode",void 0),qe(this,"clonedTrack",void 0),qe(this,"outputNode",void 0),this.outputNode=new QIe}setVolume(){}createOutputTrack(){throw new Ke(ce.NOT_SUPPORTED,"can not create output MediaStreamTrack when WebAudio disabled")}getOriginVolumeLevel(){return 0}getAccurateVolumeLevel(){return 0}stopGetAudioBuffer(){}startGetAudioBuffer(){}play(){}stop(){}destroy(){}updateTrack(){}updateOriginTrack(){}createMediaStreamSourceNode(){}}class QIe{disconnect(){}connect(){}}function Dse(r){return new Ct((a,o)=>{let c=!1,f=document.createElement("video");f.setAttribute("autoplay",""),f.setAttribute("muted",""),f.muted=!0,f.autoplay=!0,f.setAttribute("playsinline",""),f.setAttribute("style","position: fixed; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(f);let m=ra()?"canplay":"playing";f.addEventListener(m,()=>{let v=f.videoWidth,w=f.videoHeight;!v&&Pi()||(c=!0,f.srcObject=null,f.remove(),a([v,w]))}),f.srcObject=new MediaStream([r]),f.play().catch(k8),setTimeout(()=>{c||(f.srcObject=null,f.remove(),a([f.videoWidth,f.videoHeight]))},4e3)})}function bD(r){let a={};r.facingMode&&(a.facingMode=r.facingMode),r.cameraId&&(a.deviceId={exact:r.cameraId});let o=zf(r.encoderConfig);return o.width!=null&&(a.width=o.width),o.height!=null&&(a.height=o.height),!Mne()&&o.frameRate&&(a.frameRate=o.frameRate),Rne()&&typeof a.frameRate=="object"&&(a.frameRate.max=60),Pi()&&(a.frameRate={ideal:30,max:30}),a}function kse(r){let a={};if(Mne()||(r.AGC!==void 0&&(a.autoGainControl=r.AGC),r.AEC!==void 0&&(a.echoCancellation=r.AEC),r.ANS!==void 0&&(a.noiseSuppression=r.ANS,b0()&&r.ANS&&(a.googHighpassFilter=r.ANS))),r.encoderConfig){let o=ED(r.encoderConfig);a.channelCount=o.stereo?2:1,a.sampleRate=o.sampleRate,a.sampleSize=o.sampleSize}return r.microphoneId&&(a.deviceId={exact:r.microphoneId}),P8()&&(a.sampleRate=void 0),a}let ZIe=r=>{let a=r._encoderConfig;if(!a)return;let{frameRate:o,width:c,height:f}=r.getMediaStreamTrackSettings(),{frameRate:m=o,width:v=c,height:w=f}=a;if(!m||!v||!w)return;v=zH(v),w=zH(w),m=zH(m);let{max:C,min:R}=function(F,Z,W){let K=200*Math.pow(W/15,.6)*Math.pow(F*Z/640/360,.75);return{min:Math.floor(K),max:Math.floor(4*K)}}(v,w,m),{bitrateMax:x,bitrateMin:L}=a||{};x||z.debug("calculate bitrate: [w: ".concat(v,", h: ").concat(w,", fps: ").concat(m,"] => [brMax: ").concat(x,", brMin: ").concat(L,"]"));let{maxFramerate:U}=ve("ENCODER_CONFIG_LIMIT");return U&&typeof U=="number"&&(m=Math.min(m,U)),{frameRate:m,bitrateMax:x||C,bitrateMin:L||R,scaleResolutionDownBy:1,scale:0}},Mse=async(r,a,o)=>await(async(c,f,m)=>{let v=function(R){let x=[];for(let L=0;L<R.length;L+=2)x.push(parseInt(R.slice(L,L+2),16));return Uint8Array.from(x)}(tie(""+f+m)).slice(0,16),w=v.slice(0,12),C=await window.crypto.subtle.importKey("raw",v,"AES-GCM",!0,["encrypt"]);return new Uint8Array(await window.crypto.subtle.encrypt({name:"AES-GCM",iv:w},C,c))})(r.buffer,a,o),gW=r=>{let a=document.createElement("canvas");return a.width=2,a.height=2,new Ct((o,c)=>{a.toBlob(async f=>{if(a.remove(),f){let m=await jse(f);o({buffer:m,width:a.width,height:a.height})}else c(new Ke(ce.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED))},r,1)})},jse=async r=>{let a=await r.arrayBuffer();return new Uint8Array(a)};var Use,Fse,Bse,Vse,zse,Hse,Gse,Wse,$se,Kse,qse,Yse,Xse,Jse,Qse,Zse,eae,tae,pr,nae,iae,rae,sae,aae,oae,Gf,lae,cae,dae,uae,hae,fae,pae,mae,gae,vae,yae,_ae,Eae,Ys;let br=(Use=hn({argsMap:(r,a)=>[r.getTrackId(),a],throttleTime:300}),Fse=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Bse=Or(),Vse=BS("LocalAudioTrack","_enabledMutex"),zse=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Hse=Or(),Gse=BS("LocalAudioTrack","_enabledMutex"),Wse=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),$se=Or(),Kse=Or(),qse=Or(),Yse=hn({argsMap:r=>[r.getTrackId()]}),Xse=Or(),Jse=hn({argsMap:r=>[r.getTrackId()]}),Qse=Or(),Zse=hn({argsMap:r=>[r.getTrackId()]}),eae=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),tae=hn({argsMap:r=>[r.getTrackId()]}),Qn((pr=class extends hb{get _source(){return this.initWebAudio()}set _source(r){this._trackSource=r}get processorContext(){return this._processorContext||(this._processorContext=this.initProcessor().processorContext),this._processorContext}get processorDestination(){return this._processorDestination||(this._processorDestination=this.initProcessor().processorDestination),this._processorDestination}get isPlaying(){return this._useAudioElement?Oo.isPlaying(this.getTrackId()):this._source.isPlayed}get __className__(){return"LocalAudioTrack"}constructor(r,a,o,c){super(r,o),qe(this,"trackMediaType","audio"),qe(this,"_encoderConfig",void 0),qe(this,"_trackSource",void 0),qe(this,"_enabled",!0),qe(this,"_volume",100),qe(this,"_useAudioElement",!0),qe(this,"_bypassWebAudio",!1),qe(this,"processor",void 0),qe(this,"_processorContext",void 0),qe(this,"_processorDestination",void 0),qe(this,"_getOriginVolumeLevel",void 0),this._encoderConfig=a,this._getOriginVolumeLevel=!!c,this._trackSource=new mW,ve("DISABLE_WEBAUDIO")&&(this._bypassWebAudio=!0),ve("LOCAL_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1),gs()&&!Ic?setTimeout(()=>this.initWebAudio()):this.initWebAudio()}setVolume(r){Ti(r,"volume",0,1e3),this._volume=r,this._source.setVolume(r/100),this._useAudioElement&&Oo.setVolume(this.getTrackId(),r);try{if(this._bypassWebAudio)return void z.debug("[".concat(this.getTrackId(),"] setVolume returned because no pass through WebAudio."));let a=this._source.createOutputTrack();this._mediaStreamTrack!==a&&(this._mediaStreamTrack=a,Li(this,Mt.NEED_REPLACE_TRACK,this).then(()=>{z.debug("[".concat(this.getTrackId(),"] replace web audio track success"))}).catch(o=>{z.warning("[".concat(this.getTrackId(),"] replace web audio track failed"),o)}))}catch{}}getVolumeLevel(){return this._muted&&this.enabled&&this._getOriginVolumeLevel?this._source.getOriginVolumeLevel():this._source.getAccurateVolumeLevel()}async setPlaybackDevice(r){if(!this._useAudioElement||!pse())throw new Ke(ce.NOT_SUPPORTED,"your browser does not support setting the audio output device");await Oo.setSinkID(this.getTrackId(),r)}async setEnabled(r,a,o){return this._setEnabled(r,a,o)}async _setEnabled(r,a,o){if(!o){if(r===this._enabled)return;this.stateCheck("enabled",r)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),r),r){this._originMediaStreamTrack.enabled=!0;try{o||(this._enabled=!0),await Li(this,Mt.NEED_ENABLE_TRACK,this),z.info("[".concat(this.getTrackId(),"] setEnabled to ").concat(r," success"))}catch(c){throw o||(this._enabled=!1),z.error("[".concat(this.getTrackId(),"] setEnabled to true error"),c.toString()),c}}else{this._originMediaStreamTrack.enabled=!1,o||(this._enabled=!1);try{await Li(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw o||(this._enabled=!0),z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}}}async setMuted(r){r!==this._muted&&(this.stateCheck("muted",r),this._muted=r,this._originMediaStreamTrack.enabled=!r,z.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(r)),r?await Li(this,Mt.NEED_MUTE_TRACK,this):await Li(this,Mt.NEED_UNMUTE_TRACK,this))}getStats(){return T0(()=>{z.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalAudioStats instead")},"localAudioTrackGetStatsWarning"),Ml(this,Mt.GET_STATS)||ir({},lW)}setAudioFrameCallback(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4096;if(!r)return this._source.removeAllListeners(xc.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(a),this._source.removeAllListeners(xc.ON_AUDIO_BUFFER),this._source.on(xc.ON_AUDIO_BUFFER,o=>r(o))}play(){z.debug("[".concat(this.getTrackId(),"] start audio playback")),this._useAudioElement?(z.debug("[".concat(this.getTrackId(),"] start audio playback in element")),Oo.play(this._mediaStreamTrack,this.getTrackId(),this._volume)):this._source.play()}stop(){z.debug("[".concat(this.getTrackId(),"] stop audio playback")),this._useAudioElement?Oo.stop(this.getTrackId()):this._source.stop()}close(){super.close(),this._processorDestination&&this.unbindProcessorDestinationEvents(this._processorDestination),this._processorContext&&this.unbindProcessorContextEvents(this._processorContext),this.unpipe(),this._processorDestination&&this._processorDestination._source&&this._processorDestination._source.unpipe(),this._source.destroy()}_updatePlayerSource(){let r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];z.debug("[".concat(this.getTrackId(),"] update player source track")),r&&this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&Oo.updateTrack(this.getTrackId(),this._mediaStreamTrack)}async _updateOriginMediaStreamTrack(r,a){this._originMediaStreamTrack!==r&&(this._originMediaStreamTrack&&(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),a&&this._originMediaStreamTrack.stop()),r.addEventListener("ended",this._handleTrackEnded),this._originMediaStreamTrack=r,this._muted&&(this._originMediaStreamTrack.enabled=!1),this.processor&&this._processorContext&&this.processor.updateInput({track:r,context:this._processorContext}),this._mediaStreamTrack!==this._source.outputTrack?(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Li(this,Mt.NEED_REPLACE_TRACK,this)):this._source.updateTrack(this._originMediaStreamTrack),this._getOriginVolumeLevel&&this._source.updateOriginTrack(r))}renewMediaStreamTrack(r){return Ct.resolve(void 0)}pipe(r){if(this._bypassWebAudio)throw new Ke(ce.INVALID_OPERATION,"Can not process AudioTrack when bypassWebAudio set to true.");if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),r}unpipe(){var r;if(!this.processor)return;let a=this.processor;(r=this._source.processSourceNode)===null||r===void 0||r.disconnect(),this.processor._source=!1,this.processor=void 0,a.reset()}bindProcessorDestinationEvents(r){r.on(so.ON_TRACK,async a=>{a?a!==this._mediaStreamTrack&&(this._mediaStreamTrack=a,this._updatePlayerSource(!1),this._source.processedNode=this._source.createMediaStreamSourceNode(a),await Li(this,Mt.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Li(this,Mt.NEED_REPLACE_TRACK,this))}),r.on(so.ON_NODE,a=>{this._source.processedNode=a})}unbindProcessorDestinationEvents(r){r.removeAllListeners(so.ON_TRACK),r.removeAllListeners(so.ON_NODE)}bindProcessorContextEvents(r){r.on(Ac.REQUEST_CONSTRAINTS,async a=>{a(this._originMediaStreamTrack.getSettings())})}unbindProcessorContextEvents(r){r.removeAllListeners(Ac.REQUEST_CONSTRAINTS)}initWebAudio(){return this._trackSource instanceof mW&&(this._trackSource=new bse(this._mediaStreamTrack,!1,this._getOriginVolumeLevel?this._mediaStreamTrack:void 0)),this._trackSource}initProcessor(){let r=new Lse(this._source.context,this.getTrackId(),"local"),a=new Pse(r);return this._processorContext=r,this._processorDestination=a,this.bindProcessorContextEvents(r),this.bindProcessorDestinationEvents(a),this._source.on(xc.UPDATE_SOURCE,()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:r})}),this._useAudioElement&&(this._useAudioElement=!1,this.isPlaying&&(Oo.stop(this.getTrackId()),this._source.play()),Li(this,Mt.NEED_REPLACE_MIXING_TRACK,this).then(()=>{z.debug("[".concat(this.getTrackId(),"] replace from origin track to web audio track success"))}).catch(o=>{z.warning("[".concat(this.getTrackId(),"] replace from origin track to web audio track failed"),o)})),{processorContext:r,processorDestination:a}}}).prototype,"setVolume",[Use],Object.getOwnPropertyDescriptor(pr.prototype,"setVolume"),pr.prototype),Qn(pr.prototype,"setPlaybackDevice",[Fse,Bse],Object.getOwnPropertyDescriptor(pr.prototype,"setPlaybackDevice"),pr.prototype),Qn(pr.prototype,"setEnabled",[Vse,zse,Hse],Object.getOwnPropertyDescriptor(pr.prototype,"setEnabled"),pr.prototype),Qn(pr.prototype,"setMuted",[Gse,Wse,$se],Object.getOwnPropertyDescriptor(pr.prototype,"setMuted"),pr.prototype),Qn(pr.prototype,"getStats",[Kse],Object.getOwnPropertyDescriptor(pr.prototype,"getStats"),pr.prototype),Qn(pr.prototype,"setAudioFrameCallback",[qse],Object.getOwnPropertyDescriptor(pr.prototype,"setAudioFrameCallback"),pr.prototype),Qn(pr.prototype,"play",[Yse,Xse],Object.getOwnPropertyDescriptor(pr.prototype,"play"),pr.prototype),Qn(pr.prototype,"stop",[Jse,Qse],Object.getOwnPropertyDescriptor(pr.prototype,"stop"),pr.prototype),Qn(pr.prototype,"close",[Zse],Object.getOwnPropertyDescriptor(pr.prototype,"close"),pr.prototype),Qn(pr.prototype,"pipe",[eae],Object.getOwnPropertyDescriptor(pr.prototype,"pipe"),pr.prototype),Qn(pr.prototype,"unpipe",[tae],Object.getOwnPropertyDescriptor(pr.prototype,"unpipe"),pr.prototype),pr),CD=(nae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),iae=Or(),rae=BS("MicrophoneAudioTrack","_enabledMutex"),sae=hn({argsMap:(r,a,o)=>[r.getTrackId(),a,o]}),aae=Or(),oae=hn({argsMap:r=>[r.getTrackId()]}),Qn((Gf=class extends br{get __className__(){return"MicrophoneAudioTrack"}constructor(r,a,o,c){super(r,a.encoderConfig?ED(a.encoderConfig):{},c,ve("GET_VOLUME_OF_MUTED_AUDIO_TRACK")),qe(this,"_config",void 0),qe(this,"_deviceName","default"),qe(this,"_constraints",void 0),qe(this,"_originalConstraints",void 0),qe(this,"_enabled",!0),this._config=a,this._constraints=o,this._originalConstraints=o,this._deviceName=r.label,typeof a.bypassWebAudio=="boolean"&&(this._bypassWebAudio=a.bypassWebAudio),(jS()||kH())&&Si.bindInterruptDetectorTrack(this)}async setDevice(r){if(z.info("[".concat(this.getTrackId(),"] start set device to ").concat(r)),this._enabled)try{let a=await Oc.getDeviceById(r),o={};o.audio=ir({},this._constraints),o.audio.deviceId={exact:r},this._originMediaStreamTrack.stop();let c=null;try{c=await Nc(o,this.getTrackId())}catch(f){throw z.error("[".concat(this.getTrackId(),"] setDevice failed"),f.toString()),c=await Nc({audio:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!1),f}await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!1),this._deviceName=a.label,this._config.microphoneId=r,this._constraints.deviceId={exact:r}}catch(a){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),a.toString()),a}else try{let a=await Oc.getDeviceById(r);this._deviceName=a.label,this._config.microphoneId=r,this._constraints.deviceId={exact:r}}catch(a){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),a.toString()),a}z.info("[".concat(this.getTrackId(),"] set device to ").concat(r," success"))}async setEnabled(r,a,o){if(a)return z.debug("[".concat(this.getTrackId(),"] setEnabled false (do not close microphone)")),await super._setEnabled(r);if(!o){if(r===this._enabled)return;this.stateCheck("enabled",r)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),r),ve("AUTO_RESET_AUDIO_ROUTE")&&(ra()||fu())){let v=navigator.audioSession;v&&(r||(v.type="playback"),v.type="auto")}if(!r){var c;this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),(c=this._source.clonedTrack)===null||c===void 0||c.stop(),o||(this._enabled=!1);try{await Li(this,Mt.NEED_DISABLE_TRACK,this)}catch(v){throw z.error("[".concat(this.getTrackId(),"] setEnabled false failed"),v.toString()),v}return}let f=ir({},this._constraints),m=Oc.searchDeviceIdByName(this._deviceName);m&&!f.deviceId&&(f.deviceId=m);try{o||(this._enabled=!0);let v=await Nc({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(v.getAudioTracks()[0],!1),await Li(this,Mt.NEED_ENABLE_TRACK,this)}catch(v){throw o||(this._enabled=!1),z.error("[".concat(this.getTrackId(),"] setEnabled true failed"),v.toString()),v}z.info("[".concat(this.getTrackId(),"] setEnabled success"))}close(){super.close(),(jS()||kH())&&Si.unbindInterruptDetectorTrack(this)}onTrackEnded(){if((ra()||fu())&&this._enabled&&!this._isClosed&&Si.duringInterruption){let r=async()=>{Si.off(js.IOS_INTERRUPTION_END,r),this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture microphone media device for interrupted iOS device.")),await this.setEnabled(!1),await this.setEnabled(!0))};Si.on(js.IOS_INTERRUPTION_END,r)}else z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(db.TRACK_ENDED)}async renewMediaStreamTrack(r){let a=r||this._constraints,o=Oc.searchDeviceIdByName(this._deviceName);if(o&&!a.deviceId&&(a.deviceId=o),this._constraints=a,this._enabled){this._originMediaStreamTrack.stop();let c=await Nc({audio:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(c.getAudioTracks()[0],!0)}}bindProcessorContextEvents(r){super.bindProcessorContextEvents(r),r.on(Ac.REQUEST_UPDATE_CONSTRAINTS,async(a,o,c)=>{try{let f=Object.assign({},this._originalConstraints,...a);await this.renewMediaStreamTrack(f),o()}catch(f){c(f)}})}unbindProcessorContextEvents(r){super.unbindProcessorContextEvents(r),r.removeAllListeners(Ac.REQUEST_UPDATE_CONSTRAINTS)}}).prototype,"setDevice",[nae,iae],Object.getOwnPropertyDescriptor(Gf.prototype,"setDevice"),Gf.prototype),Qn(Gf.prototype,"setEnabled",[rae,sae,aae],Object.getOwnPropertyDescriptor(Gf.prototype,"setEnabled"),Gf.prototype),Qn(Gf.prototype,"close",[oae],Object.getOwnPropertyDescriptor(Gf.prototype,"close"),Gf.prototype),Gf),e4e=(lae=hn({argsMap:(r,a)=>[r.getTrackId(),a,r.duration]}),cae=Or(),dae=hn({argsMap:r=>[r.getTrackId()]}),uae=Or(),hae=hn({argsMap:r=>[r.getTrackId()]}),fae=Or(),pae=hn({argsMap:r=>[r.getTrackId()]}),mae=Or(),gae=hn({argsMap:r=>[r.getTrackId()]}),vae=Or(),yae=hn({argsMap:r=>[r.getTrackId()]}),_ae=hn({argsMap:r=>[r.getTrackId()]}),Eae=Or(),Qn((Ys=class extends br{get __className__(){return"BufferSourceAudioTrack"}constructor(r,a,o,c){super(a.createOutputTrack(),o,c),qe(this,"source",void 0),qe(this,"_bufferSource",void 0),this._useAudioElement=!1,this.source=r,this._bufferSource=a,this._bufferSource.on(xc.AUDIO_SOURCE_STATE_CHANGE,f=>{this.safeEmit(db.SOURCE_STATE_CHANGE,f)});try{this._mediaStreamTrack=this._source.createOutputTrack()}catch{}}get currentState(){return this._bufferSource.currentState}get duration(){return this._bufferSource.duration}get playbackSpeed(){return this._bufferSource.playbackSpeed}getCurrentTime(){return this._bufferSource.currentTime}startProcessAudioBuffer(r){r&&this._bufferSource.updateOptions(r),this._bufferSource.startProcessAudioBuffer()}pauseProcessAudioBuffer(){this._bufferSource.pauseProcessAudioBuffer()}seekAudioBuffer(r){this._bufferSource.seekAudioBuffer(r)}resumeProcessAudioBuffer(){this._bufferSource.resumeProcessAudioBuffer()}stopProcessAudioBuffer(){this._bufferSource.stopProcessAudioBuffer()}close(){this.source=null,this._bufferSource.destroy(),super.close()}setAudioBufferPlaybackSpeed(r){Ti(r,"speed",0),this._bufferSource.setAudioBufferPlaybackSpeed(r)}}).prototype,"startProcessAudioBuffer",[lae,cae],Object.getOwnPropertyDescriptor(Ys.prototype,"startProcessAudioBuffer"),Ys.prototype),Qn(Ys.prototype,"pauseProcessAudioBuffer",[dae,uae],Object.getOwnPropertyDescriptor(Ys.prototype,"pauseProcessAudioBuffer"),Ys.prototype),Qn(Ys.prototype,"seekAudioBuffer",[hae,fae],Object.getOwnPropertyDescriptor(Ys.prototype,"seekAudioBuffer"),Ys.prototype),Qn(Ys.prototype,"resumeProcessAudioBuffer",[pae,mae],Object.getOwnPropertyDescriptor(Ys.prototype,"resumeProcessAudioBuffer"),Ys.prototype),Qn(Ys.prototype,"stopProcessAudioBuffer",[gae,vae],Object.getOwnPropertyDescriptor(Ys.prototype,"stopProcessAudioBuffer"),Ys.prototype),Qn(Ys.prototype,"close",[yae],Object.getOwnPropertyDescriptor(Ys.prototype,"close"),Ys.prototype),Qn(Ys.prototype,"setAudioBufferPlaybackSpeed",[_ae,Eae],Object.getOwnPropertyDescriptor(Ys.prototype,"setAudioBufferPlaybackSpeed"),Ys.prototype),Ys);class ns extends br{get __className__(){return"MixingAudioTrack"}get isActive(){for(let a of this.trackList)if(a._enabled&&!a._isClosed&&!a.muted)return!0;return!1}constructor(){let a=fb().createMediaStreamDestination();super(a.stream.getAudioTracks()[0],void 0,Di(8,"track-mix-")),qe(this,"trackList",void 0),qe(this,"destNode",void 0),this._useAudioElement=!1;try{this._mediaStreamTrack=this._source.createOutputTrack()}catch{}this.destNode=a,this.trackList=[]}hasAudioTrack(a){return this.trackList.indexOf(a)!==-1}addAudioTrack(a){this.trackList.indexOf(a)===-1?(z.debug("add ".concat(a.getTrackId()," to mixing track")),a._source.outputNode.connect(this.destNode),this.trackList.push(a),this.updateEncoderConfig()):z.debug("track ".concat(a.getTrackId()," is already added"))}removeAudioTrack(a){if(this.trackList.indexOf(a)!==-1){z.debug("remove ".concat(a.getTrackId()," from mixing track"));try{a._source.outputNode.disconnect(this.destNode)}catch{}L8(this.trackList,a),this.updateEncoderConfig()}}updateEncoderConfig(){let a={};this.trackList.forEach(o=>{o._encoderConfig&&((o._encoderConfig.bitrate||0)>(a.bitrate||0)&&(a.bitrate=o._encoderConfig.bitrate),(o._encoderConfig.sampleRate||0)>(a.sampleRate||0)&&(a.sampleRate=o._encoderConfig.sampleRate),(o._encoderConfig.sampleSize||0)>(a.sampleSize||0)&&(a.sampleSize=o._encoderConfig.sampleSize),o._encoderConfig.stereo&&(a.stereo=!0))}),this._encoderConfig=a}_updateRtpTransceiver(a){this._rtpTransceiver!==a&&(this._rtpTransceiver=a,this.trackList.forEach(o=>{o instanceof ns?o.emit(i_.TRANSCEIVER_UPDATED,a):o._updateRtpTransceiver(a)}))}}class t4e extends Sse{set currentState(a){a!==this._currentState&&(this._currentState=a,this.safeEmit(xc.AUDIO_SOURCE_STATE_CHANGE,this._currentState))}get currentState(){return this._currentState}constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),qe(this,"audioBuffer",void 0),qe(this,"sourceNode",void 0),qe(this,"startPlayTime",0),qe(this,"startPlayOffset",0),qe(this,"pausePlayTime",0),qe(this,"options",void 0),qe(this,"currentLoopCount",0),qe(this,"currentPlaybackSpeed",100),qe(this,"_currentState","stopped"),this.audioBuffer=a,this.options=o,this.startPlayOffset=this.options.startPlayTime||0}createWebAudioDiagram(){return this.context.createGain()}get duration(){return this.audioBuffer?this.audioBuffer.duration:0}get playbackSpeed(){return this.currentPlaybackSpeed}get currentTime(){return this.audioBuffer?this.currentState==="stopped"?0:this.currentState==="paused"?this.pausePlayTime:((this.context.currentTime-this.startPlayTime)*(this.playbackSpeed/100)+this.startPlayOffset)%this.audioBuffer.duration:0}updateOptions(a){this.currentState==="stopped"?(this.options=a,this.startPlayOffset=this.options.startPlayTime||0):z.warning("can not set audio source options")}startProcessAudioBuffer(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"}pauseProcessAudioBuffer(){this.sourceNode&&this.currentState==="playing"&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")}seekAudioBuffer(a){this.sourceNode&&(this.sourceNode.onended=null,this.currentState==="playing"&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),this.currentState==="playing"?(this.startPlayOffset=a,this.startSourceNode()):this.currentState==="paused"&&(this.pausePlayTime=a))}resumeProcessAudioBuffer(){this.currentState==="paused"&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")}stopProcessAudioBuffer(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch{}this.reset()}}destroy(){this.audioBuffer=null,super.destroy()}setAudioBufferPlaybackSpeed(a){this.sourceNode&&(this.currentState==="playing"&&(this.startPlayOffset=this.currentTime,this.startPlayTime=this.context.currentTime),this.sourceNode.playbackRate.value=a/100),this.currentPlaybackSpeed=a}startSourceNode(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))}createSourceNode(){let a=this.context.createBufferSource();return a.buffer=this.audioBuffer,a.loop=!!this.options.loop,a.connect(this.outputNode),a.playbackRate.value=this.currentPlaybackSpeed/100,a}handleSourceNodeEnded(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()}reset(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0}}let wae=new Map;class vW{get rendFrameRate(){if(this.renderStats&&this.renderStats.curTs!==this.renderStats.lastTs){let a=this.renderStats.curTs-this.renderStats.lastTs,o=(this.renderStats.renderNum-this.renderStats.lastRenderNum)/a;return this.renderStats.lastRenderNum=this.renderStats.renderNum,this.renderStats.lastTs=this.renderStats.curTs,o}return 0}get videoElementStatus(){return this._videoElementStatus}set videoElementStatus(a){a!==this._videoElementStatus&&(z.debug("[".concat(this.trackId,"] video-element-status change ").concat(this._videoElementStatus," => ").concat(a)),this._videoElementStatus=a)}get videoState(){return this._videoState}set videoState(a){var o;a!==this._videoState&&(this._videoState=a,(o=this.onVideoStateChanged)===null||o===void 0||o.call(this,this.videoState))}constructor(a){qe(this,"trackId",void 0),qe(this,"config",void 0),qe(this,"onFirstVideoFrameDecoded",void 0),qe(this,"onVideoStateChanged",void 0),qe(this,"freezeTimeCounterList",[]),qe(this,"renderFreezeAccTime",0),qe(this,"isKeepLastFrame",!1),qe(this,"timeUpdatedCount",0),qe(this,"freezeTime",0),qe(this,"playbackTime",0),qe(this,"lastTimeUpdatedTime",0),qe(this,"autoplayFailed",!1),qe(this,"videoTrack",void 0),qe(this,"videoElement",void 0),qe(this,"cacheVideoElement",void 0),qe(this,"renderStats",void 0),qe(this,"_videoState",Hf.VideoStateStopped),qe(this,"videoElementCheckInterval",void 0),qe(this,"videoElementFreezeTimeout",void 0),qe(this,"_videoElementStatus",Da.NONE),qe(this,"isGettingVideoDimensions",!1),qe(this,"startGetVideoDimensions",()=>{let o=()=>{if(this.isGettingVideoDimensions=!0,this.videoElement.videoWidth*this.videoElement.videoHeight>4)return z.debug("[".concat(this.trackId,"] current video dimensions:"),this.videoElement.videoWidth,this.videoElement.videoHeight),void(this.isGettingVideoDimensions=!1);setTimeout(o,500)};!this.isGettingVideoDimensions&&o()}),qe(this,"autoResumeAfterInterruption",()=>{this.videoTrack&&this.videoTrack.readyState==="live"&&Si.curState==="running"&&(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume for ").concat(Tne())),Dne()?(this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):(this.videoElement.pause(),this.videoElement.play()))}),qe(this,"handleVideoEvents",o=>{switch(o.type){case"play":case"playing":this.startGetVideoDimensions(),this.videoElementStatus=Da.PLAYING;break;case"loadeddata":if(this.videoState=Hf.VideoStateStarting,this.onFirstVideoFrameDecoded&&this.onFirstVideoFrameDecoded(),this.cacheVideoElement){try{this.cacheVideoElement.srcObject=null,this.cacheVideoElement.remove()}catch{}this.cacheVideoElement=void 0}break;case"canplay":this.videoElementStatus=Da.CANPLAY;break;case"stalled":this.videoElementStatus=Da.STALLED;break;case"suspend":this.videoElementStatus=Da.SUSPEND;break;case"pause":this.videoElementStatus=Da.PAUSED,ra()||fu()||gs()&&this.autoplayFailed||!this.videoTrack||this.videoTrack.readyState!=="live"||(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume")),this.videoElement.play());break;case"waiting":this.videoElementStatus=Da.WAITING;break;case"abort":this.videoElementStatus=Da.ABORT;break;case"ended":this.videoElementStatus=Da.ENDED;break;case"emptied":this.videoElementStatus=Da.EMPTIED;break;case"error":{let c=this.videoElement.error;c?(this.videoElementStatus=Da.ERROR,z.error("[".concat(this.trackId,"] media error: ").concat(c.message," (").concat(c.code,")"))):z.debug("[".concat(this.trackId,"] media not been an error."));break}case"timeupdate":{let c=performance.now();if(this.timeUpdatedCount+=1,this.timeUpdatedCount<10)return void(this.lastTimeUpdatedTime=c);let f=c-this.lastTimeUpdatedTime,m=this.lastTimeUpdatedTime;if(this.lastTimeUpdatedTime=c,bm.lastVisibleTime<bm.lastHiddenTime||m<bm.lastHiddenTime||m<bm.lastVisibleTime)return;for(f>ve("VIDEO_FREEZE_DURATION")&&(this.freezeTime+=f),this.playbackTime+=f;this.playbackTime>=6e3;){this.playbackTime-=6e3;let v=Math.min(6e3,this.freezeTime);this.freezeTimeCounterList.push(v),this.freezeTime=Math.max(0,this.freezeTime-6e3)}break}}}),qe(this,"autoResumeAfterInterruptionOnIOS15_16",()=>{this.videoTrack&&this.videoTrack.readyState==="live"&&(z.debug("[track-".concat(this.trackId,"] video element paused, auto resume for ").concat(Tne())),Dne()?(this.videoElement.srcObject=null,this.videoElement.srcObject=new MediaStream([this.videoTrack]),this.videoElement.play()):(this.videoElement.pause(),this.videoElement.play()))}),this.trackId=a.trackId,this.config=a,a.element instanceof HTMLVideoElement?this.videoElement=a.element:this.videoElement=document.createElement("video"),Si.on(js.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.on(js.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16)}getVideoElement(){return this.videoElement}getContainerElement(){var a;return(a=this.videoElement.parentElement)!==null&&a!==void 0?a:void 0}updateConfig(a){this.config=a,this.trackId=a.trackId,a.element!==this.videoElement&&(this.destroy(),this.videoElement=a.element),this.videoTrack&&this.initVideoElement()}updateVideoTrack(a){this.videoTrack!==a&&(this.videoTrack=a,this.initVideoElement())}play(a){let o=this.videoElement.play();o&&o.catch&&o.catch(f=>{a&&Ise(a,"video",f.message,this.trackId),f.name==="NotAllowedError"?(z.warning("detected video element autoplay failed",f),this.autoplayFailed=!0,this.handleAutoPlayFailed()):z.warning("[".concat(this.trackId,"] play warning: "),f)});let c=ni();if((c.name==="Safari"&&Number(c.version)===15||jS())&&o&&o.then){let f=()=>{this.config.mirror&&(this.videoElement.style.transform="rotateY(180deg)")};o.then(f).catch(f)}}getCurrentFrame(){let a=document.createElement("canvas");a.width=this.videoElement.videoWidth,a.height=this.videoElement.videoHeight;let o=a.getContext("2d");if(!o)return z.error("create canvas context failed!"),new ImageData(2,2);o.drawImage(this.videoElement,0,0,a.width,a.height);let c=o.getImageData(0,0,a.width,a.height);return a.remove(),c}async getCurrentFrameToUint8Array(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,c=document.createElement("canvas");c.width=this.videoElement.videoWidth,c.height=this.videoElement.videoHeight;let f=c.getContext("2d");return f?(f.drawImage(this.videoElement,0,0,c.width,c.height),new Ct((m,v)=>{c.toBlob(async w=>{if(c.remove(),w){let C=await jse(w);m({buffer:C,width:c.width,height:c.height})}else v(new Ke(ce.CONVERTING_VIDEO_FRAME_TO_BLOB_FAILED))},a,o<0?.1:o>1?1:o)})):await gW(a)}destroy(){this.renderStats=void 0,Si.off(js.IOS_INTERRUPTION_END,this.autoResumeAfterInterruption),Si.off(js.IOS_15_16_INTERRUPTION_END,this.autoResumeAfterInterruptionOnIOS15_16),this.videoElement.srcObject=null,this.resetVideoElement(),this.freezeTimeCounterList=[],this.videoState=Hf.VideoStateStopped}initVideoElement(){if(this.videoElementStatus=Da.INIT,!this.videoElementCheckInterval&&(Sae.forEach(m=>{this.videoElement.addEventListener(m,this.handleVideoEvents)}),this.videoElementCheckInterval=window.setInterval(()=>{(function(m){return m!==document.body&&document.body.contains(m)})(this.videoElement)||(this.videoElementStatus=Da.DESTROYED)},1e3),ve("ENABLE_VIDEO_FRAME_CALLBACK"))){var a,o;let m,v=()=>{document.visibilityState==="visible"&&(document.removeEventListener("visibilitychange",v),this.videoElementFreezeTimeout=window.setTimeout(w,ve("VIDEO_FREEZE_DURATION")))},w=()=>{this.videoElementFreezeTimeout=void 0,this.videoState===Hf.VideoStateDecoding&&(document.visibilityState==="visible"?this.videoState=Hf.VideoStateFrozen:document.addEventListener("visibilitychange",v))},C=(R,x)=>{if(this.videoElementStatus===Da.PLAYING){if(this.renderStats?(this.renderStats.renderNum++,this.renderStats.curTs=x.mediaTime):this.renderStats={lastTs:x.mediaTime,curTs:x.mediaTime,lastRenderNum:0,renderNum:0},m){let F=x.presentationTime-m.presentationTime;this.videoState===Hf.VideoStateStarting&&(this.videoState=Hf.VideoStateDecoding),this.videoState===Hf.VideoStateDecoding&&this.onVideoStateChanged&&(this.videoElementFreezeTimeout&&window.clearTimeout(this.videoElementFreezeTimeout),this.videoElementFreezeTimeout=window.setTimeout(w,ve("VIDEO_FREEZE_DURATION"))),F<ve("VIDEO_FREEZE_DURATION")&&this.videoState===Hf.VideoStateFrozen&&(this.videoState=Hf.VideoStateDecoding),F>ve("VIDEO_FREEZE_DURATION")&&bm.lastVisibleTime>=bm.lastHiddenTime&&m.timestamp>bm.lastVisibleTime&&m.timestamp>bm.lastHiddenTime&&(this.renderFreezeAccTime+=F)}m=ir(ir({},x),{},{timestamp:R})}var L,U;ve("ENABLE_VIDEO_FRAME_CALLBACK")&&((L=(U=this.videoElement).requestVideoFrameCallback)===null||L===void 0||L.call(U,C))};(a=(o=this.videoElement).requestVideoFrameCallback)===null||a===void 0||a.call(o,C)}this.videoElement.controls=!1,this.videoElement.setAttribute("playsinline",""),P8()&&!ve("HIDE_NO_POSTER")&&(this.videoElement.poster="noposter");let c=ni();c.name==="Safari"&&Number(c.version)===15||jS()||!this.config.mirror||(this.videoElement.style.transform="rotateY(180deg)"),this.config.fit?this.videoElement.style.objectFit=this.config.fit:this.videoElement.style.objectFit="cover",this.videoElement.setAttribute("muted",""),this.videoElement.muted=!0,this.videoElement.srcObject&&this.videoElement.srcObject instanceof MediaStream?this.videoElement.srcObject.getVideoTracks()[0]!==this.videoTrack&&(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,Pi()&&this.videoElement.load()):(this.videoElement.srcObject=this.videoTrack?new MediaStream([this.videoTrack]):null,Pi()&&this.videoElement.load());let f=this.videoElement.play();f!==void 0&&f.catch(m=>{z.debug("[".concat(this.trackId,"] playback interrupted"),m.toString())})}resetVideoElement(){Sae.forEach(a=>{this.videoElement&&this.videoElement.removeEventListener(a,this.handleVideoEvents)}),this.videoElementCheckInterval&&(window.clearInterval(this.videoElementCheckInterval),this.videoElementCheckInterval=void 0),this.videoElementStatus=Da.NONE}handleAutoPlayFailed(){let a=o=>{o.preventDefault(),this.videoElement.play().then(()=>{z.debug("[".concat(this.trackId,"] Video element for trackId:").concat(this.trackId," autoplay resumed."))}).catch(c=>{z.error(c)}),this.autoplayFailed=!1,h3()?document.body.removeEventListener("click",a,!0):(document.body.removeEventListener("touchstart",a,!0),document.body.removeEventListener("mousedown",a,!0))};h3()?document.body.addEventListener("click",a,!0):(document.body.addEventListener("touchstart",a,!0),document.body.addEventListener("mousedown",a,!0)),Ase()}}let Sae=["play","playing","loadeddata","canplay","pause","stalled","suspend","waiting","abort","emptied","ended","timeupdate","error"];class bae extends vW{constructor(a){super(a),qe(this,"container",void 0),qe(this,"slot",void 0),this.slot=a.element,this.updateConfig(a)}updateConfig(a){this.config=a,this.trackId=a.trackId;let o=a.element;o!==this.slot&&(this.destroy(),this.slot=o),this.createElements()}updateVideoTrack(a){this.videoTrack!==a&&(this.videoTrack=a,this.createElements())}play(a){var o;(o=this.container)!==null&&o!==void 0&&o.contains(this.videoElement)&&super.play(a)}getCurrentFrame(){var a;return(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)?super.getCurrentFrame():new ImageData(2,2)}async getCurrentFrameToUint8Array(a){var o;let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return(o=this.container)!==null&&o!==void 0&&o.contains(this.videoElement)?await super.getCurrentFrameToUint8Array(a,c):await gW(a)}destroy(){if(super.destroy(),this.videoElement.remove(),this.videoElement=document.createElement("video"),this.container){try{this.container.remove(),this.slot.removeChild(this.container)}catch{}this.container=void 0}}createElements(){this.container||(this.container=document.createElement("div")),this.container.id="agora-video-player-".concat(this.trackId),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.videoTrack?(this.container.style.backgroundColor="black",ve("KEEP_LAST_FRAME")&&this.isKeepLastFrame&&this.videoElement.paused&&this.resetVideoElement(),this.mountedVideoElement()):this.unmountedVideoElement(),this.slot.appendChild(this.container)}mountedVideoElement(){var a;!this.container||(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)||this.container.appendChild(this.videoElement),super.initVideoElement(),this.videoElement.id="video_".concat(this.trackId),this.videoElement.className="agora_video_player",this.videoElement.style.width="100%",this.videoElement.style.height="100%",this.videoElement.style.position="absolute",this.videoElement.style.left="0",this.videoElement.style.top="0"}unmountedVideoElement(){var a;if((a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)){super.resetVideoElement();try{this.container&&this.container.removeChild(this.videoElement)}catch{}this.videoElement=document.createElement("video")}}resetVideoElement(){var a;(a=this.container)!==null&&a!==void 0&&a.contains(this.videoElement)&&(super.resetVideoElement(),this.cacheVideoElement=this.videoElement,this.videoElement=document.createElement("video"))}getContainerElement(){return this.container}}var Cae,Tae,Rae,xae,Aae,Iae,Nae,Oae,Pae,Lae,Dae,kae,Mae,jae,Uae,Fae,Bae,Vae,zae,Hae,Gae,Wae,$ae,Kae,qae,Wn,Yae,Xae,Jae,Qae,Zae,eoe,toe,noe,Lc;let ki=(Cae=hn({argsMap:(r,a,o)=>[r.getTrackId(),typeof a=="string"?a:a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement",o]}),Tae=Or(),Rae=hn({argsMap:r=>[r.getTrackId()]}),xae=BS("LocalVideoTrack","_enabledMutex"),Aae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Iae=Or(),Nae=BS("LocalVideoTrack","_enabledMutex"),Oae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Pae=Or(),Lae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Dae=Or(),kae=Or(),Mae=hn({argsMap:(r,a,o)=>[r.getTrackId(),a,o]}),jae=Or(),Uae=Or(),Fae=Or(),Bae=Or(),Vae=Or(),zae=Or(),Hae=Or(),Gae=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),Wae=hn({argsMap:r=>[r.getTrackId()]}),$ae=hn({argsMap:r=>[r.getTrackId()]}),Kae=hn({argsMap:(r,a,o)=>[r.getTrackId(),a.label,o]}),qae=hn(),Wn=class h0e extends hb{get videoHeight(){if(gs()){let{height:a}=this._mediaStreamTrack.getSettings();return this._videoHeight=a,this._videoHeight}return this._videoHeight}get videoWidth(){if(gs()){let{width:a}=this._mediaStreamTrack.getSettings();return this._videoWidth=a,this._videoWidth}return this._videoWidth}get isPlaying(){return!(!this._player||this._player.videoElementStatus!==Da.PLAYING)}get processorDestination(){return this._processorDestination}get processorContext(){return this._processorContext}set processorContext(a){this._processorContext=a}get __className__(){return"LocalVideoTrack"}constructor(a,o,c,f,m,v){if(super(a,m),qe(this,"trackMediaType","video"),qe(this,"_player",void 0),qe(this,"isUseScaleResolutionDownBy",!1),qe(this,"_videoVisibleTimer",null),qe(this,"_statsTimer",null),qe(this,"_previousVideoVisibleStatus",void 0),qe(this,"_clearPreviousVideoVisibleStatus",()=>this._previousVideoVisibleStatus=void 0),qe(this,"_encoderConfig",void 0),qe(this,"_scalabilityMode",{numSpatialLayers:1,numTemporalLayers:1}),qe(this,"_optimizationMode",void 0),qe(this,"_videoHeight",void 0),qe(this,"_videoWidth",void 0),qe(this,"_forceBitrateLimit",void 0),qe(this,"_enabled",!0),qe(this,"_processorDestination",void 0),qe(this,"_processorContext",void 0),gs()){let{width:w,height:C}=a.getSettings();this._videoWidth=w,this._videoHeight=C}else this.updateMediaStreamTrackResolution();if(this._encoderConfig=o,this._scalabilityMode=c,this._optimizationMode=f,this._hints=v||[],this._hints.indexOf(Hi.SCREEN_TRACK)===-1)this.updateBitrateFromProfile();else if(function(w,C,R){let x=ni();return!(x.name!==w||!x.osVersion)&&Number(x.version)===C}(fi.CHROME,115)&&N8().indexOf("Windows")!==-1){let w=function(C,R){if("VideoFrame"in window&&"TransformStream"in window&&Jn().supportWebRTCInsertableStream){let x=new MediaStreamTrackProcessor(C),L=new MediaStreamTrackGenerator({kind:"video"}),U,F,Z=Date.now(),W=()=>{K&&(clearInterval(K),K=void 0),U&&(U.close(),U=void 0),C.stop(),F=void 0,L.removeEventListener("ended",W)},K=window.setInterval(()=>{if(F&&U&&Date.now()-Z>1e3)try{L.readyState==="live"?F.enqueue(U.clone()):W()}catch{W()}},1e3),oe=new TransformStream({transform:(ue,xe)=>{L.readyState==="live"?(F=xe,Z=Date.now(),U===void 0?(U=ue,xe.enqueue(ue.clone())):(xe.enqueue(U),U=ue)):ue.close()}});return L.addEventListener("ended",W),x.readable.pipeThrough(oe).pipeTo(L.writable),L}}(a);w&&(z.info("local screen video track begin to inject frame"),this._mediaStreamTrack=w)}o&&this._hints.indexOf(Hi.CUSTOM_TRACK)!==-1&&this.setEncoderConfiguration(o),this._processorContext=new Ose(this.getTrackId(),"local"),this._processorDestination=new Nse(this.processorContext),this.bindProcessorDestinationEvents()}play(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof a=="string"){let f=document.getElementById(a);f?a=f:(z.warning("[".concat(this.getTrackId(),'] can not find "#').concat(a,'" element, use document.body')),a=document.body)}z.debug("[".concat(this.getTrackId(),"] start video playback in ").concat(a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement"),JSON.stringify(o));let c=ir(ir(ir({},this._getDefaultPlayerConfig()),o),{},{trackId:this.getTrackId(),element:a});this._player?this._player.updateConfig(c):(a instanceof HTMLVideoElement?this._player=new vW(c):this._player=new bae(c),this._player.updateVideoTrack(this._mediaStreamTrack)),this._player.play(),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval(()=>{try{let f=this.getVideoElementVisibleStatus();this.safeEmit(db.VIDEO_ELEMENT_VISIBLE_STATUS,f)}catch{}},ve("CHECK_VIDEO_VISIBLE_INTERVAL"))}stop(){this._player&&(this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._statsTimer&&(this.isUseScaleResolutionDownBy=!1,window.clearInterval(this._statsTimer),this._statsTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,z.debug("[".concat(this.getTrackId(),"] stop video playback")))}async setEnabled(a,o){if(!o){if(a===this._enabled)return;this.stateCheck("enabled",a)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),a),!a){this._originMediaStreamTrack.enabled=!1;try{await Li(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}return o||(this._enabled=!1),void z.info("[".concat(this.getTrackId(),"] setEnabled to false success"))}this._originMediaStreamTrack.enabled=!0;try{await Li(this,Mt.NEED_ENABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to true error"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] setEnabled to true success")),o||(this._enabled=!0)}async setMuted(a){a!==this._muted&&(this.stateCheck("muted",a),this._muted=a,this._originMediaStreamTrack.enabled=!a,z.debug("[".concat(this.getTrackId(),"] start set muted: ").concat(a)),a?await Li(this,Mt.NEED_MUTE_TRACK,this):await Li(this,Mt.NEED_UNMUTE_TRACK,this))}async setEncoderConfiguration(a,o){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");if(a==="720p_auto"?this.startMonitorStats():this._statsTimer&&(window.clearInterval(this._statsTimer),this._statsTimer=null),a=zf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:a.bitrateMin),a.width||a.height||a.frameRate){let c=bD({encoderConfig:a});(gs()||ra()||fu())&&(c.deviceId=void 0),z.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(a),JSON.stringify(c));try{await this._originMediaStreamTrack.applyConstraints(c),this.updateMediaStreamTrackResolution()}catch(f){let m=new Ke(ce.UNEXPECTED_ERROR,f.toString());throw z.error("[".concat(this.getTrackId(),"] applyConstraints error"),m.toString()),m}}this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Li(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(c){return c.throw(z)}}getStats(){return T0(()=>{z.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getLocalVideoStats instead")},"localVideoTrackGetStatsWarning"),Ml(this,Mt.GET_STATS)||ir({},cW)}async setBeautyEffect(a){z.error("LocalVideoTrack.setBeautyEffect was deprecated, please migrate to agora-extension-beauty-effect")}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}async getCurrentFrameImage(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return this._player?this._player.getCurrentFrameToUint8Array(a,o):await gW(a)}async setBitrateLimit(a){if(z.debug("[".concat(this.getTrackId(),"] set bitrate limit, ").concat(JSON.stringify(a))),a){this._forceBitrateLimit=a,this._encoderConfig&&(this._encoderConfig.bitrateMax?this._encoderConfig.bitrateMax=this._encoderConfig.bitrateMax<a.max_bitrate?this._encoderConfig.bitrateMax:a.max_bitrate:this._encoderConfig.bitrateMax=a.max_bitrate,this._encoderConfig.bitrateMin,this._encoderConfig.bitrateMin=a.min_bitrate);try{await Li(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(o){return o.throw(z)}}}async setOptimizationMode(a){if(a!=="motion"&&a!=="detail"&&a!=="balanced")return void z.error(ce.INVALID_PARAMS,"optimization mode must be motion, detail or balanced");let o=this._optimizationMode;try{this._optimizationMode=a,await Li(this,Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this)}catch(c){throw this._optimizationMode=o,z.error("[".concat(this.getTrackId(),"] set optimization mode failed"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] set optimization mode success (").concat(a,")"))}setScalabiltyMode(a){if(a.numSpatialLayers===1&&a.numTemporalLayers!==1)return z.error(ce.INVALID_PARAMS,"scalability mode currently not supported, no SVC."),void(this._scalabilityMode={numSpatialLayers:1,numTemporalLayers:1});this._scalabilityMode=a,z.info("[".concat(this.getTrackId(),"] set scalability mode success (").concat(a,")"))}updateMediaStreamTrackResolution(){Dse(this._originMediaStreamTrack).then(a=>{let[o,c]=a;this._videoHeight=c,this._videoWidth=o}).catch(k8)}_updatePlayerSource(){this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}_getDefaultPlayerConfig(){return{fit:"contain"}}async setSenderConfiguration(a){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");z.debug("[".concat(this.getTrackId(),"] setSenderConfiguration applyConstraints"),JSON.stringify(a)),a=zf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate?this._forceBitrateLimit.max_bitrate:a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate?this._forceBitrateLimit.min_bitrate:a.bitrateMin),this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Li(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(o){return o.throw(z)}}updateBitrateFromProfile(){if(!this._encoderConfig)return;let{width:a,height:o,frameRate:c}=this.getMediaStreamTrackSettings();if(!a||!o||!c)return;let{bitrateMax:f,bitrateMin:m}=this._encoderConfig;if(m==null||f==null){let{max:v,min:w}=function(C,R,x,L,U){let F=ve("BITRATE_ADAPTER_TYPE");if(F==="DEFAULT_BITRATE")return{min:L,max:U};if(U===void 0){var Z;let K=Math.floor(200*Math.pow(x/15,.6)*Math.pow(C*R/640/360,.75));U=F==="STANDARD_BITRATE"?4*K:2*K,L=(Z=L)!==null&&Z!==void 0?Z:K}else{var W;L=(W=L)!==null&&W!==void 0?W:Math.floor(U/10)}return{min:L,max:U}}(a,o,c,m,f);this._encoderConfig.bitrateMin=w,this._encoderConfig.bitrateMax=v,z.debug("[".concat(this.getTrackId(),"] update bitrate from profile, [w: ").concat(a,", h: ").concat(o,", fps: ").concat(c,"] => [brMax: ").concat(v,", brMin: ").concat(w,"]"))}}getVideoElementVisibleStatus(){try{var a,o;let c=this==null||(a=this._player)===null||a===void 0?void 0:a.getContainerElement(),f={track:this,element:this==null||(o=this._player)===null||o===void 0?void 0:o.getVideoElement(),slot:c==null?void 0:c.parentElement},{element:m,slot:v}=f;if(this.isPlaying&&m instanceof HTMLVideoElement&&v instanceof HTMLElement){let w=Vne.checkOneElementVisible(m),C=Object.assign({},w);if(C.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=C.visible;let R=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.LOCAL_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});C.visible?R.onSuccess("Video is visible"):R.onSuccess("Invisible because of ".concat(C.reason))}return C}return}catch(c){throw new Ke(ce.GET_VIDEO_ELEMENT_VISIBLE_ERROR,c.message)}}async renewMediaStreamTrack(a){}pipe(a){if(this.processor===a)return a;if(a._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(a.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=a,this.processor._source=this,a.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),a}unpipe(){if(!this.processor)return;let a=this.processor;this.processor._source=void 0,this.processor=void 0,a.reset()}close(){super.close(),this.unbindProcessorDestinationEvents(),this.unbindProcessorContextEvents(),this.unpipe(),this.processorDestination._source&&this.processorDestination._source.unpipe()}clone(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],c=this._encoderConfig;a&&(c=ir(ir({},c),zf(a))),c=zy(c);let f=Di(8,"track-video-cloned-"),m=new h0e(o?this._mediaStreamTrack.clone():this._mediaStreamTrack,c,zy(this._scalabilityMode),this._optimizationMode,f,zy(this._hints));return a&&c&&m.setEncoderConfiguration(c),z.debug("clone video track from ".concat(this.getTrackId()," to ").concat(f,", clone ").concat(o)),m}async replaceTrack(a,o){if(!(a instanceof MediaStreamTrack))throw new Ke(ce.INVALID_PARAMS,"track should be an instance of MediaStreamTrack");if(a.kind!=="video")throw new Ke(ce.INVALID_PARAMS,"track should be a video MediaStreamTrack");await this._updateOriginMediaStreamTrack(a,o,!0),this.updateMediaStreamTrackResolution()}startMonitorStats(){if(!gs()&&!ra())return;this._statsTimer&&window.clearInterval(this._statsTimer);let a=2,o=yD[a],c=-1,f=Date.now(),m=v=>{v>2||v<0||(f=Date.now(),o=yD[v],this.setSenderConfiguration(o))};this.isUseScaleResolutionDownBy=!0,this._statsTimer=window.setInterval(()=>{let v=this.getStats(),w=Ml(this,Mt.GET_RTC_STATS);if(v.sendPackets>0&&w){c===-1&&(c=Date.now());let C=Date.now();if(C-c<1e3||C-f<ve("PROFILE_SWITCH_INTERVAL"))return;let R=v.sendFrameRate,x=.6*o.frameRate,L=.9*o.frameRate;typeof R=="number"&&R>0&&R<x?a>0&&(a--,m(a),z.debug("[".concat(this.getTrackId(),"] step down for fps ").concat(R,", switchProfile to ").concat(a))):w.OutgoingAvailableBandwidth<o.bitrateMin?a>0&&(a--,m(a),z.debug("[".concat(this.getTrackId(),"] step down for OutgoingAvailableBandwidth ").concat(w.OutgoingAvailableBandwidth,", bitrateMin ").concat(o.bitrateMin,", switchProfile to ").concat(a))):typeof R=="number"&&R>L&&a<yD.length-1&&w.OutgoingAvailableBandwidth>1.2*yD[a+1].bitrateMin&&(a++,m(a),z.debug("[".concat(this.getTrackId(),"] step up for fps ").concat(R,", OutgoingAvailableBandwidth ").concat(w.OutgoingAvailableBandwidth,", switchProfile to ").concat(a)))}},ve("CHECK_LOCAL_STATS_INTERVAL"))}sendSeiData(a){if(T0(()=>{$t.reportApiInvoke(null,{name:$r.LOCAL_VIDEO_SEND_SEI_DATA,options:[],tag:vr.TRACER}).onSuccess("")},this._mediaStreamTrack.id||this.getTrackId()),!ve("ENABLE_VIDEO_SEI")||!ve("ENABLE_ENCODED_TRANSFORM"))return void z.warning('To send/receive SEI, please call AgoraRTC.setParameter("ENABLE_VIDEO_SEI", true) before instantiate IAgoraRtcClient');if(a instanceof Uint8Array==0)return new Ke(ce.INVALID_PARAMS,"Invalid argument type, ILocalVideoTrack.sendSeiData() only accept Uint8Array argument.").throw();let o=this.getRTCRtpTransceiver();if(!o)return void z.warning("Video track is not published, SEI can not be send");let c=o.sender.getParameters();if(c.codecs.length===0)return;let f=c.codecs[0].mimeType.toLocaleLowerCase();f==="video/h264"?this.safeEmit("sei-to-send",a):z.warning("SEI is not supported by ".concat(f))}bindProcessorDestinationEvents(){this.processorDestination.on(so.ON_TRACK,async a=>{a?a!==this._mediaStreamTrack&&(this._mediaStreamTrack=a,this._updatePlayerSource(),await Li(this,Mt.NEED_REPLACE_TRACK,this)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource(),await Li(this,Mt.NEED_REPLACE_TRACK,this))})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(so.ON_TRACK)}unbindProcessorContextEvents(){this.processorContext.removeAllListeners(Ac.REQUEST_UPDATE_CONSTRAINTS),this.processorContext.removeAllListeners(Ac.REQUEST_CONSTRAINTS)}},Qn(Wn.prototype,"play",[Cae,Tae],Object.getOwnPropertyDescriptor(Wn.prototype,"play"),Wn.prototype),Qn(Wn.prototype,"stop",[Rae],Object.getOwnPropertyDescriptor(Wn.prototype,"stop"),Wn.prototype),Qn(Wn.prototype,"setEnabled",[xae,Aae,Iae],Object.getOwnPropertyDescriptor(Wn.prototype,"setEnabled"),Wn.prototype),Qn(Wn.prototype,"setMuted",[Nae,Oae,Pae],Object.getOwnPropertyDescriptor(Wn.prototype,"setMuted"),Wn.prototype),Qn(Wn.prototype,"setEncoderConfiguration",[Lae,Dae],Object.getOwnPropertyDescriptor(Wn.prototype,"setEncoderConfiguration"),Wn.prototype),Qn(Wn.prototype,"getStats",[kae],Object.getOwnPropertyDescriptor(Wn.prototype,"getStats"),Wn.prototype),Qn(Wn.prototype,"setBeautyEffect",[Mae,jae],Object.getOwnPropertyDescriptor(Wn.prototype,"setBeautyEffect"),Wn.prototype),Qn(Wn.prototype,"getCurrentFrameData",[Uae],Object.getOwnPropertyDescriptor(Wn.prototype,"getCurrentFrameData"),Wn.prototype),Qn(Wn.prototype,"getCurrentFrameImage",[Fae],Object.getOwnPropertyDescriptor(Wn.prototype,"getCurrentFrameImage"),Wn.prototype),Qn(Wn.prototype,"setBitrateLimit",[Bae],Object.getOwnPropertyDescriptor(Wn.prototype,"setBitrateLimit"),Wn.prototype),Qn(Wn.prototype,"setOptimizationMode",[Vae],Object.getOwnPropertyDescriptor(Wn.prototype,"setOptimizationMode"),Wn.prototype),Qn(Wn.prototype,"setScalabiltyMode",[zae],Object.getOwnPropertyDescriptor(Wn.prototype,"setScalabiltyMode"),Wn.prototype),Qn(Wn.prototype,"updateMediaStreamTrackResolution",[Hae],Object.getOwnPropertyDescriptor(Wn.prototype,"updateMediaStreamTrackResolution"),Wn.prototype),Qn(Wn.prototype,"pipe",[Gae],Object.getOwnPropertyDescriptor(Wn.prototype,"pipe"),Wn.prototype),Qn(Wn.prototype,"unpipe",[Wae],Object.getOwnPropertyDescriptor(Wn.prototype,"unpipe"),Wn.prototype),Qn(Wn.prototype,"close",[$ae],Object.getOwnPropertyDescriptor(Wn.prototype,"close"),Wn.prototype),Qn(Wn.prototype,"replaceTrack",[Kae],Object.getOwnPropertyDescriptor(Wn.prototype,"replaceTrack"),Wn.prototype),Qn(Wn.prototype,"startMonitorStats",[qae],Object.getOwnPropertyDescriptor(Wn.prototype,"startMonitorStats"),Wn.prototype),Wn),yW=(Yae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Xae=Or(),Jae=BS("CameraVideoTrack","_enabledMutex"),Qae=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),Zae=Or(),eoe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),toe=Or(),noe=hn({argsMap:r=>[r.getTrackId()]}),Lc=class f0e extends ki{get __className__(){return"CameraVideoTrack"}constructor(a,o,c,f,m,v){super(a,zf(o.encoderConfig),f,m,v),qe(this,"_config",void 0),qe(this,"_originalConstraints",void 0),qe(this,"_constraints",void 0),qe(this,"_enabled",!0),qe(this,"_deviceName","default"),qe(this,"tryResumeVideoForIOS15_16WeChat",async()=>{(jS()||kH())&&!function(){let w=ni();if(w.os!==ms.IOS||!w.osVersion)return!1;let C=w.osVersion.split(".");return Number(C[0])===15&&Number(C[1])>=2}()&&kne()&&this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS 15 device on WeChat.")),await this.renewMediaStreamTrack())}),this._config=o,this._originalConstraints=c,this._constraints=c,this._deviceName=a.label,this._encoderConfig=zf(this._config.encoderConfig),Si.on(js.IOS_15_16_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),Si.on(js.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),this.bindProcessorContextEvents()}async setDevice(a){return typeof a=="string"?this._setDeviceById(a):a.deviceId?this._setDeviceById(a.deviceId):a.facingMode?this._setDeviceByFacingModel(a.facingMode):void 0}async _setDeviceById(a){if(z.info("[".concat(this.getTrackId(),"] set device to ").concat(a)),this._enabled)try{let o=await Oc.getDeviceById(a),c={};c.video=ir({},this._constraints),c.video.deviceId={exact:a},c.video.facingMode=void 0,this._originMediaStreamTrack.stop();let f=null;try{f=await Nc(c,this.getTrackId())}catch(m){throw z.error("[".concat(this.getTrackId(),"] setDevice failed"),m.toString()),f=await Nc({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!1),m}await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution(),this._deviceName=o.label,this._config.cameraId=a,this._constraints.deviceId={exact:a}}catch(o){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),o.toString()),o}else try{let o=await Oc.getDeviceById(a);this._deviceName=o.label,this._config.cameraId=a,this._constraints.deviceId={exact:a}}catch(o){throw z.error("[".concat(this.getTrackId(),"] setDevice error"),o.toString()),o}z.info("[".concat(this.getTrackId(),"] setDevice success"))}async _setDeviceByFacingModel(a){z.info("[".concat(this.getTrackId(),"] set facingMode ").concat(a));let o={video:ir(ir({},this._constraints),{},{deviceId:void 0,facingMode:{exact:a}})};if(this._enabled){this._originMediaStreamTrack.stop();let c=null;try{c=await Nc(o,this.getTrackId())}catch(f){throw z.error("[".concat(this.getTrackId(),"] setDeviceByFacingModel failed"),f.toString()),c=await Nc({video:this._constraints},this.getTrackId()),await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1),f}await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1),this.updateMediaStreamTrackResolution()}this._deviceName="",this._config.facingMode=a,this._config.cameraId=void 0,this._constraints=ir({},o.video),z.info("[".concat(this.getTrackId(),"] setDeviceByFacingModel success"))}async setEnabled(a,o){if(!o){if(a===this._enabled)return;this.stateCheck("enabled",a)}if(z.info("[".concat(this.getTrackId(),"] start setEnabled"),a),a){try{if(this.isExternalTrack)this._originMediaStreamTrack.enabled=!0;else{let c=await Nc({video:this._constraints},this.getTrackId());await this._updateOriginMediaStreamTrack(c.getVideoTracks()[0],!1)}await Li(this,Mt.NEED_ENABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled true error"),c.toString()),c}this.updateMediaStreamTrackResolution(),z.info("[".concat(this.getTrackId(),"] setEnabled to true success")),o||(this._enabled=!0)}else{this.isExternalTrack?this._originMediaStreamTrack.enabled=!1:(this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop()),o||(this._enabled=!1);try{await Li(this,Mt.NEED_DISABLE_TRACK,this)}catch(c){throw z.error("[".concat(this.getTrackId(),"] setEnabled to false error"),c.toString()),c}z.info("[".concat(this.getTrackId(),"] setEnabled to false success"))}}async setEncoderConfiguration(a,o){if(!this._enabled)throw new Ke(ce.TRACK_IS_DISABLED,"can not set encoder configuration when track is disabled");a==="720p_auto"?this.startMonitorStats():this._statsTimer&&(window.clearInterval(this._statsTimer),this._statsTimer=null),a=zf(a),this._forceBitrateLimit&&(a.bitrateMax=this._forceBitrateLimit.max_bitrate||a.bitrateMax,a.bitrateMin=this._forceBitrateLimit.min_bitrate||a.bitrateMin);let c=zi(this._config);c.encoderConfig=a;let f=bD(c);(gs()||ra()||fu())&&(f.deviceId=void 0),z.debug("[".concat(this.getTrackId(),"] setEncoderConfiguration applyConstraints"),JSON.stringify(a),JSON.stringify(f));try{await this._originMediaStreamTrack.applyConstraints(f),this.updateMediaStreamTrackResolution()}catch(m){let v=new Ke(ce.UNEXPECTED_ERROR,m.toString());throw z.error("[".concat(this.getTrackId(),"] applyConstraints error"),v.toString()),v}this._config=c,this._constraints=f,this._originalConstraints=f,this._encoderConfig=a,this._hints.indexOf(Hi.SCREEN_TRACK)===-1&&this.updateBitrateFromProfile();try{await Li(this,Mt.NEED_UPDATE_VIDEO_ENCODER,this)}catch(m){return m.throw(z)}}_getDefaultPlayerConfig(){return{mirror:!0,fit:"cover"}}onTrackEnded(){if((ra()||fu())&&this._enabled&&!this._isClosed&&Si.duringInterruption){let a=async()=>{Si.off(js.IOS_INTERRUPTION_END,a),this._enabled&&!this._isClosed&&(z.debug("[".concat(this.getTrackId(),"] try capture camera media device for interrupted iOS device.")),await this.setEnabled(!1),await this.setEnabled(!0))};Si.on(js.IOS_INTERRUPTION_END,a)}else z.debug("[".concat(this.getTrackId(),"] track ended")),this.safeEmit(db.TRACK_ENDED)}async renewMediaStreamTrack(a){let o=a||this._constraints,c=Oc.searchDeviceIdByName(this._deviceName);if(c&&!o.deviceId&&(o.deviceId={exact:c}),this._enabled){let f=await Nc({video:o},this.getTrackId());this._constraints=o,await this._updateOriginMediaStreamTrack(f.getVideoTracks()[0],!0),this.updateMediaStreamTrackResolution()}}close(){super.close(),Si.off(js.IOS_15_16_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat),Si.off(js.IOS_INTERRUPTION_END,this.tryResumeVideoForIOS15_16WeChat)}clone(a){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],c=this._encoderConfig;a&&(c=ir(ir({},c),zf(a))),c=zy(c);let f=Di(8,"track-cam-cloned-"),m=new f0e(o?this._mediaStreamTrack.clone():this._mediaStreamTrack,zy(ir(ir({},this._config),{},{encoderConfig:c})),zy(this._constraints),zy(this._scalabilityMode),this._optimizationMode,f);return a&&c&&m.setEncoderConfiguration(c),z.debug("clone track from ".concat(this.getTrackId()," to ").concat(f,", clone ").concat(o)),m}bindProcessorContextEvents(){this.processorContext.on(Ac.REQUEST_UPDATE_CONSTRAINTS,async(a,o,c)=>{try{let f=Object.assign({},this._originalConstraints,...a);await this.renewMediaStreamTrack(f),o()}catch(f){c(f)}}),this.processorContext.on(Ac.REQUEST_CONSTRAINTS,async a=>{a(this._originMediaStreamTrack.getSettings())})}},Qn(Lc.prototype,"setDevice",[Yae,Xae],Object.getOwnPropertyDescriptor(Lc.prototype,"setDevice"),Lc.prototype),Qn(Lc.prototype,"setEnabled",[Jae,Qae,Zae],Object.getOwnPropertyDescriptor(Lc.prototype,"setEnabled"),Lc.prototype),Qn(Lc.prototype,"setEncoderConfiguration",[eoe,toe],Object.getOwnPropertyDescriptor(Lc.prototype,"setEncoderConfiguration"),Lc.prototype),Qn(Lc.prototype,"close",[noe],Object.getOwnPropertyDescriptor(Lc.prototype,"close"),Lc.prototype),Lc);function _W(r,a,o,c){o.optimizationMode&&(c&&c.width&&c.height?(o.encoderConfig=ir(ir({},c),{},{bitrateMin:c.bitrateMin,bitrateMax:c.bitrateMax}),o.optimizationMode!=="motion"&&o.optimizationMode!=="detail"||(a.contentHint=o.optimizationMode,a.contentHint===o.optimizationMode?z.debug("[".concat(r,"] set content hint to"),o.optimizationMode):z.debug("[".concat(r,"] set content hint failed")))):z.warning("[".concat(r,"] can not apply optimization mode bitrate config, no encoderConfig")))}var ioe,roe,soe,aoe,md,ooe,loe,coe,doe,uoe,hoe,ka;class foe extends _se{getUserId(){return this._userId}constructor(a,o,c,f){super(a,"track-".concat(a.kind,"-").concat(o,"-").concat(f.clientId,"_").concat(Di(5,""))),qe(this,"_userId",void 0),qe(this,"_uintId",void 0),qe(this,"_isDestroyed",!1),qe(this,"store",void 0),qe(this,"processor",void 0),qe(this,"processorContext",void 0),this._userId=o,this._uintId=c,this.store=f}_updateOriginMediaStreamTrack(a){this._originMediaStreamTrack=a,this._mediaStreamTrack=a,this._updatePlayerSource(),this.processor&&this.processor.updateInput({track:this._originMediaStreamTrack,context:this.processorContext})}_destroy(){this._isDestroyed=!0,z.info("[".concat(this.getTrackId(),"] is destroyed")),this.stop(),super.close()}getProcessorStats(){return this.processorContext.gatherStats()}getProcessorUsage(){return this.processorContext.gatherUsage()}}let mb=(ioe=hn({argsMap:(r,a,o)=>[r.getTrackId(),typeof a=="string"?a:a instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement",o]}),roe=hn({argsMap:r=>[r.getTrackId()]}),soe=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),aoe=hn({argsMap:r=>[r.getTrackId()]}),Qn((md=class extends foe{get isPlaying(){return!(!this._player||this._player.videoElementStatus!==Da.PLAYING)}get __className__(){return"RemoteVideoTrack"}constructor(r,a,o,c){super(r,a,o,c),qe(this,"_videoVisibleTimer",null),qe(this,"_previousVideoVisibleStatus",void 0),qe(this,"_clearPreviousVideoVisibleStatus",()=>this._previousVideoVisibleStatus=void 0),qe(this,"trackMediaType","video"),qe(this,"_videoWidth",void 0),qe(this,"_videoHeight",void 0),qe(this,"_player",void 0),qe(this,"processorDestination",void 0),qe(this,"processorContext",void 0),this.updateMediaStreamTrackResolution(),this.processorContext=new Ose(this.getTrackId(),"remote"),this.processorDestination=new Nse(this.processorContext),this.bindProcessorDestinationEvents()}getStats(){return T0(()=>{z.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteVideoStats instead")},"remoteVideoTrackGetStatsWarning"),Ml(this,Mt.GET_STATS)||ir({},vse)}play(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof r=="string"){let c=document.getElementById(r);c?r=c:(z.warning("[".concat(this.getTrackId(),'] can not find "#').concat(r,'" element, use document.body')),r=document.body)}z.debug("[".concat(this.getTrackId(),"] start video playback in ").concat(r instanceof HTMLVideoElement?"HTMLVideoElement":"HTMLElement"),JSON.stringify(a));let o=ir(ir({fit:"cover"},a),{},{trackId:this.getTrackId(),element:r});this._player?this._player.updateConfig(o):(r instanceof HTMLVideoElement?this._player=new vW(o):this._player=new bae(o),this._player.updateVideoTrack(this._mediaStreamTrack),this._player.onFirstVideoFrameDecoded=()=>{this.store.subscribe(this.getUserId(),"video",void 0,void 0,Date.now()),this.safeEmit(ub.FIRST_FRAME_DECODED)},this._player.onVideoStateChanged=c=>{this.safeEmit(ub.VIDEO_STATE_CHANGED,c)}),this._player.play(this.store.sessionId||void 0),this._videoVisibleTimer&&window.clearInterval(this._videoVisibleTimer),this._clearPreviousVideoVisibleStatus(),this._videoVisibleTimer=window.setInterval(()=>{try{let c=this.getVideoElementVisibleStatus();this.safeEmit(ub.VIDEO_ELEMENT_VISIBLE_STATUS,c)}catch{}},ve("CHECK_VIDEO_VISIBLE_INTERVAL"))}stop(){this._player&&(this._videoVisibleTimer&&(window.clearInterval(this._videoVisibleTimer),this._videoVisibleTimer=null),this._clearPreviousVideoVisibleStatus(),this._player.destroy(),this._player=void 0,z.debug("[".concat(this.getTrackId(),"] stop video playback")))}getCurrentFrameData(){return this._player?this._player.getCurrentFrame():new ImageData(2,2)}updateMediaStreamTrackResolution(){Dse(this._originMediaStreamTrack).then(r=>{let[a,o]=r;this._videoHeight=o,this._videoWidth=a}).catch(k8)}_updatePlayerSource(){z.debug("[".concat(this.getTrackId(),"] update player source track")),this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)}getVideoElementVisibleStatus(){try{var r,a;let o=this==null||(r=this._player)===null||r===void 0?void 0:r.getContainerElement(),c={track:this,element:this==null||(a=this._player)===null||a===void 0?void 0:a.getVideoElement(),slot:o==null?void 0:o.parentElement},{element:f,slot:m}=c;if(this.isPlaying&&f instanceof HTMLVideoElement&&m instanceof HTMLElement){let v=Vne.checkOneElementVisible(f),w=Object.assign({},v);if(w.visible!==this._previousVideoVisibleStatus){this._previousVideoVisibleStatus=w.visible;let C=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.REMOTE_VIDEO_TRACK_GET_VIDEO_VISIBLE,options:[this.getTrackId()]});w.visible?C.onSuccess("Video is visible"):C.onSuccess("Invisible because of ".concat(w.reason))}return w}return}catch(o){throw new Ke(ce.GET_VIDEO_ELEMENT_VISIBLE_ERROR,o.message)}}pipe(r){if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,context:this.processorContext}),r}unpipe(){if(!this.processor)return;let r=this.processor;this.processor._source=void 0,this.processor=void 0,r.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(so.ON_TRACK,async r=>{r?r!==this._mediaStreamTrack&&(this._mediaStreamTrack=r,this._updatePlayerSource()):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource())})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(so.ON_TRACK)}_destroy(){super._destroy(),this.unbindProcessorDestinationEvents()}_onSei(r){this.emit(i_.SEI_RECEIVED,r)}}).prototype,"play",[ioe],Object.getOwnPropertyDescriptor(md.prototype,"play"),md.prototype),Qn(md.prototype,"stop",[roe],Object.getOwnPropertyDescriptor(md.prototype,"stop"),md.prototype),Qn(md.prototype,"pipe",[soe],Object.getOwnPropertyDescriptor(md.prototype,"pipe"),md.prototype),Qn(md.prototype,"unpipe",[aoe],Object.getOwnPropertyDescriptor(md.prototype,"unpipe"),md.prototype),md),gb=(ooe=hn({argsMap:(r,a)=>[r.getTrackId(),a],throttleTime:300}),loe=hn({argsMap:(r,a)=>[r.getTrackId(),a]}),coe=hn({argsMap:r=>[r.getTrackId()]}),doe=hn({argsMap:r=>[r.getTrackId()]}),uoe=hn({argsMap:(r,a)=>[r.getTrackId(),a.name]}),hoe=hn({argsMap:r=>[r.getTrackId()]}),Qn((ka=class extends foe{get isPlaying(){return this._useAudioElement?Oo.isPlaying(this.getTrackId()):this._source.isPlayed}get __className__(){return"RemoteAudioTrack"}constructor(r,a,o,c){super(r,a,o,c),qe(this,"trackMediaType","audio"),qe(this,"_source",void 0),qe(this,"_useAudioElement",!0),qe(this,"_volume",100),qe(this,"processorContext",void 0),qe(this,"processorDestination",void 0),qe(this,"_played",!1),qe(this,"_bypassWebAudio",!1),ve("DISABLE_WEBAUDIO")?(this._source=new mW,this._bypassWebAudio=!0,this._useAudioElement=!0):(this._source=new bse(r,!0),ve("REMOTE_AUDIO_TRACK_USES_WEB_AUDIO")&&(this._useAudioElement=!1)),this._source.once(xc.RECEIVE_TRACK_BUFFER,()=>{this.safeEmit(ub.FIRST_FRAME_DECODED)}),this.processorContext=new Lse(this._source.context,this.getTrackId(),"remote"),this.processorDestination=new Pse(this.processorContext),this.bindProcessorDestinationEvents(),this._source.on(xc.UPDATE_SOURCE,()=>{this.processor&&this.processor.updateInput({node:this._source.processSourceNode,context:this.processorContext})})}setAudioFrameCallback(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4096;if(!r)return this._source.removeAllListeners(xc.ON_AUDIO_BUFFER),void this._source.stopGetAudioBuffer();this._source.startGetAudioBuffer(a),this._source.removeAllListeners(xc.ON_AUDIO_BUFFER),this._source.on(xc.ON_AUDIO_BUFFER,o=>r(o))}setVolume(r){this._volume=r,this._useAudioElement?Oo.setVolume(this.getTrackId(),r):this._source.setVolume(r/100)}async setPlaybackDevice(r){if(!this._useAudioElement||!pse())throw new Ke(ce.NOT_SUPPORTED,"your browser does not support setting the audio output device");await Oo.setSinkID(this.getTrackId(),r)}getVolumeLevel(){return this._source.getAccurateVolumeLevel()}getStats(){return T0(()=>{z.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use AgoraRTCClient.getRemoteAudioStats instead")},"remoteAudioTrackGetStatsWarning"),Ml(this,Mt.GET_STATS)||ir({},gse)}play(){z.debug("[".concat(this.getTrackId(),"] start audio playback")),this._played=!0,this._useAudioElement?(z.debug("[".concat(this.getTrackId(),"] use audio element to play")),Oo.play(this._mediaStreamTrack,this.getTrackId(),this._volume,this.store.sessionId||void 0)):this._source.play()}stop(){z.debug("[".concat(this.getTrackId(),"] stop audio playback")),this._played=!1,this._useAudioElement?Oo.stop(this.getTrackId()):this._source.stop()}_destroy(){super._destroy(),this._played=!1,this.unbindProcessorDestinationEvents(),this._source.destroy()}_isFreeze(){return this._source.isFreeze}_updatePlayerSource(){let r=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];z.debug("[".concat(this.getTrackId(),"] update player source track")),r&&this._source.updateTrack(this._mediaStreamTrack),this._useAudioElement&&Oo.updateTrack(this.getTrackId(),this._mediaStreamTrack)}pipe(r){if(this._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"can not pipe extension when WebAudio disabled");if(this.processor===r)return r;if(r._source)throw new Ke(ce.INVALID_OPERATION,"Processor ".concat(r.name," already piped, please call unpipe beforehand."));return this.unpipe(),this.processor=r,this.processor._source=this,r.updateInput({track:this._originMediaStreamTrack,node:this._source.processSourceNode,context:this.processorContext}),r}unpipe(){var r;if(this._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"can not unpipe extension when WebAudio disabled");if(!this.processor)return;let a=this.processor;(r=this._source.processSourceNode)===null||r===void 0||r.disconnect(),this.processor._source=!1,this.processor=void 0,a.reset()}bindProcessorDestinationEvents(){this.processorDestination.on(so.ON_TRACK,async r=>{r?r!==this._mediaStreamTrack&&(this._mediaStreamTrack=r,this._updatePlayerSource(!1),this._source.processedNode=this._source.createMediaStreamSourceNode(r)):this._mediaStreamTrack!==this._originMediaStreamTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource())}),this.processorDestination.on(so.ON_NODE,r=>{this._source.processedNode=r;let a=!r;this._useAudioElement!==a&&(this._played?(this.stop(),this._useAudioElement=a,this.play()):this._useAudioElement=a)})}unbindProcessorDestinationEvents(){this.processorDestination.removeAllListeners(so.ON_TRACK),this.processorDestination.removeAllListeners(so.ON_NODE)}}).prototype,"setVolume",[ooe],Object.getOwnPropertyDescriptor(ka.prototype,"setVolume"),ka.prototype),Qn(ka.prototype,"setPlaybackDevice",[loe],Object.getOwnPropertyDescriptor(ka.prototype,"setPlaybackDevice"),ka.prototype),Qn(ka.prototype,"play",[coe],Object.getOwnPropertyDescriptor(ka.prototype,"play"),ka.prototype),Qn(ka.prototype,"stop",[doe],Object.getOwnPropertyDescriptor(ka.prototype,"stop"),ka.prototype),Qn(ka.prototype,"pipe",[uoe],Object.getOwnPropertyDescriptor(ka.prototype,"pipe"),ka.prototype),Qn(ka.prototype,"unpipe",[hoe],Object.getOwnPropertyDescriptor(ka.prototype,"unpipe"),ka.prototype),ka),bm=new class extends nr{get visibility(){return document.visibilityState}get lastHiddenTime(){return this._lastHiddenTime}get lastVisibleTime(){return this._lastVisibleTime}constructor(){super(),qe(this,"_lastHiddenTime",0),qe(this,"_lastVisibleTime",0),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this._lastHiddenTime=performance.now():this._lastVisibleTime=performance.now(),z.debug("document visibility went ".concat(document.visibilityState)),this.emit("VISIBILITY_CHANGE",document.visibilityState)})}};var poe=function(r){return r[r.ONE_BYTE=0]="ONE_BYTE",r[r.TWO_BYTE=1]="TWO_BYTE",r}(poe||{});class n4e{constructor(){qe(this,"_sequence",0),qe(this,"_startTime",Date.now()),qe(this,"isUseOneByte",!0)}get startTime(){let a=Date.now()-this._startTime;return a<Math.pow(2,16)?a:(this._startTime+=Math.pow(2,16),this.startTime)}get sequence(){return this._sequence<Math.pow(2,32)?this._sequence++:(this._sequence-=Math.pow(2,32),this.sequence)}serialize(a){let o={commonPacketHeader:{length:0,reserved:0,extension:0,sequence:this.sequence},commonStreamHeader:this.startTime,extension:void 0,payload:a};if(a.byteLength>128){let w=new Uint8Array(4);w.set([1,0,0,0]);let C={id:0,length:4,data:w.buffer},R={profile:this.isUseOneByte?0:1,length:this.isUseOneByte?5:6,datas:[C]};o.commonPacketHeader.extension=1,o.extension=R,o.payload=this.compress(a),o.commonPacketHeader.length=8+(o.extension.length+2)+o.payload.byteLength}else o.commonPacketHeader.length=8+o.payload.byteLength;ve("SHOW_DATASTREAM2_LOG")&&z.debug("send data header: ".concat(JSON.stringify(o.commonPacketHeader)));let c=new ArrayBuffer(o.commonPacketHeader.length),f=new Uint8Array(c),m=new DataView(c),v=0;if(m.setUint16(v,o.commonPacketHeader.extension<<15|o.commonPacketHeader.reserved<<14|o.commonPacketHeader.length,!0),v+=2,m.setUint32(v,o.commonPacketHeader.sequence,!0),v+=4,m.setUint16(v,o.commonStreamHeader,!0),v+=2,o.extension){let w=this.serializeExtension(o.extension);f.set(new Uint8Array(w),v),v+=w.byteLength}if(f.set(new Uint8Array(o.payload),v),v+=o.payload.byteLength,v!==o.commonPacketHeader.length)throw Error("serialize error!");return c}deserialize(a){if(a.byteLength<4)return new ArrayBuffer(0);let o=new DataView(a),c=0,f=o.getUint16(c,!0);c+=2;let m={length:16383&f,reserved:(16384&f)>>14,extension:(32768&f)>>15,sequence:o.getUint16(c+2,!0)<<16|o.getUint16(c,!0)},v,w;if(c+=4,ve("SHOW_DATASTREAM2_LOG")&&z.debug("receive data header: ".concat(JSON.stringify(m))),o.getUint16(c,!0),c+=2,m.extension){w=this.deserializeExtension(a.slice(c)),c+=2+w.length,v=a.slice(c);let C=!1;if(w.datas.length>0){let R=w.datas.find(x=>x.id===0);R&&(C=(1&new DataView(R.data).getUint32(0,!0))==1)}v=C?this.decompress(v):v}else v=a.slice(8);return v}serializeExtension(a){let{profile:o,length:c,datas:f}=a,m=new ArrayBuffer(c+2),v=new Uint8Array(m),w=new DataView(m),C=0;if(w.setUint8(C++,o),w.setUint8(C++,c),f.forEach(R=>{o?(w.setUint8(C++,R.id),w.setUint8(C++,R.length),v.set(new Uint8Array(R.data),C),C+=R.data.byteLength):(w.setUint8(C++,R.id|R.length<<4),v.set(new Uint8Array(R.data),C),C+=R.data.byteLength)}),C!==c+2)throw Error("serialize extension error, is ".concat(C,"!==").concat(c+2));return m}deserializeExtension(a){let o=new DataView(a),c=0,f=o.getUint8(c);c++;let m=o.getUint8(c);c++;let v=f===poe.TWO_BYTE,w=[],C=new DataView(a,2),R=0;for(;R<m;){let x=0,L=0,U=new ArrayBuffer(0);v?(x=C.getUint8(R),R++,L=C.getUint8(R),R++):(x=15&C.getUint8(R),L=C.getUint8(R)>>4,R++),L>0&&(U=C.buffer.slice(R+2,R+2+L),R+=U.byteLength),w.push({id:x,length:L,data:U})}if(R!==m)throw Error("parse error");return{profile:f,length:m,datas:w}}decompress(a){return VIe(new Uint8Array(a))}compress(a){return BIe(new Uint8Array(a))}}class moe extends nr{constructor(a,o){super(),qe(this,"_version",1),qe(this,"_type",3),qe(this,"_config",void 0),qe(this,"_originDataChannel",void 0),qe(this,"_dataStreamPacketHeader",new ArrayBuffer(4)),qe(this,"_dataStreamPacketHandler",void 0),qe(this,"_datachannelEventMap",new Map),this._config=a,o&&(this._originDataChannel=o,this._bandDataChannelEvents(o)),this._initPacketHeader(),this._dataStreamPacketHandler=new n4e}get id(){return this._config.id}get ordered(){return this._config.ordered}get maxRetransmits(){return ve("DATASTREAM_MAX_RETRANSMITS")}get metadata(){return this._config.metadata}get readyState(){var a,o;return(a=(o=this._originDataChannel)===null||o===void 0?void 0:o.readyState)!==null&&a!==void 0?a:"connecting"}get _originDataChannelId(){var a,o;return(a=(o=this._originDataChannel)===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null}getChannelId(){return this.id}getConfig(){return this._config}_close(){this._originDataChannel&&(this._unbindDataChannelEvents(this._originDataChannel),this._originDataChannel=void 0)}async _waitTillOpen(){return new Ct((a,o)=>{if(this._originDataChannel){this._originDataChannel.readyState==="open"&&a();let c=setTimeout(()=>{var f;o(new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT,"Cannot create datachannel, id: ".concat((f=this._originDataChannel)===null||f===void 0?void 0:f.id)))},1e4);this._originDataChannel.onopen=()=>{clearTimeout(c),this._originDataChannel&&this._bandDataChannelEvents(this._originDataChannel),a()},this._originDataChannel.onerror=()=>{throw clearTimeout(c),new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT)}}else o(new Ke(ce.DATACHANNEL_CONNECTION_TIMEOUT,"cannot find dataChannel"))})}_updateOriginDataChannel(a){this._originDataChannel=a,this._bandDataChannelEvents(a)}_initPacketHeader(){let a=new DataView(this._dataStreamPacketHeader);a.setUint16(0,this._version),a.setUint8(2,this._type),a.setUint8(3,this._config.id)}_bandDataChannelEvents(a){this._unbindDataChannelEvents(a),[wD.OPEN,wD.CLOSE,wD.ERROR].forEach(o=>{let c=()=>{this.emit(o)};this._datachannelEventMap.set(o,c),a.addEventListener(o,c)})}_unbindDataChannelEvents(a){Array.from(this._datachannelEventMap.entries()).forEach(o=>{let[c,f]=o;a.removeEventListener(c,f)}),this._datachannelEventMap.clear()}}class i4e extends moe{constructor(a){super(a),qe(this,"_messageListener",void 0),this._messageListener=o=>{if(o.data.byteLength<this._dataStreamPacketHeader.byteLength)throw Error("invalid byteLength: the byte length must exceed "+this._dataStreamPacketHeader.byteLength);let c=o.data.slice(0,this._dataStreamPacketHeader.byteLength),f=new DataView(c).getUint8(3);if(f!==this.id)return void(ve("SHOW_DATASTREAM2_LOG")&&z.debug("invalid datachannel id: ".concat(f," !== ").concat(this.id)));let m=o.data.slice(this._dataStreamPacketHeader.byteLength);m=this._dataStreamPacketHandler.deserialize(m),this.emit(wD.MESSAGE,m)}}_updateOriginDataChannel(a){super._updateOriginDataChannel(a),this._bandRemoteDataChannelEvents()}_close(){this._originDataChannel&&(this._originDataChannel.removeEventListener("message",this._messageListener),super._close())}_bandRemoteDataChannelEvents(){this._originDataChannel&&this._originDataChannel.addEventListener("message",this._messageListener)}}class goe extends moe{send(a){if(this._originDataChannel){let o=a;o=this._dataStreamPacketHandler.serialize(a);let c=new Uint8Array(this._dataStreamPacketHeader.byteLength+o.byteLength);c.set(new Uint8Array(this._dataStreamPacketHeader),0),c.set(new Uint8Array(o),this._dataStreamPacketHeader.byteLength),this._originDataChannel.send(c.buffer)}}}function TD(){let r=new Blob([atob("ZnVuY3Rpb24gZShlKXtjb25zdCB0PW5ldyBEYXRhVmlldyhlLmRhdGEpO2lmKDA9PT10LmdldFVpbnQ4KDApJiYwPT09dC5nZXRVaW50OCgxKSYmMD09PXQuZ2V0VWludDgoMikmJjE9PT10LmdldFVpbnQ4KDMpJiY2PT09dC5nZXRVaW50OCg0KSl7bGV0IG49NixyPTAsbz0wO2Zvcig7MjU1PT09KG89dC5nZXRVaW50OChuKyspKTspcis9MjU1O3IrPW87Y29uc3QgYT1mdW5jdGlvbihlLHQsbil7bGV0IHI9bmV3IFVpbnQ4QXJyYXkoZSx0LG4pLG89W10sYT0wO2Zvcig7YTxuOylhKzM8biYmMD09PXJbYV0mJjA9PT1yW2ErMV0mJjM9PT1yW2ErMl0mJigwPT09clthKzNdfHwxPT09clthKzNdfHwyPT09clthKzNdfHwzPT09clthKzNdKT8oby5wdXNoKHJbYV0sclthKzFdLHJbYSszXSksYSs9NCk6KG8ucHVzaChyW2FdKSxhKyspO3JldHVybiBuZXcgVWludDhBcnJheShvKX0oZS5kYXRhLG4scik7cmV0dXJuIG5ldyBVaW50OEFycmF5KGEpfXJldHVybiBudWxsfWZ1bmN0aW9uIHQoZSx0KXtjb25zdCBuPWZ1bmN0aW9uKGUpe2NvbnN0IHQ9ZS5sZW5ndGg7bGV0IG49W10scj0wO2Zvcig7cjx0OylyKzI8dCYmMD09PWVbcl0mJjA9PT1lW3IrMV0mJigwPT09ZVtyKzJdfHwxPT09ZVtyKzJdfHwyPT09ZVtyKzJdfHwzPT09ZVtyKzJdKT8obi5wdXNoKGVbcl0sZVtyKzFdLDMsZVtyKzJdKSxyKz0zKToobi5wdXNoKGVbcl0pLHIrKyk7cmV0dXJuIG5ldyBVaW50OEFycmF5KG4pfSh0KSxyPW4ubGVuZ3RoLG89TWF0aC5mbG9vcihyLzI1NSksYT1yJTI1NSxzPW5ldyBVaW50OEFycmF5KDYrbysxK3IrZS5ieXRlTGVuZ3RoKTtzWzBdPTAsc1sxXT0wLHNbMl09MCxzWzNdPTEsc1s0XT02LHNbNV09MTAxO2xldCBpPTA7Zm9yKDtpPG87KXNbNitpXT0yNTUsaSsrO3JldHVybiBzWzYraV09YSxpKysscy5zZXQobiw2K2kpLHMuc2V0KG5ldyBVaW50OEFycmF5KGUpLDYraStyKSxzLmJ1ZmZlcn1uYXZpZ2F0b3IudXNlckFnZW50LmluZGV4T2YoIlNhZmFyaSIpPi0xJiYtMT09PW5hdmlnYXRvci51c2VyQWdlbnQuaW5kZXhPZigiQ2hyb21lIikmJihzZWxmLm9ucnRjdHJhbnNmb3JtPW49Pntjb25zdCByPW4udHJhbnNmb3JtZXI7bGV0IG89W107ci5vcHRpb25zLnBvcnQub25tZXNzYWdlPWU9PntlLmRhdGEuc2VpJiZvLnB1c2goZS5kYXRhLnNlaSl9LHNlbGYucG9zdE1lc3NhZ2UoInN0YXJ0ZWQiKTtjb25zdCBhPXIucmVhZGFibGUuZ2V0UmVhZGVyKCkscz1yLndyaXRhYmxlLmdldFdyaXRlcigpOyJyeCI9PT1yLm9wdGlvbnMubmFtZT9mdW5jdGlvbiB0KG4pe2EucmVhZCgpLnRoZW4oKHI9PntpZighci5kb25lKXtpZihyLnZhbHVlIGluc3RhbmNlb2YgUlRDRW5jb2RlZFZpZGVvRnJhbWUpe2NvbnN0IHQ9ZShyLnZhbHVlKTt0JiZuLm9wdGlvbnMucG9ydC5wb3N0TWVzc2FnZSh7c2VpOnR9KX1zLndyaXRlKHIudmFsdWUpLG4ub3B0aW9ucy5wb3J0LnBvc3RNZXNzYWdlKHt0cmFuc2Zvcm1lZDohMH0pLHQobil9fSkpfShyKToidHgiPT09ci5vcHRpb25zLm5hbWUmJmZ1bmN0aW9uIGUobil7YS5yZWFkKCkudGhlbigocj0+e2lmKCFyLmRvbmUpe2lmKHIudmFsdWUgaW5zdGFuY2VvZiBSVENFbmNvZGVkVmlkZW9GcmFtZSl7Y29uc3QgZT1vLnNoaWZ0KCk7ZSYmKHIudmFsdWUuZGF0YT10KHIudmFsdWUuZGF0YSxlKSl9cy53cml0ZShyLnZhbHVlKSxuLm9wdGlvbnMucG9ydC5wb3N0TWVzc2FnZSh7dHJhbnNmb3JtZWQ6ITB9KSxlKG4pfX0pKX0ocil9LHNlbGYucG9zdE1lc3NhZ2UoInJlZ2lzdGVyZWQiKSk7Cg==")],{type:"text/javascript"});return setTimeout(()=>Rre.revokeObjectURL(r),0),new Worker(Rre.createObjectURL(r))}let RD=new Map,xD=new Map,AD=new Map;async function r4e(r,a){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support video encoded transform");if(AD.has(r)||!r.track)return;let o={track:r.track};if(b0()){if(!r.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let f=null;try{f=r.createEncodedStreams()}catch(w){return void z.error("create video-encoded-streams error",w&&w.message)}let m=[];a.on("sei-to-send",w=>{m.push(w)});let v=new TransformStream({transform(w,C){o.controller||(o.controller=C),r.track&&r.track.id!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c));let R=m.shift();R&&(w.data=function(x,L){let U=function(ue){let xe=ue.length,Oe=[],ke=0;for(;ke<xe;)ke+2<xe&&ue[ke]===0&&ue[ke+1]===0&&(ue[ke+2]===0||ue[ke+2]===1||ue[ke+2]===2||ue[ke+2]===3)?(Oe.push(ue[ke],ue[ke+1],3,ue[ke+2]),ke+=3):(Oe.push(ue[ke]),ke++);return new Uint8Array(Oe)}(L),F=U.length,Z=Math.floor(F/255),W=F%255,K=new Uint8Array(6+Z+1+F+x.byteLength);K[0]=0,K[1]=0,K[2]=0,K[3]=1,K[4]=6,K[5]=101;let oe=0;for(;oe<Z;)K[6+oe]=255,oe++;return K[6+oe]=W,oe++,K.set(U,6+oe),K.set(new Uint8Array(x),6+oe+F),K.buffer}(w.data,R)),C.enqueue(w)}});f.readable.pipeThrough(v).pipeTo(f.writable)}else{if(!gs())return;{if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let f=TD(),m=new MessageChannel;await new Ct(w=>f.onmessage=C=>{C.data==="registered"&&w(void 0)});let v=new RTCRtpScriptTransform(f,{name:"tx",port:m.port2},[m.port2]);r.transform=v,await new Ct(w=>f.onmessage=C=>{C.data==="started"&&w(void 0)}),a.on("sei-to-send",w=>{m.port1.postMessage({sei:w})}),m.port1.onmessage=w=>{var C;w.data.transformed&&r.track&&((C=r.track)===null||C===void 0?void 0:C.id)!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c))},o.worker=f}}function c(){if(r.track){if(this.id!==r.track.id)return;r.track.removeEventListener("ended",c)}let f=AD.get(r);if(f){AD.delete(r);try{var m,v;(m=f.controller)===null||m===void 0||m.terminate(),(v=f.worker)===null||v===void 0||v.terminate()}catch(w){z.warning(w&&w.message)}}}AD.set(r,o),r.track.addEventListener("ended",c)}let Y3=new Map;async function s4e(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support video encoded transform");if(!r.track)return;if(Y3.has(r)){let f=Y3.get(r);return void(f&&(f.onSei=a.onSei))}let o={track:r.track,onSei:a.onSei};if(b0()){if(!r.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let f=null;try{f=r.createEncodedStreams()}catch(v){return void z.error("create video-encoded-streams error",v&&v.message)}let m=new TransformStream({transform(v,w){o.controller||(o.controller=w),r.track&&r.track.id!==o.track.id&&(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c));let C=function(R){let x=new DataView(R.data);if(x.getUint8(0)===0&&x.getUint8(1)===0&&x.getUint8(2)===0&&x.getUint8(3)===1&&x.getUint8(4)===6){let L=6,U=0,F=0;for(;(F=x.getUint8(L++))===255;)U+=255;U+=F;let Z=function(W,K,oe){let ue=new Uint8Array(W,K,oe),xe=[],Oe=0;for(;Oe<oe;)Oe+3<oe&&ue[Oe]===0&&ue[Oe+1]===0&&ue[Oe+2]===3&&(ue[Oe+3]===0||ue[Oe+3]===1||ue[Oe+3]===2||ue[Oe+3]===3)?(xe.push(ue[Oe],ue[Oe+1],ue[Oe+3]),Oe+=4):(xe.push(ue[Oe]),Oe++);return new Uint8Array(xe)}(R.data,L,U);return new Uint8Array(Z)}return null}(v);C&&o.onSei&&o.onSei(C),w.enqueue(v)}});f.readable.pipeThrough(m).pipeTo(f.writable)}else if(gs()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let f=TD(),m=new MessageChannel;await new Ct(w=>f.onmessage=C=>{C.data==="registered"&&w(void 0)});let v=new RTCRtpScriptTransform(f,{name:"rx",port:m.port2},[m.port2]);r.transform=v,await new Ct(w=>f.onmessage=C=>{C.data==="started"&&w(void 0)}),m.port1.onmessage=w=>{var C;w.data.transformed&&r.track&&((C=r.track)===null||C===void 0?void 0:C.id)!==o.track.id?(z.debug("video track changed: ".concat(o.track.id," => ").concat(r.track.id)),o.track.removeEventListener("ended",c),o.track=r.track,o.track.addEventListener("ended",c)):w.data.sei&&o.onSei&&o.onSei(w.data.sei)},o.worker=f}function c(){if(r.track){if(this.id!==r.track.id)return;r.track.removeEventListener("ended",c)}(function(f){let m=Y3.get(f);if(m){Y3.delete(f);try{var v,w;(v=m.controller)===null||v===void 0||v.terminate(),(w=m.worker)===null||w===void 0||w.terminate()}catch(C){z.warning(C&&C.message)}}})(r)}Y3.set(r,o),r.track.addEventListener("ended",c)}(function(){let r=ni();qs.getDisplayMedia=!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia),qs.getStreamFromExtension=r.name===fi.CHROME&&Number(r.version)>34,qs.supportUnifiedPlan=function(){if(!window.RTCRtpTransceiver||!("currentDirection"in RTCRtpTransceiver.prototype))return!1;let a=new RTCPeerConnection,o=!1;try{a.addTransceiver("audio"),o=!0}catch{}return a.close(),o}(),qs.supportMinBitrate=r.name===fi.CHROME||r.name===fi.EDGE,qs.supportSetRtpSenderParameters=function(){let a=ni();return!!(window.RTCRtpSender&&window.RTCRtpSender.prototype.setParameters&&window.RTCRtpSender.prototype.getParameters)&&(!!C0()||!(!gs()&&!O8())||a.name===fi.FIREFOX&&Number(a.version)>=64)}(),r.name===fi.SAFARI&&(Number(r.version)>=14?qs.supportDualStream=!0:qs.supportDualStream=!1),qs.webAudioMediaStreamDest=function(){let a=ni();return!(a.name===fi.SAFARI&&Number(a.version)<12)}(),qs.supportReplaceTrack=!!window.RTCRtpSender&&typeof RTCRtpSender.prototype.replaceTrack=="function",qs.supportWebGL=typeof WebGLRenderingContext<"u",qs.supportRequestFrame=!!window.CanvasCaptureMediaStreamTrack,C0()||(qs.webAudioWithAEC=!0),qs.supportShareAudio=function(){let a=ni();return(a.os===ms.WIN_10||a.os===ms.WIN_81||a.os===ms.WIN_7||a.os===ms.LINUX||a.os===ms.MAC_OS||a.os===ms.CHROMIUM_OS)&&a.name===fi.CHROME&&Number(a.version)>=74}(),qs.supportDataChannel=!!(DH(76)||function(a){let o=ni();return!(o.name!==fi.FIREFOX||!o.osVersion)&&Number(o.version)>=a}(68)||Ane(14)),qs.supportPCSetConfiguration=function(){let a=window.RTCPeerConnection;return!Pi()&&!!a&&a.prototype.setConfiguration instanceof Function}(),qs.supportWebRTCEncodedTransform=function(){let a=ni();return a.name==="Chrome"&&Number(a.version)>=86||a.name==="Safari"&&Number(a.version)>=15}(),qs.supportWebRTCInsertableStream=function(){let a=ni();return(a.name===fi.CHROME||a.name===fi.EDGE)&&Number(a.version)>=94&&"MediaStreamTrackGenerator"in window&&"MediaStreamTrackProcessor"in window}(),qs.supportRequestVideoFrameCallback="requestVideoFrameCallback"in HTMLVideoElement.prototype,qs.supportWebCrypto=typeof window<"u"&&window.crypto!==void 0&&window.crypto.subtle!==void 0,D8(()=>{qs.supportDualStreamEncoding=function(){let a=ni();return!!ve("DISABLE_WEBAUDIO")||a.name==="Safari"&&Number(a.version)>=14||!!(a.name==="Chrome"&&/Windows/i.test(a.os||"")&&Number(a.version)>=100&&ve("CHROME_DUAL_STREAM_USE_ENCODING"))}(),z.info("browser compatibility",JSON.stringify(qs),JSON.stringify(r))})})();class a4e extends nr{constructor(){super(...arguments),X(this,"resultStorage",new Map)}setLocalAudioStats(a,o,c){this.record("AUDIO_INPUT_LEVEL_TOO_LOW",a,this.checkAudioInputLevel(c,o)),this.record("SEND_AUDIO_BITRATE_TOO_LOW",a,this.checkSendAudioBitrate(c,o))}setLocalVideoStats(a,o,c){this.record("SEND_VIDEO_BITRATE_TOO_LOW",a,this.checkSendVideoBitrate(c,o)),this.record("FRAMERATE_INPUT_TOO_LOW",a,this.checkFramerateInput(c,o)),this.record("FRAMERATE_SENT_TOO_LOW",a,this.checkFramerateSent(c))}setRemoteAudioStats(a,o){let c=a.getUserId();this.record("AUDIO_OUTPUT_LEVEL_TOO_LOW",c,this.checkAudioOutputLevel(o))}setRemoteVideoStats(a,o){let c=a.getUserId();this.record("RECV_VIDEO_DECODE_FAILED",c,this.checkVideoDecode(o))}record(a,o,c){if(ve("STATS_UPDATE_INTERVAL")>500)return;this.resultStorage.has(a)||this.resultStorage.set(a,{result:[],isPrevNormal:!0});let f=this.resultStorage.get(a);if(f&&(f.result.push(c),f.result.length>=5)){var m;let v=Tt(m=f.result).call(m,!0);f.isPrevNormal&&!v&&this.emit("exception",voe[a],a,o),!f.isPrevNormal&&v&&this.emit("exception",voe[a]+2e3,a+"_RECOVER",o),f.isPrevNormal=v,f.result=[]}}checkAudioOutputLevel(a){return!(a.receiveBitrate>0&&a.receiveLevel===0)}checkAudioInputLevel(a,o){return o instanceof ns&&!o.isActive||!!o.muted||a.sendVolumeLevel!==0}checkFramerateInput(a,o){let c=null;o._encoderConfig&&o._encoderConfig.frameRate&&(c=rl(o._encoderConfig.frameRate));let f=a.captureFrameRate;return!c||!f||!(c>10&&f<5||c<10&&c>=5&&f<=1)}checkFramerateSent(a){return!(a.captureFrameRate&&a.sendFrameRate&&a.captureFrameRate>5&&a.sendFrameRate<=1)}checkSendVideoBitrate(a,o){return!!o.muted||a.sendBitrate!==0}checkSendAudioBitrate(a,o){return o instanceof ns&&!o.isActive||!!o.muted||a.sendBitrate!==0}checkVideoDecode(a){return a.receiveBitrate===0||a.decodeFrameRate!==0}}let voe={FRAMERATE_INPUT_TOO_LOW:1001,FRAMERATE_SENT_TOO_LOW:1002,SEND_VIDEO_BITRATE_TOO_LOW:1003,RECV_VIDEO_DECODE_FAILED:1005,AUDIO_INPUT_LEVEL_TOO_LOW:2001,AUDIO_OUTPUT_LEVEL_TOO_LOW:2002,SEND_AUDIO_BITRATE_TOO_LOW:2003},aa=new class{markSubscribeStart(r,a){performance.mark("agora-web-sdk/".concat(r,"/subscribe-").concat(a))}markPublishStart(r,a){performance.mark("agora-web-sdk/".concat(r,"/publish-").concat(a))}measureFromSubscribeStart(r,a){let o=performance.getEntriesByName("agora-web-sdk/".concat(r,"/subscribe-").concat(a));if(o.length>0){let c=o[o.length-1];return Math.round(performance.now()-c.startTime)}return 0}measureFromPublishStart(r,a){let o=performance.getEntriesByName("agora-web-sdk/".concat(r,"/publish-").concat(a));if(o.length>0){let c=o[o.length-1];return Math.round(performance.now()-c.startTime)}return 0}};function EW(r,a){this.v=r,this.k=a}function Dn(r){return new EW(r,0)}var o4e=kA,l4e=du;Ni({target:"Promise",stat:!0,forced:!0},{withResolvers:function(){var r=l4e.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}});var c4e=du,d4e=f0;Ni({target:"Promise",stat:!0,forced:!0},{try:function(r){var a=c4e.f(this),o=d4e(r);return(o.error?a.reject:a.resolve)(o.value),a.promise}});var wW=l(o4e),yoe=AS.f("asyncIterator"),u4e=l(yoe);function X3(r){var a,o;function c(m,v){try{var w=r[m](v),C=w.value,R=C instanceof EW;wW.resolve(R?C.v:C).then(function(x){if(R){var L=m==="return"?"return":"next";if(!C.k||x.done)return c(L,x);x=r[L](x).value}f(w.done?"return":"normal",x)},function(x){c("throw",x)})}catch(x){f("throw",x)}}function f(m,v){switch(m){case"return":a.resolve({value:v,done:!0});break;case"throw":a.reject(v);break;default:a.resolve({value:v,done:!1})}(a=a.next)?c(a.key,a.arg):o=null}this._invoke=function(m,v){return new wW(function(w,C){var R={key:m,arg:v,resolve:w,reject:C,next:null};o?o=o.next=R:(a=o=R,c(m,v))})},typeof r.return!="function"&&(this.return=void 0)}function Ul(r){return function(){return new X3(r.apply(this,arguments))}}X3.prototype[typeof OS=="function"&&u4e||"@@asyncIterator"]=function(){return this},X3.prototype.next=function(r){return this._invoke("next",r)},X3.prototype.throw=function(r){return this._invoke("throw",r)},X3.prototype.return=function(r){return this._invoke("return",r)};var _oe=l(Me.Object.getOwnPropertySymbols),h4e=Ni,f4e=gw.indexOf,p4e=Sw,SW=ae([].indexOf),Eoe=!!SW&&1/SW([1],1,-0)<0;h4e({target:"Array",proto:!0,forced:Eoe||!p4e("indexOf")},{indexOf:function(r){var a=arguments.length>1?arguments[1]:void 0;return Eoe?SW(this,r,a)||0:f4e(this,r,a)}});var m4e=vc("Array").indexOf,g4e=b,v4e=m4e,bW=Array.prototype,y4e=function(r){var a=r.indexOf;return r===bW||g4e(bW,r)&&a===bW.indexOf?v4e:a},woe=l(y4e);function _4e(r,a){if(r==null)return{};var o,c,f=function(v,w){if(v==null)return{};var C,R,x={},L=hie(v);for(R=0;R<L.length;R++)C=L[R],woe(w).call(w,C)>=0||(x[C]=v[C]);return x}(r,a);if(_oe){var m=_oe(r);for(c=0;c<m.length;c++)o=m[c],woe(a).call(a,o)>=0||Object.prototype.propertyIsEnumerable.call(r,o)&&(f[o]=r[o])}return f}var Soe={exports:{}};(function(r,a){r.exports=(()=>{var o={8:(m,v,w)=>{w.r(v),w.d(v,{Parser:()=>$n,Printer:()=>Ou,parse:()=>Rn,print:()=>oi});let C=`
`,R="".concat("\r").concat(C),x=" ",L;function U(Rt){return Rt>="0"&&Rt<="9"}function F(Rt){return Rt>="!"&&Rt<="~"}function Z(Rt){return F(Rt)||Rt>="€"&&Rt<="ÿ"}function W(Rt){return Rt==="!"||Rt>="#"&&Rt<="'"||Rt>="*"&&Rt<="+"||Rt>="-"&&Rt<="."||Rt>="0"&&Rt<="9"||Rt>="A"&&Rt<="Z"||Rt>="^"&&Rt<="~"}function K(Rt){return Rt>="1"&&Rt<="9"}function oe(Rt){return Rt>="A"&&Rt<="Z"||Rt>="a"&&Rt<="z"}function ue(Rt){return Rt==="d"||Rt==="h"||Rt==="m"||Rt==="s"}function xe(Rt){return Rt>""&&Rt<" "||Rt>"\v"&&Rt<"\f"||Rt>""&&Rt<"ÿ"}function Oe(Rt){return oe(Rt)||U(Rt)||Rt==="+"||Rt==="/"}function ke(Rt){return U(Rt)||oe(Rt)||Rt==="+"||Rt==="/"||Rt==="-"||Rt==="_"}function He(Rt){return oe(Rt)||U(Rt)||Rt==="+"||Rt==="/"}function lt(Rt,q){var Ee=Object.keys(Rt);if(Object.getOwnPropertySymbols){var Ae=Object.getOwnPropertySymbols(Rt);q&&(Ae=Ae.filter(function(gt){return Object.getOwnPropertyDescriptor(Rt,gt).enumerable})),Ee.push.apply(Ee,Ae)}return Ee}function ut(Rt){for(var q=1;q<arguments.length;q++){var Ee=arguments[q]!=null?arguments[q]:{};q%2?lt(Object(Ee),!0).forEach(function(Ae){ft(Rt,Ae,Ee[Ae])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Rt,Object.getOwnPropertyDescriptors(Ee)):lt(Object(Ee)).forEach(function(Ae){Object.defineProperty(Rt,Ae,Object.getOwnPropertyDescriptor(Ee,Ae))})}return Rt}function ft(Rt,q,Ee){return q in Rt?Object.defineProperty(Rt,q,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Rt[q]=Ee,Rt}(function(Rt){Rt.VERSION="v",Rt.ORIGIN="o",Rt.SESSION_NAME="s",Rt.INFORMATION="i",Rt.URI="u",Rt.EMAIL="e",Rt.PHONE="p",Rt.CONNECTION="c",Rt.BANDWIDTH="b",Rt.TIME="t",Rt.REPEAT="r",Rt.ZONE_ADJUSTMENTS="z",Rt.KEY="k",Rt.ATTRIBUTE="a",Rt.MEDIA="m"})(L||(L={}));class zt{consumeText(q,Ee){let Ae=Ee;for(;Ae<q.length;){let gt=q[Ae];if(gt==="\0"||gt==="\r"||gt===C)break;Ae+=1}if(Ae-Ee==0)throw new Error("Invalid text, at ".concat(q));return Ae}consumeUnicastAddress(q,Ee,Ae){return this.consumeTill(q,Ee,x)}consumeOneOrMore(q,Ee,Ae){let gt=Ee;for(;Ae(q[gt]);)gt++;if(gt-Ee==0)throw new Error("Invalid rule at ".concat(Ee,"."));return gt}consumeSpace(q,Ee){if(q[Ee]===x)return Ee+1;throw new Error("Invalid space at ".concat(Ee,"."))}consumeIP4Address(q,Ee){let Ae=Ee;for(let gt=0;gt<4;gt++)if(Ae=this.consumeDecimalUChar(q,Ae),gt!==3){if(q[Ae]!==".")throw new Error("Invalid IP4 address.");Ae++}return Ae}consumeDecimalUChar(q,Ee){let Ae=Ee;for(let bn=0;bn<3&&U(q[Ae]);bn++,Ae++);if(Ae-Ee==0)throw new Error("Invalid decimal uchar.");let gt=parseInt(q.slice(Ee,Ae));if(gt>=0&&gt<=255)return Ae;throw new Error("Invalid decimal uchar")}consumeIP6Address(q,Ee){let Ae=this.consumeHexpart(q,Ee);return q[Ae]===":"&&(Ae+=1,Ae=this.consumeIP4Address(q,Ae)),Ae}consumeHexpart(q,Ee){let Ae=Ee;if(q[Ae]===":"&&q[Ae+1]===":"){Ae+=2;try{Ae=this.consumeHexseq(q,Ae)}catch{}return Ae}if(Ae=this.consumeHexseq(q,Ae),q[Ae]===":"&&q[Ae+1]===":"){Ae+=2;try{Ae=this.consumeHexseq(q,Ae)}catch{}return Ae}return Ae}consumeHexseq(q,Ee){let Ae=Ee;for(;Ae=this.consumeHex4(q,Ae),q[Ae]===":"&&q[Ae+1]!==":";)Ae+=1;return Ae}consumeHex4(q,Ee){let Ae=0;for(;Ae<4;Ae++)if(!((gt=q[Ee+Ae])>="0"&&gt<="9"||gt>="a"&&gt<="f"||gt>="A"&&gt<="F")){if(Ae===0)throw new Error("Invalid hex 4");break}var gt;return Ee+Ae}consumeFQDN(q,Ee){let Ae=Ee;for(;U(q[Ae])||oe(q[Ae])||q[Ae]==="-"||q[Ae]===".";)Ae+=1;if(Ae-Ee<4)throw new Error("Invalid FQDN");return Ae}consumeExtnAddr(q,Ee){return this.consumeOneOrMore(q,Ee,Z)}consumeMulticastAddress(q,Ee,Ae){switch(Ae){case"IP4":case"ip4":return this.consumeIP4MulticastAddress(q,Ee);case"IP6":case"ip6":return this.consumeIP6MulticastAddress(q,Ee);default:try{return this.consumeFQDN(q,Ee)}catch{return this.consumeExtnAddr(q,Ee)}}}consumeIP6MulticastAddress(q,Ee){let Ae=this.consumeHexpart(q,Ee);return q[Ae]==="/"?this.consumeInteger(q,Ae+1):Ae}consumeIP4MulticastAddress(q,Ee){let Ae=Ee+3,gt=q.slice(Ee,Ae),bn=parseInt(gt);if(bn<224||bn>239)throw new Error("Invalid IP4 multicast address, IPv4 multicast addresses may be in the range 224.0.0.0 to 239.255.255.255.");for(let ji=0;ji<3;ji++){if(q[Ae]!==".")throw new Error("Invalid IP4 multicast address.");Ae+=1,Ae=this.consumeDecimalUChar(q,Ae)}return q[Ae]==="/"&&(Ae+=1),Ae=this.consumeTTL(q,Ae),q[Ae]==="/"&&(Ae=this.consumeInteger(q,Ae)),Ae}consumeInteger(q,Ee){if(!K(q[Ee]))throw new Error("Invalid integer.");for(Ee+=1;U(q[Ee]);)Ee+=1;return Ee}consumeTTL(q,Ee){if(q[Ee]==="0")return Ee+1;if(!K(q[Ee]))throw new Error("Invalid TTL.");Ee+=1;for(let Ae=0;Ae<2&&U(q[Ee]);Ae++)Ee+=1;return Ee}consumeToken(q,Ee){return this.consumeOneOrMore(q,Ee,W)}consumeTime(q,Ee){let Ae=Ee;if(q[Ae]==="0")return Ae+1;for(K(q[Ae])&&(Ae+=1);U(q[Ae]);)Ae++;if(Ae-Ee<10)throw new Error("Invalid time");return Ae}consumeAddress(q,Ee){return this.consumeTill(q,Ee,x)}consumeTypedTime(q,Ee){let Ae=Ee;return Ae=this.consumeOneOrMore(q,Ae,U),ue(q[Ae])?Ae+1:Ae}consumeRepeatInterval(q,Ee){if(!K(q[Ee]))throw new Error("Invalid repeat interval");for(Ee+=1;U(q[Ee]);)Ee+=1;return ue(q[Ee])&&(Ee+=1),Ee}consumePort(q,Ee){return this.consumeOneOrMore(q,Ee,U)}consume(q,Ee,Ae){for(let gt=0;gt<Ae.length;gt++){if(Ee+gt>=q.length)throw new Error("consume exceeding value length");if(q[Ee+gt]!==Ae[gt])throw new Error("consume ".concat(Ae," failed at ").concat(gt))}return Ee+Ae.length}consumeTill(q,Ee,Ae){let gt=Ee;for(;gt<q.length&&(typeof Ae!="string"||q[gt]!==Ae)&&(typeof Ae!="function"||!Ae(q[gt]));)gt++;return gt}}class $n extends zt{constructor(){super(),ft(this,"records",[]),ft(this,"currentLine",0)}parse(q){let Ee=this.probeEOL(q);this.records=q.split(Ee).filter(Xr=>!!ks(Xr).call(Xr)).map(this.parseLine),this.currentLine=0;let Ae=this.parseVersion(),gt=this.parseOrigin(),bn=this.parseSessionName(),ji=this.parseInformation(),os=this.parseUri(),ll=this.parseEmail(),Rm=this.parsePhone(),QD=this.parseConnection(),ZD=this.parseBandWidth(),_d=this.parseTimeFields(),Y0=this.parseKey(),Tb=this.parseSessionAttribute(),Pr=this.parseMediaDescription();if(this.currentLine!==this.records.length)throw new Error("parsing failed, non exhaustive sdp lines.");return{version:Ae,origin:gt,sessionName:bn,information:ji,uri:os,emails:ll,phones:Rm,connection:QD,bandwidths:ZD,timeFields:_d,key:Y0,attributes:Tb,mediaDescriptions:Pr}}getCurrentRecord(){let q=this.records[this.currentLine];if(!q)throw new Error("Record doesn't exit.");return q}probeEOL(q){for(let Ee=0;Ee<q.length;Ee++)if(q[Ee]===C)return q[Ee-1]==="\r"?R:C;throw new Error("Invalid newline character.")}parseLine(q,Ee){if(q.length<2)throw new Error("Invalid sdp line, sdp line should be of form <type>=<value>.");let Ae=q[0];if(q[1]!=="=")throw new Error('Invalid sdp line, <type> should be a single character followed by an "=" sign.');return{type:Ae,value:q.slice(2),line:Ee,cur:0}}parseSessionAttribute(){let q=new Gi;for(;this.currentLine<this.records.length;){let Ee=this.getCurrentRecord();if(Ee.type!==L.ATTRIBUTE)break;let Ae={attField:this.extractOneOrMore(Ee,gt=>W(gt)&&gt!==":"),_cur:0};Ee.value[Ee.cur]===":"&&(Ee.cur+=1,Ae.attValue=this.extractOneOrMore(Ee,xe)),q.parse(Ae),this.currentLine++}return q.digest()}parseMediaAttributes(q){let Ee=new Ur(q);for(;this.currentLine<this.records.length;){let Ae=this.getCurrentRecord();if(Ae.type!==L.ATTRIBUTE)break;let gt={attField:this.extractOneOrMore(Ae,bn=>W(bn)&&bn!==":"),_cur:0};Ae.value[Ae.cur]===":"&&(Ae.cur+=1,gt.attValue=this.extractOneOrMore(Ae,xe)),Ee.parse(gt),this.currentLine++}return Ee.digest()}parseKey(){let q=this.getCurrentRecord();if(q.type===L.KEY){if(q.value==="prompt"||q.value==="clear:"||q.value==="base64:"||q.value==="uri:")return q.value;throw this.currentLine++,new Error("Invalid key.")}}parseZone(){let q=this.getCurrentRecord();if(q.type===L.ZONE_ADJUSTMENTS){let Ee=[];for(;;)try{let Ae=this.extract(q,this.consumeTime);this.consumeSpaceForRecord(q);let gt=!1;q.value[q.cur]==="-"&&(gt=!0,q.cur+=1);let bn=this.extract(q,this.consumeTypedTime);Ee.push({time:Ae,typedTime:bn,back:gt})}catch{break}if(Ee.length===0)throw new Error("Invalid zone adjustments");return this.currentLine++,Ee}return[]}parseRepeat(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.REPEAT)break;{let Ae=this.extract(Ee,this.consumeRepeatInterval),gt=this.parseTypedTime(Ee);q.push({repeatInterval:Ae,typedTimes:gt}),this.currentLine++}}return q}parseTypedTime(q){let Ee=[];for(;;)try{this.consumeSpaceForRecord(q),Ee.push(this.extract(q,this.consumeTypedTime))}catch{break}if(Ee.length===0)throw new Error("Invalid typed time.");return Ee}parseTime(){let q=this.getCurrentRecord(),Ee=this.extract(q,this.consumeTime);this.consumeSpaceForRecord(q);let Ae=this.extract(q,this.consumeTime);return this.currentLine++,{startTime:Ee,stopTime:Ae}}parseBandWidth(){let q=[];for(;this.currentLine<this.records.length;){let Ee=this.getCurrentRecord();if(Ee.type!==L.BANDWIDTH)break;{let Ae=this.extractOneOrMore(Ee,W);if(Ee.value[Ee.cur]!==":")throw new Error("Invalid bandwidth field.");Ee.cur++;let gt=this.extractOneOrMore(Ee,U);q.push({bwtype:Ae,bandwidth:gt}),this.currentLine++}}return q}parseVersion(){let q=this.getCurrentRecord();if(q.type!==L.VERSION)throw new Error("first sdp record must be version");let Ee=q.value.slice(0,this.consumeOneOrMore(q.value,0,U));if(Ee.length!==q.value.length)throw new Error('invalid proto version, "v='.concat(q.value,'"'));return this.currentLine++,Ee}parseOrigin(){let q=this.getCurrentRecord();if(q.type!==L.ORIGIN)throw new Error("second line of sdp must be origin");let Ee=this.extractOneOrMore(q,Z);this.consumeSpaceForRecord(q);let Ae=this.extractOneOrMore(q,U);this.consumeSpaceForRecord(q);let gt=this.extractOneOrMore(q,U);this.consumeSpaceForRecord(q);let bn=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let ji=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let os=this.extract(q,this.consumeUnicastAddress);return this.currentLine++,{username:Ee,sessId:Ae,sessVersion:gt,nettype:bn,addrtype:ji,unicastAddress:os}}parseSessionName(){let q=this.getCurrentRecord();if(q.type===L.SESSION_NAME){let Ee=this.extract(q,this.consumeText);return this.currentLine++,Ee}}parseInformation(){let q=this.getCurrentRecord();if(q.type!==L.INFORMATION)return;let Ee=this.extract(q,this.consumeText);return this.currentLine++,Ee}parseUri(){let q=this.getCurrentRecord();if(q.type===L.URI)return this.currentLine++,q.value}parseEmail(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.EMAIL)break;q.push(Ee.value),this.currentLine++}return q}parsePhone(){let q=[];for(;;){let Ee=this.getCurrentRecord();if(Ee.type!==L.PHONE)break;q.push(Ee.value),this.currentLine++}return q}parseConnection(){let q=this.getCurrentRecord();if(q.type===L.CONNECTION){let Ee=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let Ae=this.extractOneOrMore(q,W);this.consumeSpaceForRecord(q);let gt=this.extract(q,this.consumeAddress);return this.currentLine++,{nettype:Ee,addrtype:Ae,address:gt}}}parseMedia(){let q=this.getCurrentRecord(),Ee=this.extract(q,this.consumeToken);this.consumeSpaceForRecord(q);let Ae=this.extract(q,this.consumePort);q.value[q.cur]==="/"&&(q.cur+=1,Ae+=this.extract(q,this.consumeInteger)),this.consumeSpaceForRecord(q);let gt=[];for(gt.push(this.extract(q,this.consumeToken));q.value[q.cur]==="/";)q.cur+=1,gt.push(this.extract(q,this.consumeToken));if(gt.length===0)throw new Error("Invalid proto");let bn=this.parseFmt(q);return this.currentLine++,{mediaType:Ee,port:Ae,protos:gt,fmts:bn}}parseTimeFields(){let q=[];for(;this.getCurrentRecord().type===L.TIME;){let Ee=this.parseTime(),Ae=this.parseRepeat(),gt=this.parseZone();q.push({time:Ee,repeats:Ae,zones:gt})}return q}parseMediaDescription(){let q=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===L.MEDIA;){let Ee=this.parseMedia(),Ae=this.parseInformation(),gt=this.parseConnections(),bn=this.parseBandWidth(),ji=this.parseKey(),os=this.parseMediaAttributes(Ee);q.push({media:Ee,information:Ae,connections:gt,bandwidths:bn,key:ji,attributes:os})}return q}parseConnections(){let q=[];for(;this.currentLine<this.records.length&&this.getCurrentRecord().type===L.CONNECTION;)q.push(this.parseConnection());return q}parseFmt(q){let Ee=[];for(;;)try{this.consumeSpaceForRecord(q),Ee.push(this.extract(q,this.consumeToken))}catch{break}if(Ee.length===0)throw new Error("Invalid fmts");return Ee}extract(q,Ee){for(var Ae=arguments.length,gt=new Array(Ae>2?Ae-2:0),bn=2;bn<Ae;bn++)gt[bn-2]=arguments[bn];let ji=Ee.call(this,q.value,q.cur,...gt),os=q.value.slice(q.cur,ji);return q.cur=ji,os}extractOneOrMore(q,Ee){let Ae=this.consumeOneOrMore(q.value,q.cur,Ee),gt=q.value.slice(q.cur,Ae);return q.cur=Ae,gt}consumeSpaceForRecord(q){if(q.value[q.cur]!==x)throw new Error("Invalid space at ".concat(q.cur,"."));q.cur+=1}}class hi extends zt{constructor(){super(...arguments),ft(this,"attributes",void 0),ft(this,"digested",!1)}extractOneOrMore(q,Ee,Ae){let gt=this.consumeOneOrMore(q.attValue,q._cur,Ee),bn=q.attValue.slice(q._cur,gt),[ji,os]=Ae||[];if(typeof ji=="number"&&bn.length<ji)throw new Error("error in length, should be more or equal than ".concat(ji," characters."));if(typeof os=="number"&&bn.length>os)throw new Error("error in length, should be less or equal than ".concat(os," characters."));return q._cur=gt,bn}consumeAttributeSpace(q){if(q.attValue[q._cur]!==x)throw new Error("Invalid space at ".concat(q._cur,"."));q._cur+=1}extract(q,Ee){if(!q.attValue)throw new Error("Nothing to extract from attValue.");for(var Ae=arguments.length,gt=new Array(Ae>2?Ae-2:0),bn=2;bn<Ae;bn++)gt[bn-2]=arguments[bn];let ji=Ee.call(this,q.attValue,q._cur,...gt),os=q.attValue.slice(q._cur,ji);return q._cur=ji,os}atEnd(q){if(!q.attValue)throw new Error;return q._cur>=q.attValue.length}peekChar(q){if(!q.attValue)throw new Error;return q.attValue[q._cur]}peek(q,Ee){if(!q.attValue)throw new Error;for(let Ae=0;Ae<Ee.length;Ae++)if(Ee[Ae]!==q.attValue[q._cur+Ae])return!1;return!0}parseIceUfrag(q){if(this.attributes.iceUfrag)throw new Error("Invalid ice-ufrag, should be only a single line if 'a=ice-ufrag'");this.attributes.iceUfrag=this.extractOneOrMore(q,Oe,[4,256])}parseIcePwd(q){if(this.attributes.icePwd)throw new Error("Invalid ice-pwd, should be only a single line if 'a=ice-pwd'");this.attributes.icePwd=this.extractOneOrMore(q,Oe,[22,256])}parseIceOptions(q){if(this.attributes.iceOptions)throw new Error("Invalid ice-options, should be only one 'ice-options' line");let Ee=[];for(;!this.atEnd(q);){Ee.push(this.extractOneOrMore(q,Oe));try{this.consumeAttributeSpace(q)}catch(Ae){if(this.atEnd(q))break;throw Ae}}this.attributes.iceOptions=Ee}parseFingerprint(q){let Ee=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill);this.attributes.fingerprints.push({hashFunction:Ee,fingerprint:Ae})}parseExtmap(q){let Ee=this.extractOneOrMore(q,U),Ae;this.peekChar(q)==="/"&&(this.extract(q,this.consume,"/"),Ae=this.extract(q,this.consumeToken)),this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeTill,x),bn=ut(ut({entry:parseInt(Ee,10)},Ae&&{direction:Ae}),{},{extensionName:gt});this.peekChar(q)===x&&(this.consumeAttributeSpace(q),bn.extensionAttributes=this.extract(q,this.consumeTill)),this.attributes.extmaps.push(bn)}parseSetup(q){if(this.attributes.setup)throw new Error("must only be one single 'a=setup' line.");let Ee=this.extract(q,this.consumeTill);if(Ee!=="active"&&Ee!=="passive"&&Ee!=="actpass"&&Ee!=="holdconn")throw new Error("role must be one of 'active', 'passive', 'actpass', 'holdconn'.");this.attributes.setup=Ee}}class Gi extends hi{constructor(){super(...arguments),ft(this,"attributes",{unrecognized:[],groups:[],extmaps:[],fingerprints:[],identities:[]})}parse(q){if(this.digested)throw new Error("already digested");try{switch(q.attField){case"group":this.parseGroup(q);break;case"ice-lite":this.parseIceLite();break;case"ice-ufrag":this.parseIceUfrag(q);break;case"ice-pwd":this.parseIcePwd(q);break;case"ice-options":this.parseIceOptions(q);break;case"fingerprint":this.parseFingerprint(q);break;case"setup":this.parseSetup(q);break;case"tls-id":this.parseTlsId(q);break;case"identity":this.parseIdentity(q);break;case"extmap":this.parseExtmap(q);break;case"msid-semantic":this.parseMsidSemantic(q);break;default:q.ignored=!0,this.attributes.unrecognized.push(q)}}catch(Ee){throw console.error("parsing session attribute ".concat(q.attField,' error, "a=').concat(q.attField,":").concat(q.attValue,'"')),Ee}if(!q.ignored&&q.attValue&&!this.atEnd(q))throw new Error("attribute parsing error")}digest(){return this.digested=!0,this.attributes}parseGroup(q){let Ee=this.extract(q,this.consumeToken),Ae=[];for(;!this.atEnd(q)&&this.peekChar(q)===x;)this.consumeAttributeSpace(q),Ae.push(this.extract(q,this.consumeToken));this.attributes.groups.push({semantic:Ee,identificationTag:Ae})}parseIceLite(){if(this.attributes.iceLite)throw new Error("Invalid ice-lite, should be only a single line of 'a=ice-lite'");this.attributes.iceLite=!0}parseTlsId(q){if(this.attributes.tlsId)throw new Error("must be only one tld-id line");this.attributes.tlsId=this.extractOneOrMore(q,ke)}parseIdentity(q){let Ee=this.extractOneOrMore(q,He),Ae=[];for(;!this.atEnd(q)&&this.peekChar(q)===x;){this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeToken);this.extract(q,this.consume,"=");let bn=this.extractOneOrMore(q,ji=>ji!==x&&xe(ji));Ae.push({name:gt,value:bn})}this.attributes.identities.push({assertionValue:Ee,extensions:Ae})}parseMsidSemantic(q){this.peekChar(q)===x&&this.consumeAttributeSpace(q);let Ee={semantic:this.extract(q,this.consumeToken),identifierList:[]};for(;;){try{this.consumeAttributeSpace(q)}catch{break}if(this.peekChar(q)==="*"){this.extract(q,this.consume,"*"),Ee.applyForAll=!0;break}{let Ae=this.extract(q,this.consumeTill,x);Ee.identifierList.push(Ae)}}this.attributes.msidSemantic=Ee}}class Ur extends hi{constructor(q){super(),ft(this,"attributes",void 0),q.protos.indexOf("RTP")!==-1||q.protos.indexOf("rtp"),this.attributes={unrecognized:[],candidates:[],extmaps:[],fingerprints:[],imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[]}}parse(q){if(this.digested)throw new Error("already digested");try{switch(q.attField){case"extmap":this.parseExtmap(q);break;case"setup":this.parseSetup(q);break;case"ice-ufrag":this.parseIceUfrag(q);break;case"ice-pwd":this.parseIcePwd(q);break;case"ice-options":this.parseIceOptions(q);break;case"candidate":this.parseCandidate(q);break;case"remote-candidate":this.parseRemoteCandidate(q);break;case"end-of-candidates":this.parseEndOfCandidates();break;case"fingerprint":this.parseFingerprint(q);break;case"rtpmap":this.parseRtpmap(q);break;case"ptime":this.parsePtime(q);break;case"maxptime":this.parseMaxPtime(q);break;case"sendrecv":case"recvonly":case"sendonly":case"inactive":this.parseDirection(q);break;case"ssrc":this.parseSSRC(q);break;case"fmtp":this.parseFmtp(q);break;case"rtcp-fb":this.parseRtcpFb(q);break;case"rtcp-mux":this.parseRTCPMux();break;case"rtcp-mux-only":this.parseRTCPMuxOnly();break;case"rtcp-rsize":this.parseRTCPRsize();break;case"rtcp":this.parseRTCP(q);break;case"mid":this.parseMid(q);break;case"msid":this.parseMsid(q);break;case"imageattr":this.parseImageAttr(q);break;case"rid":this.parseRid(q);break;case"simulcast":this.parseSimulcast(q);break;case"sctp-port":this.parseSctpPort(q);break;case"max-message-size":this.parseMaxMessageSize(q);break;case"ssrc-group":this.parseSSRCGroup(q);break;default:q.ignored=!0,this.attributes.unrecognized.push(q)}}catch(Ee){throw console.error("parsing media attribute ".concat(q.attField,' error, "a=').concat(q.attField,":").concat(q.attValue,'"')),Ee}if(!q.ignored&&q.attValue&&!this.atEnd(q))throw new Error("attribute parsing error")}parseCandidate(q){let Ee=this.extractOneOrMore(q,Oe,[1,32]);this.consumeAttributeSpace(q);let Ae=this.extractOneOrMore(q,U,[1,5]);this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let bn=this.extractOneOrMore(q,U,[1,10]);this.consumeAttributeSpace(q);let ji=this.extract(q,this.consumeAddress);this.consumeAttributeSpace(q);let os=this.extract(q,this.consumePort);this.consumeAttributeSpace(q),this.extract(q,this.consume,"typ"),this.consumeAttributeSpace(q);let ll={foundation:Ee,componentId:Ae,transport:gt,priority:bn,connectionAddress:ji,port:os,type:this.extract(q,this.consumeToken),extension:{}};for(this.peek(q," raddr")&&(this.extract(q,this.consume," raddr"),this.consumeAttributeSpace(q),ll.relAddr=this.extract(q,this.consumeAddress)),this.peek(q," rport")&&(this.extract(q,this.consume," rport"),this.consumeAttributeSpace(q),ll.relPort=this.extract(q,this.consumePort));this.peekChar(q)===x;){this.consumeAttributeSpace(q);let Rm=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q),ll.extension[Rm]=this.extractOneOrMore(q,F)}this.attributes.candidates.push(ll)}parseRemoteCandidate(q){let Ee=[];for(;;){let Ae=this.extractOneOrMore(q,U,[1,5]);this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeAddress);this.consumeAttributeSpace(q);let bn=this.extract(q,this.consumePort);Ee.push({componentId:Ae,connectionAddress:gt,port:bn});try{this.consumeAttributeSpace(q)}catch{break}}this.attributes.remoteCandidatesList.push(Ee)}parseEndOfCandidates(){if(this.attributes.endOfCandidates)throw new Error("must be only one line of end-of-candidates");this.attributes.endOfCandidates=!0}parseRtpmap(q){let Ee=this.extract(q,this.consumeToken);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,"/");this.extract(q,this.consume,"/");let gt={encodingName:Ae,clockRate:this.extractOneOrMore(q,U)};this.atEnd(q)||this.peekChar(q)!=="/"||(this.extract(q,this.consume,"/"),gt.encodingParameters=parseInt(this.extract(q,this.consumeTill),10));let bn=this.attributes.payloads.find(ji=>ji.payloadType===parseInt(Ee,10));bn?bn.rtpMap=gt:this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtpMap:gt,rtcpFeedbacks:[]})}parsePtime(q){if(this.attributes.ptime)throw new Error("must be only one line of ptime");this.attributes.ptime=this.extract(q,this.consumeTill)}parseMaxPtime(q){if(this.attributes.maxPtime)throw new Error("must be only one line of ptime");this.attributes.maxPtime=this.extract(q,this.consumeTill)}parseDirection(q){if(this.attributes.direction)throw new Error("must be only one line of direction info");this.attributes.direction=q.attField}parseSSRC(q){let Ee=this.extractOneOrMore(q,U);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,":"),gt;this.peekChar(q)===":"&&(this.extract(q,this.consume,":"),gt=this.extract(q,this.consumeTill));let bn=this.attributes.ssrcs.find(ji=>ji.ssrcId===parseInt(Ee,10));bn?bn.attributes[Ae]=gt:this.attributes.ssrcs.push({ssrcId:parseInt(Ee,10),attributes:{[Ae]:gt}})}parseFmtp(q){let Ee=this.extract(q,this.consumeTill,x);this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill),gt={};Ae.split(";").forEach(ji=>{let[os,ll]=ji.split("=");os=ks(os).call(os);let Rm=typeof ll=="string"?ks(ll).call(ll):null;typeof os=="string"&&os.length>0&&(gt[os]=Rm)});let bn=this.attributes.payloads.find(ji=>ji.payloadType===parseInt(Ee,10));bn?bn.fmtp={parameters:gt}:this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtcpFeedbacks:[],fmtp:{parameters:gt}})}parseFmtParameters(q){let Ee={},Ae=this.extract(q,this.consumeTill,"=");q._cur++;let gt=this.extract(q,this.consumeTill,";");for(Ee[Ae]=gt;q.attValue[q._cur]===";";){let bn=this.extract(q,this.consumeTill,"=");q._cur++;let ji=this.extract(q,this.consumeTill,";");Ee[bn]=ji}return Ee}parseRtcpFb(q){let Ee="";Ee=this.peekChar(q)==="*"?this.extract(q,this.consume,"*"):this.extract(q,this.consumeTill,x),this.consumeAttributeSpace(q);let Ae=this.extract(q,this.consumeTill,x),gt;if(Ae==="trr-int")gt={type:Ae,interval:this.extract(q,this.consumeTill)};else{let bn={type:Ae};this.peekChar(q)===x&&(this.consumeAttributeSpace(q),bn.parameter=this.extract(q,this.consumeToken),this.peekChar(q)===x&&(bn.additional=this.extract(q,this.consumeTill))),gt=bn}if(Ee==="*")this.attributes.rtcpFeedbackWildcards.push(gt);else{let bn=this.attributes.payloads.find(ji=>ji.payloadType===parseInt(Ee,10));bn?bn.rtcpFeedbacks.push(gt):this.attributes.payloads.push({payloadType:parseInt(Ee,10),rtcpFeedbacks:[gt]})}}parseRTCPMux(){if(this.attributes.rtcpMux)throw new Error("must be single line of rtcp-mux");this.attributes.rtcpMux=!0}parseRTCPMuxOnly(){if(this.attributes.rtcpMuxOnly)throw new Error("must be single line of rtcp-only");this.attributes.rtcpMuxOnly=!0}parseRTCPRsize(){if(this.attributes.rtcpRsize)throw new Error("must be single line of rtcp-rsize");this.attributes.rtcpRsize=!0}parseRTCP(q){if(this.attributes.rtcp)throw new Error("must be single line of rtcp");let Ee={port:this.extract(q,this.consumePort)};this.peekChar(q)===x&&(this.consumeAttributeSpace(q),Ee.netType=this.extractOneOrMore(q,W),this.consumeAttributeSpace(q),Ee.addressType=this.extractOneOrMore(q,W),this.consumeAttributeSpace(q),Ee.address=this.extract(q,this.consumeAddress)),this.attributes.rtcp=Ee}parseMsid(q){let Ee={id:this.extractOneOrMore(q,W,[1,64])};this.peekChar(q)===x&&(this.consumeAttributeSpace(q),Ee.appdata=this.extractOneOrMore(q,W,[1,64])),this.attributes.msids.push(Ee)}parseImageAttr(q){this.attributes.imageattr.push(q.attValue)}parseRid(q){let Ee=this.extractOneOrMore(q,gt=>oe(gt)||U(gt)||gt==="_"||gt==="-");this.consumeAttributeSpace(q);let Ae={id:Ee,direction:this.extract(q,this.consumeToken),params:[]};if(this.peekChar(q)===x){if(this.consumeAttributeSpace(q),this.peek(q,"pt=")){this.extract(q,this.consume,"pt=");let gt=[];for(;;){let bn=this.extract(q,this.consumeToken);gt.push(bn);try{this.extract(q,this.consume,",")}catch{break}}Ae.payloads=gt,this.peekChar(q)===x&&this.extract(q,this.consume,x)}for(;;){let gt=this.extract(q,this.consumeToken);switch(gt){case"depend":{let bn={type:gt,rids:this.extract(q,this.consume,"=").split(",")};Ae.params.push(bn);break}default:{let bn={type:gt};this.peekChar(q)==="="&&(this.extract(q,this.consume,"="),bn.val=this.extract(q,this.consumeTill,";")),Ae.params.push(bn)}}try{this.extract(q,this.consume,";")}catch{break}}}this.attributes.rids.push(Ae)}parseSimulcast(q){if(this.attributes.simulcast)throw new Error("must be single line of simulcast");this.attributes.simulcast=q.attValue,this.extract(q,this.consumeTill)}parseSctpPort(q){this.attributes.sctpPort=this.extractOneOrMore(q,U,[1,5])}parseMaxMessageSize(q){this.attributes.maxMessageSize=this.extractOneOrMore(q,U,[1,void 0])}digest(){return this.digested=!0,this.attributes}parseMid(q){this.attributes.mid=this.extract(q,this.consumeToken)}parseSSRCGroup(q){let Ee=this.extract(q,this.consumeToken),Ae=[];for(;;)try{this.consumeAttributeSpace(q);let gt=this.extract(q,this.consumeInteger);Ae.push(parseInt(gt,10))}catch{break}this.attributes.ssrcGroups.push({semantic:Ee,ssrcIds:Ae})}}function mr(Rt,q,Ee){return q in Rt?Object.defineProperty(Rt,q,{value:Ee,enumerable:!0,configurable:!0,writable:!0}):Rt[q]=Ee,Rt}class Ou{constructor(){mr(this,"eol",R)}print(q,Ee){let Ae="";return Ee&&(this.eol=Ee),Ae+=this.printVersion(q.version),Ae+=this.printOrigin(q.origin),Ae+=this.printSessionName(q.sessionName),Ae+=this.printInformation(q.information),Ae+=this.printUri(q.uri),Ae+=this.printEmail(q.emails),Ae+=this.printPhone(q.phones),Ae+=this.printConnection(q.connection),Ae+=this.printBandwidth(q.bandwidths),Ae+=this.printTimeFields(q.timeFields),Ae+=this.printKey(q.key),Ae+=this.printSessionAttributes(q.attributes),Ae+=this.printMediaDescription(q.mediaDescriptions),Ae}printVersion(q){return"v=".concat(q).concat(this.eol)}printOrigin(q){return"o=".concat(q.username," ").concat(q.sessId," ").concat(q.sessVersion," ").concat(q.nettype," ").concat(q.addrtype," ").concat(q.unicastAddress).concat(this.eol)}printSessionName(q){return q?"s=".concat(q).concat(this.eol):""}printInformation(q){return q?"i=".concat(q).concat(this.eol):""}printUri(q){return q?"u=".concat(q).concat(this.eol):""}printEmail(q){let Ee="";for(let Ae of q)Ee+="e=".concat(Ae).concat(this.eol);return Ee}printPhone(q){let Ee="";for(let Ae of q)Ee+="e=".concat(Ae).concat(this.eol);return Ee}printConnection(q){return q?"c=".concat(q.nettype," ").concat(q.addrtype," ").concat(q.address).concat(this.eol):""}printBandwidth(q){let Ee="";for(let Ae of q)Ee+="b=".concat(Ae.bwtype,":").concat(Ae.bandwidth).concat(this.eol);return Ee}printTimeFields(q){let Ee="";for(let Ae of q){Ee+="t=".concat(Ae.time.startTime," ").concat(Ae.time.startTime).concat(this.eol);for(let gt of Ae.repeats)Ee+="r=".concat(gt.repeatInterval," ").concat(gt.typedTimes.join(" ")).concat(this.eol);Ae.zoneAdjustments&&(Ee+="z=",Ee+="z=".concat(Ae.zoneAdjustments.map(gt=>"".concat(gt.time," ").concat(gt.back?"-":""," ").concat(gt.typedTime)).join(" ")).concat(this.eol),Ee+=this.eol)}return Ee}printKey(q){return q?"k=".concat(q).concat(this.eol):""}printAttributes(q){let Ee="";for(let Ae of q)Ee+="a=".concat(Ae.attField).concat(Ae.attValue?":".concat(Ae.attValue):"").concat(this.eol);return Ee}printMediaDescription(q){let Ee="";for(let Ae of q)Ee+=this.printMedia(Ae.media),Ee+=this.printInformation(Ae.information),Ee+=this.printConnections(Ae.connections),Ee+=this.printBandwidth(Ae.bandwidths),Ee+=this.printKey(Ae.key),Ee+=this.printMediaAttributes(Ae);return Ee}printConnections(q){let Ee="";for(let Ae of q)Ee+=this.printConnection(Ae);return Ee}printMedia(q){return"m=".concat(q.mediaType," ").concat(q.port," ").concat(q.protos.join("/")," ").concat(q.fmts.join(" ")).concat(this.eol)}printSessionAttributes(q){return new yt(this.eol).print(q)}printMediaAttributes(q){return new Vt(this.eol).print(q)}}class at{constructor(q){mr(this,"eol",void 0),this.eol=q}printIceUfrag(q){return q===void 0?"":"a=ice-ufrag:".concat(q).concat(this.eol)}printIcePwd(q){return q===void 0?"":"a=ice-pwd:".concat(q).concat(this.eol)}printIceOptions(q){return q===void 0?"":"a=ice-options:".concat(q.join(x)).concat(this.eol)}printFingerprints(q){return q.length>0?q.map(Ee=>"a=fingerprint:".concat(Ee.hashFunction).concat(x).concat(Ee.fingerprint)).join(this.eol)+this.eol:""}printExtmap(q){return q.map(Ee=>"a=extmap:".concat(Ee.entry).concat(Ee.direction?"/".concat(Ee.direction):"").concat(x).concat(Ee.extensionName).concat(Ee.extensionAttributes?"".concat(x).concat(Ee.extensionAttributes):"").concat(this.eol)).join("")}printSetup(q){return q===void 0?"":"a=setup:".concat(q).concat(this.eol)}printUnrecognized(q){return q.map(Ee=>"a=".concat(Ee.attField).concat(Ee.attValue?":".concat(Ee.attValue):"").concat(this.eol)).join("")}}class yt extends at{print(q){let Ee="";return Ee+=this.printGroups(q.groups),Ee+=this.printMsidSemantic(q.msidSemantic),Ee+=this.printIceLite(q.iceLite),Ee+=this.printIceUfrag(q.iceUfrag),Ee+=this.printIcePwd(q.icePwd),Ee+=this.printIceOptions(q.iceOptions),Ee+=this.printFingerprints(q.fingerprints),Ee+=this.printSetup(q.setup),Ee+=this.printTlsId(q.tlsId),Ee+=this.printIdentity(q.identities),Ee+=this.printExtmap(q.extmaps),Ee+=this.printUnrecognized(q.unrecognized),Ee}printGroups(q){let Ee="";return q.length>0&&(Ee+=q.map(Ae=>"a=group:".concat(Ae.semantic).concat(Ae.identificationTag.map(gt=>"".concat(x).concat(gt)).join("")).concat(this.eol)).join("")),Ee}printIceLite(q){return q===void 0?"":"a=ice-lite"+this.eol}printTlsId(q){return q?"a=tls-id:".concat(q).concat(this.eol):""}printIdentity(q){return q.length===0?"":q.map(Ee=>"a=identity:".concat(Ee.assertionValue).concat(Ee.extensions.map(Ae=>"".concat(x).concat(Ae.name).concat(Ae.value?"=".concat(Ae.value):"")))).join(this.eol)+this.eol}printMsidSemantic(q){if(!q)return"";let Ee="a=msid-semantic:".concat(q.semantic);return q.applyForAll?Ee+="".concat(x,"*"):q.identifierList.length>0&&(Ee+=q.identifierList.map(Ae=>"".concat(x).concat(Ae))),Ee+this.eol}}class Vt extends at{print(q){let Ee=q.attributes,Ae="";return Ae+=this.printRTCP(Ee.rtcp),Ae+=this.printIceUfrag(Ee.iceUfrag),Ae+=this.printIcePwd(Ee.icePwd),Ae+=this.printIceOptions(Ee.iceOptions),Ae+=this.printCandidates(Ee.candidates),Ae+=this.printRemoteCandidatesList(Ee.remoteCandidatesList),Ae+=this.printEndOfCandidates(Ee.endOfCandidates),Ae+=this.printFingerprints(Ee.fingerprints),Ae+=this.printSetup(Ee.setup),Ae+=this.printMid(Ee.mid),Ae+=this.printExtmap(Ee.extmaps),Ae+=this.printRTPRelated(Ee),Ae+=this.printPtime(Ee.ptime),Ae+=this.printMaxPtime(Ee.maxPtime),Ae+=this.printDirection(Ee.direction),Ae+=this.printSSRCGroups(Ee.ssrcGroups),Ae+=this.printSSRC(Ee.ssrcs),Ae+=this.printRTCPMux(Ee.rtcpMux),Ae+=this.printRTCPMuxOnly(Ee.rtcpMuxOnly),Ae+=this.printRTCPRsize(Ee.rtcpRsize),Ae+=this.printMSId(Ee.msids),Ae+=this.printImageattr(Ee.imageattr),Ae+=this.printRid(Ee.rids),Ae+=this.printSimulcast(Ee.simulcast),Ae+=this.printSCTPPort(Ee.sctpPort),Ae+=this.printMaxMessageSize(Ee.maxMessageSize),Ae+=this.printUnrecognized(Ee.unrecognized),Ae}printCandidates(q){return q.map(Ee=>"a=candidate:".concat(Ee.foundation).concat(x).concat(Ee.componentId).concat(x).concat(Ee.transport).concat(x).concat(Ee.priority).concat(x).concat(Ee.connectionAddress).concat(x).concat(Ee.port).concat(x,"typ").concat(x).concat(Ee.type).concat(Ee.relAddr?"".concat(x,"raddr").concat(x).concat(Ee.relAddr):"").concat(Ee.relPort?"".concat(x,"rport").concat(x).concat(Ee.relPort):"").concat(Object.keys(Ee.extension).map(Ae=>"".concat(x).concat(Ae).concat(x).concat(Ee.extension[Ae])).join("")).concat(this.eol)).join("")}printRemoteCandidatesList(q){return q.map(Ee=>"a=remote-candidates:".concat(Ee.join(x)).concat(this.eol)).join("")}printEndOfCandidates(q){return q===void 0?"":"a=end-of-candidates"+this.eol}printRTPRelated(q){if(!q.payloads)return"";let Ee=q.payloads,Ae="";Ae+=q.rtcpFeedbackWildcards.map(gt=>this.printRTCPFeedback("*",gt)).join("");for(let gt of Ee)Ae+=this.printRtpMap(gt.payloadType,gt.rtpMap),Ae+=this.printFmtp(gt.payloadType,gt.fmtp),Ae+=gt.rtcpFeedbacks.map(bn=>this.printRTCPFeedback(gt.payloadType,bn)).join("");return Ae}printFmtp(q,Ee){if(!Ee)return"";let Ae=Object.keys(Ee.parameters);return Ae.length===1&&Ee.parameters[Ae[0]]===null?"a=fmtp:".concat(q).concat(x).concat(Ae[0]).concat(this.eol):"a=fmtp:".concat(q).concat(x).concat(Object.keys(Ee.parameters).map(gt=>"".concat(gt,"=").concat(Ee.parameters[gt])).join(";")).concat(this.eol)}printRtpMap(q,Ee){return Ee?"a=rtpmap:".concat(q).concat(x).concat(Ee.encodingName,"/").concat(Ee.clockRate).concat(Ee.encodingParameters?"/".concat(Ee.encodingParameters):"").concat(this.eol):""}printRTCPFeedback(q,Ee){let Ae="a=rtcp-fb:".concat(q).concat(x),gt=Ee;return gt.type==="trr-int"?Ae+="ttr-int".concat(x).concat(gt.interval):(Ae+="".concat(gt.type),gt.parameter&&(Ae+="".concat(x).concat(gt.parameter),gt.additional&&(Ae+="".concat(x).concat(gt.additional)))),Ae+this.eol}printPtime(q){return q===void 0?"":"a=ptime:".concat(q).concat(this.eol)}printMaxPtime(q){return q===void 0?"":"a=maxptime:".concat(q).concat(this.eol)}printDirection(q){return q===void 0?"":"a=".concat(q).concat(this.eol)}printSSRC(q){return q.map(Ee=>Object.keys(Ee.attributes).map(Ae=>"a=ssrc:".concat(Ee.ssrcId.toString(10)).concat(x).concat(Ae).concat(Ee.attributes[Ae]?":".concat(Ee.attributes[Ae]):"").concat(this.eol)).join("")).join("")}printRTCPMux(q){return q===void 0?"":"a=rtcp-mux".concat(this.eol)}printRTCPMuxOnly(q){return q===void 0?"":"a=rtcp-mux-only".concat(this.eol)}printRTCPRsize(q){return q===void 0?"":"a=rtcp-rsize".concat(this.eol)}printRTCP(q){if(q===void 0)return"";let Ee="a=rtcp:".concat(q.port);return q.netType&&(Ee+="".concat(x).concat(q.netType)),q.addressType&&(Ee+="".concat(x).concat(q.addressType)),q.address&&(Ee+="".concat(x).concat(q.address)),Ee+this.eol}printMSId(q){return q.map(Ee=>"a=msid:".concat(Ee.id).concat(Ee.appdata?"".concat(x).concat(Ee.appdata):"").concat(this.eol)).join("")}printImageattr(q){return q.map(Ee=>"a=imageattr:".concat(Ee).concat(this.eol)).join("")}printRid(q){return q.map(Ee=>{let Ae="a=rid:".concat(Ee.id).concat(x).concat(Ee.direction);return Ee.payloads&&(Ae+="".concat(x,"pt=").concat(Ee.payloads.join(","))),Ee.params.length>0&&(Ae+="".concat(x).concat(Ee.params.map(gt=>gt.type==="depend"?"depend=".concat(gt.rids.join(",")):"".concat(gt.type,"=").concat(gt.val)).join(";"))),Ae+this.eol}).join("")}printSimulcast(q){return q===void 0?"":"a=simulcast:".concat(q).concat(this.eol)}printSCTPPort(q){return q===void 0?"":"a=sctp-port:".concat(q).concat(this.eol)}printMaxMessageSize(q){return q===void 0?"":"a=max-message-size:".concat(q).concat(this.eol)}printMid(q){return q===void 0?"":"a=mid:".concat(q).concat(this.eol)}printSSRCGroups(q){return q.map(Ee=>"a=ssrc-group:".concat(Ee.semantic).concat(Ee.ssrcIds.map(Ae=>"".concat(x).concat(Ae.toString(10))).join("")).concat(this.eol)).join("")}}function Rn(Rt){return new $n().parse(Rt)}function oi(Rt,q){return new Ou().print(Rt,q)}}},c={};function f(m){if(c[m])return c[m].exports;var v=c[m]={exports:{}};return o[m](v,v.exports,f),v.exports}return f.d=(m,v)=>{for(var w in v)f.o(v,w)&&!f.o(m,w)&&Object.defineProperty(m,w,{enumerable:!0,get:v[w]})},f.o=(m,v)=>Object.prototype.hasOwnProperty.call(m,v),f.r=m=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(m,"__esModule",{value:!0})},f(8)})()})(Soe);var rr=Soe.exports;function Ru(r){if(Array.isArray(r))return r.map(o=>o);if(!boe(r))return r;let a={};for(let o in r){let c=r[o];boe(c)||Array.isArray(c)?a[o]=Ru(c):a[o]=c}return a}function boe(r){return!(typeof r!="object"||Array.isArray(r)||!r)}class CW{constructor(a){X(this,"input",[]),X(this,"size",void 0),this.size=a}add(a){this.input.push(a),this.input.length>this.size&&this.input.splice(0,1)}diffMean(){return this.input.length===0?0:(this.input[this.input.length-1]-this.input[0])/this.input.length}}let Wf={address:"unknown",candidateType:"unknown",id:"unknown",port:0,priority:0,protocol:"unknown",type:"unknown"},J3={timestamp:0,bitrate:{actualEncoded:0,transmit:0},sendPacketLossRate:0,recvPacketLossRate:0,videoRecv:[],videoSend:[],audioRecv:[],audioSend:[],selectedCandidatePair:{id:"unknown",localCandidate:Wf,remoteCandidate:Wf}},Coe={firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,qpSumPerFrame:0,framesDroppedCount:0,outputFrameRate:0},Toe={firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,jitterMs:0,qpSumPerFrame:0},Roe={bytes:0,packets:0,packetsLost:0,packetLostRate:0,ssrc:0,rttMs:0,jitterMs:0},xoe={jitterBufferMs:0,jitterMs:0,bytes:0,packetsLost:0,packetLostRate:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0,concealedSamples:0};function Aoe(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Ioe(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Aoe(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Aoe(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class TW{constructor(a,o){X(this,"onFirstVideoReceived",void 0),X(this,"onFirstVideoDecoded",void 0),X(this,"onFirstAudioReceived",void 0),X(this,"onFirstVideoDecodedTimeout",void 0),X(this,"onFirstAudioDecoded",void 0),X(this,"onSelectedLocalCandidateChanged",void 0),X(this,"onSelectedRemoteCandidateChanged",void 0),X(this,"videoIsReady",!1),X(this,"videoIsReady2",{}),X(this,"pc",void 0),X(this,"options",void 0),X(this,"intervalTimer",void 0),X(this,"stats",Ru(J3)),X(this,"isFirstVideoReceived",{}),X(this,"isFirstVideoDecoded",{}),X(this,"isFirstAudioReceived",{}),X(this,"isFirstAudioDecoded",{}),X(this,"isFirstVideoDecodedTimeout",{}),X(this,"lossRateWindowStats",[]),this.pc=a,this.options=o,this.intervalTimer=window.setInterval(async()=>{this.updateStats()},this.options.updateInterval)}getStats(){return this.stats}getSelectedCandidatePair(){return new Ct(a=>{a({local:Ioe({},Wf),remote:Ioe({},Wf)})})}setVideoIsReady(a){this.videoIsReady=a}setVideoIsReady2(a,o){this.videoIsReady2[a]=o}getVideoIsReady(a){return this.videoIsReady2[a]||!1}setIsFirstAudioDecoded(a){}destroy(){window.clearInterval(this.intervalTimer),this.pc=void 0}calcLossRate(a){this.lossRateWindowStats.push(a),this.lossRateWindowStats.length>this.options.lossRateInterval&&this.lossRateWindowStats.splice(0,1);let o=this.lossRateWindowStats.length,c=["videoSend","audioSend","videoRecv","audioRecv"],f=0,m=0,v=0,w=0;for(let C of c)a[C].forEach((R,x)=>{if(!this.lossRateWindowStats[o-1][C][x]||!this.lossRateWindowStats[0][C][x])return;let L=this.lossRateWindowStats[o-1][C][x].packets-this.lossRateWindowStats[0][C][x].packets,U=this.lossRateWindowStats[o-1][C][x].packetsLost-this.lossRateWindowStats[0][C][x].packetsLost;C==="videoSend"||C==="audioSend"?(f+=L,v+=U):(m+=L,w+=U),Number.isNaN(L)||Number.isNaN(L)?R.packetLostRate=0:R.packetLostRate=L<=0||U<=0?0:U/(L+U)});a.sendPacketLossRate=f<=0||v<=0?0:v/(f+v),a.recvPacketLossRate=m<=0||w<=0?0:w/(m+w)}}function Noe(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function E4e(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Noe(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Noe(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class w4e extends TW{constructor(){super(...arguments),X(this,"_stats",J3),X(this,"lastDecodeVideoReceiverStats",new Map)}async updateStats(){let a=await this._getStats(),o=this.statsResponsesToObjects(a);this._stats=Ru(J3);let c=o.filter(m=>m.type==="ssrc");this.processSSRCStats(c);let f=o.find(m=>m.type==="VideoBwe");f&&this.processBandwidthStats(f),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats}processBandwidthStats(a){this._stats.bitrate={actualEncoded:Number(a.googActualEncBitrate),targetEncoded:Number(a.googTargetEncBitrate),retransmit:Number(a.googRetransmitBitrate),transmit:Number(a.googTransmitBitrate)},this._stats.sendBandwidth=Number(a.googAvailableSendBandwidth)}processSSRCStats(a){a.forEach(o=>{var c;let f=Tt(c=o.id).call(c,"send");switch("".concat(o.mediaType,"_").concat(f?"send":"recv")){case"video_send":{let m=Ru(Toe);m.codec=o.googCodecName,m.adaptionChangeReason="none",o.googCpuLimitedResolution&&(m.adaptionChangeReason="cpu"),o.googBandwidthLimitedResolution&&(m.adaptionChangeReason="bandwidth"),m.avgEncodeMs=Number(o.googAvgEncodeMs),m.inputFrame={width:Number(o.googFrameWidthInput)||Number(o.googFrameWidthSent),height:Number(o.googFrameHeightInput)||Number(o.googFrameHeightSent),frameRate:Number(o.googFrameRateInput)},m.sentFrame={width:Number(o.googFrameWidthSent),height:Number(o.googFrameHeightSent),frameRate:Number(o.googFrameRateInput)},m.firsCount=Number(o.googFirReceived),m.nacksCount=Number(o.googNacksReceived),m.plisCount=Number(o.googPlisReceived),m.frameCount=Number(o.framesEncoded),m.bytes=Number(o.bytesSent),m.packets=Number(o.packetsSent),m.packetsLost=Number(o.packetsLost),m.ssrc=Number(o.ssrc),m.rttMs=Number(o.googRtt||0),this._stats.videoSend.push(m),this._stats.rtt=m.rttMs;break}case"video_recv":{let m=Ru(Coe),v=this.lastDecodeVideoReceiverStats.get(Number(o.ssrc));if(m.codec=o.googCodecName,m.targetDelayMs=Number(o.googTargetDelayMs),m.renderDelayMs=Number(o.googRenderDelayMs),m.currentDelayMs=Number(o.googCurrentDelayMs),m.minPlayoutDelayMs=Number(o.googMinPlayoutDelayMs),m.decodeMs=Number(o.googDecodeMs),m.maxDecodeMs=Number(o.googMaxDecodeMs),m.receivedFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateReceived)},m.decodedFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateDecoded)},m.decodeFrameRate=Number(o.googFrameRateDecoded),m.outputFrame={width:Number(o.googFrameWidthReceived),height:Number(o.googFrameHeightReceived),frameRate:Number(o.googFrameRateOutput)},m.jitterBufferMs=Number(o.googJitterBufferMs),m.firsCount=Number(o.googFirsSent),m.nacksCount=Number(o.googNacksSent),m.plisCount=Number(o.googPlisSent),m.framesDecodeCount=Number(o.framesDecoded),m.bytes=Number(o.bytesReceived),m.packets=Number(o.packetsReceived),m.packetsLost=Number(o.packetsLost),m.ssrc=Number(o.ssrc),m.packets>0&&!this.isFirstVideoReceived[m.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(m.ssrc),this.isFirstVideoReceived[m.ssrc]=!0),m.framesDecodeCount>0&&!this.isFirstVideoDecoded[m.ssrc]&&(this.onFirstVideoDecoded&&this.onFirstVideoDecoded(m.ssrc,m.decodedFrame.width,m.decodedFrame.height),this.isFirstVideoDecoded[m.ssrc]=!0),v){let w=v.stats,C=Date.now()-v.lts;m.framesDecodeFreezeTime=w.framesDecodeFreezeTime,m.framesDecodeInterval=w.framesDecodeInterval,m.framesDecodeCount>w.framesDecodeCount&&this.isFirstVideoDecoded[m.ssrc]?(v.lts=Date.now(),m.framesDecodeInterval=C,m.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(o.ssrc,10))?m.framesDecodeFreezeTime+=m.framesDecodeInterval:this.setVideoIsReady2(parseInt(o.ssrc,10),!0))):m.framesDecodeCount<v.stats.framesDecodeCount&&(m.framesDecodeInterval=0)}this.lastDecodeVideoReceiverStats.set(m.ssrc,{stats:E4e({},m),lts:Date.now()}),this._stats.videoRecv.push(m);break}case"audio_recv":{let m=Ru(xoe);m.codec=o.googCodecName,m.outputLevel=Math.abs(Number(o.audioOutputLevel))/32767,m.decodingCNG=Number(o.googDecodingCNG),m.decodingCTN=Number(o.googDecodingCTN),m.decodingCTSG=Number(o.googDecodingCTSG),m.decodingNormal=Number(o.googDecodingNormal),m.decodingPLC=Number(o.googDecodingPLC),m.decodingPLCCNG=Number(o.googDecodingPLCCNG),m.expandRate=Number(o.googExpandRate),m.accelerateRate=Number(o.googAccelerateRate),m.preemptiveExpandRate=Number(o.googPreemptiveExpandRate),m.secondaryDecodedRate=Number(o.googSecondaryDecodedRate),m.speechExpandRate=Number(o.googSpeechExpandRate),m.preferredJitterBufferMs=Number(o.googPreferredJitterBufferMs),m.jitterBufferMs=Number(o.googJitterBufferMs),m.jitterMs=Number(o.googJitterReceived),m.bytes=Number(o.bytesReceived),m.packets=Number(o.packetsReceived),m.packetsLost=Number(o.packetsLost),m.ssrc=Number(o.ssrc),m.receivedFrames=Number(o.googDecodingCTN)||Number(o.packetsReceived),m.droppedFrames=Number(o.googDecodingPLC)+Number(o.googDecodingPLCCNG)||Number(o.packetsLost),m.receivedFrames>0&&!this.isFirstAudioReceived[m.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(m.ssrc),this.isFirstAudioReceived[m.ssrc]=!0),m.decodingNormal>0&&!this.isFirstAudioDecoded[m.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(m.ssrc),this.isFirstAudioDecoded[m.ssrc]=!0),this._stats.audioRecv.push(m);break}case"audio_send":{let m=Ru(Roe);m.codec=o.googCodecName,m.inputLevel=Math.abs(Number(o.audioInputLevel))/32767,m.aecReturnLoss=Number(o.googEchoCancellationReturnLoss||0),m.aecReturnLossEnhancement=Number(o.googEchoCancellationReturnLossEnhancement||0),m.residualEchoLikelihood=Number(o.googResidualEchoLikelihood||0),m.residualEchoLikelihoodRecentMax=Number(o.googResidualEchoLikelihoodRecentMax||0),m.bytes=Number(o.bytesSent),m.packets=Number(o.packetsSent),m.packetsLost=Number(o.packetsLost),m.ssrc=Number(o.ssrc),m.rttMs=Number(o.googRtt||0),this._stats.rtt=m.rttMs,this._stats.audioSend.push(m);break}}})}_getStats(){return new Ct((a,o)=>{this.pc.getStats(a,o)})}statsResponsesToObjects(a){let o=[];return a.result().forEach(c=>{let f={id:c.id,timestamp:c.timestamp.valueOf().toString(),type:c.type};c.names().forEach(m=>{f[m]=c.stat(m)}),o.push(f)}),o}}function Ooe(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function a_(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Ooe(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ooe(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class Poe extends TW{constructor(){super(...arguments),X(this,"_stats",J3),X(this,"report",void 0),X(this,"lastDecodeVideoReceiverStats",new Map),X(this,"lastVideoFramesRecv",new Map),X(this,"lastVideoFramesSent",new Map),X(this,"lastVideoFramesDecode",new Map),X(this,"lastVideoFramesOutput",new Map),X(this,"lastVideoJBDelay",new Map),X(this,"lastAudioJBDelay",new Map),X(this,"mediaBytesSent",new Map),X(this,"mediaBytesRetransmit",new Map),X(this,"mediaBytesTargetEncode",new Map),X(this,"lastEncoderMs",new Map)}async updateStats(){this.report=await this.pc.getStats(),this._stats=Ru(J3),this.report.forEach(a=>{switch(a.type){case Tc.OUTBOUND:case Tc.INBOUND:{let o=a.mediaType||a.kind,c=!o&&"frameWidth"in a,f=!o&&!("frameWidth"in a);a.type===Tc.OUTBOUND?o==="audio"||f?this.processAudioOutboundStats(a):(o==="video"||c)&&this.processVideoOutboundStats(a):a.type===Tc.INBOUND&&(o==="audio"||f?this.processAudioInboundStats(a):(o==="video"||c)&&this.processVideoInboundStats(a));break}case Tc.TRANSPORT:{let o=this.report.get(a.selectedCandidatePairId);o&&this.processCandidatePairStats(o);break}case Tc.CANDIDATE_PAIR:a.selected&&this.processCandidatePairStats(a)}}),this.updateSendBitrate(),this._stats.timestamp=Date.now(),this.calcLossRate(this._stats),this.stats=this._stats}async getSelectedCandidatePair(){let a=await this.pc.getStats(),o={local:a_({},Wf),remote:a_({},Wf)};return a.forEach(c=>{let f;if(c.type===Tc.TRANSPORT&&(f=a.get(c.selectedCandidatePairId)),c.type===Tc.CANDIDATE_PAIR&&c.selected&&(f=c),f){let m=(v,w)=>{v.type=w.type,v.id=w.id,w.address&&(v.address=w.address),w.candidateType&&(v.candidateType=w.candidateType),w.port&&(v.port=w.port),w.priority&&(v.priority=w.priority),w.protocol&&(v.protocol=w.protocol),w.relayProtocol&&(v.relayProtocol=w.relayProtocol)};if(f.localCandidateId){let v=a.get(f.localCandidateId);v&&m(o.local,v)}if(f.remoteCandidateId){let v=a.get(f.remoteCandidateId);v&&m(o.remote,v)}}}),o}processCandidatePairStats(a){if(this._stats.sendBandwidth=a.availableOutgoingBitrate||0,a.currentRoundTripTime&&(this._stats.rtt=1e3*a.currentRoundTripTime),this._stats.videoSend.forEach(o=>{a.currentRoundTripTime&&(o.rttMs=1e3*a.currentRoundTripTime)}),this._stats.audioSend.forEach(o=>{a.currentRoundTripTime&&(o.rttMs=1e3*a.currentRoundTripTime)}),this._stats.selectedCandidatePair.id=a.id,a.localCandidateId){let o=this.report.get(a.localCandidateId);o&&this.processCandidateStats(o)}if(a.remoteCandidateId){let o=this.report.get(a.remoteCandidateId);o&&this.processCandidateStats(o)}}processCandidateStats(a){let o;a.type===Tc.LOCAL_CANDIDATE&&(o=this._stats.selectedCandidatePair.localCandidate),a.type===Tc.REMOTE_CANDIDATE&&(o=this._stats.selectedCandidatePair.remoteCandidate),o&&(o.type=a.type,o.id=a.id,a.address&&(o.address=a.address),a.candidateType&&(o.candidateType=a.candidateType),a.port&&(o.port=a.port),a.priority&&(o.priority=a.priority),a.protocol&&(o.protocol=a.protocol),a.relayProtocol&&(o.relayProtocol=a.relayProtocol),a.type===Tc.LOCAL_CANDIDATE&&this.stats.selectedCandidatePair.localCandidate.id!==o.id&&this.onSelectedLocalCandidateChanged&&this.onSelectedLocalCandidateChanged(a_({},o),a_({},this.stats.selectedCandidatePair.localCandidate)),a.type===Tc.REMOTE_CANDIDATE&&this.stats.selectedCandidatePair.remoteCandidate.id!==o.id&&this.onSelectedRemoteCandidateChanged&&this.onSelectedRemoteCandidateChanged(a_({},o),a_({},this.stats.selectedCandidatePair.remoteCandidate)))}processAudioInboundStats(a){let o=this._stats.audioRecv.find(c=>c.ssrc===a.ssrc);o||(o=Ru(xoe),this._stats.audioRecv.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsReceived,o.packetsLost=a.packetsLost,o.bytes=a.bytesReceived,o.jitterMs=1e3*a.jitter,this.processAudioTrackReceiverStats(a,a.trackId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),o.receivedFrames||(o.receivedFrames=a.packetsReceived),o.droppedFrames||(o.droppedFrames=a.packetsLost),o.receivedFrames>0&&!this.isFirstAudioReceived[o.ssrc]&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(o.ssrc),this.isFirstAudioReceived[o.ssrc]=!0),o.outputLevel&&o.outputLevel>0&&!this.isFirstAudioDecoded[o.ssrc]&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(o.ssrc),this.isFirstAudioDecoded[o.ssrc]=!0),typeof a.concealedSamples=="number"&&(o.concealedSamples=a.concealedSamples)}processVideoInboundStats(a){let o=this._stats.videoRecv.find(w=>w.ssrc===a.ssrc);o||(o=Ru(Coe),this._stats.videoRecv.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsReceived,o.packetsLost=a.packetsLost,o.bytes=a.bytesReceived,o.firsCount=a.firCount,o.nacksCount=a.nackCount,o.plisCount=a.pliCount,o.framesDecodeCount=a.framesDecoded,o.framesDroppedCount=a.framesDropped,o.totalInterFrameDelay=a.totalInterFrameDelay,o.totalSquaredInterFrameDelay=a.totalSquaredInterFrameDelay,o.totalFreezesDuration=a.totalFreezesDuration;let c=this.lastDecodeVideoReceiverStats.get(o.ssrc),f=this.lastVideoFramesDecode.get(o.ssrc),m=this.lastVideoFramesOutput.get(o.ssrc),v=Date.now();if(o.framesDecodeCount>0&&!this.isFirstVideoDecoded[o.ssrc]){let w=o.decodedFrame?o.decodedFrame.width:0,C=o.decodedFrame?o.decodedFrame.height:0;this.onFirstVideoDecoded&&this.onFirstVideoDecoded(o.ssrc,w,C),this.isFirstVideoDecoded[o.ssrc]=!0}if(c){let w=c.stats,C=v-c.lts;o.framesDecodeFreezeTime=w.framesDecodeFreezeTime,o.framesDecodeInterval=w.framesDecodeInterval,!this.isFirstVideoDecoded[o.ssrc]&&C>this.options.firstVideoDecodedTimeout&&!this.isFirstVideoDecodedTimeout[o.ssrc]&&(this.onFirstVideoDecodedTimeout&&this.onFirstVideoDecodedTimeout(o.ssrc),this.isFirstVideoDecodedTimeout[o.ssrc]=!0),o.framesDecodeCount>w.framesDecodeCount&&this.isFirstVideoDecoded[o.ssrc]?(c.lts=Date.now(),o.framesDecodeInterval=C,o.framesDecodeInterval>=this.options.freezeRateLimit&&(this.getVideoIsReady(parseInt(a.ssrc))?o.framesDecodeFreezeTime+=o.framesDecodeInterval:this.setVideoIsReady2(parseInt(a.ssrc,10),!0))):o.framesDecodeCount<w.framesDecodeCount&&(o.framesDecodeInterval=0),a.framesDecoded&&a.qpSum&&(c.stats.framesDecodeCount>a.framesDecoded?o.qpSumPerFrame=a.qpSum/a.framesDecoded:o.qpSumPerFrame=(a.qpSum-c.qpSum)/(a.framesDecoded-c.stats.framesDecodeCount))}f&&v-f.lts>=800?(o.decodeFrameRate=Math.round((o.framesDecodeCount-f.count)/((v-f.lts)/1e3)),this.lastVideoFramesDecode.set(o.ssrc,{count:o.framesDecodeCount,lts:v,rate:o.decodeFrameRate})):f?o.decodeFrameRate=f.rate:this.lastVideoFramesDecode.set(o.ssrc,{count:o.framesDecodeCount,lts:v,rate:0}),o.framesDroppedCount&&a.framesReceived&&(m&&v-m.lts>=800?(o.outputFrameRate=Math.round((a.framesReceived-o.framesDroppedCount-m.count)/((v-m.lts)/1e3)),this.lastVideoFramesOutput.set(o.ssrc,{count:a.framesReceived-o.framesDroppedCount,lts:v,rate:Math.max(o.outputFrameRate,0)})):m?o.outputFrameRate=m.rate:this.lastVideoFramesOutput.set(o.ssrc,{count:a.framesReceived-o.framesDroppedCount,lts:v,rate:0})),a.totalDecodeTime&&(o.decodeMs=1e3*a.totalDecodeTime),this.processVideoTrackReceiverStats(a,a.trackId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),a.framerateMean&&(o.framesRateFirefox=a.framerateMean),o.packets>0&&!this.isFirstVideoReceived[o.ssrc]&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(o.ssrc),this.isFirstVideoReceived[o.ssrc]=!0),this.lastDecodeVideoReceiverStats.set(o.ssrc,{stats:a_({},o),lts:c?c.lts:Date.now(),qpSum:a.qpSum})}processVideoOutboundStats(a){let o=this._stats.videoSend.find(f=>f.ssrc===a.ssrc);o||(o=Ru(Toe),this._stats.videoSend.push(o));let c=this.mediaBytesSent.get(a.ssrc);if(c)c.add(a.bytesSent);else{let f=new CW(10);f.add(a.bytesSent),this.mediaBytesSent.set(a.ssrc,f)}if(a.retransmittedBytesSent!==void 0){let f=this.mediaBytesRetransmit.get(a.ssrc);if(f)f.add(a.retransmittedBytesSent);else{let m=new CW(10);m.add(a.retransmittedBytesSent),this.mediaBytesRetransmit.set(a.ssrc,m)}}if(a.totalEncodedBytesTarget){let f=this.mediaBytesTargetEncode.get(a.ssrc);if(f)f.add(a.totalEncodedBytesTarget);else{let m=new CW(10);m.add(a.totalEncodedBytesTarget),this.mediaBytesTargetEncode.set(a.ssrc,m)}}if(o.ssrc=a.ssrc,o.bytes=a.bytesSent,o.packets=a.packetsSent,o.firsCount=a.firCount,o.nacksCount=a.nackCount,o.plisCount=a.pliCount,o.frameCount=a.framesEncoded,o.adaptionChangeReason=a.qualityLimitationReason,o.scalabilityMode=a.scalabilityMode,a.totalEncodeTime&&a.framesEncoded){let f=this.lastEncoderMs.get(a.ssrc);if(!f||f.lastFrameCount>a.framesEncoded)o.avgEncodeMs=1e3*a.totalEncodeTime/a.framesEncoded;else{let m=a.framesEncoded-f.lastFrameCount,v=a.totalEncodeTime-f.lastEncoderTime;o.avgEncodeMs=1e3*v/m}}if(a.framesEncoded&&a.qpSum){let f=this.lastEncoderMs.get(a.ssrc);!f||f.lastFrameCount>a.framesEncoded?o.qpSumPerFrame=a.qpSum/a.framesEncoded:o.qpSumPerFrame=(a.qpSum-f.lastQpSum)/(a.framesEncoded-f.lastFrameCount)}if(this.lastEncoderMs.set(a.ssrc,{lastFrameCount:a.framesEncoded,lastEncoderTime:a.totalEncodeTime,lastQpSum:a.qpSum,lts:Date.now()}),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),a.mediaSourceId&&this.processVideoMediaSource(a.mediaSourceId,o),this.processVideoTrackSenderStats(a,a.trackId,o),a.remoteId)this.processRemoteInboundStats(a.remoteId,o);else{let f=this.findRemoteStatsId(a.ssrc,Tc.REMOTE_INBOUND);f&&this.processRemoteInboundStats(f,o)}}processAudioOutboundStats(a){let o=this._stats.audioSend.find(c=>c.ssrc===a.ssrc);if(o||(o=Ru(Roe),this._stats.audioSend.push(o)),o.ssrc=a.ssrc,o.packets=a.packetsSent,o.bytes=a.bytesSent,a.mediaSourceId&&this.processAudioMediaSource(a.mediaSourceId,o),a.codecId&&(o.codec=this.getCodecFromCodecStats(a.codecId)),this.processAudioTrackSenderStats(a,a.trackId,o),a.remoteId)this.processRemoteInboundStats(a.remoteId,o);else{let c=this.findRemoteStatsId(a.ssrc,Tc.REMOTE_INBOUND);c&&this.processRemoteInboundStats(c,o)}}findRemoteStatsId(a,o){var c;let f=Array.from(Sh(c=this.report).call(c)).find(m=>m.type===o&&m.ssrc===a);return f?f.id:null}processVideoMediaSource(a,o){let c=this.report.get(a);c&&c.width&&c.height&&c.framesPerSecond&&(o.inputFrame={width:c.width,height:c.height,frameRate:c.framesPerSecond})}processAudioMediaSource(a,o){let c=this.report.get(a);c&&(o.inputLevel=c.audioLevel)}processVideoTrackSenderStats(a,o,c){var f,m,v,w;let C=o?this.report.get(o):void 0,R=(f=C==null?void 0:C.framesSent)!==null&&f!==void 0?f:a.framesSent;if(typeof R!="number")return;let x=(m=C==null?void 0:C.frameWidth)!==null&&m!==void 0?m:a.frameWidth,L=(v=C==null?void 0:C.frameHeight)!==null&&v!==void 0?v:a.frameHeight,U=(w=C==null?void 0:C.framesPerSecond)!==null&&w!==void 0?w:a.framesPerSecond;if(typeof x=="number"&&typeof L=="number"||(x=0,L=0),U==null){let F=Date.now(),Z=this.lastVideoFramesSent.get(c.ssrc);Z&&F-Z.lts>=800?(U=Math.round((R-Z.count)/((F-Z.lts)/1e3)),this.lastVideoFramesSent.set(c.ssrc,{count:R,lts:F,rate:U})):Z?U=Z.rate:this.lastVideoFramesSent.set(c.ssrc,{count:R,lts:F,rate:0})}c.sentFrame={width:x,height:L,frameRate:Math.max(0,U)}}processVideoTrackReceiverStats(a,o,c){var f,m,v,w,C;let R=o?this.report.get(o):void 0,x=(f=R==null?void 0:R.framesReceived)!==null&&f!==void 0?f:a.framesReceived,L=(m=R==null?void 0:R.frameWidth)!==null&&m!==void 0?m:a.frameWidth,U=(v=R==null?void 0:R.frameHeight)!==null&&v!==void 0?v:a.frameHeight,F=(w=R==null?void 0:R.jitterBufferDelay)!==null&&w!==void 0?w:a.jitterBufferDelay,Z=(C=R==null?void 0:R.jitterBufferEmittedCount)!==null&&C!==void 0?C:a.jitterBufferEmittedCount;if(typeof x=="number"){let W=this.lastVideoFramesRecv.get(c.ssrc),K=Date.now();c.framesReceivedCount=x;let oe=0;W&&K-W.lts>=800?(oe=Math.round((x-W.count)/((K-W.lts)/1e3)),this.lastVideoFramesRecv.set(c.ssrc,{count:x,lts:K,rate:oe})):W?oe=W.rate:this.lastVideoFramesRecv.set(c.ssrc,{count:x,lts:K,rate:0}),c.receivedFrame={width:L||0,height:U||0,frameRate:oe||0},c.decodedFrame={width:L||0,height:U||0,frameRate:c.decodeFrameRate||0},c.outputFrame={width:L||0,height:U||0,frameRate:c.outputFrameRate||c.decodeFrameRate||0}}if(F&&Z){let W=this.lastVideoJBDelay.get(c.ssrc)||{jitterBufferDelay:0,jitterBufferEmittedCount:0,jitterBufferMs:0},K=W.jitterBufferMs,oe=Z-W.jitterBufferEmittedCount;oe>0&&(K=1e3*(F-W.jitterBufferDelay)/oe),c.jitterBufferMs=K,c.currentDelayMs=Math.round(K),this.lastVideoJBDelay.set(c.ssrc,{jitterBufferDelay:F,jitterBufferEmittedCount:Z,jitterBufferMs:c.currentDelayMs})}}processAudioTrackSenderStats(a,o,c){var f,m,v,w;let C=o?this.report.get(o):void 0,R=(f=(m=C==null?void 0:C.echoReturnLoss)!==null&&m!==void 0?m:a.echoReturnLoss)!==null&&f!==void 0?f:0,x=(v=(w=C==null?void 0:C.echoReturnLossEnhancement)!==null&&w!==void 0?w:a.echoReturnLossEnhancement)!==null&&v!==void 0?v:0;c.aecReturnLoss=R,c.aecReturnLossEnhancement=x}processAudioTrackReceiverStats(a,o,c){var f,m,v,w,C,R,x;let L=o?this.report.get(o):void 0,U=(f=L==null?void 0:L.removedSamplesForAcceleration)!==null&&f!==void 0?f:a.removedSamplesForAcceleration,F=(m=L==null?void 0:L.totalSamplesReceived)!==null&&m!==void 0?m:a.totalSamplesReceived,Z=(v=L==null?void 0:L.jitterBufferDelay)!==null&&v!==void 0?v:a.jitterBufferDelay,W=(w=L==null?void 0:L.jitterBufferEmittedCount)!==null&&w!==void 0?w:a.jitterBufferEmittedCount,K=(C=L==null?void 0:L.audioLevel)!==null&&C!==void 0?C:a==null?void 0:a.audioLevel,oe=(R=L==null?void 0:L.totalSamplesDuration)!==null&&R!==void 0?R:a==null?void 0:a.totalSamplesDuration,ue=(x=L==null?void 0:L.concealedSamples)!==null&&x!==void 0?x:a.concealedSamples;if(U&&F&&(c.accelerateRate=U/F),Z&&W){let Oe=this.lastAudioJBDelay.get(c.ssrc)||{jitterBufferDelay:0,jitterBufferEmittedCount:0,jitterBufferMs:0},ke=Oe.jitterBufferMs,He=W-Oe.jitterBufferEmittedCount;He>0&&(ke=1e3*(Z-Oe.jitterBufferDelay)/He),c.jitterBufferMs=Math.round(ke),this.lastAudioJBDelay.set(c.ssrc,{jitterBufferDelay:Z,jitterBufferEmittedCount:W,jitterBufferMs:c.jitterBufferMs})}c.outputLevel=K;let xe=1920;oe&&F&&(xe=F/oe/50,c.receivedFrames=Math.round(F/xe)),ue&&(c.droppedFrames=Math.round(ue/xe))}processRemoteInboundStats(a,o){let c=this.report.get(a);c&&(o.packetsLost=c.packetsLost,c.roundTripTime&&(o.rttMs=1e3*c.roundTripTime),c.jitter&&(o.jitterMs=1e3*c.jitter),c.timestamp&&(o.timestamp=c.timestamp))}getCodecFromCodecStats(a){let o=this.report.get(a);if(!o)return"";let c=o.mimeType.match(/\/(.*)$/);return c&&c[1]?c[1]:""}updateSendBitrate(){let a=0,o=null,c=null;this.mediaBytesSent.forEach(m=>{a+=m.diffMean()}),this.mediaBytesRetransmit.forEach(m=>{o=o===null?m.diffMean():o+m.diffMean()}),this.mediaBytesTargetEncode.forEach(m=>{c=c===null?m.diffMean():c+m.diffMean()});let f=o!==null?a-o:a;this._stats.bitrate={actualEncoded:8*f/(this.options.updateInterval/1e3),transmit:8*a/(this.options.updateInterval/1e3)},o!==null&&(this._stats.bitrate.retransmit=8*o/(this.options.updateInterval/1e3)),c!==null&&(this._stats.bitrate.targetEncoded=8*c/(this.options.updateInterval/1e3))}}class S4e extends TW{updateStats(){return Ct.resolve()}}function ID(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:8,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:500,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1e4,m=function(){let v=navigator.userAgent.toLocaleLowerCase().match(/chrome\/[\d]*/i);return v&&v[0]?Number(v[0].split("/")[1]):null}();return m?m<76?new w4e(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):new Poe(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):function(v){return!!window.RTCStatsReport&&v.getStats()instanceof Ct}(r)?new Poe(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f}):new S4e(r,{updateInterval:a,lossRateInterval:o,freezeRateLimit:c,firstVideoDecodedTimeout:f})}function Loe(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Doe(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Loe(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Loe(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function Q3(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0,{filterRTX:f,filterVideoFec:m,filterAudioFec:v,filterAudioCodec:w,filterVideoCodec:C}=a,{useXR:R}=o,x=[],L=[],U=[],F=[],Z=!1,W=!1;if(rr.parse(r).mediaDescriptions.forEach(oe=>{c&&c!==oe.attributes.direction||(oe.media.mediaType!=="video"||Z||(L=oe.attributes.payloads,F=oe.attributes.extmaps,Z=!0),oe.media.mediaType!=="audio"||W||(x=oe.attributes.payloads,U=oe.attributes.extmaps,W=!0))}),!F||L.length===0)throw new Error("Cannot get video capabilities from SDP.");if(!U||x.length===0)throw new Error("Cannot get audio capabilities from SDP.");if(L.forEach(oe=>{var ue;(ue=oe.rtpMap)!==null&&ue!==void 0&&ue.clockRate&&(oe.rtpMap.clockRate=parseInt(oe.rtpMap.clockRate)),R&&oe.rtcpFeedbacks.push({type:"rrtr"})}),x.forEach(oe=>{var ue;(ue=oe.rtpMap)!==null&&ue!==void 0&&ue.clockRate&&(oe.rtpMap.clockRate=parseInt(oe.rtpMap.clockRate)),R&&oe.rtcpFeedbacks.push({type:"rrtr"})}),f&&(x=x.filter(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())!=="rtx"}),L=L.filter(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())!=="rtx"})),m&&(L=L.filter(oe=>{var ue;return!/(red)|(ulpfec)|(flexfec)/i.test(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName)||"")})),v&&(x=x.filter(oe=>{var ue;return!/(red)|(ulpfec)|(flexfec)/i.test(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName)||"")})),w&&(w==null?void 0:w.length)>0&&(x=x.filter(oe=>{var ue;return Tt(w).call(w,((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLowerCase())||"")})),C&&(C==null?void 0:C.length)>0){let oe=L.filter(ue=>{var xe;return Tt(C).call(C,((xe=ue.rtpMap)===null||xe===void 0?void 0:xe.encodingName.toLowerCase())||"")});L=oe.concat(f?[]:NW(oe,L))}let K=ve("UNSUPPORTED_VIDEO_CODEC");return K&&K.length>0&&(L=L.filter(oe=>!(oe.rtpMap&&Tt(K).call(K,oe.rtpMap.encodingName.toLowerCase())))),{audioCodecs:x,videoCodecs:L,audioExtensions:U,videoExtensions:F}}function Ah(r){let a=rr.parse(r),o,c;for(let f of a.mediaDescriptions){if(!o){let m=f.attributes.iceUfrag,v=f.attributes.icePwd;if(!m||!v)throw new Error("Cannot get iceUfrag or icePwd from SDP.");o={iceUfrag:m,icePwd:v}}if(!c){let m=f.attributes.fingerprints;m.length>0&&(c={fingerprints:m})}}if(!c&&a.attributes.fingerprints.length>0&&(c={fingerprints:a.attributes.fingerprints}),!c||!o)throw new Error("Cannot get iceParameters or dtlsParameters from SDP.");return{iceParameters:o,dtlsParameters:c}}function RW(r,a){let o=[],c=r.attributes.ssrcGroups.filter(v=>v.semantic==="FID"),f=r.attributes.ssrcGroups.find(v=>v.semantic==="SIM"),m=r.attributes.ssrcs;if(f)f.ssrcIds.forEach(v=>{var w;let C=(w=c.find(R=>R.ssrcIds[0]===v))===null||w===void 0?void 0:w.ssrcIds[1];o.push({ssrcId:v,rtx:a?C:void 0})});else if(c.length>0){let v=c[0].ssrcIds[0],w=c[0].ssrcIds[1];o.push({ssrcId:v,rtx:a?w:void 0})}else{if(m.length===0)throw new Error("No ssrcs found on local media description.");o.push({ssrcId:m[0].ssrcId})}return o}function koe(r,a){let{cname:o}=r,c;a&&a.ip&&typeof a.port=="number"?(c=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:a.ip,port:a.port.toString(),type:"host",extension:{}}],z.debug("Using remote candidate from AP ".concat(a.ip,":").concat(a.port)),a.ip6&&(c.push({foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:a.ip6,port:a.port.toString(),type:"host",extension:{}}),z.debug("Using IPV6 remote candidate from AP ".concat(a.ip6,":").concat(a.port)))):c=r.iceParameters.candidates.map(w=>({foundation:w.foundation,componentId:"1",transport:w.protocol,priority:w.priority.toString(),connectionAddress:w.ip,port:w.port.toString(),type:w.type,extension:{}}));let f={fingerprints:r.dtlsParameters.fingerprints.map(w=>({hashFunction:w.algorithm,fingerprint:w.fingerprint}))},m={iceUfrag:r.iceParameters.iceUfrag,icePwd:r.iceParameters.icePwd},v;switch(r.dtlsParameters.role){case"server":v="passive";break;case"client":v="active";break;case"auto":v="actpass"}return{dtlsParameters:f,iceParameters:m,candidates:c,rtpCapabilities:yb(r.rtpCapabilities),setup:v,cname:o}}function Dc(r,a,o){let c=[],f=[];return r.forEach(m=>{let{ssrcId:v,rtx:w}=m,C=Di(8,"track-"),R={ssrcId:v,attributes:Doe({label:C,mslabel:o=o||Di(10,""),msid:"".concat(o," ").concat(C)},a&&{cname:a})};if(c.push(R),w!==void 0){let x={ssrcId:w,attributes:Doe({label:C,mslabel:o,msid:"".concat(o," ").concat(C)},a&&{cname:a})};c.push(x),f.push({semantic:"FID",ssrcIds:[v,w]})}}),r.length>1&&f.push({semantic:"SIM",ssrcIds:r.map(m=>{let{ssrcId:v}=m;return v})}),{ssrcs:c,ssrcGroups:f}}function F0(r,a){a instanceof br&&r.attributes.payloads.forEach(o=>{var c;let f=(c=o.rtpMap)===null||c===void 0?void 0:c.encodingName.toLowerCase();if(!f||["opus","pcmu","pcma","g722"].indexOf(f)===-1)return;o.fmtp||(o.fmtp={parameters:{}}),o.fmtp.parameters.minptime="10",o.fmtp.parameters.useinbandfec="1";let m=a._encoderConfig;m&&f!=="pcmu"&&f!=="pcma"&&f!=="g722"&&(m.bitrate&&!Pi()&&(o.fmtp.parameters.maxaveragebitrate="".concat(Math.floor(1e3*m.bitrate))),m.sampleRate&&(o.fmtp.parameters.maxplaybackrate="".concat(m.sampleRate),o.fmtp.parameters["sprop-maxcapturerate"]="".concat(m.sampleRate)),m.stereo&&(o.fmtp.parameters.stereo="1",o.fmtp.parameters["sprop-stereo"]="1"))})}function ND(r){let a=r.attributes.unrecognized.findIndex(o=>o.attField==="x-google-flag"&&o.attValue==="conference");a!==-1&&r.attributes.unrecognized.splice(a,1)}function OD(r,a){var o;if(!(a instanceof ki&&a._encoderConfig&&a._hints.indexOf(Hi.SCREEN_TRACK)===-1))return;let c=a._encoderConfig;Jn().supportMinBitrate&&c.bitrateMin&&r.attributes.payloads.forEach(f=>{var m,v;Tt(m=["h264","h265","vp8","vp9","av1"]).call(m,((v=f.rtpMap)===null||v===void 0?void 0:v.encodingName.toLowerCase())||"")&&(f.fmtp||(f.fmtp={parameters:{}}),f.fmtp.parameters["x-google-min-bitrate"]="".concat(c.bitrateMin))}),Jn().supportMinBitrate&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&c.bitrateMax&&r.attributes.payloads.forEach(f=>{var m,v;Tt(m=["h264","h265","vp8","vp9","av1"]).call(m,((v=f.rtpMap)===null||v===void 0?void 0:v.encodingName.toLowerCase())||"")&&(f.fmtp||(f.fmtp={parameters:{}}),f.fmtp.parameters["x-google-start-bitrate"]="".concat(ve("X_GOOGLE_START_BITRATE")||Math.floor(c.bitrateMax)))})}function xW(r){if(r.media.mediaType!=="video")return;let a=ni();if(a.name!==fi.SAFARI&&a.os!==ms.IOS)return;let o=r.attributes.extmaps.findIndex(c=>/video-orientation/g.test(c.extensionName));o!==-1&&r.attributes.extmaps.splice(o,1)}function vb(r,a,o){if(!a)return;let c,f;if(r.media.mediaType==="video"?(c=o.videoExtensions,f=o.videoCodecs):(c=o.audioExtensions,f=o.audioCodecs),a.twcc===!0){let m=c.find(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");m&&(r.attributes.extmaps.find(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01")||r.attributes.extmaps.push({entry:m.entry,extensionName:"http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01"}),function(v,w){return w.filter(C=>!!v.find(R=>R.payloadType===C.payloadType&&!!R.rtcpFeedbacks.find(x=>x.type==="transport-cc")))}(f,r.attributes.payloads).forEach(v=>{v.rtcpFeedbacks.find(w=>w.type==="transport-cc")||v.rtcpFeedbacks.push({type:"transport-cc"})}))}else if(a.twcc===!1){let m=r.attributes.extmaps.findIndex(v=>v.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");m!==-1&&r.attributes.extmaps.splice(m,1),r.attributes.payloads.forEach(v=>{let w=v.rtcpFeedbacks.findIndex(C=>C.type==="transport-cc");w!==-1&&v.rtcpFeedbacks.splice(w,1)})}if(a.remb===!0){let m=c.find(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time");m&&(r.attributes.extmaps.find(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time")||r.attributes.extmaps.push({entry:m.entry,extensionName:"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"}),function(v,w){return w.filter(C=>!!v.find(R=>R.payloadType===C.payloadType&&!!R.rtcpFeedbacks.find(x=>x.type==="goog-remb")))}(f,r.attributes.payloads).forEach(v=>{v.rtcpFeedbacks.find(w=>w.type==="goog-remb")||v.rtcpFeedbacks.push({type:"goog-remb"})}))}else if(a.remb===!1){let m=r.attributes.extmaps.findIndex(v=>v.extensionName==="http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time");m!==-1&&r.attributes.extmaps.splice(m,1),r.attributes.payloads.forEach(v=>{let w=v.rtcpFeedbacks.findIndex(C=>C.type==="goog-remb");w!==-1&&v.rtcpFeedbacks.splice(w,1)})}}function AW(r,a,o){if(Pi()||r.media.mediaType!=="video"||!(a instanceof ki)||o!=="vp9"&&o!=="vp8"||o==="vp8"&&!ve("SIMULCAST")||a._scalabilityMode===void 0||a._scalabilityMode.numSpatialLayers<=1)return;let c=o==="vp8"?2:a._scalabilityMode.numSpatialLayers,f=r.attributes.ssrcs[0],m=r.attributes.ssrcGroups.find(w=>w.semantic==="FID"&&w.ssrcIds[0]===f.ssrcId),v={semantic:"SIM",ssrcIds:[f.ssrcId]};for(let w=1;w<c;w++)r.attributes.ssrcs.push({ssrcId:f.ssrcId+w,attributes:zi(f.attributes)}),v.ssrcIds.push(f.ssrcId+w),m&&(r.attributes.ssrcs.push({ssrcId:m.ssrcIds[1]+w,attributes:zi(f.attributes)}),r.attributes.ssrcGroups.push({semantic:"FID",ssrcIds:[f.ssrcId+w,m.ssrcIds[1]+w]}));r.attributes.ssrcGroups.unshift(v)}async function IW(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=new RTCPeerConnection;o.addTransceiver("video",{direction:"sendonly"}),o.addTransceiver("audio",{direction:"sendonly"}),o.addTransceiver("video",{direction:"recvonly"}),o.addTransceiver("audio",{direction:"recvonly"});let c=(await o.createOffer()).sdp,{send:f,recv:m,sendrecv:v}=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=arguments.length>2?arguments[2]:void 0,x=Q3(R,w,C,"sendonly"),L=Q3(R,w,C,"recvonly"),U={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},F={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},Z={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(xu(x,L,"videoExtensions",U,F,Z),xu(x,L,"videoCodecs",U,F,Z),xu(x,L,"audioExtensions",U,F,Z),xu(x,L,"audioCodecs",U,F,Z),ve("RAISE_H264_BASELINE_PRIORITY")){let W=Z.videoCodecs.findIndex(K=>{var oe,ue;return((oe=K.rtpMap)===null||oe===void 0?void 0:oe.encodingName.toLocaleLowerCase())==="h264"&&((ue=K.fmtp)===null||ue===void 0?void 0:ue.parameters["profile-level-id"])==="42001f"});if(W!==-1){let K=Z.videoCodecs.findIndex(oe=>{var ue;return((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"});if(K<W){z.debug("raising H264 baseline profile priority");let oe=Z.videoCodecs[W];Z.videoCodecs.splice(W,1),Z.videoCodecs.splice(K,0,oe)}K!==-1&&(F.videoCodecs=F.videoCodecs.filter(oe=>{var ue,xe;return!(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"&&((xe=oe.fmtp)===null||xe===void 0?void 0:xe.parameters["profile-level-id"])!=="42001f")})),K!==-1&&ve("FILTER_SEND_H264_BASELINE")&&(U.videoCodecs=U.videoCodecs.filter(oe=>{var ue,xe;return!(((ue=oe.rtpMap)===null||ue===void 0?void 0:ue.encodingName.toLocaleLowerCase())==="h264"&&((xe=oe.fmtp)===null||xe===void 0?void 0:xe.parameters["profile-level-id"])!=="42001f")}))}}return{send:U,recv:F,sendrecv:Z}}(r,a,c);try{o.close()}catch{}return{send:f,recv:m,sendrecv:v}}function Moe(){let r={audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},a=Q3(arguments.length>2?arguments[2]:void 0,arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},"recvonly"),o={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},c={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},f={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(xu(r,a,"videoExtensions",o,c,f),xu(r,a,"videoCodecs",o,c,f),xu(r,a,"audioExtensions",o,c,f),xu(r,a,"audioCodecs",o,c,f),ve("RAISE_H264_BASELINE_PRIORITY")){let m=f.videoCodecs.findIndex(v=>v.rtpMap&&v.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&v.fmtp&&v.fmtp.parameters["profile-level-id"]==="42001f");if(m!==-1){let v=f.videoCodecs.findIndex(w=>w.rtpMap&&w.rtpMap.encodingName.toLocaleLowerCase()==="h264");if(v<m){z.debug("raising H264 baseline profile priority");let w=f.videoCodecs[m];f.videoCodecs.splice(m,1),f.videoCodecs.splice(v,0,w)}v!==-1&&(c.videoCodecs=c.videoCodecs.filter(w=>!(w.rtpMap&&w.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&w.fmtp&&w.fmtp.parameters["profile-level-id"]!=="42001f")))}}return{send:o,recv:c,sendrecv:f}}function xu(r,a,o,c,f,m){if(o==="videoExtensions"||o==="audioExtensions"){let v=[];return r[o].forEach(w=>{a[o].some((C,R)=>{if(w.entry===C.entry&&w.extensionName===C.extensionName)return v.push(R),!0})?m[o].push(w):c[o].push(w)}),void a[o].forEach((w,C)=>{v.indexOf(C)===-1&&f[o].push(w)})}if(o==="videoCodecs"||o==="audioCodecs"){let v=[];return r[o].forEach(w=>{a[o].some((C,R)=>{if(w.payloadType===C.payloadType&&JSON.stringify(w)===JSON.stringify(C))return v.push(R),!0})?m[o].push(w):c[o].push(w)}),void a[o].forEach((w,C)=>{v.indexOf(C)===-1&&f[o].push(w)})}}function yb(r){let{send:a,recv:o,sendrecv:c}=r;if(!c){if(!a||!o)throw new Error("cannot merge rtp capabilities because one of send or recv is empty!");return{send:a,recv:o}}let f,m;return a?(f={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},f.audioCodecs=[...a.audioCodecs,...c.audioCodecs],f.videoCodecs=[...a.videoCodecs,...c.videoCodecs],f.audioExtensions=[...a.audioExtensions,...c.audioExtensions],f.videoExtensions=[...a.videoExtensions,...c.videoExtensions]):f=c,o?(m={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},m.audioCodecs=[...o.audioCodecs,...c.audioCodecs],m.videoCodecs=[...o.videoCodecs,...c.videoCodecs],m.audioExtensions=[...o.audioExtensions,...c.audioExtensions],m.videoExtensions=[...o.videoExtensions,...c.videoExtensions]):m=c,{send:f,recv:m}}function Ih(r){r.media.mediaType==="audio"&&r.attributes.payloads.filter(a=>{var o;return((o=a.rtpMap)===null||o===void 0?void 0:o.encodingName.toLowerCase())==="opus"}).forEach(a=>{a.fmtp||(a.fmtp={parameters:{}}),a.fmtp.parameters.stereo="1",a.fmtp.parameters["sprop-stereo"]="1"})}function PD(r){r.mediaDescriptions.forEach(a=>{a.media.mediaType!=="video"&&a.media.mediaType!=="audio"||a.attributes.payloads.forEach(o=>{o.rtcpFeedbacks.findIndex(c=>c.type==="rrtr")===-1&&o.rtcpFeedbacks.push({type:"rrtr"})})})}function o_(r,a,o,c){let f=[];if(r===Wt.VIDEO){if(ve("H264_PROFILE_LEVEL_ID")&&c==="h264"&&(f=a.videoCodecs.filter(m=>{var v;return Tt(v=m.rtpMap&&m.rtpMap.encodingName.toLowerCase()||"").call(v,c)&&m&&m.fmtp&&m.fmtp.parameters["profile-level-id"]===ve("H264_PROFILE_LEVEL_ID")})),!Array.isArray(f)||f.length===0){let m=[],v=[],w=[],C=[];if(o.videoCodecs.forEach(R=>{let x=R.rtpMap&&R.rtpMap.encodingName.toLowerCase()||"";Tt(x).call(x,c)?m.push(R):Tt(x).call(x,"vp9")?v.push(R):Tt(x).call(x,"vp8")?w.push(R):Tt(x).call(x,"h264")&&C.push(R)}),m.length===0){let R="";v.length!==0?(m=v,R="vp9"):w.length!==0?(m=w,R="vp8"):C.length!==0&&(m=C,R="h264"),z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to default payloads: ").concat(R))}m.length!==0&&(f=a.videoCodecs.filter(R=>m.some(x=>x.payloadType===R.payloadType)))}if(f.length===0&&(z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to default payloads: ").concat(a.videoCodecs[0].rtpMap&&a.videoCodecs[0].rtpMap.encodingName)),f=a.videoCodecs),ve("USE_PUB_RTX")||ve("USE_SUB_RTX")){let m=NW(f,a.videoCodecs);f=[...f,...m]}}else f=a.audioCodecs.filter(m=>{var v;return Tt(v=m.rtpMap&&m.rtpMap.encodingName.toLowerCase()||"").call(v,c)}),f.length===0&&(z.warning("codec ".concat(c," not included in rtpCapabilities, fallback to opus")),f=a.audioCodecs.filter(m=>{var v;return Tt(v=m.rtpMap&&m.rtpMap.encodingName.toLowerCase()||"").call(v,"opus")}));return f}function NW(r,a){let o=r.map(c=>c.payloadType.toString());return a.filter(c=>c.rtpMap&&c.rtpMap.encodingName==="rtx"&&c.fmtp&&c.fmtp.parameters.apt&&Tt(o).call(o,c.fmtp&&c.fmtp.parameters.apt))}let joe=class{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(r){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname","o/i14u9pJrxRKAsu"),X(this,"firefoxSsrcMidMap",new Map),r=zi(r);let{remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,localCapabilities:m,direction:v,setup:w,videoCodec:C,audioCodec:R}=r,x;this.setup=w,x=v===no.RECEIVE_ONLY?rr.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`):rr.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=extmap-allow-mixed
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`),this._rtpCapabilities=f,this._candidates=c,this._iceParameters=a,this._dtlsParameters=o,this._localCapabilities=m;let L=v===no.RECEIVE_ONLY?this.rtpCapabilities.send:this.rtpCapabilities.recv,U=v===no.RECEIVE_ONLY?this._localCapabilities.recv:this._localCapabilities.send,F=v===no.RECEIVE_ONLY?f.send.videoCodecs:o_(Wt.VIDEO,L,U,C),Z=v===no.RECEIVE_ONLY?f.send.audioCodecs:o_(Wt.AUDIO,L,U,R);for(let W of x.mediaDescriptions)W.attributes.iceUfrag=a.iceUfrag,W.attributes.icePwd=a.icePwd,W.attributes.fingerprints=o.fingerprints,W.attributes.candidates=c,W.attributes.setup=this.setup,W.media.mediaType==="application"&&(W.attributes.sctpPort="5000"),W.media.mediaType==="video"&&(W.media.fmts=F.map(K=>K.payloadType.toString(10)),W.attributes.payloads=F,W.attributes.extmaps=L.videoExtensions),W.media.mediaType==="audio"&&(W.media.fmts=Z.map(K=>K.payloadType.toString(10)),W.attributes.payloads=Z,W.attributes.extmaps=L.audioExtensions,Ih(W));this.sessionDesc=x,this.currentMidIndex=x.mediaDescriptions.length-1}toString(){return rr.print(this.sessionDesc)}hasMid(r){return Array.isArray(r)?r.every(a=>this.hasMid(a)):this.sessionDesc.mediaDescriptions.some(a=>a.attributes.mid===r)}send(r,a,o,c,f){o=o.replace(/ /g,"-");let{ssrcs:m,ssrcGroups:v}=Dc(a,this.cname,ve("SYNC_GROUP")?o:void 0),w=this.findPreloadMediaDesc(m);if(w){if(Pi()&&this.firefoxSsrcMidMap.set(m[0].ssrcId,w.attributes.mid),f&&(f.twcc||f.remb)){let C=this.sessionDesc.mediaDescriptions.indexOf(w);return this.sessionDesc.mediaDescriptions[C]=this.mungSendMediaDesc(w,f),{mid:w.attributes.mid,needExchangeSDP:!0}}return{mid:w.attributes.mid,needExchangeSDP:!1}}{let C=this.findAvailableMediaIndex(r,m,c),R;return C===-1?(R=this.createOrRecycleSendMedia(r,m,v,"sendonly",c,f),this.updateBundleMids()):(R=zi(this.sessionDesc.mediaDescriptions[C]),R.attributes.direction="sendonly",R.attributes.ssrcs=m,R.attributes.ssrcGroups=v,this.sessionDesc.mediaDescriptions[C]=this.mungSendMediaDesc(R,f)),Pi()&&this.firefoxSsrcMidMap.set(m[0].ssrcId,R.attributes.mid),{needExchangeSDP:!0,mid:R.attributes.mid}}}stopSending(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>o.attributes.mid&&r.indexOf(o.attributes.mid)!==-1);if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");a.forEach(o=>{o.attributes.ssrcs=[]}),this.updateBundleMids()}receive(r,a,o){let c=[];return r.forEach(f=>{let m=f._mediaStreamTrack.kind,v=this.findAvailableRecvMediaIndex(m),w,C=!1;v===-1?(C=!0,w=this.createOrRecycleRecvMedia(f,[],"recvonly",a,o),this.updateBundleMids()):(w=zi(this.sessionDesc.mediaDescriptions[v]),w.attributes.direction="recvonly"),c.push({mid:w.attributes.mid,needCreateTransceiver:C})}),c}stopReceiving(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>r.indexOf(o.attributes.mid)!==-1);if(a.length!==r.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");a.forEach(o=>{o.media.port="0",o.attributes.direction="inactive"}),this.updateBundleMids()}addRemoteCandidate(r){let{foundation:a,protocol:o,address:c,port:f,type:m,relatedAddress:v,relatedPort:w,priority:C}=new RTCIceCandidate(r),R={foundation:a??"",componentId:"1",transport:o??"",priority:C?C+"":"",connectionAddress:c??"",port:f?f+"":"",type:m?m+"":"",relAddr:v??"",relPort:w?w+"":"",extension:{}};this.candidates.some(x=>x.priority===R.priority&&x.connectionAddress===R.connectionAddress&&x.port===R.port)||(this._candidates.push(R),this.sessionDesc.mediaDescriptions.forEach(x=>{x.attributes.candidates=this.candidates}))}clearRemoteCandidate(){this._candidates=[],this.sessionDesc.mediaDescriptions[0].attributes.candidates=this._candidates}createOrRecycleRecvMedia(r,a,o,c,f){let m=r._mediaStreamTrack.kind,v=this.rtpCapabilities.recv,w=o_(m,v,this.localCapabilities.send,m===Wt.AUDIO?f:c),C=m===Wt.VIDEO?v.videoExtensions:v.audioExtensions,R="".concat(++this.currentMidIndex),x={media:{mediaType:m,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(U=>U.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:[],extmaps:C,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:o,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(R)}};x=this.mungRecvMediaDsec(x,r);let L=this.findFirstClosedMedia(m);if(L){let U=this.sessionDesc.mediaDescriptions.indexOf(L);this.sessionDesc.mediaDescriptions[U]=x}else this.sessionDesc.mediaDescriptions.push(x);return x}muteRemote(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>Tt(r).call(r,o.attributes.mid||""));if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");a.forEach(o=>{o.attributes.direction="inactive"})}unmuteRemote(r){let a=this.sessionDesc.mediaDescriptions.filter(o=>Tt(r).call(r,o.attributes.mid||""));if(a.length!==r.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");a.forEach(o=>{o.attributes.direction="recvonly"})}findAvailableMediaIndex(r,a,o){return this.sessionDesc.mediaDescriptions.findIndex(c=>{let f=c.media.mediaType===r&&c.media.port!=="0"&&(c.attributes.direction==="sendonly"||c.attributes.direction==="sendrecv")&&c.attributes.ssrcs.length===0;if(Pi()){if(f){let m=this.firefoxSsrcMidMap.get(a[0].ssrcId);return!(m||c.attributes.mid!=="0"&&c.attributes.mid!=="1")||!(!m||m!==c.attributes.mid)}return!1}return f&&c.attributes.mid===o})}findAvailableRecvMediaIndex(r){return this.sessionDesc.mediaDescriptions.findIndex(a=>{let o=a.media.mediaType===r&&a.media.port!=="0"&&(a.attributes.direction==="recvonly"||a.attributes.direction==="sendrecv");return a.attributes.mid!=="0"&&a.attributes.mid!=="1"&&o})}predictReceivingMids(r){let a=[];for(let o=0;o<r;o++)a.push((this.currentMidIndex+o+1).toString(10));return a}restartICE(r){r=zi(r),this._iceParameters=r,this.sessionDesc.mediaDescriptions.forEach(a=>{a.attributes.iceUfrag=r.iceUfrag,a.attributes.icePwd=r.icePwd})}createOrRecycleSendMedia(r,a,o,c,f,m){let v=this.rtpCapabilities.send,w=r===Wt.VIDEO?v.videoCodecs:v.audioCodecs,C=r===Wt.VIDEO?v.videoExtensions:v.audioExtensions;Pi()&&(f="".concat(++this.currentMidIndex));let R={media:{mediaType:r,port:"9",protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(L=>L.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:[],extmaps:C,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:a,ssrcGroups:o,rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:c,rtcpMux:!0,rtcpRsize:!0,mid:f}};R=this.mungSendMediaDesc(R,m);let x=this.findFirstClosedMedia(r);if(x){let L=this.sessionDesc.mediaDescriptions.indexOf(x);this.sessionDesc.mediaDescriptions[L]=R}else this.sessionDesc.mediaDescriptions.push(R);return R}mungRecvMediaDsec(r,a,o){let c=zi(r);return ND(c),F0(c,a),OD(c,a),xW(c),vb(c,o,this.localCapabilities.send),c}mungSendMediaDesc(r,a){let o=zi(r);return vb(o,a,this.localCapabilities.recv),Ih(o),o}updateRecvMedia(r,a){let o=this.sessionDesc.mediaDescriptions.findIndex(c=>c.attributes.mid===r);if(o!==-1){let c=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[o],a);this.sessionDesc.mediaDescriptions[o]=c}}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(r=>r.media.port!=="0").map(r=>r.attributes.mid)}findPreloadMediaDesc(r){return this.sessionDesc.mediaDescriptions.find(a=>{var o;return((o=a.attributes)===null||o===void 0||(o=o.ssrcs[0])===null||o===void 0?void 0:o.ssrcId)===r[0].ssrcId})}findFirstClosedMedia(r){return this.sessionDesc.mediaDescriptions.find(a=>Pi()?a.media.port==="0"&&a.media.mediaType===r:a.media.port==="0")}},b4e=["sdp"];var Wi;function Uoe(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function B0(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Uoe(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Uoe(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Foe=(Wi=class Vb extends Eie{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get dtlsTransportState(){var a,o;return(a=(o=this.peerConnection.getReceivers()[0])===null||o===void 0||(o=o.transport)===null||o===void 0?void 0:o.state)!==null&&a!==void 0?a:null}get localCodecs(){return[]}set isInRestartIce(a){this._isInRestartIce=a}get isInRestartIce(){return this._isInRestartIce}constructor(a,o,c){super(a,o),X(this,"direction",void 0),X(this,"name",void 0),X(this,"store",void 0),X(this,"spec",void 0),X(this,"peerConnection",void 0),X(this,"initialOffer",void 0),X(this,"transport",void 0),X(this,"statsFilter",void 0),X(this,"localCandidateCount",0),X(this,"_isInRestartIce",!1),X(this,"mutex",new Ts("P2PConnection-mutex")),X(this,"onLocalCandidate",void 0),X(this,"remoteSDP",void 0),X(this,"pendingCandidates",[]),X(this,"localCapabilities",void 0),X(this,"isReady",!1),X(this,"restartCnt",0),X(this,"curTurnServerIndex",0),this.store=o,this.spec=a,this.peerConnection=new RTCPeerConnection(Vb.resolvePCConfiguration(a,o.p2pTransport),{optional:[{googDscp:!0}]}),this.direction=c??no.SEND_ONLY,this.name=this.direction===no.SEND_ONLY?"sendP2PConnection":"recvP2PConnection",this.statsFilter=ID(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Pi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1}async establish(a){try{let o=await IW();if(this.localCapabilities=yb(o),a){let{sdp:c}=a,f=_4e(a,b4e),m=function(){let x={audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},L=Q3(arguments.length>2?arguments[2]:void 0,arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},"sendonly"),U={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},F={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},Z={audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]};if(xu(L,x,"videoExtensions",U,F,Z),xu(L,x,"videoCodecs",U,F,Z),xu(L,x,"audioExtensions",U,F,Z),xu(L,x,"audioCodecs",U,F,Z),ve("RAISE_H264_BASELINE_PRIORITY")){let W=Z.videoCodecs.findIndex(K=>K.rtpMap&&K.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&K.fmtp&&K.fmtp.parameters["profile-level-id"]==="42001f");if(W!==-1){let K=Z.videoCodecs.findIndex(oe=>oe.rtpMap&&oe.rtpMap.encodingName.toLocaleLowerCase()==="h264");if(K<W){z.debug("raising H264 baseline profile priority");let oe=Z.videoCodecs[W];Z.videoCodecs.splice(W,1),Z.videoCodecs.splice(K,0,oe)}K!==-1&&ve("FILTER_SEND_H264_BASELINE")&&(U.videoCodecs=U.videoCodecs.filter(oe=>!(oe.rtpMap&&oe.rtpMap.encodingName.toLocaleLowerCase()==="h264"&&oe.fmtp&&oe.fmtp.parameters["profile-level-id"]!=="42001f")))}}return{send:U,recv:F,sendrecv:Z}}({},{},c);this.remoteSDP=new joe({remoteIceParameters:f.iceParameters,remoteDtlsParameters:f.dtlsParameters,candidates:[],remoteRTPCapabilities:m,localCapabilities:this.localCapabilities,direction:this.direction,setup:"actpass",videoCodec:this.store.codec,audioCodec:this.store.audioCodec}),await this.setRemoteDescription({type:"offer",sdp:this.remoteSDP.toString()}),this.isReady=!0;let v=await this.peerConnection.createAnswer();if(!v.sdp)throw new Error("Cannot get answer sdp when trying to establish PeerConnection.");let w=Ah(v.sdp);await this.peerConnection.setLocalDescription(v);let C=await Moe({},{},v.sdp);this.localCapabilities=yb(C);let R=this.peerConnection.getTransceivers()[0];return R!=null&&R.receiver&&R.receiver.transport&&this.tryBindTransportEvents(R.receiver.transport),B0(B0({},w),{},{sdp:v.sdp})}{this.peerConnection.addTransceiver("video",{direction:"sendonly"}),this.peerConnection.addTransceiver("audio",{direction:"sendonly"});let c=await this.peerConnection.createOffer();if(!c.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let f=Ah(c.sdp);return this.initialOffer=c,B0(B0({},f),{},{sdp:c.sdp})}}catch(o){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,o.toString())}}async connect(a){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");await this.peerConnection.setLocalDescription(this.initialOffer);let{sdp:o,iceParameters:c,dtlsParameters:f}=a,m=await Moe({},{},o);this.remoteSDP=new joe({remoteIceParameters:c,remoteDtlsParameters:f,candidates:[],remoteRTPCapabilities:m,localCapabilities:this.localCapabilities,direction:this.direction,setup:"active",videoCodec:this.store.codec,audioCodec:this.store.audioCodec}),await this.setRemoteDescription({type:"answer",sdp:this.remoteSDP.toString()});let v=this.peerConnection.getTransceivers()[0];v!=null&&v.sender&&v.sender.transport&&this.tryBindTransportEvents(v.sender.transport)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(o.toString()))}}async addRemoteCandidate(a){try{a&&this.pendingCandidates.push(a),this.peerConnection.remoteDescription&&this.isReady&&(this.pendingCandidates.forEach(o=>{this.peerConnection.addIceCandidate(o)}),this.pendingCandidates=[])}catch(o){throw new Ke(ce.ADD_CANDIDATE_FAILED,"P2PConnection.addRemoteCandidate failed; ".concat(o.toString()))}}send(a,o,c){var f=this;return Ul(function*(){let m=yield Dn(f.mutex.lock("From P2PConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let v=[],w=f.remoteSDP.receive(a,o,c);a.forEach((K,oe)=>{if(w[oe].needCreateTransceiver){let ue=f.peerConnection.addTransceiver(K._mediaStreamTrack,{direction:"sendonly"});v.push(ue),K._updateRtpTransceiver(ue)}else{let ue=f.peerConnection.getTransceivers().find(xe=>xe.mid===w[oe].mid);if(!ue)throw new Error("cannot find transceiver when sendPeerconnection send, mid is ".concat(w[oe].mid));v.push(ue),K._updateRtpTransceiver(ue)}}),Pi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let C=w.map(K=>K.mid),R=yield Dn(f.peerConnection.createOffer()),x=f.mungSendOfferSDP(R.sdp,a,C),L=rr.parse(x),U=C.map(K=>{let oe=L.mediaDescriptions.find(ue=>ue.attributes.mid===K);if(!oe)throw new Error("Cannot extract ssrc from mediaDescription.");return RW(oe,ve("USE_PUB_RTX"))}),F=v.map((K,oe)=>{let ue=C[oe];return{localSSRC:U[oe],id:ue}});yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:x}));try{yield F}catch(K){let oe=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:x})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:oe})),yield Dn(f.stopSending(C,!0)),K}yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a));let Z=f.remoteSDP.toString(),W=f.logSDPExchange(x,"offer","local","send");return W==null||W(Z),yield Dn(f.setRemoteDescription({type:"answer",sdp:Z})),v.map((K,oe)=>{let ue=C[oe];return{localSSRC:U[oe],id:ue}})}catch(v){throw v instanceof Ke?v:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(v.toString()))}finally{m()}})()}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(C=>a.indexOf(C.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length (".concat(f.length,") doesn't match mids' length (").concat(a.length,") when trying to call P2PConnection.stopSending."));f.map(C=>{var R;C.direction="inactive",(R=C.stop)===null||R===void 0||R.call(C)});let m=await this.peerConnection.createOffer(),v=this.logSDPExchange(m.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(m),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:m,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let C=this.remoteSDP.toString(),R=this.logSDPExchange(C,"offer","remote","receive");await this.setRemoteDescription({type:"offer",sdp:C});let x=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(x.sdp,m,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(C=>C.mid===m);if(!w||w.mid===null)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,mid:w.mid,transceiver:w}}catch(m){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(m.toString()))}}async mockReceive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:m,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let w=this.remoteSDP.toString(),C=this.logSDPExchange(w,"offer","remote","receive");await this.setRemoteDescription({type:"offer",sdp:w});let R=await this.peerConnection.createAnswer(),x=this.mungReceiveAnswerSDP(R.sdp,m,a);C==null||C(x||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:x}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."))}catch(m){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(m.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async restartICE(a){try{if(this.store.p2pTransport===Gy.Auto&&(this.store.p2pTransport=Gy.SdRtn,Jn().supportPCSetConfiguration&&this.peerConnection.setConfiguration(Vb.resolvePCConfiguration(this.spec,this.store.p2pTransport))),this.restartCnt>3&&(this.restartCnt=0,Jn().supportPCSetConfiguration&&this.peerConnection.setConfiguration(Vb.resolvePCConfiguration(this.spec,this.store.p2pTransport,++this.curTurnServerIndex))),!a){this.restartCnt++,this.isReady=!1;let o=await this.peerConnection.createOffer({iceRestart:!0});if(!o.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let{iceParameters:c}=Ah(o.sdp);return this.store.descriptionStart(),this.direction===no.SEND_ONLY&&await this.peerConnection.setLocalDescription(o),c}if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");if(this.remoteSDP.restartICE(a),this.store.descriptionStart(),this.direction===no.RECEIVE_ONLY){this.restartCnt++,await this.setRemoteDescription({type:"offer",sdp:this.remoteSDP.toString()});let o=await this.peerConnection.createAnswer();if(!o.sdp)throw new Error("Cannot get answer sdp when trying to iceRestart.");let{iceParameters:c}=Ah(o.sdp);return await this.peerConnection.setLocalDescription(o),c}await this.setRemoteDescription({type:"answer",sdp:this.remoteSDP.toString()}),this.isReady=!0}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}close(){var a;this.peerConnection.close(),this.peerConnection.onicecandidate=null,(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.transport=void 0,this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let m=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Pi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}async getSelectedCandidatePair(){let a=this.peerConnection.getReceivers();if(a.length>0&&a[0].transport&&a[0].transport.iceTransport&&a[0].transport.iceTransport.getSelectedCandidatePair&&a[0].transport.iceTransport.getSelectedCandidatePair()){let o=a[0].transport.iceTransport,{local:c,remote:f}=o.getSelectedCandidatePair();return{local:B0(B0({},Wf),{},{candidateType:c.type,protocol:c.protocol,address:c.address,port:c.port}),remote:B0(B0({},Wf),{},{candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})}}return this.statsFilter.getSelectedCandidatePair()}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a,o;Tt(a=["connected","completed"]).call(a,this.peerConnection.iceConnectionState)&&(this.isReady=!1),(o=this.onICEConnectionStateChange)===null||o===void 0||o.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;this.peerConnection.connectionState==="connected"&&(this.restartCnt=0),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.startICECandidate()}startICECandidate(){this.peerConnection.onicecandidate||(this.localCandidateCount=0,this.peerConnection.onicecandidate=a=>{if(a.candidate){var o;a.candidate.candidate&&((o=this.onLocalCandidate)===null||o===void 0||o.call(this,a.candidate.toJSON())),this.localCandidateCount+=1}else z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount)})}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a,o){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,f={iceServers:[]};var m;return a.iceServers?f.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(US(a.turnServer.servers)?f.iceServers=a.turnServer.servers:(f.iceServers&&f.iceServers.push(...Vb.turnServerConfigToIceServers(a.turnServer.servers,o,c)),ve("USE_TURN_SERVER_OF_GATEWAY")&&f.iceServers&&a.turnServer.serversFromGateway&&f.iceServers.push(...Vb.turnServerConfigToIceServers(a.turnServer.serversFromGateway,o,c)),Tt(m=[Gy.Relay,Gy.SdRtn]).call(m,o)&&(f.iceTransportPolicy="relay"),ve("FORCE_TURN_TCP")?f.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(v=>{v.forceturn&&(f.iceTransportPolicy="relay")}))),ve("ENABLE_ENCODED_TRANSFORM")&&Jn().supportWebRTCEncodedTransform&&(f.encodedInsertableStreams=!0),z.debug("P2PConnection p2pTransport is ".concat(o)),f}static turnServerConfigToIceServers(a,o){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,f=[],m=a.filter(w=>w.tcpport);z.debug("P2PConnection turnServers is ".concat(m,", current index is ").concat(c));let v=m.length>c?m[c]:m[0];switch(o){case Gy.SdRtn:let w=a.filter(R=>{var x;return Tt(x=R.username).call(x,"glb:")&&R.turnServerURL==R.turnServerURL}),C=w.length>c?w[c]:w[0];C&&(f.push({username:C.username,credential:C.password,credentialType:"password",urls:"turn:".concat(O0(C.turnServerURL),":").concat(C.tcpport,"?transport=udp")}),f.push({username:C.username,credential:C.password,credentialType:"password",urls:"turns:".concat(O0(C.turnServerURL),":").concat(C.tcpport,"?transport=tcp")}));break;case Gy.Relay:v&&(f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turn:".concat(v.turnServerURL,":").concat(v.tcpport,"?transport=udp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turns:".concat(O0(v.turnServerURL),":").concat(v.tcpport,"?transport=tcp")}));break;default:v&&(f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turn:".concat(v.turnServerURL,":").concat(v.tcpport,"?transport=udp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"turns:".concat(O0(v.turnServerURL),":").concat(v.tcpport,"?transport=tcp")}),f.push({username:v.username,credential:v.password,credentialType:"password",urls:"stun:".concat(v.turnServerURL,":").concat(v.tcpport)}))}return f}tryBindTransportEvents(a){if(a){this.transport=a,a.onstatechange=()=>{var c;a!=null&&a.state&&((c=this.onDTLSTransportStateChange)===null||c===void 0||c.call(this,a.state))},a.onerror=c=>{var f;(f=this.onDTLSTransportError)===null||f===void 0||f.call(this,"error"in c?c.error:c)};let o=a.iceTransport;o&&(o.onstatechange=()=>{let c=a==null?void 0:a.iceTransport.state;var f;c&&((f=this.onICETransportStateChange)===null||f===void 0||f.call(this,c))},o.getSelectedCandidatePair&&(o.onselectedcandidatepairchange=()=>{if(o.getSelectedCandidatePair()){let{local:c,remote:f}=o.getSelectedCandidatePair();z.info("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] selectedcandidatepairchange: local ").concat(JSON.stringify({candidateType:c.type,protocol:c.protocol}),", remote ").concat(JSON.stringify({candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})," )"))}}))}}tryUnbindTransportEvents(){this.transport&&(this.transport.onstatechange=null,this.transport.onerror=null,this.transport.iceTransport&&(this.transport.iceTransport.onstatechange=null))}async updateRtpSenderEncodings(a,o){var c;if(o||(o=this.peerConnection.getSenders().find(x=>x.track===a._mediaStreamTrack)),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(this.isVP8Simulcast(a))return z.warn("[updateRtpSenderEncodings] Track is VP8 simulcast, please apply simulcast encodings");if(!Jn().supportSetRtpSenderParameters)return z.warn("[updateRtpSenderEncodings] Browser not support set rtp-sender parameters");let f={},m={};switch(a._optimizationMode){case"motion":f.degradationPreference="maintain-framerate";break;case"detail":f.degradationPreference="maintain-resolution";break;default:f.degradationPreference="balanced"}if(a._encoderConfig){var v;let{bitrateMax:x,frameRate:L,scaleResolutionDownBy:U}=a._encoderConfig;x&&(m.maxBitrate=1e3*x),Tt(v=a._hints).call(v,Hi.LOW_STREAM)&&(L&&(m.maxFramerate=rl(L)),U&&U>=1&&(m.scaleResolutionDownBy=U))}if(ve("DSCP_TYPE")&&C0()){var w;let x=ve("DSCP_TYPE");Tt(w=["very-low","low","medium","high"]).call(w,x)&&(m.networkPriority=x)}let C=o.getParameters(),R=(c=C.encodings)===null||c===void 0?void 0:c[0];Pi()&&!R&&(f.encodings=[m]),R&&Object.assign(R,m),Object.assign(C,f),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(C.encodings))),await o.setParameters(C)}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],m=o[c];m instanceof ki&&!this.isVP8Simulcast(m)&&await this.updateRtpSenderEncodings(m,f.sender)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o,c){let f=rr.parse(a);return o.forEach((m,v)=>{let w=c[v],C=f.mediaDescriptions.find(R=>R.attributes.mid===w);C&&(F0(C,m),AW(C,m,this.store.codec))}),rr.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let C=0;C<a.length;C++){var c,f,m,v,w;let R=a[C],x=o[C];if(x instanceof ki&&!Tt(c=x._hints).call(c,Hi.LOW_STREAM)&&(f=x._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((m=x._encoderConfig)===null||m===void 0?void 0:m.bitrateMax)>200&&(v=x._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=x._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(x._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Pi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof ki&&this.isVP8Simulcast(f)){let m=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let C=m.sender.getParameters();await m.sender.setParameters(Object.assign(C,v))}}}isVP8Simulcast(a){var o,c,f,m,v;return!!(a instanceof ki&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(m=a._scalabilityMode)!==null&&m!==void 0&&m.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("[".concat(this.store.clientId,"] exchanging ").concat(c," ").concat(o," SDP during P2PConnection.").concat(f,`
`),a),o==="offer"?m=>{this.logSDPExchange(m,"answer",c==="local"?"remote":"local",f)}:void 0}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async v=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}async getRemoteSSRC(a,o){var c,f;if(o=(c=o)!==null&&c!==void 0?c:(f=this.currentRemoteDescription)===null||f===void 0?void 0:f.sdp){var m;let v=(m=rr.parse(o).mediaDescriptions.find(w=>w.attributes.mid===a))===null||m===void 0?void 0:m.attributes.ssrcs;return v==null?void 0:v[0].ssrcId}}async setRemoteDescription(a){var o;await this.peerConnection.setRemoteDescription(a),Tt(o=["connected","completed"]).call(o,this.peerConnection.iceConnectionState)||(this.isReady=!0,this.addRemoteCandidate())}mungReceiveAnswerSDP(a,o,c){let f=rr.parse(a),m=f.mediaDescriptions.find(v=>v.attributes.mid===o);return m&&c===Wt.AUDIO&&m.media.mediaType==="audio"&&Ih(m),rr.print(f)}},vt(Wi.prototype,"establish",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"establish"),Wi.prototype),vt(Wi.prototype,"connect",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"connect"),Wi.prototype),vt(Wi.prototype,"receive",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"receive"),Wi.prototype),vt(Wi.prototype,"mockReceive",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"mockReceive"),Wi.prototype),vt(Wi.prototype,"stopReceiving",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"stopReceiving"),Wi.prototype),vt(Wi.prototype,"restartICE",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"restartICE"),Wi.prototype),vt(Wi.prototype,"close",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"close"),Wi.prototype),vt(Wi.prototype,"updateEncoderConfig",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"updateEncoderConfig"),Wi.prototype),vt(Wi.prototype,"updateSendParameters",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"updateSendParameters"),Wi.prototype),vt(Wi.prototype,"replaceTrack",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"replaceTrack"),Wi.prototype),vt(Wi.prototype,"muteLocal",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"muteLocal"),Wi.prototype),vt(Wi.prototype,"unmuteLocal",[Au],Object.getOwnPropertyDescriptor(Wi.prototype,"unmuteLocal"),Wi.prototype),Wi);function Au(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("From P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}function OW(r,a){let o=document.createElement("video"),c=document.createElement("canvas");o.setAttribute("style","display:none"),c.setAttribute("style","display:none"),o.setAttribute("muted",""),o.muted=!0,o.setAttribute("autoplay",""),o.autoplay=!0,o.setAttribute("playsinline",""),c.width=rl(a.width),c.height=rl(a.height);let f=rl(a.framerate||15);document.body.append(o),document.body.append(c);let m=r._mediaStreamTrack;o.srcObject=new MediaStream([m]),o.play();let v=c.getContext("2d");if(!v)throw new De(ce.UNEXPECTED_ERROR,"can not get canvas context");let w=Jn(),C=c.captureStream(w.supportRequestFrame?0:f).getVideoTracks()[0];C.canvas||(C.canvas=c),c.startCapture=()=>{if(!o)return c.stopCapture&&c.stopCapture();if(o.paused&&o.play(),o.videoHeight>2&&o.videoWidth>2){let x=o.videoWidth,L=o.videoHeight/x,U=c.width*L;Math.abs(U-c.height)>=2&&(z.debug("adjust low stream resolution","".concat(c.width,"x").concat(c.height," -> ").concat(c.width,"x").concat(U)),c.height=U)}v.drawImage(o,0,0,c.width,c.height),C.requestFrame&&C.requestFrame(),m!==r._mediaStreamTrack&&(m=r._mediaStreamTrack,o.srcObject=new MediaStream([m]))},c.stopCapture=hW(()=>c.startCapture&&c.startCapture(),f);let R=C.stop;return C.stop=()=>{R.call(C),o&&(o.remove(),o.srcObject=null,o=null),c&&(c.width=0,c.remove(),c.stopCapture&&c.stopCapture(),c.startCapture=void 0,c.stopCapture=void 0,c=null),z.debug("clean low stream renderer")},C}var LD=function(r){return r[r.HEIGHT=2033]="HEIGHT",r[r.FRAME_RATE=2034]="FRAME_RATE",r[r.WIDTH=2035]="WIDTH",r}(LD||{}),_s=function(r){return r[r.FRAME_RATE=2002]="FRAME_RATE",r[r.WIDTH=2003]="WIDTH",r[r.HEIGHT=2004]="HEIGHT",r[r.PACKAGE_LOST=2005]="PACKAGE_LOST",r[r.AVG_ENCODE=2007]="AVG_ENCODE",r[r.NACKS=2009]="NACKS",r[r.PLIS=2010]="PLIS",r[r.FIRS=2011]="FIRS",r[r.BITRATE=2012]="BITRATE",r[r.PACKAGE_RATE=2031]="PACKAGE_RATE",r[r.ADAPTATION=2032]="ADAPTATION",r[r.ACTUAL_ENCODED=2060]="ACTUAL_ENCODED",r[r.BANDWIDTH=2061]="BANDWIDTH",r[r.RETRANSMIT=2062]="RETRANSMIT",r[r.TARGET_ENCODED=2064]="TARGET_ENCODED",r[r.TRANSMIT=2066]="TRANSMIT",r[r.FREEZE=2082]="FREEZE",r[r.DISABLED=2095]="DISABLED",r[r.PLAYER_STATUS=2128]="PLAYER_STATUS",r[r.QP_SUM=2143]="QP_SUM",r}(_s||{}),l_=function(r){return r[r.BITRATE=2069]="BITRATE",r[r.PACKAGE_LOST=2070]="PACKAGE_LOST",r[r.PACKAGE_RATE=2071]="PACKAGE_RATE",r[r.HEIGHT=2073]="HEIGHT",r[r.FRAME_RATE=2075]="FRAME_RATE",r[r.WIDTH=2077]="WIDTH",r}(l_||{}),Sa=function(r){return r[r.JITTER=-1]="JITTER",r[r.PACKAGE_LOST=2014]="PACKAGE_LOST",r[r.WIDTH=2018]="WIDTH",r[r.HEIGHT=2019]="HEIGHT",r[r.FRAME_RATE=2020]="FRAME_RATE",r[r.JITTER_BUFFER=2023]="JITTER_BUFFER",r[r.CURRENT_DELAY=2024]="CURRENT_DELAY",r[r.NACKS=2026]="NACKS",r[r.PLIS=2027]="PLIS",r[r.FIRS=2028]="FIRS",r[r.BITRATE=2029]="BITRATE",r[r.PACKAGE_RATE=2078]="PACKAGE_RATE",r[r.FREEZE=2084]="FREEZE",r[r.DISABLED=2101]="DISABLED",r[r.PLAYER_STATUS=2129]="PLAYER_STATUS",r[r.QP_SUM=2144]="QP_SUM",r[r.I_FRAME_DELAY=2149]="I_FRAME_DELAY",r}(Sa||{}),c_=function(r){return r[r.FRAME_RATE_DECODE=2021]="FRAME_RATE_DECODE",r[r.FRAME_RATE_RENDER=2022]="FRAME_RATE_RENDER",r[r.FRAME_RATE_OUTPUT=2155]="FRAME_RATE_OUTPUT",r[r.FREEZE_TIME=2109]="FREEZE_TIME",r[r.FREEZE_TIME_RENDER=2147]="FREEZE_TIME_RENDER",r[r.FREEZE_DURATION=2156]="FREEZE_DURATION",r}(c_||{}),Boe=function(r){return r[r.PCM_LEVEL=2104]="PCM_LEVEL",r}(Boe||{}),V0=function(r){return r[r.PACKAGE_LOST=-1]="PACKAGE_LOST",r[r.LEVEL=2038]="LEVEL",r[r.BITRATE=2039]="BITRATE",r[r.PACKAGE_RATE=2040]="PACKAGE_RATE",r[r.AEC_RETURN_LOSS=2041]="AEC_RETURN_LOSS",r[r.AEC_RETURN_LOSS_ENH=2042]="AEC_RETURN_LOSS_ENH",r[r.FREEZE=2081]="FREEZE",r[r.DISABLED=2096]="DISABLED",r}(V0||{}),Iu=function(r){return r[r.BITRATE=2044]="BITRATE",r[r.PACKAGE_LOST=2045]="PACKAGE_LOST",r[r.PACKAGE_RATE=2046]="PACKAGE_RATE",r[r.CURRENT_DELAY=2047]="CURRENT_DELAY",r[r.JITTER_BUFFER=2054]="JITTER_BUFFER",r[r.JITTER=2055]="JITTER",r[r.FREEZE=2083]="FREEZE",r[r.DISABLED=2102]="DISABLED",r[r.PCM_LEVEL=2105]="PCM_LEVEL",r[r.PLAYER_STATUS=2130]="PLAYER_STATUS",r[r.CONCEALED_SAMPLES=2148]="CONCEALED_SAMPLES",r}(Iu||{}),Voe=function(r){return r[r.FREEZE_TIME=-1]="FREEZE_TIME",r[r.LEVEL=2043]="LEVEL",r}(Voe||{}),gd=function(r){return r[r.RTT=2006]="RTT",r[r.CONN_TYPE=801]="CONN_TYPE",r}(gd||{});let Cm=1e3,d_=3;function Mn(r,a,o){o!=null&&Number.isFinite(o)&&(r[a]=Math.round(Math.max(0,o)))}function zoe(r){let a={[gd.CONN_TYPE]:0,[gd.RTT]:r.rtt};switch(r.selectedCandidatePair.localCandidate.candidateType){case"relay":{let o=r.selectedCandidatePair.localCandidate.relayProtocol;o==="udp"&&(a[gd.CONN_TYPE]=1),o==="tcp"&&(a[gd.CONN_TYPE]=3),o==="tls"&&(a[gd.CONN_TYPE]=4);break}case"srflx":a[gd.CONN_TYPE]=2}return a}function Hoe(r){let a=0;switch(r){case"none":a=0;break;case"cpu":a=1;break;case"bandwidth":a=2;break;case"other":a=3}return a}class Goe extends nr{constructor(a){super(),X(this,"store",void 0),X(this,"uploadWRTCStatsTimer",void 0),X(this,"uploadOutboundDenoiserStatsTimer",void 0),X(this,"uploadExtStatsTimer",void 0),X(this,"uploadExtUsageStatsTimer",void 0),X(this,"uploadInboundExtStatsTimer",void 0),X(this,"requestStats",void 0),X(this,"requestTransportStats",void 0),X(this,"requestLocalMedia",void 0),X(this,"requestRemoteMedia",void 0),X(this,"requestAllTracks",void 0),X(this,"requestVideoIsReady",void 0),X(this,"requestUploadStats",void 0),X(this,"requestUpload",void 0),X(this,"uploadOutboundStarted",!1),X(this,"uploadInboundStarted",!1),X(this,"uploadTransportStarted",!1),X(this,"uploadExtensionUsageStarted",!1),X(this,"lastRecvStats",void 0),X(this,"lastSendStats",void 0),X(this,"lastFullRecvStats",void 0),X(this,"lastFullSendStats",void 0),X(this,"needUploadRenderFreezeTime",!0),this.store=a}uploadWRTCStats(a){if(!this.requestStats||!this.requestUploadStats)return;let o,c;if(this.uploadTransportStarted&&(o=this.requestStats(),this.store.useP2P&&(c=this.requestStats(!0))),!o&&this.uploadOutboundStarted&&(o=this.requestStats()),!c&&this.uploadInboundStarted&&(c=this.requestStats(!0)),o||c){let f={};if(this.uploadTransportStarted&&o){let m=this.getTransportStats(o,c,a);m&&(f.misc=[m])}if(this.uploadOutboundStarted&&o){let m=this.getOutboundStats(o,a?this.lastSendStats:this.lastFullSendStats,a);m&&(f.outbound=[m])}if(this.uploadInboundStarted&&c){let m=this.getInboundStats(c,a?this.lastRecvStats:this.lastFullRecvStats,a);m&&(f.inbound=m)}this.requestUploadStats(f)}this.lastRecvStats=c,this.lastSendStats=o,a||(this.lastFullRecvStats=c,this.lastFullSendStats=o)}startUploadWRTCStats(){if(this.uploadWRTCStatsTimer)return;let a=1;this.uploadWRTCStatsTimer=window.setInterval(()=>{if(!this.uploadTransportStarted&&!this.uploadInboundStarted&&!this.uploadOutboundStarted)return this.stopUploadWRTCStats();this.uploadWRTCStats(a!==d_),++a===d_+1&&(a=1)},Cm)}stopUploadWRTCStats(){window.clearInterval(this.uploadWRTCStatsTimer),this.uploadWRTCStatsTimer=void 0,this.lastSendStats&&(this.lastSendStats.videoSend=[],this.lastSendStats.audioSend=[],this.lastSendStats=void 0),this.lastRecvStats&&(this.lastRecvStats.videoRecv=[],this.lastRecvStats.audioRecv=[],this.lastRecvStats=void 0)}getTransportStats(a,o,c){if(!this.requestStats)return;if(c)return a.rtt==null?void 0:{addition:{[gd.RTT]:a.rtt,[gd.CONN_TYPE]:void 0}};let f=zoe(a);if(this.store.useP2P){if(o){let m=zoe(o);f[gd.CONN_TYPE]+=m[gd.CONN_TYPE]<<3}f[gd.CONN_TYPE]+=110}else f[gd.CONN_TYPE]+=100;return{addition:f}}getOutboundStats(a,o,c){if(!this.requestUploadStats||!this.requestLocalMedia)return;let f=this.requestLocalMedia();if(!f||f.length===0)return;let m,v,w;return f.forEach(C=>{let[R,{track:x,ssrcs:L}]=C;switch(R){case ht.LocalVideoLowTrack:case ht.LocalVideoTrack:if(R===ht.LocalVideoTrack){let U=function(W,K,oe,ue,xe){let Oe=K.videoSend.find(zt=>zt.ssrc===W);if(!Oe)return;let ke={},{sentFrame:He,inputFrame:lt}=Oe;if(lt&&He){let zt=lt.frameRate,$n=He.frameRate;ke[_s.FREEZE]=function(hi,Gi){let Ur=!0;return Ur=!(hi<=5)&&(hi<=10?Gi<3:hi<=20?Gi<4:Gi<5),Ur}(zt,$n)?1:0}if(Mn(ke,_s.QP_SUM,Oe.qpSumPerFrame),xe)return ke;switch(He&&(Mn(ke,_s.HEIGHT,He.height),Mn(ke,_s.WIDTH,He.width),Mn(ke,_s.FRAME_RATE,He.frameRate)),ke[_s.DISABLED]=ue._originMediaStreamTrack&&!ue._originMediaStreamTrack.enabled||ue._mediaStreamTrack&&!ue._mediaStreamTrack.enabled?1:0,Oe.adaptionChangeReason){case"none":ke[_s.ADAPTATION]=0;break;case"cpu":ke[_s.ADAPTATION]=1;break;case"bandwidth":ke[_s.ADAPTATION]=2;break;case"other":ke[_s.ADAPTATION]=3}let ut=0;Oe.adaptionChangeReason&&(ut+=Hoe(Oe.adaptionChangeReason)),K.qualityLimitationReason&&(ut+=Hoe(K.qualityLimitationReason)<<3),ke[_s.ADAPTATION]=ut,ke[_s.PLAYER_STATUS]=dW[ue._player?ue._player.videoElementStatus:"uninit"],Mn(ke,_s.NACKS,Oe.nacksCount),Mn(ke,_s.PLIS,Oe.plisCount),Mn(ke,_s.FIRS,Oe.firsCount),Mn(ke,_s.AVG_ENCODE,Oe.avgEncodeMs);let ft=oe&&oe.videoSend.find(zt=>zt.ssrc===W);if(ft){let zt=xe?Cm:Cm*d_;ft.timestamp&&Oe.timestamp&&(zt=Oe.timestamp-ft.timestamp),ft.packets!=null&&Oe.packets!=null&&Mn(ke,_s.PACKAGE_RATE,1e3*(Oe.packets-ft.packets)/zt),Oe.packetsLost!=null&&ft.packetsLost!=null&&Mn(ke,_s.PACKAGE_LOST,Oe.packetsLost-ft.packetsLost),ft.bytes!=null&&Oe.bytes!=null&&Mn(ke,_s.BITRATE,8*(Oe.bytes-ft.bytes)/zt)}return ke}(L[0].ssrcId,a,o,x,c),F=c?null:function(W,K,oe){let ue=K.videoSend.find(ut=>ut.ssrc===W);if(!ue)return null;let xe={},Oe=ue.inputFrame,ke=Oe&&Oe.height||oe&&oe.videoHeight||0,He=Oe&&Oe.width||oe&&oe.videoWidth||0,lt=Oe&&Oe.frameRate||0;return Mn(xe,LD.HEIGHT,ke),Mn(xe,LD.WIDTH,He),Mn(xe,LD.FRAME_RATE,lt),xe}(L[0].ssrcId,a,x),Z=c?null:function(W){let K={};return Mn(K,_s.RETRANSMIT,W.bitrate.retransmit),Mn(K,_s.TARGET_ENCODED,W.bitrate.targetEncoded),Mn(K,_s.ACTUAL_ENCODED,W.bitrate.actualEncoded),Mn(K,_s.TRANSMIT,W.bitrate.transmit),Mn(K,_s.BANDWIDTH,W.sendBandwidth),K}(a);v=Object.assign({},U,F,Z)}else w=c?void 0:function(U,F,Z){let W=F.videoSend.find(ue=>ue.ssrc===U);if(!W)return;let K={},oe=W.sentFrame;if(oe&&(Mn(K,l_.HEIGHT,oe.height),Mn(K,l_.WIDTH,oe.width),Mn(K,l_.FRAME_RATE,oe.frameRate)),Z){let ue=Z.videoSend.find(xe=>xe.ssrc===U);if(ue){let xe=Cm*d_;ue.timestamp&&W.timestamp&&(xe=W.timestamp-ue.timestamp),ue.packets!=null&&W.packets!=null&&Mn(K,l_.PACKAGE_RATE,1e3*(W.packets-ue.packets)/xe),W.packetsLost!=null&&ue.packetsLost!=null&&Mn(K,l_.PACKAGE_LOST,W.packetsLost-ue.packetsLost),ue.bytes!=null&&W.bytes!=null&&Mn(K,l_.BITRATE,8*(W.bytes-ue.bytes)/xe)}}return K}(L[0].ssrcId,a,o);break;case ht.LocalAudioTrack:m=c?void 0:function(U,F,Z,W){let K=F.audioSend.find(ke=>ke.ssrc===U);if(!K)return;let oe={};oe[V0.DISABLED]=W._originMediaStreamTrack&&!W._originMediaStreamTrack.enabled||W._mediaStreamTrack&&!W._mediaStreamTrack.enabled?1:0;let ue=100*W._source.getAccurateVolumeLevel(),xe=K.inputLevel;if(xe!=null){let ke=Math.ceil(50*Math.log10(100*xe+1));Mn(oe,V0.LEVEL,ke)}Mn(oe,Boe.PCM_LEVEL,ue),Mn(oe,V0.AEC_RETURN_LOSS,K.aecReturnLoss),Mn(oe,V0.AEC_RETURN_LOSS_ENH,K.aecReturnLossEnhancement),oe[V0.FREEZE]=0;let Oe=Z&&Z.audioSend.find(ke=>ke.ssrc===U);if(Oe){let ke=Cm*d_;Oe.timestamp&&K.timestamp&&(ke=K.timestamp-Oe.timestamp),Oe.bytes!=null&&K.bytes!=null&&Mn(oe,V0.BITRATE,8*(K.bytes-Oe.bytes)/ke),Oe.packets!=null&&K.packets!=null&&Mn(oe,V0.PACKAGE_RATE,1e3*(K.packets-Oe.packets)/ke)}return oe}(L[0].ssrcId,a,o,x)}}),{high:v,low:w,audio:m}}getInboundStats(a,o,c){if(!this.requestRemoteMedia)return;let f=this.requestRemoteMedia()||[],m=[];return f.forEach(v=>{let[w,C]=v,R={peer:w.uid};if(C.has(Wt.VIDEO)&&w.videoTrack){let x=w._videoSSRC&&this.requestVideoIsReady&&this.requestVideoIsReady(w._videoSSRC)||!1,L=w.videoTrack?function(U,F,Z,W,K,oe,ue){var xe;let Oe=F.videoRecv.find($n=>$n.ssrc===U);if(!Oe)return;let ke={},{receivedFrame:He,outputFrame:lt,decodeFrameRate:ut}=Oe,ft=Z&&Z.videoRecv.find($n=>$n.ssrc===U);if(ke[Sa.FREEZE]=K&&Z3.isRemoteVideoFreeze(W,Oe,ft)?1:0,Mn(ke,c_.FRAME_RATE_DECODE,ut),Mn(ke,Sa.QP_SUM,Oe.qpSumPerFrame),Oe.framesRateFirefox&&Mn(ke,Sa.FRAME_RATE,Oe.framesRateFirefox),He&&Mn(ke,Sa.FRAME_RATE,He.frameRate),ft){let $n=F.timestamp-Z.timestamp||(ue?Cm:d_*Cm);Oe.packetsLost!=null&&ft.packetsLost!=null&&Mn(ke,Sa.PACKAGE_LOST,Oe.packetsLost-ft.packetsLost),ft.bytes!=null&&Oe.bytes!=null&&Mn(ke,Sa.BITRATE,8*(Oe.bytes-ft.bytes)/$n),ft.packets!=null&&Oe.packets!=null&&Mn(ke,Sa.PACKAGE_RATE,1e3*(Oe.packets-ft.packets)/$n)}if(ue)return ke;He?(Mn(ke,Sa.HEIGHT,He.height),Mn(ke,Sa.WIDTH,He.width)):W&&(Mn(ke,Sa.HEIGHT,W._videoHeight||0),Mn(ke,Sa.WIDTH,W._videoWidth||0)),lt&&Mn(ke,c_.FRAME_RATE_OUTPUT,lt.frameRate);let zt=(xe=W._player)===null||xe===void 0?void 0:xe.rendFrameRate.toFixed(0);if(zt&&Mn(ke,c_.FRAME_RATE_RENDER,+zt),Mn(ke,Sa.JITTER_BUFFER,Oe.jitterBufferMs),Mn(ke,Sa.CURRENT_DELAY,Oe.currentDelayMs),Mn(ke,Sa.FIRS,Oe.firsCount),Mn(ke,Sa.NACKS,Oe.nacksCount),Mn(ke,Sa.PLIS,Oe.plisCount),W){ke[Sa.DISABLED]=W._originMediaStreamTrack.enabled&&W._mediaStreamTrack.enabled?0:1;let $n=W._player;if($n){let{freezeTimeCounterList:hi,renderFreezeAccTime:Gi,videoElementStatus:Ur}=$n;if(hi&&hi.length>0&&Mn(ke,c_.FREEZE_TIME,hi.splice(0,1)[0]),oe&&bm.visibility==="visible"&&Ur===Da.PLAYING&&Jn().supportRequestVideoFrameCallback){let mr=Math.min(6e3,Gi);$n.renderFreezeAccTime=Math.max(0,Gi-mr),Mn(ke,c_.FREEZE_TIME_RENDER,mr)}if(typeof Oe.totalFreezesDuration=="number"){let mr=ft&&ft.totalFreezesDuration?Oe.totalFreezesDuration-ft.totalFreezesDuration:Oe.totalFreezesDuration;Mn(ke,c_.FREEZE_DURATION,1e3*mr)}}}if(ke[Sa.PLAYER_STATUS]=dW[W._player?W._player.videoElementStatus:"uninit"],ft&&Oe.totalInterFrameDelay!==void 0&&Oe.totalSquaredInterFrameDelay!==void 0&&ft.totalInterFrameDelay!==void 0&&ft.totalSquaredInterFrameDelay!==void 0){let $n=Oe.totalInterFrameDelay-ft.totalInterFrameDelay,hi=Oe.totalSquaredInterFrameDelay-ft.totalSquaredInterFrameDelay,Gi=Oe.framesDecodeCount-ft.framesDecodeCount,Ur=$n/Gi*1e3,mr=Math.round(1e3*Math.sqrt((hi-Math.pow($n,2)/Gi)/Gi));!isNaN(mr)&&Ur+mr>Math.max(3*Ur,Ur+150)&&(ke[Sa.I_FRAME_DELAY]=mr)}return ke}(w._videoSSRC,a,o,w.videoTrack,x===!0,this.needUploadRenderFreezeTime,c):void 0;L&&(R.video=L)}if(C.has(Wt.AUDIO)&&w.audioTrack){let x=w.audioTrack?function(L,U,F,Z,W){let K=U.audioRecv.find(ft=>ft.ssrc===L);if(!K)return;let oe={},ue=F&&F.audioRecv.find(ft=>ft.ssrc===L),{receivedFrames:xe,droppedFrames:Oe}=K;var ke,He;if(Mn(oe,Iu.JITTER,K.jitterMs),xe!=null&&Oe!=null&&(oe[Iu.FREEZE]=(He=Oe,(ke=xe)===0||100*He/ke>20?1:0)),ue){let ft=U.timestamp-F.timestamp||(W?Cm:Cm*d_);K.packets!=null&&ue.packets!=null&&Mn(oe,Iu.PACKAGE_RATE,1e3*(K.packets-ue.packets)/ft),ue.bytes!=null&&K.bytes!=null&&Mn(oe,Iu.BITRATE,8*(K.bytes-ue.bytes)/ft),K.packetsLost!=null&&ue.packetsLost!=null&&Mn(oe,Iu.PACKAGE_LOST,K.packetsLost-ue.packetsLost)}if(W)return oe;let lt=100*Z._source.getAccurateVolumeLevel(),ut=K.outputLevel;if(ut!=null){let ft=Math.ceil(50*Math.log10(100*ut+1));Mn(oe,Voe.LEVEL,ft)}if(Mn(oe,Iu.PCM_LEVEL,lt),Z&&(oe[Iu.DISABLED]=Z._originMediaStreamTrack.enabled&&Z._mediaStreamTrack.enabled?0:1),Mn(oe,Iu.JITTER_BUFFER,K.jitterBufferMs),Mn(oe,Iu.CURRENT_DELAY,K.jitterBufferMs),oe[Iu.PLAYER_STATUS]=dW[Oo.getPlayerState(Z.getTrackId())],ue){let ft=K.concealedSamples-ue.concealedSamples;ft>0&&Mn(oe,Iu.CONCEALED_SAMPLES,ft)}return oe}(w._audioSSRC,a,o,w.audioTrack,c):void 0;x&&(R.audio=x)}(R.video||R.audio)&&m.push(R)}),this.needUploadRenderFreezeTime=!this.needUploadRenderFreezeTime,m}startUploadTransportStats(){this.uploadTransportStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats()}stopUploadTransportStats(){this.uploadTransportStarted=!1}startUploadOutboundStats(){this.uploadOutboundStarted||(this.uploadOutboundStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats(),this.uploadOutboundDenoiserStatsTimer&&window.clearInterval(this.uploadOutboundDenoiserStatsTimer),this.uploadOutboundDenoiserStatsTimer=window.setInterval(()=>{if(!this.requestAllTracks||!this.requestUpload)return;let a=(this.requestAllTracks()||[]).find(o=>o instanceof CD);if(a&&a._external.getDenoiserStats){let o=a._external.getDenoiserStats();o&&this.requestUpload($y.DENOISER_STATS,o)}},2e3),this.uploadExtStatsTimer&&window.clearInterval(this.uploadExtStatsTimer),this.uploadExtStatsTimer=window.setInterval(()=>{!this.requestAllTracks||!this.requestUpload||this.requestAllTracks().forEach(a=>{a.getProcessorStats().forEach(o=>{this.requestUpload&&this.requestUpload(o.type,o.stats)})})},2e3))}stopUploadOutboundStats(){this.uploadOutboundStarted&&(this.uploadOutboundStarted=!1,this.lastSendStats&&(this.lastSendStats.videoSend=[],this.lastSendStats.audioSend=[],this.lastSendStats=void 0),this.uploadOutboundDenoiserStatsTimer&&window.clearInterval(this.uploadOutboundDenoiserStatsTimer),this.uploadOutboundDenoiserStatsTimer=void 0)}startUploadInboundStats(){this.uploadInboundStarted||(this.uploadInboundStarted=!0,this.uploadWRTCStatsTimer||this.startUploadWRTCStats(),this.uploadInboundExtStatsTimer&&window.clearInterval(this.uploadInboundExtStatsTimer),this.uploadInboundExtStatsTimer=window.setInterval(()=>{!this.requestUpload||!this.requestRemoteMedia||(this.requestRemoteMedia()||[]).forEach(a=>{let[o,c]=a;c.has(Wt.VIDEO)&&o.videoTrack&&o.videoTrack.getProcessorStats().forEach(f=>{this.requestUpload&&this.requestUpload(f.type,f.stats)}),c.has(Wt.AUDIO)&&o.audioTrack&&o.audioTrack.getProcessorStats().forEach(f=>{this.requestUpload&&this.requestUpload(f.type,f.stats)})})},2e3))}stopUploadInboundStats(){this.uploadInboundStarted&&(this.uploadInboundStarted=!1,this.lastRecvStats&&(this.lastRecvStats.videoRecv=[],this.lastRecvStats.audioRecv=[],this.lastRecvStats=void 0))}startUploadExtensionUsageStats(){if(this.uploadExtensionUsageStarted)return;this.uploadExtensionUsageStarted=!0,this.uploadExtUsageStatsTimer&&window.clearInterval(this.uploadExtUsageStatsTimer);let a=new Map;this.uploadExtUsageStatsTimer=window.setInterval(async()=>{let o=Date.now(),c={connectionInterval:ve("EXTENSION_USAGE_UPLOAD_INTERVAL")/1e3,details:[],lts:o},f=[],m=this.requestAllTracks&&this.requestAllTracks()||[];for(let R of m)!R.muted&&R.enabled&&(f=f.concat(await R.getProcessorUsage()));let v=this.requestRemoteMedia&&this.requestRemoteMedia()||[];for(let[R,x]of v)x.has(Wt.VIDEO)&&R.videoTrack&&(f=f.concat(await R.videoTrack.getProcessorUsage())),x.has(Wt.AUDIO)&&R.audioTrack&&(f=f.concat(await R.audioTrack.getProcessorUsage()));if(f.length===0)return;c.details=function(R,x){let L={};for(let{id:W,value:K,level:oe,direction:ue}of R){var U;let xe=(U=x.get(W))!==null&&U!==void 0?U:0,Oe=K===2?xe+ve("EXTENSION_USAGE_UPLOAD_INTERVAL")/1e3:xe;var F,Z;x.set(W,Oe),L[W]?(K===2&&(L[W].value=K),oe>L[W].level&&(L[W].level=oe),ue==="remote"&&(L[W].remoteUidCount+=1),L[W].totalTs=(F=x.get(W))!==null&&F!==void 0?F:0):L[W]={value:K,level:oe,remoteUidCount:ue==="local"?0:1,totalTs:(Z=x.get(W))!==null&&Z!==void 0?Z:0}}return Object.keys(L).map(W=>{let{level:K,value:oe,totalTs:ue}=L[W];return{id:W,level:K,value:oe,totalTs:ue}})}(f,a);let w=Date.now(),C=w>o?w:o+1;this.requestUpload&&this.requestUpload($y.EXTENSION_USAGE_STATS,{usageStats:c,sendTs:C})},ve("EXTENSION_USAGE_UPLOAD_INTERVAL"))}stopUploadExtensionUsageStats(){this.uploadExtensionUsageStarted&&(this.uploadExtensionUsageStarted=!1,this.uploadExtUsageStatsTimer&&window.clearInterval(this.uploadExtUsageStatsTimer),this.uploadExtUsageStatsTimer=void 0)}}class z0{get hasVideo(){return this._video_enabled_&&!this._video_muted_&&this._video_added_}get hasAudio(){return this._audio_enabled_&&!this._audio_muted_&&this._audio_added_}get audioTrack(){if(this.hasAudio||this._audio_pre_subscribed)return this._audioTrack}get videoTrack(){if(this.hasVideo||this._video_pre_subscribed)return this._videoTrack}get dataChannels(){return this._dataChannels}constructor(a,o){X(this,"uid",void 0),X(this,"_uintid",void 0),X(this,"_trust_in_room_",!0),X(this,"_trust_audio_enabled_state_",!0),X(this,"_trust_video_enabled_state_",!0),X(this,"_trust_audio_mute_state_",!0),X(this,"_trust_video_mute_state_",!0),X(this,"_audio_muted_",!1),X(this,"_video_muted_",!1),X(this,"_audio_enabled_",!0),X(this,"_video_enabled_",!0),X(this,"_audio_added_",!1),X(this,"_video_added_",!1),X(this,"_is_pre_created",!1),X(this,"_video_pre_subscribed",!1),X(this,"_audio_pre_subscribed",!1),X(this,"_trust_video_stream_added_state_",!0),X(this,"_trust_audio_stream_added_state_",!0),X(this,"_audioTrack",void 0),X(this,"_videoTrack",void 0),X(this,"_dataChannels",[]),X(this,"_audioSSRC",void 0),X(this,"_videoSSRC",void 0),X(this,"_audioOrtc",void 0),X(this,"_videoOrtc",void 0),X(this,"_cname",void 0),X(this,"_rtxSsrcId",void 0),X(this,"_videoMid",void 0),X(this,"_audioMid",void 0),this.uid=a,this._uintid=o}}let Nh=function(r){return r.SEND_ONLY="SEND_ONLY",r.RECEIVE_ONLY="RECEIVE_ONLY",r}({});function C4e(r,a){var o;let c;switch(a){case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=r._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:c=pi.Low}return c}function PW(r){let a=Jn();if(r.some(o=>o._bypassWebAudio))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");if(!a.webAudioMediaStreamDest)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks because your browser does not support audio mixing")}function LW(r,a){PW(r);let o=new ns;return r.forEach(c=>o.addAudioTrack(c)),o}var Woe,$oe,Koe,qoe,Yoe,Xoe,Joe,Qoe,Zoe,ele,tle,sr;function nle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function DD(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?nle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):nle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Fl=(Woe=Oh(Nh.SEND_ONLY),$oe=Oh(Nh.SEND_ONLY),Koe=Oh(),qoe=Oh(Nh.RECEIVE_ONLY),Yoe=Oh(Nh.RECEIVE_ONLY),Xoe=Oh(Nh.RECEIVE_ONLY),Joe=Oh(Nh.RECEIVE_ONLY),Qoe=Oh(Nh.RECEIVE_ONLY),Zoe=Oh(Nh.RECEIVE_ONLY),ele=Oh(),tle=Oh(Nh.RECEIVE_ONLY),sr=class extends nr{get state(){return this._state}set state(r){let a=this._state;this._state=r,this.emit(pn.StateChange,a,this._state)}constructor(r,a){super(),X(this,"store",void 0),X(this,"statsUploader",void 0),X(this,"sendConnection",void 0),X(this,"recvConnection",void 0),X(this,"localTrackMap",new Map),X(this,"remoteUserMap",new Map),X(this,"localDataChannels",[]),X(this,"pendingLocalTracks",[]),X(this,"pendingRemoteTracks",[]),X(this,"statsCollector",void 0),X(this,"dtlsFailedCount",0),X(this,"sendMutex",new Ts("P2PChannel2-send-mutex")),X(this,"recvMutex",new Ts("P2PChannel2-recv-mutex")),X(this,"_state",gi.Disconnected),X(this,"_restartStates",["disconnected","failed"]),X(this,"reconnectInterval",void 0),X(this,"uploadUnplinkStarted",!1),X(this,"uploadDownlinkStarted",!1),X(this,"uplinkStateUploadInterval",void 0),X(this,"downlinkStatsUploadInterval",void 0),X(this,"handleMuteLocalTrack",async(o,c,f)=>{let m=await this.sendMutex.lock("Locking from P2PChannel2.handleMuteLocalTrack");try{if(!this.sendConnection||this.state!==gi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before sendConnection established."));let C=this.filterTobeMutedTracks(o);if(C.length===0)return void c();let R=C.find(F=>F[0]==="videoLowTrack");R&&R[1].track._originMediaStreamTrack.stop(),await this.sendConnection.muteLocal(C.map(F=>{let[,{id:Z}]=F;return Z}));let x=!1;var v,w;o.trackMediaType==="video"?x=!((v=this.localTrackMap.get(ht.LocalAudioTrack))===null||v===void 0||!v.track._muted):x=((w=this.localTrackMap.get(ht.LocalVideoTrack))===null||w===void 0?void 0:w.id)===void 0;let L=this.createMuteMessage(C);await Li(this,pn.RequestMuteLocal,L);let U=o.trackMediaType==="video"?N0.MUTE_LOCAL_VIDEO:N0.MUTE_LOCAL_AUDIO;await Li(this,pn.RequestP2PMuteLocal,{action:U,message:L,isMuteAll:x}),c()}catch(C){f(C)}finally{m()}}),X(this,"handleUnmuteLocalTrack",async(o,c,f)=>{let m=await this.sendMutex.lock("Locking from P2PChannel2.handleUnmuteLocalTrack");try{if(!this.sendConnection||this.state!==gi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleUnmuteLocalTrack before sendConnection established."));let v=this.filterTobeUnmutedTracks(o);if(v.length===0)return void c();await this.sendConnection.unmuteLocal(v.map(R=>{let[,{id:x}]=R;return x}));let w=this.createUnmuteMessage(v),C=o.trackMediaType==="video"?N0.UNMUTE_LOCAL_VIDEO:N0.UNMUTE_LOCAL_AUDIO;await Li(this,pn.RequestP2PMuteLocal,{action:C,message:w}),c()}catch(v){f(v)}finally{m()}}),X(this,"handleUpdateVideoEncoder",async(o,c,f)=>{let m=await this.sendMutex.lock("Locking from P2PChannel2.handleSetVideoEncoder");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.sendConnection||!v||v.track!==o||this.state!==gi.Connected)return void c();let{id:w,track:C}=v;w&&(await this.sendConnection.updateSendParameters(w,C),await this.sendConnection.updateEncoderConfig(w,C),this.emit(pn.UpdateVideoEncoder,C)),c()}catch(v){f(v)}finally{m()}}),X(this,"handleUpdateVideoSendParameters",async(o,c,f)=>{let m=await this.sendMutex.lock("Locking from P2PChannel2.handleUpdateVideoSendParameters");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.sendConnection||!v||v.track!==o||this.state!==gi.Connected)return void c();let{id:w,track:C}=v;w&&await this.sendConnection.updateSendParameters(w,C),c()}catch(v){f(v)}finally{m()}}),X(this,"handleReplaceTrack",async(o,c,f,m)=>{let v;z.debug("[".concat(this.store.clientId,"] P2PChannel2 handleReplaceTrack for [track-id-").concat(o.getTrackId(),"]")),typeof m=="boolean"&&m||(v=await this.sendMutex.lock("From P2PChannel2.handleReplaceTrack"));try{var w;let R=Array.from(this.localTrackMap.entries()).find(x=>{let[,{track:L}]=x;return o===L});if(!this.sendConnection||!R||R[1].id===void 0||this.state!==gi.Connected)return void c();if(await((w=this.sendConnection)===null||w===void 0?void 0:w.replaceTrack(o,R[1].id)),R[0]===ht.LocalVideoTrack&&Jn().supportDualStreamEncoding){let x=this.localTrackMap.get(ht.LocalVideoLowTrack);if(x){let L=o._mediaStreamTrack.clone();x.track._originMediaStreamTrack.stop(),x.track._mediaStreamTrack=L,x.track._originMediaStreamTrack=L,await new Ct((U,F)=>{this.handleReplaceTrack(x.track,U,F,!0)})}}c()}catch(R){f(R)}finally{var C;(C=v)===null||C===void 0||C()}}),X(this,"handleGetLocalVideoStats",o=>{o(this.statsCollector.getLocalVideoTrackStats())}),X(this,"handleGetLocalAudioStats",o=>{o(this.statsCollector.getLocalAudioTrackStats())}),X(this,"handleGetRemoteVideoStats",o=>this.statsCollector.getRemoteVideoTrackStats(o.uid)[o.uid]),X(this,"handleGetRemoteAudioStats",o=>this.statsCollector.getRemoteAudioTrackStats(o.uid)[o.uid]),this.store=r,this.statsCollector=a,this.statsCollector.addP2PChannel(this),this.statsUploader=new Goe(r),this.bindStatsUploaderEvents(),this.reconnectInterval=window.setInterval(()=>{[this.sendConnection,this.recvConnection].forEach(o=>{o&&(o.iceConnectionState!=="disconnected"&&o.iceConnectionState!=="failed"||this.handleDisconnect(o.direction))})},ve("ICE_RESTART_INTERVAL"))}async startP2PConnection(r,a){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support startP2PConnection.")}async connect(r,a,o,c,f,m){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support connect.")}async startP2P(r,a){let o;try{if(a){this.recvConnection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2P reset recvConnection.")),this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection)),o=await this.recvMutex.lock("From P2PChannel.startP2P"),this.recvConnection=new Foe(r,this.store,no.RECEIVE_ONLY),this.bindConnectionEvents(this.recvConnection);let c=await this.recvConnection.establish(a);return{iceParameters:c.iceParameters,dtlsParameters:c.dtlsParameters,sdp:c.sdp}}{this.state=gi.New,this.sendConnection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2P reset sendConnection.")),this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection)),o=await this.sendMutex.lock("From P2PChannel.startP2P"),this.sendConnection=new Foe(r,this.store),this.store.peerConnectionStart(),this.bindConnectionEvents(this.sendConnection);let c=await this.sendConnection.establish();return{iceParameters:c.iceParameters,dtlsParameters:c.dtlsParameters,sdp:c.sdp}}}finally{o&&o()}}async p2pConnect(r){if(!this.sendConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.p2pConnect before P2PChannel2.startP2PConnection .");this.store.peerConnectionStart(),await this.sendConnection.connect(r),this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=gi.Connected}async addRemoteCandidate(r,a){if(a===no.RECEIVE_ONLY){if(!this.sendConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.connect before P2PChannel2.addRemoteCandidate .");await this.sendConnection.addRemoteCandidate(r)}else{if(!this.recvConnection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel2.connect before P2PChannel2.addRemoteCandidate .");await this.recvConnection.addRemoteCandidate(r)}}publish(r,a,o){var c=this;return Ul(function*(){let f=yield Dn(c.sendMutex.lock("From P2PChannel.publish"));try{if(!c.sendConnection||c.state!==gi.Connected){c.throwIfTrackTypeNotMatch(r);let R=r.filter(x=>c.pendingLocalTracks.indexOf(x)===-1);return void(c.pendingLocalTracks=c.pendingLocalTracks.concat(R))}c.store.pubId=c.store.pubId+1,aa.markPublishStart(c.store.clientId,c.store.pubId);let m=c.filterTobePublishedTracks(r,a,o);if(m.length===0)return void(yield Dn(c.tryToUnmuteAudio(r)));m.forEach(R=>{let{track:x,type:L}=R,U=Date.now();c.store.publish(x.getTrackId(),L===ht.LocalAudioTrack?"audio":"video",U)}),c.bindLocalTrackEvents(m);let v=yield Dn(c.sendConnection.send(m.map(R=>{let{track:x}=R;return x}),c.store.codec,c.store.audioCodec)),w=(yield Dn(v.next())).value,C=c.createGatewayPublishMessage(m,w);try{yield C}catch(R){throw v.throw(R),(R==null?void 0:R.code)===ce.WS_ABORT&&m.forEach(x=>{let{track:L}=x;c.pendingLocalTracks.indexOf(L)===-1&&c.pendingLocalTracks.push(L)}),c.unbindLocalTrackEvents(m),R}yield Dn(v.next()),m.forEach(R=>{let{type:x}=R;c.statsCollector.addLocalStats(x)}),c.statsUploader.startUploadOutboundStats(),c.assignLocalTracks(m,w),m.forEach(R=>{let{track:x,type:L}=R,U=Date.now();c.store.publish(x.getTrackId(),L===ht.LocalAudioTrack?"audio":"video",void 0,U)}),c.startUploadUplinkState()}finally{f()}})()}async unpublish(r){if(!this.sendConnection||this.state!==gi.Connected)return void(r.length===0?this.pendingLocalTracks.length=0:this.pendingLocalTracks=this.pendingLocalTracks.filter(f=>!Tt(r).call(r,f)));let a=this.filterTobeUnpublishedTracks(r);if(a.length===0)return;let o=a.find(f=>f[0]==="videoLowTrack");o&&o[1].track.close();let c=this.createGatewayUnpublishMessage(a);if(await this.sendConnection.stopSending(a.map(f=>{let[,{id:m}]=f;return m})),this.withdrawLocalTracks(a),this.unbindLocalTrackEvents(a.map(f=>{let[m,{track:v}]=f;return{type:m,track:v}})),a.forEach(f=>{let[m]=f;this.statsCollector.removeLocalStats(m)}),this.localTrackMap.size===0&&(this.statsUploader.stopUploadOutboundStats(),this.stopUploadUplinkState()),this.sendConnection&&this.state===gi.Connected)return o&&o[1].track.close(),c;r.forEach(f=>{let m=this.pendingLocalTracks.indexOf(f);m!==-1&&this.pendingLocalTracks.splice(m,1)})}startUploadUplinkState(){if(this.uploadUnplinkStarted)return;this.uploadUnplinkStarted=!0,this.uplinkStateUploadInterval&&window.clearInterval(this.uplinkStateUploadInterval);let r=()=>{let a=[],o=[];Array.from(this.localTrackMap.entries()).forEach(c=>{let[f,{track:m,ssrcs:v}]=c,w={stream_type:C4e(m,f),ssrcs:v};m._muted||!m._enabled?a.push(w):o.push(w)}),a.length>0&&a.forEach(c=>{Li(this,pn.RequestMuteLocal,[c])}),o.length>0&&o.forEach(c=>{Li(this,pn.RequestUnmuteLocal,[c])})};r(),this.uplinkStateUploadInterval=window.setInterval(()=>{r()},3e3)}stopUploadUplinkState(){this.uploadUnplinkStarted&&(this.uploadUnplinkStarted=!1,this.uplinkStateUploadInterval&&window.clearInterval(this.uplinkStateUploadInterval))}publishLowStream(r){return Ul(function*(){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support publishLowStream.")})()}async republish(){this.pendingLocalTracks.length>0&&(z.debug("[".concat(this.store.clientId,"] Emit P2PChannelEvents.RequestRePublish to republish tracks.")),await Kr(this,pn.RequestRePublish,this.pendingLocalTracks),this.emit(pn.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[])}async unpublishLowStream(){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support unpublishLowStream.")}async subscribe(r,a,o,c){var f;if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when recvConnection disconnected.");if((f=this.remoteUserMap.get(r))!==null&&f!==void 0&&f.has(a))return;let{track:m,mid:v,transceiver:w}=await this.recvConnection.receive(a,[{ssrcId:o}],String(r.uid),c);a===Wt.AUDIO?(r._audioTrack?r._audioTrack._updateOriginMediaStreamTrack(m):(r._audioTrack=new gb(m,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(r._audioTrack.getTrackId()))),w&&r._audioTrack._updateRtpTransceiver(w),this.bindRemoteTrackEvents(r,r._audioTrack)):(r._videoSSRC=o,r._videoTrack?r._videoTrack._updateOriginMediaStreamTrack(m):(r._videoTrack=new mb(m,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(r._videoTrack.getTrackId()))),w&&r._videoTrack._updateRtpTransceiver(w),this.bindRemoteTrackEvents(r,r._videoTrack));let C=this.remoteUserMap.get(r);C?C.set(a,v):this.remoteUserMap.set(r,new Map([[a,v]])),this.statsCollector.addRemoteStats(r.uid),this.statsUploader.startUploadInboundStats(),this.startUploadDownlinkState();let R=this.pendingRemoteTracks.findIndex(x=>{let{user:L,kind:U}=x;return L.uid===r.uid&&a===U});R!==-1&&(this.pendingRemoteTracks.splice(R,1),this.emit(pn.MediaReconnectEnd,r.uid))}async mockSubscribe(r,a,o,c){if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when recvConnection disconnected.");await this.recvConnection.mockReceive(a,[{ssrcId:o}],String(r.uid),c)}async unsubscribe(r,a,o){let c=this.pendingRemoteTracks.filter(m=>{let{user:v,kind:w}=m;return a!==void 0?v.uid===r.uid&&a===w:v.uid===r.uid});if(c.forEach(m=>{let v=this.pendingRemoteTracks.indexOf(m);this.pendingRemoteTracks.splice(v,1)}),this.recvConnection||o||c.forEach(m=>{let{kind:v}=m;var w;if(v===Wt.AUDIO)(w=r._audioTrack)===null||w===void 0||w._destroy(),r._audioTrack=void 0;else if(v===Wt.VIDEO){var C;(C=r._videoTrack)===null||C===void 0||C._destroy(),r._videoTrack=void 0}}),!this.recvConnection)return;let f=this.filterTobeUnSubscribedTracks(r,a);f.length!==0&&(await this.recvConnection.stopReceiving(f.map(m=>{let[,{id:v}]=m;return v})),this.withdrawRemoteTracks(f),this.remoteUserMap.size===0&&(this.statsUploader.stopUploadInboundStats(),this.stopUploadDownlinkState()),f.forEach(m=>{let[v,{kind:w}]=m;var C,R;if(w===Wt.VIDEO&&v._videoSSRC&&((C=this.recvConnection)===null||C===void 0||C.setStatsRemoteVideoIsReady(v._videoSSRC,!1)),w===Wt.VIDEO)this.unbindRemoteTrackEvents(v._videoTrack),o||((R=v._videoTrack)===null||R===void 0||R._destroy(),v._videoTrack=void 0);else if(w===Wt.AUDIO){var x;this.unbindRemoteTrackEvents(v._audioTrack),!o&&((x=v._audioTrack)===null||x===void 0||x._destroy(),v._audioTrack=void 0)}}),f.forEach(m=>{let[,{kind:v}]=m;Li(this,pn.RequestP2PMuteRemote,v)}))}startUploadDownlinkState(){if(this.uploadDownlinkStarted)return;this.uploadDownlinkStarted=!0,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval);let r=()=>Array.from(this.remoteUserMap.entries()).forEach(a=>{let[,o]=a;[Wt.VIDEO,Wt.AUDIO].forEach(c=>{o.has(c)?Li(this,pn.RequestP2PUnmuteRemote,c):Li(this,pn.RequestP2PMuteRemote,c)})});r(),this.downlinkStatsUploadInterval=window.setInterval(()=>{r()},3e3)}stopUploadDownlinkState(){this.uploadDownlinkStarted&&(this.uploadDownlinkStarted=!1,this.downlinkStatsUploadInterval&&window.clearInterval(this.downlinkStatsUploadInterval))}getAllDataChannels(){return this.localDataChannels}async massSubscribe(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massSubscribe.")}async massSubscribeNoLock(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massSubscribeNoLock.")}async massUnsubscribe(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massUnsubscribe.")}async massUnsubscribeNoLock(r){throw new Ke(ce.NOT_SUPPORTED,"p2p mode does not support massUnsubscribeNoLock.")}async muteRemote(r,a){if(!this.recvConnection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.muteRemote has no remote user ").concat(r.uid,"."));if(!o.get(a))return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.muteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."));let c=a===Wt.VIDEO?r._videoSSRC:r._audioSSRC;c!==void 0&&this.recvConnection.setStatsRemoteVideoIsReady(c,!1)}async unmuteRemote(r,a){return this.unmuteRemoteNoLock(r,a)}async unmuteRemoteNoLock(r,a){if(!this.recvConnection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel2.unmuteRemote has no remote user ").concat(r.uid,"."));o.get(a)||z.warning("[".concat(this.store.clientId,"] P2PChannel2.unmuteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."))}getAllTracks(r){let a=this.localTrackMap.get(ht.LocalAudioTrack);if((a==null?void 0:a.track)instanceof ns){let o=a.track;return Array.from(this.localTrackMap.entries()).filter(c=>{let[f]=c;return f!==ht.LocalAudioTrack}).filter(c=>{let[f]=c;return!(r&&f===ht.LocalVideoLowTrack)}).map(c=>{let[,{track:f}]=c;return f}).concat(o.trackList)}return Array.from(this.localTrackMap.entries()).filter(o=>{let[c]=o;return!(r&&c===ht.LocalVideoLowTrack)}).map(o=>{let[,{track:c}]=o;return c})}reportPublishEvent(r,a,o,c,f){if(r){let v=this.localTrackMap.get(ht.LocalAudioTrack),w=c?this.localTrackMap.get(ht.LocalVideoLowTrack):this.localTrackMap.get(ht.LocalVideoTrack);$t.publish(this.store.sessionId,{eventElapse:aa.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.track.getTrackLabel(),videoName:w==null?void 0:w.track.getTrackLabel(),screenshare:(w==null?void 0:w.track._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}else{var m;o||(o=[]);let v=o.find(C=>C instanceof br),w=c?(m=this.localTrackMap.get(ht.LocalVideoTrack))===null||m===void 0?void 0:m.track:o.find(C=>C instanceof ki);$t.publish(this.store.sessionId,{eventElapse:aa.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.getTrackLabel(),videoName:w==null?void 0:w.getTrackLabel(),screenshare:(w==null?void 0:w._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}}reportSubscribeEvent(r,a,o,c){let f=c===Wt.VIDEO?o._videoSSRC:o._audioSSRC;f&&$t.subscribe(this.store.sessionId,{succ:r,ec:a,video:c===Wt.VIDEO,audio:c===Wt.AUDIO,peerid:o.uid,subscribeRequestid:c===Wt.VIDEO?o._videoSSRC:o._audioSSRC,p2pid:this.store.p2pId,eventElapse:aa.measureFromSubscribeStart(this.store.clientId,f)})}reset(){z.debug("[".concat(this.store.clientId,"] P2PChannel2.reset")),this.sendMutex=new Ts("P2PChannel2-send-mutex"),this.sendMutex=new Ts("P2PChannel2-recv-mutex"),this.sendConnection&&(this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0),this.recvConnection&&(this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),this.statsUploader.stopUploadExtensionUsageStats(),this.stopUploadUplinkState(),this.stopUploadDownlinkState(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.unbindRtpTransceiver();let r=this.localTrackMap.get(ht.LocalAudioTrack);if((r==null?void 0:r.track)instanceof ns){if(r.track.trackList.length>0){let a=r.track;r.track.trackList.forEach(o=>{a.removeAudioTrack(o)})}r.track.close()}this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.reconnectInterval&&(window.clearInterval(this.reconnectInterval),this.reconnectInterval=void 0),this.state=gi.Disconnected}getStats(r){var a,o;return r?(o=this.recvConnection)===null||o===void 0?void 0:o.getStats():(a=this.sendConnection)===null||a===void 0?void 0:a.getStats()}getRemoteVideoIsReady(r){var a;return((a=this.recvConnection)===null||a===void 0?void 0:a.getRemoteVideoIsReady(r))||!1}getLocalAudioVolume(){let r=this.localTrackMap.get(ht.LocalAudioTrack);if(r)return r.track.getVolumeLevel()}getLocalVideoSize(){let r=this.localTrackMap.get(ht.LocalVideoTrack);if(r)return{width:r.track.videoWidth||0,height:r.track.videoHeight||0}}getEncoderConfig(r){let a=this.localTrackMap.get(r);return a&&a.track instanceof ki||a&&a.track instanceof br?a.track._encoderConfig:void 0}getLocalMedia(r){return this.localTrackMap.get(r)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}async hasRemoteMediaWithLock(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}getRemoteMedia(r){var a;let o=Array.from(tl(a=this.remoteUserMap).call(a)).find(c=>c.uid===r);return o?{audioTrack:o.audioTrack,audioSSRC:o._audioSSRC,videoTrack:o.videoTrack,videoSSRC:o._videoSSRC}:{}}getAudioLevels(){let r=Array.from(this.remoteUserMap.entries()).map(o=>{let[c]=o;return{uid:c.uid,level:c.audioTrack?100*c.audioTrack._source.getAccurateVolumeLevel():0}}),a=this.localTrackMap.get(ht.LocalAudioTrack);return a&&r.push({level:100*a.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),r=JA(r).call(r,(o,c)=>o.level-c.level),r}async disconnectForReconnect(){this.sendConnection&&this.recvConnection&&(z.debug("[".concat(this.store.clientId,"] P2PChannel2.disconnectForReconnect closing P2PConnection")),this.state=gi.Reconnecting,ve("KEEP_LAST_FRAME")&&this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a]=r;var o;a._videoTrack&&a._videoTrack._player&&((o=a._videoTrack._player.getVideoElement())===null||o===void 0||o.pause(),a._videoTrack._player.isKeepLastFrame=!0,a._videoTrack._originMediaStreamTrack.stop())}),this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0,this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0,this.localTrackMap.size!==0&&(Array.from(this.localTrackMap.entries()).forEach(r=>{var a;let[o,{track:c}]=r;switch(o){case ht.LocalVideoTrack:Tt(a=c._hints).call(a,Hi.LOW_STREAM)?c.close():this.pendingLocalTracks.push(c);break;case ht.LocalAudioTrack:c instanceof ns?this.pendingLocalTracks=this.pendingLocalTracks.concat(c.trackList):this.pendingLocalTracks.push(c);case ht.LocalVideoLowTrack:}}),this.emit(pn.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;Array.from(tl(o).call(o)).forEach(c=>{this.setPendingRemoteMedia(a,c)}),this.emit(pn.MediaReconnectStart,a.uid)}),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.stopUploadUplinkState(),this.stopUploadDownlinkState(),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),z.debug("[".concat(this.store.clientId,"] P2PChannel2 disconnected, waiting to reconnect.")))}hasPendingRemoteMedia(r,a){for(let o of this.pendingRemoteTracks){let{user:c,kind:f}=o;if((r instanceof z0?r.uid:r)===c.uid&&a===f)return!0}return!1}setPendingRemoteMedia(r,a){this.hasPendingRemoteMedia(r,a)||this.pendingRemoteTracks.push({user:r,kind:a})}async restartICE(r,a){let o,c;if(r===no.SEND_ONLY){if(!this.sendConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before sendConnection established.");o=await this.sendMutex.lock("From P2PChannel.restartICE"),c=this.sendConnection}else{if(!this.recvConnection)throw new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel2.handleMuteLocalTrack before recvConnection established.");o=await this.recvMutex.lock("From P2PChannel.restartICE"),c=this.recvConnection}try{if(a){let f=await c.restartICE(a);return c.isInRestartIce=!1,f}{let f=await c.restartICE();if(f){let m=await Kr(this,pn.RequestP2PRestartICE,{direction:no.RECEIVE_ONLY,iceParameter:f});await c.restartICE(m),c.isInRestartIce=!1}}}finally{o()}}getUplinkNetworkQuality(){if(!this.sendConnection)return 0;let r=this.sendConnection.getStats(),a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalAudioTrack),c=r.videoSend.find(F=>{var Z;return F.ssrc===(a==null||(Z=a.ssrcs)===null||Z===void 0?void 0:Z[0].ssrcId)}),f=r.audioSend.find(F=>{var Z;return F.ssrc===(o==null||(Z=o.ssrcs)===null||Z===void 0?void 0:Z[0].ssrcId)});if(!c||!f)return 1;let m=Ml(this,pn.NeedSignalRTT),v=c?c.rttMs:void 0,w=f?f.rttMs:void 0,C=v&&w?(v+w)/2:v||w,R=(C&&m?(C+m)/2:C||m)||0,x=100*r.sendPacketLossRate*.7/50+.3*R/1500,L=x<.17?1:x<.36?2:x<.59?3:x<.1?4:5,U=a==null?void 0:a.track;if(U&&U._encoderConfig&&U._hints.indexOf(Hi.SCREEN_TRACK)===-1){let F=U._encoderConfig.bitrateMax,Z=r.bitrate.actualEncoded;if(F&&Z){let W=(1e3*F-Z)/(1e3*F);return cie[W<.15?0:W<.3?1:W<.45?2:W<.6?3:4][L]}}return L}getDownlinkNetworkQuality(){if(!this.recvConnection)return 0;let r=this.recvConnection.getStats(),a=0;return Array.from(this.remoteUserMap.entries()).forEach(o=>{let[c]=o,f=c._audioSSRC,m=c._videoSSRC,v=r.audioRecv.find(Z=>Z.ssrc===f),w=r.videoRecv.find(Z=>Z.ssrc===m);if(!v&&!w)return void(a+=1);let C=Ml(this,pn.NeedSignalRTT),R=r.rtt,x=(R&&C?(R+C)/2:R||C)||0,L=v?v.jitterMs:void 0,U=r.recvPacketLossRate,F=.7*U*100/50+.3*x/1500;L&&(F=.6*U*100/50+.2*x/1500+.2*L/400),a+=F<.1?1:F<.17?2:F<.36?3:F<.59?4:5}),this.remoteUserMap.size>0?Math.round(a/this.remoteUserMap.size):a}async muteLocalTrack(r){return new Ct((a,o)=>{this.handleMuteLocalTrack(r,a,o)})}filterTobePublishedTracks(r,a,o){let c=[],f=Jn(),m=this.getAllTracks();r=FS(r=r.filter(C=>m.indexOf(C)===-1));let v=!1,w=!1;for(let C of r){if(C instanceof ki&&(this.localTrackMap.has(ht.LocalVideoTrack)||v?new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(c.push({track:C,type:ht.LocalVideoTrack}),v=!0),a)){let R=this.getLowVideoTrack(C,o);c.push({track:R,type:ht.LocalVideoLowTrack})}if(C instanceof br){let R=this.localTrackMap.get(ht.LocalAudioTrack);if(R){if(!(R.track instanceof ns))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(C._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");R.track.addAudioTrack(C),this.bindLocalAudioTrackEvents(C,!0)}else if(w){let x=c.find(L=>{let{type:U}=L;return U===ht.LocalAudioTrack});if(!(x.track instanceof ns))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser does not support audio mixing");if(C._bypassWebAudio)throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio");x.track.addAudioTrack(C)}else{if(!f.webAudioMediaStreamDest||C instanceof ns||C._bypassWebAudio)c.push({track:C,type:ht.LocalAudioTrack});else{let x=new ns;x.addAudioTrack(C),c.push({track:x,type:ht.LocalAudioTrack})}w=!0}}}return c}filterTobeUnpublishedTracks(r){let a=[],o=this.getAllTracks();r=FS(r=r.filter(c=>o.indexOf(c)!==-1));for(let c of r){if(c instanceof br){let f=this.localTrackMap.get(ht.LocalAudioTrack);if(!f)continue;f.track instanceof ns?(f.track.removeAudioTrack(c),this.unbindLocalAudioTrackEvents(c),f.track.trackList.length===0&&(a.push([ht.LocalAudioTrack,f]),f.track.close())):a.push([ht.LocalAudioTrack,f])}if(c instanceof ki){let f=this.localTrackMap.get(ht.LocalVideoTrack);if(!f)continue;a.push([ht.LocalVideoTrack,f]);let m=this.localTrackMap.get(ht.LocalVideoLowTrack);m&&a.push([ht.LocalVideoLowTrack,m])}}return a}bindLocalTrackEvents(r){r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.addListener(Mt.GET_STATS,this.handleGetLocalVideoStats),o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.addListener(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.bindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}bindLocalAudioTrackEvents(r,a){r instanceof ns?r.trackList.forEach(o=>{o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),r.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),a||r.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack))}unbindLocalTrackEvents(r){r||(r=Array.from(this.localTrackMap.entries()).map(a=>{let[o,{track:c}]=a;return{track:c,type:o}})),r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.off(Mt.GET_STATS,this.handleGetLocalVideoStats),o.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.off(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.off(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.unbindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}unbindLocalAudioTrackEvents(r){r instanceof ns?r.trackList.forEach(a=>{a.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),a.off(Mt.GET_STATS,this.handleGetLocalAudioStats),a.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.off(Mt.GET_STATS,this.handleGetLocalAudioStats),r.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(r,a){a instanceof mb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteVideoStats(r))}),a instanceof gb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteAudioStats(r))})}unbindRemoteTrackEvents(r){r&&r.removeAllListeners(Mt.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;o.has(Wt.AUDIO)&&this.unbindRemoteTrackEvents(a._audioTrack),o.has(Wt.VIDEO)&&this.unbindRemoteTrackEvents(a._videoTrack)})}createGatewayPublishMessage(r,a){return r.map((o,c)=>{var f;let m,{track:v,type:w}=o;switch(w){case ht.LocalAudioTrack:m=pi.Audio;break;case ht.LocalVideoTrack:m=Tt(f=v._hints).call(f,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:m=pi.Low}return{kind:w===ht.LocalAudioTrack?Wt.AUDIO:Wt.VIDEO,stream_type:m,mid:a[c].id,ssrcs:a[c].localSSRC,isMuted:v.muted||!v.enabled}})}createGatewayUnpublishMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}assignLocalTracks(r,a){r.forEach((o,c)=>{let{track:f,type:m}=o;this.localTrackMap.set(m,{track:f,id:a[c].id,ssrcs:a[c].localSSRC})})}withdrawLocalTracks(r){r.forEach(a=>{let[o]=a;this.localTrackMap.delete(o)})}bindConnectionEvents(r){r.onConnectionStateChange=async a=>{var o;z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: ").concat(r.name,".onConnectionStateChange(").concat(a,")")),this.emit(pn.PeerConnectionStateChange,a),a!=="connected"||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),a==="connected"&&(r.isInRestartIce=!1),Tt(o=this._restartStates).call(o,a)&&!r.isInRestartIce&&(a==="disconnected"&&await vs(800),r.iceConnectionState!=="disconnected"&&r.iceConnectionState!=="failed"||this.handleDisconnect(r.direction))},r.onICEConnectionStateChange=a=>{a!=="connected"||this.store.keyMetrics.iceConnectionEnd||this.store.iceConnectionEnd(),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(a,")")),$t.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:a,tag:vr.TRACER}).onSuccess(),this.emit(pn.IceConnectionStateChange,a)},r.onICETransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(a,")"))},r.onDTLSTransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(a,")"))},r.onDTLSTransportError=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(a,")"))},r.onFirstAudioDecoded=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(m=>m._audioSSRC===a);var f;c&&(this.store.subscribe(c.uid,"audio",void 0,void 0,void 0,Date.now()),(f=c.audioTrack)===null||f===void 0||f.emit(ub.FIRST_FRAME_DECODED),$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_AUDIO_DECODE,fr.FIRST_AUDIO_DECODE,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId}))},r.onFirstAudioReceived=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(f=>f._audioSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_AUDIO_RECEIVED,fr.FIRST_AUDIO_RECEIVED,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onFirstVideoDecoded=(a,o,c)=>{this.reportVideoFirstFrameDecoded(a,o,c)},r.onFirstVideoReceived=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(f=>f._videoSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_VIDEO_RECEIVED,fr.FIRST_VIDEO_RECEIVED,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onSelectedLocalCandidateChanged=(a,o)=>{let c=a.candidateType==="relay",f=o.candidateType==="relay";o.candidateType!=="unknown"&&c===f||this.emit(pn.ConnectionTypeChange,c),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(P0(o))," -> ").concat(JSON.stringify(P0(a)),")"))},r.onSelectedRemoteCandidateChanged=(a,o)=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(P0(o))," -> ").concat(JSON.stringify(P0(a)),")"))},r.onFirstVideoDecodedTimeout=a=>{this.reportVideoFirstFrameDecoded(a,void 0,void 0,!0)},r.onLocalCandidate=a=>{this.emit(pn.LocalCandidate,{candidate:a,direction:r.direction})}}unbindConnectionEvents(r){r.onConnectionStateChange=void 0,r.onICEConnectionStateChange=void 0,r.onICETransportStateChange=void 0,r.onDTLSTransportStateChange=void 0,r.onDTLSTransportError=void 0,r.onFirstAudioDecoded=void 0,r.onFirstAudioReceived=void 0,r.onFirstVideoDecoded=void 0,r.onFirstVideoReceived=void 0,r.onSelectedLocalCandidateChanged=void 0,r.onSelectedRemoteCandidateChanged=void 0,r.onFirstVideoDecodedTimeout=void 0,r.onLocalCandidate=void 0}async handleDisconnect(r){let a=r===no.SEND_ONLY?this.sendConnection:this.recvConnection;a&&!a.isInRestartIce&&(a.isInRestartIce=!0,z.debug("[".concat(this.store.clientId,"] [P2PChannel-").concat(a.name,"] start use restartICE")),r===no.SEND_ONLY?this.restartICE(r):Kr(this,pn.RequestP2PRestartICE,{direction:no.SEND_ONLY}))}filterTobeMutedTracks(r){let a=[];if(this.getAllTracks().indexOf(r)===-1)return a;let o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ns)return o.track.isActive||a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:m}]=f;return r===m});if(c&&(a.push(c),c[0]===ht.LocalVideoTrack)){let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}return a}filterTobeUnmutedTracks(r){let a=[],o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ns)return o.track.isActive&&a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:m}]=f;return r===m});if(c)if(c[0]===ht.LocalVideoTrack){a.push(c);let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}else a.push(c);return a}createMuteMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}createUnmuteMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}filterTobeUnSubscribedTracks(r,a){let o=[],c=this.remoteUserMap.get(r);if(!c)return o;if(a){let f=c.get(a);if(!f)return o;o.push([r,{kind:a,id:f}])}else Array.from(c.entries()).forEach(f=>{let[m,v]=f;o.push([r,{kind:m,id:v}])});return o}createUnsubscribeMessage(r){let a=[];return r.forEach(o=>{let[c,{kind:f,id:m}]=o;switch(f){case Wt.VIDEO:return void(c._videoSSRC&&a.push({stream_type:Wt.VIDEO,ssrcId:c._videoSSRC}));case Wt.AUDIO:return void(c._audioSSRC&&a.push({stream_type:Wt.AUDIO,ssrcId:c._audioSSRC}))}}),a}withdrawRemoteTracks(r){r.forEach(a=>{let[o,{kind:c}]=a,f=this.remoteUserMap.get(o);f&&(f.delete(c),Array.from(f.entries()).length===0&&this.remoteUserMap.delete(o))})}async updateBitrateLimit(r){let a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalVideoLowTrack);a&&await a.track.setBitrateLimit(r.uplink),o&&r.low_stream_uplink&&await o.track.setBitrateLimit({max_bitrate:r.low_stream_uplink.bitrate,min_bitrate:r.low_stream_uplink.bitrate||0})}isP2PDisconnected(){if(this.sendConnection&&this.recvConnection){let r=this.sendConnection.peerConnectionState,a=this.recvConnection.peerConnectionState;return r!=="connected"&&a!=="connected"}return!0}async tryToUnmuteAudio(r){for(let a=0;a<r.length;a++)if(r[a]instanceof br){let o=this.filterTobeUnmutedTracks(r[a]);if(o.length===0)continue;let c=this.createUnmuteMessage(o);return void await Li(this,pn.RequestUnmuteLocal,c)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=r=>this.getStats(r),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()).filter(r=>{let[,{ssrcs:a}]=r;return!!a}),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=r=>{var a;return!((a=this.recvConnection)===null||a===void 0||!a.getRemoteVideoIsReady(r))},this.statsUploader.requestUpload=(r,a)=>this.emit(pn.RequestUpload,r,a),this.statsUploader.requestUploadStats=r=>this.emit(pn.RequestUploadStats,r),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await vs(j8(this.dtlsFailedCount,kr)),this.emit(pn.RequestReconnect)}async reconnectP2P(){}canPublishLowStream(){return this.localTrackMap.has(ht.LocalVideoTrack)||this.pendingLocalTracks.some(r=>r instanceof ki)}throwIfTrackTypeNotMatch(r){if(r.filter(a=>a instanceof ki).length>1)throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(r.filter(a=>a instanceof br).length>1&&(r.some(a=>a instanceof br&&a._bypassWebAudio)||!Jn().webAudioMediaStreamDest))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(let a of r){if(a instanceof ki&&this.pendingLocalTracks.some(o=>o instanceof ki))throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(a instanceof br&&this.pendingLocalTracks.some(o=>o instanceof br)&&(!Jn().webAudioMediaStreamDest||a._bypassWebAudio||this.pendingLocalTracks.some(o=>o instanceof br&&o._bypassWebAudio)))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(r,a){let o=!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding,c=DD(DD({},{width:160,height:120,framerate:15,bitrate:50}),a),f;f=o?r._mediaStreamTrack.clone():OW(r,c);let m=Di(8,"track-low-"),v=new ki(f,DD(DD({},o&&{scaleResolutionDownBy:oG(c,r)}),{},{frameRate:c.framerate,bitrateMax:c.bitrate,bitrateMin:c.bitrate}),void 0,void 0,m);return v.on(i_.TRANSCEIVER_UPDATED,w=>{r._updateRtpTransceiver(w,cb.LOW_STREAM)}),v._hints.push(Hi.LOW_STREAM),r.addListener(Mt.NEED_CLOSE,()=>{v.close()}),v}async globalLock(){return this.recvMutex.lock("From P2PChannel2.globalLock")}reportVideoFirstFrameDecoded(r,a,o,c){var f;let m=Array.from(tl(f=this.remoteUserMap).call(f)).find(v=>v._videoSSRC===r);if(m){c||this.store.subscribe(m.uid,"video",void 0,void 0,void 0,void 0,Date.now());let v=this.store.keyMetrics,w=v.subscribe.find(C=>C.userId===m.uid&&C.type==="video");$t.firstRemoteVideoDecode(this.store.sessionId,Rs.FIRST_VIDEO_DECODE,fr.FIRST_VIDEO_DECODE,{peer:m._uintid,videowidth:a,videoheight:o,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,r),subscribeRequestid:r,p2pid:this.store.p2pId,apEnd:v.requestAPEnd||0,apStart:v.requestAPStart||0,joinGwEnd:v.joinGatewayEnd||0,joinGwStart:v.joinGatewayStart||0,pcEnd:v.peerConnectionEnd||0,pcStart:v.peerConnectionStart||0,subscriberEnd:(w==null?void 0:w.subscribeEnd)||0,subscriberStart:(w==null?void 0:w.subscribeStart)||0,videoAddNotify:(w==null?void 0:w.streamAdded)||0,state:c?1:0})}}async remoteMediaSsrcChanged(r,a,o){if(!this.recvConnection)return!1;let c=this.remoteUserMap.get(r);if(!c)return!1;let f=c.get(a);if(!f)return!1;let m=await this.recvConnection.getRemoteSSRC(f);return m!==void 0&&m!==o}resetConnection(r){z.debug("[".concat(this.store.clientId,"] [P2PChannel2] reset connection to ").concat(r)),this.state===gi.Connected?(z.debug("[".concat(this.store.clientId,"] [P2PChannel2] fallback to websocket but P2PChannel2 state still connected, disconnect first")),this.disconnectForReconnect()):(this.sendConnection&&(this.sendConnection.close(),this.unbindConnectionEvents(this.sendConnection),this.sendConnection=void 0),this.recvConnection&&(this.recvConnection.close(),this.unbindConnectionEvents(this.recvConnection),this.recvConnection=void 0))}async publishDataChannel(r){throw new Ke(ce.NOT_SUPPORTED)}async unpublishDataChannel(r){throw new Ke(ce.NOT_SUPPORTED)}async subscribeDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}async unsubscribeDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}hasPendingRemoteDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}setPendingRemoteDataChannel(r,a){throw new Ke(ce.NOT_SUPPORTED)}async preConnect(r,a,o,c,f,m){throw new Ke(ce.NOT_SUPPORTED)}getEstablishParams(){throw new Ke(ce.NOT_SUPPORTED)}async reSubscribe(r){throw new Ke(ce.NOT_SUPPORTED)}async updateVideoStreamParameter(r,a){throw new Ke(ce.NOT_SUPPORTED)}unbindRtpTransceiver(){this.localTrackMap.size!==0&&Array.from(this.localTrackMap.entries()).forEach(r=>{let[a,{track:o}]=r;a===ht.LocalVideoLowTrack?o._updateRtpTransceiver(void 0,cb.LOW_STREAM):o._updateRtpTransceiver(void 0)})}},vt(sr.prototype,"p2pConnect",[Woe],Object.getOwnPropertyDescriptor(sr.prototype,"p2pConnect"),sr.prototype),vt(sr.prototype,"unpublish",[$oe],Object.getOwnPropertyDescriptor(sr.prototype,"unpublish"),sr.prototype),vt(sr.prototype,"unpublishLowStream",[Koe],Object.getOwnPropertyDescriptor(sr.prototype,"unpublishLowStream"),sr.prototype),vt(sr.prototype,"subscribe",[qoe],Object.getOwnPropertyDescriptor(sr.prototype,"subscribe"),sr.prototype),vt(sr.prototype,"mockSubscribe",[Yoe],Object.getOwnPropertyDescriptor(sr.prototype,"mockSubscribe"),sr.prototype),vt(sr.prototype,"unsubscribe",[Xoe],Object.getOwnPropertyDescriptor(sr.prototype,"unsubscribe"),sr.prototype),vt(sr.prototype,"muteRemote",[Joe],Object.getOwnPropertyDescriptor(sr.prototype,"muteRemote"),sr.prototype),vt(sr.prototype,"unmuteRemote",[Qoe],Object.getOwnPropertyDescriptor(sr.prototype,"unmuteRemote"),sr.prototype),vt(sr.prototype,"hasRemoteMediaWithLock",[Zoe],Object.getOwnPropertyDescriptor(sr.prototype,"hasRemoteMediaWithLock"),sr.prototype),vt(sr.prototype,"disconnectForReconnect",[ele],Object.getOwnPropertyDescriptor(sr.prototype,"disconnectForReconnect"),sr.prototype),vt(sr.prototype,"remoteMediaSsrcChanged",[tle],Object.getOwnPropertyDescriptor(sr.prototype,"remoteMediaSsrcChanged"),sr.prototype),sr);function Oh(r){return function(a,o,c){let f=a[o];if(typeof f!="function")throw new Error("Cannot use mutex on object property.");return c.value=async function(){for(var m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];switch(r){case Nh.SEND_ONLY:{let C=await this.sendMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{C()}}case Nh.RECEIVE_ONLY:{let C=await this.recvMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{C()}}default:{let C=await this.sendMutex.lock("From P2PChannel2.".concat(o)),R=await this.recvMutex.lock("From P2PChannel2.".concat(o));try{return await f.apply(this,v)}finally{C(),R()}}}},c}}function ile(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function u_(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?ile(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ile(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class Z3{constructor(a){X(this,"store",void 0),X(this,"onStatsException",void 0),X(this,"onUploadPublishDuration",void 0),X(this,"onStatsChanged",void 0),X(this,"localStats",new Map),X(this,"remoteStats",new Map),X(this,"updateStatsInterval",void 0),X(this,"trafficStats",void 0),X(this,"trafficStatsPeerList",[]),X(this,"uplinkStats",void 0),X(this,"exceptionMonitor",void 0),X(this,"p2pChannel",void 0),X(this,"scalabilityMode",rAe.L1T1),X(this,"updateStats",()=>{this.p2pChannel&&(this.updateRemoteStats(this.p2pChannel),this.updateLocalStats(this.p2pChannel))}),this.store=a,this.exceptionMonitor=new a4e,this.exceptionMonitor.on("exception",(o,c,f)=>{this.onStatsException&&this.onStatsException(o,c,f)})}startUpdateStats(){this.updateStatsInterval||(this.updateStatsInterval=window.setInterval(this.updateStats,1e3))}stopUpdateStats(){this.updateStatsInterval&&(window.clearInterval(this.updateStatsInterval),this.updateStatsInterval=void 0)}reset(){this.localStats=new Map,this.remoteStats=new Map,this.trafficStats=void 0,this.trafficStatsPeerList=[],this.uplinkStats=void 0}getLocalAudioTrackStats(){return this.localStats.get(ht.LocalAudioTrack)||u_({},lW)}getLocalVideoTrackStats(){return this.localStats.get(ht.LocalVideoTrack)||u_({},cW)}getRemoteAudioTrackStats(a){let o=(m,v)=>{if(!this.trafficStats)return v;let w=this.trafficStats.peer_delay.find(C=>C.peer_uid===m);return w&&(v.publishDuration=w.B_ppad+(Date.now()-this.trafficStats.timestamp)),v},c={};if(a){var f;let m=(f=this.remoteStats.get(a))===null||f===void 0?void 0:f.audioStats;m&&(c[a]=o(a,m))}else Array.from(this.remoteStats.entries()).forEach(m=>{let[v,{audioStats:w}]=m;w&&(c[v]=o(v,w))});return c}getRemoteNetworkQualityStats(a){let o={};if(a){var c;let f=(c=this.remoteStats.get(a))===null||c===void 0?void 0:c.networkStats;f&&(o[a]=f)}else Array.from(this.remoteStats.entries()).forEach(f=>{let[m,{networkStats:v}]=f;v&&(o[m]=v)});return o}getRemoteVideoTrackStats(a){let o=(m,v)=>{if(!this.trafficStats)return v;let w=this.trafficStats.peer_delay.find(C=>C.peer_uid===m);return w&&(v.publishDuration=w.B_ppvd+(Date.now()-this.trafficStats.timestamp)),v},c={};if(a){var f;let m=(f=this.remoteStats.get(a))===null||f===void 0?void 0:f.videoStats;m&&(c[a]=o(a,m))}else Array.from(this.remoteStats.entries()).forEach(m=>{let[v,{videoStats:w}]=m;w&&(c[v]=o(v,w))});return c}getRTCStats(){let a=0,o=0,c=0,f=0,m=this.localStats.get(ht.LocalAudioTrack);m&&(a+=m.sendBytes,o+=m.sendBitrate);let v=this.localStats.get(ht.LocalVideoTrack);v&&(a+=v.sendBytes,o+=v.sendBitrate);let w=this.localStats.get(ht.LocalVideoLowTrack);w&&(a+=w.sendBytes,o+=w.sendBitrate),this.remoteStats.forEach(R=>{let{audioStats:x,videoStats:L}=R;x&&(c+=x.receiveBytes,f+=x.receiveBitrate),L&&(c+=L.receiveBytes,f+=L.receiveBitrate)});let C=1;return this.trafficStats&&(C+=this.trafficStats.peer_delay.length),{Duration:0,UserCount:C,SendBitrate:o,SendBytes:a,RecvBytes:c,RecvBitrate:f,OutgoingAvailableBandwidth:this.uplinkStats?this.uplinkStats.B_uab/1e3:0,RTT:this.trafficStats?2*this.trafficStats.B_acd:0}}addLocalStats(a){this.localStats.set(a,void 0)}removeLocalStats(a){a?this.localStats.delete(a):this.localStats.clear()}addRemoteStats(a){this.remoteStats.set(a,{})}removeRemoteStats(a){a?this.remoteStats.delete(a):this.remoteStats.clear()}addP2PChannel(a){this.p2pChannel=a}updateTrafficStats(a){a.peer_delay=a.peer_delay.filter(o=>o.B_ppad!==void 0||o.B_ppvd!==void 0),a.peer_delay.filter(o=>this.trafficStatsPeerList.indexOf(o.peer_uid)===-1).forEach(o=>{var c;let f=(c=this.p2pChannel)===null||c===void 0?void 0:c.getRemoteMedia(o.peer_uid),m=f!=null&&f.videoSSRC?aa.measureFromSubscribeStart(this.store.clientId,f.videoSSRC):0,v=f!=null&&f.audioSSRC?aa.measureFromSubscribeStart(this.store.clientId,f.audioSSRC):0;o.B_ppad!==void 0&&o.B_ppvd!==void 0&&(this.onUploadPublishDuration&&this.onUploadPublishDuration(o.peer_uid,o.B_ppad,o.B_ppvd,m>v?m:v),this.trafficStatsPeerList.push(o.peer_uid))}),this.trafficStats=a}updateUplinkStats(a){this.uplinkStats&&this.uplinkStats.B_fir!==a.B_fir&&z.debug("[".concat(this.store.clientId,"]: Period fir changes to ").concat(a.B_fir)),this.uplinkStats=a}static isRemoteVideoFreeze(a,o,c){if(!a)return!1;let f=!!c&&o.framesDecodeFreezeTime>c.framesDecodeFreezeTime,m=!c||o.framesDecodeCount>c.framesDecodeCount;return f||!m}static isRemoteAudioFreeze(a){return!!a&&a._isFreeze()}isLocalVideoFreeze(a){return!(!a.inputFrame||!a.sentFrame)&&a.inputFrame.frameRate>5&&a.sentFrame.frameRate<3}updateLocalStats(a){Array.from(this.localStats.entries()).forEach(o=>{let[c,f]=o;switch(c){case ht.LocalVideoTrack:case ht.LocalVideoLowTrack:{let v=f,w=u_({},cW),C=a.getStats(),R=a.getLocalMedia(c);if(C){let x=C.videoSend.find(L=>L.ssrc===(R==null?void 0:R.ssrcs[0].ssrcId));if(x){let L=a.getLocalVideoSize(),U=a.getEncoderConfig(ht.LocalVideoTrack);x.codec!=="H264"&&x.codec!=="H265"&&x.codec!=="VP8"&&x.codec!=="VP9"&&x.codec!=="AV1X"&&x.codec!=="AV1"||(w.codecType=x.codec),w.sendBytes=x.bytes,w.sendBitrate=v?8*Math.max(0,w.sendBytes-v.sendBytes):0,x.inputFrame?(w.captureFrameRate=x.inputFrame.frameRate,w.captureResolutionHeight=x.inputFrame.height,w.captureResolutionWidth=x.inputFrame.width):L&&(w.captureResolutionWidth=L.width,w.captureResolutionHeight=L.height),x.sentFrame?(w.sendFrameRate=x.sentFrame.frameRate,w.sendResolutionHeight=x.sentFrame.height,w.sendResolutionWidth=x.sentFrame.width):L&&(w.sendResolutionWidth=L.width,w.sendResolutionHeight=L.height),x.avgEncodeMs&&(w.encodeDelay=x.avgEncodeMs),U&&U.bitrateMax&&(w.targetSendBitrate=1e3*U.bitrateMax),w.sendPackets=x.packets,w.sendPacketsLost=x.packetsLost,w.sendJitterMs=x.jitterMs,w.sendRttMs=x.rttMs,w.totalDuration=v?v.totalDuration+1:1,w.totalFreezeTime=v?v.totalFreezeTime:0,this.isLocalVideoFreeze(x)&&(w.totalFreezeTime+=1),x.scalabilityMode&&this.scalabilityMode!==x.scalabilityMode&&(z.debug("[".concat(this.store.clientId,"]: The scalabilityMode of the video sending stream is ").concat(x.scalabilityMode)),this.scalabilityMode=x.scalabilityMode)}this.trafficStats&&(w.currentPacketLossRate=(this.trafficStats.B_pvlr4||0)/100)}var m;this.localStats.set(c,w),((v==null?void 0:v.sendResolutionWidth)!==w.sendResolutionWidth||(v==null?void 0:v.sendResolutionHeight)!==w.sendResolutionHeight)&&((m=this.onStatsChanged)===null||m===void 0||m.call(this,"resolution",{width:w.sendResolutionWidth,height:w.sendResolutionHeight})),w&&R&&this.exceptionMonitor.setLocalVideoStats(this.store.uid,R.track,w);break}case ht.LocalAudioTrack:{let v=f,w=u_({},lW),C=a.getStats(),R=a.getLocalMedia(c);if(C){let x=C.audioSend.find(L=>L.ssrc===(R==null?void 0:R.ssrcs[0].ssrcId));if(x){if(x.codec!=="opus"&&x.codec!=="aac"&&x.codec!=="PCMU"&&x.codec!=="PCMA"&&x.codec!=="G722"||(w.codecType=x.codec),x.inputLevel)w.sendVolumeLevel=Math.round(32767*x.inputLevel);else{let L=a.getLocalAudioVolume();L&&(w.sendVolumeLevel=Math.round(32767*L))}w.sendBytes=x.bytes,w.sendPackets=x.packets,w.sendPacketsLost=x.packetsLost,w.sendJitterMs=x.jitterMs,w.sendRttMs=x.rttMs,w.sendBitrate=v?8*Math.max(0,w.sendBytes-v.sendBytes):0}}this.trafficStats&&(w.currentPacketLossRate=(this.trafficStats.B_palr4||0)/100),this.localStats.set(ht.LocalAudioTrack,w),w&&R&&this.exceptionMonitor.setLocalAudioStats(this.store.uid,R.track,w);break}}})}updateRemoteStats(a){Array.from(this.remoteStats.entries()).forEach(o=>{var c,f;let[m,{videoStats:v,audioStats:w,videoPcStats:C}]=o,R=w,x=v,L=C,U=u_({},gse),F=u_({},vse),Z=u_({},qIe),{audioTrack:W,videoTrack:K,audioSSRC:oe,videoSSRC:ue}=a.getRemoteMedia(m),xe;xe=a instanceof Fl?a.getStats(!0):a.getStats();let Oe=(c=xe)===null||c===void 0?void 0:c.audioRecv.find(lt=>lt.ssrc===oe),ke=(f=xe)===null||f===void 0?void 0:f.videoRecv.find(lt=>lt.ssrc===ue),He=this.trafficStats&&this.trafficStats.peer_delay.find(lt=>lt.peer_uid===m);if(Oe&&(Oe.codec!=="opus"&&Oe.codec!=="aac"&&Oe.codec!=="PCMU"&&Oe.codec!=="PCMA"&&Oe.codec!=="G722"||(U.codecType=Oe.codec),Oe.outputLevel?U.receiveLevel=Math.round(32767*Oe.outputLevel):W&&(U.receiveLevel=Math.round(32767*W.getVolumeLevel())),U.receiveBytes=Oe.bytes,U.receivePackets=Oe.packets,U.receivePacketsLost=Oe.packetsLost,U.packetLossRate=U.receivePacketsLost/(U.receivePackets+U.receivePacketsLost),U.receiveBitrate=R?8*Math.max(0,U.receiveBytes-R.receiveBytes):0,U.totalDuration=R?R.totalDuration+1:1,U.totalFreezeTime=R?R.totalFreezeTime:0,U.freezeRate=U.totalFreezeTime/U.totalDuration,U.receiveDelay=Oe.jitterBufferMs,U.totalDuration>10&&Z3.isRemoteAudioFreeze(W)&&(U.totalFreezeTime+=1)),ke){ke.codec!=="H264"&&ke.codec!=="H265"&&ke.codec!=="VP8"&&ke.codec!=="VP9"&&ke.codec!=="AV1X"&&ke.codec!=="AV1"||(F.codecType=ke.codec),F.receiveBytes=ke.bytes,F.receiveBitrate=x?8*Math.max(0,F.receiveBytes-x.receiveBytes):0,F.decodeFrameRate=ke.decodeFrameRate<0?0:ke.decodeFrameRate,F.renderFrameRate=ke.decodeFrameRate<0?0:ke.decodeFrameRate,ke.outputFrame&&(F.renderFrameRate=ke.outputFrame.frameRate),ke.receivedFrame?(F.receiveFrameRate=ke.receivedFrame.frameRate,F.receiveResolutionHeight=ke.receivedFrame.height,F.receiveResolutionWidth=ke.receivedFrame.width):K&&(F.receiveResolutionHeight=K._videoHeight||0,F.receiveResolutionWidth=K._videoWidth||0),ke.framesRateFirefox!==void 0&&(F.receiveFrameRate=Math.round(ke.framesRateFirefox)),F.receivePackets=ke.packets,F.receivePacketsLost=ke.packetsLost,F.packetLossRate=F.receivePacketsLost/(F.receivePackets+F.receivePacketsLost),F.totalDuration=x?x.totalDuration+1:1,F.totalFreezeTime=x?x.totalFreezeTime:0,F.receiveDelay=ke.jitterBufferMs||0;let lt=!!ue&&a.getRemoteVideoIsReady(ue);K&&lt&&Z3.isRemoteVideoFreeze(K,ke,L)&&(F.totalFreezeTime+=1),F.freezeRate=F.totalFreezeTime/F.totalDuration}He&&(U.end2EndDelay=He.B_ad,F.end2EndDelay=He.B_vd,U.transportDelay=He.B_ed,F.transportDelay=He.B_ed,U.currentPacketLossRate=He.B_ealr4/100,F.currentPacketLossRate=He.B_evlr4/100,Z.uplinkNetworkQuality=He.B_punq?He.B_punq:0,Z.downlinkNetworkQuality=He.B_pdnq?He.B_pdnq:0),this.remoteStats.set(m,{audioStats:U,videoStats:F,videoPcStats:ke,networkStats:Z}),W&&this.exceptionMonitor.setRemoteAudioStats(W,U),K&&this.exceptionMonitor.setRemoteVideoStats(K,F)})}}function rle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function eI(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?rle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):rle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class T4e extends nr{constructor(a,o,c,f){super(),X(this,"spec",void 0),X(this,"token",void 0),X(this,"websocket",void 0),X(this,"pingpongTimer",void 0),X(this,"reconnectMode","retry"),X(this,"serviceMode",void 0),X(this,"reqId",0),X(this,"commandReqId",0),X(this,"handleWebSocketOpen",()=>{this.reconnectMode="retry",this.startPingPong()}),X(this,"handleWebSocketMessage",m=>{if(!m.data)return;let v=JSON.parse(m.data);v.requestId?this.emit("@".concat(v.requestId,"-").concat(v.sid),v):this.serviceMode===xs.INJECT?this.emit(kf.INJECT_STREAM_STATUS,v):($t.workerEvent(this.spec.sid,{actionType:"status",serverCode:v.code,workerType:this.serviceMode===xs.TRANSCODE?1:2}),this.emit(kf.PUBLISH_STREAM_STATUS,v))}),this.spec=o,this.token=a,this.serviceMode=f,this.websocket=new E3("live-streaming",c),this.websocket.on(En.CONNECTED,this.handleWebSocketOpen),this.websocket.on(En.ON_MESSAGE,this.handleWebSocketMessage),this.websocket.on(En.REQUEST_NEW_URLS,(m,v)=>{Kr(this,kf.REQUEST_NEW_ADDRESS).then(m).catch(v)}),this.websocket.on(En.RECONNECTING,()=>{this.websocket.reconnectMode=this.reconnectMode})}init(a){return this.websocket.init(a)}async request(a,o,c,f){this.reqId+=1,a==="request"&&(this.commandReqId+=1);let m=this.commandReqId,v=this.reqId;if(!v||!this.websocket)throw new De(ce.UNEXPECTED_ERROR);let w=eI({command:a,sdkVersion:dd==="4.21.0"?"0.0.1":dd,seq:v,requestId:v,allocate:c,cname:this.spec.cname,appId:this.spec.appId,sid:this.spec.sid,uid:this.spec.uid.toString(),ts:Math.floor(Date.now()/1e3)},o);if(this.websocket.state==="closed")throw new De(ce.WS_DISCONNECT);let C=()=>new Ct((U,F)=>{this.websocket.once(En.CLOSED,()=>F(new De(ce.WS_ABORT))),this.websocket.once(En.CONNECTED,U)});this.websocket.state!=="connected"&&await C(),w.clientRequest&&(w.clientRequest.workerToken=this.token);let R=new Ct((U,F)=>{let Z=()=>{F(new De(ce.WS_ABORT))};this.websocket.once(En.RECONNECTING,Z),this.websocket.once(En.CLOSED,Z),this.once("@".concat(v,"-").concat(this.spec.sid),W=>{U(W)})});f&&$t.workerEvent(this.spec.sid,eI(eI({},f),{},{requestId:m,actionType:"request",payload:JSON.stringify(o.clientRequest),serverCode:0,code:0}));let x=Date.now();this.websocket.sendMessage(w);let L=null;try{L=await R}catch(U){if(this.websocket.state==="closed")throw U;return await C(),await this.request(a,o,c)}return f&&$t.workerEvent(this.spec.sid,eI(eI({},f),{},{requestId:m,actionType:"response",payload:JSON.stringify(L.serverResponse),serverCode:L.code,success:L.code===200,responseTime:Date.now()-x})),L.code!==200&&this.handleResponseError(L),L}tryNextAddress(){this.reconnectMode="tryNext",this.websocket.reconnect("tryNext")}close(){let a=dd==="4.21.0"?"0.0.1":dd;this.reqId+=1,this.websocket.state==="connected"?(this.websocket.sendMessage({command:"request",appId:this.spec.appId,cname:this.spec.cname,uid:this.spec.uid.toString(),sdkVersion:a,sid:this.spec.sid,seq:this.reqId,ts:Math.floor(Date.now()/1e3),requestId:this.reqId,clientRequest:{command:"DestroyWorker"}}),this.websocket.close(!1,!0)):this.websocket.close(!1),this.pingpongTimer&&(window.clearInterval(this.pingpongTimer),this.pingpongTimer=void 0)}handleResponseError(a){switch(a.code){case ts.LIVE_STREAM_RESPONSE_ALREADY_EXISTS_STREAM:return void z.warning("live stream response already exists stream");case ts.LIVE_STREAM_RESPONSE_TRANSCODING_PARAMETER_ERROR:case ts.LIVE_STREAM_RESPONSE_BAD_STREAM:case ts.LIVE_STREAM_RESPONSE_WM_PARAMETER_ERROR:return new De(ce.LIVE_STREAMING_INVALID_ARGUMENT,"",{code:a.code}).throw();case ts.LIVE_STREAM_RESPONSE_WM_WORKER_NOT_EXIST:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case ts.LIVE_STREAM_RESPONSE_NOT_AUTHORIZED:return new De(ce.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED,"",{code:a.code}).throw();case ts.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{let o=new De(ce.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE);return this.emit(kf.WARNING,o,a.serverResponse.url)}case ts.LIVE_STREAM_RESPONSE_REQUEST_TOO_OFTEN:{let o=new De(ce.LIVE_STREAMING_WARN_FREQUENT_REQUEST);return this.emit(kf.WARNING,o,a.serverResponse.url)}case ts.LIVE_STREAM_RESPONSE_NOT_FOUND_PUBLISH:throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream response wm worker not exist",{retry:!0});case ts.LIVE_STREAM_RESPONSE_NOT_SUPPORTED:return new De(ce.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED,"",{code:a.code}).throw();case ts.LIVE_STREAM_RESPONSE_MAX_STREAM_NUM:{let o=new De(ce.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT);return this.emit(kf.WARNING,o,a.serverResponse.url)}case ts.LIVE_STREAM_RESPONSE_INTERNAL_SERVER_ERROR:return new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:a.code}).throw();case ts.LIVE_STREAM_RESPONSE_RESOURCE_LIMIT:throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"live stream resource limit",{retry:!0,changeAddress:!0});case ts.LIVE_STREAM_RESPONSE_WORKER_LOST:case ts.LIVE_STREAM_RESPONSE_WORKER_QUIT:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case ts.ERROR_FAIL_SEND_MESSAGE:if(a.serverResponse.command==="UnpublishStream"||a.serverResponse.command==="UninjectStream")return;if(a.serverResponse.command==="UpdateTranscoding"||a.serverResponse.command==="ControlStream")return new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{code:a.code}).throw();throw new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"error fail send message",{retry:!0,changeAddress:!0});case ts.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:return new De(ce.LIVE_STREAMING_CDN_ERROR,"",{code:a.code}).throw()}}startPingPong(){this.pingpongTimer&&window.clearInterval(this.pingpongTimer),this.pingpongTimer=window.setInterval(()=>{this.websocket.state==="connected"&&this.request("ping",{}).catch(k8)},6e3)}}function sle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Po(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?sle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):sle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}class R4e extends nr{constructor(a){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kr,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kr;super(),X(this,"onLiveStreamWarning",void 0),X(this,"onLiveStreamError",void 0),X(this,"onInjectStatusChange",void 0),X(this,"spec",void 0),X(this,"retryTimeout",1e4),X(this,"connection",void 0),X(this,"httpRetryConfig",void 0),X(this,"wsRetryConfig",void 0),X(this,"streamingTasks",new Map),X(this,"isStartingStreamingTask",!1),X(this,"taskMutex",new Ts("live-streaming")),X(this,"cancelToken",Io.CancelToken.source()),X(this,"transcodingConfig",void 0),X(this,"injectConfig",Po({},oAe)),X(this,"injectLoopTimes",0),X(this,"uapResponse",void 0),X(this,"lastTaskId",1),X(this,"statusError",new Map),this.spec=a,this.httpRetryConfig=c,this.wsRetryConfig=o}async setTranscodingConfig(a){let o=Po(Po({},aAe),a);o.videoCodecProfile!==66&&o.videoCodecProfile!==77&&o.videoCodecProfile!==100&&(z.debug("[".concat(this.spec.clientId,"] set transcoding config, fix video codec profile: ").concat(o.videoCodecProfile," -> 100")),o.videoCodecProfile=100),o.transcodingUsers||(o.transcodingUsers=o.userConfigs),o.transcodingUsers&&(o.transcodingUsers=o.transcodingUsers.map(v=>Po(Po(Po({},sAe),v),{},{zOrder:v.zOrder?v.zOrder+1:1}))),function(v){gr(v.width)||Ti(v.width,"config.width",0,1e4),gr(v.height)||Ti(v.height,"config.height",0,1e4),gr(v.videoBitrate)||Ti(v.videoBitrate,"config.videoBitrate",1,1e6),gr(v.videoFrameRate)||Ti(v.videoFrameRate,"config.videoFrameRate"),gr(v.lowLatency)||fm(v.lowLatency,"config.lowLatency"),gr(v.audioSampleRate)||as(v.audioSampleRate,"config.audioSampleRate",[32e3,44100,48e3]),gr(v.audioBitrate)||Ti(v.audioBitrate,"config.audioBitrate",1,128),gr(v.audioChannels)||as(v.audioChannels,"config.audioChannels",[1,2,3,4,5]),gr(v.videoGop)||Ti(v.videoGop,"config.videoGop"),gr(v.videoCodecProfile)||as(v.videoCodecProfile,"config.videoCodecProfile",[66,77,100]),gr(v.userCount)||Ti(v.userCount,"config.userCount",0,17),gr(v.backgroundColor)||Ti(v.backgroundColor,"config.backgroundColor",0,16777215),gr(v.userConfigExtraInfo)||Ms(v.userConfigExtraInfo,"config.userConfigExtraInfo",0,4096,!1),v.transcodingUsers&&!gr(v.transcodingUsers)&&(pm(v.transcodingUsers,"config.transcodingUsers"),v.transcodingUsers.forEach((w,C)=>{H8(w.uid),gr(w.x)||Ti(w.x,"transcodingUser[".concat(C,"].x"),0,1e4),gr(w.y)||Ti(w.y,"transcodingUser[".concat(C,"].y"),0,1e4),gr(w.width)||Ti(w.width,"transcodingUser[".concat(C,"].width"),0,1e4),gr(w.height)||Ti(w.height,"transcodingUser[".concat(C,"].height"),0,1e4),gr(w.zOrder)||Ti(w.zOrder-1,"transcodingUser[".concat(C,"].zOrder"),0,100),gr(w.alpha)||Ti(w.alpha,"transcodingUser[".concat(C,"].alpha"),0,1,!1)})),gr(v.watermark)||iG(v.watermark,"watermark"),gr(v.backgroundImage)||iG(v.backgroundImage,"backgroundImage"),v.images&&!gr(v.images)&&(pm(v.images,"config.images"),v.images.forEach((w,C)=>{iG(w,"images[".concat(C,"]"))}))}(o);let c=[];o.images&&c.push(...o.images.map(v=>Po(Po(Po({},nG),v),{},{zOrder:255}))),o.backgroundImage&&(c.push(Po(Po(Po({},nG),o.backgroundImage),{},{zOrder:0})),delete o.backgroundImage),o.watermark&&(c.push(Po(Po(Po({},nG),o.watermark),{},{zOrder:255})),delete o.watermark),o.images=c,o.transcodingUsers&&(o.userConfigs=o.transcodingUsers.map(v=>Po({},v)),o.userCount=o.transcodingUsers.length,delete o.transcodingUsers);let f=(o.userConfigs||[]).map(v=>typeof v.uid=="number"?Ct.resolve(v.uid):Hie(v.uid,this.spec,this.cancelToken.token,this.httpRetryConfig));if((await Ct.all(f)).forEach((v,w)=>{o.userConfigs&&o.userConfigs[w]&&(o.userConfigs[w].uid=v)}),this.transcodingConfig=o,this.connection)try{var m;let v=await this.connection.request("request",{clientRequest:{command:"UpdateTranscoding",transcodingConfig:this.transcodingConfig}},!1,{command:"UpdateTranscoding",workerType:1,requestByUser:!0,tid:Array.from(Sh(m=this.streamingTasks).call(m)).map(w=>w.taskId).join("#")});z.debug("[".concat(this.spec.clientId,"] update live transcoding config success, code: ").concat(v.code,", config:"),JSON.stringify(this.transcodingConfig))}catch(v){if(!v.data||!v.data.retry)throw v;v.data.changeAddress&&this.connection.tryNextAddress(),this.streamingTasks.forEach(w=>{z.warning("[".concat(this.spec.clientId,"] live streaming receive error"),v.toString(),"try to republish",w.url),this.startLiveStreamingTask(w.url,w.mode,v).then(()=>{z.debug("[".concat(this.spec.clientId,"] live streaming republish ").concat(w.url," success"))}).catch(C=>{z.error("[".concat(this.spec.clientId,"] live streaming republish failed"),w.url,C.toString()),this.onLiveStreamError&&this.onLiveStreamError(w.url,C)})})}}setInjectStreamConfig(a,o){this.injectConfig=Object.assign({},this.injectConfig,a),this.injectLoopTimes=o}async startLiveStreamingTask(a,o,c){var f;if(Array.from(Sh(f=this.streamingTasks).call(f)).find(C=>C.mode===xs.INJECT)&&o===xs.INJECT)return new De(ce.LIVE_STREAMING_TASK_CONFLICT,"inject stream over limit").throw();if(!this.transcodingConfig&&o===xs.TRANSCODE)throw new De(ce.INVALID_OPERATION,"[LiveStreaming] no transcoding config found, can not start transcoding streaming task");let m={command:"PublishStream",ts:Date.now(),url:a,uid:this.spec.uid.toString(),autoDestroyTime:100,acceptImageTimeout:!0};z.debug("[".concat(this.spec.clientId,"] start live streaming ").concat(a,", mode: ").concat(o));let v=await this.taskMutex.lock();if(!this.connection&&c)return void v();if(this.streamingTasks.get(a)&&!c)return v(),new De(ce.LIVE_STREAMING_TASK_CONFLICT).throw();try{this.connection||(this.connection=await this.connect(o))}catch(C){throw v(),C}switch(o){case xs.TRANSCODE:m.transcodingConfig=Po({},this.transcodingConfig);break;case xs.RAW:break;case xs.INJECT:m={cname:this.spec.cname,command:"InjectStream",sid:this.spec.sid,transcodingConfig:this.injectConfig,ts:Date.now(),url:a,loopTimes:this.injectLoopTimes}}this.uapResponse&&this.uapResponse.vid&&(m.vid=this.uapResponse.vid),this.isStartingStreamingTask=!0;let w=this.lastTaskId++;try{let C=new Ct((x,L)=>{vs(this.retryTimeout).then(()=>{if(c)return L(c);let U=this.statusError.get(a);return U?(this.statusError.delete(a),L(U)):void 0})}),R=await Ct.race([this.connection.request("request",{clientRequest:m},!0,{url:a,command:"PublishStream",workerType:o===xs.TRANSCODE?1:2,requestByUser:!c,tid:w.toString()}),C]);this.isStartingStreamingTask=!1,z.debug("[".concat(this.spec.clientId,"] live streaming started, code: ").concat(R.code)),this.streamingTasks.set(a,{clientRequest:m,mode:o,url:a,taskId:w}),v()}catch(C){if(v(),this.isStartingStreamingTask=!1,!C.data||!C.data.retry||c)throw C;return C.data.changeAddress?(this.connection.tryNextAddress(),await this.startLiveStreamingTask(a,o,C)):await this.startLiveStreamingTask(a,o,C)}}stopLiveStreamingTask(a){return new Ct((o,c)=>{let f=this.streamingTasks.get(a);if(!f||!this.connection)return new De(ce.UNEXPECTED_ERROR,"can not find streaming task to stop").throw();let m=f.mode;f.abortTask=()=>{z.debug("[".concat(this.spec.clientId,"] stop live streaming success(worker exception)")),this.streamingTasks.delete(a),o()},this.connection.request("request",{clientRequest:{command:m===xs.INJECT?"UninjectStream":"UnpublishStream",url:f.url}},!1,{url:a,command:"UnPublishStream",workerType:m===xs.TRANSCODE?1:2,requestByUser:!0,tid:(this.lastTaskId++).toString()}).then(v=>{z.debug("[".concat(this.spec.clientId,"] stop live streaming success, code: ").concat(v.code)),this.streamingTasks.delete(a),this.streamingTasks.size===0&&m!==xs.INJECT&&(this.connection&&this.connection.close(),this.connection=void 0),o(),m===xs.INJECT&&this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_STOP_SUCCESS,this.spec.uid,a)}).catch(c)})}async controlInjectStream(a,o,c,f){let m=this.streamingTasks.get(a);if(!m||!this.connection||m.mode!==xs.INJECT)throw new De(ce.INVALID_OPERATION,"can not find inject stream task to control");return(await this.connection.request("request",{clientRequest:{command:"ControlStream",url:a,control:o,audioVolume:c,position:f}})).serverResponse}resetAllTask(){var a;let o=Array.from(Sh(a=this.streamingTasks).call(a));this.terminate();for(let c of o)this.startLiveStreamingTask(c.url,c.mode).catch(f=>{this.onLiveStreamError&&this.onLiveStreamError(c.url,f)})}terminate(){this.cancelToken&&this.cancelToken.cancel(),this.streamingTasks=new Map,this.isStartingStreamingTask=!1,this.statusError=new Map,this.cancelToken=Io.CancelToken.source(),this.uapResponse=void 0,this.connection&&this.connection.close(),this.connection=void 0}async connect(a){if(this.connection)throw new De(ce.UNEXPECTED_ERROR,"live streaming connection has already connected");let o=await Kr(this,G8.REQUEST_WORKER_MANAGER_LIST,a);return this.uapResponse=o,this.connection=new T4e(o.workerToken,this.spec,this.wsRetryConfig,a),this.connection.on(kf.WARNING,(c,f)=>this.onLiveStreamWarning&&this.onLiveStreamWarning(f,c)),this.connection.on(kf.PUBLISH_STREAM_STATUS,c=>this.handlePublishStreamServer(c)),this.connection.on(kf.INJECT_STREAM_STATUS,c=>this.handleInjectStreamServerStatus(c)),this.connection.on(kf.REQUEST_NEW_ADDRESS,(c,f)=>{if(!this.connection)return f(new De(ce.UNEXPECTED_ERROR,"can not get new live streaming address list"));Kr(this,G8.REQUEST_WORKER_MANAGER_LIST,a).then(m=>{this.uapResponse=m,c(m.addressList)}).catch(f)}),await this.connection.init(o.addressList),this.connection}handlePublishStreamServer(a){let o=a.serverStatus&&a.serverStatus.url||"empty_url",c=this.streamingTasks.get(o),f=a.reason;switch(a.code){case ts.PUBLISH_STREAM_STATUS_ERROR_PUBLISH_BROKEN:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_CONNECT:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_HANDSHAKE:case ts.PUBLISH_STREAM_STATUS_ERROR_RTMP_PUBLISH:{let v=new De(ce.LIVE_STREAMING_CDN_ERROR,"",{code:a.code});if(c)return z.error(v.toString()),this.onLiveStreamError&&this.onLiveStreamError(o,v);if(!this.isStartingStreamingTask)return;this.statusError.set(o,v)}case ts.LIVE_STREAM_RESPONSE_FAILED_LOAD_IMAGE:{let v=new De(ce.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE,f);return this.onLiveStreamWarning&&this.onLiveStreamWarning(o,v)}case ts.LIVE_STREAM_RESPONSE_WORKER_LOST:case ts.LIVE_STREAM_RESPONSE_WORKER_QUIT:{var m;if(!this.connection)return;this.connection.tryNextAddress();let v=Array.from(Sh(m=this.streamingTasks).call(m));for(let w of v)w.abortTask?w.abortTask():(z.warning("[".concat(this.spec.clientId,"] publish stream status code"),a.code,"try to republish",w.url),this.startLiveStreamingTask(w.url,w.mode,new De(ce.LIVE_STREAMING_INTERNAL_SERVER_ERROR,"",{code:a.code})).then(()=>{z.debug("[".concat(this.spec.clientId,"] republish live stream success"),w.url)}).catch(C=>{z.error(C.toString()),this.onLiveStreamError&&this.onLiveStreamError(w.url,C)}));return}}}handleInjectStreamServerStatus(a){let o=Number(a.uid),c=a.serverStatus&&a.serverStatus.url;switch(a.code){case 200:return void(this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_START_SUCCESS,o,c));case 451:return this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_START_ALREADY_EXISTS,o,c),void this.streamingTasks.delete(c);case 453:return this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_START_UNAUTHORIZED,o,c),void this.streamingTasks.delete(c);case 470:return this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_BROKEN,o,c),void this.streamingTasks.delete(c);case 499:return this.onInjectStatusChange&&this.onInjectStatusChange(HS.INJECT_STREAM_STATUS_START_TIMEOUT,o,c),void this.streamingTasks.delete(c);default:return void z.debug("inject stream server status",a)}}hasUrl(a){return this.streamingTasks.has(a)}}class ale{constructor(){X(this,"destChannelMediaInfos",new Map),X(this,"srcChannelMediaInfo",void 0)}setSrcChannelInfo(a){vie(a),this.srcChannelMediaInfo=a}addDestChannelInfo(a){vie(a),this.destChannelMediaInfos.set(a.channelName,a)}removeDestChannelInfo(a){z8(a),this.destChannelMediaInfos.delete(a)}getSrcChannelMediaInfo(){return this.srcChannelMediaInfo}getDestChannelMediaInfo(){return this.destChannelMediaInfos}}function ole(r){if(!(r instanceof ale))return new De(ce.INVALID_PARAMS,"Config should be instance of [ChannelMediaRelayConfiguration]").throw();let a=r.getSrcChannelMediaInfo(),o=r.getDestChannelMediaInfo();if(!a)return new De(ce.INVALID_PARAMS,"srcChannelMediaInfo should not be empty").throw();if(o.size===0)return new De(ce.INVALID_PARAMS,"destChannelMediaInfo should not be empty").throw()}class x4e extends nr{constructor(a,o,c){super(),X(this,"ws",void 0),X(this,"requestId",1),X(this,"heartBeatTimer",void 0),X(this,"joinInfo",void 0),X(this,"clientId",void 0),X(this,"onOpen",()=>{this.emit("open"),this.startHeartBeatCheck()}),X(this,"onClose",f=>{this.emit("close"),this.dispose()}),X(this,"onMessage",f=>{let m=JSON.parse(f.data);if(!m||m.command!=="serverResponse"||!m.requestId)return m&&m.command==="serverStatus"&&m.serverStatus&&m.serverStatus.command?(this.emit("status",m.serverStatus),void this.emit(m.serverStatus.command,m.serverStatus)):void 0;this.emit("req_".concat(m.requestId),m)}),this.joinInfo=a,this.clientId=o,this.ws=new E3("cross-channel-".concat(this.clientId),c),this.ws.on(En.RECONNECTING,()=>{this.ws.reconnectMode="retry",this.emit("reconnecting")}),this.ws.on(En.CONNECTED,this.onOpen),this.ws.on(En.ON_MESSAGE,this.onMessage),this.ws.on(En.CLOSED,this.onClose)}isConnect(){return this.ws.state==="connected"}sendMessage(a){let o=this.requestId++;return a.requestId=o,a.seq=o,this.ws.sendMessage(a),o}waitStatus(a){return new Ct((o,c)=>{let f=window.setTimeout(()=>{c(new De(ce.TIMEOUT,"wait status timeout, status: ".concat(a)))},5e3);this.once(a,m=>{window.clearTimeout(f),m.state&&m.state!==0?c(new De(ce.CROSS_CHANNEL_WAIT_STATUS_ERROR,"wait status error, status: ".concat(a))):o(void 0)}),this.once("dispose",()=>{window.clearTimeout(f),c(new De(ce.WS_ABORT))})})}async request(a){if(this.ws.state==="closed")throw new De(ce.WS_DISCONNECT);let o=()=>new Ct((v,w)=>{this.ws.once(En.CLOSED,()=>w(new De(ce.WS_ABORT))),this.ws.once(En.CONNECTED,v)});this.ws.state!=="connected"&&await o();let c=this.sendMessage(a),f=new Ct((v,w)=>{let C=()=>{w(new De(ce.WS_ABORT))};this.ws.once(En.RECONNECTING,C),this.ws.once(En.CLOSED,C),this.once("req_".concat(c),v),vs(3e3).then(()=>{this.removeAllListeners("req_".concat(c)),this.ws.off(En.RECONNECTING,C),this.ws.off(En.CLOSED,C),w(new De(ce.TIMEOUT,"cross channel ws request timeout"))})}),m=await f;if(!m||m.code!==200)throw new De(ce.CROSS_CHANNEL_SERVER_ERROR_RESPONSE,"response: ".concat(JSON.stringify(m)));return m}async connect(a){this.ws.removeAllListeners(En.REQUEST_NEW_URLS),this.ws.on(En.REQUEST_NEW_URLS,o=>{o(a)}),await this.ws.init(a)}dispose(){this.clearHeartBeatCheck(),this.emit("dispose"),this.removeAllListeners(),this.ws.close()}sendPing(a){let o=this.requestId++;return a.requestId=o,this.ws.sendMessage(a),o}startHeartBeatCheck(){this.heartBeatTimer&&window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=window.setInterval(()=>{this.sendPing({command:"ping",appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sid:this.joinInfo.sid,ts:+new Date,requestId:0})},3e3)}clearHeartBeatCheck(){window.clearInterval(this.heartBeatTimer),this.heartBeatTimer=void 0}}class A4e extends nr{set state(a){a!==this._state&&(a!==il.RELAY_STATE_FAILURE&&(this.errorCode=GS.RELAY_OK),this.emit("state",a,this.errorCode),this._state=a)}get state(){return this._state}constructor(a,o,c,f,m){super(),X(this,"joinInfo",void 0),X(this,"sid",void 0),X(this,"clientId",void 0),X(this,"cancelToken",Io.CancelToken.source()),X(this,"workerToken",void 0),X(this,"requestId",0),X(this,"signal",void 0),X(this,"prevChannelMediaConfig",void 0),X(this,"httpRetryConfig",void 0),X(this,"_resolution",void 0),X(this,"_state",il.RELAY_STATE_IDLE),X(this,"errorCode",GS.RELAY_OK),X(this,"onStatus",v=>{z.debug("[".concat(this.clientId,"] ChannelMediaStatus: ").concat(JSON.stringify(v))),v&&v.command&&(v.command==="onAudioPacketReceived"&&this.emit("event",mm.PACKET_RECEIVED_AUDIO_FROM_SRC),v.command==="onVideoPacketReceived"&&this.emit("event",mm.PACKET_RECEIVED_VIDEO_FROM_SRC),v.command==="onSrcTokenPrivilegeDidExpire"&&(this.errorCode=GS.SRC_TOKEN_EXPIRED,this.state=il.RELAY_STATE_FAILURE),v.command==="onDestTokenPrivilegeDidExpire"&&(this.errorCode=GS.DEST_TOKEN_EXPIRED,this.state=il.RELAY_STATE_FAILURE))}),X(this,"onReconnect",async()=>{z.debug("[".concat(this.clientId,"] ChannelMediaSocket disconnect, reconnecting")),this.emit("event",mm.NETWORK_DISCONNECTED),this.state=il.RELAY_STATE_IDLE,this.prevChannelMediaConfig&&this.sendStartRelayMessage(this.prevChannelMediaConfig).catch(v=>{this.state!==il.RELAY_STATE_IDLE&&(z.error("auto restart channel media relay failed",v.toString()),this.errorCode=GS.SERVER_CONNECTION_LOST,this.state=il.RELAY_STATE_FAILURE)})}),this.joinInfo=a,this.clientId=o,this.sid=m3(),this.signal=new x4e(this.joinInfo,this.clientId,c),this.httpRetryConfig=f,this._resolution=m}async startChannelMediaRelay(a){if(this.state!==il.RELAY_STATE_IDLE)throw new De(ce.INVALID_OPERATION);this.state=il.RELAY_STATE_CONNECTING,await this.connect(),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: connect success"));try{await this.sendStartRelayMessage(a)}catch(o){throw o.data&&o.data.serverResponse&&o.data.serverResponse.command==="SetSourceChannel"?new De(ce.CROSS_CHANNEL_FAILED_JOIN_SRC):o.data&&o.data.serverResponse&&o.serverResponse.command==="SetDestChannelStatus"?new De(ce.CROSS_CHANNEL_FAILED_JOIN_DEST):o.data&&o.data.serverResponse&&o.serverResponse.command==="StartPacketTransfer"?new De(ce.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST):o}this.prevChannelMediaConfig=a}async updateChannelMediaRelay(a){if(this.state!==il.RELAY_STATE_RUNNING)throw new De(ce.INVALID_OPERATION);await this.sendUpdateMessage(a),this.prevChannelMediaConfig=a}async setVideoProfile(a){if(this._resolution=a,this.state!==il.RELAY_STATE_RUNNING)throw new De(ce.INVALID_OPERATION);let o=this.genMessage(io.SetVideoProfile);await this.signal.request(o),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: setVideoProfile success"))}async stopChannelMediaRelay(){await this.sendStopRelayMessage(),z.debug("[".concat(this.clientId,"] stopChannelMediaRelay: send stop message success")),this.state=il.RELAY_STATE_IDLE,this.dispose()}dispose(){z.debug("[".concat(this.clientId,"] disposeChannelMediaRelay")),this.cancelToken.cancel(),this.cancelToken=Io.CancelToken.source(),this.state=il.RELAY_STATE_IDLE,this.emit("dispose"),this.signal.dispose(),this.prevChannelMediaConfig=void 0}async connect(){let a=await xAe(this.joinInfo,this.cancelToken.token,this.httpRetryConfig);this.workerToken=a.workerToken,await this.signal.connect(a.addressList),this.emit("event",mm.NETWORK_CONNECTED),this.signal.on("status",this.onStatus),this.signal.on("reconnecting",this.onReconnect)}async sendStartRelayMessage(a){let o=this.genMessage(io.StopPacketTransfer);await this.signal.request(o),await this.signal.waitStatus("Normal Quit"),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: StopPacketTransfer success"));let c=this.genMessage(io.SetSdkProfile,a);await this.signal.request(c),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSdkProfile success"));let f=this.genMessage(io.SetSourceChannel,a);await this.signal.request(f),await this.signal.waitStatus("SetSourceChannelStatus"),this.emit("event",mm.PACKET_JOINED_SRC_CHANNEL),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceChannel success"));let m=this.genMessage(io.SetSourceUserId,a);await this.signal.request(m),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetSourceUserId success"));let v=this.genMessage(io.SetDestChannel,a);await this.signal.request(v),await this.signal.waitStatus("SetDestChannelStatus"),this.emit("event",mm.PACKET_JOINED_DEST_CHANNEL),z.debug("[".concat(this.clientId,"] startChannelMediaRelay: SetDestChannel success"));let w=this.genMessage(io.StartPacketTransfer,a);await this.signal.request(w),this.emit("event",mm.PACKET_SENT_TO_DEST_CHANNEL),this.state=il.RELAY_STATE_RUNNING,z.debug("[".concat(this.clientId,"] startChannelMediaRelay: StartPacketTransfer success")),this.setVideoProfile(this._resolution)}async sendUpdateMessage(a){let o=this.genMessage(io.UpdateDestChannel,a);await this.signal.request(o),this.emit("event",mm.PACKET_UPDATE_DEST_CHANNEL),z.debug("[".concat(this.clientId,"] sendUpdateMessage: UpdateDestChannel success"))}async sendStopRelayMessage(){let a=this.genMessage(io.StopPacketTransfer);await this.signal.request(a),z.debug("[".concat(this.clientId,"] sendStopRelayMessage: StopPacketTransfer success"))}genMessage(a,o){let c=[],f=[],m=[];this.requestId+=1;let v={appId:this.joinInfo.appId,cname:this.joinInfo.cname,uid:this.joinInfo.uid.toString(),sdkVersion:dd,sid:this.sid,ts:Date.now(),requestId:this.requestId,seq:this.requestId,allocate:!0,clientRequest:{}};v.sdkVersion==="4.21.0"&&(v.sdkVersion="0.0.1");let w=null,C=null;switch(a){case io.SetSdkProfile:return v.clientRequest={command:"SetSdkProfile",type:"multi_channel"},v;case io.SetSourceChannel:if(C=o&&o.getSrcChannelMediaInfo(),!C)throw new De(ce.UNEXPECTED_ERROR,"can not find source config");return v.clientRequest={command:"SetSourceChannel",uid:"0",channelName:C.channelName,token:C.token||this.joinInfo.appId},v;case io.SetSourceUserId:if(C=o&&o.getSrcChannelMediaInfo(),!C)throw new De(ce.UNEXPECTED_ERROR,"can not find source config");return v.clientRequest={command:"SetSourceUserId",uid:C.uid+""},v;case io.SetDestChannel:if(w=o&&o.getDestChannelMediaInfo(),!w)throw new De(ce.UNEXPECTED_ERROR,"can not find dest config");return w.forEach(R=>{c.push(R.channelName),f.push(R.uid+""),m.push(R.token||this.joinInfo.appId)}),v.clientRequest={command:"SetDestChannel",channelName:c,uid:f,token:m},v;case io.StartPacketTransfer:return v.clientRequest={command:"StartPacketTransfer"},v;case io.Reconnect:return v.clientRequest={command:"Reconnect"},v;case io.StopPacketTransfer:return v.clientRequest={command:"StopPacketTransfer"},v;case io.UpdateDestChannel:if(w=o&&o.getDestChannelMediaInfo(),!w)throw new De(ce.UNEXPECTED_ERROR,"can not find dest config");return w.forEach(R=>{c.push(R.channelName),f.push(R.uid+""),m.push(R.token||this.joinInfo.appId)}),v.clientRequest={command:"UpdateDestChannel",channelName:c,uid:f,token:m},v;case io.SetVideoProfile:v.clientRequest={command:"SetVideoProfile",width:this._resolution.width,height:this._resolution.height}}return v}}function kD(r){var a={},o=!1;function c(f,m){return o=!0,{done:!1,value:new EW(m=new wW(function(v){v(r[f](m))}),1)}}return a[OS!==void 0&&Ite||"@@iterator"]=function(){return this},a.next=function(f){return o?(o=!1,f):c("next",f)},typeof r.throw=="function"&&(a.throw=function(f){if(o)throw o=!1,f;return c("throw",f)}),typeof r.return=="function"&&(a.return=function(f){return o?(o=!1,f):c("return",f)}),a}var lle=l(yoe);function cle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function dle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?cle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):cle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}var Mi;function ule(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function hle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?ule(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):ule(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let _b=(Mi=class AI extends $8{get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get localCodecs(){return[...new Set(this.localCapabilities&&this.localCapabilities.videoCodecs.map(a=>a.rtpMap&&a.rtpMap.encodingName.toLowerCase()||"").filter(a=>{var o;return Tt(o=Object.keys(VS)).call(o,a)}))]}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"statsFilter",void 0),X(this,"useRTX",!1),X(this,"localCapabilities",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"establishPromise",void 0),X(this,"mutex",new Ts("P2PConnection-mutex")),this.store=o,this.peerConnection=new RTCPeerConnection(AI.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.statsFilter=ID(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Pi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async establish(){try{let a=await this.peerConnection.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});if(!a.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let o=Ah(a.sdp),c=Q3(a.sdp,{filterRTX:!this.useRTX,filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterAudioCodec:["opus"]});return this.localCapabilities=c,this.initialOffer=a,hle(hle({},o),{},{rtpCapabilities:{send:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},recv:{audioCodecs:[],audioExtensions:[],videoCodecs:[],videoExtensions:[]},sendrecv:c},offerSDP:a.sdp})}catch(a){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,a.toString())}}async connect(a,o,c,f,m,v){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new class{constructor(C){X(this,"sessionDesc",void 0),X(this,"localCapabilities",void 0),X(this,"rtpCapabilities",void 0),X(this,"candidates",void 0),X(this,"iceParameters",void 0),X(this,"dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),C=zi(C);let{remoteIceParameters:R,remoteDtlsParameters:x,candidates:L,remoteRTPCapabilities:U,remoteSetup:F,localCapabilities:Z,sdkCodec:W,cname:K}=C,oe=rr.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS
a=ice-lite
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:audio
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=mid:video
`);this.rtpCapabilities=U,this.candidates=L,this.iceParameters=R,this.dtlsParameters=x,this.setup=F,this.localCapabilities=Z,this.cname=K;for(let ue=0;ue<oe.mediaDescriptions.length;ue++){let xe=oe.mediaDescriptions[ue];if(xe.attributes.iceUfrag=R.iceUfrag,xe.attributes.icePwd=R.icePwd,xe.attributes.fingerprints=x.fingerprints,xe.attributes.candidates=L,xe.attributes.setup=F,xe.media.mediaType==="video"){xe.media.fmts=U.videoCodecs.map(ke=>ke.payloadType.toString(10));let Oe=U.videoCodecs.filter(ke=>{var He,lt;return(He=ke.rtpMap)===null||He===void 0?void 0:Tt(lt=He.encodingName.toLowerCase()).call(lt,W)});Oe.length===0&&(Oe=U.videoCodecs),xe.attributes.payloads=Oe,xe.attributes.extmaps=U.videoExtensions}xe.media.mediaType==="audio"&&(xe.media.fmts=U.audioCodecs.map(Oe=>Oe.payloadType.toString(10)),xe.attributes.payloads=U.audioCodecs,xe.attributes.extmaps=U.audioExtensions),oe.mediaDescriptions[ue]=this.mungMediaDesc(xe)}this.sessionDesc=oe,this.currentMidIndex=oe.mediaDescriptions.length-1}toString(){return rr.print(this.sessionDesc)}send(C,R,x){let{ssrcs:L,ssrcGroups:U}=Dc(R,this.cname),F=this.sessionDesc.mediaDescriptions.find(K=>C===Wt.VIDEO?K.media.mediaType==="video":K.media.mediaType==="audio"),Z=L[0].attributes.label,W=L[0].attributes.mslabel;return F.attributes.ssrcs=F.attributes.ssrcs.concat(L),F.attributes.ssrcGroups=F.attributes.ssrcGroups.concat(U),{id:Z,mslabel:W}}batchSend(C){return C.map(R=>{let{kind:x,ssrcMsg:L}=R;return this.send(x,L,void 0)})}stopSending(C){this.sessionDesc.mediaDescriptions.forEach(R=>{let x=[],L=[],U=[];R.attributes.ssrcs.forEach(F=>{Tt(C).call(C,F.attributes.label||"")?U.push(F):x.push(F)}),R.attributes.ssrcGroups.forEach(F=>{var Z;Tt(Z=U.map(W=>W.ssrcId)).call(Z,F.ssrcIds[0])||L.push(F)}),R.attributes.ssrcs=x,R.attributes.ssrcGroups=L})}mute(C){let R=this.sessionDesc.mediaDescriptions.find(x=>x.attributes.mid===C);if(!R)throw new Error("mediaDescription not found with ".concat(C," in remote SDP when calling RemoteSDP.mute."));R.attributes.direction="inactive"}unmute(C){let R=this.sessionDesc.mediaDescriptions.find(x=>x.attributes.mid===C);if(!R)throw new Error("mediaDescription not found with ".concat(C," in remote SDP when calling RemoteSDP.unmute."));R.attributes.direction="sendonly"}receive(C,R,x){C.forEach((L,U)=>{let F=L._mediaStreamTrack,Z=this.sessionDesc.mediaDescriptions.findIndex(K=>K.attributes.mid===F.kind),W=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[Z],L);this.sessionDesc.mediaDescriptions[Z]=W})}stopReceiving(C){}updateCandidates(C){C===Pa.TCP?this.candidates.forEach(R=>{this.candidates.findIndex(x=>x.transport==="tcp"&&x.connectionAddress===R.connectionAddress&&x.port===R.port)===-1&&this.candidates.push(dle(dle({},R),{},{foundation:"tcpcandidate",priority:Number(R.priority)-1+"",transport:"tcp",port:Number(R.port)+90+""}))}):this.candidates=this.candidates.filter(R=>R.transport!=="tcp");for(let R of this.sessionDesc.mediaDescriptions)R.attributes.candidates=this.candidates}restartICE(C){C=zi(C),this.iceParameters=C,this.sessionDesc.mediaDescriptions.forEach(R=>{R.attributes.iceUfrag=C.iceUfrag,R.attributes.icePwd=C.icePwd})}predictReceivingMids(C){let R=[];for(let x=0;x<C;x++)R.push((this.currentMidIndex+x+1).toString(10));return R}mungRecvMediaDsec(C,R){let x=zi(C);return F0(x,R),OD(x,R),x}updateRecvMedia(C,R){let x=this.sessionDesc.mediaDescriptions.findIndex(L=>L.attributes.mid===C);if(x!==-1){let L=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[x],R);this.sessionDesc.mediaDescriptions[x]=L}}bumpMid(C){this.currentMidIndex+=C}updateTrackLabel(C,R,x){let L=this.sessionDesc.mediaDescriptions.find(F=>C===Wt.VIDEO?F.attributes.mid==="video":F.attributes.mid==="audio");if(L){let F=L.attributes.ssrcs.find(Z=>Z.attributes.label===R);var U;F&&(F.attributes.label=x,(U=F.attributes.msid)===null||U===void 0||U.replace(R,x))}}mungMediaDesc(C){let R=zi(C);return ND(R),function(x){let L=x.attributes.extmaps.find(U=>U.extensionName==="http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01");L&&x.attributes.extmaps.splice(x.attributes.extmaps.indexOf(L),1),x.attributes.payloads.forEach(U=>{let F=U.rtcpFeedbacks.findIndex(Z=>Z.type==="transport-cc");F!==-1&&U.rtcpFeedbacks.splice(F,1)})}(R),R}getSSRC(C){for(let R of this.sessionDesc.mediaDescriptions)for(let x of R.attributes.ssrcs)if(x.attributes.label===C)return[x]}}({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f.send,remoteSetup:m,localCapabilities:this.localCapabilities,sdkCodec:this.store.codec,cname:v});let w=this.remoteSDP.toString();await this.peerConnection.setLocalDescription(this.initialOffer),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(w){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(w.toString()))}}async updateRemoteRTPCapabilities(a,o){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support createDataChannels.")}send(a,o){var c=this;return Ul(function*(){let f=yield Dn(c.mutex.lock());try{if(!c.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let m=a.map(U=>c.peerConnection.addTrack(U._mediaStreamTrack)),v=yield Dn(c.peerConnection.createOffer()),w=rr.parse(v.sdp),C=a.map(U=>{let F=U._mediaStreamTrack,Z=w.mediaDescriptions.find(W=>W.attributes.mid===F.kind);if(!Z)throw new Error("Cannot extract ssrc from mediaDescription.");return function(W,K,oe){let ue=W.attributes.ssrcs.filter(Oe=>Oe.attributes.label===K),xe=W.attributes.ssrcGroups;if(ue.length===0)throw new Error("Cannot extract ssrc from plan-b SDP.");if(xe&&ue.length>1){let Oe=xe.find(ke=>ke.ssrcIds.indexOf(ue[0].ssrcId)!==-1);return Oe?[{ssrcId:Oe.ssrcIds[0],rtx:oe?Oe.ssrcIds[1]:void 0}]:[{ssrcId:ue[0].ssrcId}]}return[{ssrcId:ue[0].ssrcId}]}(Z,F.id,c.useRTX)}),R;try{R=yield C}catch(U){throw m.forEach(F=>{gs()&&F.replaceTrack(null),c.peerConnection.removeTrack(F)}),U}let x=c.mungSendOfferSDP(v.sdp,a);c.remoteSDP.receive(a,o,R);let L=c.remoteSDP.toString();return yield Dn(c.peerConnection.setLocalDescription({type:"offer",sdp:x})),yield Dn(c.applySendEncodings(m,a)),yield Dn(c.peerConnection.setRemoteDescription({type:"answer",sdp:L})),a.map((U,F)=>{let Z=U._mediaStreamTrack.id;return{localSSRC:C[F],id:Z}})}catch(m){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(m.toString()))}finally{f()}})()}async stopSending(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let o=this.peerConnection.getSenders().filter(m=>{var v;return a.indexOf(((v=m.track)===null||v===void 0?void 0:v.id)||"")!==-1});if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");o.map(m=>{gs()&&m.replaceTrack(null),this.peerConnection.removeTrack(m)});let c=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(c),this.remoteSDP.stopReceiving(a);let f=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:f})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(o.toString()))}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{id:m,mslabel:v}=this.remoteSDP.send(a,o,f),w=new Ct((x,L)=>{let U=setTimeout(()=>{L(new Error("Cannot receive track, id: ".concat(m)))},1e4),F=Z=>{let W=ni();if((W.name==="Safari"&&Number(W.version)===11||ra())&&Z.track.id!==m&&Z.streams[0].id===v){var K;let oe=Z.streams[0].getTracks()[0];return(K=this.remoteSDP)===null||K===void 0||K.updateTrackLabel(a,m,Z.track.id),this.peerConnection.removeEventListener("track",F),clearTimeout(U),void x(oe)}if(Z.track.id===m)return this.peerConnection.removeEventListener("track",F),clearTimeout(U),void x(Z.track)};this.peerConnection.addEventListener("track",F)}),C=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:C});let R=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(R),{track:await w,id:m}}catch(m){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(m.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let c=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(c)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){}async unmuteRemote(a){}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getSenders().filter(c=>{var f;return a.indexOf(((f=c.track)===null||f===void 0?void 0:f.id)||"")!==-1});if(o.length!==a.length)throw new Error("sender' length doesn't match mids' length.");o.map(c=>{if(gs()&&c.track)c.track.enabled=!1;else{let f=c.getParameters();f.encodings.forEach(m=>m.active=!1),c.setParameters(f)}})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getSenders().filter(m=>{var v;return a.indexOf(((v=m.track)===null||v===void 0?void 0:v.id)||"")!==-1});if(o.length!==a.length)throw new Error("Senders' length doesn't match mids' length.");o.map(async m=>{if(gs()&&m.track)m.track.enabled=!0;else{let v=m.getParameters();v.encodings.forEach(w=>w.active=!0),await m.setParameters(v)}});let c=await this.peerConnection.createOffer();await this.peerConnection.setLocalDescription(c);let f=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"answer",sdp:f})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return Ul(function*(){let c=yield Dn(o.mutex.lock("From P2PConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let C=o.peerConnection.getConfiguration(),R=a===Pa.RELAY?"relay":"all";C.iceTransportPolicy!==R&&(z.debug("[".concat(o.store.clientId,"] restartICE change iceTransportPolicy from [").concat(C.iceTransportPolicy,"] to [").concat(R,"]")),C.iceTransportPolicy=R,o.peerConnection.setConfiguration(C))}else if(a===Pa.RELAY)return;a!==Pa.RELAY&&o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let m=Ah(f.sdp),{remoteIceParameters:v}=yield m.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString();yield Dn(o.peerConnection.setLocalDescription(f)),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("[".concat(o.store.clientId,"] restart ICE failed, abort operation"),f)}finally{c()}})()}close(){var a;this.peerConnection.close(),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.statsFilter.destroy()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o]);this.remoteSDP.updateRecvMedia(o._mediaStreamTrack.kind,o);let m=this.remoteSDP.toString();await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getSenders().filter(f=>{var m;return((m=f.track)===null||m===void 0?void 0:m.id)===a});c.length===1&&await this.applySendEncodings(c,[o])}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getSenders().find(f=>{var m;return((m=f.track)===null||m===void 0?void 0:m.id)===o});c&&await c.replaceTrack(a._mediaStreamTrack)}createDataChannels(a,o){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support createDataChannels.")}stopDataChannels(a){throw new Ke(ce.NOT_SUPPORTED,"Planb mode does not support stopDataChannels.")}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[],sdpSemantics:"plan-b"};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(US(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...AI.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...AI.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}async updateRtpSenderEncodings(a,o){var c;if(o||(o=this.peerConnection.getSenders().find(R=>{var x;return((x=R.track)===null||x===void 0?void 0:x.id)===a._mediaStreamTrack.id})),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(!Jn().supportSetRtpSenderParameters)return z.warn("Browser not support set rtp-sender parameters");let f={},m={};if(a instanceof ki)switch(a._optimizationMode){case"motion":f.degradationPreference="maintain-framerate";break;case"detail":f.degradationPreference="maintain-resolution";break;default:f.degradationPreference="balanced"}if(ve("DSCP_TYPE")&&C0()){var v;let R=ve("DSCP_TYPE");Tt(v=["very-low","low","medium","high"]).call(v,R)&&(m.networkPriority=R)}let w=o.getParameters(),C=(c=w.encodings)===null||c===void 0?void 0:c[0];C&&Object.assign(C,m),Object.assign(w,f),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(w.encodings))),await o.setParameters(w)}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],m=o[c];f&&m&&await this.updateRtpSenderEncodings(m,f)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o){let c=rr.parse(a);return o.forEach((f,m)=>{let v=f._mediaStreamTrack,w=c.mediaDescriptions.find(C=>C.attributes.mid===v.kind);w&&F0(w,f)}),rr.print(c)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");let o=this.remoteSDP.batchSend(a).map((m,v)=>{let{id:w,mslabel:C}=m,{kind:R}=a[v];return new Ct((x,L)=>{let U=setTimeout(()=>{L(new Error("Cannot receive track, id: ".concat(w)))},1e4),F=Z=>{let W=ni();if(W.name==="Safari"&&Number(W.version)===11&&Z.track.id!==w&&Z.streams[0].id===C){var K;let oe=Z.streams[0].getTracks()[0];return(K=this.remoteSDP)===null||K===void 0||K.updateTrackLabel(R,w,Z.track.id),this.peerConnection.removeEventListener("track",F),clearTimeout(U),void x({track:oe,id:w})}if(Z.track.id===w)return this.peerConnection.removeEventListener("track",F),clearTimeout(U),void x({track:Z.track,id:w})};this.peerConnection.addEventListener("track",F)})}),c=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:c});let f=await this.peerConnection.createAnswer();return await this.peerConnection.setLocalDescription(f),await Ct.all(o)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(o.toString()))}}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=AI.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(Mi.prototype,"connect",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"connect"),Mi.prototype),vt(Mi.prototype,"stopSending",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"stopSending"),Mi.prototype),vt(Mi.prototype,"receive",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"receive"),Mi.prototype),vt(Mi.prototype,"stopReceiving",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"stopReceiving"),Mi.prototype),vt(Mi.prototype,"muteRemote",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"muteRemote"),Mi.prototype),vt(Mi.prototype,"unmuteRemote",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"unmuteRemote"),Mi.prototype),vt(Mi.prototype,"muteLocal",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"muteLocal"),Mi.prototype),vt(Mi.prototype,"unmuteLocal",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"unmuteLocal"),Mi.prototype),vt(Mi.prototype,"close",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"close"),Mi.prototype),vt(Mi.prototype,"updateEncoderConfig",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"updateEncoderConfig"),Mi.prototype),vt(Mi.prototype,"updateSendParameters",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"updateSendParameters"),Mi.prototype),vt(Mi.prototype,"replaceTrack",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"replaceTrack"),Mi.prototype),vt(Mi.prototype,"getRemoteSSRC",[vd],Object.getOwnPropertyDescriptor(Mi.prototype,"getRemoteSSRC"),Mi.prototype),Mi);function vd(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("Locking from P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}function fle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function H0(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?fle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):fle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let tI="9",ple=4e4;function mle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Tm(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?mle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):mle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let MD=function(r){return r.BANDWIDTH="bandwidth",r.CPU="cpu",r.NONE="none",r.OTHER="other",r}({});var Eb=function(r){return r[r.DOWN=0]="DOWN",r[r.UP=1]="UP",r}(Eb||{});let jD=new Map;function gle(r,a,o,c){let{scale:f}=r;if(f===0&&c===Eb.UP||f>=a.length-1&&c===Eb.DOWN)return r;let m=Tm(Tm({},r),{},{scale:c===Eb.DOWN?++f:--f});switch(o){case"maintain-framerate":m=Tm(Tm({},m),a[f].motion);break;case"maintain-resolution":m=Tm(Tm({},m),a[f].detail);break;case"balanced":m=Tm(Tm({},m),a[f].balanced)}return m}function vle(r,a){if(a){let o={overUse:0,underUse:0,adaptationList:yle(a)};jD.set(r,o)}else jD.delete(r)}function yle(r){let a=Tm({},r),{bitrateMax:o,frameRate:c,scaleResolutionDownBy:f,bitrateMin:m}=a,{MIN_FRAME_RATE:v,MAX_THRESHOLD_FRAMERATE:w,MAX_SCALE:C,BITRATE_MIN_THRESHOLD:R,BITRATE_MAX_THRESHOLD:x,BWE_SCALE_UP_THRESHOLD:L,BWE_SCALE_DOWN_THRESHOLD:U,PERF_SCALE_DOWN_THRESHOLD:F,PERF_SCALE_UP_THRESHOLD:Z,BALANCE_BITRATE_FACTOR:W,BALANCE_FRAMERATE_FACTOR:K,BALANCE_RESOLUTION_FACTOR:oe,MOTION_RESOLUTION_FACTOR:ue,MOTION_BITRATE_FACTOR:xe,DETAIL_FRAMERATE_FACTOR:Oe,DETAIL_BITRATE_FACTOR:ke}=KH,He=Math.min(a.frameRate,w),lt=[{scale:0,threshold:{bwe_down:Math.round(Math.pow(U,1)*o),bwe_up:o,fps_down:Math.round(Math.pow(F,1)*He),fps_up:c},balanced:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:m},motion:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:m},detail:{scaleResolutionDownBy:1,frameRate:c,bitrateMax:o,bitrateMin:m}}];for(let ut=1;ut<=C;ut++){let ft={bwe_up:Math.round(Math.pow(L,ut)*o),bwe_down:Math.round(Math.pow(U,ut+1)*o),fps_up:Math.round(Math.pow(Z,ut)*He),fps_down:Math.round(Math.pow(F,ut+1)*He)},zt={scaleResolutionDownBy:f/Math.pow(oe,ut),frameRate:Math.max(Math.round(Math.pow(K,ut)*c),v),bitrateMax:Math.max(Math.round(Math.pow(W,ut)*o),x),bitrateMin:Math.max(Math.round(Math.pow(W,ut)*m),R)},$n={scaleResolutionDownBy:f/Math.pow(ue,ut),frameRate:c,bitrateMax:Math.max(Math.round(Math.pow(xe,ut)*o),x),bitrateMin:Math.max(Math.round(Math.pow(xe,ut)*m),R)},hi={scaleResolutionDownBy:1,frameRate:Math.max(Math.round(Math.pow(Oe,ut)*c),v),bitrateMax:Math.max(Math.round(Math.pow(ke,ut)*o),x),bitrateMin:Math.max(Math.round(Math.pow(ke,ut)*m),R)};lt.push({scale:ut,threshold:ft,balanced:zt,motion:$n,detail:hi})}return lt}function I4e(r,a,o,c,f,m){let v=jD.get(r)||{overUse:0,underUse:0,adaptationList:yle(f)},{adaptationList:w}=v;jD.set(r,v);let{OVERUSE_TIMES_THRESHOLD:C,UNDERUSE_TIMES_THRESHOLD:R}=KH,{scale:x}=c,L,U;return typeof a=="number"&&a>0&&function(F,Z,W,K){if(Z>=W.length)return!1;let{threshold:{fps_down:oe}}=W[Z];return ve("FORCE_AG_HIGH_FRAMERATE")&&K==="maintain-framerate"&&(oe=W[0].threshold.fps_down),F<oe}(a,x,w,m)&&(v.overUse++,U=MD.CPU,v.overUse>C)||typeof o=="number"&&o>0&&function(F,Z,W){if(Z>=W.length)return!1;let{threshold:{bwe_down:K}}=W[Z];return F<K}(o,x,w)&&(v.overUse++,U=MD.BANDWIDTH,v.overUse>C)?(v.overUse=0,v.underUse=0,L=gle(c,w,m,Eb.DOWN),[L,U]):(typeof a=="number"&&a>0&&typeof o=="number"&&o>0&&function(F,Z,W,K){if(Z===0)return;let{threshold:{fps_up:oe}}=W[Z];return ve("FORCE_AG_HIGH_FRAMERATE")&&K==="maintain-framerate"&&(oe=W[1].threshold.fps_up),F>oe}(a,x,w,m)&&function(F,Z,W){if(Z===0)return;let{threshold:{bwe_up:K}}=W[Z];return F>K}(o,x,w)&&(v.underUse++,v.underUse>R&&(v.overUse=0,v.underUse=0,L=gle(c,w,m,Eb.UP),L.scale===0&&(U=MD.NONE))),[L,U])}function _le(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function DW(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?_le(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):_le(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function N4e(r){var a;return!!ve("ENABLE_AG_ADAPTATION")&&!!(r instanceof yW||Tt(a=r._hints).call(a,Hi.CUSTOM_TRACK))&&(!!ve("FORCE_SUPPORT_AG_ADAPTATION")||!!(function(o){let c=ni();if(c.os!==ms.IOS||!c.osVersion)return!1;let f=c.osVersion.split(".");return Number(f[0])>=o}(14)&&Ine(17,4)||Ane(14)&&Nne(17,4)))}let UD=new Map;function FD(r){let a=UD.get(r);if(a){let{timer:o,adaptationFunc:c,originConfig:f}=a;window.clearTimeout(o),c(f),UD.delete(r)}vle(r)}var ri;function Ele(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function G0(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Ele(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Ele(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Ph=(ri=class II extends $8{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get dtlsTransportState(){var a,o;return(a=(o=this.peerConnection.getReceivers()[0])===null||o===void 0||(o=o.transport)===null||o===void 0?void 0:o.state)!==null&&a!==void 0?a:null}get localCodecs(){return[...new Set(this.localCapabilities&&this.localCapabilities.send.videoCodecs.map(a=>a.rtpMap&&a.rtpMap.encodingName.toLowerCase()||"").filter(a=>{var o;return Tt(o=Object.keys(VS)).call(o,a)}))]}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"id",Di(5,"connection-")),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"transportEventReceiver",void 0),X(this,"statsFilter",void 0),X(this,"useXR",ve("USE_XR")),X(this,"localCapabilities",void 0),X(this,"remoteCodecs",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"dataStreamChannelMap",new Map),X(this,"establishPromise",void 0),X(this,"recoveredDataChannelIds",[]),X(this,"currentDataChannelId",1),X(this,"mutex",new Ts("P2PConnection-mutex")),X(this,"qualityLimitationReason",MD.NONE),this.store=o,this.peerConnection=new RTCPeerConnection(II.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.statsFilter=ID(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Pi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async updateRemoteRTPCapabilities(a,o){if(this.remoteCodecs=o,!this.remoteSDP)return void z.debug("[P2PConnection] cannot updateRemoteRTPCapabilities before remote SDP created, local codecs: ".concat(this.localCodecs,", codecs: ").concat(o));if(this.remoteSDP.updateRemoteCodec(a,o,this.store.codec)){let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}else z.debug("[P2PConnection] updateRemoteRTPCapabilities no need to exchange SDP.")}async establish(){try{this.peerConnection.addTransceiver("video",{direction:"recvonly"}),this.peerConnection.addTransceiver("audio",{direction:"recvonly"});let a=await this.peerConnection.createOffer();if(!a.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let o=Ah(a.sdp),c=await IW({filterRTX:!ve("USE_PUB_RTX")&&!ve("USE_SUB_RTX"),filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterVideoCodec:ve("FILTER_VIDEO_CODEC")},{useXR:this.useXR});return this.localCapabilities=yb(c),this.initialOffer=a,G0(G0({},o),{},{rtpCapabilities:c,offerSDP:a.sdp})}catch(a){throw new Ke(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,a.toString())}}async connect(a,o,c,f,m,v){try{if(!this.initialOffer)throw new Error("Cannot establish P2PConnection without initial offer.");this.remoteSDP=new class{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(F){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),X(this,"firefoxSsrcMidMap",new Map),F=zi(F);let{remoteIceParameters:Z,remoteDtlsParameters:W,candidates:K,remoteRTPCapabilities:oe,remoteSetup:ue,localCapabilities:xe,cname:Oe}=F,ke=rr.parse(`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
a=ice-lite
m=video 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:0
m=audio 9 UDP/TLS/RTP/SAVPF 0
c=IN IP4 127.0.0.1
a=rtcp:9 IN IP4 0.0.0.0
a=sendonly
a=rtcp-mux
a=rtcp-rsize
a=mid:1
`);this._rtpCapabilities=oe,this._candidates=K,this._iceParameters=Z,this._dtlsParameters=W,this._localCapabilities=xe,this.setup=ue,this.cname=Oe;let He=this.rtpCapabilities.send;for(let lt of ke.mediaDescriptions){if(lt.attributes.iceUfrag=Z.iceUfrag,lt.attributes.icePwd=Z.icePwd,lt.attributes.fingerprints=W.fingerprints,lt.attributes.candidates=K,lt.attributes.setup=ue,lt.media.mediaType==="video"&&(lt.media.fmts=He.videoCodecs.map(ut=>ut.payloadType.toString(10)),lt.attributes.payloads=He.videoCodecs,lt.attributes.extmaps=He.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:ut,ssrcGroups:ft}=Dc([{ssrcId:ple,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);lt.attributes.ssrcs=ut,lt.attributes.ssrcGroups=ft}if(lt.media.mediaType==="audio"&&(lt.media.fmts=He.audioCodecs.map(ut=>ut.payloadType.toString(10)),lt.attributes.payloads=He.audioCodecs,lt.attributes.extmaps=He.audioExtensions,Ih(lt),ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:ut,ssrcGroups:ft}=Dc([{ssrcId:2e4}],this.cname);lt.attributes.ssrcs=ut,lt.attributes.ssrcGroups=ft}}this.sessionDesc=ke,this.currentMidIndex=ke.mediaDescriptions.length-1}preloadRemoteMedia(){let F=ve("PRELOAD_MEDIA_COUNT");this.rtpCapabilities;let Z=this.candidates,W=this.dtlsParameters,K=this.iceParameters,oe=this.rtpCapabilities.send;for(let ue=1;ue<F;ue++){let xe=2*ue+2e4,Oe=2*ue+ple,{ssrcs:ke,ssrcGroups:He}=Dc([{ssrcId:xe}],this.cname),{ssrcs:lt,ssrcGroups:ut}=Dc([{ssrcId:Oe,rtx:ve("USE_SUB_RTX")?Oe+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:tI,protos:["UDP","TLS","RTP","SAVPF"],fmts:oe.videoCodecs.map(ft=>ft.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:K.iceUfrag,icePwd:K.icePwd,unrecognized:[],candidates:Z,extmaps:oe.videoExtensions,fingerprints:W.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:lt,ssrcGroups:ut,rtcpFeedbackWildcards:[],payloads:oe.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*ue)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:tI,protos:["UDP","TLS","RTP","SAVPF"],fmts:oe.audioCodecs.map(ft=>ft.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:K.iceUfrag,icePwd:K.icePwd,unrecognized:[],candidates:Z,extmaps:oe.audioExtensions,fingerprints:W.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:ke,ssrcGroups:He,rtcpFeedbackWildcards:[],payloads:oe.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*ue+1)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return rr.print(this.sessionDesc)}send(F,Z,W,K){let{ssrcs:oe,ssrcGroups:ue}=Dc(Z,this.cname,ve("SYNC_GROUP")?W:void 0),xe=this.findPreloadMediaDesc(oe);if(xe){if(Pi()&&this.firefoxSsrcMidMap.set(oe[0].ssrcId,xe.attributes.mid),K&&(K.twcc||K.remb)){let Oe=this.sessionDesc.mediaDescriptions.indexOf(xe);return this.sessionDesc.mediaDescriptions[Oe]=this.mungSendMediaDesc(xe,K),{mid:xe.attributes.mid,needExchangeSDP:!0}}return{mid:xe.attributes.mid,needExchangeSDP:!1}}{let Oe=this.findAvailableMediaIndex(F,oe),ke;return Oe===-1||Oe===1&&(gs()||Pne())||Oe===0&&ve("USE_SUB_RTX")||Lne()?(ke=this.createOrRecycleSendMedia(F,oe,ue,"sendonly",K),this.updateBundleMids()):(ke=zi(this.sessionDesc.mediaDescriptions[Oe]),ke.attributes.direction="sendonly",ke.attributes.ssrcs=oe,ke.attributes.ssrcGroups=ue,this.sessionDesc.mediaDescriptions[Oe]=this.mungSendMediaDesc(ke,K)),Pi()&&this.firefoxSsrcMidMap.set(oe[0].ssrcId,ke.attributes.mid),{mid:ke.attributes.mid,needExchangeSDP:!0}}}sendDataChannel(){let{mediaDesc:F,needExchangeSDP:Z}=this.createOrRecycleDataChannel();return this.updateBundleMids(),{mid:F.attributes.mid,needExchangeSDP:Z}}batchSend(F){let Z=F.map(oe=>{let{kind:ue,ssrcMsg:xe,mslabel:Oe}=oe;return this.send(ue,xe,Oe)}),W=[],K=!1;return Z.forEach(oe=>{let{mid:ue,needExchangeSDP:xe}=oe;xe&&(K=!0),W.push(ue)}),{mids:W,needExchangeSDP:K}}stopSending(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>W.attributes.mid&&F.indexOf(W.attributes.mid)!==-1);if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");Z.forEach(W=>{W.attributes.mid==="0"||Pi()||Lne()?W.attributes.ssrcs=[]:(W.attributes.ssrcs=[],W.attributes.direction="inactive",W.media.port="0")}),this.updateBundleMids()}mute(F){let Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F);if(!Z)throw new Error("mediaDescription not found with ".concat(F," in remote SDP when calling RemoteSDP.mute."));Z.attributes.direction="inactive"}unmute(F){let Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F);if(!Z)throw new Error("mediaDescription not found with ".concat(F," in remote SDP when calling RemoteSDP.unmute."));Z.attributes.direction="sendonly"}muteRemote(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>Tt(F).call(F,W.attributes.mid||""));if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");Z.forEach(W=>{W.attributes.direction="inactive"})}unmuteRemote(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>Tt(F).call(F,W.attributes.mid||""));if(Z.length!==F.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");Z.forEach(W=>{W.attributes.direction="recvonly"})}receive(F,Z,W,K){F.forEach((oe,ue)=>{this.createOrRecycleRecvMedia(oe,[],"recvonly",Z,W,K[ue])}),this.updateBundleMids()}stopReceiving(F){let Z=this.sessionDesc.mediaDescriptions.filter(W=>F.indexOf(W.attributes.mid)!==-1);if(Z.length!==F.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");Z.forEach(W=>{W.media.port="0",W.attributes.direction="inactive"}),this.updateBundleMids()}updateCandidates(F){let Z=this._candidates.filter(W=>W.transport==="udp");if(F===Pa.TCP){if(Z.length===0)return;if(ve("TCP_CANDIDATE_ONLY")){let W=this._candidates.filter(K=>K.transport==="tcp");Z.forEach(K=>{W.findIndex(oe=>oe.connectionAddress===K.connectionAddress)===-1&&W.push(H0(H0({},K),{},{foundation:"tcpcandidate",priority:Number(K.priority)-1+"",transport:"tcp",port:Number(K.port)+90+""}))}),this._candidates=W}else{let W=[];Z.forEach(K=>{W.push(H0(H0({},K),{},{foundation:"tcpcandidate",priority:Number(K.priority)-1+"",transport:"tcp",port:Number(K.port)+90+""}))}),this._candidates=[...Z,...W]}}else if(F===Pa.RELAY){if(Z.length!==0)return;{let W=this._candidates.filter(K=>K.transport==="tcp");W.forEach(K=>{Z.push(H0(H0({},K),{},{foundation:"udpcandidate",priority:Number(K.priority)+1+"",transport:"udp",port:Number(K.port)-90+""}))}),this._candidates=[...Z,...W]}}else Z.length===0?(this._candidates.filter(W=>W.transport==="tcp").forEach(W=>{Z.push(H0(H0({},W),{},{foundation:"udpcandidate",priority:Number(W.priority)+1+"",transport:"udp",port:Number(W.port)-90+""}))}),this._candidates=Z):this._candidates=this._candidates.filter(W=>W.transport!=="tcp");for(let W of this.sessionDesc.mediaDescriptions)W.attributes.candidates=this.candidates}restartICE(F){F=zi(F),this._iceParameters=F,this.sessionDesc.mediaDescriptions.forEach(Z=>{Z.attributes.iceUfrag=F.iceUfrag,Z.attributes.icePwd=F.icePwd})}predictReceivingMids(F){let Z=[];for(let W=0;W<F;W++)Z.push((this.currentMidIndex+W+1).toString(10));return Z}findAvailableMediaIndex(F,Z){return this.sessionDesc.mediaDescriptions.findIndex(W=>{let K=W.media.mediaType===F&&W.media.port!=="0"&&(W.attributes.direction==="sendonly"||W.attributes.direction==="sendrecv")&&W.attributes.ssrcs.length===0;if(Pi()){if(K){let oe=this.firefoxSsrcMidMap.get(Z[0].ssrcId);return!(oe||W.attributes.mid!=="0"&&W.attributes.mid!=="1")||!(!oe||oe!==W.attributes.mid)}return!1}return K})}createOrRecycleDataChannel(){for(let W of this.sessionDesc.mediaDescriptions)if(W.media.mediaType==="application")return{mediaDesc:W,needExchangeSDP:!1};this.currentMidIndex+=1;let F="".concat(this.currentMidIndex),Z={media:{mediaType:"application",port:tI,protos:["UDP","DTLS","SCTP"],fmts:["webrtc-datachannel"]},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:[],fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:[],ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:[],rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,mid:"".concat(F),sctpPort:"5000"}};return this.sessionDesc.mediaDescriptions.push(Z),{mediaDesc:Z,needExchangeSDP:!0}}createOrRecycleRecvMedia(F,Z,W,K,oe,ue){let xe=F._mediaStreamTrack.kind,Oe=this.rtpCapabilities.recv,ke=o_(xe,Oe,this.localCapabilities.send,xe===Wt.VIDEO?K:oe),He=xe===Wt.VIDEO?Oe.videoExtensions:Oe.audioExtensions;this.currentMidIndex+=1;let lt="".concat(this.currentMidIndex),ut={media:{mediaType:xe,port:tI,protos:["UDP","TLS","RTP","SAVPF"],fmts:ke.map(zt=>zt.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:He,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:Z,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:ke,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:W,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(lt)}};ut=this.mungRecvMediaDsec(ut,F,ue);let ft=this.findFirstClosedMedia(xe);if(ft){let zt=this.sessionDesc.mediaDescriptions.indexOf(ft);this.sessionDesc.mediaDescriptions[zt]=ut}else this.sessionDesc.mediaDescriptions.push(ut);return ut}updateRemoteCodec(F,Z,W){let K=[...new Set(this._rtpCapabilities.recv.videoCodecs.map(ut=>ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||"").filter(ut=>{var ft;return Tt(ft=Object.keys(VS)).call(ft,ut)}))],oe=new Set(Z);if(K.every(ut=>oe.has(ut)))return z.debug("codecs has not changed, no need to updateRemoteCodec, codecs: ".concat(Z)),!1;let ue=this._rtpCapabilities.recv.videoCodecs.filter(ut=>Z.some(ft=>{var zt;return Tt(zt=ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||"").call(zt,ft)}));if(ue.length===0)return z.debug("updateRemoteCodec failed, because cannot find matched codec, remoteCapabilities codecs: ".concat(K," codecs: ").concat(Z)),!1;let xe=[...new Set(ue.map(ut=>ut.rtpMap&&ut.rtpMap.encodingName.toLowerCase()||""))],Oe;if(z.debug("updateRemoteCodec, from ".concat(K," to ").concat(xe)),F.length===0)Oe=this.sessionDesc.mediaDescriptions.filter(ut=>ut.media.mediaType==="video"&&ut.attributes.direction==="recvonly");else if(Oe=this.sessionDesc.mediaDescriptions.filter(ut=>ut.attributes.mid&&Tt(F).call(F,ut.attributes.mid)&&ut.attributes.direction==="recvonly"),Oe.length!==F.length)return z.debug("updateRemoteCodec failed, because cannot find mids, mids: ".concat(F,", codecs: ").concat(Z)),!1;if(ve("USE_PUB_RTX")||ve("USE_SUB_RTX")){let ut=NW(ue,this.rtpCapabilities.recv.videoCodecs);ue.push(...ut)}this._rtpCapabilities.recv.videoCodecs=ue;let ke=this.localCapabilities.send,He=this.rtpCapabilities.recv,lt=o_(Wt.VIDEO,He,ke,W);return Oe.forEach(ut=>{let ft=lt.map(zt=>zt.payloadType.toString(10));z.debug("updateRemoteCodec mid: ".concat(ut.attributes.mid,", from ").concat(ut.attributes.payloads," to ").concat(lt)),ut.attributes.payloads=lt,ut.media.fmts=ft}),!0}createOrRecycleSendMedia(F,Z,W,K,oe){let ue=this.rtpCapabilities.send,xe=F===Wt.VIDEO?ue.videoCodecs:ue.audioCodecs,Oe=F===Wt.VIDEO?ue.videoExtensions:ue.audioExtensions;this.currentMidIndex+=1;let ke="".concat(this.currentMidIndex),He={media:{mediaType:F,port:tI,protos:["UDP","TLS","RTP","SAVPF"],fmts:xe.map(ut=>ut.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:Oe,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:Z,ssrcGroups:W,rtcpFeedbackWildcards:[],payloads:xe,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:K,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(ke)}};He=this.mungSendMediaDesc(He,oe);let lt=this.findFirstClosedMedia(F);if(lt){let ut=this.sessionDesc.mediaDescriptions.indexOf(lt);this.sessionDesc.mediaDescriptions[ut]=He}else this.sessionDesc.mediaDescriptions.push(He);return He}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(F=>F.media.port!=="0").map(F=>F.attributes.mid)}mungRecvMediaDsec(F,Z,W){let K=zi(F);return ND(K),F0(K,Z),OD(K,Z),xW(K),vb(K,W,this.localCapabilities.send),K}mungSendMediaDesc(F,Z){let W=zi(F);return vb(W,Z,this.localCapabilities.recv),Ih(W),W}updateRecvMedia(F,Z){let W=this.sessionDesc.mediaDescriptions.findIndex(K=>K.attributes.mid===F);if(W!==-1){let K=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[W],Z);this.sessionDesc.mediaDescriptions[W]=K}}bumpMid(F){this.currentMidIndex+=F}findFirstClosedMedia(F){return this.sessionDesc.mediaDescriptions.find(Z=>Pi()?Z.media.port==="0"&&Z.media.mediaType===F:Z.media.port==="0")}findPreloadMediaDesc(F){return this.sessionDesc.mediaDescriptions.find(Z=>{var W;return((W=Z.attributes)===null||W===void 0||(W=W.ssrcs[0])===null||W===void 0?void 0:W.ssrcId)===F[0].ssrcId})}getSSRC(F){var Z;return(Z=this.sessionDesc.mediaDescriptions.find(W=>W.attributes.mid===F))===null||Z===void 0?void 0:Z.attributes.ssrcs}}({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,remoteSetup:m,localCapabilities:this.localCapabilities,cname:v}),Array.isArray(this.remoteCodecs)&&this.remoteCodecs.length>0&&this.remoteSDP.updateRemoteCodec([],this.remoteCodecs,this.store.codec);let w=this.remoteSDP.toString(),C=rr.parse(this.initialOffer.sdp),R=C.mediaDescriptions.find(F=>F.media.mediaType==="audio");R&&Ih(R),this.useXR&&PD(C);let x=rr.print(C),L=this.logSDPExchange(x||"","offer","local","connect");this.store.descriptionStart(),await this.peerConnection.setLocalDescription({type:"offer",sdp:x}),L==null||L(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w});let U=this.peerConnection.getTransceivers()[0];if(U!=null&&U.receiver&&this.tryBindTransportEvents(U.receiver),ve("PRELOAD_MEDIA_COUNT")>0){this.remoteSDP.preloadRemoteMedia();let F=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:F});let Z=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(Z)}}catch(w){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.connect failed; ".concat(w.toString()))}}send(a,o,c){var f=this;return Ul(function*(){let m=yield Dn(f.mutex.lock("From P2PConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call P2PConnection.send before remote SDP created");let v=[];a.forEach(W=>{let K=f.peerConnection.addTransceiver(W._mediaStreamTrack,{direction:"sendonly"});v.push(K),W._updateRtpTransceiver(K)}),Pi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let w=yield Dn(f.peerConnection.createOffer()),C=f.remoteSDP.predictReceivingMids(a.length),R=f.mungSendOfferSDP(w.sdp,a,C),x=rr.parse(R),L=C.map(W=>{let K=x.mediaDescriptions.find(oe=>oe.attributes.mid===W);if(!K)throw new Error("Cannot extract ssrc from mediaDescription.");return RW(K,ve("USE_PUB_RTX"))}),U;try{U=yield L}catch(W){U=[],f.remoteSDP.receive(a,o,c,U);let K=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:K})),yield Dn(f.stopSending(C,!0)),W}f.remoteSDP.receive(a,o,c,U);let F=f.remoteSDP.toString(),Z=f.logSDPExchange(R,"offer","local","send");return yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a)),Z==null||Z(F),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:F})),v.map((W,K)=>{let oe=C[K];return{localSSRC:L[K],id:oe,transceiver:W}})}catch(v){throw v instanceof Ke?v:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.send failed; ".concat(v.toString()))}finally{m()}})()}async createDataChannels(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.createDataChannels before remote SDP created");let c=this.dataStreamChannelMap.get(a);if(c&&c.readyState==="open")z.debug("[P2PConnection] Channels are already available and can be reused directly.");else{let m=this.currentDataChannelId<1023?this.currentDataChannelId++:this.recoveredDataChannelIds.shift();if(typeof m!="number")throw new Error("create DataChannel error, because cannot get dc id");c=this.peerConnection.createDataChannel("datastream-channel",{id:m,negotiated:!0,ordered:!1,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS")}),c.binaryType="arraybuffer",this.dataStreamChannelMap.set(a,c)}o.forEach(m=>{m._updateOriginDataChannel(c)});let{needExchangeSDP:f}=this.remoteSDP.sendDataChannel();if(f){let m=this.remoteSDP.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:m});let v=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(v),z.debug("[P2PConnection] createDataChannels by exchanging SDP.")}else z.debug("[P2PConnection] createDataChannels no need to exchange SDP.");return}catch(c){throw c instanceof Ke?c:new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.createDataChannels failed; ".concat(c.toString()))}}async stopDataChannels(a){try{let o=this.dataStreamChannelMap.get(a);return o&&(o.id&&this.recoveredDataChannelIds.push(o.id),o.close()),void this.dataStreamChannelMap.delete(a)}catch(o){throw o instanceof Ke?o:new Ke(ce.DATACHANNEL_FAILED,"P2PConnection.stopDataChannels failed; ".concat(o.toString()))}}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From P2PConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(C=>a.indexOf(C.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call P2PConnection.stopSending.");f.map(C=>{var R;FD(this.id+C.mid),C.direction="inactive",(R=C.stop)===null||R===void 0||R.call(C)});let m=await this.peerConnection.createOffer(),v=this.logSDPExchange(m.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(m),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.receive ".concat(a," before remoteSDP created."));let{mid:m,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let C=this.remoteSDP.toString(),R=this.logSDPExchange(C,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:C});let x=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(x.sdp,m,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] receive ").concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(C=>C.mid===m);if(!w)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,id:m,transceiver:w}}catch(m){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(m.toString()))}}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.batchReceive before remoteSDP created.");let{mids:o,needExchangeSDP:c}=this.remoteSDP.batchSend(a);if(c){let f=this.remoteSDP.toString(),m=this.logSDPExchange(f,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:f});let v=await this.peerConnection.createAnswer();m==null||m(v.sdp||""),await this.peerConnection.setLocalDescription(v),z.debug("[".concat(this.store.clientId,"] [P2PConnection] batchReceive by exchanging SDP."))}else z.debug("[".concat(this.store.clientId,"] [P2PConnection] batchReceive no need to exchange SDP."));return o.map(f=>{let m=this.peerConnection.getTransceivers().find(v=>v.mid===f);if(!m)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:m.receiver.track,id:f,transceiver:m}})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.receive failed; ".concat(o.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.mute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteRemote failed; ".concat(o.toString()))}}async unmuteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.unmute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteRemote failed; ".concat(o.toString()))}}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async(v,w)=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new Ke(ce.EXCHANGE_SDP_FAILED,"P2PConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return Ul(function*(){let c=yield Dn(o.mutex.lock("From P2PConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let R=o.peerConnection.getConfiguration(),x=a===Pa.RELAY?"relay":"all";R.iceTransportPolicy!==x&&(z.debug("[".concat(o.store.clientId,"] restartICE change iceTransportPolicy from [").concat(R.iceTransportPolicy,"] to [").concat(x,"]")),R.iceTransportPolicy=x,o.peerConnection.setConfiguration(R))}else if(a===Pa.RELAY)return;o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let m=Ah(f.sdp),{remoteIceParameters:v}=yield m.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString(),C=o.logSDPExchange(f.sdp||"","offer","local","restartICE");o.store.descriptionStart(),yield Dn(o.peerConnection.setLocalDescription(f)),C==null||C(w),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("[".concat(o.store.clientId,"] restart ICE failed, abort operation"),f)}finally{c()}})()}close(){var a;this.peerConnection.getTransceivers().forEach(o=>{FD(this.id+o.mid)}),this.peerConnection.close(),(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.tryUnbindTransportEvents(),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy(),this.dataStreamChannelMap.clear(),this.recoveredDataChannelIds=[],this.currentDataChannelId=1}getStats(){return G0(G0({},this.statsFilter.getStats()),{},{qualityLimitationReason:this.qualityLimitationReason})}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call P2PConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let m=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(c){throw new Ke(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Pi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}async getSelectedCandidatePair(){let a=this.peerConnection.getReceivers();if(a.length>0&&a[0].transport&&a[0].transport.iceTransport&&a[0].transport.iceTransport.getSelectedCandidatePair&&a[0].transport.iceTransport.getSelectedCandidatePair()){let o=a[0].transport.iceTransport,{local:c,remote:f}=o.getSelectedCandidatePair();return{local:G0(G0({},Wf),{},{candidateType:c.type,protocol:c.protocol,address:c.address,port:c.port}),remote:G0(G0({},Wf),{},{candidateType:f.type,protocol:f.protocol,address:f.address,port:f.port})}}return this.statsFilter.getSelectedCandidatePair()}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(US(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...II.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...II.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),ve("ENABLE_ENCODED_TRANSFORM")&&Jn().supportWebRTCEncodedTransform&&(o.encodedInsertableStreams=!0),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat(O0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}tryBindTransportEvents(a){let o=a.transport;if(o){this.transportEventReceiver=a,o.onstatechange=()=>{var f;o!=null&&o.state&&((f=this.onDTLSTransportStateChange)===null||f===void 0||f.call(this,o.state))},o.onerror=f=>{var m;(m=this.onDTLSTransportError)===null||m===void 0||m.call(this,"error"in f?f.error:f)};let c=o.iceTransport;c&&(c.onstatechange=()=>{let f=o==null?void 0:o.iceTransport.state;var m;f&&((m=this.onICETransportStateChange)===null||m===void 0||m.call(this,f))},c.getSelectedCandidatePair&&(c.onselectedcandidatepairchange=()=>{if(c.getSelectedCandidatePair()){let{local:f,remote:m}=c.getSelectedCandidatePair();z.info("[".concat(this.store.clientId,"] [pc-").concat(this.store.p2pId,"] selectedcandidatepairchange: local ").concat(JSON.stringify({candidateType:f.type,protocol:f.protocol}),", remote ").concat(JSON.stringify({candidateType:m.type,protocol:m.protocol,address:m.address,port:m.port})," )"))}}))}}tryUnbindTransportEvents(){this.transportEventReceiver&&this.transportEventReceiver.transport&&(this.transportEventReceiver.transport.onstatechange=null,this.transportEventReceiver.transport.onerror=null,this.transportEventReceiver.transport.iceTransport&&(this.transportEventReceiver.transport.iceTransport.onstatechange=null))}async updateRtpSenderEncodings(a,o){var c,f;if(o||(o=this.peerConnection.getSenders().find(W=>W.track===a._mediaStreamTrack)),!o)return z.warn("[".concat(a.getTrackId(),"] no rtpSender found}"));if(this.isVP8Simulcast(a))return z.warn("[updateRtpSenderEncodings] Track is VP8 simulcast, please apply simulcast encodings");if(!Jn().supportSetRtpSenderParameters)return z.warn("[updateRtpSenderEncodings] Browser not support set rtp-sender parameters");let m={},v={};switch(a._optimizationMode){case"motion":m.degradationPreference="maintain-framerate";break;case"detail":m.degradationPreference="maintain-resolution";break;case"balanced":m.degradationPreference="balanced"}let w=function(W,K){return W.getTransceivers().find(oe=>oe.sender.track===K||oe.receiver.track===K)}(this.peerConnection,a._mediaStreamTrack),C=ZIe(a);if(N4e(a)&&w&&o&&C&&this.getLocalVideoStats&&Tt(c=["vp8","vp9"]).call(c,this.store.codec)){var R;let W=m.degradationPreference||(Tt(R=a._hints).call(R,Hi.CUSTOM_TRACK)?ve("CUSTOM_ADAPTATION_DEFAULT_MODE"):"maintain-framerate");(function(K,oe,ue,xe,Oe,ke){if(FD(K),xe!=="balanced"&&xe!=="maintain-framerate"&&xe!=="maintain-resolution")return;let He=-1;vle(K,oe);let lt=window.setInterval(()=>{let ft=UD.get(K);if(!ve("ENABLE_AG_ADAPTATION")||!ft)return void FD(K);let zt=ke();if(zt.sendPackets>0&&zt.OutgoingAvailableBandwidth>0){if(He===-1)return void(He=Date.now());if(Date.now()-He<1e3)return;let $n=zt.sendFrameRate,hi=zt.OutgoingAvailableBandwidth,[Gi,Ur]=I4e(K,$n,hi,ft.adaptationConfig,oe,xe);Ur&&(ue.qualityLimitationReason=Ur),Gi&&ft.adaptationConfig.scale!==Gi.scale&&(z.debug("[".concat(K,"] applyAdaptation: ").concat(ue.qualityLimitationReason,`
sendFps `).concat($n,", bwe ").concat(hi,", switch from ").concat(ft.adaptationConfig.scale," to ").concat(Gi.scale," ")),ft.adaptationConfig=DW(DW({},ft.adaptationConfig),Gi),Oe(Gi))}},ve("CHECK_LOCAL_STATS_INTERVAL")),ut=DW({},oe);UD.set(K,{timer:lt,adaptationConfig:ut,originConfig:oe,adaptationFunc:Oe}),z.debug("[".concat(K,"] start adaptation, originConfig: ").concat(JSON.stringify(oe),", degradationPreference: ").concat(xe))})(this.id+w.mid,C,this,W,K=>{o&&this.updateAdaptation(o,K)},this.getLocalVideoStats.bind(this))}if(a._encoderConfig){var x;let{bitrateMax:W,frameRate:K,scaleResolutionDownBy:oe}=a._encoderConfig;W&&(v.maxBitrate=1e3*W),(Tt(x=a._hints).call(x,Hi.LOW_STREAM)||a.isUseScaleResolutionDownBy)&&(K&&(v.maxFramerate=rl(K)),oe&&oe>=1&&(v.scaleResolutionDownBy=oe))}let{maxFramerate:L}=ve("ENCODER_CONFIG_LIMIT");if(L&&typeof L=="number"&&(v.maxFramerate=v.maxFramerate?Math.min(v.maxFramerate,L):L),ve("DSCP_TYPE")&&C0()){var U;let W=ve("DSCP_TYPE");Tt(U=["very-low","low","medium","high"]).call(U,W)&&(v.networkPriority=W)}let F=o.getParameters(),Z=(f=F.encodings)===null||f===void 0?void 0:f[0];Pi()&&!Z&&(m.encodings=[v]),Z&&Object.assign(Z,v),Object.assign(F,m),z.debug("[".concat(a.getTrackId(),"] updateRtpSenderEncodings: ").concat(JSON.stringify(F.encodings))),await o.setParameters(F)}async updateAdaptation(a,o){var c,f;if(!a)return z.debug("[updateAdaptation] no rtpSender found");if(!Jn().supportSetRtpSenderParameters)return z.debug("[updateAdaptation] Browser not support set rtp-sender parameters");let m={},{bitrateMax:v,frameRate:w,scaleResolutionDownBy:C}=o;v&&(m.maxBitrate=1e3*v),w&&(m.maxFramerate=rl(w)),C&&C>=1&&Tt(c=["vp8","vp9"]).call(c,this.store.codec)&&(m.scaleResolutionDownBy=C);let R=a.getParameters(),x=(f=R.encodings)===null||f===void 0?void 0:f[0];x&&Object.assign(x,m),Object.assign(R,{});try{await a.setParameters(R),z.debug("[updateAdaptation] updateRtpSenderEncodings: ".concat(JSON.stringify(R.encodings)))}catch(L){!("transport"in a)||a.transport&&a.transport.state==="connected"?this.peerConnectionState!=="connected"?z.debug("[updateAdaptation] peerConnection not connected}"):z.debug("[updateAdaptation] updateRtpSenderEncodings failed",L):z.debug("[updateAdaptation] rtpSender transport not connected}")}}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let c=0;c<a.length;c++){let f=a[c],m=o[c];m instanceof ki&&!this.isVP8Simulcast(m)&&await this.updateRtpSenderEncodings(m,f.sender)}}catch{z.debug("[".concat(this.store.clientId,"] Apply RTPSendEncodings failed."))}}mungSendOfferSDP(a,o,c){let f=rr.parse(a);return o.forEach((m,v)=>{let w=c[v],C=f.mediaDescriptions.find(R=>R.attributes.mid===w);C&&(F0(C,m),AW(C,m,this.store.codec))}),rr.print(f)}mungReceiveAnswerSDP(a,o,c){let f=rr.parse(a),m=f.mediaDescriptions.find(v=>v.attributes.mid===o);return m&&(c===Wt.AUDIO&&m.media.mediaType==="audio"&&Ih(m),this.useXR&&PD(f)),rr.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let C=0;C<a.length;C++){var c,f,m,v,w;let R=a[C],x=o[C];if(x instanceof ki&&!Tt(c=x._hints).call(c,Hi.LOW_STREAM)&&(f=x._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((m=x._encoderConfig)===null||m===void 0?void 0:m.bitrateMax)>200&&(v=x._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=x._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(x._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Pi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof ki&&this.isVP8Simulcast(f)){let m=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let C=m.sender.getParameters();await m.sender.setParameters(Object.assign(C,v))}}}isVP8Simulcast(a){var o,c,f,m,v;return!!(a instanceof ki&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(m=a._scalabilityMode)!==null&&m!==void 0&&m.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("[".concat(this.store.clientId,"] exchanging ").concat(c," ").concat(o," SDP during P2PConnection.").concat(f,`
`),a),o==="offer"?m=>{this.logSDPExchange(m,"answer",c==="local"?"remote":"local",f)}:void 0}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=II.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(ri.prototype,"updateRemoteRTPCapabilities",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"updateRemoteRTPCapabilities"),ri.prototype),vt(ri.prototype,"connect",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"connect"),ri.prototype),vt(ri.prototype,"createDataChannels",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"createDataChannels"),ri.prototype),vt(ri.prototype,"receive",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"receive"),ri.prototype),vt(ri.prototype,"batchReceive",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"batchReceive"),ri.prototype),vt(ri.prototype,"stopReceiving",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"stopReceiving"),ri.prototype),vt(ri.prototype,"muteRemote",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"muteRemote"),ri.prototype),vt(ri.prototype,"unmuteRemote",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"unmuteRemote"),ri.prototype),vt(ri.prototype,"muteLocal",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"muteLocal"),ri.prototype),vt(ri.prototype,"unmuteLocal",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"unmuteLocal"),ri.prototype),vt(ri.prototype,"close",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"close"),ri.prototype),vt(ri.prototype,"updateEncoderConfig",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"updateEncoderConfig"),ri.prototype),vt(ri.prototype,"updateSendParameters",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"updateSendParameters"),ri.prototype),vt(ri.prototype,"replaceTrack",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"replaceTrack"),ri.prototype),vt(ri.prototype,"updateAdaptation",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"updateAdaptation"),ri.prototype),vt(ri.prototype,"getRemoteSSRC",[sl],Object.getOwnPropertyDescriptor(ri.prototype,"getRemoteSSRC"),ri.prototype),ri);function sl(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("From P2PConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}function wle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Sle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?wle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):wle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let ble=`v=0
o=- 0 0 IN IP4 127.0.0.1
s=AgoraGateway
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS
a=ice-lite
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 127.0.0.1
a=mid:0
`,BD="9",kW=2e4,MW=4e4;class O4e{get localCapabilities(){return zi(this._localCapabilities)}get rtpCapabilities(){return zi(this._rtpCapabilities)}get candidates(){return zi(this._candidates)}get iceParameters(){return zi(this._iceParameters)}get dtlsParameters(){return zi(this._dtlsParameters)}constructor(a){X(this,"sessionDesc",void 0),X(this,"_localCapabilities",void 0),X(this,"_rtpCapabilities",void 0),X(this,"_candidates",void 0),X(this,"_iceParameters",void 0),X(this,"_dtlsParameters",void 0),X(this,"setup",void 0),X(this,"currentMidIndex",void 0),X(this,"cname",void 0),X(this,"firefoxSsrcMidMap",new Map),a=zi(a);let{remoteIceParameters:o,remoteDtlsParameters:c,candidates:f,remoteRTPCapabilities:m,remoteSetup:v,localCapabilities:w,cname:C}=a,R=rr.parse(ble);this._rtpCapabilities=m,this._candidates=f,this._iceParameters=o,this._dtlsParameters=c,this._localCapabilities=w,this.setup=v,this.cname=C;let x=this.rtpCapabilities.send;for(let L of R.mediaDescriptions){if(L.attributes.iceUfrag=o.iceUfrag,L.attributes.icePwd=o.icePwd,L.attributes.fingerprints=c.fingerprints,L.attributes.candidates=f,L.attributes.setup=v,L.media.mediaType==="application"&&(L.attributes.sctpPort="5000"),L.media.mediaType==="video"&&(L.media.fmts=x.videoCodecs.map(U=>U.payloadType.toString(10)),L.attributes.payloads=x.videoCodecs,L.attributes.extmaps=x.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:U,ssrcGroups:F}=Dc([{ssrcId:MW,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);L.attributes.ssrcs=U,L.attributes.ssrcGroups=F}if(L.media.mediaType==="audio"&&(L.media.fmts=x.audioCodecs.map(U=>U.payloadType.toString(10)),L.attributes.payloads=x.audioCodecs,L.attributes.extmaps=x.audioExtensions,Ih(L),ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:U,ssrcGroups:F}=Dc([{ssrcId:kW}],this.cname);L.attributes.ssrcs=U,L.attributes.ssrcGroups=F}}this.sessionDesc=R,this.currentMidIndex=R.mediaDescriptions.length-1}updateRemoteRTPCapabilities(a){let o=rr.parse(ble);this._rtpCapabilities=a;let c=this.rtpCapabilities.send;for(let f of o.mediaDescriptions){if(f.attributes.iceUfrag=this._iceParameters.iceUfrag,f.attributes.icePwd=this._iceParameters.icePwd,f.attributes.fingerprints=this._dtlsParameters.fingerprints,f.attributes.candidates=this._candidates,f.attributes.setup=this.setup,f.media.mediaType==="application"&&(f.attributes.sctpPort="5000"),f.media.mediaType==="video"&&(f.media.fmts=c.videoCodecs.map(m=>m.payloadType.toString(10)),f.attributes.payloads=c.videoCodecs,f.attributes.extmaps=c.videoExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:m,ssrcGroups:v}=Dc([{ssrcId:MW,rtx:ve("USE_SUB_RTX")?40001:void 0}],this.cname);f.attributes.ssrcs=m,f.attributes.ssrcGroups=v}if(f.media.mediaType==="audio"&&(f.media.fmts=c.audioCodecs.map(m=>m.payloadType.toString(10)),f.attributes.payloads=c.audioCodecs,f.attributes.extmaps=c.audioExtensions,ve("PRELOAD_MEDIA_COUNT")>0)){let{ssrcs:m,ssrcGroups:v}=Dc([{ssrcId:kW}],this.cname);f.attributes.ssrcs=m,f.attributes.ssrcGroups=v}}this.sessionDesc=o,this.currentMidIndex=o.mediaDescriptions.length-1}preloadRemoteMedia(a){this.rtpCapabilities;let o=this.candidates,c=this.dtlsParameters,f=this.iceParameters,m=this.rtpCapabilities.send;for(let v=1;v<a;v++){let w=2*v+kW,C=2*v+MW,{ssrcs:R,ssrcGroups:x}=Dc([{ssrcId:w}],this.cname),{ssrcs:L,ssrcGroups:U}=Dc([{ssrcId:C,rtx:ve("USE_SUB_RTX")?C+1:void 0}],this.cname);this.sessionDesc.mediaDescriptions.push({media:{mediaType:"video",port:BD,protos:["UDP","TLS","RTP","SAVPF"],fmts:m.videoCodecs.map(F=>F.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:f.iceUfrag,icePwd:f.icePwd,unrecognized:[],candidates:o,extmaps:m.videoExtensions,fingerprints:c.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:L,ssrcGroups:U,rtcpFeedbackWildcards:[],payloads:m.videoCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*v-1)}}),this.sessionDesc.mediaDescriptions.push({media:{mediaType:"audio",port:BD,protos:["UDP","TLS","RTP","SAVPF"],fmts:m.audioCodecs.map(F=>F.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:f.iceUfrag,icePwd:f.icePwd,unrecognized:[],candidates:o,extmaps:m.audioExtensions,fingerprints:c.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:R,ssrcGroups:x,rtcpFeedbackWildcards:[],payloads:m.audioCodecs,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:"sendonly",rtcpMux:!0,rtcpRsize:!0,mid:"".concat(2*v)}}),this.currentMidIndex+=2}this.updateBundleMids()}toString(){return rr.print(this.sessionDesc)}send(a,o,c,f){let{ssrcs:m,ssrcGroups:v}=Dc(o,this.cname,ve("SYNC_GROUP")?c:void 0),w=this.findPreloadMediaDesc(m);if(w){if(Pi()&&this.firefoxSsrcMidMap.set(m[0].ssrcId,w.attributes.mid),f&&(f.twcc||f.remb)){let C=this.sessionDesc.mediaDescriptions.indexOf(w);return this.sessionDesc.mediaDescriptions[C]=this.mungSendMediaDesc(w,f),{mid:w.attributes.mid,needExchangeSDP:!0}}return{mid:w.attributes.mid,needExchangeSDP:!1}}{let C=this.findAvailableMediaIndex(a,m),R;return C===-1||gs()||ra()||Pne()||C===0&&ve("USE_SUB_RTX")?(R=this.createOrRecycleSendMedia(a,m,v,"sendonly",f),this.updateBundleMids()):(R=zi(this.sessionDesc.mediaDescriptions[C]),R.attributes.direction="sendonly",R.attributes.ssrcs=m,R.attributes.ssrcGroups=v,this.sessionDesc.mediaDescriptions[C]=this.mungSendMediaDesc(R,f)),Pi()&&this.firefoxSsrcMidMap.set(m[0].ssrcId,R.attributes.mid),{mid:R.attributes.mid,needExchangeSDP:!0}}}batchSend(a){let o=a.map(m=>{let{kind:v,ssrcMsg:w,mslabel:C}=m;return this.send(v,w,C)}),c=[],f=!1;return o.forEach(m=>{let{mid:v,needExchangeSDP:w}=m;w&&(f=!0),c.push(v)}),{mids:c,needExchangeSDP:f}}stopSending(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>c.attributes.mid&&a.indexOf(c.attributes.mid)!==-1);if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.stopSending.");o.forEach(c=>{c.attributes.mid==="0"||Pi()||gs()||ra()?c.attributes.ssrcs=[]:(c.attributes.ssrcs=[],c.attributes.direction="inactive",c.media.port="0")}),this.updateBundleMids()}mute(a){let o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a);if(!o)throw new Error("mediaDescription not found with ".concat(a," in remote SDP when calling RemoteSDP.mute."));o.attributes.direction="inactive"}unmute(a){let o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a);if(!o)throw new Error("mediaDescription not found with ".concat(a," in remote SDP when calling RemoteSDP.unmute."));o.attributes.direction="sendonly"}muteRemote(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>Tt(a).call(a,c.attributes.mid||""));if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");o.forEach(c=>{c.attributes.direction="inactive"})}unmuteRemote(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>Tt(a).call(a,c.attributes.mid||""));if(o.length!==a.length)throw new Error("mediaDescriptions' length doesn't match mids' length when calling RemoteSDP.muteRemote.");o.forEach(c=>{c.attributes.direction="recvonly"})}receive(a,o,c,f){a.forEach((m,v)=>{this.createOrRecycleRecvMedia(m,[],"recvonly",o,c,f[v])}),this.updateBundleMids()}stopReceiving(a){let o=this.sessionDesc.mediaDescriptions.filter(c=>a.indexOf(c.attributes.mid)!==-1);if(o.length!==a.length)throw new Error("MediaDescriptions' length doesn't match mids's length when calling RemoteSDP.receive.");o.forEach(c=>{c.media.port="0",c.attributes.direction="inactive"}),this.updateBundleMids()}updateCandidates(a){a===Pa.TCP?this._candidates.forEach(o=>{this._candidates.findIndex(c=>c.transport==="tcp"&&c.connectionAddress===o.connectionAddress&&c.port===o.port)===-1&&this._candidates.push(Sle(Sle({},o),{},{foundation:"tcpcandidate",priority:Number(o.priority)-1+"",transport:"tcp",port:Number(o.port)+90+""}))}):this._candidates=this._candidates.filter(o=>o.transport!=="tcp");for(let o of this.sessionDesc.mediaDescriptions)o.attributes.candidates=this.candidates}restartICE(a){a=zi(a),this._iceParameters=a,this.sessionDesc.mediaDescriptions.forEach(o=>{o.attributes.iceUfrag=a.iceUfrag,o.attributes.icePwd=a.icePwd})}predictReceivingMids(a){let o=[];for(let c=0;c<a;c++)o.push((this.currentMidIndex+c+1).toString(10));return o}findAvailableMediaIndex(a,o){return this.sessionDesc.mediaDescriptions.findIndex(c=>{let f=c.media.mediaType===a&&c.media.port!=="0"&&(c.attributes.direction==="sendonly"||c.attributes.direction==="sendrecv")&&c.attributes.ssrcs.length===0;if(Pi()){if(f){let m=this.firefoxSsrcMidMap.get(o[0].ssrcId);return!(m||c.attributes.mid!=="0"&&c.attributes.mid!=="1")||!(!m||m!==c.attributes.mid)}return!1}return f})}createOrRecycleRecvMedia(a,o,c,f,m,v){let w=a._mediaStreamTrack.kind,C=this.rtpCapabilities.recv,R=o_(w,C,this.localCapabilities.send,w===Wt.VIDEO?f:m),x=w===Wt.VIDEO?C.videoExtensions:C.audioExtensions;this.currentMidIndex+=1;let L="".concat(this.currentMidIndex),U={media:{mediaType:w,port:BD,protos:["UDP","TLS","RTP","SAVPF"],fmts:R.map(Z=>Z.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:x,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:o,ssrcGroups:[],rtcpFeedbackWildcards:[],payloads:R,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:c,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(L)}};U=this.mungRecvMediaDsec(U,a,v);let F=this.findFirstClosedMedia(w);if(F){let Z=this.sessionDesc.mediaDescriptions.indexOf(F);this.sessionDesc.mediaDescriptions[Z]=U}else this.sessionDesc.mediaDescriptions.push(U);return U}updateRemoteCodec(a,o,c){let f=[...new Set(this._rtpCapabilities.recv.videoCodecs.map(U=>U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||"").filter(U=>{var F;return Tt(F=Object.keys(VS)).call(F,U)}))],m=new Set(o);if(f.every(U=>m.has(U)))return z.debug("codecs has not changed, no need to updateRemoteCodec, codecs: ".concat(o)),!1;let v=this._rtpCapabilities.recv.videoCodecs.filter(U=>o.some(F=>{var Z;return Tt(Z=U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||"").call(Z,F)}));if(v.length===0)return z.debug("updateRemoteCodec failed, because cannot find matched codec, remoteCapabilities codecs: ".concat(f," codecs: ").concat(o)),!1;let w=[...new Set(v.map(U=>U.rtpMap&&U.rtpMap.encodingName.toLowerCase()||""))],C;if(z.debug("updateRemoteCodec, from ".concat(f," to ").concat(w)),a.length===0)C=this.sessionDesc.mediaDescriptions.filter(U=>U.media.mediaType==="video"&&U.attributes.direction==="recvonly");else if(C=this.sessionDesc.mediaDescriptions.filter(U=>U.attributes.mid&&Tt(a).call(a,U.attributes.mid)&&U.attributes.direction==="recvonly"),C.length!==a.length)return z.debug("updateRemoteCodec failed, because cannot find mids, mids: ".concat(a,", codecs: ").concat(o)),!1;this._rtpCapabilities.recv.videoCodecs=v;let R=this.localCapabilities.send,x=this.rtpCapabilities.recv,L=o_(Wt.VIDEO,x,R,c);return C.forEach(U=>{let F=L.map(Z=>Z.payloadType.toString(10));z.debug("updateRemoteCodec mid: ".concat(U.attributes.mid,", from ").concat(U.attributes.payloads," to ").concat(L)),U.attributes.payloads=L,U.media.fmts=F}),!0}createOrRecycleSendMedia(a,o,c,f,m){let v=this.rtpCapabilities.send,w=a===Wt.VIDEO?v.videoCodecs:v.audioCodecs,C=a===Wt.VIDEO?v.videoExtensions:v.audioExtensions;this.currentMidIndex+=1;let R="".concat(this.currentMidIndex),x={media:{mediaType:a,port:BD,protos:["UDP","TLS","RTP","SAVPF"],fmts:w.map(U=>U.payloadType.toString(10))},connections:[{nettype:"IN",addrtype:"IP4",address:"127.0.0.1"}],bandwidths:[],attributes:{iceUfrag:this.iceParameters.iceUfrag,icePwd:this.iceParameters.icePwd,unrecognized:[],candidates:this.candidates,extmaps:C,fingerprints:this.dtlsParameters.fingerprints,imageattr:[],msids:[],remoteCandidatesList:[],rids:[],ssrcs:o,ssrcGroups:c,rtcpFeedbackWildcards:[],payloads:w,rtcp:{port:"9",netType:"IN",addressType:"IP4",address:"0.0.0.0"},setup:this.setup,direction:f,rtcpMux:!0,rtcpRsize:!0,mid:"".concat(R)}};x=this.mungSendMediaDesc(x,m);let L=this.findFirstClosedMedia(a);if(L){let U=this.sessionDesc.mediaDescriptions.indexOf(L);this.sessionDesc.mediaDescriptions[U]=x}else this.sessionDesc.mediaDescriptions.push(x);return x}updateBundleMids(){this.sessionDesc.attributes.groups[0].identificationTag=this.sessionDesc.mediaDescriptions.filter(a=>a.media.port!=="0").map(a=>a.attributes.mid)}mungRecvMediaDsec(a,o,c){let f=zi(a);return ND(f),F0(f,o),OD(f,o),xW(f),vb(f,c,this.localCapabilities.send),f}mungSendMediaDesc(a,o){let c=zi(a);return vb(c,o,this.localCapabilities.recv),Ih(c),c}updateRecvMedia(a,o){let c=this.sessionDesc.mediaDescriptions.findIndex(f=>f.attributes.mid===a);if(c!==-1){let f=this.mungRecvMediaDsec(this.sessionDesc.mediaDescriptions[c],o);this.sessionDesc.mediaDescriptions[c]=f}}bumpMid(a){this.currentMidIndex+=a}findFirstClosedMedia(a){return this.sessionDesc.mediaDescriptions.find(o=>Pi()?o.media.port==="0"&&o.media.mediaType===a:o.media.port==="0")}findPreloadMediaDesc(a){return this.sessionDesc.mediaDescriptions.find(o=>{var c;return((c=o.attributes)===null||c===void 0||(c=c.ssrcs[0])===null||c===void 0?void 0:c.ssrcId)===a[0].ssrcId})}getSSRC(a){var o;return(o=this.sessionDesc.mediaDescriptions.find(c=>c.attributes.mid===a))===null||o===void 0?void 0:o.attributes.ssrcs}}var si;function Cle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function VD(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Cle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Cle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let P4e=(si=class Kk extends $8{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get localCodecs(){let a;return this.localCapabilities&&(a=yb(this.localCapabilities)),[...new Set(a&&a.send.videoCodecs.map(o=>o.rtpMap&&o.rtpMap.encodingName.toLowerCase()||"").filter(o=>{var c;return Tt(c=Object.keys(VS)).call(c,o)}))]}constructor(a,o,c){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"remoteSDP",void 0),X(this,"initialOffer",void 0),X(this,"transportEventReceiver",void 0),X(this,"statsFilter",void 0),X(this,"useXR",ve("USE_XR")),X(this,"localCapabilities",void 0),X(this,"localCandidateCount",0),X(this,"allCandidatesReceived",!1),X(this,"remoteCodecs",void 0),X(this,"dataStreamChannelMap",new Map),X(this,"establishPromise",void 0),X(this,"mutex",new Ts("NVExtentionsConnection-mutex")),X(this,"rtcMedia",void 0),this.store=o,this.peerConnection=c,this.statsFilter=ID(this.peerConnection,ve("STATS_UPDATE_INTERVAL"),void 0,Pi()?1200:void 0),this.bindPCEvents(),this.bindStatsEvents(),this.store.p2pId=this.store.p2pId+1,this.establishPromise=this.establish()}async establish(a){try{let o=await this.peerConnection.createOffer();if(!o.sdp)throw new Error("Cannot get initialOffer.sdp when trying to establish PeerConnection.");let c=Ah(o.sdp),f=await IW({filterRTX:!ve("USE_PUB_RTX")&&!ve("USE_SUB_RTX"),filterVideoFec:ve("FILTER_VIDEO_FEC"),filterAudioFec:ve("FILTER_AUDIO_FEC"),filterVideoCodec:ve("FILTER_VIDEO_CODEC")},{useXR:this.useXR});return this.localCapabilities=f,this.initialOffer=o,VD(VD({},c),{},{rtpCapabilities:f,offerSDP:o.sdp})}catch(o){throw new De(ce.GET_LOCAL_CONNECTION_PARAMS_FAILED,o.toString())}}async connect(a,o,c,f,m,v){try{if(!this.initialOffer)throw new Error("Cannot establish NVConnection without initial offer.");this.remoteSDP=new O4e({remoteIceParameters:a,remoteDtlsParameters:o,candidates:c,remoteRTPCapabilities:f,remoteSetup:m,localCapabilities:yb(this.localCapabilities),cname:v});let w=this.remoteSDP.toString(),C=rr.parse(this.initialOffer.sdp),R=C.mediaDescriptions.find(U=>U.media.mediaType==="audio");R&&Ih(R),this.useXR&&PD(C);let x=rr.print(C),L=this.logSDPExchange(x||"","offer","local","connect");await this.peerConnection.setLocalDescription({type:"offer",sdp:x}),L==null||L(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(w){throw new De(ce.EXCHANGE_SDP_FAILED,"NV.connect failed; ".concat(w.toString()))}}async updateRemoteRTPCapabilities(a,o){if(this.remoteCodecs=o,!this.remoteSDP)return void z.debug("[P2PConnection] cannot updateRemoteRTPCapabilities before remote SDP created, local codecs: ".concat(this.localCodecs,", codecs: ").concat(o));if(this.remoteSDP.updateRemoteCodec(a,o,this.store.codec)){let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}else z.debug("[P2PConnection] updateRemoteRTPCapabilities no need to exchange SDP.")}async updateRemoteConnect(a){var o,c,f,m;(o=this.remoteSDP)===null||o===void 0||o.updateRemoteRTPCapabilities(a),Array.isArray(this.remoteCodecs)&&this.remoteCodecs.length>0&&((m=this.remoteSDP)===null||m===void 0||m.updateRemoteCodec([],this.remoteCodecs,this.store.codec)),(c=this.remoteSDP)===null||c===void 0||c.preloadRemoteMedia(2);let v=(f=this.remoteSDP)===null||f===void 0?void 0:f.toString();await this.peerConnection.setRemoteDescription({type:"offer",sdp:v});let w=await this.peerConnection.createAnswer();await this.peerConnection.setLocalDescription(w),z.debug("[NVExtentionsConnection] updateRemoteRTPCapabilities by exchanging SDP.")}send(a,o,c){var f=this;return Ul(function*(){let m=yield Dn(f.mutex.lock("From NVExtentionsConnection.send"));try{if(!f.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.send before remote SDP created");let v=[];a.forEach(W=>{let K=f.peerConnection.addTransceiver(W._mediaStreamTrack,{direction:"sendonly"});v.push(K)}),Pi()&&ve("SIMULCAST")===!0&&(yield Dn(f.applySimulcastForFirefox(v,a)));let w=yield Dn(f.peerConnection.createOffer()),C=f.remoteSDP.predictReceivingMids(a.length),R=f.mungSendOfferSDP(w.sdp,a,C),x=rr.parse(R),L=C.map(W=>{let K=x.mediaDescriptions.find(oe=>oe.attributes.mid===W);if(!K)throw new Error("Cannot extract ssrc from mediaDescription.");return RW(K,ve("USE_PUB_RTX"))}),U;try{U=yield L}catch(W){U=[],f.remoteSDP.receive(a,o,c,U);let K=f.remoteSDP.toString();throw yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:K})),yield Dn(f.stopSending(C,!0)),W}f.remoteSDP.receive(a,o,c,U);let F=f.remoteSDP.toString(),Z=f.logSDPExchange(R,"offer","local","send");return yield Dn(f.peerConnection.setLocalDescription({type:"offer",sdp:R})),yield Dn(f.applySimulcastEncodings(v,a)),yield Dn(f.applySendEncodings(v,a)),Z==null||Z(F),yield Dn(f.peerConnection.setRemoteDescription({type:"answer",sdp:F})),v.map((W,K)=>{let oe=C[K];return{localSSRC:L[K],id:oe,transceiver:W}})}catch(v){throw v instanceof De?v:new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.send failed; ".concat(v.toString()))}finally{m()}})()}async stopSending(a,o){let c=o?void 0:await this.mutex.lock("From NVExtentionsConnection.stopSending");try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.stopSending before remote SDP created");let f=this.peerConnection.getTransceivers().filter(C=>a.indexOf(C.mid)!==-1);if(f.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length when trying to call NVExtentionsConnection.stopSending.");f.map(C=>{var R;C.direction="inactive",(R=C.stop)===null||R===void 0||R.call(C)});let m=await this.peerConnection.createOffer(),v=this.logSDPExchange(m.sdp||"","offer","local","stopSending");await this.peerConnection.setLocalDescription(m),this.remoteSDP.stopReceiving(a);let w=this.remoteSDP.toString();v==null||v(w),await this.peerConnection.setRemoteDescription({type:"answer",sdp:w})}catch(f){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.stopSending failed; ".concat(f.toString()))}finally{c&&c()}}async createDataChannels(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.createDataChannels before remote SDP created");let c=this.dataStreamChannelMap.get(a);return c&&c.readyState==="open"?z.debug("[P2PConnection] Channels are already available and can be reused directly."):(c=this.peerConnection.createDataChannel("datastream-channel",{ordered:!1,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS")}),c.binaryType="arraybuffer",this.dataStreamChannelMap.set(a,c)),void o.forEach(f=>{f._updateOriginDataChannel(c)})}catch(c){throw c instanceof De?c:new De(ce.DATACHANNEL_FAILED,"NVExtentionsConnection.createDataChannels failed; ".concat(c.toString()))}}async stopDataChannels(a){try{let o=this.dataStreamChannelMap.get(a);return o==null||o.close(),void this.dataStreamChannelMap.delete(a)}catch(o){throw o instanceof De?o:new De(ce.DATACHANNEL_FAILED,"NVExtentionsConnection.stopDataChannels failed; ".concat(o.toString()))}}async receive(a,o,c,f){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.receive ".concat(a," before remoteSDP created."));let{mid:m,needExchangeSDP:v}=this.remoteSDP.send(a,o,c,f);if(v){let C=this.remoteSDP.toString(),R=this.logSDPExchange(C,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:C});let x=await this.peerConnection.createAnswer(),L=this.mungReceiveAnswerSDP(x.sdp,m,a);R==null||R(L||""),await this.peerConnection.setLocalDescription({type:"answer",sdp:L}),z.debug("[NVExtentionsConnection] receive ".concat(a," by exchanging SDP."))}else z.debug("[NVExtentionsConnection] receive ".concat(a," no need to exchange SDP."));let w=this.peerConnection.getTransceivers().find(C=>C.mid===m);if(!w)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:w.receiver.track,id:m}}catch(m){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.receive failed; ".concat(m.toString()))}}async batchReceive(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.batchReceive before remoteSDP created.");let{mids:o,needExchangeSDP:c}=this.remoteSDP.batchSend(a);if(c){let f=this.remoteSDP.toString(),m=this.logSDPExchange(f,"offer","remote","receive");await this.peerConnection.setRemoteDescription({type:"offer",sdp:f});let v=await this.peerConnection.createAnswer();m==null||m(v.sdp||""),await this.peerConnection.setLocalDescription(v),z.debug("[NVExtentionsConnection] batchReceive by exchanging SDP.")}else z.debug("[NVExtentionsConnection] batchReceive no need to exchange SDP.");return o.map(f=>{let m=this.peerConnection.getTransceivers().find(v=>v.mid===f);if(!m)throw new Error("Cannot get transceiver after setLocalDescription.");return{track:m.receiver.track,id:f}})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.receive failed; ".concat(o.toString()))}}async stopReceiving(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.stopReceiving before remote SDP created.");this.remoteSDP.stopSending(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","stopReceiving");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection stopReceiving failed; ".concat(o.toString()))}}async muteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.muteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.mute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","muteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.muteRemote failed; ".concat(o.toString()))}}async unmuteRemote(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.unmuteRemote mid=".concat(a," before remote SDP created."));this.remoteSDP.unmute(a);let o=this.remoteSDP.toString(),c=this.logSDPExchange(o,"offer","remote","unmuteRemote");await this.peerConnection.setRemoteDescription({type:"offer",sdp:o});let f=await this.peerConnection.createAnswer();c==null||c(f.sdp||""),await this.peerConnection.setLocalDescription(f)}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.unmuteRemote failed; ".concat(o.toString()))}}async muteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.muteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(v=>{v.direction="inactive"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","muteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.muteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.muteLocal failed; ".concat(o.toString()))}}async unmuteLocal(a){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.unmuteLocal before remote SDP created.");let o=this.peerConnection.getTransceivers().filter(v=>v.mid&&a.indexOf(v.mid)!==-1);if(o.length!==a.length)throw new Error("Transceivers' length doesn't match mids' length.");o.map(async(v,w)=>{v.direction="sendonly"});let c=await this.peerConnection.createOffer(),f=this.logSDPExchange(c.sdp||"","offer","local","unmuteLocal");await this.peerConnection.setLocalDescription(c),this.remoteSDP.unmuteRemote(a);let m=this.remoteSDP.toString();f==null||f(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(o){throw new De(ce.EXCHANGE_SDP_FAILED,"NVExtentionsConnection.unmuteLocal failed; ".concat(o.toString()))}}restartICE(a){var o=this;return Ul(function*(){let c=yield Dn(o.mutex.lock("From NVExtentionsConnection.restartICE"));try{if(!o.remoteSDP)throw new Error("Cannot restartICE before remoteSDP created.");if(Jn().supportPCSetConfiguration){let R=o.peerConnection.getConfiguration(),x=a===Pa.RELAY?"relay":"all";R.iceTransportPolicy!==x&&(z.debug("restartICE change iceTransportPolicy from [".concat(R.iceTransportPolicy,"] to [").concat(x,"]")),R.iceTransportPolicy=x,o.peerConnection.setConfiguration(R))}else if(a===Pa.RELAY)return;a!==Pa.RELAY&&o.remoteSDP.updateCandidates(a);let f=yield Dn(o.peerConnection.createOffer({iceRestart:!0}));if(!f.sdp)throw new Error("Cannot restartICE because restart offer SDP does not exist.");let m=Ah(f.sdp),{remoteIceParameters:v}=yield m.iceParameters;o.remoteSDP.restartICE(v);let w=o.remoteSDP.toString(),C=o.logSDPExchange(f.sdp||"","offer","local","restartICE");yield Dn(o.peerConnection.setLocalDescription(f)),C==null||C(w),yield Dn(o.peerConnection.setRemoteDescription({type:"answer",sdp:w}))}catch(f){z.warning("restart ICE failed, abort operation",f)}finally{c()}})()}close(){var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,"closed"),this.unbindPCEvents(),this.unbindStatsEvents(),this.removeAllListeners(),this.transportEventReceiver=void 0,this.statsFilter.destroy(),this.dataStreamChannelMap.clear()}getStats(){return this.statsFilter.getStats()}getRemoteVideoIsReady(a){return this.statsFilter.getVideoIsReady(a)}async updateEncoderConfig(a,o){try{if(!this.remoteSDP)throw new Error("Cannot call NVExtentionsConnection.updateEncoderConfig before remote SDP created.");let c=await this.peerConnection.createOffer(),f=this.mungSendOfferSDP(c.sdp,[o],[a]);this.remoteSDP.updateRecvMedia(a,o);let m=this.remoteSDP.toString(),v=this.logSDPExchange(f,"offer","local","updateEncoderConfig");await this.peerConnection.setLocalDescription({type:"offer",sdp:f}),v==null||v(m),await this.peerConnection.setRemoteDescription({type:"answer",sdp:m})}catch(c){throw new De(ce.EXCHANGE_SDP_FAILED,c.toString())}}async updateSendParameters(a,o){let c=this.peerConnection.getTransceivers().filter(f=>f.mid===a);c.length===1&&(this.isVP8Simulcast(o)?Pi()||await this.applySimulcastEncodings(c,[o]):await this.applySendEncodings(c,[o]))}setStatsRemoteVideoIsReady(a,o){this.statsFilter.setVideoIsReady2(a,o)}async replaceTrack(a,o){let c=this.peerConnection.getTransceivers().find(f=>f.mid===o);c&&await c.sender.replaceTrack(a._mediaStreamTrack)}getP2PConnectionParams(){var a;if((a=this.peerConnection.currentLocalDescription)===null||a===void 0||!a.sdp||!this.localCapabilities)throw new Error;return VD(VD({},Ah(this.peerConnection.currentLocalDescription.sdp)),{},{rtpCapabilities:this.localCapabilities})}bindPCEvents(){this.peerConnection.oniceconnectionstatechange=()=>{var a;(a=this.onICEConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.iceConnectionState)},this.peerConnection.onconnectionstatechange=()=>{var a;(a=this.onConnectionStateChange)===null||a===void 0||a.call(this,this.peerConnection.connectionState)},this.peerConnection.onicecandidate=a=>{a.candidate?this.localCandidateCount+=1:(this.peerConnection.onicecandidate=null,this.allCandidatesReceived=!0,z.debug("[pc-".concat(this.store.p2pId,"] local candidate count"),this.localCandidateCount))},setTimeout(()=>{this.allCandidatesReceived||(this.allCandidatesReceived=!0,z.debug("[pc-".concat(this.store.p2pId,"] onicecandidate timeout, local candidate count"),this.localCandidateCount))},ve("CANDIDATE_TIMEOUT"))}unbindPCEvents(){this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicecandidateerror=null,this.peerConnection.onicecandidate=null,this.peerConnection.ontrack=null}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(US(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...Kk.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...Kk.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat(O0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}async applySendEncodings(a,o){try{if(!Jn().supportSetRtpSenderParameters||a.length!==o.length)return;for(let L=0;L<a.length;L++){let U=a[L],F=o[L];if(F&&F instanceof ki){var c,f,m;if(this.isVP8Simulcast(F))continue;let Z={},W={};switch(F._optimizationMode){case"motion":Z.degradationPreference="maintain-framerate";break;case"detail":Z.degradationPreference="maintain-resolution";break;default:Z.degradationPreference="balanced"}var v,w,C,R;if((c=F._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&(W.maxBitrate=1e3*((v=F._encoderConfig)===null||v===void 0?void 0:v.bitrateMax)),Tt(f=F._hints).call(f,Hi.LOW_STREAM)&&((w=F._encoderConfig)!==null&&w!==void 0&&w.frameRate&&(W.maxFramerate=rl(F._encoderConfig.frameRate)),(C=F._encoderConfig)!==null&&C!==void 0&&C.scaleResolutionDownBy&&((R=F._encoderConfig)===null||R===void 0?void 0:R.scaleResolutionDownBy)>1&&(W.scaleResolutionDownBy=F._encoderConfig.scaleResolutionDownBy)),ve("DSCP_TYPE")&&C0()){var x;let ue=ve("DSCP_TYPE");Tt(x=["very-low","low","medium","high"]).call(x,ue)&&(W.networkPriority=ue)}let K=U.sender.getParameters(),oe=(m=K.encodings)===null||m===void 0?void 0:m[0];Pi()&&!oe&&(Z.encodings=[W]),oe&&Object.assign(oe,W),Object.assign(K,Z),await U.sender.setParameters(K)}}}catch{z.debug("Apply RTPSendEncodings failed.")}}mungSendOfferSDP(a,o,c){let f=rr.parse(a);return o.forEach((m,v)=>{let w=c[v],C=f.mediaDescriptions.find(R=>R.attributes.mid===w);C&&(F0(C,m),AW(C,m,this.store.codec))}),rr.print(f)}mungReceiveAnswerSDP(a,o,c){let f=rr.parse(a),m=f.mediaDescriptions.find(v=>v.attributes.mid===o);return m&&c===Wt.AUDIO&&m.media.mediaType==="audio"&&Ih(m),this.useXR&&PD(f),rr.print(f)}bindStatsEvents(){this.statsFilter.onFirstAudioReceived=a=>{var o;(o=this.onFirstAudioReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoReceived=a=>{var o;(o=this.onFirstVideoReceived)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstAudioDecoded=a=>{var o;(o=this.onFirstAudioDecoded)===null||o===void 0||o.call(this,a)},this.statsFilter.onFirstVideoDecoded=(a,o,c)=>{var f;(f=this.onFirstVideoDecoded)===null||f===void 0||f.call(this,a,o,c)},this.statsFilter.onSelectedLocalCandidateChanged=(a,o)=>{var c;(c=this.onSelectedLocalCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onSelectedRemoteCandidateChanged=(a,o)=>{var c;(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0||c.call(this,a,o)},this.statsFilter.onFirstVideoDecodedTimeout=a=>{var o;(o=this.onFirstVideoDecodedTimeout)===null||o===void 0||o.call(this,a)}}unbindStatsEvents(){this.statsFilter.onFirstAudioReceived=void 0,this.statsFilter.onFirstVideoReceived=void 0,this.statsFilter.onFirstAudioDecoded=void 0,this.statsFilter.onFirstVideoDecoded=void 0,this.statsFilter.onSelectedLocalCandidateChanged=void 0,this.statsFilter.onSelectedRemoteCandidateChanged=void 0,this.statsFilter.onFirstVideoDecodedTimeout=void 0}async applySimulcastForFirefox(a,o){if(a.length===o.length)for(let C=0;C<a.length;C++){var c,f,m,v,w;let R=a[C],x=o[C];if(x instanceof ki&&!Tt(c=x._hints).call(c,Hi.LOW_STREAM)&&(f=x._encoderConfig)!==null&&f!==void 0&&f.bitrateMax&&((m=x._encoderConfig)===null||m===void 0?void 0:m.bitrateMax)>200&&(v=x._scalabilityMode)!==null&&v!==void 0&&v.numSpatialLayers&&((w=x._scalabilityMode)===null||w===void 0?void 0:w.numSpatialLayers)>1&&this.store.codec==="vp8"){let L={},U={high:1e3*(x._encoderConfig.bitrateMax-50),medium:5e4};L.encodings=[{rid:"m",active:!0,maxBitrate:U.medium,scaleResolutionDownBy:4},{rid:"h",active:!0,maxBitrate:U.high}];let F=R.sender.getParameters();await R.sender.setParameters(Object.assign(F,L))}}}async applySimulcastEncodings(a,o){if(!Pi()&&a.length===o.length)for(let c=0;c<a.length;c++){let f=o[c];if(f instanceof ki&&this.isVP8Simulcast(f)){let m=a[c],v={},w={high:1e3*(f._encoderConfig.bitrateMax-50),medium:5e4};v.encodings=[{active:!0,adaptivePtime:!1,networkPriority:"high",priority:"high",maxBitrate:w.high},{active:!0,adaptivePtime:!1,networkPriority:"low",priority:"low",maxBitrate:w.medium,scaleResolutionDownBy:4}];let C=m.sender.getParameters();await m.sender.setParameters(Object.assign(C,v))}}}isVP8Simulcast(a){var o,c,f,m,v;return!!(a instanceof ki&&ve("SIMULCAST")&&this.store.codec==="vp8"&&!Tt(o=a._hints).call(o,Hi.LOW_STREAM)&&(c=a._encoderConfig)!==null&&c!==void 0&&c.bitrateMax&&((f=a._encoderConfig)===null||f===void 0?void 0:f.bitrateMax)>200&&(m=a._scalabilityMode)!==null&&m!==void 0&&m.numSpatialLayers&&((v=a._scalabilityMode)===null||v===void 0?void 0:v.numSpatialLayers)>1)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("exchanging ".concat(c," ").concat(o," SDP during NVExtentionsConnection.").concat(f,`
`),a),o==="offer"?m=>{this.logSDPExchange(m,"answer",c==="local"?"remote":"local",f)}:void 0}async getRemoteSSRC(a){if(!this.remoteSDP)return;let o=this.remoteSDP.getSSRC(a);return o==null?void 0:o[0].ssrcId}setConfiguration(a){if(Jn().supportPCSetConfiguration){let o=Kk.resolvePCConfiguration(a);this.peerConnection.setConfiguration(o)}}},vt(si.prototype,"connect",[al],Object.getOwnPropertyDescriptor(si.prototype,"connect"),si.prototype),vt(si.prototype,"updateRemoteRTPCapabilities",[al],Object.getOwnPropertyDescriptor(si.prototype,"updateRemoteRTPCapabilities"),si.prototype),vt(si.prototype,"updateRemoteConnect",[al],Object.getOwnPropertyDescriptor(si.prototype,"updateRemoteConnect"),si.prototype),vt(si.prototype,"createDataChannels",[al],Object.getOwnPropertyDescriptor(si.prototype,"createDataChannels"),si.prototype),vt(si.prototype,"receive",[al],Object.getOwnPropertyDescriptor(si.prototype,"receive"),si.prototype),vt(si.prototype,"batchReceive",[al],Object.getOwnPropertyDescriptor(si.prototype,"batchReceive"),si.prototype),vt(si.prototype,"stopReceiving",[al],Object.getOwnPropertyDescriptor(si.prototype,"stopReceiving"),si.prototype),vt(si.prototype,"muteRemote",[al],Object.getOwnPropertyDescriptor(si.prototype,"muteRemote"),si.prototype),vt(si.prototype,"unmuteRemote",[al],Object.getOwnPropertyDescriptor(si.prototype,"unmuteRemote"),si.prototype),vt(si.prototype,"muteLocal",[al],Object.getOwnPropertyDescriptor(si.prototype,"muteLocal"),si.prototype),vt(si.prototype,"unmuteLocal",[al],Object.getOwnPropertyDescriptor(si.prototype,"unmuteLocal"),si.prototype),vt(si.prototype,"close",[al],Object.getOwnPropertyDescriptor(si.prototype,"close"),si.prototype),vt(si.prototype,"updateEncoderConfig",[al],Object.getOwnPropertyDescriptor(si.prototype,"updateEncoderConfig"),si.prototype),vt(si.prototype,"updateSendParameters",[al],Object.getOwnPropertyDescriptor(si.prototype,"updateSendParameters"),si.prototype),vt(si.prototype,"replaceTrack",[al],Object.getOwnPropertyDescriptor(si.prototype,"replaceTrack"),si.prototype),vt(si.prototype,"getRemoteSSRC",[al],Object.getOwnPropertyDescriptor(si.prototype,"getRemoteSSRC"),si.prototype),si);function al(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("From NVExtentionsConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}var vi;function Tle(r){var a,o,c,f=2;for(typeof Symbol<"u"&&(o=lle,c=Symbol.iterator);f--;){if(o&&(a=r[o])!=null)return a.call(r);if(c&&(a=r[c])!=null)return new zD(a.call(r));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function zD(r){function a(o){if(Object(o)!==o)return Ct.reject(new TypeError(o+" is not an object."));var c=o.done;return Ct.resolve(o.value).then(function(f){return{value:f,done:c}})}return zD=function(o){this.s=o,this.n=o.next},zD.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(o){var c=this.s.return;return c===void 0?Ct.resolve({value:o,done:!0}):a(c.apply(this.s,arguments))},throw:function(o){var c=this.s.return;return c===void 0?Ct.reject(o):a(c.apply(this.s,arguments))}},new zD(r)}let W0=(vi=class qk extends $8{get currentLocalDescription(){return this.peerConnection.currentLocalDescription}get currentRemoteDescription(){return this.peerConnection.currentRemoteDescription}get peerConnectionState(){return this.peerConnection.connectionState}get iceConnectionState(){return this.peerConnection.iceConnectionState}get localCodecs(){return this._p2pConnection.localCodecs}constructor(a,o){super(a,o),X(this,"store",void 0),X(this,"peerConnection",void 0),X(this,"cname",void 0),X(this,"mutex",new Ts("DataChannelConnection-mutex")),X(this,"dataChannel",void 0),X(this,"_p2pConnection",void 0),X(this,"establishPromise",void 0),X(this,"_nvMedia",void 0),this.store=o,this.store.dcId=this.store.dcId+1,this.peerConnection=new RTCPeerConnection(qk.resolvePCConfiguration(a),{optional:[{googDscp:!0}]}),this.dataChannel=this.peerConnection.createDataChannel("agora-signal",{ordered:!1,maxPacketLifeTime:50}),this.dataChannel.binaryType="arraybuffer",this._p2pConnection=new P4e(a,o,this.peerConnection),this.bindPCEvents(),this.establishPromise=this._p2pConnection.establishPromise}async establish(){var a;let o=(a=this._nvMedia)===null||a===void 0?void 0:a.getLocalRtpCapabilities();return await this._p2pConnection.establish(o)}getP2PConnectionParams(){return this._p2pConnection.getP2PConnectionParams()}async connect(a,o,c,f,m,v){return this.cname=v,await this._p2pConnection.connect(a,o,c,f,m,v),await new Ct((w,C)=>{let R=setTimeout(()=>{this.closeSignal(),C(new De(ce.DATACHANNEL_CONNECTION_TIMEOUT,"Datachannel connection timed out, candidates: ".concat(JSON.stringify(c))))},2e3);this.dataChannel.onopen=()=>{if(this.dataChannel.readyState==="open")return clearTimeout(R),void w()},this.dataChannel.onerror=x=>{this.closeSignal(),C(x)}}),{transmitter:this.dataChannel,close:this.closeSignal.bind(this)}}async updateRemoteRTPCapabilities(a,o){return this._p2pConnection.updateRemoteRTPCapabilities(a,o)}send(a,o,c){var f=this;return Ul(function*(){let m=yield Dn(f.mutex.lock("From DataChannelConnection.send"));try{return yield*kD(Tle(f._p2pConnection.send(a,o,c)))}finally{m()}})()}async stopSending(a,o){return this._p2pConnection.stopSending(a,o)}async createDataChannels(a,o){return this._p2pConnection.createDataChannels(a,o)}async stopDataChannels(a){return this._p2pConnection.stopDataChannels(a)}async receive(a,o,c,f){return this._nvMedia?(z.debug("[DataChannelConnection] receive ".concat(a," by DataChannel.")),await this._nvMedia.reveiveByRTCMedia(a,o,this.cname)):(z.debug("[DataChannelConnection] receive ".concat(a," by WebRTC.")),await this._p2pConnection.receive(a,o,c,f))}async batchReceive(a){return[...await this._p2pConnection.batchReceive(a)]}async stopReceiving(a){return await this._p2pConnection.stopReceiving(a)}async muteRemote(a){return await this._p2pConnection.muteRemote(a)}async unmuteRemote(a){return await this._p2pConnection.unmuteRemote(a)}async muteLocal(a){return await this._p2pConnection.muteLocal(a)}async unmuteLocal(a){return await this._p2pConnection.unmuteLocal(a)}restartICE(a){var o=this;return Ul(function*(){return yield*kD(Tle(o._p2pConnection.restartICE(a)))})()}close(){var a;(a=this._nvMedia)===null||a===void 0||a.close(),this._p2pConnection.close(),this.unbindConnectionEvents(this._p2pConnection)}getStats(){return this._p2pConnection.getStats()}getRemoteVideoIsReady(a){return this._p2pConnection.getRemoteVideoIsReady(a)}updateRemoteConnect(a){var o;(o=this._nvMedia)===null||o===void 0||o.setRemoteRtpCapabilities(a),this._p2pConnection.updateRemoteConnect(a)}async updateEncoderConfig(a,o){return await this._p2pConnection.updateEncoderConfig(a,o)}async updateSendParameters(a,o){return await this._p2pConnection.updateSendParameters(a,o)}setStatsRemoteVideoIsReady(a,o){this._p2pConnection.setStatsRemoteVideoIsReady(a,o)}async replaceTrack(a,o){return await this._p2pConnection.replaceTrack(a,o)}async getRemoteSSRC(a){return this._p2pConnection.getRemoteSSRC(a)}logSDPExchange(a,o,c,f){if(ve("SDP_LOGGING"))return z.upload("exchanging ".concat(c," ").concat(o," SDP during DataChannelConnection.").concat(f,`
`),a),o==="offer"?m=>{this.logSDPExchange(m,"answer",c==="local"?"remote":"local",f)}:void 0}static resolvePCConfiguration(a){let o={iceServers:[]};return a.iceServers?o.iceServers=a.iceServers:a.turnServer&&a.turnServer.mode!=="off"&&(US(a.turnServer.servers)?o.iceServers=a.turnServer.servers:(o.iceServers&&o.iceServers.push(...qk.turnServerConfigToIceServers(a.turnServer.servers)),ve("USE_TURN_SERVER_OF_GATEWAY")&&o.iceServers&&a.turnServer.serversFromGateway&&o.iceServers.push(...qk.turnServerConfigToIceServers(a.turnServer.serversFromGateway)),ve("FORCE_TURN_TCP")?o.iceTransportPolicy="relay":a.turnServer.servers.concat(a.turnServer.serversFromGateway||[]).forEach(c=>{c.forceturn&&(o.iceTransportPolicy="relay")}))),o}static turnServerConfigToIceServers(a){let o=[];return a.forEach(c=>{c.security?c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turns:".concat(O0(c.turnServerURL),":").concat(c.tcpport,"?transport=tcp")}):(c.udpport&&!ve("FORCE_TURN_TCP")&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.udpport,"?transport=udp")}),c.tcpport&&o.push({username:c.username,credential:c.password,credentialType:"password",urls:"turn:".concat(c.turnServerURL,":").concat(c.tcpport,"?transport=tcp")}))}),o}bindPCEvents(){this._p2pConnection.onICEConnectionStateChange=a=>{var o;return(o=this.onICEConnectionStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onConnectionStateChange=a=>{var o;return(o=this.onConnectionStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onDTLSTransportStateChange=a=>{var o;return(o=this.onDTLSTransportStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onDTLSTransportError=a=>{var o;return(o=this.onDTLSTransportError)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onICETransportStateChange=a=>{var o;return(o=this.onICETransportStateChange)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstAudioReceived=a=>{var o;return(o=this.onFirstAudioReceived)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstVideoReceived=a=>{var o;return(o=this.onFirstVideoReceived)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstAudioDecoded=a=>{var o;return(o=this.onFirstAudioDecoded)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onFirstVideoDecoded=(a,o,c)=>{var f;return(f=this.onFirstVideoDecoded)===null||f===void 0?void 0:f.call(this,a,o,c)},this._p2pConnection.onFirstVideoDecodedTimeout=a=>{var o;return(o=this.onFirstVideoDecodedTimeout)===null||o===void 0?void 0:o.call(this,a)},this._p2pConnection.onSelectedLocalCandidateChanged=(a,o)=>{var c;return(c=this.onSelectedLocalCandidateChanged)===null||c===void 0?void 0:c.call(this,a,o)},this._p2pConnection.onSelectedRemoteCandidateChanged=(a,o)=>{var c;return(c=this.onSelectedRemoteCandidateChanged)===null||c===void 0?void 0:c.call(this,a,o)}}closeSignal(){this.dataChannel.close(),this.peerConnection.close()}unbindConnectionEvents(a){a.onConnectionStateChange=void 0,a.onICEConnectionStateChange=void 0,a.onICETransportStateChange=void 0,a.onDTLSTransportStateChange=void 0,a.onDTLSTransportError=void 0,a.onFirstAudioDecoded=void 0,a.onFirstAudioReceived=void 0,a.onFirstVideoDecoded=void 0,a.onFirstVideoReceived=void 0,a.onSelectedLocalCandidateChanged=void 0,a.onSelectedRemoteCandidateChanged=void 0,a.onFirstVideoDecodedTimeout=void 0}setConfiguration(a){this._p2pConnection.setConfiguration(a)}},vt(vi.prototype,"connect",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"connect"),vi.prototype),vt(vi.prototype,"updateRemoteRTPCapabilities",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"updateRemoteRTPCapabilities"),vi.prototype),vt(vi.prototype,"createDataChannels",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"createDataChannels"),vi.prototype),vt(vi.prototype,"receive",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"receive"),vi.prototype),vt(vi.prototype,"stopReceiving",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"stopReceiving"),vi.prototype),vt(vi.prototype,"muteRemote",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"muteRemote"),vi.prototype),vt(vi.prototype,"unmuteRemote",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"unmuteRemote"),vi.prototype),vt(vi.prototype,"muteLocal",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"muteLocal"),vi.prototype),vt(vi.prototype,"unmuteLocal",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"unmuteLocal"),vi.prototype),vt(vi.prototype,"close",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"close"),vi.prototype),vt(vi.prototype,"updateEncoderConfig",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"updateEncoderConfig"),vi.prototype),vt(vi.prototype,"updateSendParameters",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"updateSendParameters"),vi.prototype),vt(vi.prototype,"replaceTrack",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"replaceTrack"),vi.prototype),vt(vi.prototype,"getRemoteSSRC",[kc],Object.getOwnPropertyDescriptor(vi.prototype,"getRemoteSSRC"),vi.prototype),vi);function kc(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("From DataChannelConnection.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}var kn;function Rle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function $f(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Rle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Rle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}function xle(r){var a,o,c,f=2;for(typeof Symbol<"u"&&(o=lle,c=Symbol.iterator);f--;){if(o&&(a=r[o])!=null)return a.call(r);if(c&&(a=r[c])!=null)return new HD(a.call(r));o="@@asyncIterator",c="@@iterator"}throw new TypeError("Object is not async iterable")}function HD(r){function a(o){if(Object(o)!==o)return Ct.reject(new TypeError(o+" is not an object."));var c=o.done;return Ct.resolve(o.value).then(function(f){return{value:f,done:c}})}return HD=function(o){this.s=o,this.n=o.next},HD.prototype={s:null,n:null,next:function(){return a(this.n.apply(this.s,arguments))},return:function(o){var c=this.s.return;return c===void 0?Ct.resolve({value:o,done:!0}):a(c.apply(this.s,arguments))},throw:function(o){var c=this.s.return;return c===void 0?Ct.reject(o):a(c.apply(this.s,arguments))}},new HD(r)}let GD=(kn=class extends nr{get state(){return this._state}set state(r){let a=this._state;this._state=r,this.emit(pn.StateChange,a,this._state)}constructor(r,a){super(),X(this,"store",void 0),X(this,"statsUploader",void 0),X(this,"connection",void 0),X(this,"localTrackMap",new Map),X(this,"remoteUserMap",new Map),X(this,"localDataChannels",[]),X(this,"remoteDataChannelMap",new Map),X(this,"pendingLocalTracks",[]),X(this,"pendingRemoteTracks",[]),X(this,"pendingLocalDataChannels",[]),X(this,"pendingRemoteDataChannels",[]),X(this,"statsCollector",void 0),X(this,"isPlanB",!1),X(this,"shouldForwardP2PCreation",void 0),X(this,"iceFailedCount",0),X(this,"dtlsFailedCount",0),X(this,"mutex",new Ts("P2PChannel-mutex")),X(this,"_state",gi.Disconnected),X(this,"_pcStatsUploadType",ve("NEW_ICE_RESTART")?gm.FIRST_CONNECTION:gm.OLD_FIRST_CONNECTION),X(this,"_isInRestartIce",!1),X(this,"_isStartRestartIce",!1),X(this,"_restartStates",["disconnected","failed"]),X(this,"_restartTimer",void 0),X(this,"_isFirstConnected",!0),X(this,"handleMuteLocalTrack",async(o,c,f)=>{let m=await this.mutex.lock("Locking from P2PChannel.handleMuteLocalTrack");try{if(!this.connection||this.state!==gi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel.handleMuteLocalTrack before connection established."));let v=this.filterTobeMutedTracks(o);if(v.length===0)return void c();let w=v.find(R=>R[0]==="videoLowTrack");w&&w[1].track._originMediaStreamTrack.stop(),await this.connection.muteLocal(v.map(R=>{let[,{id:x}]=R;return x}));let C=this.createMuteMessage(v);await Li(this,pn.RequestMuteLocal,C),c()}catch(v){f(v)}finally{m()}}),X(this,"handleUnmuteLocalTrack",async(o,c,f)=>{let m=await this.mutex.lock("Locking from P2PChannel.handleUnmuteLocalTrack");try{if(!this.connection||this.state!==gi.Connected)return void f(new Ke(ce.INVALID_OPERATION,"Cannot call P2PChannel.handleUnmuteLocalTrack before connection established."));let v=this.filterTobeUnmutedTracks(o);if(v.length===0)return void c();let w=v.find(R=>R[0]==="videoLowTrack");if(w){let R=w[1];if(R.track._originMediaStreamTrack.stop(),!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let x=o._mediaStreamTrack.clone();R.track._mediaStreamTrack=x,R.track._originMediaStreamTrack=x}else{let x=OW(o,Vy(this,pn.RequestLowStreamParameter));R.track._mediaStreamTrack=x,R.track._originMediaStreamTrack=x}await new Ct((x,L)=>{this.handleReplaceTrack(R.track,x,L,!0)})}await this.connection.unmuteLocal(v.map(R=>{let[,{id:x}]=R;return x}));let C=this.createUnmuteMessage(v);await Li(this,pn.RequestUnmuteLocal,C),c()}catch(v){f(v)}finally{m()}}),X(this,"handleUpdateVideoEncoder",async(o,c,f)=>{let m=await this.mutex.lock("Locking from P2PChannel.handleSetVideoEncoder");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.connection||!v||v.track!==o||this.state!==gi.Connected)return void c();let{id:w,track:C}=v;await this.connection.updateSendParameters(w,C),await this.connection.updateEncoderConfig(w,C),this.emit(pn.UpdateVideoEncoder,C),c()}catch(v){f(v)}finally{m()}}),X(this,"handleUpdateVideoSendParameters",async(o,c,f)=>{let m=await this.mutex.lock("Locking from P2PChannel.handleUpdateVideoSendParameters");try{let v=this.localTrackMap.get(ht.LocalVideoTrack);if(!this.connection||!v||v.track!==o||this.state!==gi.Connected)return void c();let{id:w,track:C}=v;await this.connection.updateSendParameters(w,C),c()}catch(v){f(v)}finally{m()}}),X(this,"handleReplaceMixingTrack",async(o,c,f,m)=>{if(!this.connection||this.state!==gi.Connected)return void c();let v=LW([o]),w;z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will replace audioTrack [").concat(v.getTrackId(),"]")),typeof m=="boolean"&&m||(w=await this.mutex.lock("From P2PChannel.handleReplaceMixingTrack"));try{await this.replaceTrack(o,v),c()}catch(R){f(R)}finally{var C;(C=w)===null||C===void 0||C()}}),X(this,"handleReplaceTrack",async(o,c,f,m)=>{let v;z.debug("[".concat(this.store.clientId,"] P2PChannel handleReplaceTrack for [track-id-").concat(o.getTrackId(),"]")),typeof m=="boolean"&&m||(v=await this.mutex.lock("From P2PChannel.handleReplaceTrack"));try{var w;let R=Array.from(this.localTrackMap.entries()).find(x=>{let[,{track:L}]=x;return o===L});if(!this.connection||!R||this.state!==gi.Connected)return void c();if(await((w=this.connection)===null||w===void 0?void 0:w.replaceTrack(o,R[1].id)),this.isPlanB){let x=R[1];x.id=o._mediaStreamTrack.id,this.localTrackMap.set(R[0],x)}if(R[0]===ht.LocalVideoTrack&&!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let x=this.localTrackMap.get(ht.LocalVideoLowTrack);if(x){let L=o._mediaStreamTrack.clone();x.track._originMediaStreamTrack.stop(),x.track._mediaStreamTrack=L,x.track._originMediaStreamTrack=L,await new Ct((U,F)=>{this.handleReplaceTrack(x.track,U,F,!0)})}}c()}catch(R){f(R)}finally{var C;(C=v)===null||C===void 0||C()}}),X(this,"handleGetRTCStats",o=>{o(this.statsCollector.getRTCStats())}),X(this,"handleGetLocalVideoStats",o=>{o(this.statsCollector.getLocalVideoTrackStats())}),X(this,"handleGetLocalAudioStats",o=>{o(this.statsCollector.getLocalAudioTrackStats())}),X(this,"handleGetRemoteVideoStats",o=>this.statsCollector.getRemoteVideoTrackStats(o.uid)[o.uid]),X(this,"handleGetRemoteAudioStats",o=>this.statsCollector.getRemoteAudioTrackStats(o.uid)[o.uid]),this.store=r,this.statsCollector=a,this.statsCollector.addP2PChannel(this),this.statsUploader=new Goe(this.store),this.bindStatsUploaderEvents(),this.isPlanB=!Jn().supportUnifiedPlan||ve("CHROME_FORCE_PLAN_B")&&C0(),this.shouldForwardP2PCreation=ve("FORWARD_P2P_CREATION")&&Jn().supportPCSetConfiguration&&MH(),this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new W0({},this.store):this.isPlanB?new _b({},this.store):new Ph({},this.store),this.bindConnectionEvents(this.connection))}async startP2PConnection(r,a){var o;this.state=gi.New;let c=this.shouldForwardP2PCreation&&((o=this.connection)===null||o===void 0?void 0:o.peerConnectionState)==="closed";if(this.shouldForwardP2PCreation&&!c||(c&&this.connection&&(z.warning("[".concat(this.store.clientId,"] P2PChannel.startP2PConnection ForwardP2P closed.")),this.connection.close(),this.unbindConnectionEvents(this.connection)),this.connection=this.store.useDataChannel?new W0(r,this.store):this.isPlanB?new _b(r,this.store):new Ph(r,this.store),this.bindConnectionEvents(this.connection)),!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.startConnection before P2PConnection initialization .");return this._pcStatsUploadType=ve("NEW_ICE_RESTART")?gm.FIRST_CONNECTION:gm.OLD_FIRST_CONNECTION,this._isFirstConnected=!0,this._isInRestartIce=!1,this._isStartRestartIce=!1,this.connection.setConfiguration(r),this.connection.establishPromise}async connect(r,a,o,c,f,m){if(!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");this.connection instanceof W0?this.connection.updateRemoteConnect(c):(this.store.peerConnectionStart(),await this.connection.connect(r,a,o,c,f,m),this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=gi.Connected)}updateRemoteRTPCapabilities(r){let a=Array.from(this.localTrackMap.entries()).filter(f=>{var m;let[v]=f;return Tt(m=[ht.LocalVideoLowTrack,ht.LocalVideoTrack]).call(m,v)}),o=a.map(f=>{let[,{id:m}]=f;return m}),c=a.map(f=>{let[m]=f;return m});if(this.connection instanceof Ph){if($t.updateRemoteRTPCapabilities(this.store.sessionId,{trackTypes:JSON.stringify(c),localCodecs:JSON.stringify(this.connection.localCodecs),remoteCodecs:JSON.stringify(r)}),!Tt(r).call(r,this.store.codec)){let f=["vp9","vp8","h264"].find(m=>Tt(r).call(r,m));f&&(this.store.codec=f,z.debug("[".concat(this.store.clientId,"] [").concat(this.store.p2pId," updateRemoteRTPCapabilities] default codec is not available, hence the fallback to ").concat(f,".")))}this.connection.updateRemoteRTPCapabilities(o,r)}}async preConnect(r,a,o,c,f,m){if(!this.connection)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot P2PChannel.connect before P2PChannel.startP2PConnection .");this.store.peerConnectionStart();let v=await this.connection.connect(r,a,o,c,f,m);return this.statsUploader.startUploadTransportStats(),this.statsUploader.startUploadExtensionUsageStats(),this.state=gi.Connected,v}getEstablishParams(){if(this.connection instanceof W0)return this.connection.getP2PConnectionParams();throw new Error("Only DataChannelConnection needs to obtain establishParams")}async publishDataChannel(r){if(!this.connection||this.state!==gi.Connected){if(this.state===gi.Disconnected)throw new Ke(ce.UNEXPECTED_ERROR,"PeerConnection already disconnected.");return void r.forEach(o=>{var c;Tt(c=this.pendingLocalDataChannels).call(c,o)||this.pendingLocalDataChannels.push(o)})}let a=this.filterTobePublishedDataChannels(r);a.length!==0&&(a.forEach(o=>{let c=Date.now();this.store.publish(o.id.toString(),"datachannel",c)}),await this.connection.createDataChannels(this.store.uid,a),a.forEach(o=>{this.localDataChannels.push(o);let c=Date.now();this.store.publish(o.id+"","datachannel",void 0,c)}))}publish(r,a,o){var c=this;return Ul(function*(){let f=yield Dn(c.mutex.lock("From P2PChannel.publish"));try{if(!c.connection||c.state!==gi.Connected){if(c.state===gi.Disconnected)throw new Ke(ce.UNEXPECTED_ERROR,"PeerConnection already disconnected.");c.throwIfTrackTypeNotMatch(r);let v=r.filter(w=>c.pendingLocalTracks.indexOf(w)===-1);return void(c.pendingLocalTracks=c.pendingLocalTracks.concat(v))}c.store.pubId=c.store.pubId+1,aa.markPublishStart(c.store.clientId,c.store.pubId);let m=c.filterTobePublishedTracks(r,a,o);if(m.length===0)return void(yield Dn(c.tryToUnmuteAudio(r)));yield*kD(xle(c.doPublish(c.connection,m)))}finally{f()}})()}doPublish(r,a){var o=this;return Ul(function*(){a.forEach(L=>{let{track:U,type:F}=L,Z=Date.now();o.store.publish(U.getTrackId(),F===ht.LocalAudioTrack?"audio":"video",Z)}),o.bindLocalTrackEvents(a);let c=a.map(L=>{let{track:U}=L;return U}),f=yield Dn(r.send(a.map(L=>{let{track:U}=L;return U}),o.store.codec,o.store.audioCodec)),m=(yield Dn(f.next())).value,v=o.createGatewayPublishMessage(a,m),w;try{w=yield v}catch(L){throw f.throw(L),(L==null?void 0:L.code)===ce.WS_ABORT&&a.forEach(U=>{let{track:F}=U;o.pendingLocalTracks.indexOf(F)===-1&&o.pendingLocalTracks.push(F)}),o.unbindLocalTrackEvents(a),L}let C=o.mapPubResToRemoteConfig(v,w),R=(yield Dn(f.next(C))).value,x=ve("ENABLE_VIDEO_SEI");c.forEach(async L=>{let U=L.getRTCRtpTransceiver();U&&x&&(L.trackMediaType===Wt.VIDEO?await r4e(U.sender,L):L.trackMediaType===Wt.AUDIO&&await async function(F){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support audio encoded transform");if(RD.has(F)||!F.track)return;let Z={track:F.track};if(b0()){if(!F.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let K=null;try{K=F.createEncodedStreams()}catch(ue){return void z.error("create audio-encoded-streams error",ue&&ue.message)}let oe=new TransformStream({transform(ue,xe){Z.controller||(Z.controller=xe),F.track&&F.track.id!==Z.track.id&&(z.debug("audio track changed: ".concat(Z.track.id," => ").concat(F.track.id)),Z.track.removeEventListener("ended",W),Z.track=F.track,Z.track.addEventListener("ended",W)),xe.enqueue(ue)}});K.readable.pipeThrough(oe).pipeTo(K.writable)}else if(gs()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let K=TD(),oe=new MessageChannel;await new Ct(xe=>K.onmessage=Oe=>{Oe.data==="registered"&&xe(void 0)});let ue=new RTCRtpScriptTransform(K,{name:"tx",port:oe.port2},[oe.port2]);F.transform=ue,await new Ct(xe=>K.onmessage=Oe=>{Oe.data==="started"&&xe(void 0)}),oe.port1.onmessage=xe=>{var Oe;xe.data.transformed&&F.track&&((Oe=F.track)===null||Oe===void 0?void 0:Oe.id)!==Z.track.id&&(z.debug("audio track changed: ".concat(Z.track.id," => ").concat(F.track.id)),Z.track.removeEventListener("ended",W),Z.track=F.track,Z.track.addEventListener("ended",W))},Z.worker=K}function W(){if(F.track){if(this.id!==F.track.id)return;F.track.removeEventListener("ended",W)}let K=RD.get(F);if(K){RD.delete(F);try{var oe,ue;(oe=K.controller)===null||oe===void 0||oe.terminate(),(ue=K.worker)===null||ue===void 0||ue.terminate()}catch(xe){z.warning(xe&&xe.message)}}}RD.set(F,Z),F.track.addEventListener("ended",W)}(U.sender))}),a.forEach(L=>{let{type:U}=L;o.statsCollector.addLocalStats(U)}),o.assignLocalTracks(a,R),o.statsUploader.startUploadOutboundStats(),a.forEach(L=>{let{track:U,type:F}=L,Z=Date.now();o.store.publish(U.getTrackId(),F===ht.LocalAudioTrack?"audio":"video",void 0,Z)})})()}async updateVideoStreamParameter(r,a){let o=this.localTrackMap.get(a);if(!o)return;if(!(o.track instanceof ki))return z.warn("[updateVideoStreamParameter]: track is not an instance of LocalVideoTrack");if(!(this.connection instanceof Ph||this.connection instanceof _b))return z.warn("[updateVideoStreamParameter]: connection is not P2PConnection or P2PConnectionPlanB");let{track:c}=o,f=function(m,v){let w={};return m.height&&m.width&&(w.scaleResolutionDownBy=oG(m,v)),w.maxFramerate=m.framerate?rl(m.framerate):void 0,w.maxBitrate=m.bitrate?1e3*m.bitrate:void 0,w}(r,c);if(c._encoderConfig||(c._encoderConfig={}),a!==ht.LocalVideoLowTrack||!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding)f.scaleResolutionDownBy!=null&&(c._encoderConfig.scaleResolutionDownBy=f.scaleResolutionDownBy);else{let m=c._originMediaStreamTrack;if(!m.canvas)return z.warn("[".concat(c.getTrackId(),"] no canvas on track"));(function(v,w){let C=v.canvas;w.width&&(C.width=rl(w.width)),w.height&&(C.height=rl(w.height)),w.framerate&&(C.stopCapture&&C.stopCapture(),C.stopCapture=hW(()=>{!C.startCapture&&C.stopCapture&&C.stopCapture(),C.startCapture&&C.startCapture()},rl(w.framerate)))})(m,r)}f.maxBitrate!=null&&(c._encoderConfig.bitrateMax=f.maxBitrate/1e3),f.maxFramerate!=null&&(c._encoderConfig.frameRate&&typeof c._encoderConfig.frameRate=="object"?c._encoderConfig.frameRate.max=f.maxFramerate:c._encoderConfig.frameRate={max:f.maxFramerate}),z.debug("[".concat(c.getTrackId(),"] LowStreamEncoderConfig: , ").concat(JSON.stringify(c._encoderConfig))),await this.connection.updateRtpSenderEncodings(c)}publishLowStream(r){var a=this;return Ul(function*(){if(!a.connection||a.state!==gi.Connected)return;let o=yield Dn(a.mutex.lock("Locking from P2PChannel.publishLowStream"));try{let f=a.localTrackMap.get(ht.LocalVideoTrack);if(!f)throw new Ke(ce.UNEXPECTED_ERROR,"Could not find high stream");if(a.localTrackMap.has(ht.LocalVideoLowTrack))throw new Ke(ce.UNEXPECTED_ERROR,"[".concat(a.store.clientId,"] Can't publish low stream when stream already publish"));let m=[{track:a.getLowVideoTrack(f.track,r),type:ht.LocalVideoLowTrack}];if(yield*kD(xle(a.doPublish(a.connection,m))),f.track.muted||!f.track.enabled){var c;let v=(c=a.localTrackMap.get(ht.LocalVideoLowTrack))===null||c===void 0?void 0:c.id;v!==void 0&&(yield Dn(a.connection.muteLocal([v])))}}finally{o()}})()}async republish(){this.pendingLocalTracks.length>0&&(z.debug("[".concat(this.store.clientId,"] Emit P2PChannelEvents.RequestRePublish to republish tracks.")),await Kr(this,pn.RequestRePublish,this.pendingLocalTracks),this.emit(pn.MediaReconnectEnd,this.store.uid),this.pendingLocalTracks=[]),this.pendingLocalDataChannels.length>0&&(z.debug("Emit P2PChannelEvents.RequestRePublishDataChannel to republish datachannels."),await Kr(this,pn.RequestRePublishDataChannel,this.pendingLocalDataChannels),this.pendingLocalDataChannels=[])}async reSubscribe(r){for(let a=this.pendingRemoteTracks.length-1;a>=0;a--){let{user:o,kind:c}=this.pendingRemoteTracks[a];(c!==Wt.AUDIO||o._audio_added_&&o._audioSSRC)&&(c!==Wt.VIDEO||o._video_added_&&o._videoSSRC)||this.pendingRemoteTracks.splice(a,1)}if(r)await Kr(this,pn.RequestReSubscribe,this.pendingRemoteTracks);else for(let{user:a,kind:o}of this.pendingRemoteTracks)await this.subscribe(a,o,o===Wt.VIDEO?a._videoSSRC:a._audioSSRC);this.pendingRemoteTracks.forEach(a=>{let{user:o}=a;this.emit(pn.MediaReconnectEnd,o.uid)}),this.pendingRemoteTracks=[]}async unpublish(r){if(!this.connection||this.state!==gi.Connected)return void r.forEach(c=>{let f=this.pendingLocalTracks.indexOf(c);f!==-1&&this.pendingLocalTracks.splice(f,1)});let a=this.filterTobeUnpublishedTracks(r);if(a.length===0)return;let o=a.find(c=>c[0]==="videoLowTrack");return o&&o[1].track.close(),this.doUnpublish(this.connection,a)}async unpublishDataChannel(r){if(!this.connection||this.state!==gi.Connected)return void r.forEach(o=>{let c=this.pendingLocalDataChannels.indexOf(o);c!==-1&&this.pendingLocalDataChannels.splice(c,1)});let a=this.filterTobeUnpublishedDataChannels(r);return a.length!==0?(a.forEach(o=>{let c=this.localDataChannels.indexOf(o);c!==-1&&this.localDataChannels.splice(c,1)}),this.localDataChannels.length===0&&await this.connection.stopDataChannels(this.store.uid),a.map(o=>o.id)):void 0}async unpublishLowStream(){if(!this.connection||this.state!==gi.Connected)return;let r=this.localTrackMap.get(ht.LocalVideoLowTrack);if(!r)return;r.track.close();let a=[[ht.LocalVideoLowTrack,r]];return this.doUnpublish(this.connection,a)}async doUnpublish(r,a){let o=this.createGatewayUnpublishMessage(a);return await r.stopSending(a.map(c=>{let[,{id:f}]=c;return f})),this.withdrawLocalTracks(a),this.unbindLocalTrackEvents(a.map(c=>{let[f,{track:m}]=c;return{type:f,track:m}})),a.forEach(c=>{let[f]=c;this.statsCollector.removeLocalStats(f)}),this.localTrackMap.size===0&&this.statsUploader.stopUploadOutboundStats(),o}async subscribeDataChannel(r,a){if(!this.connection||this.state!==gi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");let o=a.filter(c=>{var f;return!((f=this.remoteDataChannelMap.get(r))!==null&&f!==void 0&&f.get(c.id))});if(o.length!==0)return await this.connection.createDataChannels(r.uid,o),o.forEach(c=>{var f;this.remoteDataChannelMap.has(r)?(f=this.remoteDataChannelMap.get(r))===null||f===void 0||f.set(c.id,c):this.remoteDataChannelMap.set(r,new Map([[c.id,c]]));let m=this.pendingRemoteDataChannels.findIndex(v=>{let{user:w,id:C}=v;return w.uid===r.uid&&C===c.id});m!==-1&&this.pendingRemoteDataChannels.splice(m,1)}),o.map(c=>c.id)}async subscribe(r,a,o,c,f){var m;if(!this.connection||this.state!==gi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribe remote user when peerConnection disconnected.");if((m=this.remoteUserMap.get(r))!==null&&m!==void 0&&m.has(a))return;let v,w,C;if(f){let L=f.find(F=>{let{stream_type:Z}=F;return Z===a});if(!L)throw new Ke(ce.UNEXPECTED_ERROR,"Cannot subscribe to remote ".concat(a," for user: ").concat(r.uid," because subscribe answer from gateway does not contain stream_type: ").concat(a,"."));let U=await this.connection.receive(a,L.ssrcs,String(r._uintid),L.attributes);this.connection instanceof Ph&&(C=U.transceiver),v=U.track,w=U.id}else{let L=await this.connection.receive(a,[{ssrcId:o,rtx:c}],String(r._uintid),void 0);this.connection instanceof Ph&&(C=L.transceiver),v=L.track,w=L.id}a===Wt.AUDIO?(r._audioTrack?r._audioTrack._updateOriginMediaStreamTrack(v):(r._audioTrack=new gb(v,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(r._audioTrack.getTrackId()))),C&&r._audioTrack._updateRtpTransceiver(C),this.bindRemoteTrackEvents(r,r._audioTrack)):(r._videoTrack?r._videoTrack._updateOriginMediaStreamTrack(v):(r._videoTrack=new mb(v,r.uid,r._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(r._videoTrack.getTrackId()))),C&&r._videoTrack._updateRtpTransceiver(C),this.bindRemoteTrackEvents(r,r._videoTrack)),ve("ENABLE_VIDEO_SEI")&&C&&(a==Wt.VIDEO?await s4e(C.receiver,{onSei:L=>{var U;(U=r._videoTrack)===null||U===void 0||U._onSei(L)}}):a==Wt.AUDIO&&await async function(L){if(!Jn().supportWebRTCEncodedTransform)return void z.warning("browser not support audio encoded transform");if(xD.has(L))return;let U={track:L.track};if(b0()){if(!L.createEncodedStreams)return void z.warning("browser not support createEncodedStreams() API");let Z=null;try{Z=L.createEncodedStreams()}catch(K){return void z.error("create audio-encoded-streams error",K&&K.message)}let W=new TransformStream({transform(K,oe){U.controller||(U.controller=oe),L.track&&L.track.id!==U.track.id&&(z.debug("audio track changed: ".concat(U.track.id," => ").concat(L.track.id)),U.track.removeEventListener("ended",F),U.track=L.track,U.track.addEventListener("ended",F)),oe.enqueue(K)}});Z.readable.pipeThrough(W).pipeTo(Z.writable)}else if(gs()){if(typeof RTCRtpScriptTransform>"u")return void z.warning("browser not support RTCRtpScriptTransform");let Z=TD(),W=new MessageChannel;await new Ct(oe=>Z.onmessage=ue=>{ue.data==="registered"&&oe(void 0)});let K=new RTCRtpScriptTransform(Z,{name:"rx",port:W.port2},[W.port2]);L.transform=K,await new Ct(oe=>Z.onmessage=ue=>{ue.data==="started"&&oe(void 0)}),W.port1.onmessage=oe=>{var ue;oe.data.transformed&&L.track&&((ue=L.track)===null||ue===void 0?void 0:ue.id)!==U.track.id&&(z.debug("audio track changed: ".concat(U.track.id," => ").concat(L.track.id)),U.track.removeEventListener("ended",F),U.track=L.track,U.track.addEventListener("ended",F))},U.worker=Z}function F(){L.track.removeEventListener("ended",F),function(Z){let W=xD.get(Z);if(W){xD.delete(Z);try{var K,oe;(K=W.controller)===null||K===void 0||K.terminate(),(oe=W.worker)===null||oe===void 0||oe.terminate()}catch(ue){z.warning(ue&&ue.message)}}}(L)}xD.set(L,U),L.track.addEventListener("ended",F)}(C.receiver));let R=this.remoteUserMap.get(r);R?R.set(a,w):this.remoteUserMap.set(r,new Map([[a,w]])),this.statsCollector.addRemoteStats(r.uid),this.statsUploader.startUploadInboundStats();let x=this.pendingRemoteTracks.findIndex(L=>{let{user:U,kind:F}=L;return U.uid===r.uid&&a===F});x!==-1&&(this.pendingRemoteTracks.splice(x,1),this.emit(pn.MediaReconnectEnd,r.uid))}async massSubscribe(r){return this.massSubscribeNoLock(r)}async massSubscribeNoLock(r){if(!this.connection||this.state!==gi.Connected)throw new Ke(ce.INVALID_OPERATION,"Cannot subscribeAll remote users when peerConnection disconnected.");r=r.filter(o=>{var c;let{user:f,mediaType:m}=o;return!((c=this.remoteUserMap.get(f))!==null&&c!==void 0&&c.has(m))});let a=await this.connection.batchReceive(r.map(o=>{let{user:c,mediaType:f,ssrcId:m,rtxSsrcId:v}=o;return{kind:f,ssrcMsg:[{ssrcId:m,rtx:v}],mslabel:String(c._uintid)}}));r.forEach((o,c)=>{let{user:f,mediaType:m}=o,{track:v,id:w,transceiver:C}=a[c];m===Wt.AUDIO?(f._audioTrack?f._audioTrack._updateOriginMediaStreamTrack(v):(f._audioTrack=new gb(v,f.uid,f._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote audio track: ").concat(f._audioTrack.getTrackId()))),C&&f._audioTrack._updateRtpTransceiver(C),this.bindRemoteTrackEvents(f,f._audioTrack)):(f._videoTrack?f._videoTrack._updateOriginMediaStreamTrack(v):(f._videoTrack=new mb(v,f.uid,f._uintid,this.store),z.info("[".concat(this.store.clientId,"] [").concat(this.store.p2pId,"] create remote video track: ").concat(f._videoTrack.getTrackId()))),C&&f._videoTrack._updateRtpTransceiver(C),this.bindRemoteTrackEvents(f,f._videoTrack));let R=this.remoteUserMap.get(f);R?R.set(m,w):this.remoteUserMap.set(f,new Map([[m,w]])),this.statsCollector.addRemoteStats(f.uid),this.statsUploader.startUploadInboundStats();let x=this.pendingRemoteTracks.findIndex(L=>{let{user:U,kind:F}=L;return U.uid===f.uid&&m===F});x!==-1&&(this.pendingRemoteTracks.splice(x,1),this.emit(pn.MediaReconnectEnd,f.uid))})}async unsubscribe(r,a,o){let c=this.pendingRemoteTracks.filter(v=>{let{user:w,kind:C}=v;return a!==void 0?w.uid===r.uid&&a===C:w.uid===r.uid});if(c.forEach(v=>{let w=this.pendingRemoteTracks.indexOf(v);this.pendingRemoteTracks.splice(w,1)}),this.connection&&this.state===gi.Connected||o||c.forEach(v=>{let{kind:w}=v;var C;if(w===Wt.AUDIO)(C=r._audioTrack)===null||C===void 0||C._destroy(),r._audioTrack=void 0;else if(w===Wt.VIDEO){var R;(R=r._videoTrack)===null||R===void 0||R._destroy(),r._videoTrack=void 0}}),!this.connection||this.state!==gi.Connected)return;let f=this.filterTobeUnSubscribedTracks(r,a);if(f.length===0)return;await this.connection.stopReceiving(f.map(v=>{let[,{id:w}]=v;return w}));let m=this.createUnsubscribeMessage(f);return this.withdrawRemoteTracks(f),this.remoteUserMap.size===0&&this.statsUploader.stopUploadInboundStats(),f.forEach(v=>{let[w,{kind:C}]=v;var R,x;if(C===Wt.VIDEO&&w._videoSSRC&&((R=this.connection)===null||R===void 0||R.setStatsRemoteVideoIsReady(w._videoSSRC,!1)),C===Wt.VIDEO)this.unbindRemoteTrackEvents(w._videoTrack),o||((x=w._videoTrack)===null||x===void 0||x._destroy(),w._videoTrack=void 0);else if(C===Wt.AUDIO){var L;this.unbindRemoteTrackEvents(w._audioTrack),!o&&((L=w._audioTrack)===null||L===void 0||L._destroy(),w._audioTrack=void 0)}}),m}async unsubscribeDataChannel(r,a){if(a.forEach(f=>{let m=this.pendingRemoteDataChannels.findIndex(v=>v.id===f.id);m!==-1&&this.pendingRemoteDataChannels.splice(m,1)}),!this.connection)return;let o=this.filterTobeUnSubscribedDataChannels(r,a);if(o.length===0)return;a.forEach(f=>{f._close()});let c=this.remoteDataChannelMap.get(r);return o.forEach(f=>{c&&c.delete(f.id)}),c&&c.size===0&&(this.remoteDataChannelMap.delete(r),await this.connection.stopDataChannels(r.uid)),o.map(f=>f.id)}async massUnsubscribe(r){return this.massUnsubscribeNoLock(r)}async massUnsubscribeNoLock(r){let a=[];for(let{user:f,mediaType:m}of r){let v=this.pendingRemoteTracks.filter(w=>{let{user:C,kind:R}=w;return m!==void 0?C.uid===f.uid&&m===R:C.uid===f.uid});v.forEach(w=>{let C=this.pendingRemoteTracks.indexOf(w);this.pendingRemoteTracks.splice(C,1)}),a=a.concat(v)}if(!this.connection||this.state!==gi.Connected)return void a.forEach(f=>{let{user:m,kind:v}=f;var w;if(v===Wt.AUDIO)(w=m._audioTrack)===null||w===void 0||w._destroy(),m._audioTrack=void 0;else if(v===Wt.VIDEO){var C;(C=m._videoTrack)===null||C===void 0||C._destroy(),m._videoTrack=void 0}});let o=_c(r).call(r,(f,m)=>{let{user:v,mediaType:w}=m,C=this.filterTobeUnSubscribedTracks(v,w);return f.concat(C)},[]);if(o.length===0)return;await this.connection.stopReceiving(o.map(f=>{let[,{id:m}]=f;return m}));let c=this.createUnsubscribeAllMessage(o);return this.withdrawRemoteTracks(o),this.remoteUserMap.size===0&&this.statsUploader.stopUploadInboundStats(),o.forEach(f=>{let[m,{kind:v}]=f;var w,C;if(v===Wt.VIDEO&&m._videoSSRC&&((w=this.connection)===null||w===void 0||w.setStatsRemoteVideoIsReady(m._videoSSRC,!1)),v===Wt.VIDEO)this.unbindRemoteTrackEvents(m._videoTrack),(C=m._videoTrack)===null||C===void 0||C._destroy(),m._videoTrack=void 0;else if(v===Wt.AUDIO){var R;this.unbindRemoteTrackEvents(m._audioTrack),(R=m._audioTrack)===null||R===void 0||R._destroy(),m._audioTrack=void 0}}),c}async muteRemote(r,a){if(!this.connection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel.muteRemote has no remote user ").concat(r.uid,"."));if(!o.get(a))return void z.warning("[".concat(this.store.clientId,"] P2PChannel.muteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."));let c=a===Wt.VIDEO?r._videoSSRC:r._audioSSRC;c!==void 0&&this.connection.setStatsRemoteVideoIsReady(c,!1)}async unmuteRemote(r,a){return this.unmuteRemoteNoLock(r,a)}async unmuteRemoteNoLock(r,a){if(!this.connection)return;let o=this.remoteUserMap.get(r);if(!o)return void z.warning("[".concat(this.store.clientId,"] P2PChannel.unmuteRemote has no remote user ").concat(r.uid,"."));o.get(a)||z.warning("[".concat(this.store.clientId,"] P2PChannel.unmuteRemote has no remote user ").concat(r.uid," media type ").concat(a,"."))}getAllTracks(r){let a=this.localTrackMap.get(ht.LocalAudioTrack);if((a==null?void 0:a.track)instanceof ns){let o=a.track;return Array.from(this.localTrackMap.entries()).filter(c=>{let[f]=c;return f!==ht.LocalAudioTrack}).filter(c=>{let[f]=c;return!(r&&f===ht.LocalVideoLowTrack)}).map(c=>{let[,{track:f}]=c;return f}).concat(o.trackList)}return Array.from(this.localTrackMap.entries()).filter(o=>{let[c]=o;return!(r&&c===ht.LocalVideoLowTrack)}).map(o=>{let[,{track:c}]=o;return c})}getAllDataChannels(){return this.localDataChannels}reportPublishEvent(r,a,o,c,f){if(r){let v=this.localTrackMap.get(ht.LocalAudioTrack),w=c?this.localTrackMap.get(ht.LocalVideoLowTrack):this.localTrackMap.get(ht.LocalVideoTrack);$t.publish(this.store.sessionId,{eventElapse:aa.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.track.getTrackLabel(),videoName:w==null?void 0:w.track.getTrackLabel(),screenshare:(w==null?void 0:w.track._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}else{var m;o||(o=[]);let v=o.find(C=>C instanceof br),w=c?(m=this.localTrackMap.get(ht.LocalVideoTrack))===null||m===void 0?void 0:m.track:o.find(C=>C instanceof ki);$t.publish(this.store.sessionId,{eventElapse:aa.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:r,ec:a,audioName:v==null?void 0:v.getTrackLabel(),videoName:w==null?void 0:w.getTrackLabel(),screenshare:(w==null?void 0:w._hints.indexOf(Hi.SCREEN_TRACK))!==-1,audio:!!v,video:!!w,p2pid:this.store.p2pId,publishRequestid:this.store.pubId,extend:f})}}reportSubscribeEvent(r,a,o,c){let f=c===Wt.VIDEO?o._videoSSRC:o._audioSSRC;f&&$t.subscribe(this.store.sessionId,{succ:r,ec:a,video:c===Wt.VIDEO,audio:c===Wt.AUDIO,peerid:o.uid,subscribeRequestid:c===Wt.VIDEO?o._videoSSRC:o._audioSSRC,p2pid:this.store.p2pId,eventElapse:aa.measureFromSubscribeStart(this.store.clientId,f)})}reset(){z.debug("[".concat(this.store.clientId,"] P2PChannel.reset")),this.mutex=new Ts("P2PChannel-mutex"),this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new W0({},this.store):this.isPlanB?new _b({},this.store):new Ph({},this.store),this.bindConnectionEvents(this.connection)),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),this.statsUploader.stopUploadExtensionUsageStats(),this.unbindLocalTrackEvents(),this.unbindAllRemoteTrackEvents(),this.unbindRtpTransceiver();let r=this.localTrackMap.get(ht.LocalAudioTrack);if((r==null?void 0:r.track)instanceof ns){if(r.track.trackList.length>0){let a=r.track;r.track.trackList.forEach(o=>{a.removeAudioTrack(o)})}r.track.close()}this.localTrackMap.clear(),this.remoteUserMap.clear(),this.statsCollector.removeRemoteStats(),this.statsCollector.removeLocalStats(),this.iceFailedCount=0,this.dtlsFailedCount=0,this.pendingLocalTracks=[],this.pendingRemoteTracks=[],this.localDataChannels=[],this.remoteDataChannelMap.clear(),this.pendingLocalDataChannels=[],this.pendingRemoteDataChannels=[],this.state=gi.Disconnected}getStats(){var r;return(r=this.connection)===null||r===void 0?void 0:r.getStats()}getRemoteVideoIsReady(r){var a;return((a=this.connection)===null||a===void 0?void 0:a.getRemoteVideoIsReady(r))||!1}getLocalAudioVolume(){let r=this.localTrackMap.get(ht.LocalAudioTrack);if(r)return r.track.getVolumeLevel()}getLocalVideoSize(){let r=this.localTrackMap.get(ht.LocalVideoTrack);if(r)return{width:r.track.videoWidth||0,height:r.track.videoHeight||0}}getEncoderConfig(r){let a=this.localTrackMap.get(r);return a&&a.track instanceof ki||a&&a.track instanceof br?a.track._encoderConfig:void 0}getLocalMedia(r){return this.localTrackMap.get(r)}hasLocalMedia(){return this.localTrackMap.size>0}hasRemoteMedia(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}async hasRemoteMediaWithLock(r,a){if(!r)return this.remoteUserMap.size>0;let o=this.remoteUserMap.get(r);return!!o&&(!a||o.has(a))}getRemoteMedia(r){var a;let o=Array.from(tl(a=this.remoteUserMap).call(a)).find(c=>c.uid===r);return o?{audioTrack:o.audioTrack,audioSSRC:o._audioSSRC,videoTrack:o.videoTrack,videoSSRC:o._videoSSRC}:{}}getAudioLevels(){let r=Array.from(this.remoteUserMap.entries()).map(o=>{let[c]=o;return{uid:c.uid,level:c.audioTrack?100*c.audioTrack._source.getAccurateVolumeLevel():0}}),a=this.localTrackMap.get(ht.LocalAudioTrack);return a&&r.push({level:100*a.track._source.getAccurateVolumeLevel(),uid:this.store.uid}),r=JA(r).call(r,(o,c)=>o.level-c.level),r}async disconnectForReconnect(){this.connection&&(z.debug("[".concat(this.store.clientId,"] P2PChannel.disconnectForReconnect closing P2PConnection")),this.state=gi.Reconnecting,ve("KEEP_LAST_FRAME")&&this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a]=r;var o;a._videoTrack&&a._videoTrack._player&&((o=a._videoTrack._player.getVideoElement())===null||o===void 0||o.pause(),a._videoTrack._player.isKeepLastFrame=!0,a._videoTrack._originMediaStreamTrack.stop())}),this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0,this.shouldForwardP2PCreation&&(this.connection=this.store.useDataChannel?new W0({},this.store):this.isPlanB?new _b({},this.store):new Ph({},this.store),this.bindConnectionEvents(this.connection)),this.localTrackMap.size!==0&&(Array.from(this.localTrackMap.entries()).forEach(r=>{var a;let[o,{track:c}]=r;switch(o){case ht.LocalVideoTrack:Tt(a=c._hints).call(a,Hi.LOW_STREAM)?c.close():this.pendingLocalTracks.push(c);break;case ht.LocalAudioTrack:c instanceof ns?this.pendingLocalTracks=this.pendingLocalTracks.concat(c.trackList):this.pendingLocalTracks.push(c);case ht.LocalVideoLowTrack:}}),this.emit(pn.MediaReconnectStart,this.store.uid)),this.unbindLocalTrackEvents(),this.localTrackMap.clear(),this.remoteUserMap.size!==0&&Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;Array.from(tl(o).call(o)).forEach(c=>{this.setPendingRemoteMedia(a,c)}),this.emit(pn.MediaReconnectStart,a.uid)}),this.unbindAllRemoteTrackEvents(),this.remoteUserMap.clear(),this.localDataChannels.length!==0&&(this.localDataChannels.forEach(r=>{this.pendingLocalDataChannels.push(r)}),this.localDataChannels.length=0),this.remoteDataChannelMap.size!==0&&(Array.from(this.remoteDataChannelMap.entries()).forEach(r=>{let[a,o]=r;Array.from(tl(o).call(o)).forEach(c=>{this.setPendingRemoteDataChannel(a,c)})}),this.remoteDataChannelMap.clear()),this.statsUploader.stopUploadOutboundStats(),this.statsUploader.stopUploadInboundStats(),this.statsUploader.stopUploadTransportStats(),z.debug("[".concat(this.store.clientId,"] P2PChannel disconnected, waiting to reconnect.")))}hasPendingRemoteDataChannel(r,a){for(let o of this.pendingRemoteDataChannels){let{user:c,id:f}=o;if((r instanceof z0?r.uid:r)===c.uid&&f===a)return!0}return!1}setPendingRemoteDataChannel(r,a){this.hasPendingRemoteDataChannel(r,a)||this.pendingRemoteDataChannels.push({user:r,id:a})}hasPendingRemoteMedia(r,a){for(let o of this.pendingRemoteTracks){let{user:c,kind:f}=o;if((r instanceof z0?r.uid:r)===c.uid&&a===f)return!0}return!1}setPendingRemoteMedia(r,a){this.hasPendingRemoteMedia(r,a)||this.pendingRemoteTracks.push({user:r,kind:a})}restartICE(r){var a=this;return Ul(function*(){if(!a.connection||a.state!==gi.Connected||a.connection instanceof W0)return;let o=yield Dn(a.mutex.lock("From P2PChannel.restartICE")),c;try{c=yield Dn(a.connection.restartICE(r));let m=yield Dn(c.next());if(m.done)return;let v=m.value,w=yield v;switch(a.reportPCDisconnectedOrFailed(r),r){case Pa.TCP:a._pcStatsUploadType=gm.TCP_RESTART;break;case Pa.RELAY:a._pcStatsUploadType=gm.RELAY_RESTART;break;default:a._pcStatsUploadType=gm.OLD_RESTART}a._isInRestartIce=!0,c.next(w)}catch(m){var f;(f=c)===null||f===void 0||f.throw(m)}finally{o()}})()}getUplinkNetworkQuality(){if(!this.connection)return 0;let r=this.connection.getStats(),a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalAudioTrack),c=r.videoSend.find(F=>F.ssrc===(a==null?void 0:a.ssrcs[0].ssrcId)),f=r.audioSend.find(F=>F.ssrc===(o==null?void 0:o.ssrcs[0].ssrcId));if(!c||!f)return 1;let m=Ml(this,pn.NeedSignalRTT),v=c?c.rttMs:void 0,w=f?f.rttMs:void 0,C=v&&w?(v+w)/2:v||w,R=(C&&m?(C+m)/2:C||m)||0,x=100*r.sendPacketLossRate*.7/50+.3*R/1500,L=x<.17?1:x<.36?2:x<.59?3:x<.1?4:5,U=a==null?void 0:a.track;if(U&&U._encoderConfig&&U._hints.indexOf(Hi.SCREEN_TRACK)===-1){let F=U._encoderConfig.bitrateMax,Z=r.bitrate.actualEncoded;if(F&&Z){let W=(1e3*F-Z)/(1e3*F);return cie[W<.15?0:W<.3?1:W<.45?2:W<.6?3:4][L]}}return L}getDownlinkNetworkQuality(){if(!this.connection)return 0;let r=this.connection.getStats(),a=0;return Array.from(this.remoteUserMap.entries()).forEach(o=>{let[c]=o,f=c._audioSSRC,m=c._videoSSRC,v=r.audioRecv.find(Z=>Z.ssrc===f),w=r.videoRecv.find(Z=>Z.ssrc===m);if(!v&&!w)return void(a+=1);let C=Ml(this,pn.NeedSignalRTT),R=r.rtt,x=(R&&C?(R+C)/2:R||C)||0,L=v?v.jitterMs:void 0,U=r.recvPacketLossRate,F=.7*U*100/50+.3*x/1500;L&&(F=.6*U*100/50+.2*x/1500+.2*L/400),a+=F<.1?1:F<.17?2:F<.36?3:F<.59?4:5}),this.remoteUserMap.size>0?Math.round(a/this.remoteUserMap.size):a}async muteLocalTrack(r){return new Ct((a,o)=>{this.handleMuteLocalTrack(r,a,o)})}async replaceTrack(r,a){var o;if(z.debug("[".concat(this.store.clientId,"] P2PChannel replaceTrack from [").concat(r.getTrackId(),"] to [").concat(a.getTrackId(),"]")),!this.connection||this.state!==gi.Connected)return;let c=Array.from(this.localTrackMap.entries()).find(m=>{let[,{track:v}]=m;return r===v});if(!c)return;let f=c[0];if(r!==a&&(this.unbindLocalTrackEvents([{track:r,type:f}]),this.bindLocalTrackEvents([{track:a,type:f}]),c[1].track=a),await((o=this.connection)===null||o===void 0?void 0:o.replaceTrack(a,c[1].id)),this.isPlanB){let m=c[1];m.id=a._mediaStreamTrack.id,this.localTrackMap.set(f,m)}if(f===ht.LocalVideoTrack&&!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding){let m=this.localTrackMap.get(ht.LocalVideoLowTrack);if(m){let v=r._mediaStreamTrack.clone();m.track._originMediaStreamTrack.stop(),m.track._mediaStreamTrack=v,m.track._originMediaStreamTrack=v,await new Ct((w,C)=>{this.handleReplaceTrack(m.track,w,C,!0)})}}}filterTobePublishedTracks(r,a,o){let c=[],f=this.getAllTracks();r=FS(r=r.filter(C=>f.indexOf(C)===-1));let m,v=!1,w=this.localTrackMap.get(ht.LocalAudioTrack);for(let C of r){if(C instanceof ki&&(this.localTrackMap.has(ht.LocalVideoTrack)||v?new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS).throw():(c.push({track:C,type:ht.LocalVideoTrack}),v=!0),a)){let R=this.getLowVideoTrack(C,o);c.push({track:R,type:ht.LocalVideoLowTrack})}if(C instanceof br)if(w){let R=w.track;if(R instanceof ns)PW([C]),R.addAudioTrack(C),this.bindLocalAudioTrackEvents(C,!0);else{let x=LW([R,C]);z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will replace audioTrack [").concat(x.getTrackId(),"]")),this.replaceTrack(R,x)}}else m instanceof ns?(PW([C]),m.addAudioTrack(C)):m||!C._useAudioElement&&Jn().webAudioMediaStreamDest&&!C._bypassWebAudio?m=LW(m?[C,m]:[C]):m=C}return m&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection will send audioTrack [").concat(m.getTrackId(),"]")),c.push({track:m,type:ht.LocalAudioTrack})),c}filterTobeUnpublishedTracks(r){let a=[],o=this.getAllTracks();r=FS(r=r.filter(c=>o.indexOf(c)!==-1));for(let c of r){if(c instanceof br){let f=this.localTrackMap.get(ht.LocalAudioTrack);if(!f)continue;f.track instanceof ns?(f.track.removeAudioTrack(c),this.unbindLocalAudioTrackEvents(c),f.track.trackList.length===0&&(a.push([ht.LocalAudioTrack,f]),f.track.close())):a.push([ht.LocalAudioTrack,f])}if(c instanceof ki){let f=this.localTrackMap.get(ht.LocalVideoTrack);if(!f)continue;a.push([ht.LocalVideoTrack,f]);let m=this.localTrackMap.get(ht.LocalVideoLowTrack);m&&a.push([ht.LocalVideoLowTrack,m])}}return a}filterTobePublishedDataChannels(r){return r=(r=FS(r)).filter(a=>this.localDataChannels.findIndex(o=>o.id===a.id)===-1)}filterTobeUnpublishedDataChannels(r){return r=(r=(r=FS(r)).filter(a=>this.localDataChannels.indexOf(a)!==-1)).filter(a=>a._originDataChannel)}bindLocalTrackEvents(r){r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.addListener(Mt.GET_STATS,this.handleGetLocalVideoStats),o.addListener(Mt.GET_RTC_STATS,this.handleGetRTCStats),o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.addListener(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.bindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}bindLocalAudioTrackEvents(r,a){r instanceof ns?r.trackList.forEach(o=>{o.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),o.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.addListener(Mt.GET_STATS,this.handleGetLocalAudioStats),r.addListener(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.addListener(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.addListener(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack),a||(r.addListener(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.addListener(Mt.NEED_REPLACE_MIXING_TRACK,this.handleReplaceMixingTrack)))}unbindLocalTrackEvents(r){r||(r=Array.from(this.localTrackMap.entries()).map(a=>{let[o,{track:c}]=a;return{track:c,type:o}})),r.forEach(a=>{let{track:o,type:c}=a;switch(c){case ht.LocalVideoTrack:o.off(Mt.GET_STATS,this.handleGetLocalVideoStats),o.off(Mt.GET_RTC_STATS,this.handleGetRTCStats),o.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),o.off(Mt.NEED_UPDATE_VIDEO_ENCODER,this.handleUpdateVideoEncoder),o.off(Mt.NEED_UPDATE_VIDEO_SEND_PARAMETERS,this.handleUpdateVideoSendParameters),o.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),o.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),o.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack);break;case ht.LocalAudioTrack:this.unbindLocalAudioTrackEvents(o);case ht.LocalVideoLowTrack:}})}unbindLocalAudioTrackEvents(r){r instanceof ns?r.trackList.forEach(a=>{a.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),a.off(Mt.GET_STATS,this.handleGetLocalAudioStats),a.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),a.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack)}):(r.off(Mt.GET_STATS,this.handleGetLocalAudioStats),r.off(Mt.NEED_DISABLE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_ENABLE_TRACK,this.handleUnmuteLocalTrack),r.off(Mt.NEED_REPLACE_TRACK,this.handleReplaceTrack),r.off(Mt.NEED_REPLACE_MIXING_TRACK,this.handleReplaceMixingTrack),r.off(Mt.NEED_MUTE_TRACK,this.handleMuteLocalTrack),r.off(Mt.NEED_UNMUTE_TRACK,this.handleUnmuteLocalTrack))}bindRemoteTrackEvents(r,a){a instanceof mb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteVideoStats(r))}),a instanceof gb&&a.addListener(Mt.GET_STATS,o=>{o(this.handleGetRemoteAudioStats(r))})}unbindRemoteTrackEvents(r){r&&r.removeAllListeners(Mt.GET_STATS)}unbindAllRemoteTrackEvents(){Array.from(this.remoteUserMap.entries()).forEach(r=>{let[a,o]=r;o.has(Wt.AUDIO)&&this.unbindRemoteTrackEvents(a._audioTrack),o.has(Wt.VIDEO)&&this.unbindRemoteTrackEvents(a._videoTrack)})}createGatewayPublishMessage(r,a){return r.map((o,c)=>{var f;let m,v,{track:w,type:C}=o;switch(C){case ht.LocalAudioTrack:m=pi.Audio,v={dtx:w instanceof CD&&w._config.DTX,hq:!1,lq:!1,stereo:!1,speech:!1};break;case ht.LocalVideoTrack:m=Tt(f=w._hints).call(f,Hi.SCREEN_TRACK)?pi.Screen:pi.High,v=$f($f({},Aie(w)),{},{codec:this.store.codec});break;case ht.LocalVideoLowTrack:m=pi.Low,v=$f($f({},Aie(w)),{},{codec:this.store.codec})}return{stream_type:m,attributes:v,ssrcs:a[c]}})}createGatewayUnpublishMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}assignLocalTracks(r,a){r.forEach((o,c)=>{let{track:f,type:m}=o;this.localTrackMap.set(m,{track:f,id:a[c].id,ssrcs:a[c].localSSRC})})}withdrawLocalTracks(r){r.forEach(a=>{let[o]=a;this.localTrackMap.delete(o)})}bindConnectionEvents(r){r.onConnectionStateChange=async a=>{if(z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onConnectionStateChange(").concat(a,")")),this.emit(pn.PeerConnectionStateChange,a),a!=="connected"||this.store.keyMetrics.peerConnectionEnd||this.store.peerConnectionEnd(),a==="connected"&&(this._restartTimer&&(clearTimeout(this._restartTimer),this._restartTimer=void 0),(this._isFirstConnected||this._isInRestartIce)&&this.reportPCStats(Date.now(),!0,this._pcStatsUploadType),this._isInRestartIce=!1,this._isFirstConnected=!1,this._isStartRestartIce=!1),ve("NEW_ICE_RESTART")){var o;if(Tt(o=this._restartStates).call(o,a)){if(this._isStartRestartIce)return;this._isStartRestartIce=!0;let c=v=>{(r.iceConnectionState==="disconnected"||r.iceConnectionState==="checking"||r.iceConnectionState==="failed")&&(z.debug("[".concat(this.store.clientId,"] [P2PChannel] start use restartICE, type is ").concat(v)),Ml(this,pn.QueryClientConnectionState)==="CONNECTED"&&this.emit(pn.RequestRestartICE,v))},f=()=>{r.iceConnectionState!=="disconnected"&&r.iceConnectionState!=="checking"&&r.iceConnectionState!=="failed"||(this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),z.debug("[".concat(this.store.clientId,"] P2PConnection disconnected timeout, force reconnect")),setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,this.requestReconnect())},m=ve("ICE_RESTART_INTERVAL");return void(this._restartTimer=window.setTimeout(()=>{if(ve("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE")&&Jn().supportPCSetConfiguration)c(Pa.RELAY),this._restartTimer=window.setTimeout(f,m);else if(Pi())c(Pa.UDP),this._restartTimer=window.setTimeout(f,4e3);else{if(c(Pa.TCP),Jn().supportPCSetConfiguration)return void(this._restartTimer=window.setTimeout(()=>{c(Pa.RELAY),this._restartTimer=window.setTimeout(f,m)},m));this._restartTimer=window.setTimeout(f,m)}},800))}}else{if(a==="disconnected"&&r.iceConnectionState==="disconnected")return setTimeout(()=>{r.iceConnectionState==="disconnected"&&ve("ICE_RESTART")&&Ml(this,pn.QueryClientConnectionState)==="CONNECTED"&&this.emit(pn.RequestRestartICE)},800),void setTimeout(()=>{r.peerConnectionState==="disconnected"&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection disconnected timeout 4000ms, force reconnect")),this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),this._isInRestartIce=!1,setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,this.requestReconnect())},4e3);a==="failed"&&(z.debug("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection state failed, force reconnect")),this.reportPCDisconnectedOrFailed(),setTimeout(()=>this.emit(pn.P2PLost),0),this.iceFailedCount+=1,await this.requestReconnect())}},r.onICEConnectionStateChange=a=>{a!=="connected"||this.store.keyMetrics.iceConnectionEnd||this.store.iceConnectionEnd(),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICEConnectionStateChange(").concat(a,")")),$t.reportApiInvoke(this.store.sessionId,{name:"ICEConnectionStateChange",options:a,tag:vr.TRACER}).onSuccess(),this.emit(pn.IceConnectionStateChange,a)},r.onICETransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onICETransportStateChange(").concat(a,")"))},r.onDTLSTransportStateChange=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportStateChange(").concat(a,")"))},r.onDTLSTransportError=a=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.onDTLSTransportError(").concat(a,")"))},r.onFirstAudioDecoded=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(m=>m._audioSSRC===a);var f;c&&(this.store.subscribe(c.uid,"audio",void 0,void 0,void 0,Date.now()),(f=c.audioTrack)===null||f===void 0||f.emit(ub.FIRST_FRAME_DECODED),$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_AUDIO_DECODE,fr.FIRST_AUDIO_DECODE,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId}))},r.onFirstAudioReceived=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(f=>f._audioSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_AUDIO_RECEIVED,fr.FIRST_AUDIO_RECEIVED,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onFirstVideoDecoded=(a,o,c)=>{this.reportVideoFirstFrameDecoded(a,o,c)},r.onFirstVideoReceived=a=>{var o;let c=Array.from(tl(o=this.remoteUserMap).call(o)).find(f=>f._videoSSRC===a);c&&$t.firstRemoteFrame(this.store.sessionId,Rs.FIRST_VIDEO_RECEIVED,fr.FIRST_VIDEO_RECEIVED,{peer:c._uintid,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,a),subscribeRequestid:a,p2pid:this.store.p2pId})},r.onSelectedLocalCandidateChanged=(a,o)=>{let c=a.candidateType==="relay",f=o.candidateType==="relay";o.candidateType!=="unknown"&&c===f||this.emit(pn.ConnectionTypeChange,c),z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedLocalCandidateChanged(").concat(JSON.stringify(P0(o))," -> ").concat(JSON.stringify(P0(a)),")"))},r.onSelectedRemoteCandidateChanged=(a,o)=>{z.info("[".concat(this.store.clientId,"] [p2pId: ").concat(this.store.p2pId,"]: P2PConnection.SelectedRemoteCandidateChanged(").concat(JSON.stringify(P0(o))," -> ").concat(JSON.stringify(P0(a)),")"))},r.onFirstVideoDecodedTimeout=a=>{this.reportVideoFirstFrameDecoded(a,void 0,void 0,!0)},r.getLocalVideoStats=()=>{let a=this.statsCollector.getLocalVideoTrackStats(),o=this.statsCollector.getRTCStats();return $f($f({},a),o)}}unbindConnectionEvents(r){r.onConnectionStateChange=void 0,r.onICEConnectionStateChange=void 0,r.onICETransportStateChange=void 0,r.onDTLSTransportStateChange=void 0,r.onDTLSTransportError=void 0,r.onFirstAudioDecoded=void 0,r.onFirstAudioReceived=void 0,r.onFirstVideoDecoded=void 0,r.onFirstVideoReceived=void 0,r.onSelectedLocalCandidateChanged=void 0,r.onSelectedRemoteCandidateChanged=void 0,r.onFirstVideoDecodedTimeout=void 0,r.getLocalVideoStats=void 0}filterTobeMutedTracks(r){let a=[];if(this.getAllTracks().indexOf(r)===-1)return a;let o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ns)return o.track.isActive||a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:m}]=f;return r===m});if(c&&(a.push(c),c[0]===ht.LocalVideoTrack)){let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}return a}filterTobeUnmutedTracks(r){let a=[],o=this.localTrackMap.get(ht.LocalAudioTrack);if(r instanceof br&&(o==null?void 0:o.track)instanceof ns)return o.track.isActive&&a.push([ht.LocalAudioTrack,o]),a;let c=Array.from(this.localTrackMap.entries()).find(f=>{let[,{track:m}]=f;return r===m});if(c)if(c[0]===ht.LocalVideoTrack){a.push(c);let f=this.localTrackMap.get(ht.LocalVideoLowTrack);f&&a.push([ht.LocalVideoLowTrack,f])}else a.push(c);return a}createMuteMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}createUnmuteMessage(r){return r.map(a=>{var o;let c,[f,{track:m,ssrcs:v,id:w}]=a;switch(f){case ht.LocalAudioTrack:c=pi.Audio;break;case ht.LocalVideoTrack:c=Tt(o=m._hints).call(o,Hi.SCREEN_TRACK)?pi.Screen:pi.High;break;case ht.LocalVideoLowTrack:c=pi.Low}return{stream_type:c,ssrcs:v,mid:w}})}filterTobeUnSubscribedTracks(r,a){let o=[],c=this.remoteUserMap.get(r);if(!c)return o;if(a){let f=c.get(a);if(!f)return o;o.push([r,{kind:a,id:f}])}else Array.from(c.entries()).forEach(f=>{let[m,v]=f;o.push([r,{kind:m,id:v}])});return o}filterTobeUnSubscribedDataChannels(r,a){let o=[];return a.forEach(c=>{var f;(f=this.remoteDataChannelMap.get(r))!==null&&f!==void 0&&f.has(c.id)&&o.push(c)}),o}createUnsubscribeMessage(r){let a=[];return r.forEach(o=>{let[c,{kind:f,id:m}]=o;switch(f){case Wt.VIDEO:return void(c._videoSSRC&&a.push({stream_type:Wt.VIDEO,ssrcId:c._videoSSRC}));case Wt.AUDIO:return void(c._audioSSRC&&a.push({stream_type:Wt.AUDIO,ssrcId:c._audioSSRC}))}}),a}createUnsubscribeAllMessage(r){let a=new Map;return r.forEach(o=>{let[c,{kind:f}]=o;if(a.has(c)){let m=a.get(c);f===Wt.VIDEO?m|=ys.Video:m|=ys.Audio,a.set(c,m)}else f===Wt.VIDEO?a.set(c,ys.Video):a.set(c,ys.Audio)}),{users:Array.from(a.entries()).map(o=>{let[c,f]=o;return{stream_id:c.uid,stream_type:f}})}}withdrawRemoteTracks(r){r.forEach(a=>{let[o,{kind:c}]=a,f=this.remoteUserMap.get(o);f&&(f.delete(c),Array.from(f.entries()).length===0&&this.remoteUserMap.delete(o))})}async updateBitrateLimit(r){let a=this.localTrackMap.get(ht.LocalVideoTrack),o=this.localTrackMap.get(ht.LocalVideoLowTrack);a&&await a.track.setBitrateLimit(r.uplink),o&&r.low_stream_uplink&&await o.track.setBitrateLimit({max_bitrate:r.low_stream_uplink.bitrate,min_bitrate:r.low_stream_uplink.bitrate||0})}isP2PDisconnected(){return this.connection?this.connection.peerConnectionState!=="connected":!0}mapPubResToRemoteConfig(r,a){return r.map((o,c)=>{var f;let{stream_type:m}=o;return(f=a.find(v=>{let{stream_type:w}=v;return m===w}))===null||f===void 0?void 0:f.attributes})}async tryToUnmuteAudio(r){for(let o=0;o<r.length;o++)if(r[o]instanceof br){var a;let c=this.filterTobeUnmutedTracks(r[o]);if(c.length===0)continue;await((a=this.connection)===null||a===void 0?void 0:a.unmuteLocal(c.map(m=>{let[,{id:v}]=m;return v})));let f=this.createUnmuteMessage(c);return void await Li(this,pn.RequestUnmuteLocal,f)}}bindStatsUploaderEvents(){this.statsUploader.requestStats=()=>this.getStats(),this.statsUploader.requestLocalMedia=()=>Array.from(this.localTrackMap.entries()),this.statsUploader.requestRemoteMedia=()=>Array.from(this.remoteUserMap.entries()),this.statsUploader.requestVideoIsReady=r=>{var a;return!((a=this.connection)===null||a===void 0||!a.getRemoteVideoIsReady(r))},this.statsUploader.requestUpload=(r,a)=>this.emit(pn.RequestUpload,r,a),this.statsUploader.requestUploadStats=r=>this.emit(pn.RequestUploadStats,r),this.statsUploader.requestAllTracks=()=>this.getAllTracks()}unbindStatsUploaderEvents(){this.statsUploader.requestStats=void 0,this.statsUploader.requestLocalMedia=void 0,this.statsUploader.requestRemoteMedia=void 0,this.statsUploader.requestVideoIsReady=void 0}async requestReconnect(){this.dtlsFailedCount+=1,await vs(j8(this.dtlsFailedCount,kr)),this.emit(pn.RequestReconnect)}async reconnectP2P(){let r=Array.from(this.localTrackMap.entries()),a=this.createGatewayUnpublishMessage(r);Array.from(this.remoteUserMap.entries()),a.length>0&&await Kr(this,pn.RequestUnpublishForReconnectPC,a),this.disconnectForReconnect(),this.emit(pn.RequestReconnectPC)}canPublishLowStream(){return this.localTrackMap.has(ht.LocalVideoTrack)||this.pendingLocalTracks.some(r=>r instanceof ki)}throwIfTrackTypeNotMatch(r){if(r.filter(a=>a instanceof ki).length>1)throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(r.filter(a=>a instanceof br).length>1&&(r.some(a=>a instanceof br&&a._bypassWebAudio)||!Jn().webAudioMediaStreamDest))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode");for(let a of r){if(a instanceof ki&&this.pendingLocalTracks.some(o=>o instanceof ki))throw new Ke(ce.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(a instanceof br&&this.pendingLocalTracks.some(o=>o instanceof br)&&(!Jn().webAudioMediaStreamDest||a._bypassWebAudio||this.pendingLocalTracks.some(o=>o instanceof br&&o._bypassWebAudio)))throw new Ke(ce.NOT_SUPPORTED,"cannot publish multiple tracks which one of them configured with bypassWebAudio or your browser doesn't support MediaStreamDestNode")}}getLowVideoTrack(r,a){let o=!ve("DISABLE_DUAL_STREAM_USE_ENCODING")&&Jn().supportDualStreamEncoding,c=$f($f({},{width:160,height:120,framerate:15,bitrate:50}),a),f;f=o?r._mediaStreamTrack.clone():OW(r,c);let m=Di(8,"track-low-"),v=new ki(f,$f($f({},o&&{scaleResolutionDownBy:oG(c,r)}),{},{frameRate:c.framerate,bitrateMax:c.bitrate,bitrateMin:c.bitrate}),void 0,void 0,m);return v.on(i_.TRANSCEIVER_UPDATED,w=>{r._updateRtpTransceiver(w,cb.LOW_STREAM)}),v._hints.push(Hi.LOW_STREAM),r.on("sei-to-send",w=>{v.emit("sei-to-send",w)}),r.addListener(Mt.NEED_CLOSE,()=>{v.close()}),v}async globalLock(){return this.mutex.lock("From P2PChannel.globalLock")}async reportPCStats(r,a,o){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(this.connection&&this.connection instanceof Ph){var f,m,v,w;let C=this.store.keyMetrics.descriptionStart||0,{iceConnectionState:R,dtlsTransportState:x,peerConnectionState:L}=this.connection,{local:U,remote:F}=await this.connection.getSelectedCandidatePair();$t.pcStats(this.store.sessionId,{startTime:C,eventElapse:r-C||0,iceconnectionsate:R,dtlsstate:x,connectionstate:L,intSucc:a?1:2,error:c,selectedLocalCandidateProtocol:(f=U==null?void 0:U.protocol)!==null&&f!==void 0?f:"",selectedLocalCandidateType:(m=U.candidateType)!==null&&m!==void 0?m:"",selectedLocalCandidateAddress:"".concat(U.address,":").concat(U.port),selectedRemoteCandidateProtocol:(v=F.protocol)!==null&&v!==void 0?v:"",selectedRemoteCandidateType:(w=F.candidateType)!==null&&w!==void 0?w:"",selectedRemoteCandidateAddress:"".concat(F.address,":").concat(F.port),restartCnt:o})}}reportVideoFirstFrameDecoded(r,a,o,c){var f;let m=Array.from(tl(f=this.remoteUserMap).call(f)).find(v=>v._videoSSRC===r);if(m){c||this.store.subscribe(m.uid,"video",void 0,void 0,void 0,void 0,Date.now());let v=this.store.keyMetrics,w=v.subscribe.find(C=>C.userId===m.uid&&C.type==="video");$t.firstRemoteVideoDecode(this.store.sessionId,Rs.FIRST_VIDEO_DECODE,fr.FIRST_VIDEO_DECODE,{peer:m._uintid,videowidth:a,videoheight:o,subscribeElapse:aa.measureFromSubscribeStart(this.store.clientId,r),subscribeRequestid:r,p2pid:this.store.p2pId,apEnd:v.requestAPEnd||0,apStart:v.requestAPStart||0,joinGwEnd:v.joinGatewayEnd||0,joinGwStart:v.joinGatewayStart||0,pcEnd:v.peerConnectionEnd||0,pcStart:v.peerConnectionStart||0,subscriberEnd:(w==null?void 0:w.subscribeEnd)||0,subscriberStart:(w==null?void 0:w.subscribeStart)||0,videoAddNotify:(w==null?void 0:w.streamAdded)||0,state:c?1:0})}}async remoteMediaSsrcChanged(r,a,o){if(!this.connection)return!1;let c=this.remoteUserMap.get(r);if(!c)return!1;let f=c.get(a);if(!f)return!1;let m=await this.connection.getRemoteSSRC(f);return m!==void 0&&m!==o}resetConnection(r){z.debug("[".concat(this.store.clientId,"] [P2PChannel] reset connection to ").concat(r)),this.state===gi.Connected?(z.debug("[".concat(this.store.clientId,"] [P2PChannel] fallback to websocket but P2PChannel state still connected, disconnect first")),this.disconnectForReconnect()):(this.connection&&(this.connection.close(),this.unbindConnectionEvents(this.connection),this.connection=void 0),this.shouldForwardP2PCreation&&(this.connection=r===yie.datachannel?new W0({},this.store):this.isPlanB?new _b({},this.store):new Ph({},this.store),this.bindConnectionEvents(this.connection)))}unbindRtpTransceiver(){this.localTrackMap.size!==0&&Array.from(this.localTrackMap.entries()).forEach(r=>{let[a,{track:o}]=r;a===ht.LocalVideoLowTrack?o._updateRtpTransceiver(void 0,cb.LOW_STREAM):o._updateRtpTransceiver(void 0)})}reportPCDisconnectedOrFailed(r){this.connection&&this.connection instanceof Ph&&(this.connection.iceConnectionState!=="disconnected"&&this.connection.iceConnectionState!=="checking"&&this.connection.iceConnectionState!=="failed"||(this._isFirstConnected?(this.reportPCStats(Date.now(),!1,this._pcStatsUploadType),this._isFirstConnected=!1):this._pcStatsUploadType===gm.TCP_RESTART&&r===Pa.RELAY?this.reportPCStats(Date.now(),!1,this._pcStatsUploadType):this.reportPCStats(Date.now(),!1,gm.DISCONNECTED_OR_FAILED)))}},vt(kn.prototype,"startP2PConnection",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"startP2PConnection"),kn.prototype),vt(kn.prototype,"connect",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"connect"),kn.prototype),vt(kn.prototype,"updateRemoteRTPCapabilities",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"updateRemoteRTPCapabilities"),kn.prototype),vt(kn.prototype,"preConnect",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"preConnect"),kn.prototype),vt(kn.prototype,"publishDataChannel",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"publishDataChannel"),kn.prototype),vt(kn.prototype,"unpublish",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unpublish"),kn.prototype),vt(kn.prototype,"unpublishDataChannel",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unpublishDataChannel"),kn.prototype),vt(kn.prototype,"unpublishLowStream",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unpublishLowStream"),kn.prototype),vt(kn.prototype,"subscribeDataChannel",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"subscribeDataChannel"),kn.prototype),vt(kn.prototype,"subscribe",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"subscribe"),kn.prototype),vt(kn.prototype,"massSubscribe",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"massSubscribe"),kn.prototype),vt(kn.prototype,"unsubscribe",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unsubscribe"),kn.prototype),vt(kn.prototype,"unsubscribeDataChannel",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unsubscribeDataChannel"),kn.prototype),vt(kn.prototype,"massUnsubscribe",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"massUnsubscribe"),kn.prototype),vt(kn.prototype,"muteRemote",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"muteRemote"),kn.prototype),vt(kn.prototype,"unmuteRemote",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"unmuteRemote"),kn.prototype),vt(kn.prototype,"hasRemoteMediaWithLock",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"hasRemoteMediaWithLock"),kn.prototype),vt(kn.prototype,"disconnectForReconnect",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"disconnectForReconnect"),kn.prototype),vt(kn.prototype,"updateBitrateLimit",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"updateBitrateLimit"),kn.prototype),vt(kn.prototype,"remoteMediaSsrcChanged",[ba],Object.getOwnPropertyDescriptor(kn.prototype,"remoteMediaSsrcChanged"),kn.prototype),kn);function ba(r,a,o){let c=r[a];if(typeof c!="function")throw new Error("Cannot use mutex on object property.");return o.value=async function(){let f=this.mutex,m=await f.lock("From P2PChannel.".concat(a));try{for(var v=arguments.length,w=new Array(v),C=0;C<v;C++)w[C]=arguments[C];return await c.apply(this,w)}finally{m()}},o}function L4e(r){let a=Nle();return function(o,c){let f=o.appId;f!==void 0&&(yi(c,10),Kf(c,f));let m=o.cid;m!==void 0&&(yi(c,16),yi(c,m));let v=o.cname;v!==void 0&&(yi(c,26),Kf(c,v));let w=o.deviceId;w!==void 0&&(yi(c,34),Kf(c,w));let C=o.elapse;C!==void 0&&(yi(c,40),$0(c,C));let R=o.fileSize;R!==void 0&&(yi(c,48),$0(c,wb(R)));let x=o.height;x!==void 0&&(yi(c,56),$0(c,wb(x)));let L=o.jpg;L!==void 0&&(yi(c,66),yi(c,L.length),function(Ou,at){let yt=Sb(Ou,at.length);Ou.bytes.set(at,yt)}(c,L));let U=o.networkType;U!==void 0&&(yi(c,72),$0(c,wb(U)));let F=o.osType;F!==void 0&&(yi(c,80),$0(c,wb(F)));let Z=o.requestId;Z!==void 0&&(yi(c,90),Kf(c,Z));let W=o.sdkVersion;W!==void 0&&(yi(c,98),Kf(c,W));let K=o.sequence;K!==void 0&&(yi(c,104),$0(c,wb(K)));let oe=o.sid;oe!==void 0&&(yi(c,114),Kf(c,oe));let ue=o.timestamp;ue!==void 0&&(yi(c,120),$0(c,ue));let xe=o.uid;xe!==void 0&&(yi(c,128),yi(c,xe));let Oe=o.vid;Oe!==void 0&&(yi(c,136),yi(c,Oe));let ke=o.width;ke!==void 0&&(yi(c,144),$0(c,wb(ke)));let He=o.service;He!==void 0&&(yi(c,152),yi(c,He));let lt=o.callbackData;lt!==void 0&&(yi(c,162),Kf(c,lt));let ut=o.jpgEncryption;ut!==void 0&&(yi(c,168),yi(c,ut));let ft=o.requestType;ft!==void 0&&(yi(c,176),yi(c,ft));let zt=o.scorePorn;zt!==void 0&&(yi(c,185),VW(c,zt));let $n=o.scoreSexy;$n!==void 0&&(yi(c,193),VW(c,$n));let hi=o.scoreNeutral;hi!==void 0&&(yi(c,201),VW(c,hi));let Gi=o.scene;Gi!==void 0&&(yi(c,208),yi(c,Gi));let Ur=o.ossFilePrefix;Ur!==void 0&&(yi(c,218),Kf(c,Ur));let mr=o.serviceVendor;if(mr!==void 0)for(let Ou of mr){yi(c,226);let at=Nle();M4e(Ou,at),yi(c,at.limit),B4e(c,at),F4e(at)}}(r,a),function(o){let c=o.bytes,f=o.limit;return c.length===f?c:c.subarray(0,f)}(a)}function D4e(r){return function(o){let c={};e:for(;!Ole(o);){let f=qf(o);switch(f>>>3){case 0:break e;case 1:c.code=qf(o);break;case 2:c.msg=Ple(o,qf(o));break;case 3:{let m=j4e(o);c.data=k4e(o),o.limit=m;break}default:Ale(o,7&f)}}return c}({bytes:a=r,offset:0,limit:a.length});var a}function k4e(r){let a={};e:for(;!Ole(r);){let o=qf(r);switch(o>>>3){case 0:break e;case 1:a.requestId=Ple(r,qf(r));break;case 2:a.requestType=qf(r)>>>0;break;case 3:a.scorePorn=BW(r);break;case 4:a.scoreSexy=BW(r);break;case 5:a.scoreNeutral=BW(r);break;case 6:a.requestScene=qf(r)>>>0;break;case 7:a.scene=qf(r)>>>0;break;default:Ale(r,7&o)}}return a}function M4e(r,a){let o=r.service;o!==void 0&&(yi(a,8),yi(a,o));let c=r.vendor;c!==void 0&&(yi(a,16),yi(a,c));let f=r.token;f!==void 0&&(yi(a,26),Kf(a,f));let m=r.callbackUrl;m!==void 0&&(yi(a,34),Kf(a,m))}function j4e(r){let a=qf(r),o=r.limit;return r.limit=r.offset+a,o}function Ale(r,a){switch(a){case 0:for(;128&Lle(r););break;case 2:UW(r,qf(r));break;case 5:UW(r,4);break;case 1:UW(r,8);break;default:throw new Error("Unimplemented type: "+a)}}let U4e=new Float32Array(1);new Uint8Array(U4e.buffer);let jW=new Float64Array(1),ol=new Uint8Array(jW.buffer);function wb(r){return{low:r|=0,high:r>>31,unsigned:r>=0}}let Ile=[];function Nle(){let r=Ile.pop();return r?(r.offset=r.limit=0,r):{bytes:new Uint8Array(64),offset:0,limit:0}}function F4e(r){Ile.push(r)}function UW(r,a){if(r.offset+a>r.limit)throw new Error("Skip past limit");r.offset+=a}function Ole(r){return r.offset>=r.limit}function Sb(r,a){let o=r.bytes,c=r.offset,f=r.limit,m=c+a;if(m>o.length){let v=new Uint8Array(2*m);v.set(o),r.bytes=v}return r.offset=m,m>f&&(r.limit=m),c}function FW(r,a){let o=r.offset;if(o+a>r.limit)throw new Error("Read past limit");return r.offset+=a,o}function Ple(r,a){let o=FW(r,a),c=String.fromCharCode,f=r.bytes,m="<22>",v="";for(let w=0;w<a;w++){let C,R,x,L,U=f[w+o];128&U?(224&U)==192?w+1>=a?v+=m:(C=f[w+o+1],(192&C)!=128?v+=m:(L=(31&U)<<6|63&C,L<128?v+=m:(v+=c(L),w++))):(240&U)==224?w+2>=a?v+=m:(C=f[w+o+1],R=f[w+o+2],(49344&(C|R<<8))!=32896?v+=m:(L=(15&U)<<12|(63&C)<<6|63&R,L<2048||L>=55296&&L<=57343?v+=m:(v+=c(L),w+=2))):(248&U)==240?w+3>=a?v+=m:(C=f[w+o+1],R=f[w+o+2],x=f[w+o+3],(12632256&(C|R<<8|x<<16))!=8421504?v+=m:(L=(7&U)<<18|(63&C)<<12|(63&R)<<6|63&x,L<65536||L>1114111?v+=m:(L-=65536,v+=c(55296+(L>>10),56320+(1023&L)),w+=3))):v+=m:v+=c(U)}return v}function Kf(r,a){let o=a.length,c=0;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),c+=w<128?1:w<2048?2:w<65536?3:4}yi(r,c);let f=Sb(r,c),m=r.bytes;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),w<128?m[f++]=w:(w<2048?m[f++]=w>>6&31|192:(w<65536?m[f++]=w>>12&15|224:(m[f++]=w>>18&7|240,m[f++]=w>>12&63|128),m[f++]=w>>6&63|128),m[f++]=63&w|128)}}function B4e(r,a){let o=Sb(r,a.limit),c=r.bytes,f=a.bytes;for(let m=0,v=a.limit;m<v;m++)c[m+o]=f[m]}function Lle(r){return r.bytes[FW(r,1)]}function Dle(r,a){let o=Sb(r,1);r.bytes[o]=a}function BW(r){let a=FW(r,8),o=r.bytes;return ol[0]=o[a++],ol[1]=o[a++],ol[2]=o[a++],ol[3]=o[a++],ol[4]=o[a++],ol[5]=o[a++],ol[6]=o[a++],ol[7]=o[a++],jW[0]}function VW(r,a){let o=Sb(r,8),c=r.bytes;jW[0]=a,c[o++]=ol[0],c[o++]=ol[1],c[o++]=ol[2],c[o++]=ol[3],c[o++]=ol[4],c[o++]=ol[5],c[o++]=ol[6],c[o++]=ol[7]}function qf(r){let a,o=0,c=0;do a=Lle(r),o<32&&(c|=(127&a)<<o),o+=7;while(128&a);return c}function yi(r,a){for(a>>>=0;a>=128;)Dle(r,127&a|128),a>>>=7;Dle(r,a)}function $0(r,a){let o=a.low>>>0,c=(a.low>>>28|a.high<<4)>>>0,f=a.high>>>24,m=f===0?c===0?o<16384?o<128?1:2:o<1<<21?3:4:c<16384?c<128?5:6:c<1<<21?7:8:f<128?9:10,v=Sb(r,m),w=r.bytes;switch(m){case 10:w[v+9]=f>>>7&1;case 9:w[v+8]=m!==9?128|f:127&f;case 8:w[v+7]=m!==8?c>>>21|128:c>>>21&127;case 7:w[v+6]=m!==7?c>>>14|128:c>>>14&127;case 6:w[v+5]=m!==6?c>>>7|128:c>>>7&127;case 5:w[v+4]=m!==5?128|c:127&c;case 4:w[v+3]=m!==4?o>>>21|128:o>>>21&127;case 3:w[v+2]=m!==3?o>>>14|128:o>>>14&127;case 2:w[v+1]=m!==2?o>>>7|128:o>>>7&127;case 1:w[v]=m!==1?128|o:127&o}}function kle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}let V4e=new Map([["moderation",1],["supervise",2]]);class WD extends nr{get connectionState(){return this._connectionState}set connectionState(a){if(this._connectionState===a)return;let o=this._connectionState;this._connectionState=a,this.emit(As.CONNECTION_STATE_CHANGE,o,a)}get inspectType(){return this._inspectType}set inspectType(a){var o;this._inspectMode=_c(o=a.map(c=>V4e.get(c)||0)).call(o,(c,f)=>c+f),this._inspectType=a}get quality(){return this._quality}set quality(a){this._quality=a>1?1:a<.1?.1:a,this.qualityTimer&&(window.clearTimeout(this.qualityTimer),this.qualityTimer=null),this._quality>=1||(this.qualityTimer=window.setTimeout(()=>{this.quality=this._quality/this.qualityRatio},6e4))}constructor(a){super(),X(this,"name","AgoraRTCVideoContentInspect"),X(this,"_connectionState",mu.CONNECTING),X(this,"_innerConnectionState",void 0),X(this,"sequence",0),X(this,"inspectStartTime",void 0),X(this,"workerManagerConnection",void 0),X(this,"workerConnection",void 0),X(this,"workerMessageLengthLimit",void 0),X(this,"inspectIntervalMinimum",void 0),X(this,"qualityRatio",void 0),X(this,"_connectInfo",void 0),X(this,"_cancelTokenSource",Io.CancelToken.source()),X(this,"_retryConfig",void 0),X(this,"wmSequence",0),X(this,"inspectInterval",void 0),X(this,"inspectTimer",null),X(this,"ossFilePrefix",void 0),X(this,"extraInfo",void 0),X(this,"_inspectType",void 0),X(this,"_inspectMode",void 0),X(this,"_quality",1),X(this,"qualityTimer",null),X(this,"_inspectId",void 0),X(this,"_needWorkUrlOnly",!1),X(this,"inspectImage",()=>{if(this.connectionState!==mu.CONNECTED)throw new De(ce.OPERATION_ABORTED,"content inspect service connection status is ".concat(this.connectionState));this.inspectTimer&&(window.clearInterval(this.inspectTimer),this.inspectTimer=null),this.inspectTimer=window.setInterval(()=>{this.connectionState===mu.CONNECTED?this.requestToInspectImage():z.debug("[".concat(this._inspectId,"] Inspect State is not connected , "),this.connectionState)},this.inspectInterval<this.inspectIntervalMinimum?this.inspectIntervalMinimum:this.inspectInterval),this.requestToInspectImage()}),this._inspectId=Di(5,"inspect-"),this.workerMessageLengthLimit=ve("VIDEO_INSPECT_WORKER_MESSAGE_LENGTH_LIMIT"),this.inspectIntervalMinimum=ve("VIDEO_INSPECT_INTERVAL_MINIMUM"),this.qualityRatio=ve("VIDEO_INSPECT_QUALITY_RATIO"),this.inspectInterval=a.interval,this.ossFilePrefix=a.ossFilePrefix,this.extraInfo=a.extraInfo,this.inspectType=a.inspectType,this.inspectStartTime=Number(Date.now()),this.workerManagerConnection=new E3("worker-manager-"+this._inspectId,kr),this.on(As.STATE_CHANGE,(o,c)=>{this._innerConnectionState=o,z.debug("[".concat(this._inspectId,"] Inspect operation :").concat(gu[o]," ").concat(c||""))}),this.handleWorkerManagerEvents(),this.workerConnection=new E3("worker-"+this._inspectId,kr),this.handleWorkerEvents()}async init(a,o){this.emit(As.STATE_CHANGE,gu.CONNECT_AP),this._connectInfo=a;let c=this._cancelTokenSource.token;return this._retryConfig=o,new Ct((f,m)=>{this.on(As.CONNECTION_STATE_CHANGE,(v,w)=>{w===mu.CONNECTED&&f()}),this.requestAP(a,c,o).then(v=>{this.connectWorkerManager(v)}).catch(v=>{m(v)})})}async requestAP(a,o,c){let f=ve("WEBCS_DOMAIN").map(w=>"https://".concat(w,"/api/v1")),m=await function(w,C,R,x){let{appId:L,areaCode:U,cname:F,sid:Z,token:W,uid:K}=C;qS++;let oe="image_moderation_api",ue={service_name:oe,json_body:JSON.stringify({appId:L,areaCode:U,cname:F,command:"allocateEdge",requestId:qS,seq:qS,sid:Z,token:W,ts:Date.now(),uid:K+""})},xe,Oe,ke=w[0];return wh(async()=>{xe=Date.now();let He=await Th(ke,{data:ue,cancelToken:R,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"},params:{action:"wrtc_gateway"}});if(Oe=Date.now()-xe,He.code!==0){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap error, code"+He.code,{retry:!0,responseTime:Oe});throw z.error(zt.toString()),zt}let lt=JSON.parse(He.json_body);if(lt.code!==200){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap error, code: ".concat(lt.code,", reason: ").concat(lt.reason),{code:lt.code,responseTime:Oe});throw z.error(zt.toString()),zt}if(!lt.servers||!Array.isArray(lt.servers)||lt.servers.length===0){let zt=new De(ce.UNEXPECTED_RESPONSE,"image inspect ap empty server",{code:lt.code,responseTime:Oe});throw z.error(zt.toString()),zt}let ut=ve("VIDEO_INSPECT_WORKER_MANAGER_HOST"),ft=ve("VIDEO_INSPECT_WORKER_MANAGER_PORT");return{addressList:lt.servers.map(zt=>{let{address:$n,wss:hi}=zt;if($n&&hi)return"wss://".concat($n.replace(/\./g,"-"),".").concat(ut,":").concat(ft||hi)}).filter(zt=>!!zt),workerToken:lt.workerToken,vid:lt.vid,responseTime:Oe}},(He,lt)=>($t.apworkerEvent(Z,{success:!0,sc:200,serviceName:oe,responseDetail:JSON.stringify(He.addressList),firstSuccess:lt===0,responseTime:Oe,serverIp:w[lt%w.length]}),!1),(He,lt)=>($t.apworkerEvent(Z,{success:!1,sc:He.data&&He.data.code||200,serviceName:oe,responseTime:Oe,serverIp:w[lt%w.length]}),!!(He.code!==ce.OPERATION_ABORTED&&He.code!==ce.UNEXPECTED_RESPONSE||He.data&&He.data.retry)&&(ke=w[(lt+1)%w.length],!0)),x)}(f,a,o,c);this.emit(As.STATE_CHANGE,gu.AP_CONNECTED);let{addressList:v}=m;return this.wmSequence++,v}async connectWorkerManager(a){let o=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this._needWorkUrlOnly=o,this.emit(As.STATE_CHANGE,gu.CONNECT_WORKER_MANAGER),await this.workerManagerConnection.init(a,1e4)}async connectWorker(a){await this.workerConnection.init([a])}handleWorkerManagerEvents(){this.workerManagerConnection.on(En.CONNECTED,async()=>{this.emit(As.STATE_CHANGE,gu.WORKER_MANAGER_CONNECTED,this.workerManagerConnection.url),this.workerManagerConnection.sendMessage({appId:this._connectInfo.appId,cname:this._connectInfo.cname,uid:this._connectInfo.uid+"",sdkVersion:"4.21.0",sid:this._connectInfo.sid,seq:this.wmSequence,ts:Number(Date.now()),requestId:Math.floor(1e12*Math.random()),allocate:!0,clientRequest:{command:"join"}},!0)}),this.workerManagerConnection.on(En.CLOSED,()=>{this._innerConnectionState<gu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Inspect worker manager is closed before connecting worker"))}),this.workerManagerConnection.on(En.FAILED,()=>{this._innerConnectionState<gu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Connecting inspect worker manager is failed before connecting worker"))}),this.workerManagerConnection.on(En.RECONNECTING,()=>{this._innerConnectionState<gu.GET_WORKER_MANAGER_RESPONSE&&z.debug("[".concat(this._inspectId,"] Inspect worker manager is reconnecting before connecting worker"))}),this.workerManagerConnection.on(En.ON_MESSAGE,async a=>{this.emit(As.STATE_CHANGE,gu.GET_WORKER_MANAGER_RESPONSE);let o=this.workerManagerConnection.url;this.workerManagerConnection.close();let c=JSON.parse(a.data);if(c.code!==200)throw z.error("[".concat(this._inspectId,"] Unexpected code ").concat(c.code," from worker manager")),new De(ce.UNEXPECTED_RESPONSE,"response code of worker is unexpected",c);if(!(c.serverResponse&&c.serverResponse.portWss&&o))throw z.error("[".concat(this._inspectId,"] Unexpected content from worker manager : ").concat(JSON.stringify(c))),new De(ce.UNEXPECTED_RESPONSE,"response content of worker is unexpected",c);{let f=ve("VIDEO_INSPECT_WORKER_PORT")||c.serverResponse.portWss,m=o.replace(/:\d+\/?$/,":".concat(f));this.emit(As.STATE_CHANGE,gu.CONNECT_WORKER,m),this._needWorkUrlOnly?this.emit(As.REQUEST_NEW_WORKER_URL,m):await this.connectWorker(m)}}),this.workerManagerConnection.on(En.WILL_RECONNECT,(a,o,c)=>{c(a)}),this.workerManagerConnection.on(En.REQUEST_NEW_URLS,(a,o)=>{this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(a).catch(o)})}handleWorkerEvents(){this.workerConnection.on(En.CONNECTED,async()=>{this.emit(As.STATE_CHANGE,gu.WORKER_CONNECTED,this.workerConnection.url),this.connectionState=mu.CONNECTED}),this.workerConnection.on(En.ON_MESSAGE,async a=>{if(a.data instanceof ArrayBuffer){let c=D4e(new Uint8Array(a.data));if(ve("SHOW_VIDEO_INSPECT_WORKER_MESSAGE")&&z.debug("[".concat(this._inspectId,"] Response message for worker of inspect content "),JSON.stringify(c)),c.code===200){if(Array.isArray(this.inspectType)&&this.inspectType.length===1&&this.inspectType[0]==="supervise")return void this.emit(As.INSPECT_RESULT,void 0,void 0);if(c.data&&c.data.scorePorn&&c.data.scoreSexy&&c.data.scoreNeutral){var o;let f={porn:c.data.scorePorn,sexy:c.data.scoreSexy,neutral:c.data.scoreNeutral},m=_c(o=Object.keys(f)).call(o,(w,C)=>f[w]>f[C]?w:C,"porn"),v=Object.keys(f).find(w=>w===m);this.emit(As.INSPECT_RESULT,v)}else this.emit(As.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,c.code+"","There is an unexpected data on message"))}else this.emit(As.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,c.code+"",c.msg))}else z.error("[".concat(this._inspectId,"] Unexpected message type from worker")),this.emit(As.INSPECT_RESULT,void 0,new De(ce.UNEXPECTED_RESPONSE,"invalid worker message type"))}),this.workerConnection.on(En.CLOSED,()=>{this.connectionState=mu.CLOSED}),this.workerConnection.on(En.FAILED,()=>{this.connectionState=mu.CLOSED}),this.workerConnection.on(En.RECONNECTING,()=>{this.connectionState=this.connectionState===mu.CONNECTED?mu.RECONNECTING:mu.CONNECTING}),this.workerConnection.on(En.WILL_RECONNECT,(a,o,c)=>{a==="recover"&&c(a),c("tryNext")}),this.workerConnection.on(En.REQUEST_NEW_URLS,(a,o)=>{this.workerManagerConnection.close(),this.once(As.REQUEST_NEW_WORKER_URL,c=>{a([c])}),this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(c=>{this.connectWorkerManager(c,!0)}).catch(c=>{o(c)})})}static intToLong(a){return{low:a|=0,high:a>>31,unsigned:a>=0}}async requestToInspectImage(){this.sequence++;let a=Ml(this,As.CLIENT_LOCAL_VIDEO_TRACK),o={appId:this._connectInfo.appId,cname:this._connectInfo.cname,cid:this._connectInfo.cid,sid:this._connectInfo.sid,uid:this._connectInfo.uid,vid:this._connectInfo.vid};if(a){if(!a.isPlaying)return void this.emit(As.INSPECT_RESULT,void 0,new De(ce.INVALID_OPERATION,"Only the track being played can be inspected"));let c=await this.generateRequestData(a,o);this.workerConnection.sendMessage(c,!0,!0)}else this.emit(As.INSPECT_RESULT,void 0,new De(ce.INVALID_OPERATION,"Only the track being published can be inspected"))}async generateRequestData(a,o){let{appId:c,cname:f,cid:m,vid:v,sid:w,uid:C}=o,R=Date.now(),x=await a.getCurrentFrameImage("image/jpeg",this.quality),L=await Mse(x,c,f),U=this.sequence+"-"+m+"-"+C+"-"+R+"-"+Di(12,""),F={appId:c,cid:m,cname:f,deviceId:"",elapse:WD.intToLong(Number(R-this.inspectStartTime)),fileSize:L.byteLength,jpgEncryption:2,height:x.height,width:x.width,jpg:L,networkType:6,osType:7,requestId:U,sdkVersion:"4.21.0",sequence:this.sequence,sid:w,timestamp:WD.intToLong(R),uid:C,vid:v,service:this._inspectMode,callbackData:this.extraInfo,ossFilePrefix:this.ossFilePrefix};this.extraInfo===void 0&&delete F.callbackData,this.ossFilePrefix===void 0&&delete F.ossFilePrefix;let Z=L4e(F);if(Z.byteLength<this.workerMessageLengthLimit){if(ve("SHOW_VIDEO_INSPECT_WORKER_MESSAGE")){let W=function(K){for(var oe=1;oe<arguments.length;oe++){var ue=arguments[oe]!=null?arguments[oe]:{};oe%2?kle(Object(ue),!0).forEach(function(xe){X(K,xe,ue[xe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(ue)):kle(Object(ue)).forEach(function(xe){Object.defineProperty(K,xe,Object.getOwnPropertyDescriptor(ue,xe))})}return K}({},F);delete W.jpg,z.debug("[".concat(this._inspectId,"] Request message for worker of inspect content "),JSON.stringify(W))}return Z}{let W=this.quality*this.qualityRatio;return this.quality=W,await this.generateRequestData(a,{appId:c,cname:f,cid:m,vid:v,sid:w,uid:C})}}close(){this._cancelTokenSource.cancel(),this._cancelTokenSource=Io.CancelToken.source(),this.workerManagerConnection&&this.workerManagerConnection.close(),this.workerConnection&&this.workerConnection.close(),this.inspectTimer&&window.clearInterval(this.inspectTimer),this.inspectTimer=null,this.connectionState=mu.CLOSED,this.emit(As.STATE_CHANGE,gu.CLOSED)}}function z4e(r){let a=function(){let o=W4e.pop();return o?(o.offset=o.limit=0,o):{bytes:new Uint8Array(64),offset:0,limit:0}}();return function(o,c){let f=o.appId;f!==void 0&&(jr(c,10),K0(c,f));let m=o.cid;m!==void 0&&(jr(c,16),jr(c,m));let v=o.cname;v!==void 0&&(jr(c,26),K0(c,v));let w=o.deviceId;w!==void 0&&(jr(c,34),K0(c,w));let C=o.elapse;C!==void 0&&(jr(c,40),q0(c,C));let R=o.fileSize;R!==void 0&&(jr(c,48),q0(c,bb(R)));let x=o.height;x!==void 0&&(jr(c,56),q0(c,bb(x)));let L=o.jpg;L!==void 0&&(jr(c,66),jr(c,L.length),jle(c,L));let U=o.networkType;U!==void 0&&(jr(c,72),q0(c,bb(U)));let F=o.osType;F!==void 0&&(jr(c,80),q0(c,bb(F)));let Z=o.requestId;Z!==void 0&&(jr(c,90),K0(c,Z));let W=o.sdkVersion;W!==void 0&&(jr(c,98),K0(c,W));let K=o.sequence;K!==void 0&&(jr(c,104),q0(c,bb(K)));let oe=o.sid;oe!==void 0&&(jr(c,114),K0(c,oe));let ue=o.timestamp;ue!==void 0&&(jr(c,120),q0(c,ue));let xe=o.uid;xe!==void 0&&(jr(c,128),jr(c,xe));let Oe=o.vid;Oe!==void 0&&(jr(c,136),jr(c,Oe));let ke=o.width;ke!==void 0&&(jr(c,144),q0(c,bb(ke)));let He=o.service;He!==void 0&&(jr(c,152),jr(c,He));let lt=o.callbackData;lt!==void 0&&(jr(c,162),jr(c,lt.length),jle(c,lt));let ut=o.ticket;ut!==void 0&&(jr(c,170),K0(c,ut));let ft=o.vendorConfigs;ft!==void 0&&(jr(c,178),K0(c,ft))}(r,a),function(o){let c=o.bytes,f=o.limit;return c.length===f?c:c.subarray(0,f)}(a)}function H4e(r){return function(o){let c={};e:for(;!$4e(o);){let f=nI(o);switch(f>>>3){case 0:break e;case 1:c.code=nI(o);break;case 2:c.msg=Ule(o,nI(o));break;case 3:c.requestId=Ule(o,nI(o));break;case 4:c.timestamp=K4e(o,!1);break;default:G4e(o,7&f)}}return c}({bytes:a=r,offset:0,limit:a.length});var a}function G4e(r,a){switch(a){case 0:for(;128&Nu(r););break;case 2:zW(r,nI(r));break;case 5:zW(r,4);break;case 1:zW(r,8);break;default:throw new Error("Unimplemented type: "+a)}}function bb(r){return{low:r|=0,high:r>>31,unsigned:r>=0}}let W4e=[];function zW(r,a){if(r.offset+a>r.limit)throw new Error("Skip past limit");r.offset+=a}function $4e(r){return r.offset>=r.limit}function $D(r,a){let o=r.bytes,c=r.offset,f=r.limit,m=c+a;if(m>o.length){let v=new Uint8Array(2*m);v.set(o),r.bytes=v}return r.offset=m,m>f&&(r.limit=m),c}function Mle(r,a){let o=r.offset;if(o+a>r.limit)throw new Error("Read past limit");return r.offset+=a,o}function jle(r,a){let o=$D(r,a.length);r.bytes.set(a,o)}function Ule(r,a){let o=Mle(r,a),c=String.fromCharCode,f=r.bytes,m="<22>",v="";for(let w=0;w<a;w++){let C,R,x,L,U=f[w+o];128&U?(224&U)==192?w+1>=a?v+=m:(C=f[w+o+1],(192&C)!=128?v+=m:(L=(31&U)<<6|63&C,L<128?v+=m:(v+=c(L),w++))):(240&U)==224?w+2>=a?v+=m:(C=f[w+o+1],R=f[w+o+2],(49344&(C|R<<8))!=32896?v+=m:(L=(15&U)<<12|(63&C)<<6|63&R,L<2048||L>=55296&&L<=57343?v+=m:(v+=c(L),w+=2))):(248&U)==240?w+3>=a?v+=m:(C=f[w+o+1],R=f[w+o+2],x=f[w+o+3],(12632256&(C|R<<8|x<<16))!=8421504?v+=m:(L=(7&U)<<18|(63&C)<<12|(63&R)<<6|63&x,L<65536||L>1114111?v+=m:(L-=65536,v+=c(55296+(L>>10),56320+(1023&L)),w+=3))):v+=m:v+=c(U)}return v}function K0(r,a){let o=a.length,c=0;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),c+=w<128?1:w<2048?2:w<65536?3:4}jr(r,c);let f=$D(r,c),m=r.bytes;for(let v=0;v<o;v++){let w=a.charCodeAt(v);w>=55296&&w<=56319&&v+1<o&&(w=(w<<10)+a.charCodeAt(++v)-56613888),w<128?m[f++]=w:(w<2048?m[f++]=w>>6&31|192:(w<65536?m[f++]=w>>12&15|224:(m[f++]=w>>18&7|240,m[f++]=w>>12&63|128),m[f++]=w>>6&63|128),m[f++]=63&w|128)}}function Nu(r){return r.bytes[Mle(r,1)]}function Fle(r,a){let o=$D(r,1);r.bytes[o]=a}function nI(r){let a,o=0,c=0;do a=Nu(r),o<32&&(c|=(127&a)<<o),o+=7;while(128&a);return c}function jr(r,a){for(a>>>=0;a>=128;)Fle(r,127&a|128),a>>>=7;Fle(r,a)}function K4e(r,a){let o,c=0,f=0,m=0;return o=Nu(r),c=127&o,128&o&&(o=Nu(r),c|=(127&o)<<7,128&o&&(o=Nu(r),c|=(127&o)<<14,128&o&&(o=Nu(r),c|=(127&o)<<21,128&o&&(o=Nu(r),f=127&o,128&o&&(o=Nu(r),f|=(127&o)<<7,128&o&&(o=Nu(r),f|=(127&o)<<14,128&o&&(o=Nu(r),f|=(127&o)<<21,128&o&&(o=Nu(r),m=127&o,128&o&&(o=Nu(r),m|=(127&o)<<7))))))))),{low:c|f<<28,high:f>>>4|m<<24,unsigned:a}}function q0(r,a){let o=a.low>>>0,c=(a.low>>>28|a.high<<4)>>>0,f=a.high>>>24,m=f===0?c===0?o<16384?o<128?1:2:o<1<<21?3:4:c<16384?c<128?5:6:c<1<<21?7:8:f<128?9:10,v=$D(r,m),w=r.bytes;switch(m){case 10:w[v+9]=f>>>7&1;case 9:w[v+8]=m!==9?128|f:127&f;case 8:w[v+7]=m!==8?c>>>21|128:c>>>21&127;case 7:w[v+6]=m!==7?c>>>14|128:c>>>14&127;case 6:w[v+5]=m!==6?c>>>7|128:c>>>7&127;case 5:w[v+4]=m!==5?128|c:127&c;case 4:w[v+3]=m!==4?o>>>21|128:o>>>21&127;case 3:w[v+2]=m!==3?o>>>14|128:o>>>14&127;case 2:w[v+1]=m!==2?o>>>7|128:o>>>7&127;case 1:w[v]=m!==1?128|o:127&o}}let Ble={},Vle={},KD=4294967296,q4e=KD*KD,zle=q4e/2;Gle(0,!0);let Hle=Gle(0),Y4e=iI(0,-2147483648,!1),X4e=iI(-1,2147483647,!1);function Gle(r,a){let o,c,f;return a?(f=0<=(r>>>=0)&&r<256)&&(c=Vle[r],c)?c:(o=iI(r,0,!0),f&&(Vle[r]=o),o):(f=-128<=(r|=0)&&r<128)&&(c=Ble[r],c)?c:(o=iI(r,r<0?-1:0,!1),f&&(Ble[r]=o),o)}function iI(r,a,o){return{low:0|r,high:0|a,unsigned:!!o}}function J4e(r,a){if(isNaN(r))return Hle;{if(r<=-zle)return Y4e;if(r+1>=zle)return X4e}return r<0?Hle:iI(r%KD|0,r/KD|0,a)}function Wle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}class HW extends nr{get connectionState(){return this._connectionState}set connectionState(a){if(this._connectionState===a)return;let o=this._connectionState;this._connectionState=a,this.emit(bh.CONNECTION_STATE_CHANGE,a,o)}get quality(){return this._quality}set quality(a){this._quality=a>1?1:a<.1?.1:a,this._qualityTimer&&(window.clearTimeout(this._qualityTimer),this._qualityTimer=null),this._quality>=1||(this._qualityTimer=window.setTimeout(()=>{this.quality=this._quality/this._qualityRatio},6e4))}constructor(a){var o;super(),X(this,"name","AgoraRTCImageModeration"),X(this,"_connectionState",hd.CONNECTING),X(this,"_sequence",0),X(this,"_moderationStartTime",void 0),X(this,"_workerConnection",void 0),X(this,"_workerMessageLengthLimit",void 0),X(this,"_qualityRatio",void 0),X(this,"_connectInfo",void 0),X(this,"_cancelTokenSource",Io.CancelToken.source()),X(this,"_retryConfig",void 0),X(this,"_moderationInterval",void 0),X(this,"_moderationTimer",null),X(this,"_moderationMode",1),X(this,"_quality",1),X(this,"_qualityTimer",null),X(this,"_ticket",void 0),X(this,"_moderationIntervalMinimum",void 0),X(this,"_uploadFailedNum",0),X(this,"_uploadNum",0),X(this,"_uploadTimer",null),X(this,"_extraInfo",void 0),X(this,"_vendor",""),X(this,"_encoder",new TextEncoder),X(this,"_moderationId",void 0),X(this,"inspectImage",()=>{if(this.connectionState!==hd.CONNECTED)throw new De(ce.OPERATION_ABORTED,"image moderation service connection status is ".concat(this.connectionState));this._moderationTimer&&(window.clearInterval(this._moderationTimer),this._moderationTimer=null),this._moderationTimer=window.setInterval(()=>{this.connectionState===hd.CONNECTED?this.requestToInspectImage():z.debug("[".concat(this._moderationId,"] Moderation State is not connected , "),this.connectionState)},this._moderationInterval<this._moderationIntervalMinimum?this._moderationIntervalMinimum:this._moderationInterval),this.requestToInspectImage()}),this._moderationId=Di(5,"image-moderation-"),this._workerMessageLengthLimit=ve("IMAGE_MODERATION_WORKER_MESSAGE_LENGTH_LIMIT"),this._moderationIntervalMinimum=ve("IMAGE_MODERATION_INTERVAL_MINIMUM"),this._moderationInterval=(o=a.interval)!==null&&o!==void 0?o:1e3,a.extraInfo&&(this._extraInfo=this._encoder.encode(a.extraInfo)),a.vendor&&(this._vendor=a.vendor),this._qualityRatio=ve("IMAGE_MODERATION_QUALITY_RATIO"),this._moderationStartTime=Number(Date.now()),this._workerConnection=new E3("worker-"+this._moderationId,kr),this.on(bh.STATE_CHANGE,(c,f)=>{z.debug("[".concat(this._moderationId,"] Moderation operation :").concat(WS[c]," ").concat(f||""))}),this.handleWorkerEvents()}async init(a,o){this.emit(bh.STATE_CHANGE,WS.CONNECT_AP),this._connectInfo=a;let c=this._cancelTokenSource.token;return this._retryConfig=o,new Ct((f,m)=>{this.on(bh.CONNECTION_STATE_CHANGE,(v,w)=>{v===hd.CONNECTED&&f()}),this.requestAP(a,c,o).then(v=>{this.connectWorker(v)}).catch(v=>{m(v)})})}updateConfig(a){var o;this._moderationInterval=(o=a.interval)!==null&&o!==void 0?o:1e3,a.extraInfo&&(this._extraInfo=this._encoder.encode(a.extraInfo)),a.vendor&&(this._vendor=a.vendor),z.debug("[".concat(this._moderationId,"] updateConfig: ").concat(JSON.stringify(a))),this.connectionState===hd.CONNECTED&&this.inspectImage()}async requestAP(a,o,c){let f=ve("WEBCS_DOMAIN").map(C=>"https://".concat(C,"/api/v1")),m=await function(C,R,x,L){let{appId:U,areaCode:F,cname:Z,sid:W,token:K,uid:oe}=R;qS++;let ue="moderation_plugin",xe={service_name:ue,json_body:JSON.stringify({appId:U,areaCode:F,cname:Z,command:"allocateEdge",requestId:qS,seq:qS,sid:W,appToken:K,ts:Date.now(),uid:oe+""})},Oe,ke,He=C[0];return wh(async()=>{Oe=Date.now();let lt=await Th(He,{data:xe,cancelToken:x,headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"61"},params:{action:"wrtc_gateway"}});if(ke=Date.now()-Oe,lt.code!==0){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap error, code"+lt.code,{retry:!0,responseTime:ke});throw z.error(zt.toString()),zt}let ut=JSON.parse(lt.json_body);if(ut.code!==200){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap error, code: ".concat(ut.code,", reason: ").concat(ut.reason),{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}if(!ut.servers||!Array.isArray(ut.servers)||ut.servers.length===0){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap empty server",{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}if(!ut.servers.some(zt=>!!zt.wss)){let zt=new De(ce.UNEXPECTED_RESPONSE,"moderation plugin ap empty port",{code:ut.code,responseTime:ke});throw z.error(zt.toString()),zt}let ft=ve("IMAGE_MODERATION_WORKER_HOST");return{addressList:ut.servers.map(zt=>{let{address:$n,wss:hi}=zt;if($n&&hi)return"wss://".concat($n.replace(/\./g,"-"),".").concat(ft,":").concat(hi,"/moderation")}).filter(zt=>!!zt),workerToken:ut.workerToken,vid:ut.vid,ticket:ut.appTicket,responseTime:ke}},(lt,ut)=>($t.apworkerEvent(W,{success:!0,sc:200,serviceName:ue,responseDetail:JSON.stringify(lt.addressList),firstSuccess:ut===0,responseTime:ke,serverIp:C[ut%C.length]}),!1),(lt,ut)=>($t.apworkerEvent(W,{success:!1,sc:lt.data&&lt.data.code||200,serviceName:ue,responseTime:ke,serverIp:C[ut%C.length]}),!!(lt.code!==ce.OPERATION_ABORTED&&lt.code!==ce.UNEXPECTED_RESPONSE||lt.data&&lt.data.retry)&&(He=C[(ut+1)%C.length],!0)),L)}(f,a,o,c);this.emit(bh.STATE_CHANGE,WS.AP_CONNECTED);let{addressList:v,ticket:w}=m;return this._ticket=w,v}async connectWorker(a){this.emit(bh.STATE_CHANGE,WS.CONNECT_WORKER),await this._workerConnection.init(a,1e4)}handleWorkerEvents(){this._workerConnection.on(En.CONNECTED,async()=>{this.emit(bh.STATE_CHANGE,WS.WORKER_CONNECTED,this._workerConnection.url),this.connectionState=hd.CONNECTED}),this._workerConnection.on(En.CLOSED,()=>{this.connectionState=hd.CLOSED}),this._workerConnection.on(En.FAILED,()=>{this.connectionState=hd.CLOSED}),this._workerConnection.on(En.RECONNECTING,()=>{this.connectionState=this.connectionState===hd.CONNECTED?hd.RECONNECTING:hd.CONNECTING}),this._workerConnection.on(En.ON_MESSAGE,async a=>{if(a.data instanceof ArrayBuffer){let o=H4e(new Uint8Array(a.data));ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("[".concat(this._moderationId,"] Response message for worker of image moderation "),JSON.stringify(o)),this._uploadNum++,o.code===void 0||o.code===0||(this._uploadFailedNum++,z.error("[".concat(this._moderationId,"] Error response from worke, code is ").concat(o.code,", msg is ").concat(o.msg)),this._uploadTimer||(this._uploadTimer=window.setTimeout(()=>{$t.reportApiInvoke(this._connectInfo.sid||null,{name:$r.IMAGE_MODERATION_UPLOAD,options:[this._uploadFailedNum,this._uploadNum,o.code],tag:vr.TRACER}).onError(new De(ce.IMAGE_MODERATION_UPLOAD_FAILED,o.msg)),this._uploadTimer=null},ve("IMAGE_MODERATION_UPLOAD_REPORT_INTERVAL"))))}else z.error("[".concat(this._moderationId,"] Unexpected message type from worker"))}),this._workerConnection.on(En.WILL_RECONNECT,(a,o,c)=>{a==="recover"&&c(a),c("tryNext")}),this._workerConnection.on(En.REQUEST_NEW_URLS,(a,o)=>{this.requestAP(this._connectInfo,this._cancelTokenSource.token,this._retryConfig).then(a).catch(o)})}static intToLong(a){return{low:a|=0,high:a>>31,unsigned:a>=0}}async requestToInspectImage(){let a=Ml(this,bh.CLIENT_LOCAL_VIDEO_TRACK),o={appId:this._connectInfo.appId,cname:this._connectInfo.cname,cid:this._connectInfo.cid,sid:this._connectInfo.sid,uid:this._connectInfo.uid,vid:this._connectInfo.vid};if(a){if(!a.isPlaying)return void(ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("Only the track being played can be inspected"));this._sequence++;let c=await this.generateRequestData(a,o);this._workerConnection.sendMessage(c,!0,!0)}else ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")&&z.debug("Only the track being published can be inspected")}async generateRequestData(a,o){let{appId:c,cname:f,cid:m,vid:v,sid:w,uid:C}=o,R=Date.now(),x=await a.getCurrentFrameImage("image/jpeg",this.quality),L=await Mse(x,c,f),U=this._sequence+"-"+m+"-"+C+"-"+R+"-"+Di(12,""),F={appId:c,cid:m,cname:f,deviceId:"",elapse:HW.intToLong(Number(R-this._moderationStartTime)),fileSize:x.buffer.byteLength,height:x.height,width:x.width,jpg:L,networkType:6,osType:7,requestId:U,sdkVersion:"4.21.0",sequence:this._sequence,sid:w,timestamp:J4e(R),uid:C,vid:v,service:this._moderationMode,ticket:this._ticket,callbackData:this._extraInfo,vendorConfigs:this._vendor};this._extraInfo===void 0&&delete F.callbackData;let Z=z4e(F);if(Z.byteLength<this._workerMessageLengthLimit){if(ve("SHOW_IMAGE_MODERATION_WORKER_MESSAGE")){let W=function(K){for(var oe=1;oe<arguments.length;oe++){var ue=arguments[oe]!=null?arguments[oe]:{};oe%2?Wle(Object(ue),!0).forEach(function(xe){X(K,xe,ue[xe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(ue)):Wle(Object(ue)).forEach(function(xe){Object.defineProperty(K,xe,Object.getOwnPropertyDescriptor(ue,xe))})}return K}({},F);delete W.jpg,z.debug("[".concat(this._moderationId,"] Request message for worker of image moderation service: "),JSON.stringify(W))}return Z}{let W=this.quality*this._qualityRatio;return this.quality=W,await this.generateRequestData(a,{appId:c,cname:f,cid:m,vid:v,sid:w,uid:C})}}close(){this._cancelTokenSource.cancel(),this._cancelTokenSource=Io.CancelToken.source(),this._workerConnection&&this._workerConnection.close(),this._moderationTimer&&window.clearInterval(this._moderationTimer),this._moderationTimer=null,this._uploadTimer&&window.clearTimeout(this._uploadTimer),this._uploadTimer=null,this.connectionState=hd.CLOSED,this.emit(bh.STATE_CHANGE,WS.CLOSED)}}function $le(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Kle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?$le(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):$le(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Q4e=Date.now(),Z4e=20,GW=new Map,qD=new Map;async function qle(r){let a=GW.get(r),o=Array.isArray(a)&&a[a.length-1],c=qD.get(r);if(!o)return void(c.isSyncing=!1);let f={uid:o.uid,payload:o.payload};c.firstRecvTs===0&&(c.firstRecvTs=o.recvTs,c.firstSendTs=o.sendTs);let m=o.sendTs-c.firstSendTs,v=m-(Date.now()-c.firstRecvTs);v>0&&(c.firstRecvTs=Date.now()-m);let w=o.mediaDelay+v;w<=0?(a.pop(),Yle(o.context,f),w=0):w=Math.min(w,Z4e),setTimeout(()=>a.length&&qle(r),w)}function Yle(r,a){r.safeEmit(Gn.STREAM_MESSAGE,a.uid,a.payload),r.onStreamMessage&&r.onStreamMessage(a)}function eNe(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;if(!r.syncWithAudio)return Yle(o,{uid:r.uid,payload:r.payload});let c="".concat(o.id,"-").concat(r.uid),f=GW.get(c)||[],m=f.findIndex(R=>r.sendTs>=R.sendTs),v=Kle(Kle({},r),{},{context:o,mediaDelay:a,recvTs:Date.now()});m===-1?f.push(v):f.splice(m,0,v),GW.set(c,f);let w=!1;var C;qD.has(c)?w=!((C=qD.get(c))===null||C===void 0||!C.isSyncing):qD.set(c,{isSyncing:w,firstRecvTs:0,firstSendTs:0}),w||qle(c)}let tNe=ni().name;function Xle(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Jle(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Xle(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Xle(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let Cb="websdk_ng_cache_parameter",nNe=ve("MAX_PRELOAD_ASYNC_LENGTH"),iNe=1e4,h_=new Map,f_=[],WW=null,$W=0,KW=0,YD=new Map,rNe=function(r,a){let o=[],c=0,f=async()=>{let m=o.shift();m&&await m(),o.length>0&&c<a?f():c--};return async function(){for(var m=arguments.length,v=new Array(m),w=0;w<m;w++)v[w]=arguments[w];return new Ct(async(C,R)=>{o.push(async()=>{try{let x=await r(...v);C(x)}catch(x){R(x)}}),c<a&&(c++,f())})}}(Qle,nNe),qW=Io.CancelToken.source();async function Qle(r,a,o,c,f){try{if(!ve("ENABLE_PRELOAD"))return;if(!Jn().supportWebCrypto)return void T0(()=>{z.warn("Your browser does not support preloading, this feature be run in a secure environment")},"preload_webcrypto_not_supported");if(!o&&o!==null)throw new Ke(ce.INVALID_PARAMS,"Invalid token: ".concat(o,". If you don not use token, set it to null"));o&&Ms(o,"token",1,2047),Ms(r,"appid",1,2047),z8(a),c&&H8(c);let m=m3();z.debug("preload channel ".concat(a,", uid is ").concat(c));let v={appId:r,cname:a,token:o||r,uid:typeof c!="string"?c:null,sid:m,proxyServer:f},w,C;typeof c=="string"?(v.stringUid=c,[C,w]=await Ct.all([TAe(c,{sid:m,appId:r},qW.token),Gie(Jle(Jle({},v),{},{token:o||r,uid:0}),qW.token)]),v.uid=C.uid,w.gatewayInfo.uid=v.uid,w.gatewayInfo.res.uid=v.uid):w=await Gie(v,qW.token);let R={sid:m,appId:r,cname:a,token:o||r,uid:v.stringUid||c,intUid:v.uid||w.gatewayInfo.uid,stringUid:v.stringUid,ts:Date.now(),sua:C,ap:w};await async function(x){let L;try{x.uid&&ece({appId:x.appId,cname:x.cname,token:x.token,uid:x.uid,stringUid:x.stringUid});let U=rce(x),F=await async function(W,K){try{let oe=await window.crypto.subtle.importKey("raw",qne(K),"AES-GCM",!1,["encrypt"]),ue=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:new Uint8Array(1)},oe,Hy(window.btoa(JSON.stringify(W))));return R0(new Uint8Array(ue))}catch{return}}(x,x.token||x.appId);if(!F)return;L=ice(Cb);let Z=L?JSON.parse(L):[];Z.push({[U]:F}),Z.length>ve("AP_CACHE_NUM")&&Z.shift(),XD(Cb,JSON.stringify(Z))}catch(U){z.warn("Error caching server parameters:",U.message),XD(Cb,"")}}(R),$W++}catch(m){throw KW++,function(v){WW||(WW=window.setTimeout(()=>{let C="";YD.forEach((R,x)=>{C+="".concat(x,": ").concat(R," ;")}),$t.reportApiInvoke(null,{name:$r.PRELOAD,options:{success:$W,failed:KW,err:C}}).onError(v),$W=0,KW=0,YD.clear(),WW=null},iNe));let w=YD.get(v.code)||0;YD.set(v.code,w+1)}(m),m}}async function Zle(r){try{let a=ece(r);if(!a||r.cloudProxyServer!=="disabled")return;let o=await async function(c,f){try{let m=await window.crypto.subtle.importKey("raw",qne(f),"AES-GCM",!1,["decrypt"]),v=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(1)},m,Hy(c));return JSON.parse(window.atob(R0(new Uint8Array(v))))}catch{return}}(a,r.token||r.appId);if(!o||!function(c,f){return c.cname===f.cname&&c.appId===f.appId&&c.token===f.token?f.stringUid?c.stringUid===f.stringUid:typeof f.uid=="number"?c.uid===f.uid:c.uid==f.uid:!1}(o,r))return;if(o&&Date.now()-o.ts<ve("AP_CACHE_LIFETIME"))return o}catch(a){z.warn("Error get preloadInfo",a.message)}}function ece(r){let a;try{if(a=ice(Cb),!a)return;let o=JSON.parse(a),c=rce(r),f=function(v,w){for(let C=v.length-1;C>=0;C--)if(w(v[C]))return C;return-1}(o,v=>c in v);if(f===-1)return;let m=o.splice(f,1)[0];return XD(Cb,JSON.stringify(o)),m[c]}catch(o){z.warn("Error delete preload info: ".concat(a),o.message),XD(Cb,"")}}function YW(r){if(r){let a=h_.get(r);a&&(window.clearTimeout(a),a=null,h_.delete(r)),Tt(f_).call(f_,r)||r.cloudProxyServer!=="disabled"||f_.push(r)}if(h_.size<ve("AP_CACHE_NUM")&&f_.length>0){let a=f_.shift();h_.set(a,window.setTimeout(async()=>{let{appId:o,cname:c,token:f,uid:m,proxyServer:v}=a;try{await rNe(o,c,f,m,v),h_.has(a)&&YW(a)}catch(w){z.warn("update preload failed",w.message),tce(a)}},ve("AP_UPDATE_INTERVAL")))}}function tce(r){let a=f_.indexOf(r);a!==-1&&f_.splice(a,1);let o=h_.get(r);o&&(window.clearTimeout(o),o=null,h_.delete(r),YW())}function nce(r,a){let o=r.sua,c=r.ap;a&&o&&$t.reqUserAccount(r.sid,{lts:o.requestTime,elapse:o.elapse,success:!0,serverAddr:o.url,stringUid:a,uid:r.intUid,errorCode:null,extend:o.req}),$t.reportResourceTiming(r.ap.url,r.sid),$t.joinWebProxyAP(r.sid,{lts:c.requestTime,elapse:c.elapse,sucess:1,apServerAddr:c.url,turnServerAddrList:c.proxyInfo.addresses.map(f=>f.ip).join(","),eventType:"disabled",unilbsServerIds:[Mr.CHOOSE_SERVER,Mr.CLOUD_PROXY_FALLBACK].toString()}),$t.joinChooseServer(r.sid,{lts:c.requestTime,elapse:c.elapse,succ:!0,csAddr:c.url,opid:c.opid,serverList:c.gatewayInfo.gatewayAddrs.map(f=>f.address),ec:null,cid:c.gatewayInfo.cid.toString(),uid:c.gatewayInfo.uid.toString(),csIp:c.gatewayInfo.csIp,unilbsServerIds:[Mr.CHOOSE_SERVER].toString(),isHttp3:c.isHttp3})}function ice(r){return window.atob(window.localStorage.getItem(r)||"")}function XD(r,a){window.localStorage.setItem(r,window.btoa(a))}function rce(r){let a="".concat(r.appId,"_").concat(r.cname);return typeof r.uid=="string"&&(a+="_s_".concat(r.uid)),typeof r.uid=="number"&&(a+="_".concat(r.uid)),r.token&&(a+="_".concat(r.token)),tie(a)}var sce,ace,oce,lce,cce,dce,uce,hce,fce,pce,mce,gce,vce,yce,_ce,Ece,wce,Sce,bce,Cce,Tce,Rce,xce,Ace,Ice,Nce,Oce,Pce,Lce,Dce,kce,Mce,jce,Uce,Fce,Bce,Vce,zce,Hce,Gce,Wce,$ce,Nt;function Kce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function yd(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Kce(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Kce(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}Ts.setLogger(z);let sNe=(sce=hn(),ace=hn({argsMap:(r,a)=>{if(!Array.isArray(a)){if(!(a instanceof hb))return[a];a=[a]}return a.map(o=>o?Object(o).toString():"null")}}),oce=hn({argsMap:(r,a)=>(a||(a=[]),a instanceof goe?[a.getChannelId()]:(Array.isArray(a)||(a=[a]),a.map(o=>o.getTrackId())))}),lce=hn({argsMap:(r,a,o,c)=>[typeof a=="object"?a.uid:a,o,c]}),cce=hn({argsMap:(r,a,o)=>[a,o]}),dce=hn({argsMap:(r,a)=>a.map(o=>{let{user:c,mediaType:f}=o;return[c==null?void 0:c.uid,f]})}),uce=hn({argsMap:(r,a,o,c)=>[typeof a=="object"?a.uid:a,o,c]}),hce=hn({argsMap:(r,a)=>a.map(o=>{let{user:c,mediaType:f}=o;return{uid:c==null?void 0:c.uid,mediaType:f}})}),fce=hn(),pce=hn(),mce=hn(),gce=hn(),vce=hn(),yce=hn(),_ce=hn(),Ece=hn(),wce=hn(),Sce=hn(),bce=hn(),Cce=hn(),Tce=hn(),Rce=hn(),xce=hn({argsMap:(r,a)=>[a]}),Ace=hn(),Ice=hn(),Nce=hn(),Oce=hn(),Pce=hn(),Lce=hn(),Dce=hn(),kce=hn(),Mce=hn(),jce=hn(),Uce=hn({argsMap:(r,a)=>(Array.isArray(a)||(a=[a]),[JSON.stringify(a)])}),Fce=hn(),Bce=hn(),Vce=hn(),zce=hn(),Hce=hn(),Gce=hn(),Wce=hn({reportResult:!0}),$ce=hn(),Nt=class extends nr{get connectionState(){return this._gateway.state}get remoteUsers(){return this._users}get localTracks(){return this._p2pChannel.getAllTracks(!0)}get uid(){return this._uid}get channelName(){return this._channelName}get localDataChannels(){return this._p2pChannel.getAllDataChannels()}get mode(){return this._config.mode}get role(){var r;return((r=this._config)===null||r===void 0?void 0:r.role)||"audience"}get codec(){return this._config.codec}get audioCodec(){return this._config.audioCodec||"opus"}get isStringUID(){return!!this._joinInfo&&!!this._joinInfo.stringUid}get __className__(){return"Client"}constructor(r){let a;if(super(),X(this,"store",void 0),X(this,"_uid",void 0),X(this,"_channelName",void 0),X(this,"_uintUid",void 0),X(this,"_users",[]),X(this,"_config",void 0),X(this,"_clientId",void 0),X(this,"_appId",void 0),X(this,"_sessionId",null),X(this,"_key",void 0),X(this,"_rtmConfig",{}),X(this,"_joinInfo",void 0),X(this,"_gateway",void 0),X(this,"_statsCollector",void 0),X(this,"_configDistribute",void 0),X(this,"_leaveMutex",new Ts("client-leave")),X(this,"_publishMutex",new Ts("client-publish")),X(this,"_renewTokenMutex",new Ts("client-renewtoken")),X(this,"_subscribeMutex",new Ts("client-subscribe")),X(this,"_encryptionMode","none"),X(this,"_encryptionSecret",null),X(this,"_encryptionSalt",null),X(this,"_encryptDataStream",!1),X(this,"_encryptDataStreamKey",null),X(this,"_encryptDataStreamIv",null),X(this,"_proxyServer",void 0),X(this,"_turnServer",{servers:[],mode:"auto"}),X(this,"_cloudProxyServerMode","disabled"),X(this,"_isDualStreamEnabled",!1),X(this,"_defaultStreamFallbackType",void 0),X(this,"_lowStreamParameter",void 0),X(this,"_streamFallbackTypeCacheMap",new Map),X(this,"_remoteStreamTypeCacheMap",new Map),X(this,"_axiosCancelSource",Io.CancelToken.source()),X(this,"_audioVolumeIndicationInterval",void 0),X(this,"_networkQualityInterval",void 0),X(this,"_userOfflineTimeout",void 0),X(this,"_streamRemovedTimeout",void 0),X(this,"_injectStreamingClient",void 0),X(this,"_liveTranscodeStreamingClient",void 0),X(this,"_liveRawStreamingClient",void 0),X(this,"_channelMediaRelayClient",void 0),X(this,"_networkQualitySensitivity","normal"),X(this,"_p2pChannel",void 0),X(this,"_useLocalAccessPoint",!1),X(this,"_setLocalAPVersion",void 0),X(this,"_joinAndNotLeaveYet",!1),X(this,"_numberOfJoinCount",0),X(this,"_remoteDefaultVideoStreamType",void 0),X(this,"_inspect",void 0),X(this,"_moderation",void 0),X(this,"_license",void 0),X(this,"_pendingPublishedUsers",[]),X(this,"ntpAlignErrorCount",0),X(this,"remoteInboundOffset",0),X(this,"_handleLocalTrackEnable",(o,c,f)=>{this.publish(o,!1).then(c).catch(f)}),X(this,"_handleLocalTrackDisable",(o,c,f)=>{this.unpublish(o).then(c).catch(f)}),X(this,"_handleUserOnline",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(o.uid,this.channelName))return void z.debug("[".concat(o.uid,"] will be ignored in local"));this.isStringUID&&typeof o.uid!="string"&&z.error("[".concat(this._clientId,"] StringUID is Mixed with UintUID"));let c=this._users.find(f=>f.uid===o.uid);if(c)c._trust_in_room_=!0,c._is_pre_created&&(c._is_pre_created=!1,this.safeEmit(Gn.USER_JOINED,c));else{let f=new z0(o.uid,o.uint_id||o.uid);this._users.push(f),z.debug("[".concat(this._clientId,"] user online"),o.uid),this.safeEmit(Gn.USER_JOINED,f)}}),X(this,"_handleUserOffline",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(o.uid,this.channelName))return;let c=this._users.find(f=>f.uid===o.uid);c&&(this._handleRemoveStream(o),this._handleRemoveDataChannels(o),c._audio_pre_subscribed||c._video_pre_subscribed?c._is_pre_created=!0:L8(this._users,c),this._remoteStreamTypeCacheMap.delete(c.uid),this._streamFallbackTypeCacheMap.delete(c.uid),z.debug("[".concat(this._clientId,"] user offline"),o.uid,"reason:",o.reason),this.safeEmit(Gn.USER_LEAVED,c,o.reason))}),X(this,"_handleAddAudioOrVideoStream",(o,c,f,m,v,w,C)=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(c,this.channelName))return;let R=this._users.find(L=>L.uid===c);if(!R)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)"));z.debug("[".concat(this._clientId,"] stream added with uid ").concat(c,", type ").concat(o)),this.store.subscribe(R.uid,o,void 0,void 0,void 0,Date.now());let x=o==="audio"?R.hasAudio:R.hasVideo;R._uintid||(R._uintid=v||c),o==="audio"?R._trust_audio_stream_added_state_=!0:R._trust_video_stream_added_state_=!0,o==="audio"?(R._audio_added_=!0,f!==void 0&&(R._audioSSRC=f),m!==void 0&&(R._cname=m),w&&(R._audioOrtc=w)):(R._video_added_=!0,f!==void 0&&(R._videoSSRC=f),m!==void 0&&(R._cname=m),C!==void 0&&(R._rtxSsrcId=C),w&&(R._videoOrtc=w)),(o==="audio"?R.hasAudio:R.hasVideo)&&!x&&(z.info("[".concat(this._clientId,"] remote user ").concat(R.uid," published ").concat(o)),this.safeEmit(Gn.USER_PUBLISHED,R,o)),o==="video"?$t.onGatewayStream(this._sessionId,Rs.ON_ADD_VIDEO_STREAM,fr.ON_ADD_VIDEO_STREAM,{peer:v||c,ssrc:R._videoSSRC}):$t.onGatewayStream(this._sessionId,Rs.ON_ADD_AUDIO_STREAM,fr.ON_ADD_AUDIO_STREAM,{peer:v||c,ssrc:R._audioSSRC}),this._p2pChannel.remoteMediaSsrcChanged(R,o,f).then(L=>{if(L&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(R.uid," after rejoin because SSRC id changed.")),this._p2pChannel instanceof GD))return this._p2pChannel.unsubscribe(R,o,!0).then(()=>this._subscribe(R,o,!0).catch(U=>{z.error("[".concat(this._clientId,"] resubscribe error"),U.toString())}))}),this._p2pChannel.hasPendingRemoteMedia(R,o)&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(R.uid," after reconnect.")),this._subscribe(R,o,!0).catch(L=>{z.error("[".concat(this._clientId,"] resubscribe error"),L.toString())}))}),X(this,"_handleRemoveStream",o=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(o.uid,this.channelName))return;let c=this._users.find(m=>m.uid===o.uid);if(!c)return void z.warning("[".concat(this._clientId,"] can not find target user!(on_remove_stream)"));z.debug("[".concat(this._clientId,"] stream removed with uid ").concat(o.uid));let f=()=>{};c.hasAudio&&c.hasVideo?f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished audio track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"audio"),z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished video track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"video")}:c.hasVideo?f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished video track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"video")}:c.hasAudio&&(f=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(c.uid," unpublished audio track")),this.safeEmit(Gn.USER_UNPUBLISHED,c,"audio")}),c._video_pre_subscribed||c._audio_pre_subscribed||(c._trust_audio_stream_added_state_=!0,c._trust_video_stream_added_state_=!0,c._audio_added_=!1,c._video_added_=!1,this._p2pChannel instanceof GD&&this._p2pChannel.unsubscribe(c).then(m=>{if(m)return this._gateway.unsubscribe(m,c.uid)}),c._audioSSRC=void 0,c._videoSSRC=void 0,c._audioOrtc=void 0,c._videoOrtc=void 0,c._rtxSsrcId=void 0),$t.onGatewayStream(this._sessionId,Rs.ON_REMOVE_STREAM,fr.ON_REMOVE_STREAM,{peer:o.uint_id||o.uid}),f()}),X(this,"_handleSetStreamLocalEnable",(o,c,f)=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(c,this.channelName))return;let m=this._users.find(C=>C.uid===c);if(!m)return void z.error("[".concat(this._clientId,"] can not find target user!(disable_local)"));z.debug("[".concat(this._clientId,"] local ").concat(o," ").concat(f?"enabled":"disabled"," with uid ").concat(c));let v=o==="audio"?m.hasAudio:m.hasVideo;if(o==="audio"){m._trust_audio_enabled_state_=!0;let C=m._audio_enabled_;if(m._audio_enabled_=f,m._audio_enabled_===C)return;{let R=m._audio_enabled_?"enable-local-audio":"disable-local-audio";z.debug("[".concat(this._clientId,"] user-info-updated, uid: ").concat(c,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,c,R)}}else{m._trust_video_enabled_state_=!0;let C=m._video_enabled_;if(m._video_enabled_=f,m._video_enabled_===C)return;{let R=m._video_enabled_?"enable-local-video":"disable-local-video";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(c,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,c,R)}}let w=o==="audio"?m.hasAudio:m.hasVideo;return v!==w?!v&&w?(z.info("[".concat(this._clientId,"] remote user ").concat(c," published ").concat(o)),void this.safeEmit(Gn.USER_PUBLISHED,m,o)):(o==="video"&&m._videoTrack&&m._videoTrack._destroy(),o==="audio"&&m._audioTrack,this._p2pChannel.muteRemote(m,o),z.info("[".concat(this._clientId,"] remote user ").concat(c," unpublished ").concat(o)),void this.safeEmit(Gn.USER_UNPUBLISHED,m,o)):void 0}),X(this,"_handleMuteStream",(o,c,f)=>{if(ve("BLOCK_LOCAL_CLIENT")&&Wy(o,this.channelName))return;z.debug("[".concat(this._clientId,"] receive mute message"),o,c,f);let m=this._users.find(C=>C.uid===o);if(!m)return void z.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(o));let v=c==="audio"?m.hasAudio:m.hasVideo;if(c==="audio"){m._trust_audio_mute_state_=!0;let C=m._audio_muted_;if(m._audio_muted_=f,m._audio_muted_===C)return;{let R=m._audio_muted_?"mute-audio":"unmute-audio";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(o,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,o,R)}}else{m._trust_video_mute_state_=!0;let C=m._video_muted_;if(m._video_muted_=f,m._video_muted_===C)return;{let R=m._video_muted_?"mute-video":"unmute-video";z.debug("[".concat(this._clientId,"] user-info-update, uid: ").concat(o,", msg: ").concat(R)),this.safeEmit(Gn.USER_INFO_UPDATED,o,R)}}let w=c==="audio"?m.hasAudio:m.hasVideo;if(v!==w){if(!v&&w)return(c==="audio"?m._audioSSRC:m._videoSSRC)?(z.info("[".concat(this._clientId,"] remote user ").concat(o," published ").concat(c)),void this.safeEmit(Gn.USER_PUBLISHED,m,c)):void z.warning("[".concat(this._clientId,"] remote user ").concat(o," receive ").concat(c," unmute message before add stream message, ").concat(c," SSRC doesn't exist yet."));c==="video"&&m._videoTrack&&!m._video_pre_subscribed&&m._videoTrack._destroy(),c==="audio"&&m._audioTrack,this._p2pChannel.muteRemote(m,c),z.info("[".concat(this._clientId,"] remote user ").concat(o," unpublished ").concat(c)),this.safeEmit(Gn.USER_UNPUBLISHED,m,c)}}),X(this,"_handleP2PLost",async o=>{z.debug("[".concat(this._clientId,"] receive p2p lost"),o),parseInt(o.p2pid,10)===this.store.p2pId?await this._p2pChannel.requestReconnect():z.warning("[".concat(this._clientId,"] P2PLost stream not found"),o)}),X(this,"_handleTokenWillExpire",()=>{z.debug("[".concat(this._clientId,"] received message onTokenPrivilegeWillExpire")),this.safeEmit(Gn.ON_TOKEN_PRIVILEGE_WILL_EXPIRE)}),X(this,"_handleBeforeUnload",o=>{o.type==="beforeunload"&&o.returnValue!==void 0&&o.returnValue!==""||(this.leave(),z.info("[".concat(this._clientId,"] auto leave onbeforeunload or pagehide")))}),X(this,"_handleUpdateNetworkQuality",()=>{if(this._networkQualitySensitivity==="normal")return;if(navigator&&navigator.onLine!==void 0&&!navigator.onLine)return void this.safeEmit(Gn.NETWORK_QUALITY,{downlinkNetworkQuality:6,uplinkNetworkQuality:6});let o={downlinkNetworkQuality:0,uplinkNetworkQuality:0};o.uplinkNetworkQuality=this._p2pChannel.getUplinkNetworkQuality(),o.downlinkNetworkQuality=this._p2pChannel.getDownlinkNetworkQuality(),this.safeEmit(Gn.NETWORK_QUALITY,o)}),X(this,"_handleP2PAddAudioOrVideoStream",(o,c,f,m)=>{let v=this._users.find(C=>C.uid===c);if(!v)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_stream)"));z.debug("[".concat(this._clientId,"] stream added with uid ").concat(c,", type ").concat(o)),this.store.subscribe(v.uid,o,void 0,void 0,void 0,Date.now());let w=o==="audio"?v.hasAudio:v.hasVideo;o==="audio"?v._trust_audio_stream_added_state_=!0:v._trust_video_stream_added_state_=!0,o==="audio"?(v._audio_added_=!0,f!==void 0&&(v._audioSSRC=f),m!==void 0&&(v._audioMid=m)):(v._video_added_=!0,f!==void 0&&(v._videoSSRC=f),m!==void 0&&(v._videoMid=m)),(o==="audio"?v.hasAudio:v.hasVideo)&&!w&&(z.info("[".concat(this._clientId,"] remote user ").concat(v.uid," published ").concat(o)),this.safeEmit(Gn.USER_PUBLISHED,v,o)),this._p2pChannel.hasPendingRemoteMedia(v,o)&&(z.debug("[".concat(this._clientId,"] resubscribe ").concat(o," for user ").concat(v.uid," after reconnect.")),this._subscribe(v,o,!0).catch(C=>{z.error("[".concat(this._clientId,"] resubscribe error"),C.toString())}))}),this._config=r,this._clientId=Di(5,"client-"),this.store=new cxe(r.codec,r.audioCodec,r.mode,this._clientId),this.store.clientCreated(),r.proxyServer&&this.setProxyServer(r.proxyServer,!0),r.turnServer&&this.setTurnServer(r.turnServer,!0),z.info("[".concat(this._clientId,"] Initializing AgoraRTC client v").concat(dd," build: ").concat(qH,", mode: ").concat(this.mode,", codec: ").concat(this.codec)),r.clientRoleOptions)try{$ne(r.clientRoleOptions),a=Object.assign({},r.clientRoleOptions)}catch(o){z.warning("[".concat(this._clientId,"] ").concat(o.toString()))}this._statsCollector=new Z3(this.store),this._statsCollector.onStatsException=(o,c,f)=>{z.debug("[".concat(this._clientId,"] receive exception msg, code: ").concat(o,", msg: ").concat(c,", uid: ").concat(f)),this.safeEmit(Gn.EXCEPTION,{code:o,msg:c,uid:f})},this._statsCollector.onUploadPublishDuration=(o,c,f,m)=>{let v=this._users.find(w=>w.uid===o);v&&$t.peerPublishStatus(this._sessionId,{subscribeElapse:m,audioPublishDuration:c,videoPublishDuration:f,peer:v._uintid})},this.store.useDataChannel=Jn().supportDataChannel&&ve("SIGNAL_CHANNEL"),this.store.useP2P=r.mode==="p2p",this._gateway=new _Ae(this.store,{clientId:this._clientId,mode:this.mode,codec:this.codec,websocketRetryConfig:r.websocketRetryConfig||kr,httpRetryConfig:r.httpRetryConfig||kr,forceWaitGatewayResponse:r.forceWaitGatewayResponse===void 0||r.forceWaitGatewayResponse,statsCollector:this._statsCollector,role:r.role,clientRoleOptions:a}),this._configDistribute=new IAe,this.store.useP2P?(this._p2pChannel=new Fl(this.store,this._statsCollector),this._handleP2PEvents()):this._p2pChannel=new GD(this.store,this._statsCollector),this._handleP2PChannelEvents(),this._handleGatewayEvents(),this._handleGatewaySignalEvents()}async joinMeta(r,a,o,c,f){let m=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],v=arguments.length>6&&arguments[6]!==void 0&&arguments[6];Ri("JOIN_GATEWAY_USE_443PORT_ONLY",m),Ri("JOIN_GATEWAY_USE_DUAL_DOMAIN",v);let w=this._gateway.signal.websocket;return w instanceof _3&&(w.use443PortOnly=m,w.tryDoubleDomain=v),async function(C,R,x){A8.get(C)||A8.set(C,[]),I8.get(C)||I8.set(C,R),Lf.get(C)||Lf.set(C,0);let L=A8.get(C),U=I8.get(C);if(!L||!U)throw new Error("concurrent: deferQueue or maxConcurrency is null");if(Lf.get(C)===U){let oe=u3();L.push(oe),await oe.promise}Lf.set(C,Lf.get(C)+1);for(var F=arguments.length,Z=new Array(F>3?F-3:0),W=3;W<F;W++)Z[W-3]=arguments[W];let K=await x(...Z);return Lf.set(C,Lf.get(C)-1),Lf.get(C)===U-1&&L.length>0&&(L[0].resolve(),L.shift()),Lf.get(C)===0&&(A8.set(C,[]),I8.set(C,0),Lf.set(C,0)),K}("client.join",ve("JOIN_MAX_CONCURRENCY"),this.join.bind(this),r,a,o,c,f)}async join(r,a,o,c,f){let m=++this._numberOfJoinCount;this.store.joinStart(),c&&(this.store.uid=c);let v=(U8||U8||(U8=(window.location.protocol.split(":")[0]||"").toUpperCase(),U8))==="HTTPS",w=nie()?window.isSecureContext:"Browser Not Support";(!nie()&&!v||!window.isSecureContext)&&z.warning("The website must be running in a secure context (About secure context: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts ), otherwise the media collection will be restricted by the browser"),this.connectionState==="DISCONNECTED"&&(this.store.avoidJoinStart=Math.round(Date.now()),z.debug("[".concat(this._clientId,"] set avoidJoinStart to ").concat(this.store.avoidJoinStart))),$t.setAppId(r);try{if(!o&&o!==null)throw new De(ce.INVALID_PARAMS,"Invalid token: ".concat(o,". If you don not use token, set it to null"));o&&Ms(o,"token",1,2047),Ms(r,"appid",1,2047),z8(a),c&&H8(c),f&&Ms(f,"optionalInfo",1,2047)}catch(W){throw $t.reportApiInvoke(m3(),{name:$r.JOIN,options:[r,a,o,c],states:{isHttps:v,isSecureContext:w},tag:vr.TRACER}).onError(W),W}let C=await Zle({appId:r,cname:a,uid:c,stringUid:typeof c=="string"?c:void 0,token:o||r,cloudProxyServer:this._cloudProxyServerMode}),R=(C==null?void 0:C.sid)||m3(),x=$t.reportApiInvoke(R,{name:$r.JOIN,options:[r,a,o,c],states:{isHttps:v,isSecureContext:w},tag:vr.TRACER});if(z.info("[".concat(this._clientId,"] start join channel ").concat(a,", join number: ").concat(m)),this._leaveMutex.isLocked&&(z.debug("[".concat(this._clientId,"] join: waiting leave operation")),(await this._leaveMutex.lock())(),z.debug("[".concat(this._clientId,"] join: continue"))),this._joinAndNotLeaveYet=!0,this.connectionState!=="DISCONNECTED"){let W=new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already in connecting/connected state"));throw x.onError(W),W}this._sessionId||(this._sessionId=R,this.store.sessionId=this._sessionId),this._gateway.state="CONNECTING";let L=yd(yd({},this._rtmConfig),{},{clientId:this._clientId,appId:r,sid:this._sessionId,cname:a,uid:typeof c!="string"?c:null,turnServer:this._turnServer,proxyServer:this._proxyServer,token:o||r,cloudProxyServer:this._cloudProxyServerMode,optionalInfo:f,license:this._license,useLocalAccessPoint:this._useLocalAccessPoint,preload:!!C},this._remoteDefaultVideoStreamType!==void 0&&{defaultVideoStream:this._remoteDefaultVideoStreamType});if(this._useLocalAccessPoint&&(L.setLocalAPVersion=this._setLocalAPVersion),typeof c=="string"&&(L.stringUid=c,this._uintUid?(L.uid=this._uintUid,this._uintUid=void 0):L.uid=0),this._encryptionMode!=="none"&&this._encryptionSecret){if(L.aesmode=this._encryptionMode,L.aespassword=await(async W=>{let K=function(Oe){let ke=window.atob(`MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCMnXAHkKIGAM+x4N22gCI+Wyu
STM9ztkT3uYslTT2PuKmZfPzhH6kVdO7PTjGCOZnAsyb3oTtWat0KcxQ4jxvqQV+
HvYl3iI1Yd4vl2c3qRMJPLtRDfNxa2Mcxgq7e9aEUibzdd0st+OJAy3tOj/Y0aVy
xQiYDz3vqa6bP29adwIDAQAB`),He=new Uint8Array(new ArrayBuffer(ke.length));for(let lt=0;lt<ke.length;lt+=1)He[lt]=ke.charCodeAt(lt);return He}(),oe=await window.crypto.subtle.importKey("spki",K,{name:"RSA-OAEP",hash:"SHA-256"},!0,["encrypt"]),ue=FH(W),xe=await window.crypto.subtle.encrypt({name:"RSA-OAEP"},oe,ue);return function(Oe){let ke="";for(let He=0;He<Oe.length;He+=1)ke+=String.fromCharCode(Oe[He]);return window.btoa(ke)}(new Uint8Array(xe))})(this._encryptionSecret),!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));this._encryptionSalt&&(L.aessalt=this._encryptionSalt)}if(this._encryptDataStream&&(this._encryptionMode==="aes-128-gcm2"||this._encryptionMode==="aes-256-gcm2"))if(this._encryptionSalt&&this._encryptionSecret)if(window.crypto.subtle){let W=new TextEncoder,K=ve("USE_PURE_ENCRYPTION_MASTER_KEY")?W.encode(L.appId+this._encryptionSecret+this._encryptionSecret):W.encode(L.appId+L.cname+this._encryptionSecret);this._encryptDataStreamIv=await async function(oe,ue,xe){let Oe=await window.crypto.subtle.importKey("raw",ue,"PBKDF2",!1,["deriveBits","deriveKey"]),ke=oe==="aes-128-gcm2"?128:256,He=await window.crypto.subtle.deriveBits({name:"PBKDF2",iterations:rie,hash:"SHA-256",salt:xe},Oe,ke+dxe);return new Uint8Array(He).subarray(ke/8)}(this._encryptionMode,K,Hy(this._encryptionSalt)),this._encryptDataStreamKey=await async function(oe,ue,xe){let Oe=await window.crypto.subtle.importKey("raw",ue,"PBKDF2",!1,["deriveBits","deriveKey"]),ke=oe==="aes-128-gcm2"?128:256;return await window.crypto.subtle.deriveKey({name:"PBKDF2",iterations:rie,hash:"SHA-256",salt:xe},Oe,{name:"AES-GCM",length:ke},!0,["encrypt","decrypt"])}(this._encryptionMode,K,Hy(this._encryptionSalt))}else w?z.warning("[".concat(this._clientId,"] encrypt datastream must be running in a secure context, fallback to plain data stream")):z.warning("[".concat(this._clientId,"] current browser do not support WebCrypto ,fallback to plain data stream")),this._encryptDataStream=!1;else this._encryptDataStream=!1,z.debug("[".concat(this._clientId,"] no salt / secret, cannot support encrypt data stream, fallback to plain data stream"));this._startSession(this._sessionId,{channel:a,appId:r,stringUid:L.stringUid,preload:L.preload});let U=this._sessionId;setTimeout(()=>{this.connectionState==="CONNECTING"&&U===this._sessionId&&$t.joinChannelTimeout(this._sessionId,5)},5e3);try{var F;let W,K=L.cloudProxyServer;if(Tt(F=["proxy3","proxy4","proxy5"]).call(F,K)){let ke=ve("PROXY_SERVER_TYPE3");Array.isArray(ke)?L.proxyServer=ke[0]:L.proxyServer=ke}if($t.setProxyServer(L.proxyServer),z.setProxyServer(L.proxyServer),this.store.requestAPStart(),C){if(z.debug("[".concat(this._clientId,"] get serverInfo Success from Preload Cache ").concat(L.stringUid?", ".concat(L.stringUid," => ").concat(C.intUid):""," ")),L.stringUid&&!L.uid&&(L.uid=C.intUid),W={gatewayInfo:C.ap.gatewayInfo},ve("JOIN_WITH_FALLBACK_MEDIA_PROXY")&&L.turnServer.mode==="auto")if(C.ap.proxyInfo.addresses.length===0)z.warning("no edge services in ap response of proxy fallback, will not set proxy in iceServers");else{let ke=(await Nie(C.ap.proxyInfo,C.ap.gatewayInfo.uid)).map(He=>({turnServerURL:He.address,tcpport:He.tcpport||Ks.tcpport,udpport:He.udpport||Ks.udpport,username:He.username||Ks.username,password:He.password||Ks.password,forceturn:!1,security:!0}));L.turnServer={mode:"manual",servers:ke}}nce(C,L.stringUid)}else{if(L.stringUid&&!L.uid){let ke;[ke,W]=await Ct.all([Hie(L.stringUid,L,this._axiosCancelSource.token,this._config.httpRetryConfig||kr,this.store),zie(L,this._axiosCancelSource.token,this._config.httpRetryConfig||kr,!0,this.store)]),z.debug("[".concat(this._clientId,"] getUserAccount Success ").concat(L.stringUid," => ").concat(ke)),L.uid=ke,W.gatewayInfo.uid=ke,W.gatewayInfo.res.uid=ke}else W=await zie(L,this._axiosCancelSource.token,this._config.httpRetryConfig||kr,!0,this.store);if(!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"))}this.store.requestAPEnd(),setTimeout(()=>{this._configDistribute.startGetConfigDistribute(L,this._axiosCancelSource.token),this._configDistribute.on(rG.UPDATE_BITRATE_LIMIT,ke=>{this._p2pChannel.updateBitrateLimit(ke)})},0),this._key=o||r;let oe=W.gatewayInfo,ue=L.uid?L.uid:oe.uid;this._joinInfo=yd(yd({},L),{},{cid:oe.cid,uid:ue,vid:oe.vid,apResponse:oe.res,uni_lbs_ip:oe.uni_lbs_ip,gatewayAddrs:oe.gatewayAddrs}),this.store.intUid=ue;let xe=await this._joinGateway();if(!this._joinAndNotLeaveYet)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client already left"));x.onSuccess(xe),this._appId=r,this._channelName=L.cname,this._uid=xe,this.store.uid=xe,setTimeout(()=>{this._networkQualityInterval&&window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=window.setInterval(this._handleUpdateNetworkQuality,2e3),window.addEventListener(gs()?"beforeunload":"pagehide",this._handleBeforeUnload),this._statsCollector.startUpdateStats()},0);let Oe=L.stringUid?"string uid: ".concat(L.stringUid,",uid: ").concat(L.uid):"uid: ".concat(this._uid);return z.info("[".concat(this._clientId,"] Joining channel success: channel: ").concat(a,",").concat(Oe)),setTimeout(()=>{z.startUpload()},5e3),this.store.joinEnd(),Z=this,Tt(A0).call(A0,Z)||A0.push(Z),this._cloudProxyServerMode==="disabled"&&Jn().supportWebCrypto&&ve("ENABLE_PRELOAD")&&YW(this._joinInfo),xe}catch(W){let K=Array.isArray(W)?W[0]:W;throw K&&K.code===ce.OPERATION_ABORTED?z.warning("[".concat(this._clientId,"] join number: ").concat(m,", Joining channel failed, rollback"),K):z.error("[".concat(this._clientId,"] join number: ").concat(m,", Joining channel failed, rollback"),K),K.code!==ce.OPERATION_ABORTED&&this._numberOfJoinCount===m&&(this._gateway.state="DISCONNECTED",this._reset()),x.onError(K),K}var Z}_joinGateway(){if(!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);return this._gateway.join(this._joinInfo,this._key,!(this._joinInfo.cloudProxyServer!=="disabled"||this._joinInfo.proxyServer||!ve("JOIN_WITH_FALLBACK_SIGNAL_PROXY"))).then(r=>r).catch(r=>{if(r.code===ce.INIT_WEBSOCKET_TIMEOUT)return this._gateway.leave(!0,Hn.FALLBACK),r;if(r.code===ce.INIT_DATACHANNEL_TIMEOUT)return this._gateway.leave(!0,Hn.FALLBACK),r;throw r}).then(r=>{if(r instanceof De){if(r.code===ce.INIT_WEBSOCKET_TIMEOUT){if(z.info("[".concat(this._clientId,"] join timeout, fallback to proxy")),!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);this._joinInfo.cloudProxyServer="fallback",this._cloudProxyServerMode="fallback",this.store.cloudProxyServerMode="fallback";let a=ve("PROXY_SERVER_TYPE3");if(Array.isArray(a))if(this._joinInfo.apUrl){let c=/^https?:\/\/(.+?)(\/.*)?$/.exec(this._joinInfo.apUrl)[1].split("."),f=c.slice(c.length-2).join(".");a.forEach(m=>{this._joinInfo&&Tt(m).call(m,f)&&(this._joinInfo.proxyServer=m)}),this._joinInfo.proxyServer||(this._joinInfo.proxyServer=a[0])}else this._joinInfo.proxyServer=a[0];else this._joinInfo.proxyServer=a;let o=ve("LOG_UPLOAD_SERVER").match(/.+:(\d{1,5})$/);return o&&o[1]&&o[1]!=="443"&&z.setProxyServer(this._joinInfo.proxyServer),ve("STATS_COLLECTOR_PORT").toString()!=="443"&&$t.setProxyServer(this._joinInfo.proxyServer),$t.reportApiInvoke(this._sessionId,{name:$r.JOIN_FALLBACK_TO_PROXY,options:[this._joinInfo.proxyServer],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.JOIN_FALLBACK_TO_PROXY,this._joinInfo.proxyServer),ve("JOIN_WITH_FALLBACK_MEDIA_PROXY_FORCE")&&this._joinInfo.turnServer.servers.forEach(c=>{"forceturn"in c&&(c.forceturn=!0)}),this._gateway.join(this._joinInfo,this._key)}if(z.info("[".concat(this._clientId,"] join by datachannel timeout, fallback to websocket")),!this._joinInfo||!this._key)throw new De(ce.INVALID_OPERATION);return $t.reportApiInvoke(this._sessionId,{name:$r.DATACHANNEL_FAILBACK,options:[this.store.clientId],tag:vr.TRACER}).onSuccess(),this._joinGateway()}return r}).then(r=>r)}async leave(){z.info("[".concat(this._clientId,"] Leaving channel")),window.removeEventListener(gs()?"beforeunload":"pagehide",this._handleBeforeUnload),this._reset(),function(a){let o=A0.indexOf(a);o!==-1&&A0.splice(o,1)}(this),this._statsCollector.stopUpdateStats();let r=await this._leaveMutex.lock();if(this.connectionState==="DISCONNECTED")return z.info("[".concat(this._clientId,"] Leaving channel repeated, success")),void r();await this._gateway.leave(this.connectionState!=="CONNECTED"),z.info("[".concat(this._clientId,"] Leaving channel success")),this._joinAndNotLeaveYet=!1,this.store.resetJoinChannelServiceRecords(),r()}async publish(r){let a=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!Array.isArray(r)){if(!(r instanceof hb))return this._publishDataChannel(r);r=[r]}if(r.length===0)throw new De(ce.INVALID_PARAMS,"param list is empty");let o=r;if(this._gateway.role==="audience")throw new De(ce.INVALID_OPERATION,"audience can not publish stream");for(let f of o){if(!(f instanceof hb))throw new De(ce.INVALID_PARAMS,"parameter is not local track");if(!f._enabled&&a)throw new De(ce.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(f.getTrackId()))}z.info("[".concat(this._clientId,"] Publishing tracks, id ").concat(o.map(f=>"".concat(f.getTrackId()," "))));let c=await this._publishMutex.lock();await this._configDistribute.awaitConfigDistributeComplete(),a&&o.forEach(f=>{let m=this._configDistribute.getBitrateLimit();f instanceof ki&&m&&f.setBitrateLimit(m.uplink)});try{await this._publishHighStream(o),z.info("[".concat(this._clientId,"] Publish success, id ").concat(o.map(f=>"".concat(f.getTrackId()," "))))}catch(f){throw z.error("[".concat(this._clientId,"] publish error"),f.toString()),f}finally{c()}}async _publishDataChannel(r){Ti(r.id,"id",0,65535,!0),fm(r.ordered,"ordered"),Ms(r.metadata,"metadata",0,512),z.info("[".concat(this._clientId,"] Publishing datachannels, id ").concat(r.id));let a=await this._publishMutex.lock();try{if(this._p2pChannel.getAllDataChannels().findIndex(c=>c.id===r.id)!==-1)throw new De(ce.INVALID_PARAMS,"Invalid id: ".concat(r.id,". If you want to republish the datachannel, unpublish first"));if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish datachannel, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish datachannel in ".concat(this.connectionState," state"));if(this._turnServer.mode==="auto"&&ve("FORCE_TURN")&&!ve("TURN_ENABLE_TCP")&&!ve("TURN_ENABLE_UDP"))throw new De(ce.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");let o=new goe(r);if(await this._p2pChannel.publishDataChannel([o]),!this._p2pChannel.isP2PDisconnected()){if(typeof o._originDataChannelId!="number")throw z.error("[".concat(this._clientId,"] can not publish with mediaType datachannel, cannot get RTCDatachannel id")),new De(ce.CREATE_DATACHANNEL_ERROR);try{let c={streamId:r.id,ordered:r.ordered,maxRetransmits:ve("DATASTREAM_MAX_RETRANSMITS"),metadata:r.metadata,channelId:o._originDataChannelId};await this._gateway.publishDataChannel(this._uid,c,!0),await o._waitTillOpen()}catch(c){if(c.code!==ce.DISCONNECT_P2P)throw c}}return z.info("[".concat(this._clientId,"] Publish dataChannels success, id ").concat(o.id)),o}catch(o){throw z.error("[".concat(this._clientId,"] publish datachannels error"),o.toString()),o}finally{a()}}async unpublish(r){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't unpublish stream, haven't joined yet!");let a=[];if(r)if(Array.isArray(r))a=r;else{if(!(r instanceof hb))return this._unpublishDataChannel([r]);a=[r]}else this.store.useP2P||await this._unpublishDataChannel(),a=this._p2pChannel.getAllTracks(!0);z.info("[".concat(this._clientId,"] Unpublish tracks, tracks ").concat(a.map(c=>"".concat(c.getTrackId()," "))," "));let o=await this._publishMutex.lock();try{if(this._p2pChannel instanceof Fl){let c=await this._p2pChannel.unpublish(a);c&&await this._gateway.sendExtensionMessage(Nr.UNPUBLISH,{unpubMsg:c},!0)}else{let c=await this._p2pChannel.unpublish(a);c&&await this._gateway.unpublish(c,this._uid),z.info("[".concat(this._clientId,"] Unpublish success,tracks ").concat(a.map(f=>"".concat(f.getTrackId()))))}}catch(c){throw z.error("[".concat(this._clientId,"] unpublish error"),c.toString()),c}finally{o&&o()}}async _unpublishDataChannel(r){r!==void 0&&r.length!==0||(r=this._p2pChannel.getAllDataChannels()),z.info("[".concat(this._clientId,"] Unpublish datachannels, datachannels ").concat(r.map(o=>"".concat(o.id," "))," "));let a=await this._publishMutex.lock();try{let o=await this._p2pChannel.unpublishDataChannel(r);o&&await this._gateway.unpublishDataChannel(o),z.info("[".concat(this._clientId,"] Unpublish dataChannel success,dataChannel ").concat(r.map(c=>"".concat(c.id))))}catch(o){throw z.error("[".concat(this._clientId,"] unpublish dataChannel error"),o.toString()),o}finally{a&&a()}}async subscribe(r,a,o){if(!(r instanceof z0)){let c=this.remoteUsers.find(f=>f.uid===r);if(!c)throw new De(ce.INVALID_REMOTE_USER,"user is not in the channel");r=c}return a==="datachannel"?this._subscribeDataChannel(r,o):this._subscribe(r,a)}async presubscribe(r,a){if(as(a,"mediaType",["audio","video"]),this._p2pChannel instanceof Fl)throw new De(ce.INVALID_OPERATION,"can't presub at p2p mode");if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can't presub when not join");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can't presub in ".concat(this.connectionState," state"));let o=a===Wt.AUDIO,c=a===Wt.VIDEO,f=await this._subscribeMutex.lock();try{let{ssrcId:m,ortc:v,rtxSsrcId:w,cname:C,uint_id:R}=await this._gateway.presubscribe(r,a,!0);if(m==null)throw new De(ce.UNEXPECTED_RESPONSE,"no ssrc id");let x=this._users.find(U=>U.uid===r);x||(x=new z0(r,R||r),x._is_pre_created=!0,this._users.push(x)),C&&(x._cname=C),x._uintid||(x._uintid=R||r),o&&(x._audioSSRC=m,x._audio_pre_subscribed=!0,v&&(x._audioOrtc=v)),c&&(x._videoSSRC=m,x._video_pre_subscribed=!0,v&&(x._videoOrtc=v),w!=null&&(x._rtxSsrcId=w)),z.info("[".concat(this._clientId,"] presub succeed ssrc: ").concat(m)),await this._p2pChannel.subscribe(x,a,m,w,v);let L=o?x._audioTrack:x._videoTrack;if(!L)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user");return o&&(x._trust_audio_stream_added_state_=!0,x._audio_added_=!0),c&&(x._trust_video_stream_added_state_=!0,x._video_added_=!0),L}catch(m){throw z.error("[".concat(this._clientId,"] presub user ").concat(r," error"),m),m}finally{f()}}async _subscribeDataChannel(r,a){var o;if(Ti(a,"channelId",0,65535,!0),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe datachannel, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe datachannel in ".concat(this.connectionState," state"));if(!this._users.find(v=>v===r))throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),new De(ce.INVALID_REMOTE_USER,"user is not in the channel");if(!r.hasAudio&&!r.hasVideo&&r._dataChannels.length===0)throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),new De(ce.INVALID_REMOTE_USER,"user is not published");let c=(o=r._dataChannels)===null||o===void 0?void 0:o.find(v=>v.id===a);if(!c)throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType datachannel, remote datachannel is not published")),new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);let f=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: datachannel"));try{let v=await this._p2pChannel.subscribeDataChannel(r,[c]);if(v&&Tt(v).call(v,c.id))try{var m;if(typeof c._originDataChannelId!="number")throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType datachannel, cannot get RTCDatachannel")),new De(ce.CREATE_DATACHANNEL_ERROR);let w={id:c.id,datachannelId:c._originDataChannelId,ordered:c.ordered,maxRetransmits:c.maxRetransmits,metadata:(m=c.metadata)!==null&&m!==void 0?m:""};await this._gateway.subscribeDataChannel(r.uid,w,!0),await c._waitTillOpen()}catch(w){if((w==null?void 0:w.code)!==ce.WS_ABORT)throw await this._p2pChannel.unsubscribeDataChannel(r,[c]),w;await this._p2pChannel.unsubscribeDataChannel(r,[c]),this._p2pChannel.setPendingRemoteDataChannel(r,c.id)}return z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: datachannel")),c}finally{f()}}async _p2pSubscribe(r,a,o){if(as(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));if(!this._users.find(f=>f===r)){let f=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),f}if(!r.hasAudio&&!r.hasVideo){let f=new De(ce.INVALID_REMOTE_USER,"user is not published");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),f}if(!o&&(a==="audio"&&!r.hasAudio||a==="video"&&!r.hasVideo)){let f=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType ").concat(a,", remote track is not published")),f}let c=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: ").concat(a));try{if(await this._p2pChannel.hasRemoteMediaWithLock(r,a))await this._p2pChannel.unmuteRemote(r,a);else try{let m=a==="audio"?r._audioSSRC:r._videoSSRC,v=a==="audio"?r._audioMid:r._videoMid;this.store.subscribe(r.uid,a,Date.now()),this._p2pChannel instanceof Fl&&await this._p2pChannel.subscribe(r,a,m,v)}catch(m){throw m}z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: ").concat(a)),this._defaultStreamFallbackType&&this.setStreamFallbackOption(r.uid,this._defaultStreamFallbackType).catch(m=>{z.warning("[".concat(this._clientId,"] auto set fallback failed"),m)});let f=a==="audio"?r._audioTrack:r._videoTrack;if(!f)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user object");return f}catch(f){throw z.error("[".concat(this._clientId,"] subscribe user ").concat(r.uid," error"),f),f}finally{c()}}async _subscribe(r,a,o){if(this._p2pChannel instanceof Fl)return this._p2pSubscribe(r,a);if(as(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));if(!this._users.find(C=>C===r)){let C=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", this user is not in the channel")),C}if(!r.hasAudio&&!r.hasVideo){let C=new De(ce.INVALID_REMOTE_USER,"user is not published");throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid,", user is not published")),C}if(!(o||(a!=="audio"||r.hasAudio&&r._audioSSRC!==void 0)&&(a!=="video"||r.hasVideo&&r._videoSSRC!==void 0))){let C=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not subscribe ").concat(r.uid," with mediaType ").concat(a,", remote track is not published")),C}let c=a==="audio"?r._audioSSRC:r._videoSSRC,f=a==="audio"?r._audioOrtc:r._videoOrtc,m=a==="video"?r._rtxSsrcId:void 0,v={stream_type:a==="audio"?Wt.AUDIO:Wt.VIDEO,ssrcId:c},w=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"] subscribe user ").concat(r.uid,", mediaType: ").concat(a));try{if(await this._p2pChannel.hasRemoteMediaWithLock(r,a))await this._p2pChannel.unmuteRemote(r,a);else try{let R=a==="audio"?r._audioSSRC:r._videoSSRC;R!==void 0&&R!==c&&(c=R,f=a==="audio"?r._audioOrtc:r._videoOrtc,m=a==="video"?r._rtxSsrcId:void 0,v={stream_type:a==="audio"?Wt.AUDIO:Wt.VIDEO,ssrcId:c}),aa.markSubscribeStart(this.store.clientId,c),this.store.subscribe(r.uid,a,Date.now()),await this._p2pChannel.subscribe(r,a,c,m,f);try{await this._gateway.subscribe(r.uid,v,!0)}catch(x){if((x==null?void 0:x.code)!==ce.WS_ABORT)throw await this._p2pChannel.unsubscribe(r,a),x;await this._p2pChannel.unsubscribe(r,a,!0),this._p2pChannel.setPendingRemoteMedia(r,a)}this.store.subscribe(r.uid,a,void 0,Date.now()),this._p2pChannel.reportSubscribeEvent(!0,null,r,a)}catch(R){throw this._p2pChannel.reportSubscribeEvent(!1,R==null?void 0:R.code,r,a),R}z.info("[".concat(this._clientId,"] subscribe success user ").concat(r.uid,", mediaType: ").concat(a)),this._defaultStreamFallbackType&&this.setStreamFallbackOption(r.uid,this._defaultStreamFallbackType).catch(R=>{z.warning("[".concat(this._clientId,"] auto set fallback failed"),R)});let C=a==="audio"?r._audioTrack:r._videoTrack;if(!C)throw new De(ce.UNEXPECTED_ERROR,"can not find remote track in user object");return C}catch(C){throw z.error("[".concat(this._clientId,"] subscribe user ").concat(r.uid," error"),C),C}finally{w()}}async massSubscribe(r){if(pm(r,"subscribeList"),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't subscribe stream, not joined");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"Can't subscribe stream in ".concat(this.connectionState," state"));let a=Date.now(),o=new Map,c=await this._subscribeMutex.lock();z.info("[".concat(this._clientId,"]start massSubscribe user ").concat(r.map(w=>{let{user:C,mediaType:R}=w;return"user: ".concat(C==null?void 0:C.uid,", mediaType: ").concat(R)}).join("; ")));let f=(r=[...r]).map(w=>{let{user:C,mediaType:R}=w;return{user:C,mediaType:R}}),m=await this._p2pChannel.globalLock();try{var v;for(let C=r.length-1;C>=0;C--){let R=r[C],{user:x,mediaType:L}=R;if(as(L,"mediaType",["audio","video"]),!x){let Z=new De(ce.INVALID_PARAMS,"user property does not exist in subscribeList item");throw z.error("[".concat(this._clientId,"] user property does not exist in subscribeList item")),Z}if(!this._users.find(Z=>Z===x)){let Z=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");z.error("[".concat(this._clientId,"] can not massSubscribe ").concat(x.uid,", this user is not in the channel")),f[C].error=Z,r.splice(C,1);continue}if(L==="audio"&&(!x.hasAudio||x._audioSSRC===void 0)||L==="video"&&(!x.hasVideo||x._videoSSRC===void 0)){let Z=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);z.error("[".concat(this._clientId,"] can not subscribe ").concat(x.uid," with mediaType ").concat(L,", remote user is not published")),f[C].error=Z,r.splice(C,1);continue}let U=ys.Video|ys.LwoVideo,F=o.get(x);if(F){if(L==="video"?F&U:F&ys.Audio){r.splice(C,1),z.warning("[".concat(this._clientId,"] repeat massSubscribe user:").concat(x.uid,", mediaType:").concat(L," twice"));continue}o.set(x,F|(L==="video"?U:ys.Audio))}else o.set(x,L==="video"?U:ys.Audio)}for(let C=r.length-1;C>=0;C--){let R=r[C],{user:x,mediaType:L}=R,U=ys.Video|ys.LwoVideo;if(this._p2pChannel.hasRemoteMedia(x,L)){await this._p2pChannel.unmuteRemoteNoLock(x,L);let F=o.get(x);o.set(x,L==="video"?F^U:F^ys.Audio),r.splice(C,1)}}this.store.massSubscribe(r.map(C=>({userId:C.user.uid,type:C.mediaType})),a);let w=_c(v=Array.from(o.entries())).call(v,(C,R)=>{let[x,L]=R;if(L===0)return C;let U={stream_id:x.uid,stream_type:L};return L&ys.Audio&&(U.audio_ssrc=x._audioSSRC),L&ys.Video&&(U.video_ssrc=x._videoSSRC),C.push(U),C},[]);try{r.length>0&&await this._p2pChannel.massSubscribeNoLock(r.map(R=>{let{user:x,mediaType:L}=R;return{user:x,mediaType:L,ssrcId:L===Wt.VIDEO?x._videoSSRC:x._audioSSRC,rtxSsrcId:L===Wt.VIDEO?x._rtxSsrcId:void 0}}));let C=new Map;if(w.length>0){let R=await this._gateway.subscribeAll(w,!0);((R==null?void 0:R.users)||[]).forEach(x=>{let{stream_id:L,video_error_code:U,audio_error_code:F,error_code:Z}=x;(U||F||Z)&&C.set(L,{video_error_code:U,audio_error_code:F,error_code:Z})})}if(Array.from(C.entries()).length>0){let R=[];Array.from(C.entries()).forEach(x=>{let[L,U]=x,F=this.remoteUsers.find(Z=>Z.uid===L);if(F){let Z;U.error_code||U.video_error_code&&U.audio_error_code?Z=void 0:U.video_error_code?Z=Wt.VIDEO:U.audio_error_code&&(Z=Wt.AUDIO),R.push({user:F,mediaType:Z})}}),R.length>0&&await this._p2pChannel.massUnsubscribeNoLock(R)}for(let R of f){let x=C.get(R.user.uid);if(x){let L=x.error_code||R.mediaType==="audio"&&x.audio_error_code||R.mediaType==="video"&&x.video_error_code;if(L){let U=Ky(L);z.error("user:".concat(R.user.uid," mediaType:").concat(R.mediaType," has massSubscribe error ").concat(U.desc)),R.error=new De(ce.SUBSCRIBE_FAILED,"code ".concat(L,": ").concat(U.desc))}}R.error||(R.mediaType==="video"?R.track=R.user.videoTrack:R.track=R.user.audioTrack)}return this.store.massSubscribe(f.filter(R=>!R.error).map(R=>({userId:R.user.uid,type:R.mediaType})),void 0,Date.now()),f.forEach(R=>{var x;$t.subscribe(this.store.sessionId,{succ:!!R.error,ec:((x=R.error)===null||x===void 0?void 0:x.code)||null,video:R.mediaType===Wt.VIDEO,audio:R.mediaType===Wt.AUDIO,peerid:R.user.uid,subscribeRequestid:R.mediaType===Wt.VIDEO?R.user._videoSSRC:R.user._audioSSRC,p2pid:this.store.p2pId,eventElapse:Math.floor(performance.now()-a)},!0)}),z.info("[".concat(this._clientId,"] massSubscribe success ").concat(r.map(R=>{let{user:x,mediaType:L}=R;return"user: ".concat(x==null?void 0:x.uid,", mediaType: ").concat(L)}).join("; "))),f}catch(C){throw await this._p2pChannel.massUnsubscribeNoLock(r),C}}finally{m(),c()}}async unsubscribe(r,a,o){if(!(r instanceof z0)){let f=this.remoteUsers.find(m=>m.uid===r);if(!f)throw new De(ce.INVALID_REMOTE_USER,"user is not in the channel");r=f}if(a||this.store.useP2P){if(a==="datachannel")return this._unsubscribeDataChannel(r,o)}else await this._unsubscribeDataChannel(r,o);if(a&&as(a,"mediaType",["audio","video"]),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribe stream, haven't joined yet!");if(!this._users.find(f=>f===r)){let f=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid,", user is not in the channel")),f}z.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(r.uid,", mediaType: ").concat(a));let c=await this._subscribeMutex.lock();try{if(this._p2pChannel instanceof Fl)await this._p2pChannel.unsubscribe(r,a);else{let f=await this._p2pChannel.unsubscribe(r,a);f&&await this._gateway.unsubscribe(f,r.uid),a&&a!=="audio"||(r._audio_pre_subscribed=!1),a&&a!=="video"||(r._video_pre_subscribed=!1),r._is_pre_created&&L8(this._users,r),z.info("[".concat(this._clientId,"] unsubscribe success uid: ").concat(r.uid,", mediaType: ").concat(a))}}catch(f){if(f.code===ce.DISCONNECT_P2P)return void z.warning("disconnecting p2p, abort unsubscribe request.");throw z.error("[".concat(this._clientId,"] unsubscribe user ").concat(r.uid," error"),f.toString()),f}finally{c()}}async _unsubscribeDataChannel(r,a){if(a&&Ti(a,"id",0,65535,!0),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribe datachannel, haven't joined yet!");if(!this._users.find(c=>c===r)){let c=new De(ce.INVALID_REMOTE_USER,"user is not in the channel");throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid,", user is not in the channel")),c}let o;if(typeof a=="number"){let c=r._dataChannels.find(f=>f.id===a);c&&(o=[c])}else o=r._dataChannels;if(o===void 0){let c=new De(ce.REMOTE_USER_IS_NOT_PUBLISHED);throw z.error("[".concat(this._clientId,"] can not unsubscribe ").concat(r.uid," with channelId ").concat(a,", remote datachannel is not published")),c}z.info("[".concat(this._clientId,"] unsubscribe uid: ").concat(r.uid,", mediaType: datachannel, ids: ").concat(o.map(c=>c.id)));try{let c=await this._p2pChannel.unsubscribeDataChannel(r,o);c&&await this._gateway.unsubscribeDataChannel(c,r.uid),z.info("[".concat(this._clientId,"] unsubscribe datachannel success uid: ").concat(r.uid,", mediaType: datachannel, ids: ").concat(c))}catch(c){if(c.code===ce.DISCONNECT_P2P)return void z.warning("disconnecting p2p, abort unsubscribe request.");throw z.error("[".concat(this._clientId,"] unsubscribe user ").concat(r.uid," error"),c.toString()),c}}async massUnsubscribe(r){if(pm(r,"unsubscribeList"),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't unsubscribeAll stream, haven't joined yet!");z.info("[".concat(this._clientId,"] start massUnsubscribe ").concat(r.map(o=>{let{user:c,mediaType:f}=o;return"user: ".concat(c==null?void 0:c.uid,", mediaType: ").concat(f,";")}).join())),r=[...r];let a=new Map;for(let o=r.length-1;o>=0;o--){let{user:c,mediaType:f}=r[o];if(!c){let v=new De(ce.INVALID_PARAMS,"user property does not exist in unsubscribeList item");throw z.error("[".concat(this._clientId,"] user property does not exist in unsubscribeList item")),v}if(as(f,"mediaType",["video","audio",void 0]),!this._users.find(v=>v===c)){z.warning("[".concat(this._clientId,"] can not unsubscribe ").concat(c.uid,", user is not in the channel")),r.splice(o,1);continue}let m=ys.Video|ys.LwoVideo;if(a.has(c)){let v=a.get(c),w;switch(f){case"video":w=v&m;break;case"audio":w=v&ys.Audio;break;default:w=v&(ys.Audio|m)}if(w){z.warning("[".concat(this._clientId,"] repeat massUnsubscribe user:").concat(c.uid,",mediaType:").concat(f," twice.")),r.splice(o,1);continue}f?f==="audio"?a.set(c,v|ys.Audio):f==="video"&&a.set(c,v|m):a.set(c,v|ys.Audio|m)}else f?f==="audio"?a.set(c,ys.Audio):f==="video"&&a.set(c,m):a.set(c,ys.Audio|m)}try{let o=await this._p2pChannel.massUnsubscribe(r);o&&await this._gateway.massUnsubscribe(o),z.info("[".concat(this._clientId,"] massUnsubscribe success ").concat(r.map(c=>{let{user:f,mediaType:m}=c;return"user: ".concat(f==null?void 0:f.uid,", mediaType: ").concat(m,";")}).join()))}catch(o){if(o.code===ce.DISCONNECT_P2P)return void z.warning("[".concat(this._clientId,"] disconnecting p2p, abort unsubscribe request."));throw z.error("[".concat(this._clientId,"] massUnsubscribe error"),o.toString()),o}}async setLowStreamParameter(r){(function(o){if(!o)throw new Ke(ce.INVALID_PARAMS);gr(o.width)||jH(o.width,"streamParameter.width"),gr(o.height)||jH(o.height,"streamParameter.height"),gr(o.framerate)||jH(o.framerate,"streamParameter.framerate"),gr(o.bitrate)||Ti(o.bitrate,"streamParameter.bitrate")})(r),(!r.width&&r.height||r.width&&!r.height)&&z.warning("[".concat(this._clientId,"] The width and height parameters take effect only when both are set")),z.info("[".concat(this._clientId,"] set low stream parameter to"),JSON.stringify(r));let a=this._configDistribute.getLowStreamConfigDistribute();if(a&&a.bitrate&&r.bitrate&&a.bitrate<r.bitrate&&(r.bitrate=a.bitrate),this._lowStreamParameter=r,this._isDualStreamEnabled)return this._p2pChannel.updateVideoStreamParameter(r,ht.LocalVideoLowTrack)}async enableDualStream(){if(!Jn().supportDualStream)throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),new De(ce.NOT_SUPPORTED,"Your browser is not support dual stream");if(this._isDualStreamEnabled)throw new De(ce.INVALID_OPERATION,"Dual stream is already enabled");if(this._p2pChannel.canPublishLowStream())try{await this._publishLowStream()}catch(r){throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!1}),r}this._isDualStreamEnabled=!0,$t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!0,succ:!0}),z.info("[".concat(this._clientId,"] enable dual stream"))}async disableDualStream(){if(this._isDualStreamEnabled){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this._p2pChannel.getLocalMedia(ht.LocalVideoLowTrack))try{let r=await this._p2pChannel.unpublishLowStream();r&&await this._gateway.unpublish(r,this._joinInfo.stringUid||this._joinInfo.uid)}catch(r){throw $t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!1}),r}this._isDualStreamEnabled=!1,$t.streamSwitch(this._sessionId,{lts:Date.now(),isdual:!1,succ:!0}),z.info("[".concat(this._clientId,"] disable dual stream"))}}async setClientRole(r,a){if(function(o){as(o,"role",["audience","host"])}(r),a&&$ne(a),this.mode==="rtc"||this.mode==="p2p")throw z.warning("[".concat(this._clientId,"]").concat(this.mode," mode can not use setClientRole")),new De(ce.INVALID_OPERATION,"".concat(this.mode," mode can not use setClientRole"));if(a&&a.level&&r==="host")throw new De(ce.INVALID_OPERATION,"host mode can not set audience latency level");if(r==="audience"&&this._p2pChannel.hasLocalMedia())throw new De(ce.INVALID_OPERATION,"can not set client role to audience when publishing stream");await this._gateway.setClientRole(r,a),this._config.role=r,z.info("[".concat(this._clientId,"] set client role to ").concat(r,", level: ").concat(a&&a.level))}getRemoteInboundOffset(){var r;let a=(r=this._p2pChannel.getStats())===null||r===void 0?void 0:r.audioSend[0];if(!a||!a.timestamp)return 0;let o=a.timestamp-Date.now();return Math.abs(o)>1e3+a.rttMs+100?this.ntpAlignErrorCount+=1:this.ntpAlignErrorCount=0,this.ntpAlignErrorCount>=3?o:0}getNtpWallTimeInMs(){return document.visibilityState==="visible"&&(this.remoteInboundOffset=this.getRemoteInboundOffset()),this.remoteInboundOffset+Date.now()+this._gateway.ntpOffset}setProxyServer(r,a){if(Ms(r,"proxyServer"),!a){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Set proxy server before join channel");if(this._cloudProxyServerMode!=="disabled"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy")}this._proxyServer=r,$t.setProxyServer(this._proxyServer),z.setProxyServer(this._proxyServer),z.info("[".concat(this._clientId,"] Set proxy server ").concat(a?"by initialize call":""," success."))}setTurnServer(r,a){if(Array.isArray(r)||(r=[r]),!a){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Set turn server before join channel");if(this._cloudProxyServerMode!=="disabled"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy")}if(US(r))return this._turnServer={servers:r,mode:"original-manual"},void z.info("[".concat(this._clientId,"] Set original turnserver ").concat(a?"by initialize call":""," success: ").concat(r.map(o=>o.urls).join(","),"."));r.forEach(o=>Wne(o)),this._turnServer={servers:r,mode:"manual"},z.info("[".concat(this._clientId,"] Set turnserver ").concat(a?"by initialize call":""," success."))}setLicense(r){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"you should set license before join channel");if(Ms(r,"license",32,32),!/^[A-Za-z\d]+$/.test(r))throw new De(ce.INVALID_PARAMS,"license should only contains characters from A-Z a-z 0-9");this._license=r,z.info("[".concat(this._clientId,"] set license success"),r)}startProxyServer(r){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Start proxy server before join channel");if(this._proxyServer||this._turnServer.mode==="manual"||this._useLocalAccessPoint)throw new De(ce.INVALID_OPERATION,"You have already set the proxy");let a=[3,4,5],o;switch(r===void 0&&(r=3),r){case 1:case 2:throw new De(ce.NOT_SUPPORTED,"proxy mode 1/2 has been deprecated and not supported.");case 3:o="proxy3";break;case 4:o="proxy4";break;case 5:o="proxy5";break;default:throw new De(ce.INVALID_PARAMS,"proxy server mode must be ".concat(a.join("|")))}this._cloudProxyServerMode=o,this.store.cloudProxyServerMode=o,z.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode)}stopProxyServer(){if(this.connectionState!=="DISCONNECTED")throw new De(ce.INVALID_OPERATION,"Stop proxy server after leave channel");$t.setProxyServer(),z.setProxyServer(),this._cloudProxyServerMode="disabled",this.store.cloudProxyServerMode="disabled",z.info("[".concat(this._clientId,"] set cloud proxy server mode to"),this._cloudProxyServerMode),this._proxyServer=void 0,this._turnServer={mode:"auto",servers:[]}}setLocalAccessPointsV2(r){if(!r.accessPoints)throw new De(ce.INVALID_PARAMS,"accessPoints is required.");pm(r.accessPoints.serverList,"accessPoints.serverList"),Ms(r.accessPoints.domain,"accessPoints.domain");let a=(U,F)=>{Ti(U,F,0,65535,!0)},o=443;if(r.accessPoints.port&&(a(r.accessPoints.port,"accessPoints.port"),o=r.accessPoints.port),this._proxyServer||this._cloudProxyServerMode!=="disabled")throw new De(ce.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");ve("CLOSE_AFB_FOR_LOCAL_AP")&&(Ri("JOIN_WITH_FALLBACK_SIGNAL_PROXY",!1),Ri("JOIN_WITH_FALLBACK_MEDIA_PROXY",!1));let c=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/,f=r.accessPoints.domain,m=r.accessPoints.serverList.map(U=>c.test(U)?"".concat(U.replace(/\./g,"-"),".").concat(f):U),v=m.map(U=>"".concat(U,":").concat(o));this._useLocalAccessPoint=!0,this._setLocalAPVersion=2,Ri("WEBCS_DOMAIN",v),Ri("WEBCS_DOMAIN_BACKUP_LIST",v),Ri("GATEWAY_DOMAINS",[f]),r.report&&r.report.hostname&&Array.isArray(r.report.hostname)&&r.report.hostname.length?(pm(r.report.hostname,"report.hostname"),Ri("EVENT_REPORT_DOMAIN",r.report.hostname[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",r.report.hostname[1]||r.report.hostname[0])):(Ri("EVENT_REPORT_DOMAIN",m[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",m[1]||m[0]));let w=6443;r.report&&r.report.port&&(a(r.report.port,"report.port"),w=r.report.port),Ri("STATS_COLLECTOR_PORT",w),r.report?Ri("ENABLE_EVENT_REPORT",!0):Ri("ENABLE_EVENT_REPORT",!1);let C="";r.log&&r.log.hostname&&Array.isArray(r.log.hostname)&&r.log.hostname.length?(pm(r.log.hostname,"log.hostname"),C=r.log.hostname[0]):C=m[0];let R=6444;r.log&&r.log.port&&(a(r.log.port,"log.port"),R=r.log.port),Ri("LOG_UPLOAD_SERVER","".concat(C,":").concat(R));let x=[];r.cds&&r.cds.hostname&&Array.isArray(r.cds.hostname)&&r.cds.hostname.length?(pm(r.cds.hostname,"cds.hostname"),x=r.cds.hostname):x=m;let L=443;r.cds&&r.cds.port&&(a(r.cds.port,"cds.port"),L=r.cds.port),Ri("CDS_AP",x.map(U=>"".concat(U,":").concat(L))),r.cds?Ri("ENABLE_CONFIG_DISTRIBUTE",!0):Ri("ENABLE_CONFIG_DISTRIBUTE",!1),z.info("set local access point v2 success")}setLocalAccessPoints(r,a){if(pm(r,"serverList"),Ms(a,"domain"),this._proxyServer||this._cloudProxyServerMode!=="disabled")throw new De(ce.INVALID_OPERATION,"set local access point failed, You have already set the cloud proxy");let o=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;r=r.map(c=>o.test(c)?"".concat(c.replace(/\./g,"-"),".").concat(a):c),this._useLocalAccessPoint=!0,this._setLocalAPVersion=1,Ri("WEBCS_DOMAIN",r),Ri("WEBCS_DOMAIN_BACKUP_LIST",r),Ri("GATEWAY_DOMAINS",[a]),Ri("EVENT_REPORT_DOMAIN",r[0]),Ri("EVENT_REPORT_BACKUP_DOMAIN",r[1]||r[0]),Ri("LOG_UPLOAD_SERVER","".concat(r[0],":6444")),z.info("[".concat(this._clientId,"] set local access point success"))}async setRemoteDefaultVideoStreamType(r){if(as(r,"streamType",[0,1]),this._remoteDefaultVideoStreamType=r,this._joinInfo)try{await this._gateway.setDefaultRemoteVideoStreamType(r),this._joinInfo.defaultVideoStream=this._remoteDefaultVideoStreamType}catch(a){throw z.error("[".concat(this._clientId,"] set default remote video stream type error"),a.toString()),a}else z.debug("[".concat(this._clientId,"] haven't joined yet, cache remoteDefaultVideoStreamType ").concat(r))}async setRemoteVideoStreamType(r,a){as(a,"streamType",[0,1]);try{await this._gateway.setRemoteVideoStreamType(r,a),setTimeout(()=>{let o=this._users.find(c=>c.uid===r);o&&o.videoTrack&&o.videoTrack.updateMediaStreamTrackResolution()},2e3)}catch(o){throw z.error("[".concat(this._clientId,"] set remote video stream type error"),o.toString()),o}z.info("[".concat(this._clientId,"] set remote ").concat(r," video stream type to ").concat(a)),this._remoteStreamTypeCacheMap.set(r,a)}async setStreamFallbackOption(r,a){as(a,"fallbackType",[0,1,2]);try{await this._gateway.setStreamFallbackOption(r,a)}catch(o){throw z.error("[".concat(this._clientId,"] set stream fallback option"),o.toString()),o}z.info("[".concat(this._clientId,"] set remote ").concat(r," stream fallback type to ").concat(a)),this._streamFallbackTypeCacheMap.set(r,a)}setEncryptionConfig(r,a,o,c){(function(m){as(m,"encryptionMode",["aes-128-xts","aes-256-xts","aes-128-ecb","sm4-128-ecb","aes-128-gcm","aes-256-gcm","aes-128-gcm2","aes-256-gcm2","none"])})(r),Ms(a,"secret");let f=["aes-128-gcm2","aes-256-gcm2"];if(Tt(f).call(f,r)){if(!o||!(o instanceof Uint8Array&&o.length===32))throw new De(ce.INVALID_PARAMS,"salt must be an Uint8Array and exactly equal to 32 bytes")}else if(o)throw new De(ce.INVALID_PARAMS,"current encrypt mode does not need salt");if(c){if(fm(c,"encryptDataStream"),!Tt(f).call(f,r))throw new De(ce.INVALID_PARAMS,"current encrypt mode does not support data stream");this._encryptDataStream=!0}new RegExp(`^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*,.<>?/:;'"|{}\\[\\]])(?=.{8,})`).test(a)||z.warning(`The secret is not strong:
The secret must contain at least 1 lowercase alphabetical character,
The secret must contain at least 1 uppercase alphabetical character,
The secret must contain at least 1 numeric character,
The secret must contain at least one special character,
The secret must be eight characters or longer.
`),this._encryptionMode=r,this._encryptionSecret=a,o&&(this._encryptionSalt=R0(o))}async renewToken(r){if(Ms(r,"token",1,2047),!this._key||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"renewToken should not be called before user join");let a=this._key;this._key=r,this._joinInfo&&(this._joinInfo.token=r);let o=await this._renewTokenMutex.lock();try{if(ve("USE_NEW_TOKEN")){z.debug("[".concat(this._clientId,"] start renew token with ticket from unilbs"));let c=await AAe(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||kr);z.debug("[".concat(this._clientId,"] get ticket from unilbs success")),await this._gateway.renewToken({token:r,ticket:c})}else z.debug("[".concat(this._clientId,"] start renew token without ticket")),await this._gateway.renewToken({token:r});z.debug("[".concat(this._clientId,"] renewToken success"))}catch(c){throw this._key=a,this._joinInfo.token=a,z.error("[".concat(this._clientId,"] renewToken failed"),c.toString()),c}finally{o()}}enableAudioVolumeIndicator(){this._audioVolumeIndicationInterval?z.warning("you have already enabled audio volume indicator!"):this._audioVolumeIndicationInterval=window.setInterval(()=>{let r=this._p2pChannel.getAudioLevels();this.safeEmit(Gn.VOLUME_INDICATOR,r)},ve("AUDIO_VOLUME_INDICATION_INTERVAL")||2e3)}getRTCStats(){let r=this._statsCollector.getRTCStats(),a=this._gateway.getInChannelInfo();return r.Duration=Math.round(a.duration/1e3),r}async startLiveStreaming(r,a){if(!a){if(this.codec!=="h264")throw new De(ce.LIVE_STREAMING_INVALID_RAW_STREAM,"raw streaming is only support h264");if(!this._p2pChannel.hasLocalMedia())throw new De(ce.LIVE_STREAMING_INVALID_RAW_STREAM,"can not find stream to raw streaming")}if(this._liveRawStreamingClient&&this._liveRawStreamingClient.hasUrl(r)||this._liveTranscodeStreamingClient&&this._liveTranscodeStreamingClient.hasUrl(r))throw new De(ce.LIVE_STREAMING_TASK_CONFLICT);let o=a?xs.TRANSCODE:xs.RAW;return this._createLiveStreamingClient(o).startLiveStreamingTask(r,o)}setLiveTranscoding(r){return this._createLiveStreamingClient(xs.TRANSCODE).setTranscodingConfig(r)}async stopLiveStreaming(r){let a=[this._liveRawStreamingClient,this._liveTranscodeStreamingClient].filter(o=>o&&o.hasUrl(r));if(!a.length)throw new De(ce.INVALID_PARAMS,"can not find live streaming url to stop");await Ct.all(a.map(o=>o&&o.stopLiveStreamingTask(r)))}async addInjectStreamUrl(r,a){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not addInjectStreamUrl, no joininfo");let o=this._createLiveStreamingClient(xs.INJECT);o.setInjectStreamConfig(a,0),await o.startLiveStreamingTask(r,xs.INJECT)}async removeInjectStreamUrl(){var r;let a=this._createLiveStreamingClient(xs.INJECT),o=Array.from(Sh(r=a.streamingTasks).call(r)).find(c=>c.mode===xs.INJECT);if(!this._joinInfo||!o)throw new De(ce.INVALID_OPERATION,"can remove addInjectStreamUrl, no joininfo or inject task");await a.stopLiveStreamingTask(o.url)}async startChannelMediaRelay(r){ole(r),await this._createChannelMediaRelayClient().startChannelMediaRelay(r)}async updateChannelMediaRelay(r){ole(r),await this._createChannelMediaRelayClient().updateChannelMediaRelay(r)}async stopChannelMediaRelay(){await this._createChannelMediaRelayClient().stopChannelMediaRelay(),this._statsCollector.onStatsChanged&&(this._statsCollector.onStatsChanged=void 0)}async sendStreamMessage(r){var a;let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send data stream, not joined");if((typeof r=="string"||r instanceof Uint8Array)&&(r={payload:r}),typeof r.payload=="string"){let f=new TextEncoder;r.payload=f.encode(r.payload)}let c=!1;if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&Tt(a=["aes-128-gcm2","aes-256-gcm2"]).call(a,this._encryptionMode)&&(c=!0,r.payload=await async function(f,m,v){var w;let C=_c(w=Array.from(v)).call(w,(W,K)=>W+K,0),R={serverTs:0,seq:uxe++,length:v.length,checkSum:C},x=new Uint8Array(eie(C,2)),L=new ArrayBuffer(zS),U=new DataView(L);U.setUint32(0,R.serverTs),U.setUint16(4,R.seq),U.setUint16(6,R.length),U.setUint16(8,R.checkSum);let F=16-v.length%16;v=Yne(v,new Uint8Array(F));let Z=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:f,tagLength:iie,additionalData:x},m,v);return Yne(new Uint8Array(L),new Uint8Array(Z))}(this._encryptDataStreamIv,this._encryptDataStreamKey,r.payload)),new Blob([r.payload]).size>1024)throw new De(ce.INVALID_PARAMS,c?"encrypted stream message out of range.":"stream message out of range.");return this._gateway.signal.request(rn.DATA_STREAM,{payload:R0(r.payload),syncWithAudio:r.syncWithAudio,sendTs:Date.now()-Q4e},!o)}sendMetadata(r){if(!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send metadata, not joined");if(new Blob([r]).size>1024)throw new De(ce.METADATA_OUT_OF_RANGE);return this._gateway.signal.request(rn.SEND_METADATA,{session_id:this._joinInfo.sid,metadata:R0(r)})}async sendCustomReportMessage(r){if(Array.isArray(r)||(r=[r]),r.forEach(fxe),!this._joinInfo)throw new De(ce.INVALID_OPERATION,"can not send custom report, not joined");await $t.sendCustomReportMessage(this._joinInfo.sid,r)}getLocalAudioStats(){return this._statsCollector.getLocalAudioTrackStats()}getRemoteAudioStats(){return this._statsCollector.getRemoteAudioTrackStats()}getLocalVideoStats(){return this._statsCollector.getLocalVideoTrackStats()}getRemoteVideoStats(){return this._statsCollector.getRemoteVideoTrackStats()}getRemoteNetworkQuality(){return this._statsCollector.getRemoteNetworkQualityStats()}async pickSVCLayer(r,a){as(a.spatialLayer,"spatialLayer",[0,1,2,3]),as(a.temporalLayer,"temporalLayer",[0,1,2,3]);try{await this._gateway.pickSVCLayer(r,a)}catch(o){throw z.error("[".concat(this._clientId,"] pick SVC layer failed"),o.toString()),o}}async setRTMConfig(r){let{apRTM:a=!1,rtmFlag:o}=r;if(fm(a,"apRTM"),Ti(o,"rtmFlag",0),this._rtmConfig.apRTM=a,this._rtmConfig.rtmFlag=o,z.debug("[".concat(this._clientId,"] setRTMconfig ").concat(JSON.stringify(r)," in ").concat(this.connectionState," state")),(this.connectionState==="CONNECTED"||this.connectionState==="RECONNECTING")&&this._joinInfo)return this._joinInfo.apRTM=a,this._joinInfo.rtmFlag=o,this._gateway.setRTM2Flag(o)}_reset(){if(z.debug("[".concat(this._clientId,"] reset client")),this._axiosCancelSource.cancel(),this._axiosCancelSource=Io.CancelToken.source(),this._streamFallbackTypeCacheMap=new Map,this._remoteStreamTypeCacheMap=new Map,this._configDistribute.stopGetConfigDistribute(),this._joinInfo&&tce(this._joinInfo),this._joinInfo=void 0,this._proxyServer=void 0,this._defaultStreamFallbackType=void 0,this._sessionId=null,this.store.sessionId=null,this._statsCollector.reset(),this._key=void 0,this._appId=void 0,this._uid=void 0,this.store.uid=void 0,this._channelName=void 0,this._encryptionMode="none",this._encryptionSecret=null,this._encryptionSalt=null,this._encryptDataStreamKey=null,this._encryptDataStreamIv=null,this._pendingPublishedUsers=[],this._users.forEach(r=>{r._audioTrack&&r._audioTrack._destroy(),r._videoTrack&&r._videoTrack._destroy(),r._dataChannels&&(r._dataChannels.forEach(a=>a._close()),r._dataChannels.length=0)}),this._users=[],this._audioVolumeIndicationInterval&&(window.clearInterval(this._audioVolumeIndicationInterval),this._audioVolumeIndicationInterval=void 0),this._cloudProxyServerMode==="fallback"&&(this._cloudProxyServerMode="disabled",this.store.cloudProxyServerMode="disabled"),this._p2pChannel.reset(),this._publishMutex=new Ts("client-publish"),this._subscribeMutex=new Ts("client-subscribe"),this._networkQualityInterval&&(window.clearInterval(this._networkQualityInterval),this._networkQualityInterval=void 0),this._injectStreamingClient&&(this._injectStreamingClient.terminate(),this._injectStreamingClient.removeAllListeners(),this._injectStreamingClient=void 0),this._liveRawStreamingClient&&(this._liveRawStreamingClient.terminate(),this._liveRawStreamingClient.removeAllListeners(),this._liveRawStreamingClient=void 0),this._liveTranscodeStreamingClient&&(this._liveTranscodeStreamingClient.terminate(),this._liveTranscodeStreamingClient.removeAllListeners(),this._liveTranscodeStreamingClient=void 0),this._channelMediaRelayClient&&(this._channelMediaRelayClient.dispose(),this._channelMediaRelayClient=void 0),this._inspect)try{this._inspect.close(),this._inspect=void 0}catch{}if(this._moderation)try{this.setImageModeration(!1)}catch{}}_startSession(r,a){var o;let c=r||m3();r?z.debug("[".concat(this._clientId,"] new Session ").concat(c)):z.debug("[".concat(this._clientId,"] renewSession ").concat(this._sessionId," => ").concat(c));let f=r?"":this._sessionId||"";this._sessionId=c,this.store.sessionId=c;let m={lts:new Date().getTime(),mode:this.mode,buildFormat:1,stringUid:(a==null?void 0:a.stringUid)||((o=this._joinInfo)===null||o===void 0?void 0:o.stringUid),channelProfile:this.mode==="live"?1:0,channelMode:0,isABTestSuccess:Number(this._configDistribute.isSuccess),lsid:f,clientRole:this.role==="audience"?2:1};a?$t.sessionInit(this._sessionId,yd({cname:a.channel,appid:a.appId,preload:a.preload},m)):this._joinInfo?$t.sessionInit(this._sessionId,yd({cname:this._joinInfo.cname,appid:this._joinInfo.appId,preload:!!this._joinInfo.recoverPreloadCache},m)):this._gateway.joinInfo&&$t.sessionInit(this._sessionId,yd({cname:this._gateway.joinInfo.cname,appid:this._gateway.joinInfo.appId},m)),this._joinInfo&&(this._joinInfo.sid=c),this._gateway.joinInfo&&(this._gateway.joinInfo.sid=c)}async _publishHighStream(r){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));if(this._turnServer.mode==="auto"&&ve("FORCE_TURN")&&!ve("TURN_ENABLE_TCP")&&!ve("TURN_ENABLE_UDP"))throw new De(ce.UNEXPECTED_ERROR,"force TURN With No TURN Configuration");z.debug("[".concat(this._clientId,"] publish high stream"));try{let o=await this._p2pChannel.publish(r,this._isDualStreamEnabled,this._lowStreamParameter);if(this._p2pChannel instanceof Fl){let c=(await o.next()).value;if(c){try{await this._gateway.sendExtensionMessage(Nr.PUBLISH,c,!0)}catch(f){throw o.throw(f),f}await o.next()}this._p2pChannel.reportPublishEvent(!0,null)}else{let c=(await o.next()).value;if(c){var a;let f;try{f=await this._gateway.publish(this._uid,c,!0)}catch(m){if(m.code!==ce.DISCONNECT_P2P)throw o.throw(m),m}await o.next(((a=f)===null||a===void 0?void 0:a.ortc)||[])}this._p2pChannel.reportPublishEvent(!0,null);for(let f of r)f instanceof ki&&f._encoderConfig&&this._gateway.setVideoProfile(f._encoderConfig),!f.muted&&f.enabled||await this._p2pChannel.muteLocalTrack(f)}}catch(o){if(this._p2pChannel.reportPublishEvent(!1,o==null?void 0:o.code,r),(o==null?void 0:o.code)===ce.WS_ABORT)return;throw o}}async _publishLowStream(){if(!this._joinInfo||this._uid===void 0)throw new De(ce.INVALID_OPERATION,"Can't publish stream, haven't joined yet!");if(this.connectionState!=="CONNECTED"&&this.connectionState!=="RECONNECTING")throw new De(ce.INVALID_OPERATION,"can not publish stream in ".concat(this.connectionState," state"));z.debug("[".concat(this._clientId,"] publish low stream"));let r=this._configDistribute.getLowStreamConfigDistribute();r&&r.bitrate&&(this._lowStreamParameter||(this._lowStreamParameter={width:160,height:120,framerate:15,bitrate:50}),this._lowStreamParameter&&this._lowStreamParameter.bitrate&&r.bitrate<this._lowStreamParameter.bitrate&&(this._lowStreamParameter.bitrate=r.bitrate));try{let o=await this._p2pChannel.publishLowStream(this._lowStreamParameter),c=(await o.next()).value;if(c){var a;let f;try{f=await this._gateway.publish(this._uid,c,!0)}catch(m){if(m.code!==ce.DISCONNECT_P2P)throw o.throw(m),m}o.next(((a=f)===null||a===void 0?void 0:a.ortc)||[]),this._p2pChannel.reportPublishEvent(!0,null,void 0,!0)}}catch(o){if(this._p2pChannel.reportPublishEvent(!1,o==null?void 0:o.code,void 0,!0),(o==null?void 0:o.code)===ce.WS_ABORT)return;throw o}}_createLiveStreamingClient(r){if(!this._joinInfo||!this._appId)return new De(ce.INVALID_OPERATION,"can not create live streaming client, please join channel first").throw();let a=()=>new R4e(this._joinInfo,this._config.websocketRetryConfig||kr,this._config.httpRetryConfig||kr),o=c=>{c.onLiveStreamError=(f,m)=>{$t.reportApiInvoke(this._sessionId,{name:$r.ON_LIVE_STREAM_ERROR,options:[f,m],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.LIVE_STREAMING_ERROR,f,m)},c.onLiveStreamWarning=(f,m)=>{$t.reportApiInvoke(this._sessionId,{name:$r.ON_LIVE_STREAM_WARNING,options:[f,m],tag:vr.TRACER}).onSuccess(),this.safeEmit(Gn.LIVE_STREAMING_WARNING,f,m)},c.on(G8.REQUEST_WORKER_MANAGER_LIST,(f,m,v)=>{if(!this._joinInfo)return v(new De(ce.INVALID_OPERATION,"can not find join info to get worker manager"));$ie(f,this._joinInfo,this._axiosCancelSource.token,kr).then(m).catch(v)})};switch(r){case xs.RAW:return this._liveRawStreamingClient||(this._liveRawStreamingClient=a(),o(this._liveRawStreamingClient)),this._liveRawStreamingClient;case xs.TRANSCODE:return this._liveTranscodeStreamingClient||(this._liveTranscodeStreamingClient=a(),o(this._liveTranscodeStreamingClient)),this._liveTranscodeStreamingClient;case xs.INJECT:return this._injectStreamingClient||(this._injectStreamingClient=a(),this._injectStreamingClient.on(G8.REQUEST_WORKER_MANAGER_LIST,(c,f,m)=>{if(!this._joinInfo)return m(new De(ce.INVALID_OPERATION,"can not find join info to get worker manager"));$ie(c,this._joinInfo,this._axiosCancelSource.token,kr).then(f).catch(m)}),this._injectStreamingClient.onInjectStatusChange=(c,f,m)=>{this.safeEmit(Gn.INJECT_STREAM_STATUS,c,f,m)}),this._injectStreamingClient}}_createChannelMediaRelayClient(){if(!this._joinInfo)return new De(ce.INVALID_OPERATION,"can not create channel media relay client, please join channel first").throw();if(!this._channelMediaRelayClient){let{sendResolutionWidth:r,sendResolutionHeight:a}=this.getLocalVideoStats(),o={width:r,height:a};this._channelMediaRelayClient=new A4e(this._joinInfo,this._clientId,this._config.websocketRetryConfig||kr,this._config.httpRetryConfig||kr,o),this._channelMediaRelayClient.on("state",c=>{c===il.RELAY_STATE_FAILURE&&this._channelMediaRelayClient&&this._channelMediaRelayClient.dispose(),this.safeEmit(Gn.CHANNEL_MEDIA_RELAY_STATE,c)}),this._channelMediaRelayClient.on("event",c=>{this.safeEmit(Gn.CHANNEL_MEDIA_RELAY_EVENT,c)}),this._statsCollector.onStatsChanged=(c,f)=>{var m;c==="resolution"&&((m=this._channelMediaRelayClient)===null||m===void 0||m.setVideoProfile(f))}}return this._channelMediaRelayClient}_handleUpdateDataChannel(r,a){let{added:o,deleted:c}=r,f=[];Array.isArray(o)&&o.length>0&&o.forEach(m=>{let{uid:v,stream_id:w,ordered:C,max_retrans_times:R,metadata:x}=m,L=this._users.find(U=>U._uintid===v);if(!L)return void z.error("[".concat(this._clientId,"] can not find target user!(on_add_data_channel)"));if(z.debug("[".concat(this._clientId,"] data_channel added with uid ").concat(v)),Tt(f).call(f,L)||f.push(L),L._uintid||(L._uintid=v),L._dataChannels.findIndex(U=>U.id===m.stream_id)===-1){let U={id:w,ordered:!!C,maxRetransmits:R,metadata:x},F=new i4e(U);L._dataChannels.push(F),z.info("[".concat(this._clientId,"] remote user ").concat(L.uid," published datachannel")),a||this.safeEmit(Gn.USER_PUBLISHED,L,"datachannel",U)}this._p2pChannel.hasPendingRemoteDataChannel(L,m.stream_id)&&(z.debug("[".concat(this._clientId,"] resubscribe datachannel for user ").concat(L.uid," after reconnect.")),this._subscribeDataChannel(L,m.stream_id).catch(U=>{z.error("[".concat(this._clientId,"] resubscribe datachannel error"),U.toString())}))}),a&&(this.safeEmit(Gn.PUBLISHED_USER_LIST,this._pendingPublishedUsers),this._pendingPublishedUsers=[]),Array.isArray(c)&&c.length>0&&c.forEach(m=>{let{uid:v,stream_id:w}=m,C=this._users.find(x=>x._uintid===v);if(!C)return void z.error("[".concat(this._clientId,"] can not find target user!(on_delete_data_channel)"));let R=C._dataChannels.find(x=>x.id===m.stream_id);R&&(z.debug("[".concat(this._clientId,"] data_stream delete with uid ").concat(v)),this._p2pChannel.unsubscribeDataChannel(C,[R]).then(x=>{if(C._dataChannels=C._dataChannels.filter(L=>L!==R),x)return this._gateway.unsubscribeDataChannel(x,C.uid)}),z.info("[".concat(this._clientId,"] remote user ").concat(v," unpublished datachannel ,id:").concat(R.id)),this.safeEmit(Gn.USER_UNPUBLISHED,C,"datachannel",R._config))})}_handleRemoveDataChannels(r){let a=this._users.find(o=>o.uid===r.uid);if(a){if(a._dataChannels!==void 0&&a._dataChannels.length>0){z.debug("[".concat(this._clientId,"] datachannel removed with uid ").concat(r.uid));let o=()=>{z.info("[".concat(this._clientId,"] remote user ").concat(a.uid," unpublished datachannel")),a._dataChannels.forEach(c=>{this.safeEmit(Gn.USER_UNPUBLISHED,a,"datachannel",c._config)})};this._p2pChannel.unsubscribeDataChannel(a,a._dataChannels).then(c=>{if(c)return this._gateway.unsubscribeDataChannel(c,a.uid)}),o()}}else z.warning("[".concat(this._clientId,"] can not find target user!(on_remove_datachannel)"))}_handleGatewayEvents(){this._gateway.on(Ir.DISCONNECT_P2P,async()=>{await this._p2pChannel.disconnectForReconnect()}),this._gateway.on(Ir.CONNECTION_STATE_CHANGE,(r,a,o)=>{var c;if(o===Hn.FALLBACK)return;let f=()=>{this.safeEmit(Gn.CONNECTION_STATE_CHANGE,r,a,o)};if($t.reportApiInvoke(this._sessionId||((c=this._gateway.joinInfo)===null||c===void 0?void 0:c.sid)||null,{name:$r.CONNECTION_STATE_CHANGE,options:[r,a,o],tag:vr.TRACER}).onSuccess(JSON.stringify({cur:r,prev:a,reason:o})),z.info("[".concat(this._clientId,"] connection state change: ").concat(a," -> ").concat(r)),r==="DISCONNECTED")return this._reset(),void f();if(r==="RECONNECTING")this._users.forEach(v=>{v._trust_in_room_=!1,v._trust_audio_enabled_state_=!1,v._trust_video_enabled_state_=!1,v._trust_audio_mute_state_=!1,v._trust_video_mute_state_=!1,v._trust_audio_stream_added_state_=!1,v._trust_video_stream_added_state_=!1,v._is_pre_created||(v._audio_pre_subscribed||(v._audioSSRC=void 0,v._audioOrtc=void 0),v._video_pre_subscribed||(v._videoSSRC=void 0,v._videoOrtc=void 0,v._rtxSsrcId=void 0),v._cname=void 0)}),this._userOfflineTimeout&&window.clearTimeout(this._userOfflineTimeout),this._streamRemovedTimeout&&window.clearTimeout(this._streamRemovedTimeout),this._userOfflineTimeout=void 0,this._streamRemovedTimeout=void 0;else if(r==="CONNECTED"){var m;this._streamFallbackTypeCacheMap.forEach((v,w)=>{this._gateway.setStreamFallbackOption(w,v).catch(C=>{z.warning("[".concat(this._clientId,"] auto set stream fallback option failed"),C)})}),this._remoteStreamTypeCacheMap.forEach((v,w)=>{this._gateway.setRemoteVideoStreamType(w,v).catch(C=>{z.warning("[".concat(this._clientId,"] auto set remote stream type failed"),C)})}),this._remoteDefaultVideoStreamType!==void 0&&((m=this._joinInfo)===null||m===void 0?void 0:m.defaultVideoStream)===void 0&&this.setRemoteDefaultVideoStreamType(this._remoteDefaultVideoStreamType).then(()=>{z.debug("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway connected"))}).catch(v=>{z.error("[".concat(this._clientId,"] setRemoteDefaultVideoStreamType after gateway failed, ").concat(v))}),this.store.useP2P||(this._p2pChannel.republish(),this._userOfflineTimeout=window.setTimeout(()=>{this.connectionState==="CONNECTED"&&(this._userOfflineTimeout=void 0,this._users.filter(v=>!v._trust_in_room_).forEach(v=>{z.debug("[".concat(this._clientId,"] user offline timeout, emit user offline ").concat(v.uid)),this._handleUserOffline({uid:v.uid})}))},3e3),this._streamRemovedTimeout=window.setTimeout(()=>{this.connectionState==="CONNECTED"&&(this._streamRemovedTimeout=void 0,this._users.forEach(v=>{v._trust_audio_mute_state_||(z.debug("[".concat(this._clientId,"] auto dispatch audio unmute event ").concat(v.uid)),this._handleMuteStream(v.uid,Wt.AUDIO,!1)),v._trust_video_mute_state_||(z.debug("[".concat(this._clientId,"] auto dispatch video unmute event ").concat(v.uid)),this._handleMuteStream(v.uid,Wt.VIDEO,!1)),v._trust_audio_enabled_state_||(z.debug("[".concat(this._clientId,"] auto dispatch enable local audio ").concat(v.uid)),this._handleSetStreamLocalEnable("audio",v.uid,!0)),v._trust_video_enabled_state_||(z.debug("[".concat(this._clientId,"] auto dispatch enable local video ").concat(v.uid)),this._handleSetStreamLocalEnable("video",v.uid,!0)),v._trust_video_stream_added_state_||(z.debug("[".concat(this._clientId,"] auto dispatch reset video stream added ").concat(v.uid)),this._handleResetAddStream(v,"video")),v._trust_audio_stream_added_state_||(z.debug("[".concat(this._clientId,"] auto dispatch reset audio stream added ").concat(v.uid)),this._handleResetAddStream(v,"audio")),v._video_added_||v._audio_added_||(z.debug("[".concat(this._clientId,"] auto dispatch stream remove ").concat(v.uid)),this._handleRemoveStream({uid:v.uid,uint_id:v._uintid}))}))},1e3))}f()}),this._gateway.on(Ir.REQUEST_NEW_GATEWAY_LIST,async(r,a)=>{if(!this._joinInfo)return a(new De(ce.UNEXPECTED_ERROR,"can not recover, no join info"));try{let o;this._joinInfo.recoverPreloadCache?(o=this._joinInfo.recoverPreloadCache.ap,nce(this._joinInfo.recoverPreloadCache),this._joinInfo.recoverPreloadCache=void 0):o=await vG(this._joinInfo,this._axiosCancelSource.token,this._config.httpRetryConfig||kr,this.store),this._joinInfo&&(this._joinInfo.apResponse=o.gatewayInfo.res,this._joinInfo.gatewayAddrs=o.gatewayInfo.gatewayAddrs,this._joinInfo.uni_lbs_ip=o.gatewayInfo.uni_lbs_ip);let c=[];o.gatewayInfo.gatewayAddrs.forEach(f=>{let{address:m}=f,[v,w]=m.split(":");this._joinInfo&&this._joinInfo.proxyServer?c.push({proxy:this._joinInfo.proxyServer,host:v,port:w}):c.push({host:v,port:w})}),r(c)}catch(o){a(o)}}),this._gateway.on(Ir.NETWORK_QUALITY,r=>{this._networkQualitySensitivity==="normal"&&this.safeEmit(Gn.NETWORK_QUALITY,r)}),this._gateway.on(Ir.STREAM_TYPE_CHANGE,(r,a)=>{this.safeEmit(Gn.STREAM_TYPE_CHANGED,r,a),$t.reportApiInvoke(this._sessionId,{name:$r.STREAM_TYPE_CHANGE,options:[r,a],tag:vr.TRACER}).onSuccess(JSON.stringify({uid:r,streamType:a}))}),this._gateway.on(Ir.IS_P2P_DISCONNECTED,r=>{this._p2pChannel.isP2PDisconnected()?r(!0):this._p2pChannel.hasLocalMedia()||this._p2pChannel.hasRemoteMedia()?r(!1):r(!0)}),this._gateway.on(Ir.NEED_RENEW_SESSION,async r=>{if(r==="recover"&&this._joinInfo){let a=await Zle(yd(yd({},this._joinInfo),{},{uid:this._joinInfo.uid,stringUid:void 0}));this._joinInfo.recoverPreloadCache=a,this._startSession(a==null?void 0:a.sid)}else this._startSession()}),this._gateway.on(Ir.REQUEST_P2P_CONNECTION_PARAMS,async(r,a,o)=>{try{a(await this._p2pChannel.startP2PConnection(r))}catch(c){o(c)}}),this._gateway.on(Ir.JOIN_RESPONSE,(r,a)=>{if(this.store.useP2P)return;let{dtlsParameters:o,iceParameters:c,candidates:f,rtpCapabilities:m,setup:v,cname:w}=koe(r.ortc,a);this._p2pChannel.connect(c,o,f,m,v,w)}),this._gateway.on(Ir.REQUEST_DC_CONNECTION_PARAMS,r=>{r(this._p2pChannel.getEstablishParams())}),this._gateway.on(Ir.RESET_SIGNAL,r=>{this._p2pChannel.resetConnection(r),this._handleGatewaySignalEvents()}),this._gateway.on(Ir.DATACHANNEL_FAILBACK,()=>{this._joinGateway()}),this._gateway.on(Ir.DATACHANNEL_PRECONNECT,async(r,a,o,c)=>{var f,m,v,w,C,R;await this._p2pChannel.startP2PConnection({turnServer:(f=this._joinInfo)===null||f===void 0?void 0:f.turnServer},!0);let x=function(L,U){let F;return U&&U.ip&&typeof U.port=="number"?(F=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:U.ip,port:U.port.toString(),type:"host",extension:{}}],z.debug("Using remote candidate from AP ".concat(U.ip,":").concat(U.port)),U.ip6&&(F.push({foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:U.ip6,port:U.port.toString(),type:"host",extension:{}}),z.debug("Using IPV6 remote candidate from AP ".concat(U.ip6,":").concat(U.port)))):F=[{foundation:"udpcandidate",componentId:"1",transport:"udp",priority:"2103266323",connectionAddress:L.ip,port:L.port.toString(),type:"host",extension:{}}],F}(r,a);return this._p2pChannel.preConnect({iceUfrag:"".concat((m=this._joinInfo)===null||m===void 0?void 0:m.apResponse.cid,"_").concat((v=this._joinInfo)===null||v===void 0?void 0:v.apResponse.cert),icePwd:"".concat((w=this._joinInfo)===null||w===void 0?void 0:w.apResponse.cid,"_").concat((C=this._joinInfo)===null||C===void 0?void 0:C.apResponse.cert)},{fingerprints:[{hashFunction:"sha-256",fingerprint:(R=ve("FINGERPRINT"))!==null&&R!==void 0?R:r.fingerprint}]},x,{send:{audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]},recv:{audioCodecs:[],videoCodecs:[],audioExtensions:[],videoExtensions:[]}},"active","o/i14u9pJrxRKAsu").then(o).catch(c)})}_handleGatewaySignalEvents(){this._gateway.signal.on(Sn.ON_USER_ONLINE,this._handleUserOnline),this._gateway.signal.on(Sn.ON_USER_OFFLINE,this._handleUserOffline),this._gateway.signal.on(Sn.ON_ADD_AUDIO_STREAM,r=>this._handleAddAudioOrVideoStream("audio",r.uid,r.ssrcId,r.cname,r.uint_id,r.ortc)),this._gateway.signal.on(Sn.ON_ADD_VIDEO_STREAM,r=>this._handleAddAudioOrVideoStream("video",r.uid,r.ssrcId,r.cname,r.uint_id,r.ortc,r.rtxSsrcId)),this._gateway.signal.on(Sn.ON_REMOTE_DATASTREAM_UPDATE,r=>{this._handleUpdateDataChannel(r)}),this._gateway.signal.on(Sn.ON_REMOTE_FULL_DATASTREAM_INFO,r=>{this._handleUpdateDataChannel({added:r.datastreams,deleted:[]},!0)}),this._gateway.signal.on(Sn.ON_REMOVE_STREAM,this._handleRemoveStream),this._gateway.signal.on(Sn.ON_P2P_LOST,this._handleP2PLost),this._gateway.signal.on(Sn.MUTE_AUDIO,r=>this._handleMuteStream(r.uid,Wt.AUDIO,!0)),this._gateway.signal.on(Sn.UNMUTE_AUDIO,r=>this._handleMuteStream(r.uid,Wt.AUDIO,!1)),this._gateway.signal.on(Sn.MUTE_VIDEO,r=>this._handleMuteStream(r.uid,Wt.VIDEO,!0)),this._gateway.signal.on(Sn.UNMUTE_VIDEO,r=>this._handleMuteStream(r.uid,Wt.VIDEO,!1)),this._gateway.signal.on(Sn.RECEIVE_METADATA,r=>{let a=Hy(r.metadata);this.safeEmit(Gn.RECEIVE_METADATA,r.uid,a)}),this._gateway.signal.on(Sn.ON_DATA_STREAM,async r=>{var a;if(!r)return;let o=Hy(r.payload);if(this._encryptDataStream&&this._encryptDataStreamIv&&this._encryptDataStreamKey&&window.crypto.subtle&&Tt(a=["aes-128-gcm2","aes-256-gcm2"]).call(a,this._encryptionMode)){if(r.payload.length<zS)throw new De(ce.UNEXPECTED_RESPONSE,"payload length ".concat(r.payload.length," is less than header length ").concat(zS));o=await async function(f,m,v){let w=v.subarray(0,zS),C=w.slice(8,zS),R=(C[0]<<8)+C[1],x=(w[6]<<8)+w[7],L=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:f,tagLength:iie,additionalData:new Uint8Array(eie(R,2))},m,v.subarray(zS));return new Uint8Array(L).subarray(0,x)}(this._encryptDataStreamIv,this._encryptDataStreamKey,o)}let c=0;if(r.ordered||r.syncWithAudio){let f=this._p2pChannel.getStats(),m=this.remoteUsers.find(w=>w.uid===r.uid),v=f==null?void 0:f.audioRecv.find(w=>w.ssrc===(m==null?void 0:m._audioSSRC));c=v==null?void 0:v.jitterBufferMs}c==null&&(c=0),eNe(yd(yd({},r),{},{payload:o}),c,{id:this._clientId,onStreamMessage:typeof this.onStreamMessage=="function"?this.onStreamMessage.bind(this):void 0,safeEmit:this.safeEmit.bind(this)})}),this._gateway.signal.on(Sn.ON_CRYPT_ERROR,()=>{T0(()=>{z.warning("[".concat(this._clientId,"] on crypt error")),this.safeEmit(Gn.CRYPT_ERROR)},this._sessionId)}),this._gateway.signal.on(Sn.ON_TOKEN_PRIVILEGE_WILL_EXPIRE,this._handleTokenWillExpire),this._gateway.signal.on(Sn.ON_TOKEN_PRIVILEGE_DID_EXPIRE,()=>{z.warning("[".concat(this._clientId,"] received message onTokenPrivilegeDidExpire, please get new token and join again")),this._gateway.leave(!0,Hn.TOKEN_EXPIRE),this.safeEmit(Gn.ON_TOKEN_PRIVILEGE_DID_EXPIRE),this._reset()}),this._gateway.signal.on(Sn.ON_STREAM_FALLBACK_UPDATE,r=>{z.debug("[".concat(this._clientId,"] stream fallback peerId: ").concat(r.stream_id,", attr: ").concat(r.stream_type)),this.safeEmit(Gn.STREAM_FALLBACK,r.stream_id,r.stream_type===1?"fallback":"recover")}),this._gateway.signal.on(Sn.ON_PUBLISH_STREAM,r=>{this.uid===this._uid&&(this._p2pChannel.reportPublishEvent(!0,null,void 0,!1,JSON.stringify({proxy:r.proxy})),z.info("[".concat(this._clientId,"] on publish stream, ").concat(JSON.stringify(r))))}),this._gateway.signal.on(Sn.ENABLE_LOCAL_VIDEO,r=>{this._handleSetStreamLocalEnable("video",r.uid,!0)}),this._gateway.signal.on(Sn.DISABLE_LOCAL_VIDEO,r=>{this._handleSetStreamLocalEnable("video",r.uid,!1)}),this._gateway.signal.on(Ut.REQUEST_TIMEOUT,(r,a)=>{if(this._joinInfo)switch(r){case rn.PUBLISH:{if(!a)return;let f=a.ortc;if(f){var o,c;let m=f.some(C=>{let{stream_type:R}=C;return R===pi.Audio}),v=f.some(C=>{let{stream_type:R}=C;return R!==pi.Audio}),w=f.some(C=>{let{stream_type:R}=C;return R===pi.Screen||R===pi.ScreenLow});a.state==="offer"&&$t.publish(this._joinInfo.sid,{eventElapse:aa.measureFromPublishStart(this.store.clientId,this.store.pubId),succ:!1,ec:ce.TIMEOUT,audio:m,video:v,p2pid:a.p2p_id,publishRequestid:this.store.pubId,screenshare:w,audioName:m?(o=f.find(C=>{let{stream_type:R}=C;return R===pi.Audio}))===null||o===void 0||(o=o.ssrcs[0])===null||o===void 0?void 0:o.ssrcId.toString():void 0,videoName:v?(c=f.find(C=>{let{stream_type:R}=C;return R!==pi.Audio}))===null||c===void 0||(c=c.ssrcs[0])===null||c===void 0?void 0:c.ssrcId.toString():void 0})}break}case rn.SUBSCRIBE:a&&$t.subscribe(this._joinInfo.sid,{succ:!1,ec:ce.TIMEOUT,audio:a.stream_type===Wt.AUDIO,video:a.stream_type===Wt.VIDEO,peerid:a.stream_id,subscribeRequestid:a.ssrcId,p2pid:this.store.p2pId,eventElapse:aa.measureFromSubscribeStart(this.store.clientId,a.ssrcId)})}}),this._gateway.signal.on(Sn.ON_P2P_OK,r=>{this.uid,this._uid}),this._gateway.signal.on(Sn.ON_PUBLISHED_USER_LIST,r=>{if(r==null||!r.users)return;ve("BLOCK_LOCAL_CLIENT")&&(r.users=r.users.filter(c=>!Wy(c.string_id||c.stream_id,this.channelName)));let a=[],o=[];for(let c of r.users){let f=this._users.find(x=>x._uintid===c.stream_id);f?f._trust_in_room_=!0:(f=new z0(c.string_id||c.stream_id,c.stream_id),this._users.push(f),this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.debug("[".concat(this._clientId,"] user online"),c.stream_id),this.safeEmit(Gn.USER_JOINED,f)));let m=ys.Audio&c.stream_type,v=(ys.Video|ys.LwoVideo)&c.stream_type,w=(65280&c.stream_type)!=0,C=m&&f.hasAudio,R=v&&f.hasVideo;v&&(f._trust_video_stream_added_state_=!0,f._video_added_=!0,f._videoSSRC=c.video_ssrc,f._rtxSsrcId=c.video_rtx),m&&(f._trust_audio_stream_added_state_=!0,f._audio_added_=!0,f._audioSSRC=c.audio_ssrc),m&&!C&&this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.info("[".concat(this._clientId,"] remote user ").concat(f.uid," published audio")),this.safeEmit(Gn.USER_PUBLISHED,f,"audio")),v&&!R&&this.getListeners(Gn.PUBLISHED_USER_LIST).length===0&&(z.info("[".concat(this._clientId,"] remote user ").concat(f.uid," published video")),this.safeEmit(Gn.USER_PUBLISHED,f,"video")),(m&&!C||v&&!R||w)&&a.push(f),v&&this._p2pChannel.hasPendingRemoteMedia(f,"video")&&o.push({user:f,mediaType:"video"}),m&&this._p2pChannel.hasPendingRemoteMedia(f,"audio")&&o.push({user:f,mediaType:"audio"})}o.length>0&&(z.debug("[".concat(this._clientId,"] RE massSubscribe after reconnect ").concat(o.map(c=>"user: ".concat(c.user.uid,", mediaType: ").concat(c.mediaType)).join("; ")," ")),this.massSubscribe(o).catch(c=>{z.error("[".concat(this._clientId,"] mass resubscribe error"),c.toString())})),this.getListeners(Gn.PUBLISHED_USER_LIST).length>0?ve("ENABLE_DATASTREAM_2")?this._pendingPublishedUsers=a:(z.info("[".concat(this._clientId,"] client emit user-list event, users: ").concat(a.map(c=>c.uid).join(", "))),this.safeEmit(Gn.PUBLISHED_USER_LIST,a)):z.info("[".concat(this._clientId,"] client not emit user-list event case there is no user-list listener, users: ").concat(a.map(c=>c.uid).join(", ")))}),this._gateway.signal.on(Sn.ON_RTP_CAPABILITY_CHANGE,r=>{let{video_codec:a}=r;this._p2pChannel instanceof GD&&this._p2pChannel.updateRemoteRTPCapabilities(a.map(o=>o.toLowerCase()).filter(o=>{var c;return Tt(c=Object.keys(VS)).call(c,o)}))})}_handleP2PEvents(){this._gateway.signal.on(Sn.ON_USER_OFFLINE,()=>{this._p2pChannel.disconnectForReconnect()}),this._gateway.signal.on(Nr.PUBLISH,(r,a,o)=>{let{uid:c}=r;r.forEach(f=>{let{kind:m,ssrcs:v,mid:w,isMuted:C}=f;this._handleP2PAddAudioOrVideoStream(m,c,v[0].ssrcId,w);let R=this._users.find(x=>x.uid===c);return R&&this._p2pChannel instanceof Fl?this._p2pChannel.mockSubscribe(R,m,v[0].ssrcId,w).then(()=>{a()}).catch(o):a(),this._handleMuteStream(c,m,!!C)})}),this._gateway.signal.on(Nr.CALL,async(r,a,o)=>{if(this._p2pChannel instanceof Fl)try{var c;a(await this._p2pChannel.startP2P({turnServer:(c=this._joinInfo)===null||c===void 0?void 0:c.turnServer},r))}catch(f){o(f)}}),this._gateway.signal.on(Ut.P2P_CONNECTION,async r=>{this._p2pChannel instanceof Fl&&await this._p2pChannel.p2pConnect(r)}),this._gateway.signal.on(Nr.UNPUBLISH,async(r,a,o)=>{if(this._p2pChannel instanceof Fl){let{unpubMsg:c,uid:f}=r,m=this._users.find(v=>v.uid===f);if(!m)return z.warning("[".concat(this._clientId,"] can not find remote user, ignore mute event, uid: ").concat(f)),void a();try{c.forEach(async v=>{let{stream_type:w}=v,C=w===pi.Audio?Wt.AUDIO:Wt.VIDEO;await this._p2pChannel.unsubscribe(m,C),this._handleMuteStream(f,C,!0)}),a()}catch(v){o(v)}}}),this._gateway.signal.on(Nr.CONTROL,async(r,a)=>{let{action:o}=r;switch(o){case N0.MUTE_LOCAL_VIDEO:this._handleMuteStream(a,Wt.VIDEO,!0);break;case N0.MUTE_LOCAL_AUDIO:this._handleMuteStream(a,Wt.AUDIO,!0);break;case N0.UNMUTE_LOCAL_VIDEO:this._handleP2PAddAudioOrVideoStream("video",a),this._handleMuteStream(a,Wt.VIDEO,!1);break;case N0.UNMUTE_LOCAL_AUDIO:this._handleP2PAddAudioOrVideoStream("audio",a),this._handleMuteStream(a,Wt.AUDIO,!1)}}),this._gateway.signal.on(Nr.RESTART_ICE,async(r,a,o)=>{if(this._p2pChannel instanceof Fl)try{let{direction:c,iceParameter:f}=r;c!==no.SEND_ONLY||f?a(await this._p2pChannel.restartICE(c,f)):(this._p2pChannel.handleDisconnect(c),a())}catch(c){o(c)}}),this._gateway.signal.on(Nr.CANDIDATE,r=>{if(this._p2pChannel instanceof Fl){let{candidate:a,direction:o}=r;this._p2pChannel.addRemoteCandidate(a,o)}}),this._p2pChannel.on(pn.RequestP2PRestartICE,async(r,a,o)=>{try{let{direction:c}=r;a(await this._gateway.sendExtensionMessage(Nr.RESTART_ICE,r,c===no.SEND_ONLY))}catch(c){o(c)}}),this._p2pChannel.on(pn.LocalCandidate,r=>{this._gateway.sendExtensionMessage(Nr.CANDIDATE,JSON.stringify(r),!0)}),this._p2pChannel.on(pn.RequestP2PMuteLocal,async(r,a,o)=>{try{await this._gateway.sendExtensionMessage(Nr.CONTROL,r,!0),a()}catch(c){o(c)}}),this._p2pChannel.on(pn.RequestP2PUnmuteRemote,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.unmuteRemote(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestP2PMuteRemote,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.muteRemote(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.StateChange,(r,a)=>{a===gi.Connected&&this._p2pChannel.republish()})}_handleP2PChannelEvents(){this._p2pChannel.on(pn.RequestMuteLocal,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.muteLocal(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestUnmuteLocal,async(r,a,o)=>{if(this._joinInfo)try{await this._gateway.unmuteLocal(r,this._joinInfo.stringUid||this._joinInfo.uid),a()}catch(c){c.code===ce.DISCONNECT_P2P?a():o(c)}else a()}),this._p2pChannel.on(pn.RequestRePublish,(r,a,o)=>{this.publish(r,!1).then(a).catch(o)}),this._p2pChannel.on(pn.RequestRePublishDataChannel,(r,a,o)=>{Ct.all(r.map(async c=>{await this._p2pChannel.publishDataChannel([c]);let f={streamId:c.id,ordered:c.ordered,maxRetransmits:c.maxRetransmits,metadata:c.metadata,channelId:c._originDataChannelId};try{await this._gateway.publishDataChannel(this._uid,f,!0)}catch(m){if(m.code!==ce.DISCONNECT_P2P)throw m}})).then(a).catch(o)}),this._p2pChannel.on(pn.RequestReSubscribe,async(r,a,o)=>{try{for(let{user:c,kind:f}of r)f===Wt.VIDEO?await this.subscribe(c,"video"):await this.subscribe(c,"audio");a()}catch(c){o(c)}}),this._p2pChannel.on(pn.RequestUpload,(r,a)=>{this._gateway.upload(r,a)}),this._p2pChannel.on(pn.RequestUploadStats,r=>{this._gateway.uploadWRTCStats(r)}),this._p2pChannel.on(pn.MediaReconnectStart,r=>{this.safeEmit(Gn.MEDIA_RECONNECT_START,r)}),this._p2pChannel.on(pn.MediaReconnectEnd,r=>{this.safeEmit(Gn.MEDIA_RECONNECT_END,r)}),this._p2pChannel.on(pn.NeedSignalRTT,r=>{r(this._gateway.getSignalRTT())}),this._p2pChannel.on(pn.RequestRestartICE,async r=>{if(this._p2pChannel instanceof Fl)return;let a=await this._p2pChannel.restartICE(r),o=await a.next();if(o.done)return;let c=o.value,f;try{f=await this._gateway.restartICE({iceParameters:c})}catch(v){return void a.throw(v)}let{iceParameters:m}=function(v){let w=v.iceParameters;return{iceParameters:{iceUfrag:w.iceUfrag,icePwd:w.icePwd}}}(f);await a.next({remoteIceParameters:m})}),this._p2pChannel.on(pn.RequestReconnect,async()=>{this._gateway.reconnect()}),this._p2pChannel.on(pn.RequestReconnectPC,async()=>{var r;let{iceParameters:a,dtlsParameters:o,rtpCapabilities:c}=await this._p2pChannel.startP2PConnection({turnServer:(r=this._joinInfo)===null||r===void 0?void 0:r.turnServer}),{gatewayEstablishParams:f,gatewayAddress:m}=await this._gateway.reconnectPC({iceParameters:a,dtlsParameters:o,rtpCapabilities:c}),{dtlsParameters:v,iceParameters:w,candidates:C,rtpCapabilities:R,setup:x,cname:L}=koe(f,m);await this._p2pChannel.connect(w,v,C,R,x,L),await this._p2pChannel.republish(),await this._p2pChannel.reSubscribe()}),this._p2pChannel.on(pn.RequestUnpublishForReconnectPC,async(r,a,o)=>{this._joinInfo&&this._uid!==void 0?(await this._gateway.unpublish(r,this._uid),a()):o()}),this._p2pChannel.on(pn.P2PLost,()=>{this.safeEmit(Gn.P2P_LOST,this.store.uid)}),this._p2pChannel.on(pn.UpdateVideoEncoder,r=>{r._encoderConfig&&this._gateway.setVideoProfile(r._encoderConfig)}),this._p2pChannel.on(pn.ConnectionTypeChange,r=>{this.safeEmit(Gn.IS_USING_CLOUD_PROXY,r)}),this._p2pChannel.on(pn.RequestLowStreamParameter,r=>{r(this._lowStreamParameter||{width:160,height:120,framerate:15,bitrate:50})}),this._p2pChannel.on(pn.QueryClientConnectionState,r=>{r(this.connectionState)})}getKeyMetrics(){return this.store.keyMetrics}async enableContentInspect(r){if(this.connectionState!=="CONNECTED"||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Client did not join channel"));if(this._inspect)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] Inspect content service already in connecting/connected state"));if(!r)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig is necessary"));if(!r.inspectType||!Array.isArray(r.inspectType))throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig.inspectType is necessary and is an instance of Array."));{let a=[...new Set(r.inspectType)];a.forEach(o=>{var c;if(!Tt(c=["supervise","moderation"]).call(c,o))throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] ").concat(o," is not a valid inspect type."))}),r.inspectType=a}if(r&&r.extraInfo&&r.extraInfo.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] inspectConfig.extraInfo length cannot exceed 1024 bytes"));try{let a=new WD(r);this._inspect=a,this.handleVideoInspectEvents(this._inspect),await a.init({appId:this._joinInfo.appId,areaCode:"",cname:this._joinInfo.cname,sid:this._joinInfo.sid,token:this._joinInfo.token,uid:this._joinInfo.uid,cid:this._joinInfo.cid,vid:this._joinInfo.vid?Number(this._joinInfo.vid):0},kr)}catch(a){throw Array.isArray(a)?a[0]:a}}async disableContentInspect(){if(!this._inspect)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] inspectVideoContent not started"));try{this._inspect.close(),this._inspect=void 0}catch(r){throw Array.isArray(r)?r[0]:r}}async setImageModeration(r,a){if(fm(r,"enabled"),r){if(!a)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config is necessary"));if(Ti(a.interval,"interval",1e3,1/0),a&&a.extraInfo&&a.extraInfo.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config.extraInfo length cannot exceed 1024 bytes"));if(a&&a.vendor&&a.vendor.length>1024)throw new De(ce.INVALID_PARAMS,"[".concat(this._clientId,"] config.vendor length cannot exceed 1024 bytes"));if(this.connectionState!=="CONNECTED"||!this._joinInfo)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,'] can not enable image moderation, not joined"'));try{if(this._moderation)return void this._moderation.updateConfig(a);let o=new HW(a);this._moderation=o,this.handleImageModerationEvents(this._moderation),await o.init({appId:this._joinInfo.appId,areaCode:"",cname:this._joinInfo.cname,sid:this._joinInfo.sid,token:this._joinInfo.token,uid:this._joinInfo.uid,cid:this._joinInfo.cid,vid:this._joinInfo.vid?Number(this._joinInfo.vid):0},kr)}catch(o){throw Array.isArray(o)?o[0]:o}}else{if(!this._moderation)throw new De(ce.INVALID_OPERATION,"[".concat(this._clientId,"] image moderation not started"));try{this._moderation.close(),this._moderation.removeAllListeners(),this._moderation=void 0}catch(o){throw Array.isArray(o)?o[0]:o}}}setP2PTransport(r){if(function(a){as(a,"transport",["default","auto","relay","sd-rtn"])}(r),this.mode!=="p2p")throw new De(ce.INVALID_OPERATION,"only p2p mode can set p2pTransport");this.store.p2pTransport=r,z.info("[".concat(this._clientId,"] set client p2pTransport to ").concat(r))}handleImageModerationEvents(r){r.on(bh.CONNECTION_STATE_CHANGE,(a,o)=>{if(this.safeEmit(Gn.IMAGE_MODERATION_CONNECTION_STATE_CHANGE,a,o),a===hd.CONNECTED){if(this.connectionState!=="CONNECTED")throw this.setImageModeration(!1),new De(ce.OPERATION_ABORTED,"Image moderation was cancelled because it left the channel");r.inspectImage()}}),r.on(bh.CLIENT_LOCAL_VIDEO_TRACK,a=>{a(this.localTracks.filter(o=>o.trackMediaType==="video")[0])})}handleVideoInspectEvents(r){r.on(As.CONNECTION_STATE_CHANGE,(a,o)=>{if(this.safeEmit(Gn.CONTENT_INSPECT_CONNECTION_STATE_CHANGE,a,o),o===mu.CONNECTED){if(this.connectionState!=="CONNECTED")return void this.safeEmit(Gn.CONTENT_INSPECT_ERROR,new De(ce.OPERATION_ABORTED,"Content inspect was cancelled because it left the channel"));r.inspectImage()}}),r.on(As.INSPECT_RESULT,(a,o)=>{var c;if((o==null?void 0:o.code)===ce.INVALID_OPERATION&&this.connectionState==="DISCONNECTED")return z.debug("Stop inspect content because that has left channel"),this==null||(c=this._inspect)===null||c===void 0||c.close(),void(this._inspect=void 0);this.safeEmit(Gn.CONTENT_INSPECT_RESULT,a,o)}),r.on(As.CLIENT_LOCAL_VIDEO_TRACK,a=>{a(this.localTracks.filter(o=>o.trackMediaType==="video")[0])})}getJoinChannelServiceRecords(){return z.debug("getJoinChannelServiceRecords"),this.store.joinChannelServiceRecords}async setPublishAudioFilterEnabled(r){fm(r,"enabled"),Ri("ENABLE_PUBLISH_AUDIO_FILTER",r),this._joinInfo&&await this._gateway.setPublishAudioFilterEnabled(r)}_handleResetAddStream(r,a){switch(a){case"audio":r._audio_added_=!1,r._trust_audio_stream_added_state_=!0;break;case"video":r._video_added_=!1,r._trust_video_stream_added_state_=!0}}},vt(Nt.prototype,"leave",[sce],Object.getOwnPropertyDescriptor(Nt.prototype,"leave"),Nt.prototype),vt(Nt.prototype,"publish",[ace],Object.getOwnPropertyDescriptor(Nt.prototype,"publish"),Nt.prototype),vt(Nt.prototype,"unpublish",[oce],Object.getOwnPropertyDescriptor(Nt.prototype,"unpublish"),Nt.prototype),vt(Nt.prototype,"subscribe",[lce],Object.getOwnPropertyDescriptor(Nt.prototype,"subscribe"),Nt.prototype),vt(Nt.prototype,"presubscribe",[cce],Object.getOwnPropertyDescriptor(Nt.prototype,"presubscribe"),Nt.prototype),vt(Nt.prototype,"massSubscribe",[dce],Object.getOwnPropertyDescriptor(Nt.prototype,"massSubscribe"),Nt.prototype),vt(Nt.prototype,"unsubscribe",[uce],Object.getOwnPropertyDescriptor(Nt.prototype,"unsubscribe"),Nt.prototype),vt(Nt.prototype,"massUnsubscribe",[hce],Object.getOwnPropertyDescriptor(Nt.prototype,"massUnsubscribe"),Nt.prototype),vt(Nt.prototype,"setLowStreamParameter",[fce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLowStreamParameter"),Nt.prototype),vt(Nt.prototype,"enableDualStream",[pce],Object.getOwnPropertyDescriptor(Nt.prototype,"enableDualStream"),Nt.prototype),vt(Nt.prototype,"disableDualStream",[mce],Object.getOwnPropertyDescriptor(Nt.prototype,"disableDualStream"),Nt.prototype),vt(Nt.prototype,"setClientRole",[gce],Object.getOwnPropertyDescriptor(Nt.prototype,"setClientRole"),Nt.prototype),vt(Nt.prototype,"setProxyServer",[vce],Object.getOwnPropertyDescriptor(Nt.prototype,"setProxyServer"),Nt.prototype),vt(Nt.prototype,"setTurnServer",[yce],Object.getOwnPropertyDescriptor(Nt.prototype,"setTurnServer"),Nt.prototype),vt(Nt.prototype,"setLicense",[_ce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLicense"),Nt.prototype),vt(Nt.prototype,"startProxyServer",[Ece],Object.getOwnPropertyDescriptor(Nt.prototype,"startProxyServer"),Nt.prototype),vt(Nt.prototype,"stopProxyServer",[wce],Object.getOwnPropertyDescriptor(Nt.prototype,"stopProxyServer"),Nt.prototype),vt(Nt.prototype,"setLocalAccessPointsV2",[Sce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLocalAccessPointsV2"),Nt.prototype),vt(Nt.prototype,"setLocalAccessPoints",[bce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLocalAccessPoints"),Nt.prototype),vt(Nt.prototype,"setRemoteDefaultVideoStreamType",[Cce],Object.getOwnPropertyDescriptor(Nt.prototype,"setRemoteDefaultVideoStreamType"),Nt.prototype),vt(Nt.prototype,"setRemoteVideoStreamType",[Tce],Object.getOwnPropertyDescriptor(Nt.prototype,"setRemoteVideoStreamType"),Nt.prototype),vt(Nt.prototype,"setStreamFallbackOption",[Rce],Object.getOwnPropertyDescriptor(Nt.prototype,"setStreamFallbackOption"),Nt.prototype),vt(Nt.prototype,"setEncryptionConfig",[xce],Object.getOwnPropertyDescriptor(Nt.prototype,"setEncryptionConfig"),Nt.prototype),vt(Nt.prototype,"renewToken",[Ace],Object.getOwnPropertyDescriptor(Nt.prototype,"renewToken"),Nt.prototype),vt(Nt.prototype,"enableAudioVolumeIndicator",[Ice],Object.getOwnPropertyDescriptor(Nt.prototype,"enableAudioVolumeIndicator"),Nt.prototype),vt(Nt.prototype,"startLiveStreaming",[Nce],Object.getOwnPropertyDescriptor(Nt.prototype,"startLiveStreaming"),Nt.prototype),vt(Nt.prototype,"setLiveTranscoding",[Oce],Object.getOwnPropertyDescriptor(Nt.prototype,"setLiveTranscoding"),Nt.prototype),vt(Nt.prototype,"stopLiveStreaming",[Pce],Object.getOwnPropertyDescriptor(Nt.prototype,"stopLiveStreaming"),Nt.prototype),vt(Nt.prototype,"addInjectStreamUrl",[Lce],Object.getOwnPropertyDescriptor(Nt.prototype,"addInjectStreamUrl"),Nt.prototype),vt(Nt.prototype,"removeInjectStreamUrl",[Dce],Object.getOwnPropertyDescriptor(Nt.prototype,"removeInjectStreamUrl"),Nt.prototype),vt(Nt.prototype,"startChannelMediaRelay",[kce],Object.getOwnPropertyDescriptor(Nt.prototype,"startChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"updateChannelMediaRelay",[Mce],Object.getOwnPropertyDescriptor(Nt.prototype,"updateChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"stopChannelMediaRelay",[jce],Object.getOwnPropertyDescriptor(Nt.prototype,"stopChannelMediaRelay"),Nt.prototype),vt(Nt.prototype,"sendCustomReportMessage",[Uce],Object.getOwnPropertyDescriptor(Nt.prototype,"sendCustomReportMessage"),Nt.prototype),vt(Nt.prototype,"pickSVCLayer",[Fce],Object.getOwnPropertyDescriptor(Nt.prototype,"pickSVCLayer"),Nt.prototype),vt(Nt.prototype,"setRTMConfig",[Bce],Object.getOwnPropertyDescriptor(Nt.prototype,"setRTMConfig"),Nt.prototype),vt(Nt.prototype,"enableContentInspect",[Vce],Object.getOwnPropertyDescriptor(Nt.prototype,"enableContentInspect"),Nt.prototype),vt(Nt.prototype,"disableContentInspect",[zce],Object.getOwnPropertyDescriptor(Nt.prototype,"disableContentInspect"),Nt.prototype),vt(Nt.prototype,"setImageModeration",[Hce],Object.getOwnPropertyDescriptor(Nt.prototype,"setImageModeration"),Nt.prototype),vt(Nt.prototype,"setP2PTransport",[Gce],Object.getOwnPropertyDescriptor(Nt.prototype,"setP2PTransport"),Nt.prototype),vt(Nt.prototype,"getJoinChannelServiceRecords",[Wce],Object.getOwnPropertyDescriptor(Nt.prototype,"getJoinChannelServiceRecords"),Nt.prototype),vt(Nt.prototype,"setPublishAudioFilterEnabled",[$ce],Object.getOwnPropertyDescriptor(Nt.prototype,"setPublishAudioFilterEnabled"),Nt.prototype),Nt);class rI{constructor(a,o){X(this,"id",0),X(this,"element",void 0),X(this,"peerPair",void 0),X(this,"context",void 0),X(this,"audioPlayerElement",void 0),X(this,"audioTrack",void 0),rI.count+=1,this.id=rI.count,this.element=a,this.context=o}initPeers(){this.peerPair=[new RTCPeerConnection,new RTCPeerConnection],this.peerPair[1].ontrack=a=>{let o=document.createElement("audio");o.srcObject=new MediaStream([a.track]),o.play(),this.audioPlayerElement=o}}async switchSdp(){if(!this.peerPair)return;let a=async(c,f)=>{let m=f==="offer"?await c.createOffer():await c.createAnswer();return await c.setLocalDescription(m),c.iceGatheringState==="complete"?c.localDescription:new Ct(v=>{c.onicegatheringstatechange=()=>{c.iceGatheringState==="complete"&&v(c.localDescription)}})},o=async(c,f)=>await c.setRemoteDescription(f);try{let c=await a(this.peerPair[0],"offer");await o(this.peerPair[1],c);let f=await a(this.peerPair[1],"answer");await o(this.peerPair[0],f)}catch(c){throw new De(ce.LOCAL_AEC_ERROR,c.toString()).print()}}async getTracksFromMediaElement(a){if(this.audioTrack)return this.audioTrack;let o;try{a instanceof HTMLVideoElement&&(a.captureStream?a.captureStream():a.mozCaptureStream()),o=this.context.createMediaStreamDestination(),this.context.createMediaElementSource(a).connect(o)}catch(f){throw new De(ce.LOCAL_AEC_ERROR,f.toString()).print()}if(!o)throw new De(ce.LOCAL_AEC_ERROR,"no dest node when local aec").print();let c=o.stream.getAudioTracks()[0];return this.audioTrack=c,c}getElement(){return this.element}async startEchoCancellation(){this.context.resume(),this.peerPair&&this.close(),this.initPeers();let a=this.element,o=await this.getTracksFromMediaElement(a);this.peerPair&&this.peerPair[0].addTrack(o),await this.switchSdp()}close(){z.debug("close echo cancellation unit, id is",this.id),this.audioPlayerElement&&this.audioPlayerElement.pause(),this.peerPair&&this.peerPair.forEach(a=>{a.close()}),this.peerPair=void 0,this.audioPlayerElement=void 0}}var qce,JD;X(rI,"count",0);let aNe=window.AudioContext||window.webkitAudioContext,oNe=new(qce=hn({report:$t}),vt((JD=class{constructor(){X(this,"units",[]),X(this,"context",void 0)}processExternalMediaAEC(r){if(!this._doesEnvironmentNeedAEC())return z.debug("the system does not need to process local aec"),-1;this.context||(this.context=new aNe);let a=this.units.find(o=>o&&o.getElement()===r);return a||(a=new rI(r,this.context),this.units.push(a)),a.startEchoCancellation(),z.debug("start processing local audio echo cancellation, id is",a.id),a.id}_doesEnvironmentNeedAEC(){return ni().name!==fi.SAFARI}}).prototype,"processExternalMediaAEC",[qce],Object.getOwnPropertyDescriptor(JD.prototype,"processExternalMediaAEC"),JD.prototype),JD);function Yce(r,a){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);a&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(r,f).enumerable})),o.push.apply(o,c)}return o}function Xce(r){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?Yce(Object(o),!0).forEach(function(c){X(r,c,o[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):Yce(Object(o)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(o,c))})}return r}let XW=window||document;function Jce(r){let a=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!XW)return;let o=Yr._cspEventHandlerPointer;if(o&&a)return void console.error(o,a);let c=f=>{if(!(f&&f.blockedURI&&(Yr.onSecurityPolicyViolation||Yr.getListeners(Mf.SECURITY_POLICY_VIOLATION).length>0)))return;let m=f.blockedURI;ve("CSP_DETECTED_HOSTNAME_LIST").some(v=>Tt(m).call(m,v))&&(Yr.onSecurityPolicyViolation&&typeof Yr.onSecurityPolicyViolation=="function"&&Yr.onSecurityPolicyViolation(f),Yr.getListeners(Mf.SECURITY_POLICY_VIOLATION).length>0&&Yr.safeEmit(Mf.SECURITY_POLICY_VIOLATION,f))};o&&XW.removeEventListener("securitypolicyviolation",o),(a||r&&typeof r=="function"||Yr.getListeners(Mf.SECURITY_POLICY_VIOLATION).length>0)&&XW.addEventListener("securitypolicyviolation",c),Yr._cspEventHandlerPointer=c}Ri("PROCESS_ID","process-".concat(Di(8,""),"-").concat(Di(4,""),"-").concat(Di(4,""),"-").concat(Di(4,""),"-").concat(Di(12,""))),function(){let r;try{r=window.localStorage.getItem("websdk_ng_global_parameter")}catch(a){return void z.error("Error loading sdk config",a.message)}if(r)try{let a=JSON.parse(window.atob(r)),o=Date.now();z.debug("Loading global parameters from cache",a),Object.keys(a).forEach(c=>{if(Object.prototype.hasOwnProperty.call(es,c)){let{value:f,expires:m}=a[c];if(m&&m<=o)return;x0[c]=f,es[c]=f}})}catch(a){z.error("Error loading mutableParamsCache: ".concat(r),a.message)}}(),Array.isArray(x0.AREAS)&&x0.AREAS.length>0&&uG(x0.AREAS,!0);let Qce=(r,a,o)=>{z.debug("setParameter key:".concat(r,", value:").concat(JSON.stringify(a))),Ri(r,a,o)},Yr=function(r){let a=new nr,o=r,c={getListeners:a.getListeners.bind(a),on:(f,m)=>(function(v,w){v===Mf.SECURITY_POLICY_VIOLATION&&Jce(w,!0)}(f,m),a.on.bind(a)(f,m)),addListener:a.addListener.bind(a),once:a.once.bind(a),off:a.off.bind(a),removeAllListeners:a.removeAllListeners.bind(a),emit:a.emit.bind(a),safeEmit:a.safeEmit.bind(a)};return Xce(Xce({},o),c)}({__TRACK_LIST__:lb,VERSION:dd,BUILD:qH,ESM_BUNDLER:!1,ESM:!1,UMD:!0,DEV:!1,setParameter:Qce,getParameter:ve,getSupportedCodec:async function(){let r={audio:[],video:[]};try{let a=new RTCPeerConnection,o=await async function(c){let f;return Jn().supportUnifiedPlan?(c.addTransceiver("video",{direction:"recvonly"}),c.addTransceiver("audio",{direction:"recvonly"}),f=(await c.createOffer()).sdp):f=(await c.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})).sdp,f}(a);if(!o)return r;a.close(),a=null,r=function(c){let f={video:[],audio:[]};return c.match(/ VP8/i)&&f.video.push("VP8"),c.match(/ VP9/i)&&f.video.push("VP9"),c.match(/ AV1/i)&&f.video.push("AV1"),c.match(/ H264/i)&&f.video.push("H264"),c.match(/ H265/i)&&f.video.push("H265"),c.match(/ opus/i)&&f.audio.push("OPUS"),c.match(/ PCMU/i)&&f.audio.push("PCMU"),c.match(/ PCMA/i)&&f.audio.push("PCMA"),c.match(/ G722/i)&&f.audio.push("G722"),f}(o)}catch(a){throw new De(ce.CREATE_OFFER_FAILED,a.toString&&a.toString()).print()}return r},checkSystemRequirements:function(){let r=$t.reportApiInvoke(null,{name:$r.CHECK_SYSTEM_REQUIREMENTS,options:[],tag:vr.TRACER}),a=!1;try{let m=window.RTCPeerConnection,v=navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,w=window.WebSocket;a=!!(m&&v&&w),a&&MH()&&function(C){let R=ni();return!(R.name!==fi.CHROME||!R.osVersion)&&Number(R.version)<C}(75)&&new m().close()}catch(m){return z.error("check system requirement failed: ",m),!1}let o=!1,c=ni();c.name===fi.CHROME&&Number(c.version)>=58&&(Eh.engine.name!=="WebKit"||function(){let m=ni();if(O8()){if(m.os===ms.MAC_OS)return!0;if(m.os===ms.IOS){let v=Eh.os.version&&Eh.os.version.split(".");if(v&&Number(v[0])===14&&v[1]&&Number(v[1])>=3||v&&Number(v[0])>14)return!0}}return!1}())&&(o=!0),(c.name===fi.FIREFOX&&Number(c.version)>=56||c.name===fi.OPERA&&Number(c.version)>=45||c.name===fi.SAFARI&&Number(c.version)>=11||c.name==="WebKit"&&(ra()||fu())&&c.osVersion&&Number(c.osVersion.split(".")[0])>=11||kne()||ni().name===fi.QQ)&&(o=!0),z.debug("checkSystemRequirements, api:",a,"browser",o);let f=a&&o;return r.onSuccess(f),f},getDevices:function(r){return Oc.enumerateDevices(!0,!0,r)},getMicrophones:function(r){return Oc.getRecordingDevices(r)},getCameras:function(r){return Oc.getCamerasDevices(r)},getElectronScreenSources:Tse,getPlaybackDevices:function(r){return Oc.getSpeakers(r)},createClient:function(){var r;let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{codec:"vp8",audioCodec:"opus",mode:"rtc"},o=$t.reportApiInvoke(null,{name:$r.CREATE_CLIENT,options:[a],tag:vr.TRACER});try{(function(c){as(c.codec,"config.codec",["vp8","vp9","av1","h264","h265"]),as(c.mode,"config.mode",["rtc","live","p2p"]),c.audioCodec!==void 0&&as(c.audioCodec,"config.audioCodec",["opus","pcmu","pcma","g722"]),c.proxyServer!==void 0&&Ms(c.proxyServer,"config.proxyServer",1,1e4),c.turnServer!==void 0&&Wne(c.turnServer),c.httpRetryConfig!==void 0&&Gne(c.httpRetryConfig),c.websocketRetryConfig!==void 0&&Gne(c.websocketRetryConfig)})(a)}catch(c){throw o.onError(c),c}return(Ine(16,0)||Nne(16,0))&&(a.codec==="vp9"&&(a.codec="vp8",z.debug("browser not support vp9, force use vp8")),Ri("UNSUPPORTED_VIDEO_CODEC",["vp9"])),a.audioCodec===void 0&&(a.audioCodec="opus"),o.onSuccess(),new sNe(yd(yd({forceWaitGatewayResponse:!0},a),{},{role:Tt(r=["rtc","p2p"]).call(r,a.mode)?"host":a.role||"audience"}))},createCameraVideoTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=ve("CAMERA_CAPTURE_CONFIG"),o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_CAM_VIDEO_TRACK,options:[ir({},r),a]});a&&(r.encoderConfig=a);let c=bD(r),f=Di(8,"track-cam-"),m=null,v=r.encoderConfig==="720p_auto";z.info("start create camera video track with config",JSON.stringify(r),"trackId",f);try{m=(await Nc({video:c},f)).getVideoTracks()[0]||null}catch(C){throw o.onError(C),C}if(!m){let C=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return o.onError(C),C.throw(z)}r.optimizationMode&&_W(f,m,r,zf(r.encoderConfig));let w=new yW(m,r,c,r.scalabiltyMode?_D(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,f);return v&&w.startMonitorStats(),o.onSuccess(w.getTrackId()),z.info("create camera video success, trackId:",f),w},createCustomVideoTrack:function(r){let a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_CUSTOM_VIDEO_TRACK,options:[r]}),o=new ki(r.mediaStreamTrack,{width:r.width,height:r.height,frameRate:r.frameRate,bitrateMax:r.bitrateMax,bitrateMin:r.bitrateMin},r.scalabiltyMode?_D(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,Di(8,"track-cus-"),[Hi.CUSTOM_TRACK]);return a.onSuccess(o.getTrackId()),z.info("create custom video track success with config",r,"trackId",o.getTrackId()),o},createScreenVideoTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"disable",o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_SCREEN_VIDEO_TRACK,options:[ir({},r),a]}),c=r.encoderConfig==="720p_auto";r.encoderConfig?typeof r.encoderConfig=="string"||r.encoderConfig.width&&r.encoderConfig.height||(r.encoderConfig.width={max:1920},r.encoderConfig.height={max:1080}):r.encoderConfig="1080p_2";let f=function(L){let U={};L.screenSourceType&&(U.mediaSource=L.screenSourceType),L.extensionId&&b0()&&(U.extensionId=L.extensionId);let{displaySurface:F,selfBrowserSurface:Z,surfaceSwitching:W,systemAudio:K}=L;(DH(107)||xne(107)||One(93))&&(F&&(as(F,"displaySurface",["browser","window","monitor"]),U.displaySurface=F),Z?(as(Z,"selfBrowserSurface",["exclude","include"]),U.selfBrowserSurface=Z):U.selfBrowserSurface="include",W&&(as(W,"surfaceSwitching",["exclude","include"]),U.surfaceSwitching=W)),(DH(105)||xne(105)||One(91))&&K&&(as(K,"systemAudio",["exclude","include"]),U.systemAudio=K),L.electronScreenSourceId&&(U.sourceId=L.electronScreenSourceId);let oe=L.encoderConfig?oW(L.encoderConfig):null;return U.mandatory={chromeMediaSource:"desktop",maxWidth:oe?oe.width:void 0,maxHeight:oe?oe.height:void 0},oe&&(oe.frameRate&&(typeof oe.frameRate=="number"?(U.mandatory.maxFrameRate=oe.frameRate,U.mandatory.minFrameRate=oe.frameRate):(U.mandatory.maxFrameRate=oe.frameRate.max||oe.frameRate.ideal||oe.frameRate.exact||void 0,U.mandatory.minFrameRate=oe.frameRate.min||oe.frameRate.ideal||oe.frameRate.exact||void 0),U.frameRate=oe.frameRate),oe.width&&(U.width=oe.width),oe.height&&(U.height=oe.height)),U}(r),m=Di(8,"track-scr-v-"),v=null,w=null,C=Jn();if(!C.supportShareAudio&&a==="enable"){let L=new Ke(ce.NOT_SUPPORTED,"your browser or platform is not support share-screen with audio");return o.onError(L),L.throw(z)}z.info("start create screen video track with config",r,"withAudio",a,"trackId",m);try{let L=await Nc({screen:f,screenAudio:a==="auto"?C.supportShareAudio:a==="enable"},m);v=L.getVideoTracks()[0]||null,w=L.getAudioTracks()[0]||null}catch(L){throw o.onError(L),L}if(!v){let L=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return o.onError(L),L.throw(z)}if(!w&&a==="enable"){v&&v.stop();let L=new Ke(ce.SHARE_AUDIO_NOT_ALLOWED);return o.onError(L),L.throw(z)}r.optimizationMode||(r.optimizationMode="detail"),r.optimizationMode&&(_W(m,v,r,r.encoderConfig&&oW(r.encoderConfig)||void 0),r.encoderConfig&&typeof r.encoderConfig!="string"&&(r.encoderConfig.bitrateMin=r.encoderConfig.bitrateMax));let R=new ki(v,r.encoderConfig?oW(r.encoderConfig):{},r.scalabiltyMode?_D(r.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},r.optimizationMode,m,[Hi.SCREEN_TRACK]);if(c&&R.startMonitorStats(),!w)return o.onSuccess(R.getTrackId()),z.info("create screen video track success","video:",R.getTrackId()),R;let x=new br(w,void 0,Di(8,"track-scr-a-"),!1);return o.onSuccess([R.getTrackId(),x.getTrackId()]),z.info("create screen video track success","video:",R.getTrackId(),"audio:",x.getTrackId()),[R,x]},createMicrophoneAndCameraTracks:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=ve("CAMERA_CAPTURE_CONFIG"),c=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_MIC_AND_CAM_TRACKS,options:[r,a,o]});o&&(a.encoderConfig=o);let f=a.encoderConfig==="720p_auto",m=bD(a),v=kse(r),w=Di(8,"track-mic-"),C=Di(8,"track-cam-"),R=null,x=null;z.info("start create camera video track(".concat(C,") and microphone audio track(").concat(w,") with config, audio: ").concat(JSON.stringify(r),", video: ").concat(JSON.stringify(a)));try{let F=await Nc({audio:v,video:m},"".concat(w,"-").concat(C));R=F.getAudioTracks()[0],x=F.getVideoTracks()[0]}catch(F){throw c.onError(F),F}if(!R||!x){let F=new Ke(ce.UNEXPECTED_ERROR,"can not find tracks in media stream");return c.onError(F),F.throw(z)}a.optimizationMode&&_W(C,x,a,zf(a.encoderConfig));let L=new CD(R,r,v,w),U=new yW(x,a,m,a.scalabiltyMode?_D(a.scalabiltyMode):{numSpatialLayers:1,numTemporalLayers:1},a.optimizationMode,C);return f&&U.startMonitorStats(),c.onSuccess([L.getTrackId(),U.getTrackId()]),z.info("create camera video track(".concat(C,") and microphone audio track(").concat(w,") success")),[L,U]},createMicrophoneAudioTrack:async function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_MIC_AUDIO_TRACK,options:[r]}),o=kse(r),c=Di(8,"track-mic-"),f=null;z.info("start create microphone audio track with config",JSON.stringify(r),"trackId",c);try{f=(await Nc({audio:o},c)).getAudioTracks()[0]||null}catch(v){throw a.onError(v),v}if(!f){let v=new Ke(ce.UNEXPECTED_ERROR,"can not find track in media stream");return a.onError(v),v.throw(z)}let m=new CD(f,r,o,c);return a.onSuccess(m.getTrackId()),z.info("create microphone audio track success, trackId:",c),m},createCustomAudioTrack:function(r){let a=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_CUSTOM_AUDIO_TRACK,options:[r]}),o=new br(r.mediaStreamTrack,r.encoderConfig?ED(r.encoderConfig):{},Di(8,"track-cus-"),!1);return z.info("create custom audio track success with config",r,"trackId",o.getTrackId()),a.onSuccess(o.getTrackId()),o},createBufferSourceAudioTrack:async function(r){var a;let{cacheOnlineFile:o,encoderConfig:c}=r,{source:f}=r,m={source:f instanceof AudioBuffer?"AudioBuffer":f instanceof File?(a=File.name)!==null&&a!==void 0?a:"File":f,cacheOnlineFile:o,encoderConfig:c},v=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CREATE_BUFFER_AUDIO_TRACK,options:[m]});if(ve("DISABLE_WEBAUDIO"))throw new Ke(ce.NOT_SUPPORTED,"can not create BufferSourceAudioTrack when WebAudio disabled");let w=Di(8,"track-buf-");z.info("start create buffer source audio track with config",JSON.stringify(m),"trackId",w);let C=f;if(!(f instanceof AudioBuffer))try{f=await async function(L,U){let F=null;if(typeof L=="string"){let W=wae.get(L);if(W)return z.debug("use cached audio resource: ",L),W;try{F=(await wh(()=>Io.get(L,{responseType:"arraybuffer"}),void 0,void 0,{maxRetryCount:3})).data}catch(K){throw new Ke(ce.FETCH_AUDIO_FILE_FAILED,K.toString())}}else F=await new Ct((W,K)=>{let oe=new FileReader;oe.onload=ue=>{ue.target?W(ue.target.result):K(new Ke(ce.READ_LOCAL_AUDIO_FILE_ERROR))},oe.onerror=()=>{K(new Ke(ce.READ_LOCAL_AUDIO_FILE_ERROR))},oe.readAsArrayBuffer(L)});let Z=await function(W){let K=fb();return new Ct((oe,ue)=>{K.decodeAudioData(W,xe=>{oe(xe)},xe=>{ue(new Ke(ce.DECODE_AUDIO_FILE_FAILED,xe.toString()))})})}(F);return typeof L=="string"&&U&&wae.set(L,Z),Z}(f,o)}catch(L){return v.onError(L),L.throw(z)}let R=new t4e(f),x=new e4e(C,R,c?ED(c):{},w);return z.info("create buffer source audio track success, trackId:",w),v.onSuccess(x.getTrackId()),x},setAppType:function(r){if(z.debug("setAppType: ".concat(r)),!(Number.isInteger(r)&&r>=0))throw z.debug("Invalid appType"),new De(ce.INVALID_PARAMS,"invalid app type",r);Ri("APP_TYPE",Math.floor(r))},setLogLevel:function(r){z.setLogLevel(r)},enableLogUpload:function(){ve("USE_NEW_LOG")?Ri("UPLOAD_LOG",!0):z.enableLogUpload()},disableLogUpload:function(){ve("USE_NEW_LOG")?Ri("UPLOAD_LOG",!1):z.disableLogUpload()},createChannelMediaRelayConfiguration:function(){return new ale},checkAudioTrackIsActive:async function(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CHECK_AUDIO_TRACK_IS_ACTIVE,options:[a]});if(!(r instanceof br||r instanceof gb)){let C=new De(ce.INVALID_TRACK,"the parameter is not a audio track");return o.onError(C),C.throw()}a&&a<1e3&&(a=1e3);let c=r instanceof br?r.getTrackLabel():"remote_track",f=r.getVolumeLevel(),m=f,v=f,w=Date.now();return new Ct(C=>{let R=setInterval(()=>{let x=r.getVolumeLevel();m=x>m?x:m,v=x<v?x:v;let L=m-v>1e-4,U=Date.now()-w;if(L||U>a){clearInterval(R);let F=L,Z={duration:U,deviceLabel:c,maxVolumeLevel:m,result:F};z.info("[track-".concat(r.getTrackId(),"] check audio track active completed. ").concat(JSON.stringify(Z))),o.onSuccess(Z),C(F)}},200)})},checkVideoTrackIsActive:async function(r){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5e3,o=$t.reportApiInvoke(null,{tag:vr.TRACER,name:$r.CHECK_VIDEO_TRACK_IS_ACTIVE,options:[a]});if(!(r instanceof ki||r instanceof mb)){let L=new De(ce.INVALID_TRACK,"the parameter is not a video track");return o.onError(L),L.throw()}a&&a<1e3&&(a=1e3);let c=r instanceof ki?r.getTrackLabel():"remote_track",f=r.getMediaStreamTrack(!0),m=document.createElement("video");m.style.width="1px",m.style.height="1px",m.setAttribute("muted",""),m.muted=!0,m.setAttribute("playsinline",""),m.controls=!1,(gs()||O8())&&(m.style.opacity="0.01",m.style.position="fixed",m.style.left="0",m.style.top="0",document.body.appendChild(m)),m.srcObject=new MediaStream([f]),m.play();let v=document.createElement("canvas");v.width=160,v.height=120;let w=0,C=0;try{let L=Date.now();w=await function(U,F,Z,W){let K,oe=0,ue=null;return new Ct((xe,Oe)=>{function ke(){oe>W&&K&&(K(),xe(oe));let He=Z.getContext("2d");if(!He){let ft=new De(ce.UNEXPECTED_ERROR,"can not get canvas 2d context.");return z.error(ft.toString()),void Oe(ft)}He.drawImage(U,0,0,160,120);let lt=He.getImageData(0,0,Z.width,Z.height),ut=Math.floor(lt.data.length/3);if(ue){for(let ft=0;ft<ut;ft+=3)if(lt.data[ft]!==ue[ft])return oe+=1,void(ue=lt.data);ue=lt.data}else ue=lt.data}setTimeout(()=>{K&&(K(),xe(oe))},F),K=hW(()=>{ke()},30)})}(m,a,v,4),C=Date.now()-L}catch(L){throw o.onError(L),L}tNe===fi.SAFARI&&(m.pause(),m.remove()),m.srcObject=null;let R=w>4,x={duration:C,changedPicNum:w,deviceLabel:c,result:R};return z.info("[track-".concat(r.getTrackId(),"] check video track active completed. ").concat(JSON.stringify(x))),o.onSuccess(x),R},setArea:uG,audioElementPlayCenter:Oo,resumeAudioContext:function(){Oo.autoResumeAfterInterruption(!0)},processExternalMediaAEC:function(r){oNe.processExternalMediaAEC(r)},registerExtensions:function(r){let a=ve("PLUGIN_INFO")||[];r.forEach(o=>{"name"in o&&!Tt(a).call(a,o.name)&&a.push(o.name);let c=o;c.__registered__=!0,c.logger.hookLog=z.extLog,c.reporter.hookApiInvoke=$t.extApiInvoke,c.parameters&&Object.keys(c.parameters).forEach(f=>{c.parameters[f]=ve(f)})}),Qce("PLUGIN_INFO",a)},ChannelMediaRelayError:GS,ChannelMediaRelayEvent:mm,ChannelMediaRelayState:il,RemoteStreamFallbackType:KIe,RemoteStreamType:$Ie,ConnectionDisconnectedReason:Hn,AudienceLatencyLevelType:sxe,AREAS:ai,preload:async function(r,a,o,c){return Qle(r,a,o,c)}});return Object.defineProperties(Yr,{onAudioAutoplayFailed:{get:()=>Pc.onAudioAutoplayFailed,set:r=>{Pc.onAudioAutoplayFailed=r}},onAutoplayFailed:{get:()=>Pc.onAutoplayFailed,set:r=>{Pc.onAutoplayFailed=r}},_onSecurityPolicyViolation:{value:void 0,writable:!0},_cspEventHandlerPointer:{value:void 0,writable:!0},onSecurityPolicyViolation:{get:()=>Yr._onSecurityPolicyViolation,set(r){Yr._onSecurityPolicyViolation=r,Jce(r)}},__CLIENT_LIST__:{get:()=>ve("SHOW_GLOBAL_CLIENT_LIST")?A0:[]}}),Oc.on(r_.CAMERA_DEVICE_CHANGED,r=>{z.info("camera device changed",JSON.stringify(r)),Yr.onCameraChanged&&Yr.onCameraChanged(r),Yr.safeEmit(Mf.CAMERA_CHANGED,r)}),Oc.on(r_.RECORDING_DEVICE_CHANGED,r=>{z.info("microphone device changed",JSON.stringify(r)),Yr.onMicrophoneChanged&&Yr.onMicrophoneChanged(r),Yr.safeEmit(Mf.MICROPHONE_CHANGED,r)}),Oc.on(r_.PLAYOUT_DEVICE_CHANGED,r=>{z.debug("playout device changed",JSON.stringify(r)),Yr.onPlaybackDeviceChanged&&Yr.onPlaybackDeviceChanged(r),Yr.safeEmit(Mf.PLAYBACK_DEVICE_CHANGED,r)}),Oo.onAutoplayFailed=()=>{z.info("detect audio element autoplay failed"),Pc.onAudioAutoplayFailed&&Pc.onAudioAutoplayFailed()},Si.on("autoplay-failed",()=>{z.info("detect webaudio autoplay failed"),Pc.onAudioAutoplayFailed&&Pc.onAudioAutoplayFailed(),Yr.safeEmit(Mf.AUTOPLAY_FAILED)}),Si.on(js.STATE_CHANGE,(r,a)=>{z.info("audio context state changed: ".concat(a," => ").concat(r)),Yr.onAudioContextStateChanged&&Yr.onAudioContextStateChanged(r,a),Yr.safeEmit(Mf.AUDIO_CONTEXT_STATE_CHANGED,r,a)}),yr.on(By.NETWORK_STATE_CHANGE,(r,a)=>{z.info("[network-indicator] network state changed, ".concat(a," => ").concat(r))}),window&&(window.__ARTC__=Yr),Yr})}),p0e={};ePe(p0e,{AgoraRTCProvider:()=>v0e,AgoraRTCReactError:()=>oc,AgoraRTCScreenShareProvider:()=>uPe,LocalAudioTrack:()=>b0e,LocalUser:()=>A0e,LocalVideoTrack:()=>R0e,RemoteAudioTrack:()=>I0e,RemoteUser:()=>IPe,RemoteVideoTrack:()=>N0e,TrackBoundary:()=>RPe,VERSION:()=>PPe,default:()=>O0e,useAutoPlayAudioTrack:()=>KJ,useAutoPlayVideoTrack:()=>$J,useClientEvent:()=>lPe,useConnectionState:()=>fPe,useCurrentUID:()=>pPe,useIsConnected:()=>Bp,useJoin:()=>_0e,useLocalCameraTrack:()=>S0e,useLocalMicrophoneTrack:()=>w0e,useLocalScreenTrack:()=>CPe,useNetworkQuality:()=>mPe,usePublish:()=>E0e,useRTCClient:()=>ff,useRTCScreenShareClient:()=>hPe,useRemoteAudioTracks:()=>EPe,useRemoteUserTrack:()=>yq,useRemoteUsers:()=>SPe,useRemoteVideoTracks:()=>wPe,useTrackEvent:()=>cPe,useVolumeLevel:()=>vPe});var nPe=jE(UE());function El(n,t,i){return n.on(t,i),()=>n.off(t,i)}function iPe(n){try{return n()}catch(t){console.error(t)}}function FE(n){return()=>n.forEach(iPe)}function rPe(n,t){let i=setInterval(n,t);return()=>clearInterval(i)}function Zj(n,t){let i=setTimeout(n,t);return()=>clearTimeout(i)}function GJ(){let n,t,i;function s(){if(t){let _=t;t=void 0,_()}}async function l(){if(i){let _=i;i=void 0;try{await _()}catch(y){console.error(y)}}}async function d(_){n=!0,await l();try{i=await _()}catch(y){console.error(y)}n=!1,s()}async function u(){n=!0,await l(),n=!1,s()}function p(_){n?t=()=>d(_):d(_)}function g(){n?t=u:u()}return{run:p,dispose:g}}var eU=typeof document<"u"?k.useLayoutEffect:k.useEffect;function sPe(n){return n!=null&&typeof n.then=="function"}function Bv(){let n=k.useRef(!1);return k.useEffect(()=>(n.current=!1,()=>{n.current=!0}),[]),n}function aPe(){let n=Bv();function t(i,s){return new Promise(async(l,d)=>{try{let u=await i;n.current||l(u)}catch(u){n.current?s&&s(u):d(u)}})}return k.useCallback(t,[n])}function m0e(n){let t=aPe(),[i,s]=k.useState();return eU(()=>{sPe(n)?t(n).then(s):s(n)},[n,t]),i}function BE(n,t){let i=k.useRef();k.useEffect(()=>{let{run:s,dispose:l}=i.current||(i.current=GJ());return s(n),l},t)}function oPe(n,t){let i=n.split("."),s=t.split("."),l=Math.max(i.length,s.length);for(let d=0;d<l;d++){let u=parseInt(i[d]||"0"),p=parseInt(s[d]||"0");if(u>p)return 1;if(u<p)return-1}return 0}function lPe(n,t,i){let s=k.useRef(i);eU(()=>{s.current=i},[i]),k.useEffect(()=>{if(n)return El(n,t,(...l)=>{s.current&&s.current(...l)})},[t,n])}function cPe(n,t,i){let s=k.useRef(i);eU(()=>{s.current=i},[i]),k.useEffect(()=>{if(n)return El(n,t,(...l)=>{s.current&&s.current(...l)})},[t,n])}var g0e=k.createContext(null);function v0e({client:n,children:t}){return h.jsx(g0e.Provider,{value:n,children:t})}function dPe(n){let t=k.useContext(g0e);return n||t}function ff(n){let t=dPe(n);if(!t)throw new Error("Agora RTC client not found. Should be wrapped in <AgoraRTCProvider value={client} />");return t}var y0e=k.createContext(null);function uPe({client:n,children:t}){return h.jsx(y0e.Provider,{value:n,children:t})}function hPe(n){let t=k.useContext(y0e);return n||t}function fPe(n){let t=ff(n),[i,s]=k.useState(t?t.connectionState:"DISCONNECTED");return k.useEffect(()=>{if(t){s(t.connectionState);let l;return FE([El(t,"connection-state-change",d=>{l==null||l(),d==="CONNECTED"?l=Zj(()=>s(d),0):s(d)}),()=>l==null?void 0:l()])}else s("DISCONNECTED")},[t]),i}function Bp(n){let t=ff(n),[i,s]=k.useState(t?t.connectionState==="CONNECTED":!1);return k.useEffect(()=>{if(t){s(t.connectionState==="CONNECTED");let l;return FE([El(t,"connection-state-change",d=>{l==null||l(),l=Zj(()=>s(d==="CONNECTED"),0)}),()=>l==null?void 0:l()])}else s(!1)},[t]),i}function pPe(n){let t=ff(n),[i,s]=k.useState(t==null?void 0:t.uid);return k.useEffect(()=>{if(t)return El(t,"connection-state-change",l=>{if(l==="CONNECTED")return Zj(()=>s(t.uid),0);l==="DISCONNECTED"&&s(void 0)})},[t]),i}var oc=class extends Error{constructor(t,i){var n=(...Vat)=>(super(...Vat),sn(this,"rtcMethod"),sn(this,"rtcError"),sn(this,"name","AgoraRTCReactException"),this);n(typeof i=="string"?i:i.message),this.rtcMethod=t,this.rtcError=i}log(t){console[t](this)}};function _0e(n,t=!0,i){let s=ff(i),l=Bp(i),d=k.useRef(),[u,p]=k.useState(!1),[g,_]=k.useState(0),[y,E]=k.useState(null),b=Bv();return BE(async()=>{if(b.current||(E(null),_(0),p(!1)),t&&s){try{b.current||p(!0);let{appid:N,channel:O,token:D,uid:P}=typeof n=="function"?await n():n,j=await s.join(N,O,D,P);b.current||_(j)}catch(N){console.error(N),b.current||E(new oc("IAgoraRTCClient.join",N))}b.current||p(!1);let A=d.current||(d.current=GJ());return FE([()=>{A.dispose()},()=>{A.run(()=>s.unpublish(s.localTracks))},()=>{for(let N of s.localTracks)N.isPlaying&&N.stop(),N.close();A.run(()=>s.leave())}])}},[t,i]),{data:g,isLoading:u,isConnected:l,error:y}}var cue=()=>({uplinkNetworkQuality:0,downlinkNetworkQuality:0,delay:0});function mPe(n){let t=ff(n),[i,s]=k.useState(cue);return k.useEffect(()=>{if(t)return El(t,"network-quality",l=>s({uplinkNetworkQuality:l.uplinkNetworkQuality,downlinkNetworkQuality:l.downlinkNetworkQuality,delay:t.getRTCStats().RTT??0}));s(cue())},[t]),i}var gPe=jE(UE());function E0e(n,t=!0,i){let s=ff(i),l=Bp(i),d=k.useRef([]),[u,p]=k.useState(!1),[g,_]=k.useState(null),y=Bv();return BE(async()=>{if(y.current||(p(!1),_(null)),!s||!l||!t)return;let E=n.filter(Boolean),b=O=>{let D=oPe(gPe.default.VERSION,"4.18.2")>=0;return D||new oc("usePublish","please check your agora-rtc-sdk-ng version in package.json, it's recommend upgrade to >= 4.18.2").log("warn"),D?s.mode!=="live"||s.role!=="audience":!0},A=O=>d.current.some(D=>D&&D.getTrackId()===O.getTrackId()),N=O=>b()&&O.enabled&&t&&!A(O);for(let O=0;O<E.length;O++){let D=E[O];if(D&&N(D)){await s.unpublish(d.current.filter(P=>(P==null?void 0:P.trackMediaType)===D.trackMediaType));try{y.current||p(!0),await s.publish(D)}catch(P){console.error(P),y.current||_(new oc("IAgoraRTCClient.publish",P))}y.current||p(!1)}}d.current=E},[l,t,s,n]),{isLoading:u,error:g}}function vPe(n){let[t,i]=k.useState(0);return k.useEffect(()=>{if(n)return rPe(()=>{i(n.getVolumeLevel())},1e3)},[n]),t}var yPe=jE(UE());function w0e(n=!0,t={ANS:!0,AEC:!0},i){let s=Bp(i),[l,d]=k.useState(null),[u,p]=k.useState(!1),[g,_]=k.useState(null),y=Bv();return BE(async()=>{if(y.current||(p(!1),_(null)),s&&n&&!l){try{y.current||p(!0);let E=await yPe.default.createMicrophoneAudioTrack(t);y.current||d(E)}catch(E){console.error(E),y.current||_(new oc("IAgoraRTC.createMicrophoneAudioTrack",E))}y.current||p(!1)}!s&&!y.current&&d(null)},[s,n]),{localMicrophoneTrack:l,isLoading:u,error:g}}var _Pe=jE(UE());function S0e(n=!0,t,i){let s=Bp(i),[l,d]=k.useState(null),[u,p]=k.useState(!1),[g,_]=k.useState(null),y=Bv();return BE(async()=>{if(y.current||(p(!1),_(null)),s&&n&&!l){try{y.current||p(!0);let E=await _Pe.default.createCameraVideoTrack(t);y.current||d(E)}catch(E){console.error(E),y.current||_(new oc("IAgoraRTC.createCameraVideoTrack",E))}y.current||p(!1)}!s&&!y.current&&d(null)},[s,n]),{localCameraTrack:l,isLoading:u,error:g}}function EPe(n,t){let i=ff(t),[s,l]=k.useState([]),d=Bp(),u=k.useRef([]),[p,g]=k.useState(!1),[_,y]=k.useState(null),E=Bv();return BE(async()=>{if(E.current||y(null),!Array.isArray(n)||!d)return;let b=async O=>{if(!O.audioTrack&&n.some(({uid:D})=>O.uid===D)){try{E.current||g(!0),await i.subscribe(O,"audio")}catch(D){console.error(D),E.current||y(new oc("IAgoraRTCClient.subscribe",D))}O.audioTrack&&!u.current.some(D=>D.getUserId()===O.uid)&&u.current.push(O.audioTrack),u.current=u.current.map(D=>O.audioTrack&&D.getUserId()===O.uid&&D.getTrackId()!==O.audioTrack.getTrackId()?O.audioTrack:D),E.current||(l([...u.current]),g(!1))}},A=async O=>{if(n.some(({uid:D})=>O.uid===D)){E.current||(u.current=u.current.filter(D=>D.getUserId()!==O.uid),l([...u.current]));try{E.current||g(!0),await i.unsubscribe(O,"audio")}catch(D){console.error(D),E.current||y(new oc("IAgoraRTCClient.unsubscribe",D))}E.current||g(!1)}};n.map(O=>{!O.audioTrack&&O.hasAudio&&b(O)});let N=[];for(let O=0;O<u.current.length;O++){let D=u.current[O];if(!n.some(P=>P.uid===D.getUserId())){let P=i.remoteUsers.find(j=>j.uid===D.getUserId());P&&N.push({user:P,mediaType:"audio"}),u.current.splice(O,1),O--}}if(N.length>0){try{E.current||g(!0),await i.massUnsubscribe(N)}catch(O){console.error(O),E.current||y(new oc("IAgoraRTCClient.massUnsubscribe",O))}E.current||(l(u.current.slice()),g(!1))}return FE([El(i,"user-published",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="audio"&&b(O)}),El(i,"user-unpublished",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="audio"&&A(O)})])},[d,i,n]),{audioTracks:s,isLoading:p,error:_}}function wPe(n,t){let i=ff(t),[s,l]=k.useState([]),d=Bp(),u=k.useRef([]),[p,g]=k.useState(!1),[_,y]=k.useState(null),E=Bv();return BE(async()=>{if(E.current||y(null),!Array.isArray(n)||!d)return;let b=async O=>{if(!O.videoTrack&&n.some(({uid:D})=>O.uid===D)){try{E.current||g(!0),await i.subscribe(O,"video")}catch(D){console.error(D),E.current||y(new oc("IAgoraRTCClient.subscribe",D))}O.videoTrack&&!u.current.some(D=>D.getUserId()===O.uid)&&u.current.push(O.videoTrack),u.current=u.current.map(D=>O.videoTrack&&D.getUserId()===O.uid&&D.getTrackId()!==O.videoTrack.getTrackId()?O.videoTrack:D),E.current||(l([...u.current]),g(!1))}},A=async O=>{if(n.some(({uid:D})=>O.uid===D)){E.current||(u.current=u.current.filter(D=>D.getUserId()!==O.uid),l([...u.current]));try{E.current||g(!0),await i.unsubscribe(O,"video")}catch(D){console.error(D),E.current||y(new oc("IAgoraRTCClient.unsubscribe",D))}E.current||g(!1)}};n.map(O=>{!O.videoTrack&&O.hasVideo&&b(O)});let N=[];for(let O=0;O<u.current.length;O++){let D=u.current[O];if(!n.some(P=>P.uid===D.getUserId())){let P=i.remoteUsers.find(j=>j.uid===D.getUserId());P&&N.push({user:P,mediaType:"video"}),u.current.splice(O,1),O--}}if(N.length>0){try{E.current||g(!0),await i.massUnsubscribe(N)}catch(O){console.error(O),E.current||y(new oc("IAgoraRTCClient.massUnsubscribe",O))}E.current||(l(u.current.slice()),g(!1))}return FE([El(i,"user-published",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="video"&&b(O)}),El(i,"user-unpublished",(O,D)=>{n.find(P=>P.uid===O.uid)&&D==="video"&&A(O)})])},[d,i,n]),{videoTracks:s,isLoading:p,error:_}}function yq(n,t,i){let s=ff(i),l=t==="audio"?"audioTrack":"videoTrack",[d,u]=k.useState(n&&n[l]),p=Bp(),g=k.useRef(),[_,y]=k.useState(!1),[E,b]=k.useState(null);return k.useEffect(()=>{if(!n||!p)return;let A=!1;A||b(null);let N=t==="audio"?"hasAudio":"hasVideo",O=n.uid,D=async(M,V)=>{if(M[l]&&s.remoteUsers.some(({uid:H})=>M.uid===H))try{A||y(!0),await s.unsubscribe(M,V)}catch(H){A||b(new oc("IAgoraRTCClient.unsubscribe",H)),console.error(H)}A||(u(void 0),y(!1))},P=async(M,V)=>{try{!M[l]&&s.remoteUsers.some(({uid:H})=>M.uid===H)&&(A||y(!0),await s.subscribe(M,V)),A||u(M[l])}catch(H){A||b(new oc("IAgoraRTCClient.subscribe",H)),console.error(H)}A||y(!1)},j=g.current||(g.current=GJ());return!n[l]&&n[N]?j.run(()=>P(n,t)):u(n[l]),FE([()=>{A=!0,j.dispose()},El(s,"user-published",(M,V)=>{M.uid===O&&V===t&&j.run(()=>P(M,t))}),El(s,"user-unpublished",(M,V)=>{M.uid===O&&V===t&&j.run(()=>D(M,t))})])},[p,s,n,t,l]),{track:d,isLoading:_,error:E}}function SPe(n){let t=ff(n),[i,s]=k.useState(t?t.remoteUsers:[]);return k.useEffect(()=>{if(t){let l=()=>s(t.remoteUsers.slice());return FE([El(t,"user-joined",l),El(t,"user-left",l),El(t,"user-published",l),El(t,"user-unpublished",l)])}},[t]),i}var bPe=jE(UE());function CPe(n=!0,t,i,s){let l=Bp(s),[d,u]=k.useState(null),[p,g]=k.useState(!1),[_,y]=k.useState(null),E=Bv();return BE(async()=>{if(E.current||(g(!1),y(null)),l&&n&&!d){try{E.current||g(!0);let b=await bPe.default.createScreenVideoTrack(t,i);E.current||u(b)}catch(b){console.error(b),E.current||y(new oc("IAgoraRTC.createScreenVideoTrack",b))}E.current||g(!1)}(!l||!n)&&!E.current&&u(null)},[l,n]),{screenTrack:d,isLoading:p,error:_}}function TPe(){let n=new Map,t=1500;return{onMount:i=>{let s=n.get(i);s&&(s(),n.delete(i))},onUnmount:i=>{let s=n.get(i);s&&s(),n.set(i,Zj(()=>{i.isPlaying&&i.stop(),n.delete(i)},t))},dispose:()=>{for(let[i,s]of n)i.isPlaying&&i.stop(),s&&s();n.clear()}}}var WJ=k.createContext(void 0);function RPe({children:n}){let[t]=k.useState(TPe);return k.useEffect(()=>t.dispose,[t]),h.jsx(WJ.Provider,{value:t,children:n})}function $J(n,t,i,s){let l=k.useContext(WJ);k.useEffect(()=>{if(n)return s&&t?n.play(s,i||void 0):n.stop(),l?(l.onMount(n),()=>l.onUnmount(n)):()=>{n.isPlaying&&n.stop()}},[n,s,t,l,i])}function KJ(n,t){let i=k.useContext(WJ);eU(()=>{if(n)return t?n.play():n.stop(),i?(i.onMount(n),()=>i.onUnmount(n)):()=>{n.isPlaying&&n.stop()}},[n,t,i])}function b0e({track:n,play:t=!1,volume:i,disabled:s,muted:l,children:d}){let u=m0e(n);return KJ(u,t),k.useEffect(()=>{u&&i!=null&&u.setVolume(i)},[u,i]),k.useEffect(()=>{u&&s!=null&&u.setEnabled(!s).catch(console.warn)},[s,u]),k.useEffect(()=>{u&&l!=null&&u.setMuted(l).catch(console.warn)},[l,u]),d?h.jsx(h.Fragment,{children:d}):null}var C0e={position:"relative",width:"100%",height:"100%",overflow:"hidden",background:"#000"},T0e={width:"100%",height:"100%"},qJ={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",zIndex:2},tU=(n,t)=>k.useMemo(()=>({...n,...t}),[n,t]);function R0e({track:n,play:t,disabled:i,muted:s,style:l,videoPlayerConfig:d,...u}){let p=tU(T0e,l),[g,_]=k.useState(null),y=m0e(n);return $J(y,t,d,g),k.useEffect(()=>{y&&i!=null&&y.setEnabled(!i).catch(console.warn)},[i,y]),k.useEffect(()=>{y&&s!=null&&y.setMuted(s).catch(console.warn)},[s,y]),h.jsx("div",{...u,ref:_,style:p})}var xPe={width:"100%",height:"100%",background:"#1a1e21 center/cover no-repeat",filter:"blur(16px) brightness(0.4)"},APe={position:"absolute",top:"50%",left:"50%",maxWidth:"50%",maxHeight:"50%",aspectRatio:"1",transform:"translate(-50%, -50%)",borderRadius:"50%",overflow:"hidden",objectFit:"cover"};function x0e({cover:n}){return h.jsx("div",{style:qJ,children:typeof n=="string"?h.jsxs(h.Fragment,{children:[h.jsx("div",{style:{...xPe,backgroundImage:`url(${n})`}}),h.jsx("img",{src:n,style:APe})]}):n()})}function A0e({micOn:n,cameraOn:t,audioTrack:i,videoTrack:s,playAudio:l,playVideo:d,volume:u,cover:p,children:g,style:_,...y}){let E=tU(C0e,_);return d=d??!!t,l=l??!!n,h.jsxs("div",{...y,style:E,children:[h.jsx(R0e,{disabled:!t,play:d,track:s}),h.jsx(b0e,{disabled:!n,play:l,track:i,volume:u}),p&&!t&&h.jsx(x0e,{cover:p}),h.jsx("div",{style:qJ,children:g})]})}function I0e({track:n,play:t=!1,playbackDeviceId:i,volume:s,children:l}){return KJ(n,t),k.useEffect(()=>{n&&i!=null&&n.setPlaybackDevice(i).catch(console.warn)},[n,i]),k.useEffect(()=>{n&&s!=null&&n.setVolume(s)},[n,s]),l?h.jsx(h.Fragment,{children:l}):null}function N0e({track:n,play:t,style:i,videoPlayerConfig:s,...l}){let d=tU(T0e,i),[u,p]=k.useState(null);return $J(n,t,s,u),h.jsx("div",{...l,ref:p,style:d})}function IPe({user:n,playVideo:t,playAudio:i,playbackDeviceId:s,volume:l,cover:d,style:u,children:p,videoPlayerConfig:g,..._}){let y=tU(C0e,u),{track:E}=yq(n,"video"),{track:b}=yq(n,"audio");return t=t??(n==null?void 0:n.hasVideo),i=i??(n==null?void 0:n.hasAudio),h.jsxs("div",{..._,style:y,children:[h.jsx(N0e,{play:t,track:E,videoPlayerConfig:g}),h.jsx(I0e,{play:i,playbackDeviceId:s,track:b,volume:l}),d&&!t&&h.jsx(x0e,{cover:d}),h.jsx("div",{style:qJ,children:p})]})}var NPe=jE(UE()),OPe=class{constructor(){sn(this,"appType",1001);NPe.default.setAppType(this.appType)}};new OPe;var PPe="2.2.0";tPe(p0e,jE(UE()));var O0e=nPe.default;/**
* @remix-run/router v1.15.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function j4(){return j4=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},j4.apply(this,arguments)}var fv;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(fv||(fv={}));const due="popstate";function LPe(n){n===void 0&&(n={});function t(s,l){let{pathname:d,search:u,hash:p}=s.location;return _q("",{pathname:d,search:u,hash:p},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function i(s,l){return typeof l=="string"?l:l7(l)}return kPe(t,i,null,n)}function pa(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function YJ(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function DPe(){return Math.random().toString(36).substr(2,8)}function uue(n,t){return{usr:n.state,key:n.key,idx:t}}function _q(n,t,i,s){return i===void 0&&(i=null),j4({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof t=="string"?GR(t):t,{state:i,key:t&&t.key||s||DPe()})}function l7(n){let{pathname:t="/",search:i="",hash:s=""}=n;return i&&i!=="?"&&(t+=i.charAt(0)==="?"?i:"?"+i),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function GR(n){let t={};if(n){let i=n.indexOf("#");i>=0&&(t.hash=n.substr(i),n=n.substr(0,i));let s=n.indexOf("?");s>=0&&(t.search=n.substr(s),n=n.substr(0,s)),n&&(t.pathname=n)}return t}function kPe(n,t,i,s){s===void 0&&(s={});let{window:l=document.defaultView,v5Compat:d=!1}=s,u=l.history,p=fv.Pop,g=null,_=y();_==null&&(_=0,u.replaceState(j4({},u.state,{idx:_}),""));function y(){return(u.state||{idx:null}).idx}function E(){p=fv.Pop;let D=y(),P=D==null?null:D-_;_=D,g&&g({action:p,location:O.location,delta:P})}function b(D,P){p=fv.Push;let j=_q(O.location,D,P);i&&i(j,D),_=y()+1;let M=uue(j,_),V=O.createHref(j);try{u.pushState(M,"",V)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;l.location.assign(V)}d&&g&&g({action:p,location:O.location,delta:1})}function A(D,P){p=fv.Replace;let j=_q(O.location,D,P);i&&i(j,D),_=y();let M=uue(j,_),V=O.createHref(j);u.replaceState(M,"",V),d&&g&&g({action:p,location:O.location,delta:0})}function N(D){let P=l.location.origin!=="null"?l.location.origin:l.location.href,j=typeof D=="string"?D:l7(D);return pa(P,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,P)}let O={get action(){return p},get location(){return n(l,u)},listen(D){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(due,E),g=D,()=>{l.removeEventListener(due,E),g=null}},createHref(D){return t(l,D)},createURL:N,encodeLocation(D){let P=N(D);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:b,replace:A,go(D){return u.go(D)}};return O}var hue;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(hue||(hue={}));function MPe(n,t,i){i===void 0&&(i="/");let s=typeof t=="string"?GR(t):t,l=XJ(s.pathname||"/",i);if(l==null)return null;let d=P0e(n);jPe(d);let u=null;for(let p=0;u==null&&p<d.length;++p)u=$Pe(d[p],YPe(l));return u}function P0e(n,t,i,s){t===void 0&&(t=[]),i===void 0&&(i=[]),s===void 0&&(s="");let l=(d,u,p)=>{let g={relativePath:p===void 0?d.path||"":p,caseSensitive:d.caseSensitive===!0,childrenIndex:u,route:d};g.relativePath.startsWith("/")&&(pa(g.relativePath.startsWith(s),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(s.length));let _=Rv([s,g.relativePath]),y=i.concat(g);d.children&&d.children.length>0&&(pa(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+_+'".')),P0e(d.children,t,y,_)),!(d.path==null&&!d.index)&&t.push({path:_,score:GPe(_,d.index),routesMeta:y})};return n.forEach((d,u)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))l(d,u);else for(let g of L0e(d.path))l(d,u,g)}),t}function L0e(n){let t=n.split("/");if(t.length===0)return[];let[i,...s]=t,l=i.endsWith("?"),d=i.replace(/\?$/,"");if(s.length===0)return l?[d,""]:[d];let u=L0e(s.join("/")),p=[];return p.push(...u.map(g=>g===""?d:[d,g].join("/"))),l&&p.push(...u),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function jPe(n){n.sort((t,i)=>t.score!==i.score?i.score-t.score:WPe(t.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}const UPe=/^:[\w-]+$/,FPe=3,BPe=2,VPe=1,zPe=10,HPe=-2,fue=n=>n==="*";function GPe(n,t){let i=n.split("/"),s=i.length;return i.some(fue)&&(s+=HPe),t&&(s+=BPe),i.filter(l=>!fue(l)).reduce((l,d)=>l+(UPe.test(d)?FPe:d===""?VPe:zPe),s)}function WPe(n,t){return n.length===t.length&&n.slice(0,-1).every((s,l)=>s===t[l])?n[n.length-1]-t[t.length-1]:0}function $Pe(n,t){let{routesMeta:i}=n,s={},l="/",d=[];for(let u=0;u<i.length;++u){let p=i[u],g=u===i.length-1,_=l==="/"?t:t.slice(l.length)||"/",y=KPe({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},_);if(!y)return null;Object.assign(s,y.params);let E=p.route;d.push({params:s,pathname:Rv([l,y.pathname]),pathnameBase:e6e(Rv([l,y.pathnameBase])),route:E}),y.pathnameBase!=="/"&&(l=Rv([l,y.pathnameBase]))}return d}function KPe(n,t){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,s]=qPe(n.path,n.caseSensitive,n.end),l=t.match(i);if(!l)return null;let d=l[0],u=d.replace(/(.)\/+$/,"$1"),p=l.slice(1);return{params:s.reduce((_,y,E)=>{let{paramName:b,isOptional:A}=y;if(b==="*"){let O=p[E]||"";u=d.slice(0,d.length-O.length).replace(/(.)\/+$/,"$1")}const N=p[E];return A&&!N?_[b]=void 0:_[b]=XPe(N||"",b),_},{}),pathname:d,pathnameBase:u,pattern:n}}function qPe(n,t,i){t===void 0&&(t=!1),i===void 0&&(i=!0),YJ(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let s=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,p,g)=>(s.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(s.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),s]}function YPe(n){try{return decodeURI(n)}catch(t){return YJ(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),n}}function XPe(n,t){try{return decodeURIComponent(n)}catch(i){return YJ(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+i+").")),n}}function XJ(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let i=t.endsWith("/")?t.length-1:t.length,s=n.charAt(i);return s&&s!=="/"?null:n.slice(i)||"/"}function JPe(n,t){t===void 0&&(t="/");let{pathname:i,search:s="",hash:l=""}=typeof n=="string"?GR(n):n;return{pathname:i?i.startsWith("/")?i:QPe(i,t):t,search:t6e(s),hash:n6e(l)}}function QPe(n,t){let i=t.replace(/\/+$/,"").split("/");return n.split("/").forEach(l=>{l===".."?i.length>1&&i.pop():l!=="."&&i.push(l)}),i.length>1?i.join("/"):"/"}function T$(n,t,i,s){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ZPe(n){return n.filter((t,i)=>i===0||t.route.path&&t.route.path.length>0)}function JJ(n,t){let i=ZPe(n);return t?i.map((s,l)=>l===n.length-1?s.pathname:s.pathnameBase):i.map(s=>s.pathnameBase)}function QJ(n,t,i,s){s===void 0&&(s=!1);let l;typeof n=="string"?l=GR(n):(l=j4({},n),pa(!l.pathname||!l.pathname.includes("?"),T$("?","pathname","search",l)),pa(!l.pathname||!l.pathname.includes("#"),T$("#","pathname","hash",l)),pa(!l.search||!l.search.includes("#"),T$("#","search","hash",l)));let d=n===""||l.pathname==="",u=d?"/":l.pathname,p;if(u==null)p=i;else{let E=t.length-1;if(!s&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),E-=1;l.pathname=b.join("/")}p=E>=0?t[E]:"/"}let g=JPe(l,p),_=u&&u!=="/"&&u.endsWith("/"),y=(d||u===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(_||y)&&(g.pathname+="/"),g}const Rv=n=>n.join("/").replace(/\/\/+/g,"/"),e6e=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),t6e=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,n6e=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function i6e(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const D0e=["post","put","patch","delete"];new Set(D0e);const r6e=["get",...D0e];new Set(r6e);/**
* React Router v6.22.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function U4(){return U4=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},U4.apply(this,arguments)}const ZJ=k.createContext(null),s6e=k.createContext(null),Vv=k.createContext(null),nU=k.createContext(null),Vp=k.createContext({outlet:null,matches:[],isDataRoute:!1}),k0e=k.createContext(null);function a6e(n,t){let{relative:i}=t===void 0?{}:t;WR()||pa(!1);let{basename:s,navigator:l}=k.useContext(Vv),{hash:d,pathname:u,search:p}=j0e(n,{relative:i}),g=u;return s!=="/"&&(g=u==="/"?s:Rv([s,u])),l.createHref({pathname:g,search:p,hash:d})}function WR(){return k.useContext(nU)!=null}function Xo(){return WR()||pa(!1),k.useContext(nU).location}function M0e(n){k.useContext(Vv).static||k.useLayoutEffect(n)}function Ii(){let{isDataRoute:n}=k.useContext(Vp);return n?w6e():o6e()}function o6e(){WR()||pa(!1);let n=k.useContext(ZJ),{basename:t,future:i,navigator:s}=k.useContext(Vv),{matches:l}=k.useContext(Vp),{pathname:d}=Xo(),u=JSON.stringify(JJ(l,i.v7_relativeSplatPath)),p=k.useRef(!1);return M0e(()=>{p.current=!0}),k.useCallback(function(_,y){if(y===void 0&&(y={}),!p.current)return;if(typeof _=="number"){s.go(_);return}let E=QJ(_,JSON.parse(u),d,y.relative==="path");n==null&&t!=="/"&&(E.pathname=E.pathname==="/"?t:Rv([t,E.pathname])),(y.replace?s.replace:s.push)(E,y.state,y)},[t,s,u,d,n])}const l6e=k.createContext(null);function c6e(n){let t=k.useContext(Vp).outlet;return t&&k.createElement(l6e.Provider,{value:n},t)}function iU(){let{matches:n}=k.useContext(Vp),t=n[n.length-1];return t?t.params:{}}function j0e(n,t){let{relative:i}=t===void 0?{}:t,{future:s}=k.useContext(Vv),{matches:l}=k.useContext(Vp),{pathname:d}=Xo(),u=JSON.stringify(JJ(l,s.v7_relativeSplatPath));return k.useMemo(()=>QJ(n,JSON.parse(u),d,i==="path"),[n,u,d,i])}function d6e(n,t){return u6e(n,t)}function u6e(n,t,i,s){WR()||pa(!1);let{navigator:l}=k.useContext(Vv),{matches:d}=k.useContext(Vp),u=d[d.length-1],p=u?u.params:{};u&&u.pathname;let g=u?u.pathnameBase:"/";u&&u.route;let _=Xo(),y;if(t){var E;let D=typeof t=="string"?GR(t):t;g==="/"||(E=D.pathname)!=null&&E.startsWith(g)||pa(!1),y=D}else y=_;let b=y.pathname||"/",A=g==="/"?b:b.slice(g.length)||"/",N=MPe(n,{pathname:A}),O=g6e(N&&N.map(D=>Object.assign({},D,{params:Object.assign({},p,D.params),pathname:Rv([g,l.encodeLocation?l.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?g:Rv([g,l.encodeLocation?l.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),d,i,s);return t&&O?k.createElement(nU.Provider,{value:{location:U4({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:fv.Pop}},O):O}function h6e(){let n=E6e(),t=i6e(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),i?k.createElement("pre",{style:l},i):null,null)}const f6e=k.createElement(h6e,null);class p6e extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,i){return i.location!==t.location||i.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:i.error,location:i.location,revalidation:t.revalidation||i.revalidation}}componentDidCatch(t,i){console.error("React Router caught the following error during render",t,i)}render(){return this.state.error!==void 0?k.createElement(Vp.Provider,{value:this.props.routeContext},k.createElement(k0e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function m6e(n){let{routeContext:t,match:i,children:s}=n,l=k.useContext(ZJ);return l&&l.static&&l.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=i.route.id),k.createElement(Vp.Provider,{value:t},s)}function g6e(n,t,i,s){var l;if(t===void 0&&(t=[]),i===void 0&&(i=null),s===void 0&&(s=null),n==null){var d;if((d=i)!=null&&d.errors)n=i.matches;else return null}let u=n,p=(l=i)==null?void 0:l.errors;if(p!=null){let y=u.findIndex(E=>E.route.id&&(p==null?void 0:p[E.route.id]));y>=0||pa(!1),u=u.slice(0,Math.min(u.length,y+1))}let g=!1,_=-1;if(i&&s&&s.v7_partialHydration)for(let y=0;y<u.length;y++){let E=u[y];if((E.route.HydrateFallback||E.route.hydrateFallbackElement)&&(_=y),E.route.id){let{loaderData:b,errors:A}=i,N=E.route.loader&&b[E.route.id]===void 0&&(!A||A[E.route.id]===void 0);if(E.route.lazy||N){g=!0,_>=0?u=u.slice(0,_+1):u=[u[0]];break}}}return u.reduceRight((y,E,b)=>{let A,N=!1,O=null,D=null;i&&(A=p&&E.route.id?p[E.route.id]:void 0,O=E.route.errorElement||f6e,g&&(_<0&&b===0?(S6e("route-fallback",!1),N=!0,D=null):_===b&&(N=!0,D=E.route.hydrateFallbackElement||null)));let P=t.concat(u.slice(0,b+1)),j=()=>{let M;return A?M=O:N?M=D:E.route.Component?M=k.createElement(E.route.Component,null):E.route.element?M=E.route.element:M=y,k.createElement(m6e,{match:E,routeContext:{outlet:y,matches:P,isDataRoute:i!=null},children:M})};return i&&(E.route.ErrorBoundary||E.route.errorElement||b===0)?k.createElement(p6e,{location:i.location,revalidation:i.revalidation,component:O,error:A,children:j(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):j()},null)}var U0e=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(U0e||{}),c7=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(c7||{});function v6e(n){let t=k.useContext(ZJ);return t||pa(!1),t}function y6e(n){let t=k.useContext(s6e);return t||pa(!1),t}function _6e(n){let t=k.useContext(Vp);return t||pa(!1),t}function F0e(n){let t=_6e(),i=t.matches[t.matches.length-1];return i.route.id||pa(!1),i.route.id}function E6e(){var n;let t=k.useContext(k0e),i=y6e(c7.UseRouteError),s=F0e(c7.UseRouteError);return t!==void 0?t:(n=i.errors)==null?void 0:n[s]}function w6e(){let{router:n}=v6e(U0e.UseNavigateStable),t=F0e(c7.UseNavigateStable),i=k.useRef(!1);return M0e(()=>{i.current=!0}),k.useCallback(function(l,d){d===void 0&&(d={}),i.current&&(typeof l=="number"?n.navigate(l):n.navigate(l,U4({fromRouteId:t},d)))},[n,t])}const pue={};function S6e(n,t,i){!t&&!pue[n]&&(pue[n]=!0)}function B0e(n){let{to:t,replace:i,state:s,relative:l}=n;WR()||pa(!1);let{future:d,static:u}=k.useContext(Vv),{matches:p}=k.useContext(Vp),{pathname:g}=Xo(),_=Ii(),y=QJ(t,JJ(p,d.v7_relativeSplatPath),g,l==="path"),E=JSON.stringify(y);return k.useEffect(()=>_(JSON.parse(E),{replace:i,state:s,relative:l}),[_,E,l,i,s]),null}function b6e(n){return c6e(n.context)}function mi(n){pa(!1)}function C6e(n){let{basename:t="/",children:i=null,location:s,navigationType:l=fv.Pop,navigator:d,static:u=!1,future:p}=n;WR()&&pa(!1);let g=t.replace(/^\/*/,"/"),_=k.useMemo(()=>({basename:g,navigator:d,static:u,future:U4({v7_relativeSplatPath:!1},p)}),[g,p,d,u]);typeof s=="string"&&(s=GR(s));let{pathname:y="/",search:E="",hash:b="",state:A=null,key:N="default"}=s,O=k.useMemo(()=>{let D=XJ(y,g);return D==null?null:{location:{pathname:D,search:E,hash:b,state:A,key:N},navigationType:l}},[g,y,E,b,A,N,l]);return O==null?null:k.createElement(Vv.Provider,{value:_},k.createElement(nU.Provider,{children:i,value:O}))}function T6e(n){let{children:t,location:i}=n;return d6e(Eq(t),i)}new Promise(()=>{});function Eq(n,t){t===void 0&&(t=[]);let i=[];return k.Children.forEach(n,(s,l)=>{if(!k.isValidElement(s))return;let d=[...t,l];if(s.type===k.Fragment){i.push.apply(i,Eq(s.props.children,d));return}s.type!==mi&&pa(!1),!s.props.index||!s.props.children||pa(!1);let u={id:s.props.id||d.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Eq(s.props.children,d)),i.push(u)}),i}/**
* React Router DOM v6.22.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function wq(){return wq=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},wq.apply(this,arguments)}function R6e(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}function x6e(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function A6e(n,t){return n.button===0&&(!t||t==="_self")&&!x6e(n)}const I6e=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],N6e="6";try{window.__reactRouterVersion=N6e}catch{}const O6e="startTransition",mue=RNe[O6e];function P6e(n){let{basename:t,children:i,future:s,window:l}=n,d=k.useRef();d.current==null&&(d.current=LPe({window:l,v5Compat:!0}));let u=d.current,[p,g]=k.useState({action:u.action,location:u.location}),{v7_startTransition:_}=s||{},y=k.useCallback(E=>{_&&mue?mue(()=>g(E)):g(E)},[g,_]);return k.useLayoutEffect(()=>u.listen(y),[u,y]),k.createElement(C6e,{basename:t,children:i,location:p.location,navigationType:p.action,navigator:u,future:s})}const L6e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",D6e=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yu=k.forwardRef(function(t,i){let{onClick:s,relative:l,reloadDocument:d,replace:u,state:p,target:g,to:_,preventScrollReset:y,unstable_viewTransition:E}=t,b=R6e(t,I6e),{basename:A}=k.useContext(Vv),N,O=!1;if(typeof _=="string"&&D6e.test(_)&&(N=_,L6e))try{let M=new URL(window.location.href),V=_.startsWith("//")?new URL(M.protocol+_):new URL(_),H=XJ(V.pathname,A);V.origin===M.origin&&H!=null?_=H+V.search+V.hash:O=!0}catch{}let D=a6e(_,{relative:l}),P=k6e(_,{replace:u,state:p,target:g,preventScrollReset:y,relative:l,unstable_viewTransition:E});function j(M){s&&s(M),M.defaultPrevented||P(M)}return k.createElement("a",wq({},b,{href:N||D,onClick:O||d?s:j,ref:i,target:g}))});var gue;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(gue||(gue={}));var vue;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(vue||(vue={}));function k6e(n,t){let{target:i,replace:s,state:l,preventScrollReset:d,relative:u,unstable_viewTransition:p}=t===void 0?{}:t,g=Ii(),_=Xo(),y=j0e(n,{relative:u});return k.useCallback(E=>{if(A6e(E,i)){E.preventDefault();let b=s!==void 0?s:l7(_)===l7(y);g(n,{replace:b,state:l,preventScrollReset:d,relative:u,unstable_viewTransition:p})}},[_,g,y,s,l,i,n,d,u,p])}function V0e(n){var t,i,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(t=0;t<l;t++)n[t]&&(i=V0e(n[t]))&&(s&&(s+=" "),s+=i)}else for(i in n)n[i]&&(s&&(s+=" "),s+=i);return s}function pv(){for(var n,t,i=0,s="",l=arguments.length;i<l;i++)(n=arguments[i])&&(t=V0e(n))&&(s&&(s+=" "),s+=t);return s}const F4=n=>typeof n=="number"&&!isNaN(n),fE=n=>typeof n=="string",Wd=n=>typeof n=="function",Yk=n=>fE(n)||Wd(n)?n:null,Sq=n=>k.isValidElement(n)||fE(n)||Wd(n)||F4(n);function M6e(n,t,i){i===void 0&&(i=300);const{scrollHeight:s,style:l}=n;requestAnimationFrame(()=>{l.minHeight="initial",l.height=s+"px",l.transition=`all ${i}ms`,requestAnimationFrame(()=>{l.height="0",l.padding="0",l.margin="0",setTimeout(t,i)})})}function rU(n){let{enter:t,exit:i,appendPosition:s=!1,collapse:l=!0,collapseDuration:d=300}=n;return function(u){let{children:p,position:g,preventExitTransition:_,done:y,nodeRef:E,isIn:b,playToast:A}=u;const N=s?`${t}--${g}`:t,O=s?`${i}--${g}`:i,D=k.useRef(0);return k.useLayoutEffect(()=>{const P=E.current,j=N.split(" "),M=V=>{V.target===E.current&&(A(),P.removeEventListener("animationend",M),P.removeEventListener("animationcancel",M),D.current===0&&V.type!=="animationcancel"&&P.classList.remove(...j))};P.classList.add(...j),P.addEventListener("animationend",M),P.addEventListener("animationcancel",M)},[]),k.useEffect(()=>{const P=E.current,j=()=>{P.removeEventListener("animationend",j),l?M6e(P,y,d):y()};b||(_?j():(D.current=1,P.className+=` ${O}`,P.addEventListener("animationend",j)))},[b]),dn.createElement(dn.Fragment,null,p)}}function yue(n,t){return n!=null?{content:n.content,containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,status:t}:{}}const sc=new Map;let B4=[];const bq=new Set,j6e=n=>bq.forEach(t=>t(n)),z0e=()=>sc.size>0;function H0e(n,t){var i;if(t)return!((i=sc.get(t))==null||!i.isToastActive(n));let s=!1;return sc.forEach(l=>{l.isToastActive(n)&&(s=!0)}),s}function G0e(n,t){Sq(n)&&(z0e()||B4.push({content:n,options:t}),sc.forEach(i=>{i.buildToast(n,t)}))}function _ue(n,t){sc.forEach(i=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===i.id&&i.toggle(n,t==null?void 0:t.id):i.toggle(n,t==null?void 0:t.id)})}function U6e(n){const{subscribe:t,getSnapshot:i,setProps:s}=k.useRef(function(d){const u=d.containerId||1;return{subscribe(p){const g=function(y,E,b){let A=1,N=0,O=[],D=[],P=[],j=E;const M=new Map,V=new Set,H=()=>{P=Array.from(M.values()),V.forEach(Y=>Y())},$=Y=>{D=Y==null?[]:D.filter(le=>le!==Y),H()},Q=Y=>{const{toastId:le,onOpen:ae,updateId:te,children:de}=Y.props,G=te==null;Y.staleId&&M.delete(Y.staleId),M.set(le,Y),D=[...D,Y.props.toastId].filter(ie=>ie!==Y.staleId),H(),b(yue(Y,G?"added":"updated")),G&&Wd(ae)&&ae(k.isValidElement(de)&&de.props)};return{id:y,props:j,observe:Y=>(V.add(Y),()=>V.delete(Y)),toggle:(Y,le)=>{M.forEach(ae=>{le!=null&&le!==ae.props.toastId||Wd(ae.toggle)&&ae.toggle(Y)})},removeToast:$,toasts:M,clearQueue:()=>{N-=O.length,O=[]},buildToast:(Y,le)=>{if((je=>{let{containerId:Ve,toastId:Re,updateId:Be}=je;const Xe=Ve?Ve!==y:y!==1,we=M.has(Re)&&Be==null;return Xe||we})(le))return;const{toastId:ae,updateId:te,data:de,staleId:G,delay:ie}=le,_e=()=>{$(ae)},he=te==null;he&&N++;const Ce={...j,style:j.toastStyle,key:A++,...Object.fromEntries(Object.entries(le).filter(je=>{let[Ve,Re]=je;return Re!=null})),toastId:ae,updateId:te,data:de,closeToast:_e,isIn:!1,className:Yk(le.className||j.toastClassName),bodyClassName:Yk(le.bodyClassName||j.bodyClassName),progressClassName:Yk(le.progressClassName||j.progressClassName),autoClose:!le.isLoading&&(fe=le.autoClose,me=j.autoClose,fe===!1||F4(fe)&&fe>0?fe:me),deleteToast(){const je=M.get(ae),{onClose:Ve,children:Re}=je.props;Wd(Ve)&&Ve(k.isValidElement(Re)&&Re.props),b(yue(je,"removed")),M.delete(ae),N--,N<0&&(N=0),O.length>0?Q(O.shift()):H()}};var fe,me;Ce.closeButton=j.closeButton,le.closeButton===!1||Sq(le.closeButton)?Ce.closeButton=le.closeButton:le.closeButton===!0&&(Ce.closeButton=!Sq(j.closeButton)||j.closeButton);let Ne=Y;k.isValidElement(Y)&&!fE(Y.type)?Ne=k.cloneElement(Y,{closeToast:_e,toastProps:Ce,data:de}):Wd(Y)&&(Ne=Y({closeToast:_e,toastProps:Ce,data:de}));const Fe={content:Ne,props:Ce,staleId:G};j.limit&&j.limit>0&&N>j.limit&&he?O.push(Fe):F4(ie)?setTimeout(()=>{Q(Fe)},ie):Q(Fe)},setProps(Y){j=Y},setToggle:(Y,le)=>{M.get(Y).toggle=le},isToastActive:Y=>D.some(le=>le===Y),getSnapshot:()=>j.newestOnTop?P.reverse():P}}(u,d,j6e);sc.set(u,g);const _=g.observe(p);return B4.forEach(y=>G0e(y.content,y.options)),B4=[],()=>{_(),sc.delete(u)}},setProps(p){var g;(g=sc.get(u))==null||g.setProps(p)},getSnapshot(){var p;return(p=sc.get(u))==null?void 0:p.getSnapshot()}}}(n)).current;s(n);const l=k.useSyncExternalStore(t,i,i);return{getToastToRender:function(d){if(!l)return[];const u=new Map;return l.forEach(p=>{const{position:g}=p.props;u.has(g)||u.set(g,[]),u.get(g).push(p)}),Array.from(u,p=>d(p[0],p[1]))},isToastActive:H0e,count:l==null?void 0:l.length}}function F6e(n){const[t,i]=k.useState(!1),[s,l]=k.useState(!1),d=k.useRef(null),u=k.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:p,pauseOnHover:g,closeToast:_,onClick:y,closeOnClick:E}=n;var b,A;function N(){i(!0)}function O(){i(!1)}function D(M){const V=d.current;u.canDrag&&V&&(u.didMove=!0,t&&O(),u.delta=n.draggableDirection==="x"?M.clientX-u.start:M.clientY-u.start,u.start!==M.clientX&&(u.canCloseOnClick=!1),V.style.transform=`translate3d(${n.draggableDirection==="x"?`${u.delta}px, var(--y)`:`0, calc(${u.delta}px + var(--y))`},0)`,V.style.opacity=""+(1-Math.abs(u.delta/u.removalDistance)))}function P(){document.removeEventListener("pointermove",D),document.removeEventListener("pointerup",P);const M=d.current;if(u.canDrag&&u.didMove&&M){if(u.canDrag=!1,Math.abs(u.delta)>u.removalDistance)return l(!0),n.closeToast(),void n.collapseAll();M.style.transition="transform 0.2s, opacity 0.2s",M.style.removeProperty("transform"),M.style.removeProperty("opacity")}}(A=sc.get((b={id:n.toastId,containerId:n.containerId,fn:i}).containerId||1))==null||A.setToggle(b.id,b.fn),k.useEffect(()=>{if(n.pauseOnFocusLoss)return document.hasFocus()||O(),window.addEventListener("focus",N),window.addEventListener("blur",O),()=>{window.removeEventListener("focus",N),window.removeEventListener("blur",O)}},[n.pauseOnFocusLoss]);const j={onPointerDown:function(M){if(n.draggable===!0||n.draggable===M.pointerType){u.didMove=!1,document.addEventListener("pointermove",D),document.addEventListener("pointerup",P);const V=d.current;u.canCloseOnClick=!0,u.canDrag=!0,V.style.transition="none",n.draggableDirection==="x"?(u.start=M.clientX,u.removalDistance=V.offsetWidth*(n.draggablePercent/100)):(u.start=M.clientY,u.removalDistance=V.offsetHeight*(n.draggablePercent===80?1.5*n.draggablePercent:n.draggablePercent)/100)}},onPointerUp:function(M){const{top:V,bottom:H,left:$,right:Q}=d.current.getBoundingClientRect();M.nativeEvent.type!=="touchend"&&n.pauseOnHover&&M.clientX>=$&&M.clientX<=Q&&M.clientY>=V&&M.clientY<=H?O():N()}};return p&&g&&(j.onMouseEnter=O,n.stacked||(j.onMouseLeave=N)),E&&(j.onClick=M=>{y&&y(M),u.canCloseOnClick&&_()}),{playToast:N,pauseToast:O,isRunning:t,preventExitTransition:s,toastRef:d,eventHandlers:j}}function B6e(n){let{delay:t,isRunning:i,closeToast:s,type:l="default",hide:d,className:u,style:p,controlledProgress:g,progress:_,rtl:y,isIn:E,theme:b}=n;const A=d||g&&_===0,N={...p,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused"};g&&(N.transform=`scaleX(${_})`);const O=pv("Toastify__progress-bar",g?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${b}`,`Toastify__progress-bar--${l}`,{"Toastify__progress-bar--rtl":y}),D=Wd(u)?u({rtl:y,type:l,defaultClassName:O}):pv(O,u),P={[g&&_>=1?"onTransitionEnd":"onAnimationEnd"]:g&&_<1?null:()=>{E&&s()}};return dn.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":A},dn.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${b} Toastify__progress-bar--${l}`}),dn.createElement("div",{role:"progressbar","aria-hidden":A?"true":"false","aria-label":"notification timer",className:D,style:N,...P}))}let V6e=1;const W0e=()=>""+V6e++;function z6e(n){return n&&(fE(n.toastId)||F4(n.toastId))?n.toastId:W0e()}function f4(n,t){return G0e(n,t),t.toastId}function d7(n,t){return{...t,type:t&&t.type||n,toastId:z6e(t)}}function vk(n){return(t,i)=>f4(t,d7(n,i))}function Qr(n,t){return f4(n,d7("default",t))}Qr.loading=(n,t)=>f4(n,d7("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Qr.promise=function(n,t,i){let s,{pending:l,error:d,success:u}=t;l&&(s=fE(l)?Qr.loading(l,i):Qr.loading(l.render,{...i,...l}));const p={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},g=(y,E,b)=>{if(E==null)return void Qr.dismiss(s);const A={type:y,...p,...i,data:b},N=fE(E)?{render:E}:E;return s?Qr.update(s,{...A,...N}):Qr(N.render,{...A,...N}),b},_=Wd(n)?n():n;return _.then(y=>g("success",u,y)).catch(y=>g("error",d,y)),_},Qr.success=vk("success"),Qr.info=vk("info"),Qr.error=vk("error"),Qr.warning=vk("warning"),Qr.warn=Qr.warning,Qr.dark=(n,t)=>f4(n,d7("default",{theme:"dark",...t})),Qr.dismiss=function(n){(function(t){var i;if(z0e()){if(t==null||fE(i=t)||F4(i))sc.forEach(l=>{l.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){var s;(s=sc.get(t.containerId))!=null&&s.removeToast(t.id)||sc.forEach(l=>{l.removeToast(t.id)})}}else B4=B4.filter(l=>t!=null&&l.options.toastId!==t)})(n)},Qr.clearWaitingQueue=function(n){n===void 0&&(n={}),sc.forEach(t=>{!t.props.limit||n.containerId&&t.id!==n.containerId||t.clearQueue()})},Qr.isActive=H0e,Qr.update=function(n,t){t===void 0&&(t={});const i=((s,l)=>{var d;let{containerId:u}=l;return(d=sc.get(u||1))==null?void 0:d.toasts.get(s)})(n,t);if(i){const{props:s,content:l}=i,d={delay:100,...s,...t,toastId:t.toastId||n,updateId:W0e()};d.toastId!==n&&(d.staleId=n);const u=d.render||l;delete d.render,f4(u,d)}},Qr.done=n=>{Qr.update(n,{progress:1})},Qr.onChange=function(n){return bq.add(n),()=>{bq.delete(n)}},Qr.play=n=>_ue(!0,n),Qr.pause=n=>_ue(!1,n);const H6e=typeof window<"u"?k.useLayoutEffect:k.useEffect,yk=n=>{let{theme:t,type:i,isLoading:s,...l}=n;return dn.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${i})`,...l})},R$={info:function(n){return dn.createElement(yk,{...n},dn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(n){return dn.createElement(yk,{...n},dn.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(n){return dn.createElement(yk,{...n},dn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(n){return dn.createElement(yk,{...n},dn.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return dn.createElement("div",{className:"Toastify__spinner"})}},G6e=n=>{const{isRunning:t,preventExitTransition:i,toastRef:s,eventHandlers:l,playToast:d}=F6e(n),{closeButton:u,children:p,autoClose:g,onClick:_,type:y,hideProgressBar:E,closeToast:b,transition:A,position:N,className:O,style:D,bodyClassName:P,bodyStyle:j,progressClassName:M,progressStyle:V,updateId:H,role:$,progress:Q,rtl:Y,toastId:le,deleteToast:ae,isIn:te,isLoading:de,closeOnClick:G,theme:ie}=n,_e=pv("Toastify__toast",`Toastify__toast-theme--${ie}`,`Toastify__toast--${y}`,{"Toastify__toast--rtl":Y},{"Toastify__toast--close-on-click":G}),he=Wd(O)?O({rtl:Y,position:N,type:y,defaultClassName:_e}):pv(_e,O),Ce=function(Fe){let{theme:je,type:Ve,isLoading:Re,icon:Be}=Fe,Xe=null;const we={theme:je,type:Ve};return Be===!1||(Wd(Be)?Xe=Be({...we,isLoading:Re}):k.isValidElement(Be)?Xe=k.cloneElement(Be,we):Re?Xe=R$.spinner():(Ge=>Ge in R$)(Ve)&&(Xe=R$[Ve](we))),Xe}(n),fe=!!Q||!g,me={closeToast:b,type:y,theme:ie};let Ne=null;return u===!1||(Ne=Wd(u)?u(me):k.isValidElement(u)?k.cloneElement(u,me):function(Fe){let{closeToast:je,theme:Ve,ariaLabel:Re="close"}=Fe;return dn.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Ve}`,type:"button",onClick:Be=>{Be.stopPropagation(),je(Be)},"aria-label":Re},dn.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},dn.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(me)),dn.createElement(A,{isIn:te,done:ae,position:N,preventExitTransition:i,nodeRef:s,playToast:d},dn.createElement("div",{id:le,onClick:_,"data-in":te,className:he,...l,style:D,ref:s},dn.createElement("div",{...te&&{role:$},className:Wd(P)?P({type:y}):pv("Toastify__toast-body",P),style:j},Ce!=null&&dn.createElement("div",{className:pv("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!de})},Ce),dn.createElement("div",null,p)),Ne,dn.createElement(B6e,{...H&&!fe?{key:`pb-${H}`}:{},rtl:Y,theme:ie,delay:g,isRunning:t,isIn:te,closeToast:b,hide:E,type:y,style:V,className:M,controlledProgress:fe,progress:Q||0})))},sU=function(n,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:t}},W6e=rU(sU("bounce",!0)),$6e=rU(sU("slide",!0));rU(sU("zoom"));rU(sU("flip"));const K6e={position:"top-right",transition:W6e,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function q6e(n){let t={...K6e,...n};const i=n.stacked,[s,l]=k.useState(!0),d=k.useRef(null),{getToastToRender:u,isToastActive:p,count:g}=U6e(t),{className:_,style:y,rtl:E,containerId:b}=t;function A(O){const D=pv("Toastify__toast-container",`Toastify__toast-container--${O}`,{"Toastify__toast-container--rtl":E});return Wd(_)?_({position:O,rtl:E,defaultClassName:D}):pv(D,Yk(_))}function N(){i&&(l(!0),Qr.play())}return H6e(()=>{if(i){var O;const D=d.current.querySelectorAll('[data-in="true"]'),P=12,j=(O=t.position)==null?void 0:O.includes("top");let M=0,V=0;Array.from(D).reverse().forEach((H,$)=>{const Q=H;Q.classList.add("Toastify__toast--stacked"),$>0&&(Q.dataset.collapsed=`${s}`),Q.dataset.pos||(Q.dataset.pos=j?"top":"bot");const Y=M*(s?.2:1)+(s?0:P*$);Q.style.setProperty("--y",`${j?Y:-1*Y}px`),Q.style.setProperty("--g",`${P}`),Q.style.setProperty("--s",""+(1-(s?V:0))),M+=Q.offsetHeight,V+=.025})}},[s,g,i]),dn.createElement("div",{ref:d,className:"Toastify",id:b,onMouseEnter:()=>{i&&(l(!1),Qr.pause())},onMouseLeave:N},u((O,D)=>{const P=D.length?{...y}:{...y,pointerEvents:"none"};return dn.createElement("div",{className:A(O),style:P,key:`container-${O}`},D.map(j=>{let{content:M,props:V}=j;return dn.createElement(G6e,{...V,stacked:i,collapseAll:N,isIn:p(V.toastId,V.containerId),style:V.style,key:`toast-${V.key}`},M)}))}))}const Qt=(n="Default message!",t="info")=>{t==="success"&&Qr.success(n,{}),t==="error"&&Qr.error(n,{}),t==="info"&&Qr.info(n,{})},Y6e=(n,t)=>{n==="dark"?document.body.classList.add("dark_theme"):document.body.classList.remove("dark_theme"),t(n),localStorage.setItem("theme",n)};function $R(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Pv(n="Guest",t="User",i=""){const s=`${n&&n} ${i&&i} ${t&&t}`;return!n&&!i&&!t?"Guest User":s}function X6e(n){const t=[{id:"dashboard",title:""},{id:"profile",title:"Profile"},{id:"change-password",title:"Change Password"},{id:"quick-actions",title:"Quick Actions"},{id:"notifications",title:"Notifications"},{id:"appreciations",title:"Appreciations"},{id:"badges",title:"Badges"},{id:"rewards",title:"Rewards"},{id:"metric-reports",title:"Metric Reports"},{id:"approve-reject-form-submission",title:"Approve or Reject Form Submission"},{id:"quick-actions-content",title:"Quick Actions Content"},{id:"magazines",title:"Magazines"},{id:"magazine-details",title:"Magazine Details"},{id:"messages",title:"Messages"},{id:"messages-details",title:"Messages Details"},{id:"contests",title:"Detailing Contests"},{id:"contest-details",title:"Contest Details"},{id:"upload-response",title:"Upload Response"},{id:"evaluate",title:"Evaluate"},{id:"competition-contests",title:"Contests"}];let i="";return t.forEach(s=>{(s==null?void 0:s.id.toLowerCase())===n.toLowerCase()&&(i=s==null?void 0:s.title)}),i}function J6e(n){let t="image2",i="media-image";switch(n?n.toLowerCase():"image"){case"video":t="play1",i="media-video";break;case"audio":t="consult1",i="media-audio";break;case"pdf":t="pdf2",i="media-doc";break;case"image":t="image2",i="media-image";break;case"gallery":t="image3",i="media-image";break;case"survey":t="survey1",i="media-survey";break;case"form":t="form1",i="media-form";break;case"quiz":t="quiz2",i="media-quiz";break;case"external":t="link2",i="media-link";break;default:t="consult1"}return{mediaIcon:t,mediaIconClass:i}}function eQ(n,t){return[parseInt(n/60/60),parseInt(n/60%60),parseInt(n%60)].join(t||":").replace(/\b(\d)\b/g,"0$1").replace(/^00\:/,"")}const pE=n=>{const t=`${Math.floor(n/60)}`.padStart(2,"0"),i=`${n-t*60}`.padStart(2,"0");return`${t>0?`${t}:${i} min`:`${i} sec`}`},Q6e=(n,t)=>t.split(".").reduce((i,s)=>i&&i[s],n),FO=(n,t,i)=>{if(!t.trim())return n;const s=t.toLowerCase().split(" ").filter(Boolean);return n.filter(l=>s.some(d=>i.some(u=>{const p=Q6e(l,u);return p==null?void 0:p.toLowerCase().includes(d)})))},Z6e=n=>{if(n==null)return 0;const t=String(n).trim();return!t||t.toLowerCase()==="null"||t.toLowerCase()==="undefined"?0:/^-?\d+(\.\d+)?$/.test(t)?Number(t):t};function $0e(n,t){return function(){return n.apply(t,arguments)}}const{toString:eLe}=Object.prototype,{getPrototypeOf:tQ}=Object,aU=(n=>t=>{const i=eLe.call(t);return n[i]||(n[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),pf=n=>(n=n.toLowerCase(),t=>aU(t)===n),oU=n=>t=>typeof t===n,{isArray:KR}=Array,V4=oU("undefined");function tLe(n){return n!==null&&!V4(n)&&n.constructor!==null&&!V4(n.constructor)&&Yd(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const K0e=pf("ArrayBuffer");function nLe(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&K0e(n.buffer),t}const iLe=oU("string"),Yd=oU("function"),q0e=oU("number"),lU=n=>n!==null&&typeof n=="object",rLe=n=>n===!0||n===!1,Xk=n=>{if(aU(n)!=="object")return!1;const t=tQ(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},sLe=pf("Date"),aLe=pf("File"),oLe=pf("Blob"),lLe=pf("FileList"),cLe=n=>lU(n)&&Yd(n.pipe),dLe=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Yd(n.append)&&((t=aU(n))==="formdata"||t==="object"&&Yd(n.toString)&&n.toString()==="[object FormData]"))},uLe=pf("URLSearchParams"),[hLe,fLe,pLe,mLe]=["ReadableStream","Request","Response","Headers"].map(pf),gLe=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function BO(n,t,{allOwnKeys:i=!1}={}){if(n===null||typeof n>"u")return;let s,l;if(typeof n!="object"&&(n=[n]),KR(n))for(s=0,l=n.length;s<l;s++)t.call(null,n[s],s,n);else{const d=i?Object.getOwnPropertyNames(n):Object.keys(n),u=d.length;let p;for(s=0;s<u;s++)p=d[s],t.call(null,n[p],p,n)}}function Y0e(n,t){t=t.toLowerCase();const i=Object.keys(n);let s=i.length,l;for(;s-- >0;)if(l=i[s],t===l.toLowerCase())return l;return null}const D_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Wo,X0e=n=>!V4(n)&&n!==D_;function Cq(){const{caseless:n}=X0e(this)&&this||{},t={},i=(s,l)=>{const d=n&&Y0e(t,l)||l;Xk(t[d])&&Xk(s)?t[d]=Cq(t[d],s):Xk(s)?t[d]=Cq({},s):KR(s)?t[d]=s.slice():t[d]=s};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&BO(arguments[s],i);return t}const vLe=(n,t,i,{allOwnKeys:s}={})=>(BO(t,(l,d)=>{i&&Yd(l)?n[d]=$0e(l,i):n[d]=l},{allOwnKeys:s}),n),yLe=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),_Le=(n,t,i,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),i&&Object.assign(n.prototype,i)},ELe=(n,t,i,s)=>{let l,d,u;const p={};if(t=t||{},n==null)return t;do{for(l=Object.getOwnPropertyNames(n),d=l.length;d-- >0;)u=l[d],(!s||s(u,n,t))&&!p[u]&&(t[u]=n[u],p[u]=!0);n=i!==!1&&tQ(n)}while(n&&(!i||i(n,t))&&n!==Object.prototype);return t},wLe=(n,t,i)=>{n=String(n),(i===void 0||i>n.length)&&(i=n.length),i-=t.length;const s=n.indexOf(t,i);return s!==-1&&s===i},SLe=n=>{if(!n)return null;if(KR(n))return n;let t=n.length;if(!q0e(t))return null;const i=new Array(t);for(;t-- >0;)i[t]=n[t];return i},bLe=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&tQ(Uint8Array)),CLe=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let l;for(;(l=s.next())&&!l.done;){const d=l.value;t.call(n,d[0],d[1])}},TLe=(n,t)=>{let i;const s=[];for(;(i=n.exec(t))!==null;)s.push(i);return s},RLe=pf("HTMLFormElement"),xLe=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,s,l){return s.toUpperCase()+l}),Eue=(({hasOwnProperty:n})=>(t,i)=>n.call(t,i))(Object.prototype),ALe=pf("RegExp"),J0e=(n,t)=>{const i=Object.getOwnPropertyDescriptors(n),s={};BO(i,(l,d)=>{let u;(u=t(l,d,n))!==!1&&(s[d]=u||l)}),Object.defineProperties(n,s)},ILe=n=>{J0e(n,(t,i)=>{if(Yd(n)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=n[i];if(Yd(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},NLe=(n,t)=>{const i={},s=l=>{l.forEach(d=>{i[d]=!0})};return KR(n)?s(n):s(String(n).split(t)),i},OLe=()=>{},PLe=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t,x$="abcdefghijklmnopqrstuvwxyz",wue="0123456789",Q0e={DIGIT:wue,ALPHA:x$,ALPHA_DIGIT:x$+x$.toUpperCase()+wue},LLe=(n=16,t=Q0e.ALPHA_DIGIT)=>{let i="";const{length:s}=t;for(;n--;)i+=t[Math.random()*s|0];return i};function DLe(n){return!!(n&&Yd(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const kLe=n=>{const t=new Array(10),i=(s,l)=>{if(lU(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[l]=s;const d=KR(s)?[]:{};return BO(s,(u,p)=>{const g=i(u,l+1);!V4(g)&&(d[p]=g)}),t[l]=void 0,d}}return s};return i(n,0)},MLe=pf("AsyncFunction"),jLe=n=>n&&(lU(n)||Yd(n))&&Yd(n.then)&&Yd(n.catch),Z0e=((n,t)=>n?setImmediate:t?((i,s)=>(D_.addEventListener("message",({source:l,data:d})=>{l===D_&&d===i&&s.length&&s.shift()()},!1),l=>{s.push(l),D_.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Yd(D_.postMessage)),ULe=typeof queueMicrotask<"u"?queueMicrotask.bind(D_):typeof ic<"u"&&ic.nextTick||Z0e,At={isArray:KR,isArrayBuffer:K0e,isBuffer:tLe,isFormData:dLe,isArrayBufferView:nLe,isString:iLe,isNumber:q0e,isBoolean:rLe,isObject:lU,isPlainObject:Xk,isReadableStream:hLe,isRequest:fLe,isResponse:pLe,isHeaders:mLe,isUndefined:V4,isDate:sLe,isFile:aLe,isBlob:oLe,isRegExp:ALe,isFunction:Yd,isStream:cLe,isURLSearchParams:uLe,isTypedArray:bLe,isFileList:lLe,forEach:BO,merge:Cq,extend:vLe,trim:gLe,stripBOM:yLe,inherits:_Le,toFlatObject:ELe,kindOf:aU,kindOfTest:pf,endsWith:wLe,toArray:SLe,forEachEntry:CLe,matchAll:TLe,isHTMLForm:RLe,hasOwnProperty:Eue,hasOwnProp:Eue,reduceDescriptors:J0e,freezeMethods:ILe,toObjectSet:NLe,toCamelCase:xLe,noop:OLe,toFiniteNumber:PLe,findKey:Y0e,global:D_,isContextDefined:X0e,ALPHABET:Q0e,generateString:LLe,isSpecCompliantForm:DLe,toJSONObject:kLe,isAsyncFn:MLe,isThenable:jLe,setImmediate:Z0e,asap:ULe};function xi(n,t,i,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),i&&(this.config=i),s&&(this.request=s),l&&(this.response=l)}At.inherits(xi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:At.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const e1e=xi.prototype,t1e={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{t1e[n]={value:n}});Object.defineProperties(xi,t1e);Object.defineProperty(e1e,"isAxiosError",{value:!0});xi.from=(n,t,i,s,l,d)=>{const u=Object.create(e1e);return At.toFlatObject(n,u,function(g){return g!==Error.prototype},p=>p!=="isAxiosError"),xi.call(u,n.message,t,i,s,l),u.cause=n,u.name=n.name,d&&Object.assign(u,d),u};const FLe=null;function Tq(n){return At.isPlainObject(n)||At.isArray(n)}function n1e(n){return At.endsWith(n,"[]")?n.slice(0,-2):n}function Sue(n,t,i){return n?n.concat(t).map(function(l,d){return l=n1e(l),!i&&d?"["+l+"]":l}).join(i?".":""):t}function BLe(n){return At.isArray(n)&&!n.some(Tq)}const VLe=At.toFlatObject(At,{},null,function(t){return/^is[A-Z]/.test(t)});function cU(n,t,i){if(!At.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,i=At.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(O,D){return!At.isUndefined(D[O])});const s=i.metaTokens,l=i.visitor||y,d=i.dots,u=i.indexes,g=(i.Blob||typeof Blob<"u"&&Blob)&&At.isSpecCompliantForm(t);if(!At.isFunction(l))throw new TypeError("visitor must be a function");function _(N){if(N===null)return"";if(At.isDate(N))return N.toISOString();if(!g&&At.isBlob(N))throw new xi("Blob is not supported. Use a Buffer instead.");return At.isArrayBuffer(N)||At.isTypedArray(N)?g&&typeof Blob=="function"?new Blob([N]):o7.from(N):N}function y(N,O,D){let P=N;if(N&&!D&&typeof N=="object"){if(At.endsWith(O,"{}"))O=s?O:O.slice(0,-2),N=JSON.stringify(N);else if(At.isArray(N)&&BLe(N)||(At.isFileList(N)||At.endsWith(O,"[]"))&&(P=At.toArray(N)))return O=n1e(O),P.forEach(function(M,V){!(At.isUndefined(M)||M===null)&&t.append(u===!0?Sue([O],V,d):u===null?O:O+"[]",_(M))}),!1}return Tq(N)?!0:(t.append(Sue(D,O,d),_(N)),!1)}const E=[],b=Object.assign(VLe,{defaultVisitor:y,convertValue:_,isVisitable:Tq});function A(N,O){if(!At.isUndefined(N)){if(E.indexOf(N)!==-1)throw Error("Circular reference detected in "+O.join("."));E.push(N),At.forEach(N,function(P,j){(!(At.isUndefined(P)||P===null)&&l.call(t,P,At.isString(j)?j.trim():j,O,b))===!0&&A(P,O?O.concat(j):[j])}),E.pop()}}if(!At.isObject(n))throw new TypeError("data must be an object");return A(n),t}function bue(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function nQ(n,t){this._pairs=[],n&&cU(n,this,t)}const i1e=nQ.prototype;i1e.append=function(t,i){this._pairs.push([t,i])};i1e.toString=function(t){const i=t?function(s){return t.call(this,s,bue)}:bue;return this._pairs.map(function(l){return i(l[0])+"="+i(l[1])},"").join("&")};function zLe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function r1e(n,t,i){if(!t)return n;const s=i&&i.encode||zLe,l=i&&i.serialize;let d;if(l?d=l(t,i):d=At.isURLSearchParams(t)?t.toString():new nQ(t,i).toString(s),d){const u=n.indexOf("#");u!==-1&&(n=n.slice(0,u)),n+=(n.indexOf("?")===-1?"?":"&")+d}return n}class Cue{constructor(){this.handlers=[]}use(t,i,s){return this.handlers.push({fulfilled:t,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){At.forEach(this.handlers,function(s){s!==null&&t(s)})}}const s1e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},HLe=typeof URLSearchParams<"u"?URLSearchParams:nQ,GLe=typeof FormData<"u"?FormData:null,WLe=typeof Blob<"u"?Blob:null,$Le={isBrowser:!0,classes:{URLSearchParams:HLe,FormData:GLe,Blob:WLe},protocols:["http","https","file","blob","url","data"]},iQ=typeof window<"u"&&typeof document<"u",KLe=(n=>iQ&&["ReactNative","NativeScript","NS"].indexOf(n)<0)(typeof navigator<"u"&&navigator.product),qLe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",YLe=iQ&&window.location.href||"http://localhost",XLe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:iQ,hasStandardBrowserEnv:KLe,hasStandardBrowserWebWorkerEnv:qLe,origin:YLe},Symbol.toStringTag,{value:"Module"})),cf={...XLe,...$Le};function JLe(n,t){return cU(n,new cf.classes.URLSearchParams,Object.assign({visitor:function(i,s,l,d){return cf.isNode&&At.isBuffer(i)?(this.append(s,i.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},t))}function QLe(n){return At.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function ZLe(n){const t={},i=Object.keys(n);let s;const l=i.length;let d;for(s=0;s<l;s++)d=i[s],t[d]=n[d];return t}function a1e(n){function t(i,s,l,d){let u=i[d++];if(u==="__proto__")return!0;const p=Number.isFinite(+u),g=d>=i.length;return u=!u&&At.isArray(l)?l.length:u,g?(At.hasOwnProp(l,u)?l[u]=[l[u],s]:l[u]=s,!p):((!l[u]||!At.isObject(l[u]))&&(l[u]=[]),t(i,s,l[u],d)&&At.isArray(l[u])&&(l[u]=ZLe(l[u])),!p)}if(At.isFormData(n)&&At.isFunction(n.entries)){const i={};return At.forEachEntry(n,(s,l)=>{t(QLe(s),l,i,0)}),i}return null}function e8e(n,t,i){if(At.isString(n))try{return(t||JSON.parse)(n),At.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(i||JSON.stringify)(n)}const rQ={transitional:s1e,adapter:["xhr","http","fetch"],transformRequest:[function(t,i){const s=i.getContentType()||"",l=s.indexOf("application/json")>-1,d=At.isObject(t);if(d&&At.isHTMLForm(t)&&(t=new FormData(t)),At.isFormData(t))return l?JSON.stringify(a1e(t)):t;if(At.isArrayBuffer(t)||At.isBuffer(t)||At.isStream(t)||At.isFile(t)||At.isBlob(t)||At.isReadableStream(t))return t;if(At.isArrayBufferView(t))return t.buffer;if(At.isURLSearchParams(t))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let p;if(d){if(s.indexOf("application/x-www-form-urlencoded")>-1)return JLe(t,this.formSerializer).toString();if((p=At.isFileList(t))||s.indexOf("multipart/form-data")>-1){const g=this.env&&this.env.FormData;return cU(p?{"files[]":t}:t,g&&new g,this.formSerializer)}}return d||l?(i.setContentType("application/json",!1),e8e(t)):t}],transformResponse:[function(t){const i=this.transitional||rQ.transitional,s=i&&i.forcedJSONParsing,l=this.responseType==="json";if(At.isResponse(t)||At.isReadableStream(t))return t;if(t&&At.isString(t)&&(s&&!this.responseType||l)){const u=!(i&&i.silentJSONParsing)&&l;try{return JSON.parse(t)}catch(p){if(u)throw p.name==="SyntaxError"?xi.from(p,xi.ERR_BAD_RESPONSE,this,null,this.response):p}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:cf.classes.FormData,Blob:cf.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};At.forEach(["delete","get","head","post","put","patch"],n=>{rQ.headers[n]={}});const sQ=rQ,t8e=At.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n8e=n=>{const t={};let i,s,l;return n&&n.split(`
`).forEach(function(u){l=u.indexOf(":"),i=u.substring(0,l).trim().toLowerCase(),s=u.substring(l+1).trim(),!(!i||t[i]&&t8e[i])&&(i==="set-cookie"?t[i]?t[i].push(s):t[i]=[s]:t[i]=t[i]?t[i]+", "+s:s)}),t},Tue=Symbol("internals");function fI(n){return n&&String(n).trim().toLowerCase()}function Jk(n){return n===!1||n==null?n:At.isArray(n)?n.map(Jk):String(n)}function i8e(n){const t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(n);)t[s[1]]=s[2];return t}const r8e=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function A$(n,t,i,s,l){if(At.isFunction(s))return s.call(this,t,i);if(l&&(t=i),!!At.isString(t)){if(At.isString(s))return t.indexOf(s)!==-1;if(At.isRegExp(s))return s.test(t)}}function s8e(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,s)=>i.toUpperCase()+s)}function a8e(n,t){const i=At.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+i,{value:function(l,d,u){return this[s].call(this,t,l,d,u)},configurable:!0})})}class dU{constructor(t){t&&this.set(t)}set(t,i,s){const l=this;function d(p,g,_){const y=fI(g);if(!y)throw new Error("header name must be a non-empty string");const E=At.findKey(l,y);(!E||l[E]===void 0||_===!0||_===void 0&&l[E]!==!1)&&(l[E||g]=Jk(p))}const u=(p,g)=>At.forEach(p,(_,y)=>d(_,y,g));if(At.isPlainObject(t)||t instanceof this.constructor)u(t,i);else if(At.isString(t)&&(t=t.trim())&&!r8e(t))u(n8e(t),i);else if(At.isHeaders(t))for(const[p,g]of t.entries())d(g,p,s);else t!=null&&d(i,t,s);return this}get(t,i){if(t=fI(t),t){const s=At.findKey(this,t);if(s){const l=this[s];if(!i)return l;if(i===!0)return i8e(l);if(At.isFunction(i))return i.call(this,l,s);if(At.isRegExp(i))return i.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=fI(t),t){const s=At.findKey(this,t);return!!(s&&this[s]!==void 0&&(!i||A$(this,this[s],s,i)))}return!1}delete(t,i){const s=this;let l=!1;function d(u){if(u=fI(u),u){const p=At.findKey(s,u);p&&(!i||A$(s,s[p],p,i))&&(delete s[p],l=!0)}}return At.isArray(t)?t.forEach(d):d(t),l}clear(t){const i=Object.keys(this);let s=i.length,l=!1;for(;s--;){const d=i[s];(!t||A$(this,this[d],d,t,!0))&&(delete this[d],l=!0)}return l}normalize(t){const i=this,s={};return At.forEach(this,(l,d)=>{const u=At.findKey(s,d);if(u){i[u]=Jk(l),delete i[d];return}const p=t?s8e(d):String(d).trim();p!==d&&delete i[d],i[p]=Jk(l),s[p]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const i=Object.create(null);return At.forEach(this,(s,l)=>{s!=null&&s!==!1&&(i[l]=t&&At.isArray(s)?s.join(", "):s)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){const s=new this(t);return i.forEach(l=>s.set(l)),s}static accessor(t){const s=(this[Tue]=this[Tue]={accessors:{}}).accessors,l=this.prototype;function d(u){const p=fI(u);s[p]||(a8e(l,u),s[p]=!0)}return At.isArray(t)?t.forEach(d):d(t),this}}dU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);At.reduceDescriptors(dU.prototype,({value:n},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[i]=s}}});At.freezeMethods(dU);const df=dU;function I$(n,t){const i=this||sQ,s=t||i,l=df.from(s.headers);let d=s.data;return At.forEach(n,function(p){d=p.call(i,d,l.normalize(),t?t.status:void 0)}),l.normalize(),d}function o1e(n){return!!(n&&n.__CANCEL__)}function qR(n,t,i){xi.call(this,n??"canceled",xi.ERR_CANCELED,t,i),this.name="CanceledError"}At.inherits(qR,xi,{__CANCEL__:!0});function l1e(n,t,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?n(i):t(new xi("Request failed with status code "+i.status,[xi.ERR_BAD_REQUEST,xi.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function o8e(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function l8e(n,t){n=n||10;const i=new Array(n),s=new Array(n);let l=0,d=0,u;return t=t!==void 0?t:1e3,function(g){const _=Date.now(),y=s[d];u||(u=_),i[l]=g,s[l]=_;let E=d,b=0;for(;E!==l;)b+=i[E++],E=E%n;if(l=(l+1)%n,l===d&&(d=(d+1)%n),_-u<t)return;const A=y&&_-y;return A?Math.round(b*1e3/A):void 0}}function c8e(n,t){let i=0,s=1e3/t,l,d;const u=(_,y=Date.now())=>{i=y,l=null,d&&(clearTimeout(d),d=null),n.apply(null,_)};return[(..._)=>{const y=Date.now(),E=y-i;E>=s?u(_,y):(l=_,d||(d=setTimeout(()=>{d=null,u(l)},s-E)))},()=>l&&u(l)]}const u7=(n,t,i=3)=>{let s=0;const l=l8e(50,250);return c8e(d=>{const u=d.loaded,p=d.lengthComputable?d.total:void 0,g=u-s,_=l(g),y=u<=p;s=u;const E={loaded:u,total:p,progress:p?u/p:void 0,bytes:g,rate:_||void 0,estimated:_&&p&&y?(p-u)/_:void 0,event:d,lengthComputable:p!=null,[t?"download":"upload"]:!0};n(E)},i)},Rue=(n,t)=>{const i=n!=null;return[s=>t[0]({lengthComputable:i,total:n,loaded:s}),t[1]]},xue=n=>(...t)=>At.asap(()=>n(...t)),d8e=cf.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let s;function l(d){let u=d;return t&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return s=l(window.location.href),function(u){const p=At.isString(u)?l(u):u;return p.protocol===s.protocol&&p.host===s.host}}():function(){return function(){return!0}}(),u8e=cf.hasStandardBrowserEnv?{write(n,t,i,s,l,d){const u=[n+"="+encodeURIComponent(t)];At.isNumber(i)&&u.push("expires="+new Date(i).toGMTString()),At.isString(s)&&u.push("path="+s),At.isString(l)&&u.push("domain="+l),d===!0&&u.push("secure"),document.cookie=u.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function h8e(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function f8e(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function c1e(n,t){return n&&!h8e(t)?f8e(n,t):t}const Aue=n=>n instanceof df?{...n}:n;function CE(n,t){t=t||{};const i={};function s(_,y,E){return At.isPlainObject(_)&&At.isPlainObject(y)?At.merge.call({caseless:E},_,y):At.isPlainObject(y)?At.merge({},y):At.isArray(y)?y.slice():y}function l(_,y,E){if(At.isUndefined(y)){if(!At.isUndefined(_))return s(void 0,_,E)}else return s(_,y,E)}function d(_,y){if(!At.isUndefined(y))return s(void 0,y)}function u(_,y){if(At.isUndefined(y)){if(!At.isUndefined(_))return s(void 0,_)}else return s(void 0,y)}function p(_,y,E){if(E in t)return s(_,y);if(E in n)return s(void 0,_)}const g={url:d,method:d,data:d,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:p,headers:(_,y)=>l(Aue(_),Aue(y),!0)};return At.forEach(Object.keys(Object.assign({},n,t)),function(y){const E=g[y]||l,b=E(n[y],t[y],y);At.isUndefined(b)&&E!==p||(i[y]=b)}),i}const d1e=n=>{const t=CE({},n);let{data:i,withXSRFToken:s,xsrfHeaderName:l,xsrfCookieName:d,headers:u,auth:p}=t;t.headers=u=df.from(u),t.url=r1e(c1e(t.baseURL,t.url),n.params,n.paramsSerializer),p&&u.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):"")));let g;if(At.isFormData(i)){if(cf.hasStandardBrowserEnv||cf.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((g=u.getContentType())!==!1){const[_,...y]=g?g.split(";").map(E=>E.trim()).filter(Boolean):[];u.setContentType([_||"multipart/form-data",...y].join("; "))}}if(cf.hasStandardBrowserEnv&&(s&&At.isFunction(s)&&(s=s(t)),s||s!==!1&&d8e(t.url))){const _=l&&d&&u8e.read(d);_&&u.set(l,_)}return t},p8e=typeof XMLHttpRequest<"u",m8e=p8e&&function(n){return new Promise(function(i,s){const l=d1e(n);let d=l.data;const u=df.from(l.headers).normalize();let{responseType:p,onUploadProgress:g,onDownloadProgress:_}=l,y,E,b,A,N;function O(){A&&A(),N&&N(),l.cancelToken&&l.cancelToken.unsubscribe(y),l.signal&&l.signal.removeEventListener("abort",y)}let D=new XMLHttpRequest;D.open(l.method.toUpperCase(),l.url,!0),D.timeout=l.timeout;function P(){if(!D)return;const M=df.from("getAllResponseHeaders"in D&&D.getAllResponseHeaders()),H={data:!p||p==="text"||p==="json"?D.responseText:D.response,status:D.status,statusText:D.statusText,headers:M,config:n,request:D};l1e(function(Q){i(Q),O()},function(Q){s(Q),O()},H),D=null}"onloadend"in D?D.onloadend=P:D.onreadystatechange=function(){!D||D.readyState!==4||D.status===0&&!(D.responseURL&&D.responseURL.indexOf("file:")===0)||setTimeout(P)},D.onabort=function(){D&&(s(new xi("Request aborted",xi.ECONNABORTED,n,D)),D=null)},D.onerror=function(){s(new xi("Network Error",xi.ERR_NETWORK,n,D)),D=null},D.ontimeout=function(){let V=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const H=l.transitional||s1e;l.timeoutErrorMessage&&(V=l.timeoutErrorMessage),s(new xi(V,H.clarifyTimeoutError?xi.ETIMEDOUT:xi.ECONNABORTED,n,D)),D=null},d===void 0&&u.setContentType(null),"setRequestHeader"in D&&At.forEach(u.toJSON(),function(V,H){D.setRequestHeader(H,V)}),At.isUndefined(l.withCredentials)||(D.withCredentials=!!l.withCredentials),p&&p!=="json"&&(D.responseType=l.responseType),_&&([b,N]=u7(_,!0),D.addEventListener("progress",b)),g&&D.upload&&([E,A]=u7(g),D.upload.addEventListener("progress",E),D.upload.addEventListener("loadend",A)),(l.cancelToken||l.signal)&&(y=M=>{D&&(s(!M||M.type?new qR(null,n,D):M),D.abort(),D=null)},l.cancelToken&&l.cancelToken.subscribe(y),l.signal&&(l.signal.aborted?y():l.signal.addEventListener("abort",y)));const j=o8e(l.url);if(j&&cf.protocols.indexOf(j)===-1){s(new xi("Unsupported protocol "+j+":",xi.ERR_BAD_REQUEST,n));return}D.send(d||null)})},g8e=(n,t)=>{let i=new AbortController,s;const l=function(g){if(!s){s=!0,u();const _=g instanceof Error?g:this.reason;i.abort(_ instanceof xi?_:new qR(_ instanceof Error?_.message:_))}};let d=t&&setTimeout(()=>{l(new xi(`timeout ${t} of ms exceeded`,xi.ETIMEDOUT))},t);const u=()=>{n&&(d&&clearTimeout(d),d=null,n.forEach(g=>{g&&(g.removeEventListener?g.removeEventListener("abort",l):g.unsubscribe(l))}),n=null)};n.forEach(g=>g&&g.addEventListener&&g.addEventListener("abort",l));const{signal:p}=i;return p.unsubscribe=u,[p,()=>{d&&clearTimeout(d),d=null}]},v8e=function*(n,t){let i=n.byteLength;if(!t||i<t){yield n;return}let s=0,l;for(;s<i;)l=s+t,yield n.slice(s,l),s=l},y8e=async function*(n,t,i){for await(const s of n)yield*v8e(ArrayBuffer.isView(s)?s:await i(String(s)),t)},Iue=(n,t,i,s,l)=>{const d=y8e(n,t,l);let u=0,p,g=_=>{p||(p=!0,s&&s(_))};return new ReadableStream({async pull(_){try{const{done:y,value:E}=await d.next();if(y){g(),_.close();return}let b=E.byteLength;if(i){let A=u+=b;i(A)}_.enqueue(new Uint8Array(E))}catch(y){throw g(y),y}},cancel(_){return g(_),d.return()}},{highWaterMark:2})},uU=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",u1e=uU&&typeof ReadableStream=="function",Rq=uU&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),h1e=(n,...t)=>{try{return!!n(...t)}catch{return!1}},_8e=u1e&&h1e(()=>{let n=!1;const t=new Request(cf.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Nue=64*1024,xq=u1e&&h1e(()=>At.isReadableStream(new Response("").body)),h7={stream:xq&&(n=>n.body)};uU&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!h7[t]&&(h7[t]=At.isFunction(n[t])?i=>i[t]():(i,s)=>{throw new xi(`Response type '${t}' is not supported`,xi.ERR_NOT_SUPPORT,s)})})})(new Response);const E8e=async n=>{if(n==null)return 0;if(At.isBlob(n))return n.size;if(At.isSpecCompliantForm(n))return(await new Request(n).arrayBuffer()).byteLength;if(At.isArrayBufferView(n)||At.isArrayBuffer(n))return n.byteLength;if(At.isURLSearchParams(n)&&(n=n+""),At.isString(n))return(await Rq(n)).byteLength},w8e=async(n,t)=>{const i=At.toFiniteNumber(n.getContentLength());return i??E8e(t)},S8e=uU&&(async n=>{let{url:t,method:i,data:s,signal:l,cancelToken:d,timeout:u,onDownloadProgress:p,onUploadProgress:g,responseType:_,headers:y,withCredentials:E="same-origin",fetchOptions:b}=d1e(n);_=_?(_+"").toLowerCase():"text";let[A,N]=l||d||u?g8e([l,d],u):[],O,D;const P=()=>{!O&&setTimeout(()=>{A&&A.unsubscribe()}),O=!0};let j;try{if(g&&_8e&&i!=="get"&&i!=="head"&&(j=await w8e(y,s))!==0){let $=new Request(t,{method:"POST",body:s,duplex:"half"}),Q;if(At.isFormData(s)&&(Q=$.headers.get("content-type"))&&y.setContentType(Q),$.body){const[Y,le]=Rue(j,u7(xue(g)));s=Iue($.body,Nue,Y,le,Rq)}}At.isString(E)||(E=E?"include":"omit"),D=new Request(t,{...b,signal:A,method:i.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:E});let M=await fetch(D);const V=xq&&(_==="stream"||_==="response");if(xq&&(p||V)){const $={};["status","statusText","headers"].forEach(ae=>{$[ae]=M[ae]});const Q=At.toFiniteNumber(M.headers.get("content-length")),[Y,le]=p&&Rue(Q,u7(xue(p),!0))||[];M=new Response(Iue(M.body,Nue,Y,()=>{le&&le(),V&&P()},Rq),$)}_=_||"text";let H=await h7[At.findKey(h7,_)||"text"](M,n);return!V&&P(),N&&N(),await new Promise(($,Q)=>{l1e($,Q,{data:H,headers:df.from(M.headers),status:M.status,statusText:M.statusText,config:n,request:D})})}catch(M){throw P(),M&&M.name==="TypeError"&&/fetch/i.test(M.message)?Object.assign(new xi("Network Error",xi.ERR_NETWORK,n,D),{cause:M.cause||M}):xi.from(M,M&&M.code,n,D)}}),Aq={http:FLe,xhr:m8e,fetch:S8e};At.forEach(Aq,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Oue=n=>`- ${n}`,b8e=n=>At.isFunction(n)||n===null||n===!1,f1e={getAdapter:n=>{n=At.isArray(n)?n:[n];const{length:t}=n;let i,s;const l={};for(let d=0;d<t;d++){i=n[d];let u;if(s=i,!b8e(i)&&(s=Aq[(u=String(i)).toLowerCase()],s===void 0))throw new xi(`Unknown adapter '${u}'`);if(s)break;l[u||"#"+d]=s}if(!s){const d=Object.entries(l).map(([p,g])=>`adapter ${p} `+(g===!1?"is not supported by the environment":"is not available in the build"));let u=t?d.length>1?`since :
`+d.map(Oue).join(`
`):" "+Oue(d[0]):"as no adapter specified";throw new xi("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},adapters:Aq};function N$(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new qR(null,n)}function Pue(n){return N$(n),n.headers=df.from(n.headers),n.data=I$.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),f1e.getAdapter(n.adapter||sQ.adapter)(n).then(function(s){return N$(n),s.data=I$.call(n,n.transformResponse,s),s.headers=df.from(s.headers),s},function(s){return o1e(s)||(N$(n),s&&s.response&&(s.response.data=I$.call(n,n.transformResponse,s.response),s.response.headers=df.from(s.response.headers))),Promise.reject(s)})}const p1e="1.7.3",aQ={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{aQ[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Lue={};aQ.transitional=function(t,i,s){function l(d,u){return"[Axios v"+p1e+"] Transitional option '"+d+"'"+u+(s?". "+s:"")}return(d,u,p)=>{if(t===!1)throw new xi(l(u," has been removed"+(i?" in "+i:"")),xi.ERR_DEPRECATED);return i&&!Lue[u]&&(Lue[u]=!0,console.warn(l(u," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(d,u,p):!0}};function C8e(n,t,i){if(typeof n!="object")throw new xi("options must be an object",xi.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let l=s.length;for(;l-- >0;){const d=s[l],u=t[d];if(u){const p=n[d],g=p===void 0||u(p,d,n);if(g!==!0)throw new xi("option "+d+" must be "+g,xi.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new xi("Unknown option "+d,xi.ERR_BAD_OPTION)}}const Iq={assertOptions:C8e,validators:aQ},Q0=Iq.validators;class f7{constructor(t){this.defaults=t,this.interceptors={request:new Cue,response:new Cue}}async request(t,i){try{return await this._request(t,i)}catch(s){if(s instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;const d=l.stack?l.stack.replace(/^.+\n/,""):"";try{s.stack?d&&!String(s.stack).endsWith(d.replace(/^.+\n.+\n/,""))&&(s.stack+=`
`+d):s.stack=d}catch{}}throw s}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=CE(this.defaults,i);const{transitional:s,paramsSerializer:l,headers:d}=i;s!==void 0&&Iq.assertOptions(s,{silentJSONParsing:Q0.transitional(Q0.boolean),forcedJSONParsing:Q0.transitional(Q0.boolean),clarifyTimeoutError:Q0.transitional(Q0.boolean)},!1),l!=null&&(At.isFunction(l)?i.paramsSerializer={serialize:l}:Iq.assertOptions(l,{encode:Q0.function,serialize:Q0.function},!0)),i.method=(i.method||this.defaults.method||"get").toLowerCase();let u=d&&At.merge(d.common,d[i.method]);d&&At.forEach(["delete","get","head","post","put","patch","common"],N=>{delete d[N]}),i.headers=df.concat(u,d);const p=[];let g=!0;this.interceptors.request.forEach(function(O){typeof O.runWhen=="function"&&O.runWhen(i)===!1||(g=g&&O.synchronous,p.unshift(O.fulfilled,O.rejected))});const _=[];this.interceptors.response.forEach(function(O){_.push(O.fulfilled,O.rejected)});let y,E=0,b;if(!g){const N=[Pue.bind(this),void 0];for(N.unshift.apply(N,p),N.push.apply(N,_),b=N.length,y=Promise.resolve(i);E<b;)y=y.then(N[E++],N[E++]);return y}b=p.length;let A=i;for(E=0;E<b;){const N=p[E++],O=p[E++];try{A=N(A)}catch(D){O.call(this,D);break}}try{y=Pue.call(this,A)}catch(N){return Promise.reject(N)}for(E=0,b=_.length;E<b;)y=y.then(_[E++],_[E++]);return y}getUri(t){t=CE(this.defaults,t);const i=c1e(t.baseURL,t.url);return r1e(i,t.params,t.paramsSerializer)}}At.forEach(["delete","get","head","options"],function(t){f7.prototype[t]=function(i,s){return this.request(CE(s||{},{method:t,url:i,data:(s||{}).data}))}});At.forEach(["post","put","patch"],function(t){function i(s){return function(d,u,p){return this.request(CE(p||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:d,data:u}))}}f7.prototype[t]=i(),f7.prototype[t+"Form"]=i(!0)});const Qk=f7;class oQ{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(d){i=d});const s=this;this.promise.then(l=>{if(!s._listeners)return;let d=s._listeners.length;for(;d-- >0;)s._listeners[d](l);s._listeners=null}),this.promise.then=l=>{let d;const u=new Promise(p=>{s.subscribe(p),d=p}).then(l);return u.cancel=function(){s.unsubscribe(d)},u},t(function(d,u,p){s.reason||(s.reason=new qR(d,u,p),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}static source(){let t;return{token:new oQ(function(l){t=l}),cancel:t}}}const T8e=oQ;function R8e(n){return function(i){return n.apply(null,i)}}function x8e(n){return At.isObject(n)&&n.isAxiosError===!0}const Nq={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Nq).forEach(([n,t])=>{Nq[t]=n});const A8e=Nq;function m1e(n){const t=new Qk(n),i=$0e(Qk.prototype.request,t);return At.extend(i,Qk.prototype,t,{allOwnKeys:!0}),At.extend(i,t,null,{allOwnKeys:!0}),i.create=function(l){return m1e(CE(n,l))},i}const zr=m1e(sQ);zr.Axios=Qk;zr.CanceledError=qR;zr.CancelToken=T8e;zr.isCancel=o1e;zr.VERSION=p1e;zr.toFormData=cU;zr.AxiosError=xi;zr.Cancel=zr.CanceledError;zr.all=function(t){return Promise.all(t)};zr.spread=R8e;zr.isAxiosError=x8e;zr.mergeConfig=CE;zr.AxiosHeaders=df;zr.formToJSON=n=>a1e(At.isHTMLForm(n)?new FormData(n):n);zr.getAdapter=f1e.getAdapter;zr.HttpStatusCode=A8e;zr.default=zr;var g1e={baseUrl:"https://rapportapi.click/"};const On=zr.create({baseURL:g1e.baseUrl,validateStatus:function(n){return n>=200&&n<500},timeout:3e4}),I8e=["ums/auth/login","ums/auth/verify","ums/auth/reverify","ums/auth/register","ums/auth/forgot_password_otp","ums/auth/forgot_password","mag/magazine/crest_verfication"],N8e=async()=>{var t,i,s,l;const n=localStorage.getItem("refresh_token");try{const d=await zr.post(`${g1e.baseUrl}ums/auth/reverify`,{refresh_token:n},{headers:{"Content-Type":"application/json"}});if(((t=d.data)==null?void 0:t.status)==="success"&&((i=d.data)==null?void 0:i.statusCode)===200){const{access_token:u,refresh_token:p,user:g,permissions:_,expiresin:y}=(s=d.data)==null?void 0:s.data;return localStorage.setItem("auth_token",u),localStorage.setItem("refresh_token",p),localStorage.setItem("auth_user",JSON.stringify(g)),localStorage.setItem("permissions",JSON.stringify(_)),localStorage.setItem("expiresin",y),u}else throw localStorage.clear(),new Error(((l=d==null?void 0:d.data)==null?void 0:l.message)||"Session expired")}catch(d){throw console.log("reVerifyAuth err - ",d),localStorage.clear(),Qt("Session expired. Please log in again.","error"),d}};On.interceptors.request.use(async n=>{if(!I8e.includes(n.url)){let t=localStorage.getItem("auth_token")?localStorage.getItem("auth_token"):null;const i=parseInt(localStorage.getItem("expiresin")||"0");let s=Date.now()>i;if(!t||s)try{t=await N8e()}catch(l){return console.error("Failed to refresh token",l),Promise.reject(l)}t&&(n.headers.authorization=t)}return n},n=>(window.location.href="/",localStorage.clear(),Promise.reject(n)));const lQ={getFormApprovalInfo:async n=>(console.log("Inside Service getFormApprovalInfo() ...",n),await On.post("form/formentity/approval",n)),approveForm:async n=>(console.log("Inside Service approveForm() ...",n),await On.post("form/formentity/approvereject",n)),rejectForm:async n=>(console.log("Inside Service approveForm() ...",n),await On.post("form/formentity/approvereject",n))},Due="form_approval",O8e="form_approved",P8e="form_reject",L8e="form_submitted",D8e="target_achieved",v1e=n=>{console.log("handleNotificationClick called with payload = ",n);const t=n==null?void 0:n.type,i=n!=null&&n.entity_id?n==null?void 0:n.entity_id:n!=null&&n.contest_id?n==null?void 0:n.contest_id:"";let s="/dashboard";switch(t){case"form_approval":s=`/approve-reject-form-submission/${i}`;break;case"form_reminder":s="/quick-actions";break;case"form_approved":case"form_reject":case"form_submitted":case"target_achieved":console.log("Nothing to do...");break;case"broadcast_created":case"broadcast_liked":case"broadcast_comment":s=`/messages/${i}`;break;case"magazine_created":case"magazine_media_created":s=`/magazines/${i}`;break;case"appreciation_recieved":s="/appreciations";break;case"badge_recieved":s="/badges";break;case"detailing_contest_created":case"detailing_contest_upload_response":case"detailing_contest_evaluated":s=`/contests/${i}`;break;default:console.log("No payload type matched...")}return s},Ai={login:async n=>(console.log("In Login Data =",n),await On.post("ums/auth/login",n)),changePassword:async n=>(console.log("In Login Service Data =",n),await On.post("ums/auth/change_password",n)),getToken:()=>localStorage.getItem("auth_token"),getRefreshToken:()=>localStorage.getItem("refresh_token"),getTokenExpiry:()=>localStorage.getItem("expiresin"),setToken:n=>{localStorage.setItem("auth_token",n.access_token),localStorage.setItem("refresh_token",n.refresh_token),localStorage.setItem("auth_user",JSON.stringify(n.user)),localStorage.setItem("permissions",JSON.stringify(n.permissions)),localStorage.setItem("expiresin",n.expiresin)},getLoginSchemeFromLocal:()=>localStorage.getItem("login_scheme"),setLoginSchemeToLocal:n=>{console.log("setLoginSchemeToLocal = ",n,typeof n),localStorage.setItem("login_scheme",n)},setAuthUser:n=>{console.log("setAuthUSer = ",n);const i={...JSON.parse(localStorage.getItem("auth_user")),...n};localStorage.setItem("auth_user",JSON.stringify(i))},logout:()=>{localStorage.clear(),window.location.href="/"},verifyAuth:async n=>(console.log("In Verify Auth: ",n),await On.post("ums/auth/verify",n)),reVerifyAuth:async n=>await On.post("ums/auth/reverify",n),forgotPasswordOTP:async n=>await On.post("ums/auth/forgot_password_otp",n),forgotPassword:async n=>await On.post("ums/auth/forgot_password",n),getAuthUser:()=>localStorage.getItem("auth_user"),getDeviceInfo:()=>JSON.parse(localStorage.getItem("deviceInfo")),getDevicePlatform:()=>{const n=JSON.parse(localStorage.getItem("deviceInfo"));return n==null?void 0:n.platform},getDeviceID:()=>localStorage.getItem("deviceID"),getAppID:()=>localStorage.getItem("appID"),getAppCurrentVersion:()=>localStorage.getItem("appCurrentVersion"),getNotificationToken:()=>localStorage.getItem("notificationToken"),appInfoFromServer:async n=>(console.log("data in appInfoFromServer = ",JSON.stringify(n)),await On.post("detailing/app/appversion",n)),registerDeviceForPushNotification:async()=>{console.log("-- ** registerDeviceForPushNotification() service called... ** --");const n=Ai.getDeviceInfo();console.log("deviceInfo from registerDeviceForPushNotification service = ",n);const t={device:Ai.getDeviceID(),platform:n.platform,package_name:Ai.getAppID(),token:Ai.getNotificationToken(),manufacturer:n.manufacturer,device_model:n.model,app_version:Ai.getAppCurrentVersion(),version:n.osVersion};return console.log("registerDeviceForPushNotification service tempData =",t),await On.post("ums/notification/registertoken",t)}};var y1e={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(n){(function(){var t={}.hasOwnProperty;function i(){for(var d="",u=0;u<arguments.length;u++){var p=arguments[u];p&&(d=l(d,s(p)))}return d}function s(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return i.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var u="";for(var p in d)t.call(d,p)&&d[p]&&(u=l(u,p));return u}function l(d,u){return u?d?d+" "+u:d+u:d}n.exports?(i.default=i,n.exports=i):window.classNames=i})()})(y1e);var k8e=y1e.exports;const Un=Mv(k8e);function $d(){return $d=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},$d.apply(null,arguments)}function cQ(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)!==-1)continue;i[s]=n[s]}return i}function kue(n){return"default"+n.charAt(0).toUpperCase()+n.substr(1)}function M8e(n){var t=j8e(n,"string");return typeof t=="symbol"?t:String(t)}function j8e(n,t){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function U8e(n,t,i){var s=k.useRef(n!==void 0),l=k.useState(t),d=l[0],u=l[1],p=n!==void 0,g=s.current;return s.current=p,!p&&g&&d!==t&&u(t),[p?n:d,k.useCallback(function(_){for(var y=arguments.length,E=new Array(y>1?y-1:0),b=1;b<y;b++)E[b-1]=arguments[b];i&&i.apply(void 0,[_].concat(E)),u(_)},[i])]}function dQ(n,t){return Object.keys(t).reduce(function(i,s){var l,d=i,u=d[kue(s)],p=d[s],g=cQ(d,[kue(s),s].map(M8e)),_=t[s],y=U8e(p,u,n[_]),E=y[0],b=y[1];return $d({},g,(l={},l[s]=E,l[_]=b,l))},n)}function p7(n,t){return p7=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,s){return i.__proto__=s,i},p7(n,t)}function F8e(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,p7(n,t)}function _1e(){var n=this.constructor.getDerivedStateFromProps(this.props,this.state);n!=null&&this.setState(n)}function E1e(n){function t(i){var s=this.constructor.getDerivedStateFromProps(n,i);return s??null}this.setState(t.bind(this))}function w1e(n,t){try{var i=this.props,s=this.state;this.props=n,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(i,s)}finally{this.props=i,this.state=s}}_1e.__suppressDeprecationWarning=!0;E1e.__suppressDeprecationWarning=!0;w1e.__suppressDeprecationWarning=!0;function VO(n){var t=n.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof n.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return n;var i=null,s=null,l=null;if(typeof t.componentWillMount=="function"?i="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(i="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?s="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(s="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?l="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(l="UNSAFE_componentWillUpdate"),i!==null||s!==null||l!==null){var d=n.displayName||n.name,u=typeof n.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
`+d+" uses "+u+" but also contains the following legacy lifecycles:"+(i!==null?`
`+i:"")+(s!==null?`
`+s:"")+(l!==null?`
`+l:"")+`
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof n.getDerivedStateFromProps=="function"&&(t.componentWillMount=_1e,t.componentWillReceiveProps=E1e),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=w1e;var p=t.componentDidUpdate;t.componentDidUpdate=function(_,y,E){var b=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:E;p.call(this,_,y,b)}}return n}const B8e=["xxl","xl","lg","md","sm","xs"],V8e="xs",hU=k.createContext({prefixes:{},breakpoints:B8e,minBreakpoint:V8e});function ii(n,t){const{prefixes:i}=k.useContext(hU);return n||i[t]||t}function S1e(){const{breakpoints:n}=k.useContext(hU);return n}function b1e(){const{minBreakpoint:n}=k.useContext(hU);return n}function z8e(){const{dir:n}=k.useContext(hU);return n==="rtl"}function fU(n){return n&&n.ownerDocument||document}function H8e(n){var t=fU(n);return t&&t.defaultView||window}function G8e(n,t){return H8e(n).getComputedStyle(n,t)}var W8e=/([A-Z])/g;function $8e(n){return n.replace(W8e,"-$1").toLowerCase()}var K8e=/^ms-/;function _k(n){return $8e(n).replace(K8e,"-ms-")}var q8e=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function Y8e(n){return!!(n&&q8e.test(n))}function Ag(n,t){var i="",s="";if(typeof t=="string")return n.style.getPropertyValue(_k(t))||G8e(n).getPropertyValue(_k(t));Object.keys(t).forEach(function(l){var d=t[l];!d&&d!==0?n.style.removeProperty(_k(l)):Y8e(l)?s+=l+"("+d+") ":i+=_k(l)+": "+d+";"}),s&&(i+="transform: "+s+";"),n.style.cssText+=";"+i}var C1e={exports:{}},X8e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",J8e=X8e,Q8e=J8e;function T1e(){}function R1e(){}R1e.resetWarningCache=T1e;var Z8e=function(){function n(s,l,d,u,p,g){if(g!==Q8e){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}n.isRequired=n;function t(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:t,element:n,elementType:n,instanceOf:t,node:n,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:R1e,resetWarningCache:T1e};return i.PropTypes=i,i};C1e.exports=Z8e();var uQ=C1e.exports;const yl=Mv(uQ),Mue={disabled:!1},x1e=dn.createContext(null);var eDe=function(t){return t.scrollTop},NI="unmounted",s1="exited",sf="entering",Eg="entered",z4="exiting",Mg=function(n){F8e(t,n);function t(s,l){var d;d=n.call(this,s,l)||this;var u=l,p=u&&!u.isMounting?s.enter:s.appear,g;return d.appearStatus=null,s.in?p?(g=s1,d.appearStatus=sf):g=Eg:s.unmountOnExit||s.mountOnEnter?g=NI:g=s1,d.state={status:g},d.nextCallback=null,d}t.getDerivedStateFromProps=function(l,d){var u=l.in;return u&&d.status===NI?{status:s1}:null};var i=t.prototype;return i.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},i.componentDidUpdate=function(l){var d=null;if(l!==this.props){var u=this.state.status;this.props.in?u!==sf&&u!==Eg&&(d=sf):(u===sf||u===Eg)&&(d=z4)}this.updateStatus(!1,d)},i.componentWillUnmount=function(){this.cancelNextCallback()},i.getTimeouts=function(){var l=this.props.timeout,d,u,p;return d=u=p=l,l!=null&&typeof l!="number"&&(d=l.exit,u=l.enter,p=l.appear!==void 0?l.appear:u),{exit:d,enter:u,appear:p}},i.updateStatus=function(l,d){if(l===void 0&&(l=!1),d!==null)if(this.cancelNextCallback(),d===sf){if(this.props.unmountOnExit||this.props.mountOnEnter){var u=this.props.nodeRef?this.props.nodeRef.current:dC.findDOMNode(this);u&&eDe(u)}this.performEnter(l)}else this.performExit();else this.props.unmountOnExit&&this.state.status===s1&&this.setState({status:NI})},i.performEnter=function(l){var d=this,u=this.props.enter,p=this.context?this.context.isMounting:l,g=this.props.nodeRef?[p]:[dC.findDOMNode(this),p],_=g[0],y=g[1],E=this.getTimeouts(),b=p?E.appear:E.enter;if(!l&&!u||Mue.disabled){this.safeSetState({status:Eg},function(){d.props.onEntered(_)});return}this.props.onEnter(_,y),this.safeSetState({status:sf},function(){d.props.onEntering(_,y),d.onTransitionEnd(b,function(){d.safeSetState({status:Eg},function(){d.props.onEntered(_,y)})})})},i.performExit=function(){var l=this,d=this.props.exit,u=this.getTimeouts(),p=this.props.nodeRef?void 0:dC.findDOMNode(this);if(!d||Mue.disabled){this.safeSetState({status:s1},function(){l.props.onExited(p)});return}this.props.onExit(p),this.safeSetState({status:z4},function(){l.props.onExiting(p),l.onTransitionEnd(u.exit,function(){l.safeSetState({status:s1},function(){l.props.onExited(p)})})})},i.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},i.safeSetState=function(l,d){d=this.setNextCallback(d),this.setState(l,d)},i.setNextCallback=function(l){var d=this,u=!0;return this.nextCallback=function(p){u&&(u=!1,d.nextCallback=null,l(p))},this.nextCallback.cancel=function(){u=!1},this.nextCallback},i.onTransitionEnd=function(l,d){this.setNextCallback(d);var u=this.props.nodeRef?this.props.nodeRef.current:dC.findDOMNode(this),p=l==null&&!this.props.addEndListener;if(!u||p){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var g=this.props.nodeRef?[this.nextCallback]:[u,this.nextCallback],_=g[0],y=g[1];this.props.addEndListener(_,y)}l!=null&&setTimeout(this.nextCallback,l)},i.render=function(){var l=this.state.status;if(l===NI)return null;var d=this.props,u=d.children;d.in,d.mountOnEnter,d.unmountOnExit,d.appear,d.enter,d.exit,d.timeout,d.addEndListener,d.onEnter,d.onEntering,d.onEntered,d.onExit,d.onExiting,d.onExited,d.nodeRef;var p=cQ(d,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return dn.createElement(x1e.Provider,{value:null},typeof u=="function"?u(l,p):dn.cloneElement(dn.Children.only(u),p))},t}(dn.Component);Mg.contextType=x1e;Mg.propTypes={};function Ab(){}Mg.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ab,onEntering:Ab,onEntered:Ab,onExit:Ab,onExiting:Ab,onExited:Ab};Mg.UNMOUNTED=NI;Mg.EXITED=s1;Mg.ENTERING=sf;Mg.ENTERED=Eg;Mg.EXITING=z4;const tDe=Mg;function nDe(n){return n.code==="Escape"||n.keyCode===27}function iDe(){const n=k.version.split(".");return{major:+n[0],minor:+n[1],patch:+n[2]}}function YR(n){if(!n||typeof n=="function")return null;const{major:t}=iDe();return t>=19?n.props.ref:n.ref}const XR=!!(typeof window<"u"&&window.document&&window.document.createElement);var Oq=!1,Pq=!1;try{var O$={get passive(){return Oq=!0},get once(){return Pq=Oq=!0}};XR&&(window.addEventListener("test",O$,O$),window.removeEventListener("test",O$,!0))}catch{}function A1e(n,t,i,s){if(s&&typeof s!="boolean"&&!Pq){var l=s.once,d=s.capture,u=i;!Pq&&l&&(u=i.__once||function p(g){this.removeEventListener(t,p,d),i.call(this,g)},i.__once=u),n.addEventListener(t,u,Oq?s:d)}n.addEventListener(t,i,s)}function Lq(n,t,i,s){var l=s&&typeof s!="boolean"?s.capture:s;n.removeEventListener(t,i,l),i.__once&&n.removeEventListener(t,i.__once,l)}function m7(n,t,i,s){return A1e(n,t,i,s),function(){Lq(n,t,i,s)}}function rDe(n,t,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=!0),n){var l=document.createEvent("HTMLEvents");l.initEvent(t,i,s),n.dispatchEvent(l)}}function sDe(n){var t=Ag(n,"transitionDuration")||"",i=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*i}function aDe(n,t,i){i===void 0&&(i=5);var s=!1,l=setTimeout(function(){s||rDe(n,"transitionend",!0)},t+i),d=m7(n,"transitionend",function(){s=!0},{once:!0});return function(){clearTimeout(l),d()}}function I1e(n,t,i,s){i==null&&(i=sDe(n)||0);var l=aDe(n,i,s),d=m7(n,"transitionend",t);return function(){l(),d()}}function jue(n,t){const i=Ag(n,t)||"",s=i.indexOf("ms")===-1?1e3:1;return parseFloat(i)*s}function hQ(n,t){const i=jue(n,"transitionDuration"),s=jue(n,"transitionDelay"),l=I1e(n,d=>{d.target===n&&(l(),t(d))},i+s)}function pI(...n){return n.filter(t=>t!=null).reduce((t,i)=>{if(typeof i!="function")throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");return t===null?i:function(...l){t.apply(this,l),i.apply(this,l)}},null)}function N1e(n){n.offsetHeight}const Uue=n=>!n||typeof n=="function"?n:t=>{n.current=t};function oDe(n,t){const i=Uue(n),s=Uue(t);return l=>{i&&i(l),s&&s(l)}}function O1e(n,t){return k.useMemo(()=>oDe(n,t),[n,t])}function lDe(n){return n&&"setState"in n?dC.findDOMNode(n):n??null}const P1e=dn.forwardRef(({onEnter:n,onEntering:t,onEntered:i,onExit:s,onExiting:l,onExited:d,addEndListener:u,children:p,childRef:g,..._},y)=>{const E=k.useRef(null),b=O1e(E,g),A=$=>{b(lDe($))},N=$=>Q=>{$&&E.current&&$(E.current,Q)},O=k.useCallback(N(n),[n]),D=k.useCallback(N(t),[t]),P=k.useCallback(N(i),[i]),j=k.useCallback(N(s),[s]),M=k.useCallback(N(l),[l]),V=k.useCallback(N(d),[d]),H=k.useCallback(N(u),[u]);return h.jsx(tDe,{ref:y,..._,onEnter:O,onEntered:P,onEntering:D,onExit:j,onExited:V,onExiting:M,addEndListener:H,nodeRef:E,children:typeof p=="function"?($,Q)=>p($,{...Q,ref:A}):dn.cloneElement(p,{ref:A})})});P1e.displayName="TransitionWrapper";const fQ=P1e,cDe={height:["marginTop","marginBottom"],width:["marginLeft","marginRight"]};function dDe(n,t){const i=`offset${n[0].toUpperCase()}${n.slice(1)}`,s=t[i],l=cDe[n];return s+parseInt(Ag(t,l[0]),10)+parseInt(Ag(t,l[1]),10)}const uDe={[s1]:"collapse",[z4]:"collapsing",[sf]:"collapsing",[Eg]:"collapse show"},L1e=dn.forwardRef(({onEnter:n,onEntering:t,onEntered:i,onExit:s,onExiting:l,className:d,children:u,dimension:p="height",in:g=!1,timeout:_=300,mountOnEnter:y=!1,unmountOnExit:E=!1,appear:b=!1,getDimensionValue:A=dDe,...N},O)=>{const D=typeof p=="function"?p():p,P=k.useMemo(()=>pI($=>{$.style[D]="0"},n),[D,n]),j=k.useMemo(()=>pI($=>{const Q=`scroll${D[0].toUpperCase()}${D.slice(1)}`;$.style[D]=`${$[Q]}px`},t),[D,t]),M=k.useMemo(()=>pI($=>{$.style[D]=null},i),[D,i]),V=k.useMemo(()=>pI($=>{$.style[D]=`${A(D,$)}px`,N1e($)},s),[s,A,D]),H=k.useMemo(()=>pI($=>{$.style[D]=null},l),[D,l]);return h.jsx(fQ,{ref:O,addEndListener:hQ,...N,"aria-expanded":N.role?g:null,onEnter:P,onEntering:j,onEntered:M,onExit:V,onExiting:H,childRef:YR(u),in:g,timeout:_,mountOnEnter:y,unmountOnExit:E,appear:b,children:($,Q)=>dn.cloneElement(u,{...Q,className:Un(d,u.props.className,uDe[$],D==="width"&&"collapse-horizontal")})})});L1e.displayName="Collapse";const pQ=L1e;function hDe(n){const t=k.useRef(n);return k.useEffect(()=>{t.current=n},[n]),t}function IR(n){const t=hDe(n);return k.useCallback(function(...i){return t.current&&t.current(...i)},[t])}const pU=n=>k.forwardRef((t,i)=>h.jsx("div",{...t,ref:i,className:Un(t.className,n)}));function fDe(n){const t=k.useRef(n);return k.useEffect(()=>{t.current=n},[n]),t}function wg(n){const t=fDe(n);return k.useCallback(function(...i){return t.current&&t.current(...i)},[t])}function pDe(){const n=k.useRef(!0),t=k.useRef(()=>n.current);return k.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),t.current}function mDe(n){const t=k.useRef(null);return k.useEffect(()=>{t.current=n}),t.current}const gDe=typeof Wo<"u"&&Wo.navigator&&Wo.navigator.product==="ReactNative",vDe=typeof document<"u",Fue=vDe||gDe?k.useLayoutEffect:k.useEffect,yDe=["as","disabled"];function _De(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function EDe(n){return!n||n.trim()==="#"}function mQ({tagName:n,disabled:t,href:i,target:s,rel:l,role:d,onClick:u,tabIndex:p=0,type:g}){n||(i!=null||s!=null||l!=null?n="a":n="button");const _={tagName:n};if(n==="button")return[{type:g||"button",disabled:t},_];const y=b=>{if((t||n==="a"&&EDe(i))&&b.preventDefault(),t){b.stopPropagation();return}u==null||u(b)},E=b=>{b.key===" "&&(b.preventDefault(),y(b))};return n==="a"&&(i||(i="#"),t&&(i=void 0)),[{role:d??"button",disabled:void 0,tabIndex:t?void 0:p,href:i,target:n==="a"?s:void 0,"aria-disabled":t||void 0,rel:n==="a"?l:void 0,onClick:y,onKeyDown:E},_]}const D1e=k.forwardRef((n,t)=>{let{as:i,disabled:s}=n,l=_De(n,yDe);const[d,{tagName:u}]=mQ(Object.assign({tagName:i,disabled:s},l));return h.jsx(u,Object.assign({},l,d,{ref:t}))});D1e.displayName="Button";const wDe=["onKeyDown"];function SDe(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function bDe(n){return!n||n.trim()==="#"}const k1e=k.forwardRef((n,t)=>{let{onKeyDown:i}=n,s=SDe(n,wDe);const[l]=mQ(Object.assign({tagName:"a"},s)),d=wg(u=>{l.onKeyDown(u),i==null||i(u)});return bDe(s.href)||s.role==="button"?h.jsx("a",Object.assign({ref:t},s,l,{onKeyDown:d})):h.jsx("a",Object.assign({ref:t},s,{onKeyDown:i}))});k1e.displayName="Anchor";const CDe=k1e,TDe={[sf]:"show",[Eg]:"show"},M1e=k.forwardRef(({className:n,children:t,transitionClasses:i={},onEnter:s,...l},d)=>{const u={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...l},p=k.useCallback((g,_)=>{N1e(g),s==null||s(g,_)},[s]);return h.jsx(fQ,{ref:d,addEndListener:hQ,...u,onEnter:p,childRef:YR(t),children:(g,_)=>k.cloneElement(t,{..._,className:Un("fade",n,t.props.className,TDe[g],i[g])})})});M1e.displayName="Fade";const zO=M1e,RDe={"aria-label":yl.string,onClick:yl.func,variant:yl.oneOf(["white"])},gQ=k.forwardRef(({className:n,variant:t,"aria-label":i="Close",...s},l)=>h.jsx("button",{ref:l,type:"button",className:Un("btn-close",t&&`btn-close-${t}`,n),"aria-label":i,...s}));gQ.displayName="CloseButton";gQ.propTypes=RDe;const xDe=gQ,j1e=k.forwardRef(({as:n,bsPrefix:t,variant:i="primary",size:s,active:l=!1,disabled:d=!1,className:u,...p},g)=>{const _=ii(t,"btn"),[y,{tagName:E}]=mQ({tagName:n,disabled:d,...p}),b=E;return h.jsx(b,{...y,...p,ref:g,disabled:d,className:Un(u,_,l&&"active",i&&`${_}-${i}`,s&&`${_}-${s}`,p.href&&d&&"disabled")})});j1e.displayName="Button";const Pt=j1e,U1e=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-body"),h.jsx(i,{ref:l,className:Un(n,t),...s})));U1e.displayName="CardBody";const F1e=U1e,B1e=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-footer"),h.jsx(i,{ref:l,className:Un(n,t),...s})));B1e.displayName="CardFooter";const ADe=B1e,V1e=k.createContext(null);V1e.displayName="CardHeaderContext";const z1e=V1e,H1e=k.forwardRef(({bsPrefix:n,className:t,as:i="div",...s},l)=>{const d=ii(n,"card-header"),u=k.useMemo(()=>({cardHeaderBsPrefix:d}),[d]);return h.jsx(z1e.Provider,{value:u,children:h.jsx(i,{ref:l,...s,className:Un(t,d)})})});H1e.displayName="CardHeader";const IDe=H1e,G1e=k.forwardRef(({bsPrefix:n,className:t,variant:i,as:s="img",...l},d)=>{const u=ii(n,"card-img");return h.jsx(s,{ref:d,className:Un(i?`${u}-${i}`:u,t),...l})});G1e.displayName="CardImg";const NDe=G1e,W1e=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"card-img-overlay"),h.jsx(i,{ref:l,className:Un(n,t),...s})));W1e.displayName="CardImgOverlay";const ODe=W1e,$1e=k.forwardRef(({className:n,bsPrefix:t,as:i="a",...s},l)=>(t=ii(t,"card-link"),h.jsx(i,{ref:l,className:Un(n,t),...s})));$1e.displayName="CardLink";const PDe=$1e,LDe=pU("h6"),K1e=k.forwardRef(({className:n,bsPrefix:t,as:i=LDe,...s},l)=>(t=ii(t,"card-subtitle"),h.jsx(i,{ref:l,className:Un(n,t),...s})));K1e.displayName="CardSubtitle";const DDe=K1e,q1e=k.forwardRef(({className:n,bsPrefix:t,as:i="p",...s},l)=>(t=ii(t,"card-text"),h.jsx(i,{ref:l,className:Un(n,t),...s})));q1e.displayName="CardText";const kDe=q1e,MDe=pU("h5"),Y1e=k.forwardRef(({className:n,bsPrefix:t,as:i=MDe,...s},l)=>(t=ii(t,"card-title"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Y1e.displayName="CardTitle";const jDe=Y1e,X1e=k.forwardRef(({bsPrefix:n,className:t,bg:i,text:s,border:l,body:d=!1,children:u,as:p="div",...g},_)=>{const y=ii(n,"card");return h.jsx(p,{ref:_,...g,className:Un(t,y,i&&`bg-${i}`,s&&`text-${s}`,l&&`border-${l}`),children:d?h.jsx(F1e,{children:u}):u})});X1e.displayName="Card";const et=Object.assign(X1e,{Img:NDe,Title:jDe,Subtitle:DDe,Body:F1e,Link:PDe,Text:kDe,Header:IDe,Footer:ADe,ImgOverlay:ODe});function UDe(n){const t=k.useRef(n);return t.current=n,t}function FDe(n){const t=UDe(n);k.useEffect(()=>()=>t.current(),[])}function Dq(n,t){let i=0;return k.Children.map(n,s=>k.isValidElement(s)?t(s,i++):s)}function BDe(n,t){let i=0;k.Children.forEach(n,s=>{k.isValidElement(s)&&t(s,i++)})}function VDe(n,t){return k.Children.toArray(n).some(i=>k.isValidElement(i)&&i.type===t)}function J1e({as:n,bsPrefix:t,className:i,...s}){t=ii(t,"col");const l=S1e(),d=b1e(),u=[],p=[];return l.forEach(g=>{const _=s[g];delete s[g];let y,E,b;typeof _=="object"&&_!=null?{span:y,offset:E,order:b}=_:y=_;const A=g!==d?`-${g}`:"";y&&u.push(y===!0?`${t}${A}`:`${t}${A}-${y}`),b!=null&&p.push(`order${A}-${b}`),E!=null&&p.push(`offset${A}-${E}`)}),[{...s,className:Un(i,...u,...p)},{as:n,bsPrefix:t,spans:u}]}const Q1e=k.forwardRef((n,t)=>{const[{className:i,...s},{as:l="div",bsPrefix:d,spans:u}]=J1e(n);return h.jsx(l,{...s,ref:t,className:Un(i,!u.length&&d)})});Q1e.displayName="Col";const Gt=Q1e,Z1e=k.forwardRef(({bsPrefix:n,fluid:t=!1,as:i="div",className:s,...l},d)=>{const u=ii(n,"container"),p=typeof t=="string"?`-${t}`:"-fluid";return h.jsx(i,{ref:d,...l,className:Un(s,t?`${u}${p}`:u)})});Z1e.displayName="Container";const Yn=Z1e;var zDe=Function.prototype.bind.call(Function.prototype.call,[].slice);function y_(n,t){return zDe(n.querySelectorAll(t))}function HDe(n,t,i){const s=k.useRef(n!==void 0),[l,d]=k.useState(t),u=n!==void 0,p=s.current;return s.current=u,!u&&p&&l!==t&&d(t),[u?n:l,k.useCallback((...g)=>{const[_,...y]=g;let E=i==null?void 0:i(_,...y);return d(_),E},[i])]}function GDe(){const[,n]=k.useReducer(t=>t+1,0);return n}function Bue(n,t){if(n.contains)return n.contains(t);if(n.compareDocumentPosition)return n===t||!!(n.compareDocumentPosition(t)&16)}const g7={prefix:String(Math.round(Math.random()*1e10)),current:0},eve=dn.createContext(g7),WDe=dn.createContext(!1);let $De=!!(typeof window<"u"&&window.document&&window.document.createElement),P$=new WeakMap;function KDe(n=!1){let t=k.useContext(eve),i=k.useRef(null);if(i.current===null&&!n){var s,l;let d=(l=dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||l===void 0||(s=l.ReactCurrentOwner)===null||s===void 0?void 0:s.current;if(d){let u=P$.get(d);u==null?P$.set(d,{id:t.current,state:d.memoizedState}):d.memoizedState!==u.state&&(t.current=u.id,P$.delete(d))}i.current=++t.current}return i.current}function qDe(n){let t=k.useContext(eve),i=KDe(!!n),s=`react-aria${t.prefix}`;return n||`${s}-${i}`}function YDe(n){let t=dn.useId(),[i]=k.useState(eke()),s=i?"react-aria":`react-aria${g7.prefix}`;return n||`${s}-${t}`}const XDe=typeof dn.useId=="function"?YDe:qDe;function JDe(){return!1}function QDe(){return!0}function ZDe(n){return()=>{}}function eke(){return typeof dn.useSyncExternalStore=="function"?dn.useSyncExternalStore(ZDe,JDe,QDe):k.useContext(WDe)}const tke=k.createContext(null),H4=(n,t=null)=>n!=null?String(n):t||null,TE=tke,tve=k.createContext(null);tve.displayName="NavContext";const nve=tve,nke="data-rr-ui-",ike="rrUi";function mU(n){return`${nke}${n}`}function rke(n){return`${ike}${n}`}const ive=k.createContext(XR?window:void 0);ive.Provider;function vQ(){return k.useContext(ive)}const ske=typeof Wo<"u"&&Wo.navigator&&Wo.navigator.product==="ReactNative",ake=typeof document<"u",oke=ake||ske?k.useLayoutEffect:k.useEffect,rve=k.createContext(null);rve.displayName="NavbarContext";const HO=rve,lke={type:yl.string,tooltip:yl.bool,as:yl.elementType},yQ=k.forwardRef(({as:n="div",className:t,type:i="valid",tooltip:s=!1,...l},d)=>h.jsx(n,{...l,ref:d,className:Un(t,`${i}-${s?"tooltip":"feedback"}`)}));yQ.displayName="Feedback";yQ.propTypes=lke;const sve=yQ,cke=k.createContext({}),Lg=cke,ave=k.forwardRef(({id:n,bsPrefix:t,className:i,type:s="checkbox",isValid:l=!1,isInvalid:d=!1,as:u="input",...p},g)=>{const{controlId:_}=k.useContext(Lg);return t=ii(t,"form-check-input"),h.jsx(u,{...p,ref:g,type:s,id:n||_,className:Un(i,t,l&&"is-valid",d&&"is-invalid")})});ave.displayName="FormCheckInput";const ove=ave,lve=k.forwardRef(({bsPrefix:n,className:t,htmlFor:i,...s},l)=>{const{controlId:d}=k.useContext(Lg);return n=ii(n,"form-check-label"),h.jsx("label",{...s,ref:l,htmlFor:i||d,className:Un(t,n)})});lve.displayName="FormCheckLabel";const kq=lve,cve=k.forwardRef(({id:n,bsPrefix:t,bsSwitchPrefix:i,inline:s=!1,reverse:l=!1,disabled:d=!1,isValid:u=!1,isInvalid:p=!1,feedbackTooltip:g=!1,feedback:_,feedbackType:y,className:E,style:b,title:A="",type:N="checkbox",label:O,children:D,as:P="input",...j},M)=>{t=ii(t,"form-check"),i=ii(i,"form-switch");const{controlId:V}=k.useContext(Lg),H=k.useMemo(()=>({controlId:n||V}),[V,n]),$=!D&&O!=null&&O!==!1||VDe(D,kq),Q=h.jsx(ove,{...j,type:N==="switch"?"checkbox":N,ref:M,isValid:u,isInvalid:p,disabled:d,as:P});return h.jsx(Lg.Provider,{value:H,children:h.jsx("div",{style:b,className:Un(E,$&&t,s&&`${t}-inline`,l&&`${t}-reverse`,N==="switch"&&i),children:D||h.jsxs(h.Fragment,{children:[Q,$&&h.jsx(kq,{title:A,children:O}),_&&h.jsx(sve,{type:y,tooltip:g,children:_})]})})})});cve.displayName="FormCheck";const v7=Object.assign(cve,{Input:ove,Label:kq}),dve=k.forwardRef(({bsPrefix:n,type:t,size:i,htmlSize:s,id:l,className:d,isValid:u=!1,isInvalid:p=!1,plaintext:g,readOnly:_,as:y="input",...E},b)=>{const{controlId:A}=k.useContext(Lg);return n=ii(n,"form-control"),h.jsx(y,{...E,type:t,size:s,ref:b,readOnly:_,id:l||A,className:Un(d,g?`${n}-plaintext`:n,i&&`${n}-${i}`,t==="color"&&`${n}-color`,u&&"is-valid",p&&"is-invalid")})});dve.displayName="FormControl";const dke=Object.assign(dve,{Feedback:sve}),uve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"form-floating"),h.jsx(i,{ref:l,className:Un(n,t),...s})));uve.displayName="FormFloating";const uke=uve,hve=k.forwardRef(({controlId:n,as:t="div",...i},s)=>{const l=k.useMemo(()=>({controlId:n}),[n]);return h.jsx(Lg.Provider,{value:l,children:h.jsx(t,{...i,ref:s})})});hve.displayName="FormGroup";const fve=hve,pve=k.forwardRef(({as:n="label",bsPrefix:t,column:i=!1,visuallyHidden:s=!1,className:l,htmlFor:d,...u},p)=>{const{controlId:g}=k.useContext(Lg);t=ii(t,"form-label");let _="col-form-label";typeof i=="string"&&(_=`${_} ${_}-${i}`);const y=Un(l,t,s&&"visually-hidden",i&&_);return d=d||g,i?h.jsx(Gt,{ref:p,as:"label",className:y,htmlFor:d,...u}):h.jsx(n,{ref:p,className:y,htmlFor:d,...u})});pve.displayName="FormLabel";const hke=pve,mve=k.forwardRef(({bsPrefix:n,className:t,id:i,...s},l)=>{const{controlId:d}=k.useContext(Lg);return n=ii(n,"form-range"),h.jsx("input",{...s,type:"range",ref:l,className:Un(t,n),id:i||d})});mve.displayName="FormRange";const fke=mve,gve=k.forwardRef(({bsPrefix:n,size:t,htmlSize:i,className:s,isValid:l=!1,isInvalid:d=!1,id:u,...p},g)=>{const{controlId:_}=k.useContext(Lg);return n=ii(n,"form-select"),h.jsx("select",{...p,size:i,ref:g,className:Un(s,n,t&&`${n}-${t}`,l&&"is-valid",d&&"is-invalid"),id:u||_})});gve.displayName="FormSelect";const pke=gve,vve=k.forwardRef(({bsPrefix:n,className:t,as:i="small",muted:s,...l},d)=>(n=ii(n,"form-text"),h.jsx(i,{...l,ref:d,className:Un(t,n,s&&"text-muted")})));vve.displayName="FormText";const mke=vve,yve=k.forwardRef((n,t)=>h.jsx(v7,{...n,ref:t,type:"switch"}));yve.displayName="Switch";const gke=Object.assign(yve,{Input:v7.Input,Label:v7.Label}),_ve=k.forwardRef(({bsPrefix:n,className:t,children:i,controlId:s,label:l,...d},u)=>(n=ii(n,"form-floating"),h.jsxs(fve,{ref:u,className:Un(t,n),controlId:s,...d,children:[i,h.jsx("label",{htmlFor:s,children:l})]})));_ve.displayName="FloatingLabel";const vke=_ve,yke={_ref:yl.any,validated:yl.bool,as:yl.elementType},_Q=k.forwardRef(({className:n,validated:t,as:i="form",...s},l)=>h.jsx(i,{...s,ref:l,className:Un(n,t&&"was-validated")}));_Q.displayName="Form";_Q.propTypes=yke;const kt=Object.assign(_Q,{Group:fve,Control:dke,Floating:uke,Check:v7,Switch:gke,Label:hke,Text:mke,Range:fke,Select:pke,FloatingLabel:vke}),Vue=n=>!n||typeof n=="function"?n:t=>{n.current=t};function _ke(n,t){const i=Vue(n),s=Vue(t);return l=>{i&&i(l),s&&s(l)}}function gU(n,t){return k.useMemo(()=>_ke(n,t),[n,t])}const Eke=k.createContext(null),JR=Eke,wke=["as","active","eventKey"];function Ske(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function Eve({key:n,onClick:t,active:i,id:s,role:l,disabled:d}){const u=k.useContext(TE),p=k.useContext(nve),g=k.useContext(JR);let _=i;const y={role:l};if(p){!l&&p.role==="tablist"&&(y.role="tab");const E=p.getControllerId(n??null),b=p.getControlledId(n??null);y[mU("event-key")]=n,y.id=E||s,_=i==null&&n!=null?p.activeKey===n:i,(_||!(g!=null&&g.unmountOnExit)&&!(g!=null&&g.mountOnEnter))&&(y["aria-controls"]=b)}return y.role==="tab"&&(y["aria-selected"]=_,_||(y.tabIndex=-1),d&&(y.tabIndex=-1,y["aria-disabled"]=!0)),y.onClick=wg(E=>{d||(t==null||t(E),n!=null&&u&&!E.isPropagationStopped()&&u(n,E))}),[y,{isActive:_}]}const wve=k.forwardRef((n,t)=>{let{as:i=D1e,active:s,eventKey:l}=n,d=Ske(n,wke);const[u,p]=Eve(Object.assign({key:H4(l,d.href),active:s},d));return u[mU("active")]=p.isActive,h.jsx(i,Object.assign({},d,u,{ref:t}))});wve.displayName="NavItem";const bke=wve,Cke=["as","onSelect","activeKey","role","onKeyDown"];function Tke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}const zue=()=>{},Hue=mU("event-key"),Sve=k.forwardRef((n,t)=>{let{as:i="div",onSelect:s,activeKey:l,role:d,onKeyDown:u}=n,p=Tke(n,Cke);const g=GDe(),_=k.useRef(!1),y=k.useContext(TE),E=k.useContext(JR);let b,A;E&&(d=d||"tablist",l=E.activeKey,b=E.getControlledId,A=E.getControllerId);const N=k.useRef(null),O=M=>{const V=N.current;if(!V)return null;const H=y_(V,`[${Hue}]:not([aria-disabled=true])`),$=V.querySelector("[aria-selected=true]");if(!$||$!==document.activeElement)return null;const Q=H.indexOf($);if(Q===-1)return null;let Y=Q+M;return Y>=H.length&&(Y=0),Y<0&&(Y=H.length-1),H[Y]},D=(M,V)=>{M!=null&&(s==null||s(M,V),y==null||y(M,V))},P=M=>{if(u==null||u(M),!E)return;let V;switch(M.key){case"ArrowLeft":case"ArrowUp":V=O(-1);break;case"ArrowRight":case"ArrowDown":V=O(1);break;default:return}V&&(M.preventDefault(),D(V.dataset[rke("EventKey")]||null,M),_.current=!0,g())};k.useEffect(()=>{if(N.current&&_.current){const M=N.current.querySelector(`[${Hue}][aria-selected=true]`);M==null||M.focus()}_.current=!1});const j=gU(t,N);return h.jsx(TE.Provider,{value:D,children:h.jsx(nve.Provider,{value:{role:d,activeKey:H4(l),getControlledId:b||zue,getControllerId:A||zue},children:h.jsx(i,Object.assign({},p,{onKeyDown:P,ref:j,role:d}))})})});Sve.displayName="Nav";const Rke=Object.assign(Sve,{Item:bke});var Ek;function G4(n){if((!Ek&&Ek!==0||n)&&XR){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),Ek=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Ek}function xke(){return k.useState(null)}function L$(n){n===void 0&&(n=fU());try{var t=n.activeElement;return!t||!t.nodeName?null:t}catch{return n.body}}function Ake(n){const t=k.useRef(n);return t.current=n,t}function Ike(n){const t=Ake(n);k.useEffect(()=>()=>t.current(),[])}function Nke(n=document){const t=n.defaultView;return Math.abs(t.innerWidth-n.documentElement.clientWidth)}const Gue=mU("modal-open");class Oke{constructor({ownerDocument:t,handleContainerOverflow:i=!0,isRTL:s=!1}={}){this.handleContainerOverflow=i,this.isRTL=s,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return Nke(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const i={overflow:"hidden"},s=this.isRTL?"paddingLeft":"paddingRight",l=this.getElement();t.style={overflow:l.style.overflow,[s]:l.style[s]},t.scrollBarWidth&&(i[s]=`${parseInt(Ag(l,s)||"0",10)+t.scrollBarWidth}px`),l.setAttribute(Gue,""),Ag(l,i)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const i=this.getElement();i.removeAttribute(Gue),Object.assign(i.style,t.style)}add(t){let i=this.modals.indexOf(t);return i!==-1||(i=this.modals.length,this.modals.push(t),this.setModalAttributes(t),i!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),i}remove(t){const i=this.modals.indexOf(t);i!==-1&&(this.modals.splice(i,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const EQ=Oke,D$=(n,t)=>XR?n==null?(t||fU()).body:(typeof n=="function"&&(n=n()),n&&"current"in n&&(n=n.current),n&&("nodeType"in n||n.getBoundingClientRect)?n:null):null;function Pke(n,t){const i=vQ(),[s,l]=k.useState(()=>D$(n,i==null?void 0:i.document));if(!s){const d=D$(n);d&&l(d)}return k.useEffect(()=>{t&&s&&t(s)},[t,s]),k.useEffect(()=>{const d=D$(n);d!==s&&l(d)},[n,s]),s}function wQ({children:n,in:t,onExited:i,mountOnEnter:s,unmountOnExit:l}){const d=k.useRef(null),u=k.useRef(t),p=wg(i);k.useEffect(()=>{t?u.current=!0:p(d.current)},[t,p]);const g=gU(d,YR(n)),_=k.cloneElement(n,{ref:g});return t?_:l||!u.current&&s?null:_}const Lke=["onEnter","onEntering","onEntered","onExit","onExiting","onExited","addEndListener","children"];function Dke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function kke(n){let{onEnter:t,onEntering:i,onEntered:s,onExit:l,onExiting:d,onExited:u,addEndListener:p,children:g}=n,_=Dke(n,Lke);const y=k.useRef(null),E=gU(y,YR(g)),b=V=>H=>{V&&y.current&&V(y.current,H)},A=k.useCallback(b(t),[t]),N=k.useCallback(b(i),[i]),O=k.useCallback(b(s),[s]),D=k.useCallback(b(l),[l]),P=k.useCallback(b(d),[d]),j=k.useCallback(b(u),[u]),M=k.useCallback(b(p),[p]);return Object.assign({},_,{nodeRef:y},t&&{onEnter:A},i&&{onEntering:N},s&&{onEntered:O},l&&{onExit:D},d&&{onExiting:P},u&&{onExited:j},p&&{addEndListener:M},{children:typeof g=="function"?(V,H)=>g(V,Object.assign({},H,{ref:E})):k.cloneElement(g,{ref:E})})}const Mke=["component"];function jke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}const Uke=k.forwardRef((n,t)=>{let{component:i}=n,s=jke(n,Mke);const l=kke(s);return h.jsx(i,Object.assign({ref:t},l))}),Fke=Uke;function Bke({in:n,onTransition:t}){const i=k.useRef(null),s=k.useRef(!0),l=wg(t);return Fue(()=>{if(!i.current)return;let d=!1;return l({in:n,element:i.current,initial:s.current,isStale:()=>d}),()=>{d=!0}},[n,l]),Fue(()=>(s.current=!1,()=>{s.current=!0}),[]),i}function Vke({children:n,in:t,onExited:i,onEntered:s,transition:l}){const[d,u]=k.useState(!t);t&&d&&u(!1);const p=Bke({in:!!t,onTransition:_=>{const y=()=>{_.isStale()||(_.in?s==null||s(_.element,_.initial):(u(!0),i==null||i(_.element)))};Promise.resolve(l(_)).then(y,E=>{throw _.in||u(!0),E})}}),g=gU(p,YR(n));return d&&!t?null:k.cloneElement(n,{ref:g})}function Wue(n,t,i){return n?h.jsx(Fke,Object.assign({},i,{component:n})):t?h.jsx(Vke,Object.assign({},i,{transition:t})):h.jsx(wQ,Object.assign({},i))}const zke=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Hke(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}let k$;function Gke(n){return k$||(k$=new EQ({ownerDocument:n==null?void 0:n.document})),k$}function Wke(n){const t=vQ(),i=n||Gke(t),s=k.useRef({dialog:null,backdrop:null});return Object.assign(s.current,{add:()=>i.add(s.current),remove:()=>i.remove(s.current),isTopModal:()=>i.isTopModal(s.current),setDialogRef:k.useCallback(l=>{s.current.dialog=l},[]),setBackdropRef:k.useCallback(l=>{s.current.backdrop=l},[])})}const bve=k.forwardRef((n,t)=>{let{show:i=!1,role:s="dialog",className:l,style:d,children:u,backdrop:p=!0,keyboard:g=!0,onBackdropClick:_,onEscapeKeyDown:y,transition:E,runTransition:b,backdropTransition:A,runBackdropTransition:N,autoFocus:O=!0,enforceFocus:D=!0,restoreFocus:P=!0,restoreFocusOptions:j,renderDialog:M,renderBackdrop:V=Ht=>h.jsx("div",Object.assign({},Ht)),manager:H,container:$,onShow:Q,onHide:Y=()=>{},onExit:le,onExited:ae,onExiting:te,onEnter:de,onEntering:G,onEntered:ie}=n,_e=Hke(n,zke);const he=vQ(),Ce=Pke($),fe=Wke(H),me=pDe(),Ne=mDe(i),[Fe,je]=k.useState(!i),Ve=k.useRef(null);k.useImperativeHandle(t,()=>fe,[fe]),XR&&!Ne&&i&&(Ve.current=L$(he==null?void 0:he.document)),i&&Fe&&je(!1);const Re=wg(()=>{if(fe.add(),pt.current=m7(document,"keydown",Ge),rt.current=m7(document,"focus",()=>setTimeout(Xe),!0),Q&&Q(),O){var Ht,gn;const It=L$((Ht=(gn=fe.dialog)==null?void 0:gn.ownerDocument)!=null?Ht:he==null?void 0:he.document);fe.dialog&&It&&!Bue(fe.dialog,It)&&(Ve.current=It,fe.dialog.focus())}}),Be=wg(()=>{if(fe.remove(),pt.current==null||pt.current(),rt.current==null||rt.current(),P){var Ht;(Ht=Ve.current)==null||Ht.focus==null||Ht.focus(j),Ve.current=null}});k.useEffect(()=>{!i||!Ce||Re()},[i,Ce,Re]),k.useEffect(()=>{Fe&&Be()},[Fe,Be]),Ike(()=>{Be()});const Xe=wg(()=>{if(!D||!me()||!fe.isTopModal())return;const Ht=L$(he==null?void 0:he.document);fe.dialog&&Ht&&!Bue(fe.dialog,Ht)&&fe.dialog.focus()}),we=wg(Ht=>{Ht.target===Ht.currentTarget&&(_==null||_(Ht),p===!0&&Y())}),Ge=wg(Ht=>{g&&nDe(Ht)&&fe.isTopModal()&&(y==null||y(Ht),Ht.defaultPrevented||Y())}),rt=k.useRef(),pt=k.useRef(),Ze=(...Ht)=>{je(!0),ae==null||ae(...Ht)};if(!Ce)return null;const Je=Object.assign({role:s,ref:fe.setDialogRef,"aria-modal":s==="dialog"?!0:void 0},_e,{style:d,className:l,tabIndex:-1});let _t=M?M(Je):h.jsx("div",Object.assign({},Je,{children:k.cloneElement(u,{role:"document"})}));_t=Wue(E,b,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!i,onExit:le,onExiting:te,onExited:Ze,onEnter:de,onEntering:G,onEntered:ie,children:_t});let Xt=null;return p&&(Xt=V({ref:fe.setBackdropRef,onClick:we}),Xt=Wue(A,N,{in:!!i,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Xt})),h.jsx(h.Fragment,{children:dC.createPortal(h.jsxs(h.Fragment,{children:[Xt,_t]}),Ce)})});bve.displayName="Modal";const Cve=Object.assign(bve,{Manager:EQ});function $ke(n,t){return n.classList?!!t&&n.classList.contains(t):(" "+(n.className.baseVal||n.className)+" ").indexOf(" "+t+" ")!==-1}function Kke(n,t){n.classList?n.classList.add(t):$ke(n,t)||(typeof n.className=="string"?n.className=n.className+" "+t:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+t))}function $ue(n,t){return n.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function qke(n,t){n.classList?n.classList.remove(t):typeof n.className=="string"?n.className=$ue(n.className,t):n.setAttribute("class",$ue(n.className&&n.className.baseVal||"",t))}const Ib={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Tve extends EQ{adjustAndStore(t,i,s){const l=i.style[t];i.dataset[t]=l,Ag(i,{[t]:`${parseFloat(Ag(i,t))+s}px`})}restore(t,i){const s=i.dataset[t];s!==void 0&&(delete i.dataset[t],Ag(i,{[t]:s}))}setContainerStyle(t){super.setContainerStyle(t);const i=this.getElement();if(Kke(i,"modal-open"),!t.scrollBarWidth)return;const s=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";y_(i,Ib.FIXED_CONTENT).forEach(d=>this.adjustAndStore(s,d,t.scrollBarWidth)),y_(i,Ib.STICKY_CONTENT).forEach(d=>this.adjustAndStore(l,d,-t.scrollBarWidth)),y_(i,Ib.NAVBAR_TOGGLER).forEach(d=>this.adjustAndStore(l,d,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const i=this.getElement();qke(i,"modal-open");const s=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";y_(i,Ib.FIXED_CONTENT).forEach(d=>this.restore(s,d)),y_(i,Ib.STICKY_CONTENT).forEach(d=>this.restore(l,d)),y_(i,Ib.NAVBAR_TOGGLER).forEach(d=>this.restore(l,d))}}let M$;function Rve(n){return M$||(M$=new Tve(n)),M$}const xve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"modal-body"),h.jsx(i,{ref:l,className:Un(n,t),...s})));xve.displayName="ModalBody";const Yke=xve,Xke=k.createContext({onHide(){}}),SQ=Xke,Ave=k.forwardRef(({bsPrefix:n,className:t,contentClassName:i,centered:s,size:l,fullscreen:d,children:u,scrollable:p,...g},_)=>{n=ii(n,"modal");const y=`${n}-dialog`,E=typeof d=="string"?`${n}-fullscreen-${d}`:`${n}-fullscreen`;return h.jsx("div",{...g,ref:_,className:Un(y,t,l&&`${n}-${l}`,s&&`${y}-centered`,p&&`${y}-scrollable`,d&&E),children:h.jsx("div",{className:Un(`${n}-content`,i),children:u})})});Ave.displayName="ModalDialog";const Ive=Ave,Nve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"modal-footer"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Nve.displayName="ModalFooter";const Jke=Nve,Ove=k.forwardRef(({closeLabel:n="Close",closeVariant:t,closeButton:i=!1,onHide:s,children:l,...d},u)=>{const p=k.useContext(SQ),g=IR(()=>{p==null||p.onHide(),s==null||s()});return h.jsxs("div",{ref:u,...d,children:[l,i&&h.jsx(xDe,{"aria-label":n,variant:t,onClick:g})]})});Ove.displayName="AbstractModalHeader";const Pve=Ove,Lve=k.forwardRef(({bsPrefix:n,className:t,closeLabel:i="Close",closeButton:s=!1,...l},d)=>(n=ii(n,"modal-header"),h.jsx(Pve,{ref:d,...l,className:Un(t,n),closeLabel:i,closeButton:s})));Lve.displayName="ModalHeader";const Qke=Lve,Zke=pU("h4"),Dve=k.forwardRef(({className:n,bsPrefix:t,as:i=Zke,...s},l)=>(t=ii(t,"modal-title"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Dve.displayName="ModalTitle";const eMe=Dve;function tMe(n){return h.jsx(zO,{...n,timeout:null})}function nMe(n){return h.jsx(zO,{...n,timeout:null})}const kve=k.forwardRef(({bsPrefix:n,className:t,style:i,dialogClassName:s,contentClassName:l,children:d,dialogAs:u=Ive,"data-bs-theme":p,"aria-labelledby":g,"aria-describedby":_,"aria-label":y,show:E=!1,animation:b=!0,backdrop:A=!0,keyboard:N=!0,onEscapeKeyDown:O,onShow:D,onHide:P,container:j,autoFocus:M=!0,enforceFocus:V=!0,restoreFocus:H=!0,restoreFocusOptions:$,onEntered:Q,onExit:Y,onExiting:le,onEnter:ae,onEntering:te,onExited:de,backdropClassName:G,manager:ie,..._e},he)=>{const[Ce,fe]=k.useState({}),[me,Ne]=k.useState(!1),Fe=k.useRef(!1),je=k.useRef(!1),Ve=k.useRef(null),[Re,Be]=xke(),Xe=O1e(he,Be),we=IR(P),Ge=z8e();n=ii(n,"modal");const rt=k.useMemo(()=>({onHide:we}),[we]);function pt(){return ie||Rve({isRTL:Ge})}function Ze(Lt){if(!XR)return;const tn=pt().getScrollbarWidth()>0,un=Lt.scrollHeight>fU(Lt).documentElement.clientHeight;fe({paddingRight:tn&&!un?G4():void 0,paddingLeft:!tn&&un?G4():void 0})}const Je=IR(()=>{Re&&Ze(Re.dialog)});FDe(()=>{Lq(window,"resize",Je),Ve.current==null||Ve.current()});const _t=()=>{Fe.current=!0},Xt=Lt=>{Fe.current&&Re&&Lt.target===Re.dialog&&(je.current=!0),Fe.current=!1},Ht=()=>{Ne(!0),Ve.current=I1e(Re.dialog,()=>{Ne(!1)})},gn=Lt=>{Lt.target===Lt.currentTarget&&Ht()},It=Lt=>{if(A==="static"){gn(Lt);return}if(je.current||Lt.target!==Lt.currentTarget){je.current=!1;return}P==null||P()},xt=Lt=>{N?O==null||O(Lt):(Lt.preventDefault(),A==="static"&&Ht())},mt=(Lt,tn)=>{Lt&&Ze(Lt),ae==null||ae(Lt,tn)},dt=Lt=>{Ve.current==null||Ve.current(),Y==null||Y(Lt)},it=(Lt,tn)=>{te==null||te(Lt,tn),A1e(window,"resize",Je)},Me=Lt=>{Lt&&(Lt.style.display=""),de==null||de(Lt),Lq(window,"resize",Je)},We=k.useCallback(Lt=>h.jsx("div",{...Lt,className:Un(`${n}-backdrop`,G,!b&&"show")}),[b,G,n]),bt={...i,...Ce};bt.display="block";const St=Lt=>h.jsx("div",{role:"dialog",...Lt,style:bt,className:Un(t,n,me&&`${n}-static`,!b&&"show"),onClick:A?It:void 0,onMouseUp:Xt,"data-bs-theme":p,"aria-label":y,"aria-labelledby":g,"aria-describedby":_,children:h.jsx(u,{..._e,onMouseDown:_t,className:s,contentClassName:l,children:d})});return h.jsx(SQ.Provider,{value:rt,children:h.jsx(Cve,{show:E,ref:Xe,backdrop:A,container:j,keyboard:!0,autoFocus:M,enforceFocus:V,restoreFocus:H,restoreFocusOptions:$,onEscapeKeyDown:xt,onShow:D,onHide:P,onEnter:mt,onEntering:it,onEntered:Q,onExit:dt,onExiting:le,onExited:Me,manager:pt(),transition:b?tMe:void 0,backdropTransition:b?nMe:void 0,renderBackdrop:We,renderDialog:St})})});kve.displayName="Modal";const vn=Object.assign(kve,{Body:Yke,Header:Qke,Title:eMe,Footer:Jke,Dialog:Ive,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),Mve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"nav-item"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Mve.displayName="NavItem";const jve=Mve,Uve=k.forwardRef(({bsPrefix:n,className:t,as:i=CDe,active:s,eventKey:l,disabled:d=!1,...u},p)=>{n=ii(n,"nav-link");const[g,_]=Eve({key:H4(l,u.href),active:s,disabled:d,...u});return h.jsx(i,{...u,...g,ref:p,disabled:d,className:Un(t,n,d&&"disabled",_.isActive&&"active")})});Uve.displayName="NavLink";const Fve=Uve,Bve=k.forwardRef((n,t)=>{const{as:i="div",bsPrefix:s,variant:l,fill:d=!1,justify:u=!1,navbar:p,navbarScroll:g,className:_,activeKey:y,...E}=dQ(n,{activeKey:"onSelect"}),b=ii(s,"nav");let A,N,O=!1;const D=k.useContext(HO),P=k.useContext(z1e);return D?(A=D.bsPrefix,O=p??!0):P&&({cardHeaderBsPrefix:N}=P),h.jsx(Rke,{as:i,ref:t,activeKey:y,className:Un(_,{[b]:!O,[`${A}-nav`]:O,[`${A}-nav-scroll`]:O&&g,[`${N}-${l}`]:!!N,[`${b}-${l}`]:!!l,[`${b}-fill`]:d,[`${b}-justified`]:u}),...E})});Bve.displayName="Nav";const jn=Object.assign(Bve,{Item:jve,Link:Fve}),Vve=k.forwardRef(({bsPrefix:n,className:t,as:i,...s},l)=>{n=ii(n,"navbar-brand");const d=i||(s.href?"a":"span");return h.jsx(d,{...s,ref:l,className:Un(t,n)})});Vve.displayName="NavbarBrand";const iMe=Vve,zve=k.forwardRef(({children:n,bsPrefix:t,...i},s)=>{t=ii(t,"navbar-collapse");const l=k.useContext(HO);return h.jsx(pQ,{in:!!(l&&l.expanded),...i,children:h.jsx("div",{ref:s,className:t,children:n})})});zve.displayName="NavbarCollapse";const rMe=zve,Hve=k.forwardRef(({bsPrefix:n,className:t,children:i,label:s="Toggle navigation",as:l="button",onClick:d,...u},p)=>{n=ii(n,"navbar-toggler");const{onToggle:g,expanded:_}=k.useContext(HO)||{},y=IR(E=>{d&&d(E),g&&g()});return l==="button"&&(u.type="button"),h.jsx(l,{...u,ref:p,onClick:y,"aria-label":s,className:Un(t,n,!_&&"collapsed"),children:i||h.jsx("span",{className:`${n}-icon`})})});Hve.displayName="NavbarToggle";const sMe=Hve,Mq=new WeakMap,Kue=(n,t)=>{if(!n||!t)return;const i=Mq.get(t)||new Map;Mq.set(t,i);let s=i.get(n);return s||(s=t.matchMedia(n),s.refCount=0,i.set(s.media,s)),s};function aMe(n,t=typeof window>"u"?void 0:window){const i=Kue(n,t),[s,l]=k.useState(()=>i?i.matches:!1);return oke(()=>{let d=Kue(n,t);if(!d)return l(!1);let u=Mq.get(t);const p=()=>{l(d.matches)};return d.refCount++,d.addListener(p),p(),()=>{d.removeListener(p),d.refCount--,d.refCount<=0&&(u==null||u.delete(d.media)),d=void 0}},[n]),s}function oMe(n){const t=Object.keys(n);function i(p,g){return p===g?g:p?`${p} and ${g}`:g}function s(p){return t[Math.min(t.indexOf(p)+1,t.length-1)]}function l(p){const g=s(p);let _=n[g];return typeof _=="number"?_=`${_-.2}px`:_=`calc(${_} - 0.2px)`,`(max-width: ${_})`}function d(p){let g=n[p];return typeof g=="number"&&(g=`${g}px`),`(min-width: ${g})`}function u(p,g,_){let y;typeof p=="object"?(y=p,_=g,g=!0):(g=g||!0,y={[p]:g});let E=k.useMemo(()=>Object.entries(y).reduce((b,[A,N])=>((N==="up"||N===!0)&&(b=i(b,d(A))),(N==="down"||N===!0)&&(b=i(b,l(A))),b),""),[JSON.stringify(y)]);return aMe(E,_)}return u}const lMe=oMe({xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400}),Gve=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"offcanvas-body"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Gve.displayName="OffcanvasBody";const cMe=Gve,dMe={[sf]:"show",[Eg]:"show"},Wve=k.forwardRef(({bsPrefix:n,className:t,children:i,in:s=!1,mountOnEnter:l=!1,unmountOnExit:d=!1,appear:u=!1,...p},g)=>(n=ii(n,"offcanvas"),h.jsx(fQ,{ref:g,addEndListener:hQ,in:s,mountOnEnter:l,unmountOnExit:d,appear:u,...p,childRef:YR(i),children:(_,y)=>k.cloneElement(i,{...y,className:Un(t,i.props.className,(_===sf||_===z4)&&`${n}-toggling`,dMe[_])})})));Wve.displayName="OffcanvasToggling";const uMe=Wve,$ve=k.forwardRef(({bsPrefix:n,className:t,closeLabel:i="Close",closeButton:s=!1,...l},d)=>(n=ii(n,"offcanvas-header"),h.jsx(Pve,{ref:d,...l,className:Un(t,n),closeLabel:i,closeButton:s})));$ve.displayName="OffcanvasHeader";const hMe=$ve,fMe=pU("h5"),Kve=k.forwardRef(({className:n,bsPrefix:t,as:i=fMe,...s},l)=>(t=ii(t,"offcanvas-title"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Kve.displayName="OffcanvasTitle";const pMe=Kve;function mMe(n){return h.jsx(uMe,{...n})}function gMe(n){return h.jsx(zO,{...n})}const qve=k.forwardRef(({bsPrefix:n,className:t,children:i,"aria-labelledby":s,placement:l="start",responsive:d,show:u=!1,backdrop:p=!0,keyboard:g=!0,scroll:_=!1,onEscapeKeyDown:y,onShow:E,onHide:b,container:A,autoFocus:N=!0,enforceFocus:O=!0,restoreFocus:D=!0,restoreFocusOptions:P,onEntered:j,onExit:M,onExiting:V,onEnter:H,onEntering:$,onExited:Q,backdropClassName:Y,manager:le,renderStaticNode:ae=!1,...te},de)=>{const G=k.useRef();n=ii(n,"offcanvas");const[ie,_e]=k.useState(!1),he=IR(b),Ce=lMe(d||"xs","up");k.useEffect(()=>{_e(d?u&&!Ce:u)},[u,d,Ce]);const fe=k.useMemo(()=>({onHide:he}),[he]);function me(){return le||(_?(G.current||(G.current=new Tve({handleContainerOverflow:!1})),G.current):Rve())}const Ne=(Re,...Be)=>{Re&&(Re.style.visibility="visible"),H==null||H(Re,...Be)},Fe=(Re,...Be)=>{Re&&(Re.style.visibility=""),Q==null||Q(...Be)},je=k.useCallback(Re=>h.jsx("div",{...Re,className:Un(`${n}-backdrop`,Y)}),[Y,n]),Ve=Re=>h.jsx("div",{...Re,...te,className:Un(t,d?`${n}-${d}`:n,`${n}-${l}`),"aria-labelledby":s,children:i});return h.jsxs(h.Fragment,{children:[!ie&&(d||ae)&&Ve({}),h.jsx(SQ.Provider,{value:fe,children:h.jsx(Cve,{show:ie,ref:de,backdrop:p,container:A,keyboard:g,autoFocus:N,enforceFocus:O&&!_,restoreFocus:D,restoreFocusOptions:P,onEscapeKeyDown:y,onShow:E,onHide:he,onEnter:Ne,onEntering:$,onEntered:j,onExit:M,onExiting:V,onExited:Fe,manager:me(),transition:mMe,backdropTransition:gMe,renderBackdrop:je,renderDialog:Ve})})]})});qve.displayName="Offcanvas";const OI=Object.assign(qve,{Body:cMe,Header:hMe,Title:pMe}),Yve=k.forwardRef(({onHide:n,...t},i)=>{const s=k.useContext(HO),l=IR(()=>{s==null||s.onToggle==null||s.onToggle(),n==null||n()});return h.jsx(OI,{ref:i,show:!!(s!=null&&s.expanded),...t,renderStaticNode:!0,onHide:l})});Yve.displayName="NavbarOffcanvas";const vMe=Yve,Xve=k.forwardRef(({className:n,bsPrefix:t,as:i="span",...s},l)=>(t=ii(t,"navbar-text"),h.jsx(i,{ref:l,className:Un(n,t),...s})));Xve.displayName="NavbarText";const yMe=Xve,Jve=k.forwardRef((n,t)=>{const{bsPrefix:i,expand:s=!0,variant:l="light",bg:d,fixed:u,sticky:p,className:g,as:_="nav",expanded:y,onToggle:E,onSelect:b,collapseOnSelect:A=!1,...N}=dQ(n,{expanded:"onToggle"}),O=ii(i,"navbar"),D=k.useCallback((...M)=>{b==null||b(...M),A&&y&&(E==null||E(!1))},[b,A,y,E]);N.role===void 0&&_!=="nav"&&(N.role="navigation");let P=`${O}-expand`;typeof s=="string"&&(P=`${P}-${s}`);const j=k.useMemo(()=>({onToggle:()=>E==null?void 0:E(!y),bsPrefix:O,expanded:!!y,expand:s}),[O,y,s,E]);return h.jsx(HO.Provider,{value:j,children:h.jsx(TE.Provider,{value:D,children:h.jsx(_,{ref:t,...N,className:Un(g,O,s&&P,l&&`${O}-${l}`,d&&`bg-${d}`,p&&`sticky-${p}`,u&&`fixed-${u}`)})})})});Jve.displayName="Navbar";const Qve=Object.assign(Jve,{Brand:iMe,Collapse:rMe,Offcanvas:vMe,Text:yMe,Toggle:sMe});function Zve({animation:n,bg:t,bsPrefix:i,size:s,...l}){i=ii(i,"placeholder");const[{className:d,...u}]=J1e(l);return{...u,className:Un(d,n?`${i}-${n}`:i,s&&`${i}-${s}`,t&&`bg-${t}`)}}const eye=k.forwardRef((n,t)=>{const i=Zve(n);return h.jsx(Pt,{...i,ref:t,disabled:!0,tabIndex:-1})});eye.displayName="PlaceholderButton";const _Me=eye,tye=k.forwardRef(({as:n="span",...t},i)=>{const s=Zve(t);return h.jsx(n,{...s,ref:i})});tye.displayName="Placeholder";const cn=Object.assign(tye,{Button:_Me}),que=1e3;function EMe(n,t,i){const s=(n-t)/(i-t)*100;return Math.round(s*que)/que}function Yue({min:n,now:t,max:i,label:s,visuallyHidden:l,striped:d,animated:u,className:p,style:g,variant:_,bsPrefix:y,...E},b){return h.jsx("div",{ref:b,...E,role:"progressbar",className:Un(p,`${y}-bar`,{[`bg-${_}`]:_,[`${y}-bar-animated`]:u,[`${y}-bar-striped`]:u||d}),style:{width:`${EMe(t,n,i)}%`,...g},"aria-valuenow":t,"aria-valuemin":n,"aria-valuemax":i,children:l?h.jsx("span",{className:"visually-hidden",children:s}):s})}const nye=k.forwardRef(({isChild:n=!1,...t},i)=>{const s={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...t};if(s.bsPrefix=ii(s.bsPrefix,"progress"),n)return Yue(s,i);const{min:l,now:d,max:u,label:p,visuallyHidden:g,striped:_,animated:y,bsPrefix:E,variant:b,className:A,children:N,...O}=s;return h.jsx("div",{ref:i,...O,className:Un(A,E),children:N?Dq(N,D=>k.cloneElement(D,{isChild:!0})):Yue({min:l,now:d,max:u,label:p,visuallyHidden:g,striped:_,animated:y,bsPrefix:E,variant:b},i)})});nye.displayName="ProgressBar";const bQ=nye;function wMe(n){return n<=0?"100%":n<1?`${n*100}%`:`${n}%`}const iye=k.forwardRef(({bsPrefix:n,className:t,children:i,aspectRatio:s="1x1",style:l,...d},u)=>{n=ii(n,"ratio");const p=typeof s=="number";return h.jsx("div",{ref:u,...d,style:{...l,...p&&{"--bs-aspect-ratio":wMe(s)}},className:Un(n,t,!p&&`${n}-${s}`),children:k.Children.only(i)})});iye.displayName="Ratio";const Jd=iye,rye=k.forwardRef(({bsPrefix:n,className:t,as:i="div",...s},l)=>{const d=ii(n,"row"),u=S1e(),p=b1e(),g=`${d}-cols`,_=[];return u.forEach(y=>{const E=s[y];delete s[y];let b;E!=null&&typeof E=="object"?{cols:b}=E:b=E;const A=y!==p?`-${y}`:"";b!=null&&_.push(`${g}${A}-${b}`)}),h.jsx(i,{ref:l,...s,className:Un(t,d,..._)})});rye.displayName="Row";const fn=rye,sye=k.forwardRef(({bsPrefix:n,variant:t,animation:i="border",size:s,as:l="div",className:d,...u},p)=>{n=ii(n,"spinner");const g=`${n}-${i}`;return h.jsx(l,{ref:p,...u,className:Un(d,g,s&&`${g}-${s}`,t&&`text-${t}`)})});sye.displayName="Spinner";const Ji=sye,SMe=["active","eventKey","mountOnEnter","transition","unmountOnExit","role","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],bMe=["activeKey","getControlledId","getControllerId"],CMe=["as"];function jq(n,t){if(n==null)return{};var i={};for(var s in n)if({}.hasOwnProperty.call(n,s)){if(t.indexOf(s)>=0)continue;i[s]=n[s]}return i}function aye(n){let{active:t,eventKey:i,mountOnEnter:s,transition:l,unmountOnExit:d,role:u="tabpanel",onEnter:p,onEntering:g,onEntered:_,onExit:y,onExiting:E,onExited:b}=n,A=jq(n,SMe);const N=k.useContext(JR);if(!N)return[Object.assign({},A,{role:u}),{eventKey:i,isActive:t,mountOnEnter:s,transition:l,unmountOnExit:d,onEnter:p,onEntering:g,onEntered:_,onExit:y,onExiting:E,onExited:b}];const{activeKey:O,getControlledId:D,getControllerId:P}=N,j=jq(N,bMe),M=H4(i);return[Object.assign({},A,{role:u,id:D(i),"aria-labelledby":P(i)}),{eventKey:i,isActive:t==null&&M!=null?H4(O)===M:t,transition:l||j.transition,mountOnEnter:s??j.mountOnEnter,unmountOnExit:d??j.unmountOnExit,onEnter:p,onEntering:g,onEntered:_,onExit:y,onExiting:E,onExited:b}]}const oye=k.forwardRef((n,t)=>{let{as:i="div"}=n,s=jq(n,CMe);const[l,{isActive:d,onEnter:u,onEntering:p,onEntered:g,onExit:_,onExiting:y,onExited:E,mountOnEnter:b,unmountOnExit:A,transition:N=wQ}]=aye(s);return h.jsx(JR.Provider,{value:null,children:h.jsx(TE.Provider,{value:null,children:h.jsx(N,{in:d,onEnter:u,onEntering:p,onEntered:g,onExit:_,onExiting:y,onExited:E,mountOnEnter:b,unmountOnExit:A,children:h.jsx(i,Object.assign({},l,{ref:t,hidden:!d,"aria-hidden":!d}))})})})});oye.displayName="TabPanel";const lye=n=>{const{id:t,generateChildId:i,onSelect:s,activeKey:l,defaultActiveKey:d,transition:u,mountOnEnter:p,unmountOnExit:g,children:_}=n,[y,E]=HDe(l,d,s),b=XDe(t),A=k.useMemo(()=>i||((O,D)=>b?`${b}-${D}-${O}`:null),[b,i]),N=k.useMemo(()=>({onSelect:E,activeKey:y,transition:u,mountOnEnter:p||!1,unmountOnExit:g||!1,getControlledId:O=>A(O,"tabpane"),getControllerId:O=>A(O,"tab")}),[E,y,u,p,g,A]);return h.jsx(JR.Provider,{value:N,children:h.jsx(TE.Provider,{value:E||null,children:_})})};lye.Panel=oye;const cye=lye;function CQ(n){return typeof n=="boolean"?n?zO:wQ:n}const dye=({transition:n,...t})=>h.jsx(cye,{...t,transition:CQ(n)});dye.displayName="TabContainer";const TMe=dye,uye=k.forwardRef(({className:n,bsPrefix:t,as:i="div",...s},l)=>(t=ii(t,"tab-content"),h.jsx(i,{ref:l,className:Un(n,t),...s})));uye.displayName="TabContent";const hye=uye,fye=k.forwardRef(({bsPrefix:n,transition:t,...i},s)=>{const[{className:l,as:d="div",...u},{isActive:p,onEnter:g,onEntering:_,onEntered:y,onExit:E,onExiting:b,onExited:A,mountOnEnter:N,unmountOnExit:O,transition:D=zO}]=aye({...i,transition:CQ(t)}),P=ii(n,"tab-pane");return h.jsx(JR.Provider,{value:null,children:h.jsx(TE.Provider,{value:null,children:h.jsx(D,{in:p,onEnter:g,onEntering:_,onEntered:y,onExit:E,onExiting:b,onExited:A,mountOnEnter:N,unmountOnExit:O,children:h.jsx(d,{...u,ref:s,className:Un(l,P,p&&"active")})})})})});fye.displayName="TabPane";const pye=fye,RMe={eventKey:yl.oneOfType([yl.string,yl.number]),title:yl.node.isRequired,disabled:yl.bool,tabClassName:yl.string,tabAttrs:yl.object},mye=()=>{throw new Error("ReactBootstrap: The `Tab` component is not meant to be rendered! It's an abstract component that is only valid as a direct Child of the `Tabs` Component. For custom tabs components use TabPane and TabsContainer directly")};mye.propTypes=RMe;const Zn=Object.assign(mye,{Container:TMe,Content:hye,Pane:pye}),gye=k.forwardRef(({bsPrefix:n,className:t,striped:i,bordered:s,borderless:l,hover:d,size:u,variant:p,responsive:g,..._},y)=>{const E=ii(n,"table"),b=Un(t,E,p&&`${E}-${p}`,u&&`${E}-${u}`,i&&`${E}-${typeof i=="string"?`striped-${i}`:"striped"}`,s&&`${E}-bordered`,l&&`${E}-borderless`,d&&`${E}-hover`),A=h.jsx("table",{..._,className:b,ref:y});if(g){let N=`${E}-responsive`;return typeof g=="string"&&(N=`${N}-${g}`),h.jsx("div",{className:N,children:A})}return A});gye.displayName="Table";const xMe=gye;function AMe(n){let t;return BDe(n,i=>{t==null&&(t=i.props.eventKey)}),t}function IMe(n){const{title:t,eventKey:i,disabled:s,tabClassName:l,tabAttrs:d,id:u}=n.props;return t==null?null:h.jsx(jve,{as:"li",role:"presentation",children:h.jsx(Fve,{as:"button",type:"button",eventKey:i,disabled:s,id:u,className:l,...d,children:t})})}const vye=n=>{const{id:t,onSelect:i,transition:s,mountOnEnter:l=!1,unmountOnExit:d=!1,variant:u="tabs",children:p,activeKey:g=AMe(p),..._}=dQ(n,{activeKey:"onSelect"});return h.jsxs(cye,{id:t,activeKey:g,onSelect:i,transition:CQ(s),mountOnEnter:l,unmountOnExit:d,children:[h.jsx(jn,{id:t,..._,role:"tablist",as:"ul",variant:u,children:Dq(p,IMe)}),h.jsx(hye,{children:Dq(p,y=>{const E={...y.props};return delete E.title,delete E.disabled,delete E.tabClassName,delete E.tabAttrs,h.jsx(pye,{...E})})})]})};vye.displayName="Tabs";const vU=vye;var yye={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Xue=dn.createContext&&dn.createContext(yye),NMe=["attr","size","title"];function OMe(n,t){if(n==null)return{};var i=PMe(n,t),s,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(n);for(l=0;l<d.length;l++)s=d[l],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(n,s)&&(i[s]=n[s])}return i}function PMe(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}function y7(){return y7=Object.assign?Object.assign.bind():function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},y7.apply(this,arguments)}function Jue(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function _7(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Jue(Object(i),!0).forEach(function(s){LMe(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Jue(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function LMe(n,t,i){return t=DMe(t),t in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function DMe(n){var t=kMe(n,"string");return typeof t=="symbol"?t:String(t)}function kMe(n,t){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function _ye(n){return n&&n.map((t,i)=>dn.createElement(t.tag,_7({key:i},t.attr),_ye(t.child)))}function Le(n){return t=>dn.createElement(MMe,y7({attr:_7({},n.attr)},t),_ye(n.child))}function MMe(n){var t=i=>{var{attr:s,size:l,title:d}=n,u=OMe(n,NMe),p=l||i.size||"1em",g;return i.className&&(g=i.className),n.className&&(g=(g?g+" ":"")+n.className),dn.createElement("svg",y7({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,s,u,{className:g,style:_7(_7({color:n.color||i.color},i.style),n.style),height:p,width:p,xmlns:"http://www.w3.org/2000/svg"}),d&&dn.createElement("title",null,d),n.children)};return Xue!==void 0?dn.createElement(Xue.Consumer,null,i=>t(i)):t(yye)}function jMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M863.1 518.5H505.5V160.9c0-4.4-3.6-8-8-8h-26a398.57 398.57 0 0 0-282.5 117 397.47 397.47 0 0 0-85.6 127C82.6 446.2 72 498.5 72 552.5S82.6 658.7 103.4 708c20.1 47.5 48.9 90.3 85.6 127 36.7 36.7 79.4 65.5 127 85.6a396.64 396.64 0 0 0 155.6 31.5 398.57 398.57 0 0 0 282.5-117c36.7-36.7 65.5-79.4 85.6-127a396.64 396.64 0 0 0 31.5-155.6v-26c-.1-4.4-3.7-8-8.1-8zM951 463l-2.6-28.2c-8.5-92-49.3-178.8-115.1-244.3A398.5 398.5 0 0 0 588.4 75.6L560.1 73c-4.7-.4-8.7 3.2-8.7 7.9v383.7c0 4.4 3.6 8 8 8l383.6-1c4.7-.1 8.4-4 8-8.6z"},child:[]}]})(n)}function UMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563v233zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75V563zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 0 0-11.3 0l-39.6 39.6a8.03 8.03 0 0 0 0 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0zm669.6-79.2l-39.6-39.6a8.03 8.03 0 0 0-11.3 0l-67.9 67.9a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3zM832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32zM484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function FMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-616-64h536c4.4 0 8-3.6 8-8V284c0-7.2-8.7-10.7-13.7-5.7L592 488.6l-125.4-124a8.03 8.03 0 0 0-11.3 0l-189 189.6a7.87 7.87 0 0 0-2.3 5.6V720c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function BMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"},child:[]}]})(n)}function VMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(n)}function zMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M709.6 210l.4-.2h.2L512 96 313.9 209.8h-.2l.7.3L151.5 304v416L512 928l360.5-208V304l-162.9-94zM482.7 843.6L339.6 761V621.4L210 547.8V372.9l272.7 157.3v313.4zM238.2 321.5l134.7-77.8 138.9 79.7 139.1-79.9 135.2 78-273.9 158-274-158zM814 548.3l-128.8 73.1v139.1l-143.9 83V530.4L814 373.1v175.2z"},child:[]}]})(n)}function HMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 128c-212.1 0-384 171.9-384 384v360c0 13.3 10.7 24 24 24h184c35.3 0 64-28.7 64-64V624c0-35.3-28.7-64-64-64H200v-48c0-172.3 139.7-312 312-312s312 139.7 312 312v48H688c-35.3 0-64 28.7-64 64v208c0 35.3 28.7 64 64 64h184c13.3 0 24-10.7 24-24V512c0-212.1-171.9-384-384-384zM328 632v192H200V632h128zm496 192H696V632h128v192z"},child:[]}]})(n)}function GMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"},child:[]}]})(n)}function WMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888.3 693.2c-42.5-24.6-94.3-18-129.2 12.8l-53-30.7V523.6c0-15.7-8.4-30.3-22-38.1l-136-78.3v-67.1c44.2-15 76-56.8 76-106.1 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 49.3 31.8 91.1 76 106.1v67.1l-136 78.3c-13.6 7.8-22 22.4-22 38.1v151.6l-53 30.7c-34.9-30.8-86.8-37.4-129.2-12.8-53.5 31-71.7 99.4-41 152.9 30.8 53.5 98.9 71.9 152.2 41 42.5-24.6 62.7-73 53.6-118.8l48.7-28.3 140.6 81c6.8 3.9 14.4 5.9 22 5.9s15.2-2 22-5.9L674.5 740l48.7 28.3c-9.1 45.7 11.2 94.2 53.6 118.8 53.3 30.9 121.5 12.6 152.2-41 30.8-53.6 12.6-122-40.7-152.9zm-673 138.4a47.6 47.6 0 0 1-65.2-17.6c-13.2-22.9-5.4-52.3 17.5-65.5a47.6 47.6 0 0 1 65.2 17.6c13.2 22.9 5.4 52.3-17.5 65.5zM522 463.8zM464 234a48.01 48.01 0 0 1 96 0 48.01 48.01 0 0 1-96 0zm170 446.2l-122 70.3-122-70.3V539.8l122-70.3 122 70.3v140.4zm239.9 133.9c-13.2 22.9-42.4 30.8-65.2 17.6-22.8-13.2-30.7-42.6-17.5-65.5s42.4-30.8 65.2-17.6c22.9 13.2 30.7 42.5 17.5 65.5z"},child:[]}]})(n)}function $Me(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 0 0-44.4 0L77.5 505a63.9 63.9 0 0 0-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0 0 18.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"},child:[]}]})(n)}function KMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 0 1-112.7 75.9A352.8 352.8 0 0 1 512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 0 1-112.7-75.9 353.28 353.28 0 0 1-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 0 0 0-12.6z"},child:[]}]})(n)}function qMe(n){return Le({tag:"svg",attr:{t:"1569683371420",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M952 612c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H298c-14.2-35.2-48.7-60-89-60-53 0-96 43-96 96s43 96 96 96c40.3 0 74.8-24.8 89-60h150.3v152c0 55.2 44.8 100 100 100H952c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H548.3c-15.5 0-28-12.5-28-28V612H952zM451.7 313.7l172.5 136.2c6.3 5.1 15.8 0.5 15.8-7.7V344h264c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H640v-98.2c0-8.1-9.4-12.8-15.8-7.7L451.7 298.3c-4.9 3.9-4.9 11.5 0 15.4z"},child:[]}]})(n)}function YMe(n){return Le({tag:"svg",attr:{t:"1569683374330",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M952 612c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H298c-14.2-35.2-48.7-60-89-60-53 0-96 43-96 96s43 96 96 96c40.3 0 74.8-24.8 89-60h150.3v152c0 55.2 44.8 100 100 100H952c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H548.3c-15.5 0-28-12.5-28-28V612H952zM456 344h264v98.2c0 8.1 9.5 12.8 15.8 7.7l172.5-136.2c5-3.9 5-11.4 0-15.3L735.8 162.1c-6.4-5.1-15.8-0.5-15.8 7.7V268H456c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8z"},child:[]}]})(n)}function XMe(n){return Le({tag:"svg",attr:{t:"1569683635191",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M843.5 737.4c-12.4-75.2-79.2-129.1-155.3-125.4S550.9 676 546 752c-153.5-4.8-208-40.7-199.1-113.7 3.3-27.3 19.8-41.9 50.1-49 18.4-4.3 38.8-4.9 57.3-3.2 1.7 0.2 3.5 0.3 5.2 0.5 11.3 2.7 22.8 5 34.3 6.8 34.1 5.6 68.8 8.4 101.8 6.6 92.8-5 156-45.9 159.2-132.7 3.1-84.1-54.7-143.7-147.9-183.6-29.9-12.8-61.6-22.7-93.3-30.2-14.3-3.4-26.3-5.7-35.2-7.2-7.9-75.9-71.5-133.8-147.8-134.4-76.3-0.6-140.9 56.1-150.1 131.9s40 146.3 114.2 163.9c74.2 17.6 149.9-23.3 175.7-95.1 9.4 1.7 18.7 3.6 28 5.8 28.2 6.6 56.4 15.4 82.4 26.6 70.7 30.2 109.3 70.1 107.5 119.9-1.6 44.6-33.6 65.2-96.2 68.6-27.5 1.5-57.6-0.9-87.3-5.8-8.3-1.4-15.9-2.8-22.6-4.3-3.9-0.8-6.6-1.5-7.8-1.8l-3.1-0.6c-2.2-0.3-5.9-0.8-10.7-1.3-25-2.3-52.1-1.5-78.5 4.6-55.2 12.9-93.9 47.2-101.1 105.8-15.7 126.2 78.6 184.7 276 188.9 29.1 70.4 106.4 107.9 179.6 87 73.3-20.9 119.3-93.4 106.9-168.6zM329.1 345.2c-46 0-83.3-37.3-83.3-83.3s37.3-83.3 83.3-83.3 83.3 37.3 83.3 83.3-37.3 83.3-83.3 83.3zM695.6 845c-46 0-83.3-37.3-83.3-83.3s37.3-83.3 83.3-83.3 83.3 37.3 83.3 83.3-37.3 83.3-83.3 83.3z"},child:[]}]})(n)}function JMe(n){return Le({tag:"svg",attr:{t:"1569683632175",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M640.6 429.8h257.1c7.9 0 14.3-6.4 14.3-14.3V158.3c0-7.9-6.4-14.3-14.3-14.3H640.6c-7.9 0-14.3 6.4-14.3 14.3v92.9H490.6c-3.9 0-7.1 3.2-7.1 7.1v221.5h-85.7v-96.5c0-7.9-6.4-14.3-14.3-14.3H126.3c-7.9 0-14.3 6.4-14.3 14.3v257.2c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3V544h85.7v221.5c0 3.9 3.2 7.1 7.1 7.1h135.7v92.9c0 7.9 6.4 14.3 14.3 14.3h257.1c7.9 0 14.3-6.4 14.3-14.3v-257c0-7.9-6.4-14.3-14.3-14.3h-257c-7.9 0-14.3 6.4-14.3 14.3v100h-78.6v-393h78.6v100c0 7.9 6.4 14.3 14.3 14.3z m53.5-217.9h150V362h-150V211.9zM329.9 587h-150V437h150v150z m364.2 75.1h150v150.1h-150V662.1z"},child:[]}]})(n)}function QMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M864 518H506V160c0-4.4-3.6-8-8-8h-26a398.46 398.46 0 0 0-282.8 117.1 398.19 398.19 0 0 0-85.7 127.1A397.61 397.61 0 0 0 72 552a398.46 398.46 0 0 0 117.1 282.8c36.7 36.7 79.5 65.6 127.1 85.7A397.61 397.61 0 0 0 472 952a398.46 398.46 0 0 0 282.8-117.1c36.7-36.7 65.6-79.5 85.7-127.1A397.61 397.61 0 0 0 872 552v-26c0-4.4-3.6-8-8-8zM705.7 787.8A331.59 331.59 0 0 1 470.4 884c-88.1-.4-170.9-34.9-233.2-97.2C174.5 724.1 140 640.7 140 552c0-88.7 34.5-172.1 97.2-234.8 54.6-54.6 124.9-87.9 200.8-95.5V586h364.3c-7.7 76.3-41.3 147-96.6 201.8zM952 462.4l-2.6-28.2c-8.5-92.1-49.4-179-115.2-244.6A399.4 399.4 0 0 0 589 74.6L560.7 72c-4.7-.4-8.7 3.2-8.7 7.9V464c0 4.4 3.6 8 8 8l384-1c4.7 0 8.4-4 8-8.6zm-332.2-58.2V147.6a332.24 332.24 0 0 1 166.4 89.8c45.7 45.6 77 103.6 90 166.1l-256.4.7z"},child:[]}]})(n)}function ZMe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z"},child:[]},{tag:"path",attr:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"},child:[]}]})(n)}function e7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M928 161H699.2c-49.1 0-97.1 14.1-138.4 40.7L512 233l-48.8-31.3A255.2 255.2 0 0 0 324.8 161H96c-17.7 0-32 14.3-32 32v568c0 17.7 14.3 32 32 32h228.8c49.1 0 97.1 14.1 138.4 40.7l44.4 28.6c1.3.8 2.8 1.3 4.3 1.3s3-.4 4.3-1.3l44.4-28.6C602 807.1 650.1 793 699.2 793H928c17.7 0 32-14.3 32-32V193c0-17.7-14.3-32-32-32zM324.8 721H136V233h188.8c35.4 0 69.8 10.1 99.5 29.2l48.8 31.3 6.9 4.5v462c-47.6-25.6-100.8-39-155.2-39zm563.2 0H699.2c-54.4 0-107.6 13.4-155.2 39V298l6.9-4.5 48.8-31.3c29.7-19.1 64.1-29.2 99.5-29.2H888v488zM396.9 361H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm223.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c0-4.1-3.2-7.5-7.1-7.5H627.1c-3.9 0-7.1 3.4-7.1 7.5zM396.9 501H211.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5zm416 0H627.1c-3.9 0-7.1 3.4-7.1 7.5v45c0 4.1 3.2 7.5 7.1 7.5h185.7c3.9 0 7.1-3.4 7.1-7.5v-45c.1-4.1-3.1-7.5-7-7.5z"},child:[]}]})(n)}function t7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 0 0-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 0 1 655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 0 1 279 755.2a342.16 342.16 0 0 1-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 0 1 109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"},child:[]}]})(n)}function n7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M882 272.1V144c0-17.7-14.3-32-32-32H174c-17.7 0-32 14.3-32 32v128.1c-16.7 1-30 14.9-30 31.9v131.7a177 177 0 0 0 14.4 70.4c4.3 10.2 9.6 19.8 15.6 28.9v345c0 17.6 14.3 32 32 32h676c17.7 0 32-14.3 32-32V535a175 175 0 0 0 15.6-28.9c9.5-22.3 14.4-46 14.4-70.4V304c0-17-13.3-30.9-30-31.9zM214 184h596v88H214v-88zm362 656.1H448V736h128v104.1zm234 0H640V704c0-17.7-14.3-32-32-32H416c-17.7 0-32 14.3-32 32v136.1H214V597.9c2.9 1.4 5.9 2.8 9 4 22.3 9.4 46 14.1 70.4 14.1s48-4.7 70.4-14.1c13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0 0 38.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 13.8-5.8 26.8-13.2 38.7-22.1.2-.1.4-.1.6 0a180.4 180.4 0 0 0 38.7 22.1c22.3 9.4 46 14.1 70.4 14.1 24.4 0 48-4.7 70.4-14.1 3-1.3 6-2.6 9-4v242.2zm30-404.4c0 59.8-49 108.3-109.3 108.3-40.8 0-76.4-22.1-95.2-54.9-2.9-5-8.1-8.1-13.9-8.1h-.6c-5.7 0-11 3.1-13.9 8.1A109.24 109.24 0 0 1 512 544c-40.7 0-76.2-22-95-54.7-3-5.1-8.4-8.3-14.3-8.3s-11.4 3.2-14.3 8.3a109.63 109.63 0 0 1-95.1 54.7C233 544 184 495.5 184 435.7v-91.2c0-.3.2-.5.5-.5h655c.3 0 .5.2.5.5v91.2z"},child:[]}]})(n)}function i7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 0 0-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 1 0 0 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 0 0-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 0 0-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 0 0-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 0 0-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 0 1-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 0 1-31.6 31.6z"},child:[]}]})(n)}function r7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M832 312H696v-16c0-101.6-82.4-184-184-184s-184 82.4-184 184v16H192c-17.7 0-32 14.3-32 32v536c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V344c0-17.7-14.3-32-32-32zm-432-16c0-61.9 50.1-112 112-112s112 50.1 112 112v16H400v-16zm392 544H232V384h96v88c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-88h224v88c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-88h96v456z"},child:[]}]})(n)}function s7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M688 264c0-4.4-3.6-8-8-8H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48zm-8 136H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM480 544H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 308H208V148h560v344c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm356.8-74.4c29-26.3 47.2-64.3 47.2-106.6 0-79.5-64.5-144-144-144s-144 64.5-144 144c0 42.3 18.2 80.3 47.2 106.6-57 32.5-96.2 92.7-99.2 162.1-.2 4.5 3.5 8.3 8 8.3h48.1c4.2 0 7.7-3.3 8-7.6C564 871.2 621.7 816 692 816s128 55.2 131.9 124.4c.2 4.2 3.7 7.6 8 7.6H880c4.6 0 8.2-3.8 8-8.3-2.9-69.5-42.2-129.6-99.2-162.1zM692 591c44.2 0 80 35.8 80 80s-35.8 80-80 80-80-35.8-80-80 35.8-80 80-80z"},child:[]}]})(n)}function a7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M847.9 592H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h605.2L612.9 851c-4.1 5.2-.4 13 6.3 13h72.5c4.9 0 9.5-2.2 12.6-6.1l168.8-214.1c16.5-21 1.6-51.8-25.2-51.8zM872 356H266.8l144.3-183c4.1-5.2.4-13-6.3-13h-72.5c-4.9 0-9.5 2.2-12.6 6.1L150.9 380.2c-16.5 21-1.6 51.8 25.1 51.8h696c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"},child:[]}]})(n)}function o7e(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 0 1 755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 0 0 3 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 0 1 512.1 856a342.24 342.24 0 0 1-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 0 0-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 0 0-8-8.2z"},child:[]}]})(n)}function l7e(n){return Le({tag:"svg",attr:{t:"1569683921137",viewBox:"0 0 1024 1024",version:"1.1"},child:[{tag:"defs",attr:{},child:[]},{tag:"path",attr:{d:"M759 335c0-137-111-248-248-248S263 198 263 335c0 82.8 40.6 156.2 103 201.2-0.4 0.2-0.7 0.3-0.9 0.4-44.7 18.9-84.8 46-119.3 80.6-34.5 34.5-61.5 74.7-80.4 119.5C146.9 780.5 137 827 136 874.8c-0.1 4.5 3.5 8.2 8 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C356 614.2 431 583 511 583c137 0 248-111 248-248zM511 507c-95 0-172-77-172-172s77-172 172-172 172 77 172 172-77 172-172 172zM616 728h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H703.5l47.2-60.1c1.1-1.4 1.7-3.2 1.7-4.9 0-4.4-3.6-8-8-8h-72.6c-4.9 0-9.5 2.3-12.6 6.1l-68.5 87.1c-4.4 5.6-6.8 12.6-6.8 19.8 0.1 17.7 14.4 32 32.1 32zM856 792H592c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h176.5l-47.2 60.1c-1.1 1.4-1.7 3.2-1.7 4.9 0 4.4 3.6 8 8 8h72.6c4.9 0 9.5-2.3 12.6-6.1l68.5-87.1c4.4-5.6 6.8-12.6 6.8-19.8-0.1-17.7-14.4-32-32.1-32z"},child:[]}]})(n)}function c7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"},child:[]}]})(n)}function d7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"},child:[]}]})(n)}function u7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"},child:[]}]})(n)}function h7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"},child:[]},{tag:"path",attr:{d:"M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"},child:[]}]})(n)}function f7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m10.79 12.912-1.614-1.615a3.5 3.5 0 0 1-4.474-4.474l-2.06-2.06C.938 6.278 0 8 0 8s3 5.5 8 5.5a7.029 7.029 0 0 0 2.79-.588zM5.21 3.088A7.028 7.028 0 0 1 8 2.5c5 0 8 5.5 8 5.5s-.939 1.721-2.641 3.238l-2.062-2.062a3.5 3.5 0 0 0-4.474-4.474L5.21 3.089z"},child:[]},{tag:"path",attr:{d:"M5.525 7.646a2.5 2.5 0 0 0 2.829 2.829l-2.83-2.829zm4.95.708-2.829-2.83a2.5 2.5 0 0 1 2.829 2.829zm3.171 6-12-12 .708-.708 12 12-.708.708z"},child:[]}]})(n)}function p7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},child:[]}]})(n)}function m7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M7 14s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H7Zm4-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm-5.784 6A2.238 2.238 0 0 1 5 13c0-1.355.68-2.75 1.936-3.72A6.325 6.325 0 0 0 5 9c-4 0-5 3-5 4s1 1 1 1h4.216ZM4.5 8a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]}]})(n)}function g7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},child:[]}]})(n)}function v7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"},child:[]}]})(n)}function y7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"},child:[]}]})(n)}function _7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.5 1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1H3v9a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4h.5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H10a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1H2.5zm3 4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 .5-.5zM8 5a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-1 0v-7A.5.5 0 0 1 8 5zm3 .5v7a.5.5 0 0 1-1 0v-7a.5.5 0 0 1 1 0z"},child:[]}]})(n)}function E7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"},child:[]},{tag:"path",attr:{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516.024.034 1.52.087 2.475-1.258.955-1.345.762-2.391.728-2.43Zm3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422.212-2.189 1.675-2.789 1.698-2.854.023-.065-.597-.79-1.254-1.157a3.692 3.692 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56.244.729.625 1.924 1.273 2.796.576.984 1.34 1.667 1.659 1.899.319.232 1.219.386 1.843.067.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758.347-.79.505-1.217.473-1.282Z"},child:[]}]})(n)}function w7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M1 11.5a.5.5 0 0 0 .5.5h11.793l-3.147 3.146a.5.5 0 0 0 .708.708l4-4a.5.5 0 0 0 0-.708l-4-4a.5.5 0 0 0-.708.708L13.293 11H1.5a.5.5 0 0 0-.5.5zm14-7a.5.5 0 0 1-.5.5H2.707l3.147 3.146a.5.5 0 1 1-.708.708l-4-4a.5.5 0 0 1 0-.708l4-4a.5.5 0 1 1 .708.708L2.707 4H14.5a.5.5 0 0 1 .5.5z"},child:[]}]})(n)}function S7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.277.084a.5.5 0 0 0-.554 0l-7.5 5A.5.5 0 0 0 .5 6h1.875v7H1.5a.5.5 0 0 0 0 1h13a.5.5 0 1 0 0-1h-.875V6H15.5a.5.5 0 0 0 .277-.916l-7.5-5zM12.375 6v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zm-2.5 0v7h-1.25V6h1.25zM8 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM.5 15a.5.5 0 0 0 0 1h15a.5.5 0 1 0 0-1H.5z"},child:[]}]})(n)}function b7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zm.995-14.901a1 1 0 1 0-1.99 0A5.002 5.002 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901z"},child:[]}]})(n)}function C7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.5a1 1 0 0 0-.8.4l-1.9 2.533a1 1 0 0 1-1.6 0L5.3 12.4a1 1 0 0 0-.8-.4H2a2 2 0 0 1-2-2V2zm3.5 1a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1h-9zm0 2.5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1h-5z"},child:[]}]})(n)}function T7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"},child:[]}]})(n)}function R7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"},child:[]}]})(n)}function x7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]}]})(n)}function A7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.515 1.019A7 7 0 0 0 8 1V0a8 8 0 0 1 .589.022l-.074.997zm2.004.45a7.003 7.003 0 0 0-.985-.299l.219-.976c.383.086.76.2 1.126.342l-.36.933zm1.37.71a7.01 7.01 0 0 0-.439-.27l.493-.87a8.025 8.025 0 0 1 .979.654l-.615.789a6.996 6.996 0 0 0-.418-.302zm1.834 1.79a6.99 6.99 0 0 0-.653-.796l.724-.69c.27.285.52.59.747.91l-.818.576zm.744 1.352a7.08 7.08 0 0 0-.214-.468l.893-.45a7.976 7.976 0 0 1 .45 1.088l-.95.313a7.023 7.023 0 0 0-.179-.483zm.53 2.507a6.991 6.991 0 0 0-.1-1.025l.985-.17c.067.386.106.778.116 1.17l-1 .025zm-.131 1.538c.033-.17.06-.339.081-.51l.993.123a7.957 7.957 0 0 1-.23 1.155l-.964-.267c.046-.165.086-.332.12-.501zm-.952 2.379c.184-.29.346-.594.486-.908l.914.405c-.16.36-.345.706-.555 1.038l-.845-.535zm-.964 1.205c.122-.122.239-.248.35-.378l.758.653a8.073 8.073 0 0 1-.401.432l-.707-.707z"},child:[]},{tag:"path",attr:{d:"M8 1a7 7 0 1 0 4.95 11.95l.707.707A8.001 8.001 0 1 1 8 0v1z"},child:[]},{tag:"path",attr:{d:"M7.5 3a.5.5 0 0 1 .5.5v5.21l3.248 1.856a.5.5 0 0 1-.496.868l-3.5-2A.5.5 0 0 1 7 9V3.5a.5.5 0 0 1 .5-.5z"},child:[]}]})(n)}function I7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 1v3H1V1h5zM1 0a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1H1zm14 12v3h-5v-3h5zm-5-1a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-5zM6 8v7H1V8h5zM1 7a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H1zm14-6v7h-5V1h5zm-5-1a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1h-5z"},child:[]}]})(n)}function N7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M6 3.5A1.5 1.5 0 0 1 7.5 2h1A1.5 1.5 0 0 1 10 3.5v1A1.5 1.5 0 0 1 8.5 6v1H14a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0V8h-5v.5a.5.5 0 0 1-1 0v-1A.5.5 0 0 1 2 7h5.5V6A1.5 1.5 0 0 1 6 4.5v-1zM8.5 5a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1zM0 11.5A1.5 1.5 0 0 1 1.5 10h1A1.5 1.5 0 0 1 4 11.5v1A1.5 1.5 0 0 1 2.5 14h-1A1.5 1.5 0 0 1 0 12.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zm4.5.5A1.5 1.5 0 0 1 7.5 10h1a1.5 1.5 0 0 1 1.5 1.5v1A1.5 1.5 0 0 1 8.5 14h-1A1.5 1.5 0 0 1 6 12.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1zm4.5.5a1.5 1.5 0 0 1 1.5-1.5h1a1.5 1.5 0 0 1 1.5 1.5v1a1.5 1.5 0 0 1-1.5 1.5h-1a1.5 1.5 0 0 1-1.5-1.5v-1zm1.5-.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5h-1z"},child:[]}]})(n)}function O7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z"},child:[]}]})(n)}function GO(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z"},child:[]}]})(n)}function P7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.6 11.85H0v3.999h.791v-1.342h.803c.287 0 .531-.057.732-.173.203-.117.358-.275.463-.474a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.476-.158-.677a1.176 1.176 0 0 0-.46-.477c-.2-.12-.443-.179-.732-.179Zm.545 1.333a.795.795 0 0 1-.085.38.574.574 0 0 1-.238.241.794.794 0 0 1-.375.082H.788V12.48h.66c.218 0 .389.06.512.181.123.122.185.296.185.522Zm1.217-1.333v3.999h1.46c.401 0 .734-.08.998-.237a1.45 1.45 0 0 0 .595-.689c.13-.3.196-.662.196-1.084 0-.42-.065-.778-.196-1.075a1.426 1.426 0 0 0-.589-.68c-.264-.156-.599-.234-1.005-.234H3.362Zm.791.645h.563c.248 0 .45.05.609.152a.89.89 0 0 1 .354.454c.079.201.118.452.118.753a2.3 2.3 0 0 1-.068.592 1.14 1.14 0 0 1-.196.422.8.8 0 0 1-.334.252 1.298 1.298 0 0 1-.483.082h-.563v-2.707Zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638H7.896Z"},child:[]}]})(n)}function L7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5z"},child:[]}]})(n)}function D7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z"},child:[]}]})(n)}function k7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"},child:[]}]})(n)}function M7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z"},child:[]},{tag:"path",attr:{d:"M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"},child:[]}]})(n)}function j7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z"},child:[]},{tag:"path",attr:{d:"M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"},child:[]}]})(n)}function U7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 3a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V8a6 6 0 1 1 12 0v5a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1V8a5 5 0 0 0-5-5z"},child:[]}]})(n)}function F7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 1a5 5 0 0 0-5 5v1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V6a6 6 0 1 1 12 0v6a2.5 2.5 0 0 1-2.5 2.5H9.366a1 1 0 0 1-.866.5h-1a1 1 0 1 1 0-2h1a1 1 0 0 1 .866.5H11.5A1.5 1.5 0 0 0 13 12h-1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1V6a5 5 0 0 0-5-5z"},child:[]}]})(n)}function B7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"},child:[]},{tag:"path",attr:{d:"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z"},child:[]}]})(n)}function V7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.502 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"},child:[]},{tag:"path",attr:{d:"M14.002 13a2 2 0 0 1-2 2h-10a2 2 0 0 1-2-2V5A2 2 0 0 1 2 3a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v8a2 2 0 0 1-1.998 2zM14 2H4a1 1 0 0 0-1 1h9.002a2 2 0 0 1 2 2v7A1 1 0 0 0 15 11V3a1 1 0 0 0-1-1zM2.002 4a1 1 0 0 0-1 1v8l2.646-2.354a.5.5 0 0 1 .63-.062l2.66 1.773 3.71-3.71a.5.5 0 0 1 .577-.094l1.777 1.947V5a1 1 0 0 0-1-1h-10z"},child:[]}]})(n)}function z7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"},child:[]}]})(n)}function H7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"},child:[]},{tag:"path",attr:{d:"M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"},child:[]}]})(n)}function G7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M5.933.87a2.89 2.89 0 0 1 4.134 0l.622.638.89-.011a2.89 2.89 0 0 1 2.924 2.924l-.01.89.636.622a2.89 2.89 0 0 1 0 4.134l-.637.622.011.89a2.89 2.89 0 0 1-2.924 2.924l-.89-.01-.622.636a2.89 2.89 0 0 1-4.134 0l-.622-.637-.89.011a2.89 2.89 0 0 1-2.924-2.924l.01-.89-.636-.622a2.89 2.89 0 0 1 0-4.134l.637-.622-.011-.89a2.89 2.89 0 0 1 2.924-2.924l.89.01.622-.636zM7.002 11a1 1 0 1 0 2 0 1 1 0 0 0-2 0zm1.602-2.027c.04-.534.198-.815.846-1.26.674-.475 1.05-1.09 1.05-1.986 0-1.325-.92-2.227-2.262-2.227-1.02 0-1.792.492-2.1 1.29A1.71 1.71 0 0 0 6 5.48c0 .393.203.64.545.64.272 0 .455-.147.564-.51.158-.592.525-.915 1.074-.915.61 0 1.03.446 1.03 1.084 0 .563-.208.885-.822 1.325-.619.433-.926.914-.926 1.64v.111c0 .428.208.745.585.745.336 0 .504-.24.554-.627z"},child:[]}]})(n)}function W7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.05 9.6c.336 0 .504-.24.554-.627.04-.534.198-.815.847-1.26.673-.475 1.049-1.09 1.049-1.986 0-1.325-.92-2.227-2.262-2.227-1.02 0-1.792.492-2.1 1.29A1.71 1.71 0 0 0 6 5.48c0 .393.203.64.545.64.272 0 .455-.147.564-.51.158-.592.525-.915 1.074-.915.61 0 1.03.446 1.03 1.084 0 .563-.208.885-.822 1.325-.619.433-.926.914-.926 1.64v.111c0 .428.208.745.585.745z"},child:[]},{tag:"path",attr:{d:"m10.273 2.513-.921-.944.715-.698.622.637.89-.011a2.89 2.89 0 0 1 2.924 2.924l-.01.89.636.622a2.89 2.89 0 0 1 0 4.134l-.637.622.011.89a2.89 2.89 0 0 1-2.924 2.924l-.89-.01-.622.636a2.89 2.89 0 0 1-4.134 0l-.622-.637-.89.011a2.89 2.89 0 0 1-2.924-2.924l.01-.89-.636-.622a2.89 2.89 0 0 1 0-4.134l.637-.622-.011-.89a2.89 2.89 0 0 1 2.924-2.924l.89.01.622-.636a2.89 2.89 0 0 1 4.134 0l-.715.698a1.89 1.89 0 0 0-2.704 0l-.92.944-1.32-.016a1.89 1.89 0 0 0-1.911 1.912l.016 1.318-.944.921a1.89 1.89 0 0 0 0 2.704l.944.92-.016 1.32a1.89 1.89 0 0 0 1.912 1.911l1.318-.016.921.944a1.89 1.89 0 0 0 2.704 0l.92-.944 1.32.016a1.89 1.89 0 0 0 1.911-1.912l-.016-1.318.944-.921a1.89 1.89 0 0 0 0-2.704l-.944-.92.016-1.32a1.89 1.89 0 0 0-1.912-1.911l-1.318.016z"},child:[]},{tag:"path",attr:{d:"M7.001 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0z"},child:[]}]})(n)}function $7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.854.146a.5.5 0 0 0-.707 0L10.5 1.793 14.207 5.5l1.647-1.646a.5.5 0 0 0 0-.708l-3-3zm.646 6.061L9.793 2.5 3.293 9H3.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.207l6.5-6.5zm-7.468 7.468A.5.5 0 0 1 6 13.5V13h-.5a.5.5 0 0 1-.5-.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.5-.5V10h-.5a.499.499 0 0 1-.175-.032l-.179.178a.5.5 0 0 0-.11.168l-2 5a.5.5 0 0 0 .65.65l5-2a.5.5 0 0 0 .168-.11l.178-.178z"},child:[]}]})(n)}function K7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"},child:[]},{tag:"path",attr:{fillRule:"evenodd",d:"M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"},child:[]}]})(n)}function q7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z"},child:[]}]})(n)}function Y7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1h8Zm-7.978-1A.261.261 0 0 1 7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002a.274.274 0 0 1-.014.002H7.022ZM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM6.936 9.28a5.88 5.88 0 0 0-1.23-.247A7.35 7.35 0 0 0 5 9c-4 0-5 3-5 4 0 .667.333 1 1 1h4.216A2.238 2.238 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816ZM4.92 10A5.493 5.493 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275ZM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0Zm3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"},child:[]}]})(n)}function X7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.5 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3zM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"},child:[]},{tag:"path",attr:{d:"M4.5 0A2.5 2.5 0 0 0 2 2.5V14a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2.5A2.5 2.5 0 0 0 11.5 0h-7zM3 2.5A1.5 1.5 0 0 1 4.5 1h7A1.5 1.5 0 0 1 13 2.5v10.795a4.2 4.2 0 0 0-.776-.492C11.392 12.387 10.063 12 8 12s-3.392.387-4.224.803a4.2 4.2 0 0 0-.776.492V2.5z"},child:[]}]})(n)}function J7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm1.679-4.493-1.335 2.226a.75.75 0 0 1-1.174.144l-.774-.773a.5.5 0 0 1 .708-.708l.547.548 1.17-1.951a.5.5 0 1 1 .858.514ZM11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"},child:[]},{tag:"path",attr:{d:"M8.256 14a4.474 4.474 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10c.26 0 .507.009.74.025.226-.341.496-.65.804-.918C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4s1 1 1 1h5.256Z"},child:[]}]})(n)}function Q7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-5 6s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H1zM11 3.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5zm.5 2.5a.5.5 0 0 0 0 1h4a.5.5 0 0 0 0-1h-4zm2 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2zm0 3a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1h-2z"},child:[]}]})(n)}function Z7e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 9.05a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]},{tag:"path",attr:{d:"M1 1a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h.5a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0 .5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5.5.5 0 0 1 1 0 .5.5 0 0 0 .5.5h.5a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H6.707L6 1.293A1 1 0 0 0 5.293 1H1Zm0 1h4.293L6 2.707A1 1 0 0 0 6.707 3H15v10h-.085a1.5 1.5 0 0 0-2.4-.63C11.885 11.223 10.554 10 8 10c-2.555 0-3.886 1.224-4.514 2.37a1.5 1.5 0 0 0-2.4.63H1V2Z"},child:[]}]})(n)}function e9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"},child:[]},{tag:"path",attr:{d:"M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm12 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1v-1c0-1-1-4-6-4s-6 3-6 4v1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12z"},child:[]}]})(n)}function t9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4 16s-1 0-1-1 1-4 5-4 5 3 5 4-1 1-1 1H4Zm4-5.95a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"},child:[]},{tag:"path",attr:{d:"M2 1a2 2 0 0 0-2 2v9.5A1.5 1.5 0 0 0 1.5 14h.653a5.373 5.373 0 0 1 1.066-2H1V3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v9h-2.219c.554.654.89 1.373 1.066 2h.653a1.5 1.5 0 0 0 1.5-1.5V3a2 2 0 0 0-2-2H2Z"},child:[]}]})(n)}function n9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10Z"},child:[]}]})(n)}function i9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 12V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm6.79-6.907A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]}]})(n)}function r9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]},{tag:"path",attr:{d:"M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm15 0a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z"},child:[]}]})(n)}function s9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z"},child:[]}]})(n)}function a9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"},child:[]}]})(n)}function o9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"},child:[]}]})(n)}function l9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"},child:[]}]})(n)}function c9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.302 1.256a1.5 1.5 0 0 0-2.604 0l-1.704 2.98a.5.5 0 0 0 .869.497l1.703-2.981a.5.5 0 0 1 .868 0l2.54 4.444-1.256-.337a.5.5 0 1 0-.26.966l2.415.647a.5.5 0 0 0 .613-.353l.647-2.415a.5.5 0 1 0-.966-.259l-.333 1.242-2.532-4.431zM2.973 7.773l-1.255.337a.5.5 0 1 1-.26-.966l2.416-.647a.5.5 0 0 1 .612.353l.647 2.415a.5.5 0 0 1-.966.259l-.333-1.242-2.545 4.454a.5.5 0 0 0 .434.748H5a.5.5 0 0 1 0 1H1.723A1.5 1.5 0 0 1 .421 12.24l2.552-4.467zm10.89 1.463a.5.5 0 1 0-.868.496l1.716 3.004a.5.5 0 0 1-.434.748h-5.57l.647-.646a.5.5 0 1 0-.708-.707l-1.5 1.5a.498.498 0 0 0 0 .707l1.5 1.5a.5.5 0 1 0 .708-.707l-.647-.647h5.57a1.5 1.5 0 0 0 1.302-2.244l-1.716-3.004z"},child:[]}]})(n)}function d9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"},child:[]}]})(n)}function u9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.5 1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM11 2.5a2.5 2.5 0 1 1 .603 1.628l-6.718 3.12a2.499 2.499 0 0 1 0 1.504l6.718 3.12a2.5 2.5 0 1 1-.488.876l-6.718-3.12a2.5 2.5 0 1 1 0-3.256l6.718-3.12A2.5 2.5 0 0 1 11 2.5zm-8.5 4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm11 5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"},child:[]}]})(n)}function h9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"},child:[]}]})(n)}function f9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"},child:[]}]})(n)}function p9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"},child:[]}]})(n)}function m9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.5.5A.5.5 0 0 1 3 0h10a.5.5 0 0 1 .5.5c0 .538-.012 1.05-.034 1.536a3 3 0 1 1-1.133 5.89c-.79 1.865-1.878 2.777-2.833 3.011v2.173l1.425.356c.194.048.377.135.537.255L13.3 15.1a.5.5 0 0 1-.3.9H3a.5.5 0 0 1-.3-.9l1.838-1.379c.16-.12.343-.207.537-.255L6.5 13.11v-2.173c-.955-.234-2.043-1.146-2.833-3.012a3 3 0 1 1-1.132-5.89A33.076 33.076 0 0 1 2.5.5zm.099 2.54a2 2 0 0 0 .72 3.935c-.333-1.05-.588-2.346-.72-3.935zm10.083 3.935a2 2 0 0 0 .72-3.935c-.133 1.59-.388 2.885-.72 3.935zM3.504 1c.007.517.026 1.006.056 1.469.13 2.028.457 3.546.87 4.667C5.294 9.48 6.484 10 7 10a.5.5 0 0 1 .5.5v2.61a1 1 0 0 1-.757.97l-1.426.356a.5.5 0 0 0-.179.085L4.5 15h7l-.638-.479a.501.501 0 0 0-.18-.085l-1.425-.356a1 1 0 0 1-.757-.97V10.5A.5.5 0 0 1 9 10c.516 0 1.706-.52 2.57-2.864.413-1.12.74-2.64.87-4.667.03-.463.049-.952.056-1.469H3.504z"},child:[]}]})(n)}function g9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"m2.244 13.081.943-2.803H6.66l.944 2.803H8.86L5.54 3.75H4.322L1 13.081h1.244zm2.7-7.923L6.34 9.314H3.51l1.4-4.156h.034zm9.146 7.027h.035v.896h1.128V8.125c0-1.51-1.114-2.345-2.646-2.345-1.736 0-2.59.916-2.666 2.174h1.108c.068-.718.595-1.19 1.517-1.19.971 0 1.518.52 1.518 1.464v.731H12.19c-1.647.007-2.522.8-2.522 2.058 0 1.319.957 2.18 2.345 2.18 1.06 0 1.716-.43 2.078-1.011zm-1.763.035c-.752 0-1.456-.397-1.456-1.244 0-.65.424-1.115 1.408-1.115h1.805v.834c0 .896-.752 1.525-1.757 1.525z"},child:[]}]})(n)}function v9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M2.273 9.53a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.547Zm9.467-4.984a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.546ZM7.4 13.108a5.535 5.535 0 0 1-3.775-2.88 3.273 3.273 0 0 1-1.944.24 7.4 7.4 0 0 0 5.328 4.465c.53.113 1.072.169 1.614.166a3.253 3.253 0 0 1-.666-1.9 5.639 5.639 0 0 1-.557-.091Zm3.828 2.285a2.273 2.273 0 1 0 0-4.546 2.273 2.273 0 0 0 0 4.546Zm3.163-3.108a7.436 7.436 0 0 0 .373-8.726 3.276 3.276 0 0 1-1.278 1.498 5.573 5.573 0 0 1-.183 5.535 3.26 3.26 0 0 1 1.088 1.693ZM2.098 3.998a3.28 3.28 0 0 1 1.897.486 5.544 5.544 0 0 1 4.464-2.388c.037-.67.277-1.313.69-1.843a7.472 7.472 0 0 0-7.051 3.745Z"},child:[]}]})(n)}function y9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"},child:[]}]})(n)}function _9e(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"},child:[]},{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"},child:[]}]})(n)}function VE(n){return Le({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"},child:[]}]})(n)}function E9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 1c3.681 0 7 2.565 7 6v4.539c0 .642.189 1.269.545 1.803l2.2 3.298A1.517 1.517 0 0 1 20.482 19H15.5a3.5 3.5 0 1 1-7 0H3.519a1.518 1.518 0 0 1-1.265-2.359l2.2-3.299A3.25 3.25 0 0 0 5 11.539V7c0-3.435 3.318-6 7-6ZM6.5 7v4.539a4.75 4.75 0 0 1-.797 2.635l-2.2 3.298-.003.01.001.007.004.006.006.004.007.001h16.964l.007-.001.006-.004.004-.006.001-.006a.017.017 0 0 0-.003-.01l-2.199-3.299a4.753 4.753 0 0 1-.798-2.635V7c0-2.364-2.383-4.5-5.5-4.5S6.5 4.636 6.5 7ZM14 19h-4a2 2 0 1 0 4 0Z"},child:[]}]})(n)}function w9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 8a6 6 0 1 1 12 0v2.917c0 .703.228 1.387.65 1.95L20.7 15.6a1.5 1.5 0 0 1-1.2 2.4h-15a1.5 1.5 0 0 1-1.2-2.4l2.05-2.733a3.25 3.25 0 0 0 .65-1.95Zm6 13.5A3.502 3.502 0 0 1 8.645 19h6.71A3.502 3.502 0 0 1 12 21.5Z"},child:[]}]})(n)}function S9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M0 3.75A.75.75 0 0 1 .75 3h7.497c1.566 0 2.945.8 3.751 2.014A4.495 4.495 0 0 1 15.75 3h7.5a.75.75 0 0 1 .75.75v15.063a.752.752 0 0 1-.755.75l-7.682-.052a3 3 0 0 0-2.142.878l-.89.891a.75.75 0 0 1-1.061 0l-.902-.901a2.996 2.996 0 0 0-2.121-.879H.75a.75.75 0 0 1-.75-.75Zm12.75 15.232a4.503 4.503 0 0 1 2.823-.971l6.927.047V4.5h-6.75a3 3 0 0 0-3 3ZM11.247 7.497a3 3 0 0 0-3-2.997H1.5V18h6.947c1.018 0 2.006.346 2.803.98Z"},child:[]}]})(n)}function b9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-1.5 0a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"},child:[]},{tag:"path",attr:{d:"M12 1c.266 0 .532.009.797.028.763.055 1.345.617 1.512 1.304l.352 1.45c.019.078.09.171.225.221.247.089.49.19.728.302.13.061.246.044.315.002l1.275-.776c.603-.368 1.411-.353 1.99.147.402.349.78.726 1.128 1.129.501.578.515 1.386.147 1.99l-.776 1.274c-.042.069-.058.185.002.315.112.238.213.481.303.728.048.135.142.205.22.225l1.45.352c.687.167 1.249.749 1.303 1.512.038.531.038 1.063 0 1.594-.054.763-.616 1.345-1.303 1.512l-1.45.352c-.078.019-.171.09-.221.225-.089.248-.19.491-.302.728-.061.13-.044.246-.002.315l.776 1.275c.368.603.353 1.411-.147 1.99-.349.402-.726.78-1.129 1.128-.578.501-1.386.515-1.99.147l-1.274-.776c-.069-.042-.185-.058-.314.002a8.606 8.606 0 0 1-.729.303c-.135.048-.205.142-.225.22l-.352 1.45c-.167.687-.749 1.249-1.512 1.303-.531.038-1.063.038-1.594 0-.763-.054-1.345-.616-1.512-1.303l-.352-1.45c-.019-.078-.09-.171-.225-.221a8.138 8.138 0 0 1-.728-.302c-.13-.061-.246-.044-.315-.002l-1.275.776c-.603.368-1.411.353-1.99-.147-.402-.349-.78-.726-1.128-1.129-.501-.578-.515-1.386-.147-1.99l.776-1.274c.042-.069.058-.185-.002-.314a8.606 8.606 0 0 1-.303-.729c-.048-.135-.142-.205-.22-.225l-1.45-.352c-.687-.167-1.249-.749-1.304-1.512a11.158 11.158 0 0 1 0-1.594c.055-.763.617-1.345 1.304-1.512l1.45-.352c.078-.019.171-.09.221-.225.089-.248.19-.491.302-.728.061-.13.044-.246.002-.315l-.776-1.275c-.368-.603-.353-1.411.147-1.99.349-.402.726-.78 1.129-1.128.578-.501 1.386-.515 1.99-.147l1.274.776c.069.042.185.058.315-.002.238-.112.481-.213.728-.303.135-.048.205-.142.225-.22l.352-1.45c.167-.687.749-1.249 1.512-1.304C11.466 1.01 11.732 1 12 1Zm-.69 1.525c-.055.004-.135.05-.161.161l-.353 1.45a1.832 1.832 0 0 1-1.172 1.277 7.147 7.147 0 0 0-.6.249 1.833 1.833 0 0 1-1.734-.074l-1.274-.776c-.098-.06-.186-.036-.228 0a9.774 9.774 0 0 0-.976.976c-.036.042-.06.131 0 .228l.776 1.274c.314.529.342 1.18.074 1.734a7.147 7.147 0 0 0-.249.6 1.831 1.831 0 0 1-1.278 1.173l-1.45.351c-.11.027-.156.107-.16.162a9.63 9.63 0 0 0 0 1.38c.004.055.05.135.161.161l1.45.353a1.832 1.832 0 0 1 1.277 1.172c.074.204.157.404.249.6.268.553.24 1.204-.074 1.733l-.776 1.275c-.06.098-.036.186 0 .228.301.348.628.675.976.976.042.036.131.06.228 0l1.274-.776a1.83 1.83 0 0 1 1.734-.075c.196.093.396.176.6.25a1.831 1.831 0 0 1 1.173 1.278l.351 1.45c.027.11.107.156.162.16a9.63 9.63 0 0 0 1.38 0c.055-.004.135-.05.161-.161l.353-1.45a1.834 1.834 0 0 1 1.172-1.278 6.82 6.82 0 0 0 .6-.248 1.831 1.831 0 0 1 1.733.074l1.275.776c.098.06.186.036.228 0 .348-.301.675-.628.976-.976.036-.042.06-.131 0-.228l-.776-1.275a1.834 1.834 0 0 1-.075-1.733c.093-.196.176-.396.25-.6a1.831 1.831 0 0 1 1.278-1.173l1.45-.351c.11-.027.156-.107.16-.162a9.63 9.63 0 0 0 0-1.38c-.004-.055-.05-.135-.161-.161l-1.45-.353c-.626-.152-1.08-.625-1.278-1.172a6.576 6.576 0 0 0-.248-.6 1.833 1.833 0 0 1 .074-1.734l.776-1.274c.06-.098.036-.186 0-.228a9.774 9.774 0 0 0-.976-.976c-.042-.036-.131-.06-.228 0l-1.275.776a1.831 1.831 0 0 1-1.733.074 6.88 6.88 0 0 0-.6-.249 1.835 1.835 0 0 1-1.173-1.278l-.351-1.45c-.027-.11-.107-.156-.162-.16a9.63 9.63 0 0 0-1.38 0Z"},child:[]}]})(n)}function C9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M14 20.408c-.492.308-.903.546-1.192.709-.153.086-.308.17-.463.252h-.002a.75.75 0 0 1-.686 0 16.709 16.709 0 0 1-.465-.252 31.147 31.147 0 0 1-4.803-3.34C3.8 15.572 1 12.331 1 8.513 1 5.052 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262A31.146 31.146 0 0 1 14 20.408Z"},child:[]}]})(n)}function T9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2.5c-3.81 0-6.5 2.743-6.5 6.119 0 1.536.632 2.572 1.425 3.56.172.215.347.422.527.635l.096.112c.21.25.427.508.63.774.404.531.783 1.128.995 1.834a.75.75 0 0 1-1.436.432c-.138-.46-.397-.89-.753-1.357a18.111 18.111 0 0 0-.582-.714l-.092-.11c-.18-.212-.37-.436-.555-.667C4.87 12.016 4 10.651 4 8.618 4 4.363 7.415 1 12 1s8 3.362 8 7.619c0 2.032-.87 3.397-1.755 4.5-.185.23-.375.454-.555.667l-.092.109c-.21.248-.405.481-.582.714-.356.467-.615.898-.753 1.357a.751.751 0 0 1-1.437-.432c.213-.706.592-1.303.997-1.834.202-.266.419-.524.63-.774l.095-.112c.18-.213.355-.42.527-.634.793-.99 1.425-2.025 1.425-3.561C18.5 5.243 15.81 2.5 12 2.5ZM8.75 18h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5Zm.75 3.75a.75.75 0 0 1 .75-.75h3.5a.75.75 0 0 1 0 1.5h-3.5a.75.75 0 0 1-.75-.75Z"},child:[]}]})(n)}function R9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M0 4.75C0 3.784.784 3 1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V4.75a.25.25 0 0 0-.25-.25Z"},child:[]},{tag:"path",attr:{d:"M5 8.75A.75.75 0 0 1 5.75 8h11.5a.75.75 0 0 1 0 1.5H5.75A.75.75 0 0 1 5 8.75Zm0 4a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5h-5.5a.75.75 0 0 1-.75-.75Z"},child:[]}]})(n)}function x9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12.672.668 3.059 6.197 6.838.993a.75.75 0 0 1 .416 1.28l-4.948 4.823 1.168 6.812a.75.75 0 0 1-1.088.79L12 18.347l-6.116 3.216a.75.75 0 0 1-1.088-.791l1.168-6.811-4.948-4.823a.749.749 0 0 1 .416-1.279l6.838-.994L11.327.668a.75.75 0 0 1 1.345 0Z"},child:[]}]})(n)}function A9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.38 8A9.502 9.502 0 0 1 12 2.5a9.502 9.502 0 0 1 9.215 7.182.75.75 0 1 0 1.456-.364C21.473 4.539 17.15 1 12 1a10.995 10.995 0 0 0-9.5 5.452V4.75a.75.75 0 0 0-1.5 0V8.5a1 1 0 0 0 1 1h3.75a.75.75 0 0 0 0-1.5H3.38Zm-.595 6.318a.75.75 0 0 0-1.455.364C2.527 19.461 6.85 23 12 23c4.052 0 7.592-2.191 9.5-5.451v1.701a.75.75 0 0 0 1.5 0V15.5a1 1 0 0 0-1-1h-3.75a.75.75 0 0 0 0 1.5h2.37A9.502 9.502 0 0 1 12 21.5c-4.446 0-8.181-3.055-9.215-7.182Z"},child:[]}]})(n)}function I9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 1.75V3h5.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H8V1.75C8 .784 8.784 0 9.75 0h4.5C15.216 0 16 .784 16 1.75Zm-6.5 0V3h5V1.75a.25.25 0 0 0-.25-.25h-4.5a.25.25 0 0 0-.25.25ZM4.997 6.178a.75.75 0 1 0-1.493.144L4.916 20.92a1.75 1.75 0 0 0 1.742 1.58h10.684a1.75 1.75 0 0 0 1.742-1.581l1.413-14.597a.75.75 0 0 0-1.494-.144l-1.412 14.596a.25.25 0 0 1-.249.226H6.658a.25.25 0 0 1-.249-.226L4.997 6.178Z"},child:[]},{tag:"path",attr:{d:"M9.206 7.501a.75.75 0 0 1 .793.705l.5 8.5A.75.75 0 1 1 9 16.794l-.5-8.5a.75.75 0 0 1 .705-.793Zm6.293.793A.75.75 0 1 0 14 8.206l-.5 8.5a.75.75 0 0 0 1.498.088l.5-8.5Z"},child:[]}]})(n)}function N9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5.09 10.121A5.251 5.251 0 0 1 1 5V3.75C1 2.784 1.784 2 2.75 2h2.364c.236-.586.81-1 1.48-1h10.812c.67 0 1.244.414 1.48 1h2.489c.966 0 1.75.784 1.75 1.75V5a5.252 5.252 0 0 1-4.219 5.149 7.01 7.01 0 0 1-4.644 5.478l.231 3.003a.5.5 0 0 0 .034.031c.079.065.303.203.836.282.838.124 1.637.81 1.637 1.807v.75h2.25a.75.75 0 0 1 0 1.5H4.75a.75.75 0 0 1 0-1.5H7v-.75c0-.996.8-1.683 1.637-1.807.533-.08.757-.217.836-.282a.5.5 0 0 0 .034-.031l.231-3.003A7.012 7.012 0 0 1 5.09 10.12ZM6.5 2.594V9a5.5 5.5 0 1 0 11 0V2.594a.094.094 0 0 0-.094-.094H6.594a.094.094 0 0 0-.094.094Zm4.717 13.363-.215 2.793-.001.021-.003.043a1.212 1.212 0 0 1-.022.147c-.05.237-.194.567-.553.86-.348.286-.853.5-1.566.605a.478.478 0 0 0-.274.136.264.264 0 0 0-.083.188v.75h7v-.75a.264.264 0 0 0-.083-.188.478.478 0 0 0-.274-.136c-.713-.105-1.218-.32-1.567-.604-.358-.294-.502-.624-.552-.86a1.22 1.22 0 0 1-.025-.19l-.001-.022-.215-2.793a7.069 7.069 0 0 1-1.566 0ZM19 8.578A3.751 3.751 0 0 0 21.625 5V3.75a.25.25 0 0 0-.25-.25H19ZM5 3.5H2.75a.25.25 0 0 0-.25.25V5A3.752 3.752 0 0 0 5 8.537Z"},child:[]}]})(n)}function O9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M1.75 4.5a.25.25 0 0 0-.25.25v.852l10.36 7a.25.25 0 0 0 .28 0l5.69-3.845A.75.75 0 0 1 18.67 10l-5.69 3.845c-.592.4-1.368.4-1.96 0L1.5 7.412V19.25c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25v-8.5a.75.75 0 0 1 1.5 0v8.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25V4.75C0 3.784.784 3 1.75 3h15.5a.75.75 0 0 1 0 1.5H1.75Z"},child:[]},{tag:"path",attr:{d:"M24 5.5a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"},child:[]}]})(n)}function P9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13 16.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm-2.517-7.665c.112-.223.268-.424.488-.57C11.186 8.12 11.506 8 12 8c.384 0 .766.118 1.034.319a.953.953 0 0 1 .403.806c0 .48-.218.81-.62 1.186a9.293 9.293 0 0 1-.409.354 19.8 19.8 0 0 0-.294.249c-.246.213-.524.474-.738.795l-.126.19V13.5a.75.75 0 0 0 1.5 0v-1.12c.09-.1.203-.208.347-.333.063-.055.14-.119.222-.187.166-.14.358-.3.52-.452.536-.5 1.098-1.2 1.098-2.283a2.45 2.45 0 0 0-1.003-2.006C13.37 6.695 12.658 6.5 12 6.5c-.756 0-1.373.191-1.861.517a2.944 2.944 0 0 0-.997 1.148.75.75 0 0 0 1.341.67Z"},child:[]},{tag:"path",attr:{d:"M9.864 1.2a3.61 3.61 0 0 1 4.272 0l1.375 1.01c.274.2.593.333.929.384l1.686.259a3.61 3.61 0 0 1 3.021 3.02l.259 1.687c.051.336.183.655.384.929l1.01 1.375a3.61 3.61 0 0 1 0 4.272l-1.01 1.375a2.106 2.106 0 0 0-.384.929l-.259 1.686a3.61 3.61 0 0 1-3.02 3.021l-1.687.259a2.106 2.106 0 0 0-.929.384l-1.375 1.01a3.61 3.61 0 0 1-4.272 0l-1.375-1.01a2.106 2.106 0 0 0-.929-.384l-1.686-.259a3.61 3.61 0 0 1-3.021-3.02l-.259-1.687a2.106 2.106 0 0 0-.384-.929L1.2 14.136a3.61 3.61 0 0 1 0-4.272l1.01-1.375c.201-.274.333-.593.384-.929l.259-1.686a3.61 3.61 0 0 1 3.02-3.021l1.687-.259c.336-.051.655-.183.929-.384Zm3.384 1.209a2.11 2.11 0 0 0-2.496 0l-1.376 1.01a3.61 3.61 0 0 1-1.589.658l-1.686.258a2.111 2.111 0 0 0-1.766 1.766l-.258 1.686a3.614 3.614 0 0 1-.658 1.59l-1.01 1.375a2.11 2.11 0 0 0 0 2.496l1.01 1.376a3.61 3.61 0 0 1 .658 1.589l.258 1.686a2.11 2.11 0 0 0 1.766 1.765l1.686.26a3.613 3.613 0 0 1 1.59.657l1.375 1.01a2.11 2.11 0 0 0 2.496 0l1.376-1.01a3.61 3.61 0 0 1 1.589-.658l1.686-.258a2.11 2.11 0 0 0 1.765-1.766l.26-1.686a3.613 3.613 0 0 1 .657-1.59l1.01-1.375a2.11 2.11 0 0 0 0-2.496l-1.01-1.376a3.61 3.61 0 0 1-.658-1.589l-.258-1.686a2.111 2.111 0 0 0-1.766-1.766l-1.686-.258a3.614 3.614 0 0 1-1.59-.658Z"},child:[]}]})(n)}function L9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M241.063 54.406c-2.31.008-4.61.032-6.907.094-1.805.05-3.61.106-5.406.188-8.814 1.567-12.884 5.426-15.094 9.843-2.435 4.87-2.34 11.423.375 17.25 2.717 5.83 7.7 10.596 14.657 12.376 6.958 1.78 16.536.86 29.125-7.187l10.063 15.75c-15.818 10.11-31.124 12.777-43.813 9.53-12.688-3.247-22.103-12.123-26.968-22.563-4.584-9.836-5.426-21.376-1.03-31.624-42.917 6.94-81.777 23.398-111.626 46.562-9.81 10.688-10.77 23.11-6.47 31.594 4.83 9.526 16.21 16.48 38.97 9.28l5.656 17.813c-28.58 9.04-52.137-.588-61.28-18.625-2.23-4.397-3.592-9.156-4.127-14.063-4.814 5.712-9.16 11.658-13 17.844l.126.06c-8.614 19.616-8.81 33.203-5.376 42.032 3.436 8.83 10.635 14.44 21.72 17.532 22.168 6.18 58.065-1.277 83.343-20.156 10.82-8.08 21.077-27.677 21.97-42.875.445-7.6-1.165-13.604-4.345-17.438-3.18-3.834-8.272-6.703-18.813-6.594l-.187-18.686c14.487-.15 26.25 4.754 33.375 13.344 7.124 8.59 9.26 19.652 8.625 30.468-1.27 21.633-12.595 44.172-29.438 56.75-29.876 22.314-69.336 31.606-99.53 23.188-13.988-3.9-26.37-12.386-32.75-25.53-9.546 45.446 4.323 87.66 30.718 116.874 3.45 3.82 7.122 7.43 10.97 10.78-2.754-7.887-4.016-16.1-3.72-24.093.53-14.325 6.082-28.346 17.22-38.03 9.134-7.946 21.752-12.53 36.843-12.5 1.006 0 2.034.018 3.062.06 2.35.1 4.763.304 7.22.626l-2.44 18.532c-15.588-2.048-25.705 1.522-32.436 7.375-6.73 5.854-10.443 14.614-10.813 24.625-.74 20.024 12.07 43.406 39.69 50.188l-.032.188c27.192 5.19 57.536.372 88-18.22.018-.012.043-.017.062-.03 6.34-4.45 9.755-8.808 11.438-12.563 1.985-4.432 1.943-8.292.53-12.438-2.824-8.29-12.94-16.812-22.218-19.187-15.002-3.84-24.532 1.436-29 7.72-4.468 6.28-4.74 12.45 2.156 17.81l-11.47 14.75c-14.187-11.033-15.092-30.487-5.905-43.405 6.892-9.688 18.985-16.326 33.564-16.75.607-.018 1.228-.036 1.844-.03 4.306.03 8.79.622 13.437 1.81 15.505 3.97 29.84 15.277 35.28 31.25 1.416 4.155 2.09 8.69 1.876 13.314 16.71-8.538 34.332-16.12 52.282-21.814 30.156-13.78 43.23-37.938 42.72-58.28-.515-20.493-13.187-37.74-42.376-40.626l1.844-18.594c36.666 3.626 58.462 29.848 59.188 58.75.422 16.84-5.754 34.363-18.188 49.28 16.072-1.8 32.044-1.495 47.53 1.627-3.152-6.472-4.68-13.478-4.467-20.438.677-22.036 19.42-42.593 48.875-42.906 1.963-.022 3.974.053 6.03.218l-1.5 18.625c-24.927-1.998-34.3 11.086-34.718 24.656-.412 13.42 8.545 28.442 34.22 30.436 28.3.25 48.588-15.098 58.53-37.906 13.31-30.536 6.997-76.317-34.844-118.188-.792-.793-1.578-1.593-2.375-2.375-.444 3.792-1.424 7.443-2.842 10.844-7.25 17.39-24.233 29.128-41.875 32.407-24.335 4.522-44.29-5.347-53.5-20.406-9.21-15.057-6.792-36.35 9.78-47.56l10.47 15.5c-8.913 6.028-9.28 14.19-4.313 22.31 4.967 8.122 16.17 15.156 34.156 11.814 11.306-2.102 23.896-11.33 28.03-21.25 2.07-4.96 2.47-9.862.408-15.47-1.675-4.555-5.187-9.764-11.72-15.25l-.187-.155c-27.316-20.587-56.338-35.393-85.75-45.157.018.032.045.06.063.093 6.684 12.22 7.18 26.082 3.063 38.344-8.233 24.525-34.07 43.848-66.032 42.78-6.948-.23-13.56 3.12-19.186 9.657-5.627 6.537-9.735 16.113-10.688 26.313-1.905 20.4 6.923 42.886 41.344 54L277 258.28c-41.083-13.264-56.83-45.546-54.22-73.5 1.307-13.975 6.706-26.962 15.157-36.78 8.452-9.818 20.475-16.603 33.97-16.156 24.04.802 42.323-14.084 47.687-30.063 2.682-7.988 2.335-15.937-1.75-23.405-3.968-7.252-11.83-14.423-25.906-19.656-17.114-2.967-34.16-4.367-50.875-4.314zM342.28 306.344c-41.915 3.41-87.366 23.4-125.28 46.562-55.98 34.198-114.89 26.733-156.688-4.28 16.444 58.844 74.712 70.788 135.5 55.905 6.083-2.285 12.06-6.538 17.157-12.03 7.057-7.607 12.17-17.47 13.78-25.625l18.344 3.625c-2.445 12.383-9.078 24.666-18.406 34.72-8.95 9.645-20.61 17.35-34.094 19.374-6.766 15.07-12.334 29.68-14.594 39.906-3.55 16.06 14.206 22.225 22.156 6.03 19.022-38.743 45.87-73.23 79.406-102.967 26.064-17.153 48.406-38.303 62.72-61.22z"},child:[]}]})(n)}function D9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M196.38 16.29l12.018 214.677-69.382-213.75h-19.65l70.52 217.25c-17.16-18.22-34.434-44.74-52.243-80.246 18.864 62.058 35.573 139.067 40.552 192.04L19.38 62.393v38.277l144.89 258.98c-33.493-21.316-67.86-56.375-97.918-92.87 26.712 52.73 55.26 104.847 73.076 160.54L19.378 289.453v28.46l107.997 124.026C99 434.69 70.625 422.05 42.25 408.165c38.03 26.607 62.036 50.897 84.234 85.82H230.84l-6.785-91.082H197.77c0-44.845 2.87-108.728 40.767-115.86-6.993-8.433-11.533-20.27-11.533-33.523 0-23.93 14.228-43.758 32.45-46.127h.005c.303-.038.61-.056.923-.063.934-.02 1.895.063 2.83.063 19.957 0 36.205 20.602 36.205 46.128 0 12.928-4.304 24.595-10.996 32.99 41.4 6.42 40.496 71.424 40.496 116.394h-24.94l-6.003 91.082h90.96c19.418-30.77 60.864-56.727 96.524-75.234-38.585 10.67-75.927 17.602-109.66 21.02l117.97-86.97v-23.218l-125.78 92.728c24.4-49.363 55.902-88.075 90.164-122.648-40.56 27.323-73.25 37.7-107.027 43.785L493.77 158.7v-30.58L339.297 328.19c1.19-51.24 16.946-114.427 39.156-171.047-17.383 25.054-33.876 46.073-49.713 62.742l56.406-202.668h-19.398l-53.412 191.906 3.832-192.834h-119.79z"},child:[]}]})(n)}function k9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M115.703 19.684C74.03 56.01 47.746 108.598 47.746 167.047c0 59.615 27.327 113.03 70.47 149.428-2.24-9.474-3.615-19.306-4.03-29.4-29.71-31.86-47.75-73.932-47.75-120.028 0-60.944 31.49-114.743 79.876-147.363h-30.61zm245.98 0c48.38 32.614 79.874 86.417 79.874 147.363 0 44.114-16.52 84.543-43.98 115.863-.15 10.162-1.272 20.075-3.272 29.645 40.52-36.26 65.94-88.003 65.94-145.508 0-58.446-26.263-111.034-67.93-147.363h-30.633zM259.616 21.13c-1.22.046-2.1.16-2.627.16-22.966 0-42.474 13.933-54.28 34.743 5.434-2.258 11.378-3.512 17.602-3.512 2.635 0 5.216.238 7.733.667 8.205-8.343 18.363-13.208 28.945-13.208 2.87 0 4.478-.11 4.53-.103l.09.014.09.012c8.883 1.155 17.385 5.918 24.452 13.31 2.568-.448 5.204-.69 7.895-.69 6.14 0 12.004 1.224 17.377 3.423-10.47-18.69-27.132-31.908-47.215-34.556-1.847-.27-3.393-.303-4.593-.26zm-58.758.925C139.302 43.72 95.366 100.54 95.366 167.23c0 26.838 7.12 52.075 19.633 74.07 4.785-43.393 27.372-81.088 59.895-104.857-4.985-11.973-7.76-25.238-7.76-39.2 0-30.428 13.17-57.555 33.724-75.188zm112.966.884c19.968 17.648 32.7 44.38 32.7 74.304 0 14.4-2.955 28.06-8.24 40.324 31.91 23.98 53.94 61.508 58.454 104.57 12.815-22.19 20.12-47.727 20.12-74.908 0-65.8-42.768-121.992-103.034-144.29zm-93.514 48.27c-15.31 0-27.52 12.21-27.52 27.522 0 15.31 12.21 27.522 27.52 27.522 15.31 0 27.524-12.21 27.524-27.522 0-15.31-12.213-27.523-27.524-27.523zm73.735 0c-15.31 0-27.522 12.21-27.522 27.522 0 15.31 12.21 27.522 27.522 27.522 15.31 0 27.523-12.21 27.523-27.522 0-15.31-12.212-27.523-27.523-27.523zm-96.818 67.495c1.458 3.72 3.135 7.29 5.014 10.688-28.76 10.036-47.118 36.23-56.088 67.806-10.313 36.304-9.78 80.714-1.82 123.044l1.432 7.617h38.28l.354 5.406.04 4.084.23-.002 9.09 137.91h122.584l10.408-139.71.385.003.038-5.708.148-1.98h40.32l1.543-7.446c9.072-43.706 8.052-87.865-3.38-123.508-9.866-30.763-28.282-55.794-54.945-66.185 2.144-3.686 4.042-7.593 5.68-11.678-6.67 3.75-14.344 5.898-22.498 5.898-.516 0-1.025-.03-1.537-.047-1.22 1.83-2.504 3.576-3.858 5.21l-10.125 12.212 15.59 2.934c25.758 4.847 43.76 25.75 53.9 57.363 9.523 29.697 11.076 68.077 4.198 106.557h-24.893l.64-91.475-18.687-.13-.78 111.488L299 476.568h-33.332V342.19H246.98V476.57h-35.72l-8.174-124.025-1.133-115.002-18.69.185.903 91.447h-22.713c-6.188-37.77-5.89-76.687 2.682-106.865 9.15-32.208 26.076-53.426 54.59-57.848l15.91-2.47L224.6 149.4c-1.133-1.42-2.22-2.92-3.256-4.488-.345.008-.685.03-1.03.03-8.396 0-16.28-2.28-23.085-6.237z"},child:[]}]})(n)}function M9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M272.95 16.707c-151.29 47.714 57.322 110.88-26.536 131.344C190.7 161.648 137.3 96.283 192.947 45.313c-90.766 32.524-66.292 89.67-12.396 113.25 34.31 15.01 31.884 61.38 8.643 64.637 46.37-54.285-116.637-44.737-86.03-147.47-126.44 158.063 132.535 163.37 51.6 273.194 16.4-51.26-51.074-33.42-65.52-77.88-48.557 115.975 86.87 96.047 107.81 222.95h36.394l-7.375-108.703H196.93c0-49.724 3.178-108.336 45.2-116.245-7.75-9.352-12.786-24.51-12.786-39.207 0-26.536 15.774-48.523 35.98-51.15h.002c1.348-.17 2.78 0 4.164 0 22.13 0 40.145 22.846 40.145 51.15 0 14.334-4.772 29.304-12.192 38.613 45.905 7.12 44.903 66.976 44.903 116.84H314.69l-6.524 108.704h36.752c14.29-138.24 137.056-121.245 77.576-235.742 9.728 46.034-32.646 93.67-53.514 52.13-19.04-37.903 125.515-105.092 70.21-215.175 4.588 81.484-114.155 120.303-118.663 65.824 52.768 23.022 73.61-45.905 30.02-71.985-40.69-24.346-116.444-36.76-77.596-72.338zm69.488 20.635c44.895 15.685 63.888 78.675 48.73 110.674 18.238-3.568 70.807-106.98-48.73-110.674z"},child:[]}]})(n)}function j9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M250.9 18.9c-23.9 2.99-45.3 30.65-45.3 66.99 0 19.91 6.8 37.41 16.8 49.61l12.2 14.5-18.7 3.5c-13 2.5-22.6 9.5-30.7 20.8-8.5 11.5-14.8 26.9-19.1 45.2-8 32.7-9.9 72.7-9.9 108.2h43.6l11.7 160.5c30.4 7 63.1 6.5 92.3 0l10.7-160.5H356c0-35.7-.5-76.4-7.8-109.7-3.9-17.9-10-33.7-18.2-45.1-8.2-11.1-18.5-17.8-33.3-20.1l-18.9-3 11.9-14.9c9.9-12.1 16.4-29.6 16.4-49.01 0-38.54-24-66.99-50.3-66.99h-4.9zm145 3.59v41.85h-41.8v50.16h41.8v41.6h49.9v-41.6h41.9V64.34h-41.9V22.49h-49.9zM52.92 62.89v30.58H22.39v36.63h30.53v30.4h36.4v-30.4h30.58V93.47H89.32V62.89h-36.4zM92.63 199.7v21.8H70.75v26.3h21.88v21.9h26.27v-21.9h21.8v-26.3h-21.8v-21.8H92.63zm355.07 62.4v21.8h-21.9v26.3h21.9v21.9H474v-21.9h21.8v-26.3H474v-21.8h-26.3zm-307.5 99.4v15h-15v18h15v15h18.1v-15h15v-18h-15v-15h-18.1zm230 45.8v15h-15v18h15v15h18v-15h15v-18h-15v-15h-18zM49.32 431.8v15h-15v18h15v15h18.01v-15h15v-18h-15v-15H49.32z"},child:[]}]})(n)}function U9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M54.53 118.73c-15.623 74.884 20.42 123.6 64.126 150.56-33.063-7.81-65.052-19.483-98.25-36.845 25.5 77.488 81.165 95.816 129.906 90.75-26.933 14.252-55.392 25.302-83.937 32.782 69.446 43.143 120.11 16.458 148.27-21.317a586.15 586.15 0 0 0-6.217-5.498c-5.193-3.697-10.128-7.95-14.778-12.71-5.968-5.095-12.045-10.295-18.173-15.73-33.648-29.837-67.978-65.614-69.43-112.83-.002-.05 0-.1-.002-.15-19.147-22.057-36.472-45.304-51.514-69.013zm402.94 0c-15.04 23.705-32.368 46.943-51.515 68.993 0 .026.003.05.004.078 1.388 45.967-33.476 82.66-67.968 113.386-13.87 12.355-27.86 23.824-39.904 34.44 28.298 37.26 78.683 63.125 147.54 20.35-28.543-7.48-56.98-18.53-83.91-32.78 48.737 5.056 104.38-13.28 129.876-90.75-33.197 17.363-65.187 29.036-98.25 36.845 43.705-26.962 79.75-75.675 64.125-150.56zm-132.42 3.977c-22.146.17-45.395 11.85-61.025 38.36l-7.783 13.2-7.736-13.228c-19.473-33.286-54.394-43.623-82.15-35.75h-.01c-24.486 6.947-43.386 26.957-42.307 62.048 1.187 38.61 30.602 70.852 63.38 99.918 16.39 14.533 33.36 28.123 47.412 41.52 8.357 7.968 15.777 15.842 21.332 24.142 5.568-7.718 12.923-15.143 21.217-22.86 14.382-13.384 31.856-27.363 48.64-42.314 33.567-29.9 63.045-63.115 61.95-99.398-1.118-36.974-22.723-58.38-48.618-64.127a63.71 63.71 0 0 0-14.303-1.513z"},child:[]}]})(n)}function F9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480.25 156.355c0 161.24-224.25 324.43-224.25 324.43S31.75 317.595 31.75 156.355c0-91.41 70.63-125.13 107.77-125.13 77.65 0 116.48 65.72 116.48 65.72s38.83-65.73 116.48-65.73c37.14.01 107.77 33.72 107.77 125.14z"},child:[]}]})(n)}function B9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M262.82 18.514c-1.538-.042-3.118.125-4.656.125-32.843 0-59.586 33.905-59.586 75.917 0 21.273 7.083 40.47 18.096 54.287-7.947 1.232-15.16 3.625-21.688 7.004l-.066-.465c-21.085 10.394-34.678 31.075-42.815 58.777-4.388 14.94-6.894 31.782-7.736 49.553-.034.657-.06 1.32-.087 1.978-.037.938-.092 1.866-.12 2.808l.013-.016c-.013.397-.022.795-.033 1.192l-.014-.004c-.01.333-.01.67-.017 1.004-.565 22.66 1.55 46.508 5.914 69.724h23.56L172.57 237.02l1.785-1.98 16.883-.165 1.248 126.938 8.74 132.626h46.895V318.847h18.69v175.59h44.32l11.475-154.04h.055l1.035-105.523 15.606.154 3.05 3.376-1 101.992h24.51c16.256-78.303.03-158.175-47.17-183.627l-.13-.073v.002c-6.087-3.265-12.68-5.636-19.79-6.973 11.508-13.88 18.98-33.36 18.98-55.17 0-39.388-23.415-72.02-53.406-75.918h-.002c-.5-.076-1.01-.112-1.522-.126zm-138.877.062l21.733 94.787 26.586 34.713c5.16-4.086 10.777-7.594 16.855-10.437-5.548-13.12-8.664-27.926-8.664-43.45 0-1.243.037-2.476.076-3.71l-56.587-71.904zm265.782 0l-53.29 67.72c.18 2.61.29 5.237.29 7.893 0 16.542-3.534 32.27-9.786 46.005 4.808 2.61 9.335 5.635 13.568 9.05l27.484-35.886 21.733-94.784zM64.037 81.902l46.19 76.31 37.8 18.202c3.21-5.437 6.79-10.53 10.748-15.215l-32.15-41.975-62.588-37.323zm385.594 0l-62.59 37.325-33.08 43.19c3.828 4.506 7.336 9.376 10.52 14.556l38.96-18.762 46.19-76.308zm-420.86 78.46l53.515 42.034 51.88 6.526.01-.027c1.59-5.413 3.44-10.67 5.54-15.74L93.58 170.936 28.77 160.36zm456.128 0l-64.814 10.577-46.938 22.603c2.152 4.86 4.08 9.896 5.776 15.074.04.12.076.243.115.363l52.346-6.584 53.515-42.035zM80.305 220.98l-59.866 11.48 76.238 27.143 28.87 4.44c.554-12.688 1.93-25.047 4.212-36.84l-49.455-6.223zm353.058 0l-49.36 6.21c2.63 11.738 4.363 24.043 5.257 36.677l27.734-4.266 76.236-27.143-59.867-11.478zm-339.418 57.11l-74.814 52.72 87.286-.964 20.588-18.703c-.95-9.458-1.526-18.897-1.693-28.23l-31.365-4.823zm325.778 0l-29.746 4.574c.063 10.024-.368 20.174-1.262 30.342l18.537 16.84 87.285.964-74.814-52.72zm-334.01 78.01l-51.61 58.302 75.004-20.424 22.9-37.56-46.294-.318zm341.746 0l-46.294.318 22.898 37.56 75.004 20.424-51.61-58.302zM159.49 400.455L121.346 419.7l-11.664 69.577 50.79-48.36-.98-40.462zm194.186 0l-.977 40.46 50.788 48.362-11.664-69.578-38.146-19.245z"},child:[]}]})(n)}function V9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M51.34 23.63l-6.68 16.72 80.04 32.01 6.6-16.72-79.96-32.01zm409.36.01l-80 32 6.6 16.72 80-32-6.6-16.72zM256 25c-29 0-50 14.08-64.7 34.29C176.6 79.51 169 106 169 128c0 13 7 27.8 14.5 39s14.9 18.6 14.9 18.6l1.5 1.5 9.3 27.9H228L194.7 98.07 256 118.5l61.3-20.43L284 215h18.8l9.3-27.9 1.5-1.5s7.4-7.4 14.9-18.6c7.5-11.2 14.5-26 14.5-39 0-22-7.6-48.49-22.3-68.71C306 39.08 285 25 256 25zm128 94v18h96v-18h-96zm-352 .1v18h96v-18H32zm189.3 6.8l25.5 89.1h18.4l25.5-89.1-34.7 11.6-34.7-11.6zm166 57.7l-6.6 16.8 80 32 6.6-16.8-80-32zm-262.6.1l-80.04 32 6.68 16.8 79.96-32-6.6-16.8zM217 233v14h78v-14h-78zm0 32v14h78v-14h-78zm-46.9 2.6c-27.1.5-52.6 5-66.9 11.1L29.8 484.1c71.1-14.1 143.9-26 217.2-.9V297h-48v-28.3c-7.9-.7-16-1.1-23.9-1.1h-5zm166.8 0c-7.9 0-16 .4-23.9 1.1V297h-48v186.2c73.3-25.1 146.1-13.2 217.2.9l-73.4-205.4c-14.3-6.1-39.8-10.6-66.9-11.1h-5z"},child:[]}]})(n)}function z9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M282.063 20.938c-18.876 0-33.875 15.56-33.875 34.437 0 18.877 15 33.875 33.875 33.875s33.875-14.998 33.875-33.875c0-18.875-15-34.438-33.875-34.438zM129.905 82.094c-18.875 0-33.875 15.59-33.875 34.47 0 18.876 15 33.874 33.876 33.874 18.875 0 33.875-14.998 33.875-33.875 0-18.876-15-34.47-33.874-34.47zm284.281 22.656c-18.875 0-33.875 15.59-33.875 34.47 0 18.876 15 33.874 33.875 33.874 18.876 0 33.875-14.998 33.875-33.875 0-18.877-15-34.47-33.875-34.47zm-162.25 57.563c-3.24-.003-6.51.42-9.718 1.28-25.657 6.875-39.12 39.755-30.095 73.438 3.502 13.072 9.883 24.315 17.875 32.814-19.225 4.532-34.137 13.467-40.5 24.5l-.406-.094-41.594 64.438-50.688-21.938c-29.376-16.12-61.575 24-30.624 41.688l94.468 44.062 38.03-50.063c21.493 38.735 15.748 77.484-25.124 116.25H342.75c-39.82-38.2-42.438-76.424-23.28-114.625l36.81 48.438 94.47-44.063c11.635-6.65 14.334-16.47 11.625-25.28-8.184 5.26-17.915 8.343-28.344 8.343-14.224 0-27.118-5.72-36.592-14.938l-28 12.125-41.594-64.437h-.03c-5.48-9.417-17.226-17.278-32.533-22.188 11.58-14.222 15.924-36.9 9.75-59.937-7.896-29.473-30.4-49.798-53.092-49.813zm-164.125 61.03c-18.875 0-33.874 15.56-33.874 34.438 0 18.88 15 33.876 33.874 33.876 18.876 0 33.876-14.997 33.876-33.875 0-18.874-15-34.436-33.876-34.436zm346.22 51.126c-18.876 0-33.876 15.59-33.876 34.467 0 18.878 15 33.875 33.875 33.875 18.876 0 33.876-14.997 33.876-33.875 0-18.875-15-34.468-33.875-34.468z"},child:[]}]})(n)}function H9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M263.375 19.375c-11.768 0-22.676 6.137-31.156 17.22-7.267 9.494-12.397 22.54-13.72 37.25 11.14-4.926 22.473-7.91 33.813-9V83.25c-10.965 1.377-22.008 5.008-33.157 11.03 1.968 12.487 6.703 23.502 13.063 31.814 8.48 11.082 19.387 17.22 31.155 17.22s22.707-6.138 31.188-17.22c6.167-8.06 10.783-18.667 12.843-30.688-12.07-6.832-24.194-10.997-36.406-12.344V64.75c12.676 1.087 25.22 4.516 37.344 10.188-1.155-15.158-6.336-28.614-13.78-38.344-8.482-11.082-19.42-17.22-31.19-17.22zm-46.594 117.25c-10.442 4.8-18.39 11.182-22.593 18.47l-.375-.095-41.625 64.438-50.656-21.97c-29.375-16.118-61.574 24-30.624 41.688l94.47 44.063 38.03-50.064c18.7 33.703 16.77 67.43-10.97 101.156-8.344-.642-16.37-.958-23.967-.906-40.312.278-68.942 10.254-73.907 28.78l.03.002c-4.44 16.58 10.992 36.67 39.126 55.28 55.675 29.297 95.38 38.468 156.968 42.344h1.562l.438.125c.424.026.823.07 1.25.094l-.032.314 92.063 28.72-22.19-53.72L183.595 375.5l5.875-17.72 71.81 23.845 71.845-23.844L339 375.5l-48.094 15.97 94.438 31.374c33.494-20.046 52.528-42.468 47.656-60.656-5.95-22.21-45.925-32.107-99.25-27.782-26.392-33.215-26.196-66.41-9.53-99.625L361 283.22l94.47-44.064c30.95-17.687-1.25-57.806-30.626-41.687l-50.688 21.968L332.562 155h-.062c-4.217-7.246-12.135-13.596-22.53-18.375-.2.27-.392.547-.595.813-11.268 14.725-27.633 24.562-46 24.562s-34.732-9.837-46-24.563c-.203-.265-.394-.543-.594-.812zm-63.686 311l-16.72 40.5 69.876-21.78c-17.624-4.574-34.93-10.634-53.156-18.72z"},child:[]}]})(n)}function G9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 28l-32 128c-32-16-64-48-96-96 0 48 0 96 32 128-32 17-64 0-96-32 0 32 0 80 48 112-32 16-64 0-80-32 0 48 16 96 48 128-16 16-48 0-64-16 0 64 48 112 112 144h76.8l16.7-68.6-17.2-86.1-97.9 5s20.3-75.2 34.9-103.7c5-9.6 7.2-18 20-18.3 11.3 0 20.4 9.8 20.4 21.9 0 12-9.1 21.8-20.4 21.8-2.3 0-4.6-.5-6.6-1.3l-5.1 46.8c29.6-8.9 56.9-18.8 84-30.9 0-.1-.1-.2-.1-.3-6.2-8.8-10.4-21.5-10.4-35.7 0-14.1 4.1-26.8 10.4-35.7 6.1-8.9 14.1-13.7 22.5-13.7 8.5 0 16.5 4.8 22.6 13.7 6.2 8.9 10.2 21.6 10.2 35.7 0 14.2-4 26.9-10.2 35.7-.1.3-.5.7-.6.9 27.3 12.1 56.1 20.6 84.3 30.3l-5-46.8c-2.2.8-4.3 1.3-6.7 1.3-11.2 0-20.3-9.8-20.3-21.8 0-12.1 9.1-21.9 20.3-21.9 12.8.3 15.2 8.7 20 18.3 14.8 28.5 35 103.7 35 103.7l-97.9-5-17.2 86.1 16.7 68.6H384c64-32 112-80 112-144-16 16-48 32-64 16 32-32 48-80 48-128-16 32-48 48-80 32 48-32 48-80 48-112-32 32-64 48-96 32 32-32 32-80 32-128-32 48-64 80-96 96z"},child:[]}]})(n)}function W9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M206.28 20.75l40.75 18.406v95.625l11 17.907 12.75-17.906V39.157l40.75-18.406H206.28zm-81.874 32.28L49.97 127.438l41.843-15.78 67.624 67.624 21.657 3.657-4.875-20.468-67.626-67.595 15.812-41.844zm264.281 0l15.782 41.845-67.626 67.594-4.875 20.468 21.686-3.657 67.594-67.624 41.844 15.78-74.406-74.405zM258.281 167.47c-18.774 0-35.987 9.647-49 26.28-13.01 16.633-21.374 40.158-21.374 66.313 0 27.096 9.278 51.387 23.188 68.156l10.125 12.217-15.595 2.938c-39.857 7.504-58.408 22.664-69.28 48.25-10.143 23.866-12.33 58.635-12.595 103.094h270.406c-.04-44.852-.605-80.457-9.812-104.626-9.865-25.894-27.82-41.064-71.28-47.906l-15.845-2.5 10-12.563c13.226-16.583 21.436-40.478 21.436-67.063 0-26.153-8.363-49.68-21.375-66.312-13.01-16.633-30.224-26.28-49-26.28zM35.407 206.78V312l18.438-40.75h95.594l17.906-12.72-17.906-11H53.844l-18.438-40.75zm446.97 0l-18.407 40.75h-95.626l-17.906 11 17.906 12.72h95.625L482.374 312V206.78z"},child:[]}]})(n)}function $9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M253.813 15.625c-132.32 0-239.782 107.46-239.782 239.78s107.463 239.782 239.782 239.782c132.32 0 239.782-107.46 239.782-239.78S386.132 15.624 253.814 15.624zm0 17.906c122.653 0 221.906 99.223 221.906 221.876 0 30.738-6.26 59.99-17.533 86.594l-42.343-34.72c-49.613 13.98-110.337 9.033-138.906-60.874l-41.97 152.938c-8.837-45.53-23.35-81.28-47.905-115.22-19.71 13.855-32.352 32.63-39.72 50.97L88.94 237.03c-17.85 27.32-33.77 56.565-45.032 90.47-7.744-22.6-11.968-46.852-11.968-72.094 0-26.013 4.484-50.973 12.687-74.156 2.752 6.608 9.27 11.25 16.875 11.25 10.093 0 18.28-8.157 18.28-18.25s-8.187-18.28-18.28-18.28c-2.385 0-4.66.48-6.75 1.31 27.537-55.83 77.83-98.368 138.844-115.5-.558 1.938-.844 3.98-.844 6.095 0 12.146 9.823 22 21.97 22 12.144 0 22-9.854 22-22 0-4.99-1.67-9.59-4.47-13.28 7.092-.683 14.29-1.064 21.563-1.064zm18.75 27.657c-6.444 0-11.657 5.213-11.657 11.657 0 6.443 5.213 11.687 11.656 11.687 6.444 0 11.688-5.243 11.688-11.686 0-6.444-5.244-11.656-11.688-11.656zM198.03 90.22c-6.02.06-12.132.868-18.218 2.5-38.945 10.434-62.06 50.46-51.625 89.405 10.436 38.946 50.463 62.06 89.407 51.625 21.712-5.818 38.48-20.85 47.28-39.75-6.835 7.36-15.737 12.958-26.155 15.75-29.504 7.905-59.846-9.59-67.75-39.094-7.907-29.504 9.62-59.813 39.124-67.72 10.41-2.788 20.906-2.417 30.5.533-12.28-8.598-27.116-13.405-42.563-13.25zm155.282.81c-9.408 0-17.03 7.624-17.03 17.032 0 9.41 7.622 17.032 17.03 17.032 9.41 0 17.032-7.623 17.032-17.03 0-9.41-7.623-17.033-17.03-17.033zm-248.937 27.376c-6.443 0-11.656 5.244-11.656 11.688 0 6.443 5.212 11.656 11.655 11.656s11.656-5.213 11.656-11.656c0-6.444-5.212-11.688-11.655-11.688zm275.688 40.813l-.625 29.843-28.22 9.812 28.22 9.813.625 29.843 18.03-23.78 28.563 8.625-17.03-24.5 17.03-24.53L398.094 183l-18.03-23.78zm-72.094 11.593c-6.445 0-11.658 5.212-11.658 11.656 0 6.442 5.213 11.686 11.657 11.686 6.442 0 11.686-5.244 11.686-11.687 0-6.445-5.244-11.657-11.687-11.657zm139 74.75c-6.445 0-11.658 5.244-11.658 11.687s5.213 11.656 11.657 11.656c6.442 0 11.686-5.213 11.686-11.656 0-6.443-5.244-11.688-11.687-11.688zm-127.314 3.5c-6.443 0-11.656 5.244-11.656 11.687s5.213 11.656 11.656 11.656c6.444 0 11.656-5.213 11.656-11.656 0-6.443-5.212-11.688-11.656-11.688z"},child:[]}]})(n)}function K9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M294.8 26.57L238 60.37l7.8 13.17L281 52.59 270.8 118l6.3 10.6L336 93.53l-7.8-13.17-37.3 22.14L301 37.12l-6.2-10.55zM147.1 60.55A224 224 0 0 0 32 256a224 224 0 0 0 224 224 224 224 0 0 0 214.9-161.2A208 208 0 0 1 320 384a208 208 0 0 1-208-208 208 208 0 0 1 35.1-115.45zm244.5 52.05l-6.9 16.5 44.1 18.4-68.3 35.9-5.5 13.2 73.7 30.8 6.9-16.5-46.7-19.5 68.3-35.9 5.5-13.2-71.1-29.7zm-115 64l-97.8 35 8.1 22.7 60.6-21.7-35.4 97.9 6.5 18.1L320 292.4l-8.1-22.7-64.2 23 35.4-97.9-6.5-18.2z"},child:[]}]})(n)}function q9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256.25 20.656c-32.78 0-64.03 6.79-92.438 19-8.182-10.618-20.994-17.468-35.437-17.468-24.716 0-44.78 20.033-44.78 44.75 0 8.356 2.324 16.18 6.31 22.874-42.638 42.655-69.093 101.49-69.093 166.282 0 129.617 105.823 234.72 235.438 234.72 129.615-.002 234.72-105.103 234.72-234.72 0-129.618-105.105-235.438-234.72-235.438zm0 19.313c119.515 0 216.094 96.607 216.094 216.124s-96.58 216.094-216.094 216.094c-119.515 0-216.813-96.577-216.813-216.094 0-59.568 24.176-113.438 63.22-152.5 7.273 5.113 16.15 8.094 25.718 8.094 24.716 0 44.75-20.034 44.75-44.75 0-3.453-.385-6.804-1.125-10.032C197.91 46 226.396 39.97 256.25 39.97zm-.125 51.81c-91.3 0-165.875 74.575-165.875 165.876 0 91.3 74.576 165.406 165.875 165.406 35.12 0 67.708-10.965 94.5-29.656 7.13 4.23 15.45 6.656 24.344 6.656 26.396 0 47.81-21.384 47.81-47.78 0-12.763-5.005-24.366-13.155-32.938 7.677-19.067 11.906-39.884 11.906-61.688 0-91.3-74.106-165.875-165.405-165.875zm0 19.126c81.2 0 146.78 65.55 146.78 146.75 0 17.833-3.172 34.924-8.967 50.72-5.81-2.513-12.237-3.907-18.97-3.907-26.396 0-47.78 21.414-47.78 47.81 0 10.59 3.454 20.362 9.28 28.283-23.065 15.084-50.66 23.843-80.343 23.843-81.2 0-147.22-65.55-147.22-146.75s66.02-146.75 147.22-146.75zm-1.063 19.625c-7.462 31.99-21.767 62.112-42.906 83.25-21.14 21.14-48.73 32.913-80.72 40.376 31.99 7.462 62.112 21.736 83.25 42.875 21.14 21.14 32.914 48.764 40.376 80.75 7.463-31.986 19.204-59.61 40.344-80.75 21.14-21.138 51.262-35.412 83.25-42.874-32.236-7.428-59.455-19.11-80.72-40.375-21.262-21.263-35.446-51.013-42.873-83.25zm.094 86.564c20.498 0 37.125 16.627 37.125 37.125 0 20.496-16.626 37.124-37.124 37.124-20.497 0-37.125-16.628-37.125-37.125 0-20.5 16.63-37.126 37.126-37.126z"},child:[]}]})(n)}function Y9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M122.7 23.32l1.7 21.87-16.7 14.25 21.4 5.17 8.4 20.25L149 66.18l21.8-1.75-14.2-16.71 5.1-21.32-20.3 8.35-18.7-11.43zM464 32a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zM239.8 42.5a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zm183.9 6.84c-9.2 1.74-17.7 7.18-25.9 14.28-7.6 6.53-14.7 14.66-20.7 23.45-18.8 3.01-37.6 10.67-50.2 21.13-16.1 13.2-30.4 35.8-38.2 59.1-7.4 3.1-14.4 6.8-20.1 10.8-15.5 10.9-23.5 31.8-29.4 50-5.9 18.3-8.8 34.3-8.8 34.3l17.8 3.2s2.7-15 8.1-31.9c5.5-16.9 14.8-35.3 22.7-40.8 1.3-.9 3-1.9 4.5-2.8-.6 5.7-.6 11.4.3 16.8 1.8 11.4 8 22.3 19 28.2 7.8 4.2 16.6 3.2 24 .2 7.4-3.1 14-8.2 19.7-14.2 5.7-6 10.4-13.1 13.2-20.6 2.8-7.5 3.8-16 .2-23.9h-.1c-3.9-8.4-11.4-13.8-19.4-16.1-8-2.3-16.6-2.2-25.2-.9-1.5.2-2.9.7-4.4 1 7.4-15.8 18-30.7 27.5-38.6 6.2-5.1 16.6-10 27.7-13.6-1.4 3.8-2.5 7.6-3 11.5-1.6 10.5.7 21.9 9.1 29.7 6.1 5.6 14.3 6.5 21.5 5.3 7.1-1.2 14-4.4 20.2-8.5 6.2-4.2 11.7-9.4 15.6-15.5 3.9-6.1 6.5-13.9 4-21.7v-.1c-3.3-10.07-11.5-16.99-20.6-20.27-3.9-1.4-8-2.19-12.2-2.66 2.9-3.26 5.9-6.31 8.9-8.92 6.8-5.84 13.7-9.5 17.6-10.23l-3.4-17.68zM174.8 84.39l-15.2 9.56 34.5 55.25-56.4 2.9 26.5 57.8 16.4-7.6-15.5-33.6 60.6-3.1-50.9-81.21zm216.4 19.31c6.1-.1 11.5.6 15.5 2.1 5.4 1.9 8.1 4.3 9.5 8.8.4 1.1.2 3.3-1.9 6.6-2.2 3.4-6.1 7.2-10.5 10.2-4.5 3-9.5 5.1-13.2 5.7-3.8.7-5.5 0-6.3-.7-3.5-3.2-4.5-7.2-3.5-13.9.8-5.4 3.3-11.9 7-18.6 1.2 0 2.3-.2 3.4-.2zM94.99 123a16 16 0 0 0-16 16 16 16 0 0 0 16 16A16 16 0 0 0 111 139a16 16 0 0 0-16.01-16zm356.11 37.2l-14.4 16.6-21.8-1.8 11.4 18.8-8.5 20.2 21.4-5 16.6 14.3 1.9-21.9 18.7-11.4-20.2-8.5-5.1-21.3zm-123.5 16.5c2.9.1 5.6.5 7.7 1.1 4.3 1.2 6.6 3 8.2 6.4.9 1.9 1 5.4-.7 10-1.7 4.7-5.2 10.1-9.4 14.6s-9.3 8.1-13.5 9.8c-4.2 1.7-6.8 1.6-8.5.7h-.1c-5.8-3.2-8.6-7.8-9.7-15.2-1-6.3-.3-14.3 1.8-22.9 4.9-1.7 9.8-3.1 14.5-3.8 3.5-.5 6.7-.7 9.7-.7zm-202.4 51.9c-7.2-.2-11.7 1.5-14.5 4.3-2.8 2.8-4.5 7.3-4.3 14.5.2 7.3 2.6 16.9 7.2 27.6 9.2 21.5 27.3 47.4 51.6 71.8 24.3 24.3 50.3 42.3 71.8 51.5 10.6 4.6 20.2 7 27.5 7.2 7.3.3 11.7-1.5 14.5-4.3 2.8-2.8 4.6-7.2 4.3-14.5-.2-7.3-2.6-16.9-7.2-27.6-9.2-21.4-27.2-47.4-51.5-71.7-24.3-24.4-50.3-42.4-71.8-51.6-10.7-4.6-20.3-7-27.6-7.2zm232 31.3l-33 54-29.1-27.9-12.4 13 45.1 43.3 33.8-55.2 38.7 32.3 89.3-38.2-7-16.6-79.3 34-46.1-38.7zM93.43 272.6l-17.64 57.9c41.41 49.1 89.71 76.7 142.11 94.7l21.6-6.6c-3.1-1.1-6.4-2.4-9.7-3.8-24.4-10.4-51.7-29.6-77.3-55.3-25.7-25.7-44.9-53-55.34-77.4-1.41-3.2-2.65-6.4-3.73-9.5zm-23.82 78.2l-14.01 46c28.89 27 59 39.2 90.6 50.2l43.4-13.2c-43.2-17.6-84-43.3-119.99-83zM368 352a16 16 0 0 0-16 16 16 16 0 0 0 16 16 16 16 0 0 0 16-16 16 16 0 0 0-16-16zM49.81 415.9l-20.29 66.6 88.28-26.9c-22.77-9.1-45.78-20.7-67.99-39.7z"},child:[]}]})(n)}function X9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M486 203.652H310.111L256 37.113l-54.111 166.539H26l142.22 103.623-54.462 167.612L256 371.24l142.242 103.646-54.473-167.612zm-85.995 28.008l-65.335 47.596-15.46-47.596h80.795zM256 127.708l24.658 75.91H231.33zM111.995 231.66h80.795l-15.45 47.596zm55.097 169.713l24.932-76.743 40.194 29.29zm34.041-104.762l21.1-64.951h67.524l21.099 64.95-54.867 39.977zm143.731 104.762l-65.082-47.454 40.194-29.29zm-37.983-264.359l-10.424-32.092a183.269 183.269 0 0 1 114.322 81.21H376.43a155.293 155.293 0 0 0-69.55-49.118zM129 371.328l-10.413 32.049a182.425 182.425 0 0 1-43.918-142.581l26.684 19.435v2.847A153.804 153.804 0 0 0 129 371.284zm177.104 58.108l26.64 19.413a182.447 182.447 0 0 1-153.51 0l26.64-19.413a154.79 154.79 0 0 0 100.23 0zM135.569 186.133h-34.348a183.269 183.269 0 0 1 114.322-81.21l-10.424 32.091a155.293 155.293 0 0 0-69.55 49.119zm303.12 96.955a181.922 181.922 0 0 1-45.276 120.245L383 371.285a153.804 153.804 0 0 0 27.68-88.197v-2.846l26.683-19.446a183.685 183.685 0 0 1 1.325 22.292z"},child:[]}]})(n)}function J9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M255.9 19.77C241.5 109.6 229.4 163 196.2 196.2c-33.2 33.2-86.6 45.3-176.43 59.7C109.6 270.3 163 282.4 196.2 315.7c33.2 33.2 45.3 86.6 59.7 176.5 14.4-89.9 26.5-143.3 59.7-176.6 33.3-33.2 86.7-45.3 176.6-59.7-89.9-14.4-143.3-26.5-176.5-59.7-33.3-33.2-45.4-86.6-59.8-176.43zM423 89c-45.8 33.1-81 56.9-112.4 70.2 5.1 9.4 11 17.4 17.8 24.2 6.8 6.8 14.8 12.7 24.3 17.9 13.4-31.4 37.2-66.6 70.3-112.3zm-333.94.06C122.2 134.8 145.9 169.9 159.2 201.2c9.4-5.1 17.4-11 24.2-17.8 6.8-6.8 12.7-14.8 17.8-24.2-31.3-13.3-66.4-37-112.14-70.14zM352.7 310.5c-9.5 5.2-17.5 11.1-24.3 17.9-6.8 6.8-12.7 14.8-17.9 24.3C342 366 377.2 389.8 423 423c-33.2-45.8-57-81-70.3-112.5zm-193.5.1C145.9 342 122.1 377.2 89 423c45.7-33.1 80.9-56.9 112.3-70.3-5.2-9.5-11.1-17.5-17.9-24.3-6.8-6.8-14.8-12.7-24.2-17.8z"},child:[]}]})(n)}function Q9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M65.125 18.344C47.11 49.844 36.72 86.262 36.72 125.124c0 80.293 43.973 150.497 109.124 187.75.403-6.904.92-13.833 1.625-20.75-55.33-34.965-92.064-96.676-92.064-167 0-39.426 11.63-75.964 31.563-106.78H65.124zm69.03 0c-25.61 28.273-41.374 65.635-41.374 106.78 0 51.08 24.052 96.656 61.44 125.97l.06-.25c1.612-6.61 3.473-13.008 5.69-19.125-29.73-25.896-48.5-64.026-48.5-106.595 0-42.848 19.254-80.837 49.436-106.78h-26.75zm210.532 0c30.125 25.95 49.438 64.003 49.438 106.78 0 41.152-17.546 78.157-45.563 103.97 2.26 6.282 4.116 12.876 5.657 19.687 35.748-29.366 58.592-73.883 58.592-123.655 0-41.123-15.81-78.5-41.406-106.78h-26.72zm73.407 0c20.06 30.867 32.094 67.387 32.094 106.78 0 69.457-35.82 130.505-90 165.69.545 7.037.933 14.107 1.187 21.123 64.267-37.483 107.53-107.18 107.53-186.812 0-38.925-10.745-75.328-28.874-106.78h-21.936zm-165.313 2.28c-57.625 0-104.53 46.906-104.53 104.532 0 28.606 11.56 54.573 30.25 73.47 4.13-4.712 8.84-8.817 14.094-12.19-15.844-15.56-25.656-37.237-25.656-61.28 0-47.527 38.316-85.844 85.843-85.844 47.528 0 85.845 38.317 85.845 85.844 0 23.16-9.108 44.114-23.938 59.53 5.488 3.14 10.394 7.033 14.688 11.533 17.327-18.666 27.938-43.657 27.938-71.064 0-57.626-46.905-104.53-104.532-104.53zm-4.186 55.564c-21.622 2.8-40.97 27.91-40.97 60.28 0 17.846 6.173 33.653 15.282 44.595l10.188 12.218-15.656 2.94c-11.884 2.226-20.62 8.512-28.032 18.655-7.41 10.143-13.023 24.216-16.97 40.406-7.188 29.5-8.736 65.498-8.967 97.126h38.999l.655 8.656 9.906 132.5h83.69l8.75-132.437.592-8.72h37.125c-.02-32-.39-68.49-6.906-98.217-3.57-16.297-8.992-30.34-16.5-40.375-7.505-10.035-16.654-16.288-29.967-18.344L273.875 193l10.094-12.625c8.713-10.89 14.592-26.495 14.592-43.906 0-34.515-21.658-60.22-45.468-60.22-2.672 0-4.275-.092-4.5-.063z"},child:[]}]})(n)}function Z9e(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 23.545c-33.5 0-63.525 15.197-83.55 39.053L92.7 38.313l60.85 56.867c-2.134 5.82-3.785 11.872-4.905 18.105L18.498 132.592 148.635 151.9c1.118 6.238 2.768 12.293 4.902 18.118L92.7 226.873l78.898-24.025c1.62-2.674 3.35-5.246 5.203-7.702 2.154-2.85 4.502-5.53 7.02-8.027-11.435-15.14-18.21-34.01-18.21-54.503 0-50.03 40.357-90.39 90.39-90.39 50.03 0 90.39 40.36 90.39 90.39 0 20.494-6.774 39.36-18.208 54.5 2.518 2.497 4.868 5.177 7.02 8.03 1.855 2.455 3.585 5.028 5.204 7.703l78.895 24.023-60.837-56.857c2.133-5.824 3.784-11.88 4.902-18.116l130.137-19.308-130.147-19.307c-1.12-6.232-2.77-12.283-4.906-18.103l60.85-56.87-79.75 24.286C319.52 38.743 289.5 23.545 256 23.545zm.002 45.182c-23.1 0-42.257 23.548-45.89 54.412h36.544v18.686H209.85c1.698 19.243 9.403 35.878 20.408 46.133H219.94c-11.947 2.392-20.787 8.595-28.223 18.446-7.56 10.013-13.304 23.86-17.34 39.875-7.365 29.223-8.98 65.15-9.22 97.33h39.972l10.32 149.056h81.103l10.322-149.057h39.973c-.24-32.18-1.856-68.107-9.22-97.33-4.037-16.014-9.782-29.86-17.34-39.874-7.437-9.85-16.278-16.054-28.226-18.447h-10.316c11.005-10.256 18.71-26.89 20.408-46.134h-36.81V123.14h36.547c-3.633-30.865-22.79-54.413-45.888-54.413z"},child:[]}]})(n)}function eje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M418.176 280.486c21.38-30.735 42.538-61.17 64.123-92.267-30.341-4.086-59.886-8.048-89.888-12.134 13.6-39.089 26.955-77.509 40.735-117.15-41.247 23.546-81.281 46.413-121.716 69.462-10.34-34.333-20.703-68.359-31.223-103.298-18.23 32.498-35.798 63.965-53.603 95.676-33.719-32.262-66.83-64.029-101.163-96.841 7.803 45.31 15.426 89.155 22.986 133.733-43.964-7.009-86.833-13.655-130.986-20.553 31.892 37.199 63.052 73.548 94.4 110.197-27.932 25.67-55.681 51.161-84.029 77.383 36.648 8.173 71.958 16.16 108.18 24.332-13.236 29.451-26.221 58.358-39.577 88.061 23.718-6.284 26.68-7.016 49.303-13.118 0 0 22.35-68.463 32.866-84.747 4.806-7.29 5.267-13.96 3.675-22.182-6.668-34.118-12.749-68.32-19.108-102.447-.39-1.934-.47-3.335 1.543-4.647 23.978-16.689 36.344-21.244 73.797-47.78 17.295 19.699 34.47 39.477 51.997 59.647a2368.384 2368.384 0 0 0-17.837 16.364c-.46.46-1.622.69-2.324.46-6.52-1.943-13.03-3.876-19.588-5.968-7.708-7.292-13.68-15.293-19.808-21.482-1.703 6.36-3.456 12.327-4.887 18.457 8.984 10.945 11.236 14.184 16.904 19.77 1.162 1.17 1.861 3.024 1.861 4.576 1.549 31.612.61 62.646 2.134 89.81 3.374.932 6.439 1.703 10.196 2.795-.773-34.13-1.353-67.71-2.244-101.52 2.053 0 3.995 1.012 5.618 3.877 19.688 32.305 37.333 64.041 54.95 93.455 2.944-1.712 5.858-3.415 8.843-5.127-1.513 4.573-6.594 10.905-9.314 14.822-9.388 14.727-25.093 22.027-37.995 30.863-15.624 24.762-28.247 50.076-38.257 67.658l14.789 37.443c.37.118 26.19-39.152 38.908-59.09 21.19 18.717 41.987 37.136 63.39 56.035 1.55-41.042 3.196-80.801 4.692-121.048 44.704 3.844 88.763 7.623 134.04 11.53-26.01-32.444-51.169-63.604-76.383-95.007zm-164.443-117.08c12.948-8.062 25.587-15.822 38.506-23.725 6.389 11.007 12.479 21.863 18.646 32.878-10.625 6.59-21.17 13.189-32.107 19.849-8.181-9.614-16.593-19.147-25.045-29.002zm51.184 59.027c-6.29-7.37-12.568-14.512-19.197-22.183 11.055-6.75 22.062-13.57 33.307-20.48 5.74 10.085 11.368 19.93 17.066 30.013-16.835 10.475-33.47 20.63-49.834 30.715-.11-.232-.23-.311-.459-.47 6.317-5.739 12.598-11.476 19.117-17.595zm-26.138 34.74c20.55-12.639 40.83-25.047 61.42-37.765 6.128 10.546 11.946 20.86 18.115 31.716-20.52 12.719-40.879 25.127-61.54 37.844-6.018-10.775-11.985-21.25-17.995-31.795zm40.479 71.033c-5.739-10.155-11.476-20.08-17.175-30.325 19.238-11.786 38.346-23.574 57.744-35.51 5.698 10.073 11.438 20.079 17.135 30.245-19.31 12.015-38.466 23.733-57.704 35.59z"},child:[]}]})(n)}function tje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M384 64a64 64 0 0 0-64 64 64 64 0 0 0 1.1 11.3l-146.3 73.2A64 64 0 0 0 128 192a64 64 0 0 0-64 64 64 64 0 0 0 64 64 64 64 0 0 0 46.8-20.5L321 372.7a64 64 0 0 0-1 11.3 64 64 0 0 0 64 64 64 64 0 0 0 64-64 64 64 0 0 0-64-64 64 64 0 0 0-46.8 20.5L191 267.4a64 64 0 0 0 1-11.4 64 64 0 0 0-1.1-11.4l146.3-73.1A64 64 0 0 0 384 192a64 64 0 0 0 64-64 64 64 0 0 0-64-64z"},child:[]}]})(n)}function nje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256.3 19.95c-41 0-74.1 32.7-74.1 73.27 0 22.98 8 33.78 16.8 47.78 5.9 9.3 12 20.1 15.5 35.6h83c3.5-15.9 9.6-26.8 15.5-36.2 8.9-14.1 16.8-24.7 16.8-47.18 0-40.57-32.8-73.27-73.5-73.27zm-142.1 7.7L81 35.4l81.2 40.25-48-48zm283.6 0l-48 48L431 35.4l-33.2-7.75zM210.5 79.2l45.5 22.7 45.5-22.7-20.8 83-17.4-4.4 11.2-45-18.5 9.3-18.5-9.3 11.2 45-17.4 4.4-20.8-83zM64 96.03v32.07l96-16.1-96-15.97zm384 0L352 112l96 16V96.03zM334.2 144.3l39.9 63.3 24.1-15.3-64-48zm-156.4.1l-64 48 24.1 15.3 39.9-63.3zM216 191v16h80v-16h-80zm34.4 28.3c-13.7 0-26.9.5-35.7 1-68.2 10.7-82.9 105.4-66.7 191.6h23.6l-1-105.4 18.6-.2c-1.4 63.7 1.6 126.6 5.5 189.7h51.4V390.3h18.7V496h50.4c4.5-65 5.9-131.5 6.5-189.7l18.7.2-1.1 105.4h24.6c18.3-88.5-4.8-178.9-67.1-190.6-9.4-1.4-24.9-2-40.6-2h-5.8z"},child:[]}]})(n)}function ije(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M257.65 19.033l-47.552 85.598c-51.53 16.016-91.8 57.678-105.877 110.026L33.407 252.25l69.276 38.486c5.942 26.33 18.456 50.18 35.722 69.737 5.63-7.952 12.438-15.05 20.547-21.162-19.19-22.513-30.794-51.682-30.794-83.51 0-71.074 57.838-128.488 128.912-128.488 71.077 0 128.49 57.412 128.49 128.49 0 30.006-10.234 57.65-27.408 79.583 8.525 5.88 15.612 12.795 21.413 20.592 15.176-18.532 26.235-40.563 31.77-64.692l70.263-39.035-71.826-38.13c-14.312-52.475-54.968-94.123-106.856-109.825L257.65 19.033zm.266 150.33c-17.56 0-33.686 9.02-45.902 24.647-12.217 15.626-20.09 37.754-20.09 62.373 0 26.12 9.218 49.343 22.846 65.148l10.14 11.76-15.14 3.452c-38.027 8.67-55.962 26.396-66.48 54.268-9.788 25.934-11.75 61.67-11.99 104.236h254.473c-.047-42.74-.66-79.348-9.683-105.814-9.693-28.432-27.11-46.38-67.99-54.38l-15.272-2.99 9.817-12.076c12.778-15.718 21.267-38.404 21.267-63.603 0-24.62-7.875-46.747-20.092-62.373-12.216-15.626-28.343-24.647-45.902-24.647h-.002z"},child:[]}]})(n)}function rje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M255.422 18.346c-111.086 0-204.14 76.375-229.615 179.533-11.867 70.7 11.228 143.745 60.048 194.24-5.034 28.402-5.687 61.755-5.687 100.54h18.687c0-57.013 2.106-100.723 14.88-130.744 12.776-30.02 34.883-47.983 81.394-56.728l15.61-2.934-10.148-12.22c-16.364-19.7-27.22-48.142-27.22-79.84 0-30.586 9.785-58.117 25.093-77.66 15.308-19.54 35.707-30.99 57.99-30.99s42.683 11.45 57.99 30.99c15.308 19.543 25.094 47.074 25.094 77.66 0 31.072-9.61 59.05-25.186 78.55l-10.036 12.565 15.885 2.497c50.69 7.97 72.17 25.994 83.77 56.398 11.598 30.404 11.513 75.137 11.513 132.455h18.69c0-30.09.238-57.06-1.506-81.117 36.888-41.708 59.28-96.54 59.28-156.668 0-130.742-105.786-236.53-236.528-236.53zm8.2 43.45c30.12.1 60.5 7.25 88.24 21.995 99.02 52.642 132.557 179.59 80.525 276.79-1.816 3.392-3.722 6.703-5.698 9.95-1.455-5.895-3.186-11.558-5.256-16.985-.896-2.347-1.872-4.636-2.913-6.877 43.444-87.576 12.394-199.683-75.432-246.373-24.95-13.264-52.307-19.685-79.436-19.775-59.683-.2-118.266 30.23-147.71 85.798-25.907 48.89-22.56 108.01 5.224 152.838-4.82 4.473-9.11 9.337-12.906 14.582-34-50.89-38.835-119.552-8.834-176.17 32.91-62.107 97.928-95.992 164.195-95.77zm86.657 98.9c37.642 37.22 50.227 94.933 32.638 145.548-5.115-3.25-10.7-6.19-16.773-8.81 10.177-31.69 6.895-66.347-8.112-95-.702-14.7-3.382-28.753-7.754-41.74zM158.92 173.642c-2.762 11.597-4.24 23.864-4.24 36.55 0 7.46.533 14.768 1.543 21.875-1.932 21.073 3.05 42.43 14.21 60.077-6.35 1.94-12.302 4.153-17.867 6.638-19.113-32.745-21.045-74.92-2.818-110.215 2.726-5.28 5.8-10.255 9.172-14.925zm60.45 29.34c-15.794.205-19.24 4.585-24.546 8.15 12.483 11.99 36.9 10.832 47.748 0-4.992-4.043-10.37-8.317-23.203-8.15zm74.69.177c-15.794.205-19.24 4.586-24.546 8.15 12.483 11.992 36.9 10.833 47.748 0-4.992-4.042-10.37-8.317-23.203-8.15z"},child:[]}]})(n)}function sje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 16c-48 0-80 32-80 64 0 48 16 80 32 96v16h96v-16c16-16 32-48 32-96 0-32-32-64-80-64zm-63.6 65.33L256 102.5l63.6-21.17-39.2 97.97-16.8-6.6 24.8-62-32.4 10.8-32.4-10.8 24.8 62-16.8 6.6-39.2-97.97zm-83.3 79.07c-23.4 3-44.6 30.5-44.6 65.9 0 19.6 6.8 36.9 16.7 48.9l11.9 14.2-18.3 3.4c-12.9 2.5-22.3 9.3-30.4 20.4-8.1 11.1-14.3 26.5-18.6 44.4C18 389.8 16.2 429.2 16 464h42.8l2.24 30H169.6l2-30h40.8c0-35.2-.4-75.1-7.5-107.7-4-17.9-9.9-33.3-18.1-44.3-8.2-11-18.1-17.8-32.6-20l-18.5-2.9 11.7-14.7c9.5-11.9 15.9-29 15.9-48.1 0-37.8-23.6-65.8-49.4-65.8l-4.8-.1zm283.6 0c-23.4 3-44.6 30.5-44.6 65.9 0 19.6 6.8 36.9 16.7 48.9l11.9 14.2-18.3 3.4c-12.9 2.5-22.3 9.3-30.4 20.4-8.1 11.1-14.3 26.5-18.6 44.4-7.8 32.2-9.6 71.6-9.8 106.4h42.8l2.2 30h108.6l2-30H496c0-35.2-.4-75.1-7.5-107.7-4-17.9-9.9-33.3-18.1-44.3-8.2-11-18.1-17.8-32.6-20l-18.5-2.9 11.7-14.7c9.5-11.9 15.9-29 15.9-48.1 0-37.8-23.6-65.8-49.4-65.8l-4.8-.1zM208 209v18h96v-18h-96zm16 34v18h64v-18h-64z"},child:[]}]})(n)}function aje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M249.334 22.717c-18.64 2.424-35.677 23.574-37.043 51.49v.02c-.057 1.186-.097 2.38-.097 3.59 0 16.362 5.658 30.827 13.942 40.818l10.127 12.213-15.592 2.933c-10.75 2.025-18.622 7.702-25.373 16.978-2.285 3.14-4.384 6.707-6.31 10.62-57.54-6.44-97.91-21.06-97.91-37.952 0-17.363 42.647-31.983 102.75-37.97-.213-2.51-.323-5.057-.323-7.636v-.002c0-.84.024-1.674.047-2.51-96.43 6.77-167.298 29.15-167.3 55.71-.002 25.33 64.462 46.86 154.074 54.67-.19.742-.394 1.465-.576 2.216-2.36 9.72-4.05 20.22-5.268 31.03-.01 0-.02 0-.03.002-.418 3.653-.78 7.34-1.095 11.046l.05-.005c-1.316 15.777-1.772 31.88-1.893 46.95h35.894l2.115 28.4c-68.24-4.994-118.444-21.004-118.444-39.843 0-13.243 24.83-24.89 63.27-32.33.3-4.056.66-8.115 1.076-12.162-76.42 9.353-129.17 29.168-129.172 52.086-.002 28.17 79.71 51.643 185.098 56.768l5.94 79.77c10.5 2.648 24.84 4.162 39.017 4.068 13.79-.092 27.235-1.71 36.45-4l5.263-79.846c105.308-5.14 184.935-28.605 184.935-56.76 0-23.013-53.196-42.895-130.13-52.2.304 4.02.557 8.047.755 12.07 38.883 7.43 63.965 19.17 63.965 32.536 0 18.84-49.804 34.85-117.908 39.844l1.87-28.402h34.18c-.012-15.113-.127-31.27-1.033-47.094.01 0 .02.002.032.004-.214-3.687-.472-7.352-.782-10.986l-.02-.002c-.94-11.157-2.367-21.984-4.546-31.967-.09-.405-.184-.803-.275-1.206 89.518-7.826 153.893-29.344 153.893-54.656 0-26.787-72.076-49.332-169.77-55.887.025.895.053 1.788.053 2.688 0 2.5-.104 4.97-.304 7.407 61.19 5.836 104.61 20.61 104.61 38.2 0 16.805-39.633 31.355-96.524 37.848-2.01-4.283-4.26-8.15-6.762-11.505-6.83-9.167-15.063-14.81-27.14-16.682l-15.913-2.47 10.037-12.59c6.928-8.69 11.912-20.715 13.057-34.268h.002c.163-1.95.25-3.93.25-5.938 0-.77-.022-1.532-.048-2.29-.015-.48-.033-.958-.057-1.434h-.002c-1.48-29.745-20.507-51.3-41.076-51.3-2.528 0-3.966-.087-4.03-.08h-.003zM194.54 355.822c-97.11 6.655-168.573 29.11-168.573 55.8 0 31.932 102.243 57.815 228.367 57.815S482.7 443.555 482.7 411.623c0-26.608-71.02-49.004-167.67-55.736l-.655 9.93c60.363 6.055 103.074 20.956 103.074 38.394 0 22.81-73.032 41.298-163.12 41.298-90.088 0-163.12-18.49-163.12-41.297 0-17.533 43.18-32.502 104.07-38.493l-.74-9.895z"},child:[]}]})(n)}function oje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M20.22 21.75v65.5l92 70.625-60.126 58.094 235.656 157.5-83.844-5.845 93.25 76.53-77.562 5.47 113.5 40.656-4.625-69.03h-21.783c0-37.79-.747-91.963 32.5-100-5.097-7.648-8.187-17.65-8.187-28.625 0-23.993 14.784-43.47 33-43.47s32.97 19.475 32.97 43.47c0 11.247-3.24 21.472-8.564 29.188 30.514 8.638 32.875 61.79 32.875 99.437h-22.967l-5.25 69.813 91.906-59.594-49.064 4.374 57.594-105.53-60.156 16.905 57.5-92.814-68.53 28.813 54.217-102.345-72.655 43.063 18.53-123.407-51.717 115.94-71.125-144.032 23 165.062-66.25-52.5 42.468 85.75-120.436-76.97 73.594-54.655L123.188 21.75H20.218z"},child:[]}]})(n)}function lje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M250.322 18.494c-25.06 3.26-47.158 32.267-47.158 69.346 0 20.453 7.06 38.57 17.502 51.166l10.123 12.213-15.59 2.932c-13.676 2.574-23.794 9.896-32.272 21.547-8.48 11.65-14.86 27.7-19.326 46.095-8.23 33.9-9.916 75.216-10.143 111.275h44.007l11.883 159.512h96.37l10.514-159.512h41.88c-.013-36.448-.353-78.316-7.81-112.48-4.042-18.524-10.176-34.575-18.777-46.12-8.6-11.543-19.21-18.81-34.482-21.18l-15.912-2.468 10.037-12.59c9.99-12.533 16.7-30.436 16.7-50.392 0-39.537-24.776-69.268-52.352-69.268-2.915 0-4.754-.135-5.196-.078zm178.608 1.078c-31.872-.534-61.166 26.473-71.084 63.49-4.575 17.073-4.83 35.29-.817 51.108-10.96 1.307-20.99 5.173-29.772 10.996 5.563 3.58 10.537 7.906 14.906 12.814 7.998-4.296 16.716-6.28 27.084-5.492l15.816 1.2-6.615-14.415c-5.86-12.764-7.33-33.55-2.554-51.377 8.122-30.308 31.484-49.75 52.75-49.61 1.416.008 2.825.104 4.22.29l.01.002c.263.037 1.817.567 4.44 1.27 23.73 6.36 38.404 37.853 29.168 72.324-4.66 17.392-15.965 34.567-27.02 42.73l-12.954 9.565 14.73 6.502c13.063 5.765 20.835 13.86 25.885 24.348 5.05 10.487 7.12 23.674 6.846 38.674-.5 27.368-8.862 60.148-17.2 91.362l-36.864-9.88-51.232 153.712-42.69.11-1.23 18.69 57.402-.146 49.914-149.758 37.946 10.166 2.42-9.025c9.022-33.677 19.603-71.135 20.22-104.89.31-16.876-1.89-32.994-8.693-47.124-5.016-10.417-12.696-19.57-23.065-26.622 10.814-11.607 19.228-27.125 23.637-43.58 11.288-42.13-6.228-85.52-42.38-95.21l-.003-.003c-1.106-.296-3.297-1.274-6.81-1.744h-.008l-2.838-.38-.295.146c-1.09-.082-2.185-.226-3.27-.244zm-349.32.46c-4.49.056-9.02.665-13.538 1.876-.095.026-.327.068-.44.094l-.575-.574-5.76 2.377h-.002C27.32 36.99 13.11 77.635 23.69 117.12c4.574 17.073 13.46 32.977 24.845 44.67-9.328 6.978-16.34 15.908-21.053 25.99-6.507 13.924-8.973 29.83-9.11 46.6-.27 33.543 8.753 71.01 17.82 104.845l2.42 9.027 40.02-10.727 51.11 149.454 60.46.153-1.39-18.694-45.7-.116-52.446-153.37-38.73 10.378c-8.028-30.892-15.098-63.467-14.875-90.8.122-14.997 2.417-28.276 7.354-38.84 4.937-10.56 12.24-18.566 23.865-24.15l14.298-6.87-12.94-9.176c-11.456-8.122-23.12-25.39-27.896-43.215-8.66-32.315 3.867-62.596 24.653-71.188l.025-.01c.244-.1 1.86-.42 4.486-1.12h.002l.002-.003c2.966-.796 6.005-1.18 9.072-1.175 21.47.027 44.263 19.06 52.344 49.223 4.66 17.392 3.46 37.92-2.035 50.517l-6.436 14.76 16.01-1.734c13.355-1.447 23.684 1.234 32.868 7.016 4.285-4.866 9.108-9.17 14.46-12.742-.73-.536-1.464-1.062-2.212-1.572-9.55-6.512-20.777-10.598-33.283-11.522 3.562-15.46 3.09-33.105-1.318-49.56-9.878-36.864-39.338-63.538-70.77-63.14z"},child:[]}]})(n)}function cje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4"},child:[]},{tag:"path",attr:{d:"M18 14v4h4"},child:[]},{tag:"path",attr:{d:"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"},child:[]},{tag:"path",attr:{d:"M15 3v4"},child:[]},{tag:"path",attr:{d:"M7 3v4"},child:[]},{tag:"path",attr:{d:"M3 11h16"},child:[]}]})(n)}function dje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4"},child:[]},{tag:"path",attr:{d:"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0"},child:[]},{tag:"path",attr:{d:"M15 3v4"},child:[]},{tag:"path",attr:{d:"M7 3v4"},child:[]},{tag:"path",attr:{d:"M3 11h16"},child:[]},{tag:"path",attr:{d:"M18 16.496v1.504l1 1"},child:[]}]})(n)}function uje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M15.22 9.375a1 1 0 0 1 1.393 -.165l.094 .083l4 4a1 1 0 0 1 .284 .576l.009 .131v5a1 1 0 0 1 -.883 .993l-.117 .007h-16.022l-.11 -.009l-.11 -.02l-.107 -.034l-.105 -.046l-.1 -.059l-.094 -.07l-.06 -.055l-.072 -.082l-.064 -.089l-.054 -.096l-.016 -.035l-.04 -.103l-.027 -.106l-.015 -.108l-.004 -.11l.009 -.11l.019 -.105c.01 -.04 .022 -.077 .035 -.112l.046 -.105l.059 -.1l4 -6a1 1 0 0 1 1.165 -.39l.114 .05l3.277 1.638l3.495 -4.369z",strokeWidth:"0",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M15.232 3.36a1 1 0 0 1 1.382 -.15l.093 .083l4 4a1 1 0 0 1 -1.32 1.497l-.094 -.083l-3.226 -3.225l-4.299 5.158a1 1 0 0 1 -1.1 .303l-.115 -.049l-3.254 -1.626l-2.499 3.332a1 1 0 0 1 -1.295 .269l-.105 -.069a1 1 0 0 1 -.269 -1.295l.069 -.105l3 -4a1 1 0 0 1 1.137 -.341l.11 .047l3.291 1.645l4.494 -5.391z",strokeWidth:"0",fill:"currentColor"},child:[]}]})(n)}function hje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M3 3v18h18"},child:[]},{tag:"path",attr:{d:"M20 18v3"},child:[]},{tag:"path",attr:{d:"M16 16v5"},child:[]},{tag:"path",attr:{d:"M12 13v8"},child:[]},{tag:"path",attr:{d:"M8 16v5"},child:[]},{tag:"path",attr:{d:"M3 11c6 0 5 -5 9 -5s3 5 9 5"},child:[]}]})(n)}function fje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M14 3v4a1 1 0 0 0 1 1h4"},child:[]},{tag:"path",attr:{d:"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"},child:[]},{tag:"path",attr:{d:"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"},child:[]},{tag:"path",attr:{d:"M17 18h2"},child:[]},{tag:"path",attr:{d:"M20 15h-3v6"},child:[]},{tag:"path",attr:{d:"M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1z"},child:[]}]})(n)}function pje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2"},child:[]}]})(n)}function mje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M11.013 12v9.754a13 13 0 0 1 -8.733 -9.754h8.734zm9.284 3.794a13 13 0 0 1 -7.283 5.951l-.001 -9.745h8.708a12.96 12.96 0 0 1 -1.424 3.794zm-9.283 -13.268l-.001 7.474h-8.986c-.068 -1.432 .101 -2.88 .514 -4.282a1 1 0 0 1 1.005 -.717a11 11 0 0 0 7.192 -2.256l.276 -.219zm1.999 7.474v-7.453l-.09 -.073a11 11 0 0 0 7.189 2.537l.342 -.01a1 1 0 0 1 1.005 .717c.413 1.403 .582 2.85 .514 4.282h-8.96z",strokeWidth:"0",fill:"currentColor"},child:[]}]})(n)}function gje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M12 3a12 12 0 0 0 8.5 3a12 12 0 0 1 -8.5 15a12 12 0 0 1 -8.5 -15a12 12 0 0 0 8.5 -3"},child:[]},{tag:"path",attr:{d:"M12 3v18"},child:[]},{tag:"path",attr:{d:"M12 11h8.9"},child:[]},{tag:"path",attr:{d:"M12 8h8.9"},child:[]},{tag:"path",attr:{d:"M12 5h3.1"},child:[]},{tag:"path",attr:{d:"M12 17h6.2"},child:[]},{tag:"path",attr:{d:"M12 14h8"},child:[]}]})(n)}function vje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},child:[]},{tag:"path",attr:{d:"M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4"},child:[]},{tag:"path",attr:{d:"M19 21h-4l4 -7h-4"},child:[]},{tag:"path",attr:{d:"M4 15l3 3l3 -3"},child:[]},{tag:"path",attr:{d:"M7 6v12"},child:[]}]})(n)}function yje(n){return Le({tag:"svg",attr:{version:"1.2",baseProfile:"tiny",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10.895 16.553l-4-8c-.339-.678-1.45-.678-1.789 0l-4 8c-.247.494-.047 1.095.447 1.342.495.248 1.095.046 1.342-.447l.723-1.448h4.764l.724 1.447c.175.351.528.553.895.553.15 0 .303-.034.446-.105.494-.248.695-.848.448-1.342zm-6.277-2.553l1.382-2.764 1.382 2.764h-2.764zM22 18h-6c-.379 0-.725-.214-.895-.553s-.132-.744.095-1.047l4.8-6.4h-4c-.552 0-1-.448-1-1s.448-1 1-1h6c.379 0 .725.214.895.553s.132.744-.095 1.047l-4.8 6.4h4c.552 0 1 .448 1 1s-.448 1-1 1zM14 14h-2c-.552 0-1-.448-1-1s.448-1 1-1h2c.552 0 1 .448 1 1s-.448 1-1 1z"},child:[]}]})(n)}function _je(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M17 11.5v0.5h-6.168v-1h5.152c-0.112-1.692-0.789-3.231-1.842-4.434l-0.806 0.806-0.707-0.707 0.802-0.802c-1.202-1.053-2.74-1.726-4.431-1.839v2.976h-1v-2.976c-1.691 0.113-3.229 0.786-4.43 1.839l0.796 0.796-0.707 0.707-0.8-0.8c-1.053 1.203-1.731 2.742-1.842 4.434h5.171v1h-6.188v-0.5c0-4.687 3.813-8.5 8.5-8.5s8.5 3.813 8.5 8.5zM10.5 11.5c0 1.103-0.897 2-2 2s-2-0.897-2-2c0-0.644 0.311-1.21 0.784-1.577l-2.082-3.63 0.867-0.497 2.141 3.733c0.095-0.014 0.19-0.029 0.29-0.029 1.103 0 2 0.897 2 2zM9.5 11.5c0-0.551-0.449-1-1-1s-1 0.449-1 1 0.449 1 1 1 1-0.449 1-1z"},child:[]}]})(n)}function Eje(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 17"},child:[{tag:"g",attr:{},child:[]},{tag:"path",attr:{d:"M8.301 6.422c0.437 0 0.769-0.161 1.006-0.484 0.181-0.237 0.265-0.617 0.265-1.12v-1.66c0-0.503-0.084-0.873-0.265-1.11-0.238-0.321-0.57-0.483-1.006-0.483-0.428 0-0.76 0.161-0.995 0.483-0.181 0.238-0.266 0.608-0.266 1.111v1.66c0 0.503 0.085 0.873 0.266 1.12 0.235 0.322 0.567 0.483 0.995 0.483zM7.893 2.988c0-0.436 0.133-0.654 0.408-0.654 0.285 0 0.408 0.218 0.408 0.654v1.992c0 0.437-0.123 0.664-0.408 0.664-0.275 0-0.408-0.228-0.408-0.664v-1.992zM10.35 6.071c-0.048-0.143-0.075-0.37-0.075-0.711v-3.738h0.863v3.481c0 0.2 0 0.313 0.010 0.333 0.019 0.133 0.085 0.208 0.199 0.208 0.17 0 0.35-0.133 0.54-0.408v-3.614h0.863v4.734h-0.863v-0.522c-0.341 0.398-0.663 0.588-0.978 0.588-0.275 0-0.474-0.113-0.559-0.351zM13.633 11.811v0.436h-0.854v-0.436c0-0.427 0.143-0.646 0.427-0.646 0.284 0.001 0.427 0.219 0.427 0.646zM4.354 1.774c-0.208-0.588-0.416-1.186-0.617-1.774h1.007l0.673 2.495 0.645-2.495h0.968l-1.148 3.785v2.571h-0.948v-2.571c-0.086-0.465-0.276-1.129-0.58-2.011zM15.283 8.785c-0.171-0.75-0.788-1.3-1.518-1.385-1.746-0.19-3.511-0.19-5.266-0.19s-3.52 0-5.256 0.19c-0.738 0.085-1.346 0.635-1.526 1.385-0.237 1.062-0.247 2.22-0.247 3.32 0 1.091 0 2.257 0.247 3.32 0.171 0.75 0.788 1.3 1.518 1.376 1.745 0.199 3.51 0.199 5.265 0.199s3.52 0 5.266-0.199c0.729-0.076 1.337-0.626 1.518-1.376 0.237-1.062 0.247-2.229 0.247-3.32-0.001-1.1-0.001-2.258-0.248-3.32zM5.483 9.743h-1.014v5.398h-0.949v-5.398h-0.997v-0.892h2.96v0.892zM8.045 15.141h-0.845v-0.512c-0.342 0.389-0.664 0.579-0.968 0.579-0.274 0-0.474-0.114-0.55-0.351-0.048-0.142-0.076-0.361-0.076-0.692v-3.709h0.845v3.453c0 0.2 0 0.304 0.009 0.333 0.020 0.132 0.086 0.199 0.199 0.199 0.172 0 0.352-0.132 0.541-0.398v-3.586h0.845v4.684zM11.271 13.737c0 0.437-0.020 0.749-0.086 0.948-0.104 0.342-0.342 0.522-0.674 0.522-0.303 0-0.598-0.171-0.883-0.522v0.456h-0.843v-6.29h0.843v2.059c0.275-0.342 0.57-0.512 0.883-0.512 0.332 0 0.57 0.18 0.674 0.531 0.066 0.19 0.086 0.502 0.086 0.939v1.869zM14.477 12.959h-1.698v0.825c0 0.437 0.143 0.654 0.437 0.654 0.209 0 0.332-0.113 0.38-0.341 0.009-0.047 0.019-0.237 0.019-0.579h0.863v0.124c0 0.275 0 0.465-0.019 0.55-0.020 0.189-0.096 0.36-0.199 0.512-0.229 0.332-0.579 0.503-1.024 0.503-0.446 0-0.779-0.161-1.025-0.484-0.18-0.228-0.275-0.598-0.275-1.101v-1.641c0-0.503 0.086-0.863 0.266-1.101 0.247-0.323 0.579-0.484 1.016-0.484 0.428 0 0.759 0.161 1.005 0.484 0.172 0.237 0.257 0.597 0.257 1.101v0.978zM10.426 11.801v2.002c0 0.427-0.124 0.635-0.37 0.635-0.143 0-0.285-0.066-0.428-0.208v-2.855c0.143-0.143 0.285-0.209 0.428-0.209 0.246 0 0.37 0.218 0.37 0.635z"},child:[]}]})(n)}function wje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 14h.5c.827 0 1.5-.673 1.5-1.5v-9c0-.827-.673-1.5-1.5-1.5h-13C2.673 2 2 2.673 2 3.5V18l5.333-4H16zm-9.333-2L4 14V4h12v8H6.667z"},child:[]},{tag:"path",attr:{d:"M20.5 8H20v6.001c0 1.1-.893 1.993-1.99 1.999H8v.5c0 .827.673 1.5 1.5 1.5h7.167L22 22V9.5c0-.827-.673-1.5-1.5-1.5z"},child:[]}]})(n)}function Sje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20.56,3.34a1,1,0,0,0-1-.08l-17,8a1,1,0,0,0-.57.92,1,1,0,0,0,.6.9L8,15.45v6.72L13.84,18l4.76,2.08a.93.93,0,0,0,.4.09,1,1,0,0,0,.52-.15,1,1,0,0,0,.48-.79l1-15A1,1,0,0,0,20.56,3.34ZM18.1,17.68l-5.27-2.31L16,9.17,8.35,13.42,5.42,12.13,18.89,5.79Z"},child:[]}]})(n)}function bje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 6c0-1.654-1.346-3-3-3a2.993 2.993 0 0 0-2.815 2h-6.37A2.993 2.993 0 0 0 6 3C4.346 3 3 4.346 3 6c0 1.302.839 2.401 2 2.815v6.369A2.997 2.997 0 0 0 3 18c0 1.654 1.346 3 3 3a2.993 2.993 0 0 0 2.815-2h6.369a2.994 2.994 0 0 0 2.815 2c1.654 0 3-1.346 3-3a2.997 2.997 0 0 0-2-2.816V8.816A2.996 2.996 0 0 0 21 6zm-3-1a1.001 1.001 0 1 1-1 1c0-.551.448-1 1-1zm-2.815 12h-6.37A2.99 2.99 0 0 0 7 15.184V8.816A2.99 2.99 0 0 0 8.815 7h6.369A2.99 2.99 0 0 0 17 8.815v6.369A2.99 2.99 0 0 0 15.185 17zM6 5a1.001 1.001 0 1 1-1 1c0-.551.448-1 1-1zm0 14a1.001 1.001 0 0 1 0-2 1.001 1.001 0 0 1 0 2zm12 0a1.001 1.001 0 0 1 0-2 1.001 1.001 0 0 1 0 2z"},child:[]}]})(n)}function Cje(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C7.589 2 4 5.589 4 9.995 3.971 16.44 11.696 21.784 12 22c0 0 8.029-5.56 8-12 0-4.411-3.589-8-8-8zm0 12c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"},child:[]}]})(n)}function Tje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(n)}function Rje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(n)}function xje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"},child:[]}]})(n)}function Aje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(n)}function Ije(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M424 64H88c-22 0-40 18-40 40v304c0 22 18 40 40 40h336c22 0 40-18 40-40V104c0-22-18-40-40-40zm12 176c0 8.8-7.2 16-16 16h-86.8c-6.8 0-12.8 4.2-15.1 10.6C314 278.2 303.8 288 292 288h-72c-11.9 0-22.1-9.8-26.1-21.4-2.2-6.4-8.3-10.6-15.1-10.6H92c-8.8 0-16-7.2-16-16V108c0-8.8 7.2-16 16-16h328c8.8 0 16 7.2 16 16v132z"},child:[]},{tag:"path",attr:{d:"M386 156H126c-7.7 0-14-6.3-14-14s6.3-14 14-14h260c7.7 0 14 6.3 14 14s-6.3 14-14 14zM386 220H126c-7.7 0-14-6.3-14-14s6.3-14 14-14h260c7.7 0 14 6.3 14 14s-6.3 14-14 14z"},child:[]}]})(n)}function Nje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M260.062 32C138.605 32 40.134 129.701 40.134 250.232c0 41.23 11.532 79.79 31.559 112.687L32 480l121.764-38.682c31.508 17.285 67.745 27.146 106.298 27.146C381.535 468.464 480 370.749 480 250.232 480 129.701 381.535 32 260.062 32zm109.362 301.11c-5.174 12.827-28.574 24.533-38.899 25.072-10.314.547-10.608 7.994-66.84-16.434-56.225-24.434-90.052-83.844-92.719-87.67-2.669-3.812-21.78-31.047-20.749-58.455 1.038-27.413 16.047-40.346 21.404-45.725 5.351-5.387 11.486-6.352 15.232-6.413 4.428-.072 7.296-.132 10.573-.011 3.274.124 8.192-.685 12.45 10.639 4.256 11.323 14.443 39.153 15.746 41.989 1.302 2.839 2.108 6.126.102 9.771-2.012 3.653-3.042 5.935-5.961 9.083-2.935 3.148-6.174 7.042-8.792 9.449-2.92 2.665-5.97 5.572-2.9 11.269 3.068 5.693 13.653 24.356 29.779 39.736 20.725 19.771 38.598 26.329 44.098 29.317 5.515 3.004 8.806 2.67 12.226-.929 3.404-3.599 14.639-15.746 18.596-21.169 3.955-5.438 7.661-4.373 12.742-2.329 5.078 2.052 32.157 16.556 37.673 19.551 5.51 2.989 9.193 4.529 10.51 6.9 1.317 2.38.901 13.531-4.271 26.359z"},child:[]}]})(n)}function Oje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M448 248L288 96v85.334C138.666 202.667 85.333 309.334 64 416c53.333-74.666 117.333-108.802 224-108.802v87.469L448 248z"},child:[]}]})(n)}function Pje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M32 32v432a16 16 0 0 0 16 16h432"},child:[]},{tag:"rect",attr:{width:"80",height:"192",x:"96",y:"224",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]},{tag:"rect",attr:{width:"80",height:"240",x:"240",y:"176",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]},{tag:"rect",attr:{width:"80",height:"304",x:"383.64",y:"112",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",rx:"20",ry:"20"},child:[]}]})(n)}function Lje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M451 374c-15.88-16-54.34-39.35-73-48.76-24.3-12.24-26.3-13.24-45.4.95-12.74 9.47-21.21 17.93-36.12 14.75s-47.31-21.11-75.68-49.39-47.34-61.62-50.53-76.48 5.41-23.23 14.79-36c13.22-18 12.22-21 .92-45.3-8.81-18.9-32.84-57-48.9-72.8C119.9 44 119.9 47 108.83 51.6A160.15 160.15 0 0 0 83 65.37C67 76 58.12 84.83 51.91 98.1s-9 44.38 23.07 102.64 54.57 88.05 101.14 134.49S258.5 406.64 310.85 436c64.76 36.27 89.6 29.2 102.91 23s22.18-15 32.83-31a159.09 159.09 0 0 0 13.8-25.8C465 391.17 468 391.17 451 374z"},child:[]}]})(n)}function Dje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m479.66 268.7-32-151.81C441.48 83.77 417.68 64 384 64H128c-16.8 0-31 4.69-42.1 13.94s-18.37 22.31-21.58 38.89l-32 151.87A16.65 16.65 0 0 0 32 272v112a64 64 0 0 0 64 64h320a64 64 0 0 0 64-64V272a16.65 16.65 0 0 0-.34-3.3zm-384-145.4v-.28c3.55-18.43 13.81-27 32.29-27H384c18.61 0 28.87 8.55 32.27 26.91 0 .13.05.26.07.39l26.93 127.88a4 4 0 0 1-3.92 4.82H320a15.92 15.92 0 0 0-16 15.82 48 48 0 1 1-96 0A15.92 15.92 0 0 0 192 256H72.65a4 4 0 0 1-3.92-4.82z"},child:[]},{tag:"path",attr:{d:"M368 160H144a16 16 0 0 1 0-32h224a16 16 0 0 1 0 32zm16 64H128a16 16 0 0 1 0-32h256a16 16 0 0 1 0 32z"},child:[]}]})(n)}function kje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(n)}function Mje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M218.1 167.17c0 13 0 25.6 4.1 37.4-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3 6.6 6.9 34.8 33 40 28 15.4-15 18.5-19 24.8-25.2 9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4 15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2 5-4.6 8.6-8.9 8.7-15.6.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5 22.8-15.5 24.1-21.6-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4 15.5 6.7 29.6 9.4 47.7 9.4 68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32 32 32 0 0 1 32 32z"},child:[]}]})(n)}function jje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C167.67 32 96 96.51 96 176c0 128 160 304 160 304s160-176 160-304c0-79.49-71.67-144-160-144zm0 224a64 64 0 1 1 64-64 64.07 64.07 0 0 1-64 64z"},child:[]}]})(n)}function Uje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M384 368h24a40.12 40.12 0 0 0 40-40V168a40.12 40.12 0 0 0-40-40H104a40.12 40.12 0 0 0-40 40v160a40.12 40.12 0 0 0 40 40h24"},child:[]},{tag:"rect",attr:{width:"256",height:"208",x:"128",y:"240",fill:"none",strokeLinejoin:"round",strokeWidth:"32",rx:"24.32",ry:"24.32"},child:[]},{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M384 128v-24a40.12 40.12 0 0 0-40-40H168a40.12 40.12 0 0 0-40 40v24"},child:[]},{tag:"circle",attr:{cx:"392",cy:"184",r:"24"},child:[]}]})(n)}function Fje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M400 96V56a8 8 0 0 0-8-8H120a8 8 0 0 0-8 8v40"},child:[]},{tag:"rect",attr:{width:"208",height:"160",x:"152",y:"264",fill:"none",rx:"4",ry:"4"},child:[]},{tag:"rect",attr:{width:"208",height:"160",x:"152",y:"264",fill:"none",rx:"4",ry:"4"},child:[]},{tag:"path",attr:{d:"M408 112H104a56 56 0 0 0-56 56v208a8 8 0 0 0 8 8h56v72a8 8 0 0 0 8 8h272a8 8 0 0 0 8-8v-72h56a8 8 0 0 0 8-8V168a56 56 0 0 0-56-56zm-48 308a4 4 0 0 1-4 4H156a4 4 0 0 1-4-4V268a4 4 0 0 1 4-4h200a4 4 0 0 1 4 4zm34-212.08a24 24 0 1 1 22-22 24 24 0 0 1-22 22z"},child:[]}]})(n)}function Bje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M336 176 225.2 304 176 255.8"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M463.1 112.37C373.68 96.33 336.71 84.45 256 48c-80.71 36.45-117.68 48.33-207.1 64.37C32.7 369.13 240.58 457.79 256 464c15.42-6.21 223.3-94.87 207.1-351.63z"},child:[]}]})(n)}function Vje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M479.07 111.36a16 16 0 0 0-13.15-14.74c-86.5-15.52-122.61-26.74-203.33-63.2a16 16 0 0 0-13.18 0C168.69 69.88 132.58 81.1 46.08 96.62a16 16 0 0 0-13.15 14.74c-3.85 61.11 4.36 118.05 24.43 169.24A349.47 349.47 0 0 0 129 393.11c53.47 56.73 110.24 81.37 121.07 85.73a16 16 0 0 0 12 0c10.83-4.36 67.6-29 121.07-85.73a349.47 349.47 0 0 0 71.5-112.51c20.07-51.19 28.28-108.13 24.43-169.24zm-131 75.11-110.8 128a16 16 0 0 1-11.41 5.53h-.66a16 16 0 0 1-11.2-4.57l-49.2-48.2a16 16 0 1 1 22.4-22.86l37 36.29 99.7-115.13a16 16 0 0 1 24.2 20.94z"},child:[]}]})(n)}function zje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M48.9 112.37C138.32 96.33 175.29 84.45 256 48c80.71 36.45 117.68 48.33 207.1 64.37C479.3 369.13 271.42 457.79 256 464c-15.42-6.21-223.3-94.87-207.1-351.63z"},child:[]},{tag:"path",attr:{d:"M256 48c80.71 36.45 117.68 48.33 207.1 64.37C479.3 369.13 271.42 457.79 256 464z"},child:[]}]})(n)}function Hje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM127 384.5c-5.5 9.6-17.8 12.8-27.3 7.3-9.6-5.5-12.8-17.8-7.3-27.3l14.3-24.7c16.1-4.9 29.3-1.1 39.6 11.4L127 384.5zm138.9-53.9H84c-11 0-20-9-20-20s9-20 20-20h51l65.4-113.2-20.5-35.4c-5.5-9.6-2.2-21.8 7.3-27.3 9.6-5.5 21.8-2.2 27.3 7.3l8.9 15.4 8.9-15.4c5.5-9.6 17.8-12.8 27.3-7.3 9.6 5.5 12.8 17.8 7.3 27.3l-85.8 148.6h62.1c20.2 0 31.5 23.7 22.7 40zm98.1 0h-29l19.6 33.9c5.5 9.6 2.2 21.8-7.3 27.3-9.6 5.5-21.8 2.2-27.3-7.3-32.9-56.9-57.5-99.7-74-128.1-16.7-29-4.8-58 7.1-67.8 13.1 22.7 32.7 56.7 58.9 102h52c11 0 20 9 20 20 0 11.1-9 20-20 20z"},child:[]}]})(n)}function Gje(n){return Le({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"},child:[]}]})(n)}function Wje(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M325.3 234.3L104.6 13l280.8 161.2-60.1 60.1zM47 0C34 6.8 25.3 19.2 25.3 35.3v441.3c0 16.1 8.7 28.5 21.7 35.3l256.6-256L47 0zm425.2 225.6l-58.9-34.1-65.7 64.5 65.7 64.5 60.1-34.1c18-14.3 18-46.5-1.2-60.8zM104.6 499l280.8-161.2-60.1-60.1L104.6 499z"},child:[]}]})(n)}function $je(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M446.7 98.6l-67.6 318.8c-5.1 22.5-18.4 28.1-37.3 17.5l-103-75.9-49.7 47.8c-5.5 5.5-10.1 10.1-20.7 10.1l7.4-104.9 190.9-172.5c8.3-7.4-1.8-11.5-12.9-4.1L117.8 284 16.2 252.2c-22.1-6.9-22.5-22.1 4.6-32.7L418.2 66.4c18.4-6.9 34.5 4.1 28.5 32.2z"},child:[]}]})(n)}function Kje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z"},child:[]}]})(n)}function qje(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(n)}function Yje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(n)}function Xje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"},child:[]}]})(n)}function Jje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"},child:[]}]})(n)}function Qje(n){return Le({tag:"svg",attr:{viewBox:"0 0 544 512"},child:[{tag:"path",attr:{d:"M527.79 288H290.5l158.03 158.03c6.04 6.04 15.98 6.53 22.19.68 38.7-36.46 65.32-85.61 73.13-140.86 1.34-9.46-6.51-17.85-16.06-17.85zm-15.83-64.8C503.72 103.74 408.26 8.28 288.8.04 279.68-.59 272 7.1 272 16.24V240h223.77c9.14 0 16.82-7.68 16.19-16.8zM224 288V50.71c0-9.55-8.39-17.4-17.84-16.06C86.99 51.49-4.1 155.6.14 280.37 4.5 408.51 114.83 513.59 243.03 511.98c50.4-.63 96.97-16.87 135.26-44.03 7.9-5.6 8.42-17.23 1.57-24.08L224 288z"},child:[]}]})(n)}function Zje(n){return Le({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(n)}function eUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"},child:[]}]})(n)}function tUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32zM128 272c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"},child:[]}]})(n)}function nUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M528 448H112c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h416c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm64-320c-26.5 0-48 21.5-48 48 0 7.1 1.6 13.7 4.4 19.8L476 239.2c-15.4 9.2-35.3 4-44.2-11.6L350.3 85C361 76.2 368 63 368 48c0-26.5-21.5-48-48-48s-48 21.5-48 48c0 15 7 28.2 17.7 37l-81.5 142.6c-8.9 15.6-28.9 20.8-44.2 11.6l-72.3-43.4c2.7-6 4.4-12.7 4.4-19.8 0-26.5-21.5-48-48-48S0 149.5 0 176s21.5 48 48 48c2.6 0 5.2-.4 7.7-.8L128 416h384l72.3-192.8c2.5.4 5.1.8 7.7.8 26.5 0 48-21.5 48-48s-21.5-48-48-48z"},child:[]}]})(n)}function iUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M181.9 256.1c-5-16-4.9-46.9-2-46.9 8.4 0 7.6 36.9 2 46.9zm-1.7 47.2c-7.7 20.2-17.3 43.3-28.4 62.7 18.3-7 39-17.2 62.9-21.9-12.7-9.6-24.9-23.4-34.5-40.8zM86.1 428.1c0 .8 13.2-5.4 34.9-40.2-6.7 6.3-29.1 24.5-34.9 40.2zM248 160h136v328c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V24C0 10.7 10.7 0 24 0h200v136c0 13.2 10.8 24 24 24zm-8 171.8c-20-12.2-33.3-29-42.7-53.8 4.5-18.5 11.6-46.6 6.2-64.2-4.7-29.4-42.4-26.5-47.8-6.8-5 18.3-.4 44.1 8.1 77-11.6 27.6-28.7 64.6-40.8 85.8-.1 0-.1.1-.2.1-27.1 13.9-73.6 44.5-54.5 68 5.6 6.9 16 10 21.5 10 17.9 0 35.7-18 61.1-61.8 25.8-8.5 54.1-19.1 79-23.2 21.7 11.8 47.1 19.5 64 19.5 29.2 0 31.2-32 19.7-43.4-13.9-13.6-54.3-9.7-73.6-7.2zM377 105L279 7c-4.5-4.5-10.6-7-17-7h-6v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zm-74.1 255.3c4.1-2.7-2.5-11.9-42.8-9 37.1 15.8 42.8 9 42.8 9z"},child:[]}]})(n)}function rUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"},child:[]}]})(n)}function sUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"},child:[]}]})(n)}function aUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 56v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H24C10.745 32 0 42.745 0 56zm40 200c0-13.255 10.745-24 24-24s24 10.745 24 24-10.745 24-24 24-24-10.745-24-24zm272 256c-20.183 0-29.485-39.293-33.931-57.795-5.206-21.666-10.589-44.07-25.393-58.902-32.469-32.524-49.503-73.967-89.117-113.111a11.98 11.98 0 0 1-3.558-8.521V59.901c0-6.541 5.243-11.878 11.783-11.998 15.831-.29 36.694-9.079 52.651-16.178C256.189 17.598 295.709.017 343.995 0h2.844c42.777 0 93.363.413 113.774 29.737 8.392 12.057 10.446 27.034 6.148 44.632 16.312 17.053 25.063 48.863 16.382 74.757 17.544 23.432 19.143 56.132 9.308 79.469l.11.11c11.893 11.949 19.523 31.259 19.439 49.197-.156 30.352-26.157 58.098-59.553 58.098H350.723C358.03 364.34 384 388.132 384 430.548 384 504 336 512 312 512z"},child:[]}]})(n)}function oUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M104 224H24c-13.255 0-24 10.745-24 24v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V248c0-13.255-10.745-24-24-24zM64 472c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zM384 81.452c0 42.416-25.97 66.208-33.277 94.548h101.723c33.397 0 59.397 27.746 59.553 58.098.084 17.938-7.546 37.249-19.439 49.197l-.11.11c9.836 23.337 8.237 56.037-9.308 79.469 8.681 25.895-.069 57.704-16.382 74.757 4.298 17.598 2.244 32.575-6.148 44.632C440.202 511.587 389.616 512 346.839 512l-2.845-.001c-48.287-.017-87.806-17.598-119.56-31.725-15.957-7.099-36.821-15.887-52.651-16.178-6.54-.12-11.783-5.457-11.783-11.998v-213.77c0-3.2 1.282-6.271 3.558-8.521 39.614-39.144 56.648-80.587 89.117-113.111 14.804-14.832 20.188-37.236 25.393-58.902C282.515 39.293 291.817 0 312 0c24 0 72 8 72 81.452z"},child:[]}]})(n)}function lUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(n)}function cUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M622.3 271.1l-115.2-45c-4.1-1.6-12.6-3.7-22.2 0l-115.2 45c-10.7 4.2-17.7 14-17.7 24.9 0 111.6 68.7 188.8 132.9 213.9 9.6 3.7 18 1.6 22.2 0C558.4 489.9 640 420.5 640 296c0-10.9-7-20.7-17.7-24.9zM496 462.4V273.3l95.5 37.3c-5.6 87.1-60.9 135.4-95.5 151.8zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm96 40c0-2.5.8-4.8 1.1-7.2-2.5-.1-4.9-.8-7.5-.8h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c6.8 0 13.3-1.5 19.2-4-54-42.9-99.2-116.7-99.2-212z"},child:[]}]})(n)}function dUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"},child:[]}]})(n)}function uUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"},child:[]}]})(n)}function hUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"},child:[]}]})(n)}function fUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128z"},child:[]}]})(n)}function pUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128z"},child:[]}]})(n)}function mUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64H64C28.7 64 0 92.7 0 128V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64H282.5C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM105.8 229.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L216 328.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V314.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H158.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM160 416a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"},child:[]}]})(n)}function gUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"},child:[]}]})(n)}function vUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"},child:[]}]})(n)}function yUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M168.2 384.9c-15-5.4-31.7-3.1-44.6 6.4c-8.2 6-22.3 14.8-39.4 22.7c5.6-14.7 9.9-31.3 11.3-49.4c1-12.9-3.3-25.7-11.8-35.5C60.4 302.8 48 272 48 240c0-79.5 83.3-160 208-160s208 80.5 208 160s-83.3 160-208 160c-31.6 0-61.3-5.5-87.8-15.1zM26.3 423.8c-1.6 2.7-3.3 5.4-5.1 8.1l-.3 .5c-1.6 2.3-3.2 4.6-4.8 6.9c-3.5 4.7-7.3 9.3-11.3 13.5c-4.6 4.6-5.9 11.4-3.4 17.4c2.5 6 8.3 9.9 14.8 9.9c5.1 0 10.2-.3 15.3-.8l.7-.1c4.4-.5 8.8-1.1 13.2-1.9c.8-.1 1.6-.3 2.4-.5c17.8-3.5 34.9-9.5 50.1-16.1c22.9-10 42.4-21.9 54.3-30.6c31.8 11.5 67 17.9 104.1 17.9c141.4 0 256-93.1 256-208S397.4 32 256 32S0 125.1 0 240c0 45.1 17.7 86.8 47.7 120.9c-1.9 24.5-11.4 46.3-21.4 62.9zM144 272a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm144-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm80 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"},child:[]}]})(n)}function _Ue(n){return Le({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152V424c0 48.6 39.4 88 88 88H360c48.6 0 88-39.4 88-88V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V424c0 22.1-17.9 40-40 40H88c-22.1 0-40-17.9-40-40V152c0-22.1 17.9-40 40-40H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H88z"},child:[]}]})(n)}function EUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M400 255.4V240 208c0-8.8-7.2-16-16-16H352 336 289.5c-50.9 0-93.9 33.5-108.3 79.6c-3.3-9.4-5.2-19.8-5.2-31.6c0-61.9 50.1-112 112-112h48 16 32c8.8 0 16-7.2 16-16V80 64.6L506 160 400 255.4zM336 240h16v48c0 17.7 14.3 32 32 32h3.7c7.9 0 15.5-2.9 21.4-8.2l139-125.1c7.6-6.8 11.9-16.5 11.9-26.7s-4.3-19.9-11.9-26.7L409.9 8.9C403.5 3.2 395.3 0 386.7 0C367.5 0 352 15.5 352 34.7V80H336 304 288c-88.4 0-160 71.6-160 160c0 60.4 34.6 99.1 63.9 120.9c5.9 4.4 11.5 8.1 16.7 11.2c4.4 2.7 8.5 4.9 11.9 6.6c3.4 1.7 6.2 3 8.2 3.9c2.2 1 4.6 1.4 7.1 1.4h2.5c9.8 0 17.8-8 17.8-17.8c0-7.8-5.3-14.7-11.6-19.5l0 0c-.4-.3-.7-.5-1.1-.8c-1.7-1.1-3.4-2.5-5-4.1c-.8-.8-1.7-1.6-2.5-2.6s-1.6-1.9-2.4-2.9c-1.8-2.5-3.5-5.3-5-8.5c-2.6-6-4.3-13.3-4.3-22.4c0-36.1 29.3-65.5 65.5-65.5H304h32zM72 32C32.2 32 0 64.2 0 104V440c0 39.8 32.2 72 72 72H408c39.8 0 72-32.2 72-72V376c0-13.3-10.7-24-24-24s-24 10.7-24 24v64c0 13.3-10.7 24-24 24H72c-13.3 0-24-10.7-24-24V104c0-13.3 10.7-24 24-24h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H72z"},child:[]}]})(n)}function wUe(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"},child:[]}]})(n)}function SUe(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"},child:[]}]})(n)}function bUe(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"},child:[]}]})(n)}function CUe(n){return Le({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"},child:[]}]})(n)}function TUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5"},child:[]},{tag:"path",attr:{d:"M16 2v4"},child:[]},{tag:"path",attr:{d:"M8 2v4"},child:[]},{tag:"path",attr:{d:"M3 10h5"},child:[]},{tag:"path",attr:{d:"M17.5 17.5 16 16.25V14"},child:[]},{tag:"path",attr:{d:"M22 16a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"},child:[]}]})(n)}function RUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",x2:"21",y1:"10",y2:"10"},child:[]},{tag:"path",attr:{d:"M8 14h.01"},child:[]},{tag:"path",attr:{d:"M12 14h.01"},child:[]},{tag:"path",attr:{d:"M16 14h.01"},child:[]},{tag:"path",attr:{d:"M8 18h.01"},child:[]},{tag:"path",attr:{d:"M12 18h.01"},child:[]},{tag:"path",attr:{d:"M16 18h.01"},child:[]}]})(n)}function xUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",x2:"16",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",x2:"8",y1:"2",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",x2:"21",y1:"10",y2:"10"},child:[]},{tag:"path",attr:{d:"M17 14h-6"},child:[]},{tag:"path",attr:{d:"M13 18H7"},child:[]},{tag:"path",attr:{d:"M7 14h.01"},child:[]},{tag:"path",attr:{d:"M17 18h.01"},child:[]}]})(n)}function AUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"3",rx:"1"},child:[]},{tag:"rect",attr:{width:"7",height:"7",x:"3",y:"14",rx:"1"},child:[]},{tag:"path",attr:{d:"M14 4h7"},child:[]},{tag:"path",attr:{d:"M14 9h7"},child:[]},{tag:"path",attr:{d:"M14 15h7"},child:[]},{tag:"path",attr:{d:"M14 20h7"},child:[]}]})(n)}function IUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2"},child:[]},{tag:"path",attr:{d:"M18 14h-8"},child:[]},{tag:"path",attr:{d:"M15 18h-5"},child:[]},{tag:"path",attr:{d:"M10 6h8v4h-8V6Z"},child:[]}]})(n)}function NUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"},child:[]}]})(n)}function OUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8A5.87 5.87 0 0 1 6 12c0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"},child:[]}]})(n)}function PUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11 9.16V2c-5 .5-9 4.79-9 10s4 9.5 9 10v-7.16c-1-.41-2-1.52-2-2.84s1-2.43 2-2.84zM14.86 11H22c-.48-4.75-4-8.53-9-9v7.16c1 .3 1.52.98 1.86 1.84zM13 14.84V22c5-.47 8.52-4.25 9-9h-7.14c-.34.86-.86 1.54-1.86 1.84z"},child:[]}]})(n)}function LUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14 19.88V22h2.12l5.17-5.17-2.12-2.12zM20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H12v-2.95l8-8V8zm-7 1V3.5L18.5 9H13zM22.71 14l-.71-.71a.996.996 0 0 0-1.41 0l-.71.71L22 16.12l.71-.71a.996.996 0 0 0 0-1.41z"},child:[]}]})(n)}function DUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"},child:[]}]})(n)}function kUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"},child:[]}]})(n)}function MUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.5 21H2V9h5.5v12zm7.25-18h-5.5v18h5.5V3zM22 11h-5.5v10H22V11z"},child:[]}]})(n)}function jUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2 11.7V16h-4v-2.3C8.48 12.63 7 11.53 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 2.49-1.51 3.65-3 4.7z"},child:[]}]})(n)}function UUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z"},child:[]}]})(n)}function FUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z"},child:[]}]})(n)}function BUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"},child:[]}]})(n)}function VUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"},child:[]}]})(n)}function zUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"9",cy:"9",r:"4"},child:[]},{tag:"path",attr:{d:"M9 15c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm7.76-9.64-1.68 1.69c.84 1.18.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14z"},child:[]}]})(n)}function HUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm4.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"},child:[]}]})(n)}function GUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 16.5c-.83 0-1.5-.67-1.5-1.5v-2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V15c0 .83-.67 1.5-1.5 1.5zM20 20h1v-1.54c1.69-.24 3-1.7 3-3.46h-1a2.5 2.5 0 0 1-5 0h-1c0 1.76 1.31 3.22 3 3.46V20zM9 12c-2.21 0-4-1.79-4-4a3.999 3.999 0 0 1 5.34-3.77A5.938 5.938 0 0 0 9 8c0 1.43.5 2.74 1.34 3.77-.42.15-.87.23-1.34.23zm-1.89 1.13A4.965 4.965 0 0 0 5 17.22V20H1v-2.78c0-1.12.61-2.15 1.61-2.66 1.24-.64 2.76-1.19 4.5-1.43zM11 8c0-2.21 1.79-4 4-4s4 1.79 4 4-1.79 4-4 4-4-1.79-4-4zm7.32 12a4.997 4.997 0 0 1-2.82-4.5c0-.89.23-1.73.64-2.45-.37-.03-.75-.05-1.14-.05-2.53 0-4.71.7-6.39 1.56A2.97 2.97 0 0 0 7 17.22V20h11.32z"},child:[]}]})(n)}function WUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0zm0 0h24v24H0V0zm.75.75h22.5v22.5H.75z"},child:[]},{tag:"path",attr:{d:"M14.94 4.66h-4.72l2.36-2.36zm-4.69 14.71h4.66l-2.33 2.33zM6.1 6.27 1.6 17.73h1.84l.92-2.45h5.11l.92 2.45h1.84L7.74 6.27H6.1zm-1.13 7.37 1.94-5.18 1.94 5.18H4.97zm10.76 2.5h6.12v1.59h-8.53v-1.29l5.92-8.56h-5.88v-1.6h8.3v1.26l-5.93 8.6z"},child:[]}]})(n)}function $Ue(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.1 0-2 .9-2 2v8h2V5h18v16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"circle",attr:{cx:"9",cy:"10",r:"4"},child:[]},{tag:"path",attr:{d:"M15.39 16.56C13.71 15.7 11.53 15 9 15s-4.71.7-6.39 1.56A2.97 2.97 0 0 0 1 19.22V22h16v-2.78c0-1.12-.61-2.15-1.61-2.66z"},child:[]}]})(n)}function KUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19.1 17H22v-6c0-1.7-1.3-3-3-3h-9l9.1 9zm-.1-7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-1-3V3H6v1.1L9 7zM1.2 1.8 0 3l4.9 5C3.3 8.1 2 9.4 2 11v6h4v4h11.9l3 3 1.3-1.3-21-20.9zM8 19v-5h2.9l5 5H8z"},child:[]}]})(n)}function qUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M18 13h-.68l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2H6l-3 3v4c0 1.1.89 2 1.99 2H19a2 2 0 0 0 2-2v-4l-3-3zm-1-5.05-4.95 4.95-3.54-3.54 4.95-4.95L17 7.95zm-4.24-5.66L6.39 8.66a.996.996 0 0 0 0 1.41l4.95 4.95c.39.39 1.02.39 1.41 0l6.36-6.36a.996.996 0 0 0 0-1.41L14.16 2.3a.975.975 0 0 0-1.4-.01z"},child:[]}]})(n)}function YUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},child:[]}]})(n)}function Eye(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"},child:[]}]})(n)}function XUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-6.43 9.57L12 15l-1.57-3.43L7 10l3.43-1.57L12 5l1.57 3.43L17 10l-3.43 1.57z"},child:[]}]})(n)}function JUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M14.06 9.94 12 9l2.06-.94L15 6l.94 2.06L18 9l-2.06.94L15 12l-.94-2.06zM4 14l.94-2.06L7 11l-2.06-.94L4 8l-.94 2.06L1 11l2.06.94L4 14zm4.5-5 1.09-2.41L12 5.5 9.59 4.41 8.5 2 7.41 4.41 5 5.5l2.41 1.09L8.5 9zm-4 11.5 6-6.01 4 4L23 8.93l-1.41-1.41-7.09 7.97-4-4L3 19l1.5 1.5z"},child:[]}]})(n)}function QUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M23 7V1h-6v2H7V1H1v6h2v10H1v6h6v-2h10v2h6v-6h-2V7h2zM3 3h2v2H3V3zm2 18H3v-2h2v2zm12-2H7v-2H5V7h2V5h10v2h2v10h-2v2zm4 2h-2v-2h2v2zM19 5V3h2v2h-2zm-5.27 9h-3.49l-.73 2H7.89l3.4-9h1.4l3.41 9h-1.63l-.74-2zm-3.04-1.26h2.61L12 8.91l-1.31 3.83z"},child:[]}]})(n)}function ZUe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 2v20c-5.07-.5-9-4.79-9-10s3.93-9.5 9-10zm2.03 0v8.99H22c-.47-4.74-4.24-8.52-8.97-8.99zm0 11.01V22c4.74-.47 8.5-4.25 8.97-8.99h-8.97z"},child:[]}]})(n)}function eFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6z"},child:[]},{tag:"path",attr:{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-3.37 12.5-.8-2.3H12.2l-.82 2.3H9.81l3.38-9h1.61l3.38 9h-1.55z"},child:[]},{tag:"path",attr:{d:"m13.96 7.17-1.31 3.72h2.69l-1.3-3.72z"},child:[]}]})(n)}function tFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"},child:[]}]})(n)}function nFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96a.996.996 0 0 0 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05a.996.996 0 0 0 0-1.41l-2.33-2.35zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12-2.44 2.44z"},child:[]}]})(n)}function iFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m10.1 15.9 1.42-1.42C8.79 12.05 7 10.41 7 8.85 7 7.8 7.8 7 8.85 7c1.11 0 1.54.65 2.68 2h.93c1.12-1.31 1.53-2 2.68-2 .87 0 1.55.54 1.77 1.32.35-.04.68-.06 1-.06.36 0 .7.03 1.03.08C18.7 6.43 17.13 5 15.15 5c-.12 0-.23.03-.35.04.12-.33.2-.67.2-1.04 0-1.66-1.34-3-3-3S9 2.34 9 4c0 .37.08.71.2 1.04-.12-.01-.23-.04-.35-.04C6.69 5 5 6.69 5 8.85c0 2.42 2.04 4.31 5.1 7.05z"},child:[]},{tag:"path",attr:{d:"M22.5 16.24c-.32-.18-.66-.29-1-.35.07-.1.15-.18.21-.28 1.08-1.87.46-4.18-1.41-5.26-2.09-1.21-4.76-.39-8.65.9l.52 1.94c3.47-1.14 5.79-1.88 7.14-1.1.91.53 1.2 1.61.68 2.53-.56.96-1.33 1-3.07 1.32l-.47.81c.58 1.62.97 2.33.39 3.32-.53.91-1.61 1.2-2.53.68-.06-.03-.11-.09-.17-.13-.3.67-.64 1.24-1.03 1.73.07.04.13.09.2.14 1.87 1.08 4.18.46 5.26-1.41.06-.1.09-.21.14-.32.22.27.48.51.8.69 1.43.83 3.27.34 4.1-1.1s.32-3.29-1.11-4.11z"},child:[]},{tag:"path",attr:{d:"M12.32 14.01c-.74 3.58-1.27 5.95-2.62 6.73-.91.53-2 .24-2.53-.68-.56-.96-.2-1.66.39-3.32l-.46-.81c-1.7-.31-2.5-.33-3.07-1.32-.53-.91-.24-2 .68-2.53.09-.05.19-.08.29-.11-.35-.56-.64-1.17-.82-1.85-.16.07-.32.14-.48.23-1.87 1.08-2.49 3.39-1.41 5.26.06.1.14.18.21.28-.34.06-.68.17-1 .35-1.43.83-1.93 2.66-1.1 4.1s2.66 1.93 4.1 1.1c.32-.18.58-.42.8-.69.05.11.08.22.14.32 1.08 1.87 3.39 2.49 5.26 1.41 2.09-1.21 2.71-3.93 3.55-7.94l-1.93-.53z"},child:[]}]})(n)}function rFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M6.32 13.01c.96.02 1.85.5 2.45 1.34A3.961 3.961 0 0 0 12 16c1.29 0 2.5-.62 3.23-1.66.6-.84 1.49-1.32 2.45-1.34-.72-1.22-3.6-2-5.68-2-2.07 0-4.96.78-5.68 2.01zM4 13c1.66 0 3-1.34 3-3S5.66 7 4 7s-3 1.34-3 3 1.34 3 3 3zM20 13c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zM12 10c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z"},child:[]},{tag:"path",attr:{d:"M21 14h-3.27c-.77 0-1.35.45-1.68.92-.04.06-1.36 2.08-4.05 2.08-1.43 0-3.03-.64-4.05-2.08-.39-.55-1-.92-1.68-.92H3c-1.1 0-2 .9-2 2v4h7v-2.26c1.15.8 2.54 1.26 4 1.26s2.85-.46 4-1.26V20h7v-4c0-1.1-.9-2-2-2z"},child:[]}]})(n)}function sFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10.27 12h3.46a1.5 1.5 0 0 0 1.48-1.75l-.3-1.79a2.951 2.951 0 0 0-5.82.01l-.3 1.79c-.15.91.55 1.74 1.48 1.74zM1.66 11.11c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65a1.12 1.12 0 0 0-.99-.74.09.09 0 0 1-.07-.03C5.03 8.14 4.72 8 4.37 8c-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02a1.24 1.24 0 0 0-1.7 1.03c0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09zM16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2z"},child:[]}]})(n)}function aFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM12 12c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zM1.497 11 4 8.497 6.503 11 4 13.503zM20 9l-2.5 4h5z"},child:[]}]})(n)}function oFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12.75c1.63 0 3.07.39 4.24.9 1.08.48 1.76 1.56 1.76 2.73V18H6v-1.61c0-1.18.68-2.26 1.76-2.73 1.17-.52 2.61-.91 4.24-.91zM4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zM12 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z"},child:[]}]})(n)}function lFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z"},child:[]}]})(n)}function cFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"},child:[]}]})(n)}function dFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 8c0-2.21-1.79-4-4-4S5 5.79 5 8s1.79 4 4 4 4-1.79 4-4zm2 2v2h3v3h2v-3h3v-2h-3V7h-2v3h-3zM1 18v2h16v-2c0-2.66-5.33-4-8-4s-8 1.34-8 4z"},child:[]}]})(n)}function uFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"},child:[]}]})(n)}function hFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19.94 9.06C19.5 5.73 16.57 3 13 3 9.47 3 6.57 5.61 6.08 9l-1.93 3.48c-.41.66.07 1.52.85 1.52h1v2c0 1.1.9 2 2 2h1v3h7v-4.68a7.016 7.016 0 0 0 3.94-7.26zM12.5 14c-.41 0-.74-.33-.74-.74s.33-.73.74-.73.73.32.73.73-.31.74-.73.74zm1.76-4.32c-.44.65-.86.85-1.09 1.27-.09.17-.13.28-.13.82h-1.06c0-.29-.04-.75.18-1.16.28-.51.83-.81 1.14-1.26.33-.47.15-1.36-.8-1.36-.62 0-.92.47-1.05.86l-.96-.4c.27-.78.97-1.45 2.01-1.45.86 0 1.45.39 1.75.88.26.43.41 1.22.01 1.8z"},child:[]}]})(n)}function fFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 8.57a1.43 1.43 0 1 0 0 2.86 1.43 1.43 0 0 0 0-2.86z"},child:[]},{tag:"path",attr:{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2a.5.5 0 0 0 .4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68A6.999 6.999 0 0 0 13 3zm3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39a.19.19 0 0 1 .05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38a.2.2 0 0 1-.05.26l-.85.66c.03.12.04.25.04.39z"},child:[]}]})(n)}function pFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"6",r:"2"},child:[]},{tag:"path",attr:{d:"M21 16v-2c-2.24 0-4.16-.96-5.6-2.68l-1.34-1.6A1.98 1.98 0 0 0 12.53 9h-1.05c-.59 0-1.15.26-1.53.72l-1.34 1.6C7.16 13.04 5.24 14 3 14v2c2.77 0 5.19-1.17 7-3.25V15l-3.88 1.55c-.67.27-1.12.93-1.12 1.66C5 19.2 5.8 20 6.79 20H9v-.5a2.5 2.5 0 0 1 2.5-2.5h3c.28 0 .5.22.5.5s-.22.5-.5.5h-3c-.83 0-1.5.67-1.5 1.5v.5h7.21c.99 0 1.79-.8 1.79-1.79 0-.73-.45-1.39-1.12-1.66L14 15v-2.25c1.81 2.08 4.23 3.25 7 3.25z"},child:[]}]})(n)}function mFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"},child:[]}]})(n)}function gFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M17 8H7c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-4 12.5h-2V19h2v1.5zm0-2.5h-2c0-1.5-2.5-3-2.5-5 0-1.93 1.57-3.5 3.5-3.5s3.5 1.57 3.5 3.5c0 2-2.5 3.5-2.5 5zm5-11.5H6C6 5.67 6.67 5 7.5 5h9c.83 0 1.5.67 1.5 1.5zm-1-3H7C7 2.67 7.67 2 8.5 2h7c.83 0 1.5.67 1.5 1.5z"},child:[]}]})(n)}function vFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2zm-7 5h5v5h-5z"},child:[]}]})(n)}function yFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M16.23 7h2.6c-.06-.47-.36-.94-.79-1.17L10.5 2 2.8 5.83c-.48.26-.8.81-.8 1.34V15c0 1.1.9 2 2 2V7.4L10.5 4l5.73 3z"},child:[]},{tag:"path",attr:{d:"M20 8H7c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm0 11H7v-7l6.5 3.33L20 12v7zm-6.5-5.67L7 10h13l-6.5 3.33z"},child:[]}]})(n)}function _Fe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 20h4c0 1.1-.9 2-2 2s-2-.9-2-2zm-2-1h8v-2H5v2zm11.5-9.5c0 3.82-2.66 5.86-3.77 6.5H5.27c-1.11-.64-3.77-2.68-3.77-6.5C1.5 5.36 4.86 2 9 2s7.5 3.36 7.5 7.5zm-2 0C14.5 6.47 12.03 4 9 4S3.5 6.47 3.5 9.5c0 2.47 1.49 3.89 2.35 4.5h6.3c.86-.61 2.35-2.03 2.35-4.5zm6.87-2.13L20 8l1.37.63L22 10l.63-1.37L24 8l-1.37-.63L22 6l-.63 1.37zM19 6l.94-2.06L22 3l-2.06-.94L19 0l-.94 2.06L16 3l2.06.94L19 6z"},child:[]}]})(n)}function EFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 16.5c-.83 0-1.5-.67-1.5-1.5v-2.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5V15c0 .83-.67 1.5-1.5 1.5zM20 20h1v-1.54c1.69-.24 3-1.7 3-3.46h-1a2.5 2.5 0 0 1-5 0h-1c0 1.76 1.31 3.22 3 3.46V20zM9 12c-2.21 0-4-1.79-4-4a3.999 3.999 0 0 1 5.34-3.77A5.938 5.938 0 0 0 9 8c0 1.43.5 2.74 1.34 3.77-.42.15-.87.23-1.34.23zm-1.89 1.13A4.965 4.965 0 0 0 5 17.22V20H1v-2.78c0-1.12.61-2.15 1.61-2.66 1.24-.64 2.76-1.19 4.5-1.43zM11 8c0-2.21 1.79-4 4-4s4 1.79 4 4-1.79 4-4 4-4-1.79-4-4zm2 0c0 1.1.9 2 2 2s2-.9 2-2-.9-2-2-2-2 .9-2 2zm2 7c-2.37 0-4.29.73-5.48 1.34-.32.16-.52.5-.52.88V18h7.17c.5.86 1.25 1.56 2.15 2H7v-2.78c0-1.12.61-2.15 1.61-2.66C10.29 13.7 12.47 13 15 13c.39 0 .77.02 1.14.05-.33.59-.55 1.26-.62 1.96-.17-.01-.34-.01-.52-.01z"},child:[]}]})(n)}function wFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M14.94 4.66h-4.72l2.36-2.36 2.36 2.36zm-4.69 14.71h4.66l-2.33 2.33-2.33-2.33zM6.1 6.27 1.6 17.73h1.84l.92-2.45h5.11l.92 2.45h1.84L7.74 6.27H6.1zm-1.13 7.37 1.94-5.18 1.94 5.18H4.97zm10.76 2.5h6.12v1.59h-8.53v-1.29l5.92-8.56h-5.88v-1.6h8.3v1.26l-5.93 8.6z"},child:[]}]})(n)}function SFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.1 0-2 .9-2 2v8h2V5h18v16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"M13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zm-6 0c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zM15.39 16.56C13.71 15.7 11.53 15 9 15s-4.71.7-6.39 1.56A2.97 2.97 0 0 0 1 19.22V22h16v-2.78c0-1.12-.61-2.15-1.61-2.66zM15 20H3c0-.72-.1-1.34.52-1.66C4.71 17.73 6.63 17 9 17c2.37 0 4.29.73 5.48 1.34.63.32.52.95.52 1.66z"},child:[]}]})(n)}function bFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"},child:[]}]})(n)}function CFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M22 8.98V18c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2l.01-12c0-1.1.89-2 1.99-2h10.1c-.06.32-.1.66-.1 1s.04.68.1 1H4l8 5 3.67-2.29c.47.43 1.02.76 1.63.98L12 13 4 8v10h16V9.9c.74-.15 1.42-.48 2-.92zM16 5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"},child:[]}]})(n)}function TFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zm-2 0v.01L12 13 4 8l8-4.68L19.99 8zM4 18v-7.66l8 5.02 7.99-4.99L20 18H4z"},child:[]}]})(n)}function RFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M18 13h-.68l-2 2h1.91L19 17H5l1.78-2h2.05l-2-2H6l-3 3v4c0 1.1.89 2 1.99 2H19a2 2 0 0 0 2-2v-4l-3-3zm1 7H5v-1h14v1zm-7.66-4.98c.39.39 1.02.39 1.41 0l6.36-6.36a.996.996 0 0 0 0-1.41L14.16 2.3a.975.975 0 0 0-1.4-.01L6.39 8.66a.996.996 0 0 0 0 1.41l4.95 4.95zm2.12-10.61L17 7.95l-4.95 4.95-3.54-3.54 4.95-4.95z"},child:[]}]})(n)}function xFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2z"},child:[]},{tag:"path",attr:{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},child:[]}]})(n)}function AFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0-8 4.99L4 6h16zm0 12H4V8l8 5 8-5v10z"},child:[]}]})(n)}function IFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 10h11v2H3v-2zm0-2h11V6H3v2zm0 8h7v-2H3v2zm15.01-3.13.71-.71a.996.996 0 0 1 1.41 0l.71.71c.39.39.39 1.02 0 1.41l-.71.71-2.12-2.12zm-.71.71-5.3 5.3V21h2.12l5.3-5.3-2.12-2.12z"},child:[]}]})(n)}function NFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M23 7V1h-6v2H7V1H1v6h2v10H1v6h6v-2h10v2h6v-6h-2V7h2zM3 3h2v2H3V3zm2 18H3v-2h2v2zm12-2H7v-2H5V7h2V5h10v2h2v10h-2v2zm4 2h-2v-2h2v2zM19 5V3h2v2h-2zm-5.27 9h-3.49l-.73 2H7.89l3.4-9h1.4l3.41 9h-1.63l-.74-2zm-3.04-1.26h2.61L12 8.91l-1.31 3.83z"},child:[]}]})(n)}function OFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6zm-2 16c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"},child:[]}]})(n)}function PFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zM11.5 9.5 9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99-2.18.99z"},child:[]}]})(n)}function LFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"circle",attr:{cx:"4",cy:"14",r:"2"},child:[]},{tag:"path",attr:{d:"M1.22 17.58A2.01 2.01 0 0 0 0 19.43V21h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58z"},child:[]},{tag:"circle",attr:{cx:"20",cy:"14",r:"2"},child:[]},{tag:"path",attr:{d:"M22.78 17.58A6.95 6.95 0 0 0 20 17c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V21H24v-1.57c0-.81-.48-1.53-1.22-1.85zM16.24 16.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 19.39V21h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 19a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM9 12c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3zm4 0c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1z"},child:[]},{tag:"path",attr:{d:"M2.48 10.86C2.17 10.1 2 9.36 2 8.6 2 6.02 4.02 4 6.6 4c2.68 0 3.82 1.74 5.4 3.59C13.57 5.76 14.7 4 17.4 4 19.98 4 22 6.02 22 8.6c0 .76-.17 1.5-.48 2.26.65.31 1.18.82 1.53 1.44.6-1.2.95-2.42.95-3.7C24 4.9 21.1 2 17.4 2c-2.09 0-4.09.97-5.4 2.51C10.69 2.97 8.69 2 6.6 2 2.9 2 0 4.9 0 8.6c0 1.28.35 2.5.96 3.7.35-.62.88-1.13 1.52-1.44z"},child:[]}]})(n)}function DFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M10.27 12h3.46a1.5 1.5 0 0 0 1.48-1.75l-.3-1.79a2.951 2.951 0 0 0-5.82.01l-.3 1.79c-.15.91.55 1.74 1.48 1.74zm.79-3.21c.08-.46.47-.79.94-.79s.86.33.94.79l.2 1.21h-2.28l.2-1.21zM1.66 11.11c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65a1.12 1.12 0 0 0-.99-.74.09.09 0 0 1-.07-.03C5.03 8.14 4.72 8 4.37 8c-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02a1.24 1.24 0 0 0-1.7 1.03c0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09zM16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2z"},child:[]}]})(n)}function kFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.24 13.65c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16a.96.96 0 0 1 .49-.52c1.1-.49 2.26-.73 3.43-.73 1.18 0 2.33.25 3.43.73.23.1.4.29.49.52H8.07zM1.22 14.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58zM22.78 14.58A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85zM12 12c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm0-4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM1.497 11 4 8.497 6.503 11 4 13.503zM20 9l-2.5 4h5z"},child:[]}]})(n)}function MFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58A2.01 2.01 0 0 0 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29zM20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm4 3.43c0-.81-.48-1.53-1.22-1.85A6.95 6.95 0 0 0 20 14c-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9A2.988 2.988 0 0 0 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74zM8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69H8.07zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"},child:[]}]})(n)}function jFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16.67 13.13C18.04 14.06 19 15.32 19 17v3h4v-3c0-2.18-3.57-3.47-6.33-3.87zM15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4c-.47 0-.91.1-1.33.24a5.98 5.98 0 0 1 0 7.52c.42.14.86.24 1.33.24zM9 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM9 13c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4zm6 5H3v-.99C3.2 16.29 6.3 15 9 15s5.8 1.29 6 2v1z"},child:[]}]})(n)}function UFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM8 14V16H6V14H8ZM18 14V16H10V14H18ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z"},child:[]}]})(n)}function FFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11.8611 2.39057C12.8495 1.73163 14.1336 1.71797 15.1358 2.35573L19.291 4.99994H20.9998C21.5521 4.99994 21.9998 5.44766 21.9998 5.99994V14.9999C21.9998 15.5522 21.5521 15.9999 20.9998 15.9999H19.4801C19.5396 16.9472 19.0933 17.9102 18.1955 18.4489L13.1021 21.505C12.4591 21.8907 11.6609 21.8817 11.0314 21.4974C10.3311 22.1167 9.2531 22.1849 8.47104 21.5704L3.33028 17.5312C2.56387 16.9291 2.37006 15.9003 2.76579 15.0847C2.28248 14.7057 2 14.1254 2 13.5109V6C2 5.44772 2.44772 5 3 5H7.94693L11.8611 2.39057ZM4.17264 13.6452L4.86467 13.0397C6.09488 11.9632 7.96042 12.0698 9.06001 13.2794L11.7622 16.2518C12.6317 17.2083 12.7903 18.6135 12.1579 19.739L17.1665 16.7339C17.4479 16.5651 17.5497 16.2276 17.4448 15.9433L13.0177 9.74551C12.769 9.39736 12.3264 9.24598 11.9166 9.36892L9.43135 10.1145C8.37425 10.4316 7.22838 10.1427 6.44799 9.36235L6.15522 9.06958C5.58721 8.50157 5.44032 7.69318 5.67935 7H4V13.5109L4.17264 13.6452ZM14.0621 4.04306C13.728 3.83047 13.3 3.83502 12.9705 4.05467L7.56943 7.65537L7.8622 7.94814C8.12233 8.20827 8.50429 8.30456 8.85666 8.19885L11.3419 7.45327C12.5713 7.08445 13.8992 7.53859 14.6452 8.58303L18.5144 13.9999H19.9998V6.99994H19.291C18.9106 6.99994 18.5381 6.89148 18.2172 6.68727L14.0621 4.04306ZM6.18168 14.5448L4.56593 15.9586L9.70669 19.9978L10.4106 18.7659C10.6256 18.3897 10.5738 17.9178 10.2823 17.5971L7.58013 14.6247C7.2136 14.2215 6.59175 14.186 6.18168 14.5448Z"},child:[]}]})(n)}function BFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 4H21C21.5523 4 22 4.44772 22 5V19C22 19.5523 21.5523 20 21 20H3C2.44772 20 2 19.5523 2 19V5C2 4.44772 2.44772 4 3 4Z"},child:[]}]})(n)}function VFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 4H21C21.5523 4 22 4.44772 22 5V19C22 19.5523 21.5523 20 21 20H3C2.44772 20 2 19.5523 2 19V5C2 4.44772 2.44772 4 3 4ZM4 6V18H20V6H4Z"},child:[]}]})(n)}function zFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2ZM12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4ZM12 5C13.018 5 13.9852 5.21731 14.8579 5.60806L13.2954 7.16944C12.8822 7.05892 12.448 7 12 7C9.23858 7 7 9.23858 7 12C7 13.3807 7.55964 14.6307 8.46447 15.5355L7.05025 16.9497L6.89445 16.7889C5.71957 15.5368 5 13.8525 5 12C5 8.13401 8.13401 5 12 5ZM18.3924 9.14312C18.7829 10.0155 19 10.9824 19 12C19 13.933 18.2165 15.683 16.9497 16.9497L15.5355 15.5355C16.4404 14.6307 17 13.3807 17 12C17 11.552 16.9411 11.1178 16.8306 10.7046L18.3924 9.14312ZM16.2426 6.34315L17.6569 7.75736L13.9325 11.483C13.9765 11.6479 14 11.8212 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C12.1788 10 12.3521 10.0235 12.517 10.0675L16.2426 6.34315Z"},child:[]}]})(n)}function HFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM7 6H11V10H7V6ZM7 12H17V14H7V12ZM7 16H17V18H7V16ZM13 7H17V9H13V7Z"},child:[]}]})(n)}function GFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z"},child:[]}]})(n)}function WFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M9.97308 18H14.0269C14.1589 16.7984 14.7721 15.8065 15.7676 14.7226C15.8797 14.6006 16.5988 13.8564 16.6841 13.7501C17.5318 12.6931 18 11.385 18 10C18 6.68629 15.3137 4 12 4C8.68629 4 6 6.68629 6 10C6 11.3843 6.46774 12.6917 7.31462 13.7484C7.40004 13.855 8.12081 14.6012 8.23154 14.7218C9.22766 15.8064 9.84103 16.7984 9.97308 18ZM14 20H10V21H14V20ZM5.75395 14.9992C4.65645 13.6297 4 11.8915 4 10C4 5.58172 7.58172 2 12 2C16.4183 2 20 5.58172 20 10C20 11.8925 19.3428 13.6315 18.2443 15.0014C17.624 15.7748 16 17 16 18.5V21C16 22.1046 15.1046 23 14 23H10C8.89543 23 8 22.1046 8 21V18.5C8 17 6.37458 15.7736 5.75395 14.9992ZM13 10.0048H15.5L11 16.0048V12.0048H8.5L13 6V10.0048Z"},child:[]}]})(n)}function $Fe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"},child:[]}]})(n)}function KFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.78307 2.82598L12 1L20.2169 2.82598C20.6745 2.92766 21 3.33347 21 3.80217V13.7889C21 15.795 19.9974 17.6684 18.3282 18.7812L12 23L5.6718 18.7812C4.00261 17.6684 3 15.795 3 13.7889V3.80217C3 3.33347 3.32553 2.92766 3.78307 2.82598ZM12 13.5L14.9389 15.0451L14.3776 11.7725L16.7553 9.45492L13.4695 8.97746L12 6L10.5305 8.97746L7.24472 9.45492L9.62236 11.7725L9.06107 15.0451L12 13.5Z"},child:[]}]})(n)}function qFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 4.60434V13.7889C5 15.1263 5.6684 16.3752 6.7812 17.1171L12 20.5963L17.2188 17.1171C18.3316 16.3752 19 15.1263 19 13.7889V4.60434L12 3.04879L5 4.60434ZM3.78307 2.82598L12 1L20.2169 2.82598C20.6745 2.92766 21 3.33347 21 3.80217V13.7889C21 15.795 19.9974 17.6684 18.3282 18.7812L12 23L5.6718 18.7812C4.00261 17.6684 3 15.795 3 13.7889V3.80217C3 3.33347 3.32553 2.92766 3.78307 2.82598ZM12 13.5L9.06107 15.0451L9.62236 11.7725L7.24472 9.45492L10.5305 8.97746L12 6L13.4695 8.97746L16.7553 9.45492L14.3776 11.7725L14.9389 15.0451L12 13.5Z"},child:[]}]})(n)}function YFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.78307 2.82598L12 1L20.2169 2.82598C20.6745 2.92766 21 3.33347 21 3.80217V13.7889C21 15.795 19.9974 17.6684 18.3282 18.7812L12 23L5.6718 18.7812C4.00261 17.6684 3 15.795 3 13.7889V3.80217C3 3.33347 3.32553 2.92766 3.78307 2.82598ZM12 11C13.3807 11 14.5 9.88071 14.5 8.5C14.5 7.11929 13.3807 6 12 6C10.6193 6 9.5 7.11929 9.5 8.5C9.5 9.88071 10.6193 11 12 11ZM7.52746 16H16.4725C16.2238 13.75 14.3163 12 12 12C9.68372 12 7.77619 13.75 7.52746 16Z"},child:[]}]})(n)}function XFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3.78307 2.82598L12 1L20.2169 2.82598C20.6745 2.92766 21 3.33347 21 3.80217V13.7889C21 15.795 19.9974 17.6684 18.3282 18.7812L12 23L5.6718 18.7812C4.00261 17.6684 3 15.795 3 13.7889V3.80217C3 3.33347 3.32553 2.92766 3.78307 2.82598ZM5 4.60434V13.7889C5 15.1263 5.6684 16.3752 6.7812 17.1171L12 20.5963L17.2188 17.1171C18.3316 16.3752 19 15.1263 19 13.7889V4.60434L12 3.04879L5 4.60434ZM12 11C10.6193 11 9.5 9.88071 9.5 8.5C9.5 7.11929 10.6193 6 12 6C13.3807 6 14.5 7.11929 14.5 8.5C14.5 9.88071 13.3807 11 12 11ZM7.52746 16C7.77619 13.75 9.68372 12 12 12C14.3163 12 16.2238 13.75 16.4725 16H7.52746Z"},child:[]}]})(n)}function JFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M22 15H19V3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15ZM16.7071 16.2929L10.3066 22.6934C10.1307 22.8693 9.85214 22.8891 9.65308 22.7398L8.8005 22.1004C8.3158 21.7369 8.09739 21.1174 8.24686 20.5303L9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H16C16.5523 3 17 3.44772 17 4V15.5858C17 15.851 16.8946 16.1054 16.7071 16.2929Z"},child:[]}]})(n)}function QFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2 8.99997H5V21H2C1.44772 21 1 20.5523 1 20V9.99997C1 9.44769 1.44772 8.99997 2 8.99997ZM7.29289 7.70708L13.6934 1.30661C13.8693 1.13066 14.1479 1.11087 14.3469 1.26016L15.1995 1.8996C15.6842 2.26312 15.9026 2.88253 15.7531 3.46966L14.5998 7.99997H21C22.1046 7.99997 23 8.8954 23 9.99997V12.1043C23 12.3656 22.9488 12.6243 22.8494 12.8658L19.755 20.3807C19.6007 20.7554 19.2355 21 18.8303 21H8C7.44772 21 7 20.5523 7 20V8.41419C7 8.14897 7.10536 7.89462 7.29289 7.70708Z"},child:[]}]})(n)}function ZFe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 14V16C8.68629 16 6 18.6863 6 22H4C4 17.5817 7.58172 14 12 14ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11ZM18 21.5L15.0611 23.0451L15.6224 19.7725L13.2447 17.4549L16.5305 16.9775L18 14L19.4695 16.9775L22.7553 17.4549L20.3776 19.7725L20.9389 23.0451L18 21.5Z"},child:[]}]})(n)}function eBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M1023.31 473.28c-1.36-11.312-5.614-21.713-12.095-30.465h.16l-.88-.88c-3.28-4.32-7.12-8.128-11.408-11.504L831.935 262.047V158.783c0-17.68-14.32-32-32-32H698.607l-116.8-99.711c-36.223-36.224-99.504-36.289-135.776 0l-116.4 99.711H223.935c-17.68 0-32 14.32-32 32V264.16L28.815 427.28c-17.343 11.472-28.88 31.088-28.88 53.344v479.504c0 35.184 28.817 64 64 64h896c35.184 0 64-28.816 64-64v-478.24c.224-2.88-.064-5.76-.624-8.607zM268.865 725.503L63.937 915.582V544.686zm61.697 29.999a31.634 31.634 0 0 0 11.377-8.224c1.712-1.935 3.056-4.063 4.224-6.255l137.904-127.936c7.248-5.84 15.84-8.913 24.88-8.913 9.183 0 18.367 3.216 24.527 8l383.84 347.936H110.002zm427.777-25.776l201.6-178.896v361.632zm139.599-313.104h-.976l54.896 55.792-119.92 106.432V350.638zM491.283 72.318c6.064-6.032 14.095-9.376 22.623-9.376 8.56 0 16.592 3.344 22.656 9.376l64.624 54.464H426.754zm276.655 118.464V635.63l-57.312 50.88-136.32-123.568c-37.68-29.536-91.775-30.817-131.68 1.376l-126.624 117.44-60.064-53.008V190.782zM103.777 442.813l88.16-88.129V572.3L75.313 469.404l26.992-26.592h1.472z"},child:[]}]})(n)}function tBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M1023.46 232a31.629 31.629 0 0 0-2.48-18.271C1012.917 178.288 987.3 160 944.005 160h-832c-38.08 0-79.105 14-99.28 41.472-1.745 1.328-3.409 2.832-4.912 4.576-6.449 7.44-8.705 17.009-7.264 26.033-.288 2.592-.544 5.2-.544 7.92v512c0 53.024 58.992 112 112 112h832c53.024 0 80-58.976 80-112v-512c0-2.832-.368-5.313-.544-8.001zm-911.459-8l832.001-.001h.432L512.002 568.655 81.314 225.407C91.106 223.599 103.154 224 112 224zm832.001 575.999H112.003c-17.648 0-48-30.336-48-48V293.551l427.04 341.648c6.016 5.2 13.487 7.792 20.959 7.792a32.046 32.046 0 0 0 20.976-7.792l427.024-341.632v458.432c0 17.664 1.664 48-16 48z"},child:[]}]})(n)}function nBe(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 17 16"},child:[{tag:"path",attr:{d:"M16 15v-1h-1v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-1v1h-1v1h17v-1h-1z"},child:[]},{tag:"path",attr:{d:"M8 0h1l8 5v1h-17v-1l8-5z"},child:[]}]})(n)}function iBe(n){return Le({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11 0c-2.761 0-5 2.239-5 5 0 0.313 0.029 0.619 0.084 0.916l-6.084 6.084v3c0 0.552 0.448 1 1 1h1v-1h2v-2h2v-2h2l1.298-1.298c0.531 0.192 1.105 0.298 1.702 0.298 2.761 0 5-2.239 5-5s-2.239-5-5-5zM12.498 5.002c-0.828 0-1.5-0.672-1.5-1.5s0.672-1.5 1.5-1.5 1.5 0.672 1.5 1.5-0.672 1.5-1.5 1.5z"},child:[]}]})(n)}function rBe(n){return Le({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:`M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r
c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r
c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z`},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:`M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r
C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z`},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:`M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r
c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z`},child:[]},{tag:"path",attr:{fill:"#1976D2",d:`M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r
c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z`},child:[]}]})(n)}function sBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 2H13V1h-1v1H4V1H3v1H1.5l-.5.5v12l.5.5h13l.5-.5v-12l-.5-.5zM14 14H2V5h12v9zm0-10H2V3h12v1zM4 8H3v1h1V8zm-1 2h1v1H3v-1zm1 2H3v1h1v-1zm2-4h1v1H6V8zm1 2H6v1h1v-1zm-1 2h1v1H6v-1zm1-6H6v1h1V6zm2 2h1v1H9V8zm1 2H9v1h1v-1zm-1 2h1v1H9v-1zm1-6H9v1h1V6zm2 2h1v1h-1V8zm1 2h-1v1h1v-1zm-1-4h1v1h-1V6z"},child:[]}]})(n)}function aBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M3.889 2.095a6.5 6.5 0 1 1 7.222 10.81A6.5 6.5 0 0 1 3.89 2.094zm.555 9.978A5.5 5.5 0 0 0 7.5 13 5.506 5.506 0 0 0 13 7.5a5.5 5.5 0 1 0-8.556 4.573zM10.294 4l.706.707-2.15 2.15a1.514 1.514 0 1 1-.707-.707L10.293 4zM7.221 7.916a.5.5 0 1 0 .556-.832.5.5 0 0 0-.556.832zm4.286-2.449l-.763.763c.166.403.253.834.255 1.27a3.463 3.463 0 0 1-.5 1.777l.735.735a4.477 4.477 0 0 0 .274-4.545h-.001zM8.733 4.242A3.373 3.373 0 0 0 7.5 4 3.5 3.5 0 0 0 4 7.5a3.46 3.46 0 0 0 .5 1.777l-.734.735A4.5 4.5 0 0 1 9.5 3.473l-.767.769z"},child:[]}]})(n)}function oBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M13.85 4.44l-3.28-3.3-.35-.14H2.5l-.5.5V7h1V2h6v3.5l.5.5H13v1h1V4.8l-.15-.36zM10 5V2l3 3h-3zM2.5 8l-.5.5v6l.5.5h11l.5-.5v-6l-.5-.5h-11zM13 13v1H3V9h10v4zm-8-1h-.32v1H4v-3h1.06c.75 0 1.13.36 1.13 1a.94.94 0 0 1-.32.72A1.33 1.33 0 0 1 5 12zm-.06-1.45h-.26v.93h.26c.36 0 .54-.16.54-.47 0-.31-.18-.46-.54-.46zM9 12.58a1.48 1.48 0 0 0 .44-1.12c0-1-.53-1.46-1.6-1.46H6.78v3h1.06A1.6 1.6 0 0 0 9 12.58zm-1.55-.13v-1.9h.33a.94.94 0 0 1 .7.25.91.91 0 0 1 .25.67 1 1 0 0 1-.25.72.94.94 0 0 1-.69.26h-.34zm4.45-.61h-.97V13h-.68v-3h1.74v.55h-1.06v.74h.97v.55z"},child:[]}]})(n)}function lBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.02 3.77v1.56l1-.99V2.5l-.5-.5h-9l-.5.5v.486L2 3v10.29l.36.46 5 1.72L8 15v-1h3.52l.5-.5v-1.81l-1-1V13H8V4.71l-.33-.46L4.036 3h6.984v.77zM7 14.28l-4-1.34V3.72l4 1.34v9.22zm6.52-5.8H8.55v-1h4.93l-1.6-1.6.71-.7 2.47 2.46v.71l-2.49 2.48-.7-.7 1.65-1.65z"},child:[]}]})(n)}function cBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M152,180a40.55,40.55,0,0,1-20,34.91A8,8,0,0,1,124,201.09a24.49,24.49,0,0,0,0-42.18A8,8,0,0,1,132,145.09,40.55,40.55,0,0,1,152,180ZM99.06,128.61a8,8,0,0,0-8.72,1.73L68.69,152H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H68.69l21.65,21.66A8,8,0,0,0,104,224V136A8,8,0,0,0,99.06,128.61ZM216,88V216a16,16,0,0,1-16,16H168a8,8,0,0,1,0-16h32V96H152a8,8,0,0,1-8-8V40H56v80a8,8,0,0,1-16,0V40A16,16,0,0,1,56,24h96a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31Z"},child:[]}]})(n)}function dBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M112,216a8,8,0,0,1-8,8H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h56a8,8,0,0,1,0,16H48V208h56A8,8,0,0,1,112,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L196.69,120H104a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,221.66,122.34Z"},child:[]}]})(n)}function uBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"},child:[]},{tag:"circle",attr:{cx:"12",cy:"13",r:"4"},child:[]}]})(n)}function hBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 3 Z M 8 5 L 24 5 L 24 27 L 8 27 Z M 16 9.71875 L 16 16.1875 C 15.683594 16.074219 15.351563 16 15 16 C 13.355469 16 12 17.355469 12 19 C 12 20.644531 13.355469 22 15 22 C 16.644531 22 18 20.644531 18 19 L 18 12.28125 L 20.75 12.96875 L 21.25 11.03125 Z M 15 18 C 15.5625 18 16 18.4375 16 19 C 16 19.5625 15.5625 20 15 20 C 14.4375 20 14 19.5625 14 19 C 14 18.4375 14.4375 18 15 18 Z"},child:[]}]})(n)}function fBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 9.59375 L 25.71875 9.28125 L 19.71875 3.28125 L 19.40625 3 Z M 8 5 L 18 5 L 18 11 L 24 11 L 24 27 L 8 27 Z M 20 6.4375 L 22.5625 9 L 20 9 Z M 21.09375 14 C 20.542969 14 20.09375 14.449219 20.09375 15 C 20.09375 15.550781 20.542969 16 21.09375 16 C 21.644531 16 22.09375 15.550781 22.09375 15 C 22.09375 14.449219 21.644531 14 21.09375 14 Z M 14 15.59375 L 13.28125 16.28125 L 9.28125 20.28125 L 10.71875 21.71875 L 14 18.4375 L 16.28125 20.71875 L 17 21.40625 L 17.71875 20.71875 L 19 19.4375 L 21.28125 21.71875 L 22.71875 20.28125 L 19.71875 17.28125 L 19 16.59375 L 18.28125 17.28125 L 17 18.5625 L 14.71875 16.28125 Z"},child:[]}]})(n)}function pBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 3 Z M 8 5 L 24 5 L 24 27 L 8 27 Z M 15.40625 10.34375 C 15.101563 10.339844 14.746094 10.449219 14.5 10.65625 C 14.246094 10.871094 14.132813 11.136719 14.0625 11.40625 C 13.925781 11.945313 13.964844 12.503906 14.09375 13.125 C 14.246094 13.851563 14.679688 14.726563 15.03125 15.5625 C 14.851563 16.324219 14.804688 17 14.53125 17.78125 C 14.296875 18.453125 13.996094 18.839844 13.71875 19.4375 C 13.089844 19.675781 12.339844 19.816406 11.84375 20.125 C 11.308594 20.457031 10.839844 20.824219 10.5625 21.34375 C 10.285156 21.863281 10.316406 22.597656 10.6875 23.125 C 10.871094 23.402344 11.113281 23.621094 11.4375 23.75 C 11.761719 23.878906 12.113281 23.882813 12.40625 23.78125 C 12.996094 23.578125 13.414063 23.125 13.8125 22.59375 C 14.183594 22.101563 14.445313 21.265625 14.78125 20.59375 C 15.285156 20.425781 15.648438 20.214844 16.1875 20.09375 C 16.75 19.96875 17.128906 20.027344 17.65625 19.96875 C 17.882813 20.226563 18.074219 20.640625 18.3125 20.84375 C 18.789063 21.257813 19.3125 21.585938 19.9375 21.625 C 20.5625 21.664063 21.1875 21.273438 21.53125 20.6875 L 21.5625 20.6875 L 21.5625 20.65625 C 21.714844 20.390625 21.820313 20.101563 21.8125 19.78125 C 21.804688 19.460938 21.644531 19.125 21.4375 18.90625 C 21.027344 18.46875 20.503906 18.355469 19.9375 18.28125 C 19.5 18.222656 18.890625 18.378906 18.375 18.40625 C 17.921875 17.808594 17.472656 17.359375 17.0625 16.59375 C 16.839844 16.179688 16.78125 15.828125 16.59375 15.40625 C 16.738281 14.726563 17.023438 13.96875 17.0625 13.375 C 17.109375 12.65625 17.082031 12.035156 16.875 11.46875 C 16.769531 11.183594 16.601563 10.902344 16.34375 10.6875 C 16.09375 10.480469 15.769531 10.351563 15.4375 10.34375 C 15.425781 10.34375 15.417969 10.34375 15.40625 10.34375 Z M 16.0625 17.75 C 16.242188 18.066406 16.464844 18.265625 16.65625 18.5625 C 16.375 18.613281 16.160156 18.5625 15.875 18.625 C 15.828125 18.636719 15.796875 18.675781 15.75 18.6875 C 15.808594 18.53125 15.882813 18.4375 15.9375 18.28125 C 16 18.097656 16.003906 17.933594 16.0625 17.75 Z M 19.75 19.78125 C 20.085938 19.824219 20.207031 19.886719 20.25 19.90625 C 20.242188 19.921875 20.261719 19.917969 20.25 19.9375 C 20.125 20.144531 20.113281 20.128906 20.03125 20.125 C 19.964844 20.121094 19.710938 19.984375 19.46875 19.8125 C 19.539063 19.816406 19.6875 19.773438 19.75 19.78125 Z M 12.75 21.34375 C 12.695313 21.425781 12.648438 21.617188 12.59375 21.6875 C 12.289063 22.09375 12.007813 22.28125 11.9375 22.3125 C 11.925781 22.296875 11.957031 22.3125 11.9375 22.28125 L 11.90625 22.28125 C 11.804688 22.136719 11.832031 22.195313 11.90625 22.0625 C 11.980469 21.929688 12.214844 21.660156 12.625 21.40625 C 12.65625 21.386719 12.71875 21.363281 12.75 21.34375 Z"},child:[]}]})(n)}function mBe(n){return Le({tag:"svg",attr:{viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M 6 3 L 6 29 L 26 29 L 26 9.59375 L 25.71875 9.28125 L 19.71875 3.28125 L 19.40625 3 Z M 8 5 L 18 5 L 18 11 L 24 11 L 24 27 L 8 27 Z M 20 6.4375 L 22.5625 9 L 20 9 Z M 13 13.21875 L 13 22.78125 L 14.5 21.84375 L 19.5 18.84375 L 20.9375 18 L 19.5 17.15625 L 14.5 14.15625 Z M 15 16.75 L 17.09375 18 L 15 19.25 Z"},child:[]}]})(n)}const wn=[{title:"FaBars",category:"general",tag:"menubar1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Jje,{})},{title:"FaSignOutAlt",category:"general",tag:"logout1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(sUe,{})},{title:"AiOutlineLogout",category:"general",tag:"logout2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(KMe,{})},{title:"VscSignOut",category:"general",tag:"logout3",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(lBe,{})},{title:"PiSignOut",category:"general",tag:"logout4",familyName:"Phosphor Icons",familyCode:"pi",component:h.jsx(dBe,{})},{title:"BsPlusCircle",category:"general",tag:"add1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(o9e,{})},{title:"BsPlus",category:"general",tag:"add2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(l9e,{})},{title:"AiOutlinePlus",category:"general",tag:"add3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(ZMe,{})},{title:"BsMoonStarsFill",category:"general",tag:"theme-light1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(H7e,{})},{title:"BsFillSunFill",category:"general",tag:"theme-dark1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(y7e,{})},{title:"BsPlayCircleFill",category:"general",tag:"play1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(s9e,{})},{title:"BsPlayBtnFill",category:"general",tag:"play2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(i9e,{})},{title:"BsPlayFill",category:"general",tag:"play3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(a9e,{})},{title:"BsExclamationCircle",category:"general",tag:"warning1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(GO,{})},{title:"BsFillExclamationTriangleFill",category:"general",tag:"warning2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(u7e,{})},{title:"BsFillExclamationCircleFill",category:"general",tag:"warning3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(d7e,{})},{title:"BsInfoCircle",category:"general",tag:"info1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(z7e,{})},{title:"BsFillInfoCircleFill",category:"general",tag:"info2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(p7e,{})},{title:"MdSend",category:"general",tag:"send1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(Eye,{})},{title:"FaTelegramPlane",category:"general",tag:"send2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx($je,{})},{title:"BiPaperPlane",category:"general",tag:"send3",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Sje,{})},{title:"BsGear",category:"general",tag:"settings1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(M7e,{})},{title:"GoGear",category:"general",tag:"settings2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(b9e,{})},{title:"BsGearFill",category:"general",tag:"settings3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(k7e,{})},{title:"BsFillEyeFill",category:"general",tag:"view1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(h7e,{})},{title:"BsFillEyeSlashFill",category:"general",tag:"hide1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(f7e,{})},{title:"BsCheck",category:"general",tag:"check1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(R7e,{})},{title:"BsFillCheckCircleFill",category:"general",tag:"check2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(c7e,{})},{title:"BsCheckCircleFill",category:"general",tag:"check3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(T7e,{})},{title:"BsSearch",category:"general",tag:"search1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(d9e,{})},{title:"FaCrown",category:"general",tag:"crown1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(nUe,{})},{title:"BsClockHistory",category:"general",tag:"date1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(A7e,{})},{title:"TbCalendarTime",category:"general",tag:"date2",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(dje,{})},{title:"TbCalendarStats",category:"general",tag:"date3",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(cje,{})},{title:"VscCalendar",category:"general",tag:"date4",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(sBe,{})},{title:"LuCalendarClock",category:"general",tag:"date5",familyName:"Lucide",familyCode:"lu",component:h.jsx(TUe,{})},{title:"LuCalendarDays",category:"general",tag:"date6",familyName:"Lucide",familyCode:"lu",component:h.jsx(RUe,{})},{title:"LuCalendarRange",category:"general",tag:"date7",familyName:"Lucide",familyCode:"lu",component:h.jsx(xUe,{})},{title:"TfiDashboard",category:"general",tag:"metrics1",familyName:"Themify Icons",familyCode:"tfi",component:h.jsx(_je,{})},{title:"RiDashboard2Line",category:"general",tag:"metrics2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(zFe,{})},{title:"VscDashboard",category:"general",tag:"metrics3",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(aBe,{})},{title:"BsPerson",category:"general",tag:"user1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(n9e,{})},{title:"MdPerson",category:"general",tag:"user2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(uFe,{})},{title:"BsFillPersonFill",category:"general",tag:"user3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(g7e,{})},{title:"FiCamera",category:"general",tag:"camera1",familyName:"Feather",familyCode:"fi",component:h.jsx(uBe,{})},{title:"IoCallOutline",category:"general",tag:"call1",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Lje,{})},{title:"HiOutlinePhone",category:"general",tag:"call2",familyName:"Heroicons",familyCode:"hi",component:h.jsx(SUe,{})},{title:"TbPhone",category:"general",tag:"call3",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(pje,{})},{title:"AiOutlineHome",category:"general",tag:"home1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx($Me,{})},{title:"BsCircle",category:"general",tag:"circle1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(x7e,{})},{title:"FaThumbsUp",category:"general",tag:"upvote1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(oUe,{})},{title:"RiThumbUpFill",category:"general",tag:"upvote2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(QFe,{})},{title:"HiOutlineThumbUp",category:"general",tag:"upvote3",familyName:"Heroicons",familyCode:"hi",component:h.jsx(CUe,{})},{title:"FaThumbsDown",category:"general",tag:"downvote1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(aUe,{})},{title:"RiThumbDownFill",category:"general",tag:"downvote2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(JFe,{})},{title:"HiOutlineThumbDown",category:"general",tag:"downvote3",familyName:"Heroicons",familyCode:"hi",component:h.jsx(bUe,{})},{title:"BiSolidMap",category:"general",tag:"location1",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(Cje,{})},{title:"FaKey",category:"general",tag:"key1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(rUe,{})},{title:"IoKey",category:"general",tag:"key2",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Mje,{})},{title:"IoKeyOutline",category:"general",tag:"key3",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(kje,{})},{title:"ImKey",category:"general",tag:"key4",familyName:"IcoMoon Free",familyCode:"im",component:h.jsx(iBe,{})},{title:"MdLock",category:"general",tag:"lock1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(BUe,{})},{title:"MdLockOpen",category:"general",tag:"lock2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(UUe,{})},{title:"MdLockOutline",category:"general",tag:"lock3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(FUe,{})},{title:"MdPrint",category:"general",tag:"print1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(VUe,{})},{title:"IoPrintSharp",category:"general",tag:"print2",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Fje,{})},{title:"IoPrintOutline",category:"general",tag:"print3",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Uje,{})},{title:"MdPrintDisabled",category:"general",tag:"noprint1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(KUe,{})},{title:"IoLocationSharp",category:"general",tag:"location1",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(jje,{})},{title:"FaLocationDot",category:"file",tag:"location2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(vUe,{})},{title:"BsPlayBtn",category:"file",tag:"video1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(r9e,{})},{title:"LiaFileVideo",category:"file",tag:"video2",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(mBe,{})},{title:"MdOutlineAudiotrack",category:"file",tag:"audio1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(OFe,{})},{title:"PiFileAudioFill",category:"file",tag:"audio2",familyName:"Phosphor Icons",familyCode:"pi",component:h.jsx(cBe,{})},{title:"LiaFileAudio",category:"file",tag:"audio3",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(hBe,{})},{title:"LiaFilePdf",category:"file",tag:"pdf1",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(pBe,{})},{title:"FaFilePdf",category:"file",tag:"pdf2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(iUe,{})},{title:"BsFiletypePdf",category:"file",tag:"pdf3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(P7e,{})},{title:"VscFilePdf",category:"file",tag:"pdf4",familyName:"VS Code Icons",familyCode:"vsc",component:h.jsx(oBe,{})},{title:"TbFileTypePdf",category:"file",tag:"pdf5",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(fje,{})},{title:"LiaFileImage",category:"file",tag:"image1",familyName:"Icons8 Line Awesome",familyCode:"lia",component:h.jsx(fBe,{})},{title:"BsImage",category:"file",tag:"image2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(B7e,{})},{title:"BsImages",category:"file",tag:"image3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(V7e,{})},{title:"FaClipboardQuestion",category:"file",tag:"quiz1",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(mUe,{})},{title:"BsPatchQuestionFill",category:"file",tag:"quiz2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(G7e,{})},{title:"FaLink",category:"file",tag:"link1",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(gUe,{})},{title:"RiExternalLinkLine",category:"file",tag:"link2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx($Fe,{})},{title:"MdEditDocument",category:"file",tag:"form1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(LUe,{})},{title:"MdOutlineEditNote",category:"file",tag:"survey1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(IFe,{})},{title:"IoIosArrowUp",category:"arrows",tag:"arrow-up1",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Aje,{})},{title:"FaChevronDown",category:"arrows",tag:"arrow-down1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Zje,{})},{title:"IoIosArrowDown",category:"arrows",tag:"arrow-down2",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Rje,{})},{title:"FaArrowLeft",category:"arrows",tag:"arrow-left1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Yje,{})},{title:"FaArrowLeftLong",category:"arrows",tag:"arrow-left2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(fUe,{})},{title:"IoIosArrowBack",category:"arrows",tag:"arrow-left3",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Tje,{})},{title:"FaAnglesLeft",category:"arrows",tag:"arrow-left4",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(uUe,{})},{title:"IoIosArrowForward",category:"arrows",tag:"arrow-right1",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(xje,{})},{title:"FaArrowRight",category:"arrows",tag:"arrow-right2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Xje,{})},{title:"FaArrowRightLong",category:"arrows",tag:"arrow-right3",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(pUe,{})},{title:"FaAnglesRight",category:"arrows",tag:"arrow-right4",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(hUe,{})},{title:"BsArrowLeftRight",category:"arrows",tag:"arrow-left-right1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(w7e,{})},{title:"TiSortAlphabetically",category:"sort",tag:"sort1",familyName:"Typicons",familyCode:"ti",component:h.jsx(yje,{})},{title:"BsFilter",category:"sort",tag:"sort2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(L7e,{})},{title:"BsType",category:"sort",tag:"sort3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(g9e,{})},{title:"TbSortAscendingLetters",category:"sort",tag:"sort4",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(vje,{})},{title:"MdOutlineSortByAlpha",category:"sort",tag:"sort5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(wFe,{})},{title:"MdSortByAlpha",category:"sort",tag:"sort6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(WUe,{})},{title:"BsThreeDotsVertical",category:"sort",tag:"sort7",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(f9e,{})},{title:"BsFunnelFill",category:"sort",tag:"sort8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(D7e,{})},{title:"ImLibrary",category:"exp-bank",tag:"exp-bank1",familyName:"IcoMoon Free",familyCode:"im",component:h.jsx(nBe,{})},{title:"BsBank2",category:"exp-bank",tag:"exp-bank2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(S7e,{})},{title:"BsColumnsGap",category:"dashboard",tag:"dashboard1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(I7e,{})},{title:"BiShapeSquare",category:"associate",tag:"associate1",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(bje,{})},{title:"BsRecycle",category:"associate",tag:"associate2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(c9e,{})},{title:"BsUbuntu",category:"associate",tag:"associate3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(v9e,{})},{title:"AiOutlineCodeSandbox",category:"associate",tag:"associate4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(zMe,{})},{title:"AiOutlineDeploymentUnit",category:"associate",tag:"associate5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(WMe,{})},{title:"MdFormatShapes",category:"associate",tag:"associate6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(QUe,{})},{title:"MdTypeSpecimen",category:"associate",tag:"associate7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(eFe,{})},{title:"MdOutlineFormatShapes",category:"associate",tag:"associate8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(NFe,{})},{title:"RiShakeHandsLine",category:"associate",tag:"associate9",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(FFe,{})},{title:"MdDiversity2",category:"associate",tag:"associate10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(iFe,{})},{title:"BsShare",category:"share",tag:"share1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(u9e,{})},{title:"FaRegShareFromSquare",category:"share",tag:"share2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(EUe,{})},{title:"IoMdShareAlt",category:"share",tag:"share3",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Oje,{})},{title:"GiShare",category:"share",tag:"share4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(tje,{})},{title:"BsDiagram3",category:"network",tag:"network1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(N7e,{})},{title:"BsFillPeopleFill",category:"network",tag:"network2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(m7e,{})},{title:"AiOutlineCluster",category:"network",tag:"network3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(VMe,{})},{title:"AiOutlinePartition",category:"network",tag:"network4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(JMe,{})},{title:"AiOutlineNodeCollapse",category:"network",tag:"network5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(qMe,{})},{title:"AiOutlineNodeExpand",category:"network",tag:"network6",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(YMe,{})},{title:"AiOutlineNodeIndex",category:"network",tag:"network7",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(XMe,{})},{title:"MdDiversity3",category:"network",tag:"network8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(rFe,{})},{title:"MdGroups2",category:"network",tag:"network9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(sFe,{})},{title:"MdGroups",category:"network",tag:"network10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(oFe,{})},{title:"MdGroups3",category:"network",tag:"network11",familyName:"Material Design icons",familyCode:"md",component:h.jsx(aFe,{})},{title:"MdOutlineGroups3",category:"network",tag:"network12",familyName:"Material Design icons",familyCode:"md",component:h.jsx(kFe,{})},{title:"MdOutlineGroups2",category:"network",tag:"network13",familyName:"Material Design icons",familyCode:"md",component:h.jsx(DFe,{})},{title:"MdOutlineGroups",category:"network",tag:"network14",familyName:"Material Design icons",familyCode:"md",component:h.jsx(MFe,{})},{title:"MdOutlineDiversity1",category:"network",tag:"network15",familyName:"Material Design icons",familyCode:"md",component:h.jsx(LFe,{})},{title:"MdOutlinePeopleAlt",category:"network",tag:"network16",familyName:"Material Design icons",familyCode:"md",component:h.jsx(jFe,{})},{title:"BsPeople",category:"network",tag:"network17",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Y7e,{})},{title:"BsPatchQuestion",category:"discover",tag:"discover1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(W7e,{})},{title:"AiOutlineAlert",category:"discover",tag:"discover2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(UMe,{})},{title:"AiOutlineBulb",category:"discover",tag:"discover3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(BMe,{})},{title:"GiSmart",category:"discover",tag:"discover4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(nje,{})},{title:"GiTeamIdea",category:"discover",tag:"discover5",familyName:"Game Icons",familyCode:"gi",component:h.jsx(sje,{})},{title:"GoLightBulb",category:"discover",tag:"discover6",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(T9e,{})},{title:"HiOutlineLightBulb",category:"discover",tag:"discover7",familyName:"Heroicons",familyCode:"hi",component:h.jsx(wUe,{})},{title:"MdLightbulbOutline",category:"discover",tag:"discover8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(jUe,{})},{title:"MdTipsAndUpdates",category:"discover",tag:"discover9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(HUe,{})},{title:"MdOutlineBatchPrediction",category:"discover",tag:"discover10",familyName:"Material Design icons",familyCode:"md",component:h.jsx(gFe,{})},{title:"MdOutlineTipsAndUpdates",category:"discover",tag:"discover11",familyName:"Material Design icons",familyCode:"md",component:h.jsx(_Fe,{})},{title:"RiLightbulbFlashLine",category:"discover",tag:"discover12",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(WFe,{})},{title:"BsHeadphones",category:"consult",tag:"consult1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(U7e,{})},{title:"BsPersonCheck",category:"consult",tag:"consult2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(J7e,{})},{title:"BsPersonBadge",category:"consult",tag:"consult3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(X7e,{})},{title:"AiOutlineCustomerService",category:"consult",tag:"consult4",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(HMe,{})},{title:"AiOutlineSolution",category:"consult",tag:"consult5",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(s7e,{})},{title:"MdCoPresent",category:"consult",tag:"consult6",familyName:"Material Design icons",familyCode:"md",component:h.jsx($Ue,{})},{title:"MdOutlineCoPresent",category:"consult",tag:"consult7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(SFe,{})},{title:"BsPersonWorkspace",category:"consult",tag:"consult8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(t9e,{})},{title:"BsPersonRolodex",category:"consult",tag:"consult9",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Z7e,{})},{title:"BsPersonSquare",category:"consult",tag:"consult10",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(e9e,{})},{title:"BsHeadset",category:"consult",tag:"consult11",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(F7e,{})},{title:"BsPersonLinesFill",category:"consult",tag:"consult12",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(Q7e,{})},{title:"AiOutlineUserSwitch",category:"consult",tag:"consult13",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(l7e,{})},{title:"MdRecordVoiceOver",category:"consult",tag:"consult14",familyName:"Material Design icons",familyCode:"md",component:h.jsx(zUe,{})},{title:"MdInterpreterMode",category:"consult",tag:"consult15",familyName:"Material Design icons",familyCode:"md",component:h.jsx(GUe,{})},{title:"MdOutlineInterpreterMode",category:"consult",tag:"consult16",familyName:"Material Design icons",familyCode:"md",component:h.jsx(EFe,{})},{title:"BsEnvelope",category:"message",tag:"message1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(O7e,{})},{title:"MdOutlineMailOutline",category:"message",tag:"message2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(bFe,{})},{title:"MdOutlineMarkEmailUnread",category:"message",tag:"message3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(CFe,{})},{title:"MdOutlineMail",category:"message",tag:"message4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(AFe,{})},{title:"SlEnvolope",category:"message",tag:"message5",familyName:"Simple Line Icons",familyCode:"sl",component:h.jsx(tBe,{})},{title:"BsChatSquareTextFill",category:"message",tag:"message6",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(C7e,{})},{title:"BiConversation",category:"message",tag:"message7",familyName:"BoxIcons",familyCode:"bi",component:h.jsx(wje,{})},{title:"FaCommentDots",category:"message",tag:"message8",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(tUe,{})},{title:"FaRegCommentDots",category:"message",tag:"message9",familyName:"Font Awesome 6",familyCode:"fas",component:h.jsx(yUe,{})},{title:"BsTrophy",category:"achievements",tag:"achievements1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(m9e,{})},{title:"GoTrophy",category:"achievements",tag:"achievements2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(N9e,{})},{title:"BsStarFill",category:"star",tag:"star1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(h9e,{})},{title:"BsFillStarFill",category:"star",tag:"star2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(v7e,{})},{title:"FaRegStar",category:"star",tag:"star3",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(dUe,{})},{title:"BsTrash3",category:"delete",tag:"delete1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(p9e,{})},{title:"BsXCircle",category:"delete",tag:"delete2",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(_9e,{})},{title:"AiOutlineDelete",category:"delete",tag:"delete3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(GMe,{})},{title:"GoTrash",category:"delete",tag:"delete4",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(I9e,{})},{title:"BsFillTrashFill",category:"delete",tag:"delete5",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(_7e,{})},{title:"FaTimes",category:"delete",tag:"delete6",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(lUe,{})},{title:"BsX",category:"delete",tag:"delete7",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(VE,{})},{title:"BsXCircleFill",category:"delete",tag:"delete8",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(y9e,{})},{title:"AiFillPieChart",category:"analyze",tag:"analyze1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(jMe,{})},{title:"AiOutlineAreaChart",category:"analyze",tag:"analyze2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(FMe,{})},{title:"AiOutlinePieChart",category:"analyze",tag:"analyze3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(QMe,{})},{title:"IoBarChartOutline",category:"analyze",tag:"analyze4",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Pje,{})},{title:"MdDonutSmall",category:"analyze",tag:"analyze5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(PUe,{})},{title:"MdPieChart",category:"analyze",tag:"analyze6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(ZUe,{})},{title:"TbChartHistogram",category:"analyze",tag:"analyze7",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(hje,{})},{title:"TbChartAreaLineFilled",category:"analyze",tag:"analyze8",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(uje,{})},{title:"FaChartPie",category:"analyze",tag:"analyze9",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Qje,{})},{title:"BsGeoAlt",category:"location",tag:"location1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(j7e,{})},{title:"BsPencil",category:"edit",tag:"edit1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(q7e,{})},{title:"FaRegPenToSquare",category:"edit",tag:"edit2",familyName:"Font Awesome 6",familyCode:"fa6",component:h.jsx(_Ue,{})},{title:"BsPencilFill",category:"edit",tag:"edit3",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx($7e,{})},{title:"BsPencilSquare",category:"edit",tag:"edit4",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(K7e,{})},{title:"AiOutlineRead",category:"dictionary",tag:"dictionary1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(e7e,{})},{title:"GoBook",category:"dictionary",tag:"dictionary2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(S9e,{})},{title:"AiOutlineReload",category:"reload",tag:"reload1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(t7e,{})},{title:"AiOutlineSync",category:"reload",tag:"reload2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(o7e,{})},{title:"GoSync",category:"reload",tag:"reload3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(A9e,{})},{title:"MdAutorenew",category:"reload",tag:"reload4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(OUe,{})},{title:"AiOutlineShoppingCart",category:"shop",tag:"shop1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(i7e,{})},{title:"AiOutlineShop",category:"shop",tag:"shop2",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(n7e,{})},{title:"AiOutlineShopping",category:"shop",tag:"shop3",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(r7e,{})},{title:"AiOutlineSwap",category:"connect",tag:"connect1",familyName:"Ant Design Icons",familyCode:"ai",component:h.jsx(a7e,{})},{title:"GoNote",category:"invitation",tag:"invitation1",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(R9e,{})},{title:"GoUnread",category:"invitation",tag:"invitation2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(O9e,{})},{title:"GoUnverified",category:"invitation",tag:"invitation3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(P9e,{})},{title:"IoIosFiling",category:"invitation",tag:"invitation4",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Ije,{})},{title:"IoFileTrayFull",category:"invitation",tag:"invitation5",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Dje,{})},{title:"MdHowToVote",category:"invitation",tag:"invitation6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(qUe,{})},{title:"MdOutlineMarkAsUnread",category:"invitation",tag:"invitation7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(yFe,{})},{title:"MdOutlineDrafts",category:"invitation",tag:"invitation8",familyName:"Material Design icons",familyCode:"md",component:h.jsx(TFe,{})},{title:"MdOutlineHowToVote",category:"invitation",tag:"invitation9",familyName:"Material Design icons",familyCode:"md",component:h.jsx(RFe,{})},{title:"SlEnvolopeLetter",category:"invitation",tag:"invitation10",familyName:"Simple Line Icons",familyCode:"sl",component:h.jsx(eBe,{})},{title:"GiBrain",category:"experience",tag:"experience1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(L9e,{})},{title:"MdSelfImprovement",category:"experience",tag:"experience2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(pFe,{})},{title:"MdArticle",category:"details",tag:"details1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(NUe,{})},{title:"LuLayoutList",category:"details",tag:"details2",familyName:"Lucide",familyCode:"lu",component:h.jsx(AUe,{})},{title:"LuNewspaper",category:"details",tag:"details3",familyName:"Lucide",familyCode:"lu",component:h.jsx(IUe,{})},{title:"MdOutlineArticle",category:"details",tag:"details4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(mFe,{})},{title:"RiArticleLine",category:"details",tag:"details5",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(HFe,{})},{title:"GiNightSleep",category:"dreams",tag:"dreams1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(K9e,{})},{title:"GiNightSky",category:"dreams",tag:"dreams2",familyName:"Game Icons",familyCode:"gi",component:h.jsx($9e,{})},{title:"MdOutlineEvent",category:"events",tag:"events1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(vFe,{})},{title:"RiCalendarTodoLine",category:"events",tag:"events2",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(UFe,{})},{title:"GiPartyPopper",category:"events",tag:"events3",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Y9e,{})},{title:"MdPsychologyAlt",category:"thoughts",tag:"thoughts1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(hFe,{})},{title:"MdPsychology",category:"thoughts",tag:"thoughts2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(fFe,{})},{title:"GiDeadlyStrike",category:"out of body",tag:"out-of-body1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(D9e,{})},{title:"GiExtraLucid",category:"out of body",tag:"out-of-body2",familyName:"Game Icons",familyCode:"gi",component:h.jsx(k9e,{})},{title:"GiFireSilhouette",category:"out of body",tag:"out-of-body3",familyName:"Game Icons",familyCode:"gi",component:h.jsx(M9e,{})},{title:"GiHealing",category:"out of body",tag:"out-of-body4",familyName:"Game Icons",familyCode:"gi",component:h.jsx(j9e,{})},{title:"GiIciclesAura",category:"out of body",tag:"out-of-body5",familyName:"Game Icons",familyCode:"gi",component:h.jsx(B9e,{})},{title:"GiInspiration",category:"out of body",tag:"out-of-body6",familyName:"Game Icons",familyCode:"gi",component:h.jsx(V9e,{})},{title:"GiJuggler",category:"out of body",tag:"out-of-body7",familyName:"Game Icons",familyCode:"gi",component:h.jsx(z9e,{})},{title:"GiMeditation",category:"out of body",tag:"out-of-body8",familyName:"Game Icons",familyCode:"gi",component:h.jsx(H9e,{})},{title:"GiMightyForce",category:"out of body",tag:"out-of-body9",familyName:"Game Icons",familyCode:"gi",component:h.jsx(G9e,{})},{title:"GiNailedHead",category:"out of body",tag:"out-of-body10",familyName:"Game Icons",familyCode:"gi",component:h.jsx(W9e,{})},{title:"GiOrbital",category:"out of body",tag:"out-of-body13",familyName:"Game Icons",familyCode:"gi",component:h.jsx(q9e,{})},{title:"GiPentacle",category:"out of body",tag:"out-of-body15",familyName:"Game Icons",familyCode:"gi",component:h.jsx(X9e,{})},{title:"GiPolarStar",category:"out of body",tag:"out-of-body16",familyName:"Game Icons",familyCode:"gi",component:h.jsx(J9e,{})},{title:"GiPsychicWaves",category:"out of body",tag:"out-of-body17",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Q9e,{})},{title:"GiRearAura",category:"out of body",tag:"out-of-body18",familyName:"Game Icons",familyCode:"gi",component:h.jsx(Z9e,{})},{title:"GiSpikedHalo",category:"out of body",tag:"out-of-body19",familyName:"Game Icons",familyCode:"gi",component:h.jsx(ije,{})},{title:"GiSuspicious",category:"out of body",tag:"out-of-body20",familyName:"Game Icons",familyCode:"gi",component:h.jsx(rje,{})},{title:"GiTeleport",category:"out of body",tag:"out-of-body21",familyName:"Game Icons",familyCode:"gi",component:h.jsx(aje,{})},{title:"GiThunderStruck",category:"out of body",tag:"out-of-body22",familyName:"Game Icons",familyCode:"gi",component:h.jsx(oje,{})},{title:"GiTwoShadows",category:"out of body",tag:"out-of-body23",familyName:"Game Icons",familyCode:"gi",component:h.jsx(lje,{})},{title:"GiHeartWings",category:"favorite",tag:"favorite1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(U9e,{})},{title:"GiHearts",category:"favorite",tag:"favorite2",familyName:"Game Icons",familyCode:"gi",component:h.jsx(F9e,{})},{title:"GoHeartFill",category:"favorite",tag:"favorite3",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(C9e,{})},{title:"GoStarFill",category:"favorite",tag:"favorite4",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(x9e,{})},{title:"MdFavorite",category:"favorite",tag:"favorite5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(kUe,{})},{title:"MdFavoriteBorder",category:"favorite",tag:"favorite6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(DUe,{})},{title:"GiRevolt",category:"resolution",tag:"resolution1",familyName:"Game Icons",familyCode:"gi",component:h.jsx(eje,{})},{title:"GoBellFill",category:"notifications",tag:"notifications1",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(w9e,{})},{title:"GoBell",category:"notifications",tag:"notifications2",familyName:"Github Octicons Icons",familyCode:"go",component:h.jsx(E9e,{})},{title:"MdNotificationsNone",category:"notifications",tag:"notifications3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(lFe,{})},{title:"MdNotifications",category:"notifications",tag:"notifications4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(cFe,{})},{title:"BsBellFill",category:"notifications",tag:"notifications5",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(b7e,{})},{title:"MdLeaderboard",category:"leaderboard",tag:"leaderboard",familyName:"Material Design icons",familyCode:"md",component:h.jsx(MUe,{})},{title:"MdInsights",category:"popular insights",tag:"insights1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(YUe,{})},{title:"MdReviews",category:"popular insights",tag:"insights2",familyName:"Material Design icons",familyCode:"md",component:h.jsx(XUe,{})},{title:"MdAutoGraph",category:"popular insights",tag:"insights3",familyName:"Material Design icons",familyCode:"md",component:h.jsx(JUe,{})},{title:"MdAutoAwesome",category:"popular insights",tag:"insights4",familyName:"Material Design icons",familyCode:"md",component:h.jsx(tFe,{})},{title:"MdAutoFixHigh",category:"popular insights",tag:"insights5",familyName:"Material Design icons",familyCode:"md",component:h.jsx(nFe,{})},{title:"MdOutlineInsights",category:"popular insights",tag:"insights6",familyName:"Material Design icons",familyCode:"md",component:h.jsx(xFe,{})},{title:"MdOutlineAutoAwesome",category:"popular insights",tag:"insights7",familyName:"Material Design icons",familyCode:"md",component:h.jsx(PFe,{})},{title:"RiUserStarLine",category:"popular insights",tag:"insights8",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(ZFe,{})},{title:"RiShieldUserFill",category:"popular insights",tag:"insights9",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(YFe,{})},{title:"RiShieldUserLine",category:"popular insights",tag:"insights10",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(XFe,{})},{title:"RiShieldStarFill",category:"popular insights",tag:"insights11",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(KFe,{})},{title:"RiShieldStarLine",category:"popular insights",tag:"insights12",familyName:"Remix Icon",familyCode:"ri",component:h.jsx(qFe,{})},{title:"TbShieldCheckeredFilled",category:"popular insights",tag:"insights13",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(mje,{})},{title:"TbShieldHalfFilled",category:"popular insights",tag:"insights14",familyName:"Tabler Icons",familyCode:"tb",component:h.jsx(gje,{})},{title:"FaUserShield",category:"popular insights",tag:"insights15",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(cUe,{})},{title:"IoShieldCheckmark",category:"popular insights",tag:"insights16",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Vje,{})},{title:"IoShieldHalf",category:"popular insights",tag:"insights17",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(zje,{})},{title:"IoShieldCheckmarkOutline",category:"popular insights",tag:"insights18",familyName:"Ionicons 5",familyCode:"io5",component:h.jsx(Bje,{})},{title:"MdPersonAddAlt1",category:"add user",tag:"add-user1",familyName:"Material Design icons",familyCode:"md",component:h.jsx(dFe,{})},{title:"TfiYoutube",category:"social",tag:"youtube1",familyName:"Themify Icons",familyCode:"tfi",component:h.jsx(Eje,{})},{title:"FaYoutube",category:"social",tag:"youtube2",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(qje,{})},{title:"BsApple",category:"social",tag:"apple1",familyName:"Bootstrap Icons",familyCode:"bs",component:h.jsx(E7e,{})},{title:"FaFacebookF",category:"social",tag:"facebook1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Gje,{})},{title:"FcGoogle",category:"social",tag:"google1",familyName:"Flat Color Icons",familyCode:"fc",component:h.jsx(rBe,{})},{title:"FaWhatsapp",category:"social",tag:"whatsapp1",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(Kje,{})},{title:"IoLogoWhatsapp",category:"social",tag:"whatsapp2",familyName:"Ionicons 4",familyCode:"io",component:h.jsx(Nje,{})},{title:"FaCircle",category:"default",tag:"default",familyName:"Font Awesome 5",familyCode:"fa",component:h.jsx(eUe,{})}];function Zt({className:n,tag:t,style:i}){var u,p;const s=t||"default",l=h.jsx(h.Fragment,{children:wn.filter(g=>(g==null?void 0:g.tag)===s).length>0?(u=wn.filter(g=>(g==null?void 0:g.tag)===s)[0])==null?void 0:u.component:(p=wn.filter(g=>(g==null?void 0:g.tag)==="default")[0])==null?void 0:p.component}),d=l&&k.cloneElement(l.props.children,{className:n,style:i});return h.jsx(h.Fragment,{children:d})}var wye={exports:{}};(()=>{var n={181:(l,d,u)=>{var p=/^\s+|\s+$/g,g=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,y=/^0o[0-7]+$/i,E=parseInt,b=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,A=typeof self=="object"&&self&&self.Object===Object&&self,N=b||A||Function("return this")(),O=Object.prototype.toString,D=Math.max,P=Math.min,j=function(){return N.Date.now()};function M(H){var $=typeof H;return!!H&&($=="object"||$=="function")}function V(H){if(typeof H=="number")return H;if(function(Y){return typeof Y=="symbol"||function(le){return!!le&&typeof le=="object"}(Y)&&O.call(Y)=="[object Symbol]"}(H))return NaN;if(M(H)){var $=typeof H.valueOf=="function"?H.valueOf():H;H=M($)?$+"":$}if(typeof H!="string")return H===0?H:+H;H=H.replace(p,"");var Q=_.test(H);return Q||y.test(H)?E(H.slice(2),Q?2:8):g.test(H)?NaN:+H}l.exports=function(H,$,Q){var Y,le,ae,te,de,G,ie=0,_e=!1,he=!1,Ce=!0;if(typeof H!="function")throw new TypeError("Expected a function");function fe(Ve){var Re=Y,Be=le;return Y=le=void 0,ie=Ve,te=H.apply(Be,Re)}function me(Ve){var Re=Ve-G;return G===void 0||Re>=$||Re<0||he&&Ve-ie>=ae}function Ne(){var Ve=j();if(me(Ve))return Fe(Ve);de=setTimeout(Ne,function(Re){var Be=$-(Re-G);return he?P(Be,ae-(Re-ie)):Be}(Ve))}function Fe(Ve){return de=void 0,Ce&&Y?fe(Ve):(Y=le=void 0,te)}function je(){var Ve=j(),Re=me(Ve);if(Y=arguments,le=this,G=Ve,Re){if(de===void 0)return function(Be){return ie=Be,de=setTimeout(Ne,$),_e?fe(Be):te}(G);if(he)return de=setTimeout(Ne,$),fe(G)}return de===void 0&&(de=setTimeout(Ne,$)),te}return $=V($)||0,M(Q)&&(_e=!!Q.leading,ae=(he="maxWait"in Q)?D(V(Q.maxWait)||0,$):ae,Ce="trailing"in Q?!!Q.trailing:Ce),je.cancel=function(){de!==void 0&&clearTimeout(de),ie=0,Y=G=le=de=void 0},je.flush=function(){return de===void 0?te:Fe(j())},je}},858:(l,d,u)=>{var p="Expected a function",g=NaN,_="[object Symbol]",y=/^\s+|\s+$/g,E=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,A=/^0o[0-7]+$/i,N=parseInt,O=typeof u.g=="object"&&u.g&&u.g.Object===Object&&u.g,D=typeof self=="object"&&self&&self.Object===Object&&self,P=O||D||Function("return this")(),j=Object.prototype.toString,M=Math.max,V=Math.min,H=function(){return P.Date.now()};function $(Y){var le=typeof Y;return!!Y&&(le=="object"||le=="function")}function Q(Y){if(typeof Y=="number")return Y;if(function(te){return typeof te=="symbol"||function(de){return!!de&&typeof de=="object"}(te)&&j.call(te)==_}(Y))return g;if($(Y)){var le=typeof Y.valueOf=="function"?Y.valueOf():Y;Y=$(le)?le+"":le}if(typeof Y!="string")return Y===0?Y:+Y;Y=Y.replace(y,"");var ae=b.test(Y);return ae||A.test(Y)?N(Y.slice(2),ae?2:8):E.test(Y)?g:+Y}l.exports=function(Y,le,ae){var te=!0,de=!0;if(typeof Y!="function")throw new TypeError(p);return $(ae)&&(te="leading"in ae?!!ae.leading:te,de="trailing"in ae?!!ae.trailing:de),function(G,ie,_e){var he,Ce,fe,me,Ne,Fe,je=0,Ve=!1,Re=!1,Be=!0;if(typeof G!="function")throw new TypeError(p);function Xe(Ze){var Je=he,_t=Ce;return he=Ce=void 0,je=Ze,me=G.apply(_t,Je)}function we(Ze){var Je=Ze-Fe;return Fe===void 0||Je>=ie||Je<0||Re&&Ze-je>=fe}function Ge(){var Ze=H();if(we(Ze))return rt(Ze);Ne=setTimeout(Ge,function(Je){var _t=ie-(Je-Fe);return Re?V(_t,fe-(Je-je)):_t}(Ze))}function rt(Ze){return Ne=void 0,Be&&he?Xe(Ze):(he=Ce=void 0,me)}function pt(){var Ze=H(),Je=we(Ze);if(he=arguments,Ce=this,Fe=Ze,Je){if(Ne===void 0)return function(_t){return je=_t,Ne=setTimeout(Ge,ie),Ve?Xe(_t):me}(Fe);if(Re)return Ne=setTimeout(Ge,ie),Xe(Fe)}return Ne===void 0&&(Ne=setTimeout(Ge,ie)),me}return ie=Q(ie)||0,$(_e)&&(Ve=!!_e.leading,fe=(Re="maxWait"in _e)?M(Q(_e.maxWait)||0,ie):fe,Be="trailing"in _e?!!_e.trailing:Be),pt.cancel=function(){Ne!==void 0&&clearTimeout(Ne),je=0,he=Fe=Ce=Ne=void 0},pt.flush=function(){return Ne===void 0?me:rt(H())},pt}(Y,le,{leading:te,maxWait:le,trailing:de})}},694:(l,d,u)=>{var p=u(925);function g(){}function _(){}_.resetWarningCache=g,l.exports=function(){function y(A,N,O,D,P,j){if(j!==p){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}function E(){return y}y.isRequired=y;var b={array:y,bigint:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:E,element:y,elementType:y,instanceOf:E,node:y,objectOf:E,oneOf:E,oneOfType:E,shape:E,exact:E,checkPropTypes:_,resetWarningCache:g};return b.PropTypes=b,b}},556:(l,d,u)=>{l.exports=u(694)()},925:l=>{l.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(l){var d=t[l];if(d!==void 0)return d.exports;var u=t[l]={exports:{}};return n[l](u,u.exports,i),u.exports}i.n=l=>{var d=l&&l.__esModule?()=>l.default:()=>l;return i.d(d,{a:d}),d},i.d=(l,d)=>{for(var u in d)i.o(d,u)&&!i.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:d[u]})},i.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),i.o=(l,d)=>Object.prototype.hasOwnProperty.call(l,d),i.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var s={};(()=>{i.r(s),i.d(s,{LazyLoadComponent:()=>it,LazyLoadImage:()=>tt,trackWindowScroll:()=>Ve});const l=k;var d=i.n(l),u=i(556);function p(){return typeof window<"u"&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function g(Te){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},g(Te)}function _(Te,Pe){var Qe=Object.keys(Te);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(Te);Pe&&(nt=nt.filter(function($e){return Object.getOwnPropertyDescriptor(Te,$e).enumerable})),Qe.push.apply(Qe,nt)}return Qe}function y(Te,Pe,Qe){return(Pe=b(Pe))in Te?Object.defineProperty(Te,Pe,{value:Qe,enumerable:!0,configurable:!0,writable:!0}):Te[Pe]=Qe,Te}function E(Te,Pe){for(var Qe=0;Qe<Pe.length;Qe++){var nt=Pe[Qe];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,b(nt.key),nt)}}function b(Te){var Pe=function(Qe,nt){if(g(Qe)!="object"||!Qe)return Qe;var $e=Qe[Symbol.toPrimitive];if($e!==void 0){var st=$e.call(Qe,"string");if(g(st)!="object")return st;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Qe)}(Te);return g(Pe)=="symbol"?Pe:Pe+""}function A(Te,Pe,Qe){return Pe=O(Pe),function(nt,$e){if($e&&(g($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(st){if(st===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return st}(nt)}(Te,N()?Reflect.construct(Pe,Qe||[],O(Te).constructor):Pe.apply(Te,Qe))}function N(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N=function(){return!!Te})()}function O(Te){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},O(Te)}function D(Te,Pe){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Qe,nt){return Qe.__proto__=nt,Qe},D(Te,Pe)}var P=function(Te){Te.forEach(function(Pe){Pe.isIntersecting&&Pe.target.onVisible()})},j={},M=function(Te){function Pe($e){var st;if(function(Dt,nn){if(!(Dt instanceof nn))throw new TypeError("Cannot call a class as a function")}(this,Pe),(st=A(this,Pe,[$e])).supportsObserver=!$e.scrollPosition&&$e.useIntersectionObserver&&p(),st.supportsObserver){var _n=$e.threshold;st.observer=function(Dt){return j[Dt]=j[Dt]||new IntersectionObserver(P,{rootMargin:Dt+"px"}),j[Dt]}(_n)}return st}return function($e,st){if(typeof st!="function"&&st!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(st&&st.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),st&&D($e,st)}(Pe,Te),Qe=Pe,nt=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollPosition,st=this.placeholder.getBoundingClientRect(),_n=this.placeholder.style,Dt=parseInt(_n.getPropertyValue("margin-left"),10)||0,nn=parseInt(_n.getPropertyValue("margin-top"),10)||0;return{bottom:$e.y+st.bottom+nn,left:$e.x+st.left+Dt,right:$e.x+st.right+Dt,top:$e.y+st.top+nn}}},{key:"isPlaceholderInViewport",value:function(){if(typeof window>"u"||!this.placeholder)return!1;var $e=this.props,st=$e.scrollPosition,_n=$e.threshold,Dt=this.getPlaceholderBoundingBox(st),nn=st.y+window.innerHeight,en=st.x,qt=st.x+window.innerWidth,Jt=st.y;return Jt-_n<=Dt.bottom&&nn+_n>=Dt.top&&en-_n<=Dt.right&&qt+_n>=Dt.left}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var $e=this,st=this.props,_n=st.className,Dt=st.height,nn=st.placeholder,en=st.style,qt=st.width;if(nn&&typeof nn.type!="function")return d().cloneElement(nn,{ref:function(mn){return $e.placeholder=mn}});var Jt=function(mn){for(var Kn=1;Kn<arguments.length;Kn++){var Nn=arguments[Kn]!=null?arguments[Kn]:{};Kn%2?_(Object(Nn),!0).forEach(function(Tn){y(mn,Tn,Nn[Tn])}):Object.getOwnPropertyDescriptors?Object.defineProperties(mn,Object.getOwnPropertyDescriptors(Nn)):_(Object(Nn)).forEach(function(Tn){Object.defineProperty(mn,Tn,Object.getOwnPropertyDescriptor(Nn,Tn))})}return mn}({display:"inline-block"},en);return qt!==void 0&&(Jt.width=qt),Dt!==void 0&&(Jt.height=Dt),d().createElement("span",{className:_n,ref:function(mn){return $e.placeholder=mn},style:Jt},nn)}}],nt&&E(Qe.prototype,nt),Object.defineProperty(Qe,"prototype",{writable:!1}),Qe;var Qe,nt}(d().Component);M.propTypes={onVisible:u.PropTypes.func.isRequired,className:u.PropTypes.string,height:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string]),placeholder:u.PropTypes.element,threshold:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool,scrollPosition:u.PropTypes.shape({x:u.PropTypes.number.isRequired,y:u.PropTypes.number.isRequired}),width:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string])},M.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const V=M;var H=i(181),$=i.n(H),Q=i(858),Y=i.n(Q),le=function(Te){var Pe=getComputedStyle(Te,null);return Pe.getPropertyValue("overflow")+Pe.getPropertyValue("overflow-y")+Pe.getPropertyValue("overflow-x")};const ae=function(Te){if(!(Te instanceof HTMLElement))return window;for(var Pe=Te;Pe&&Pe instanceof HTMLElement;){if(/(scroll|auto)/.test(le(Pe)))return Pe;Pe=Pe.parentNode}return window};function te(Te){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},te(Te)}var de=["delayMethod","delayTime"];function G(){return G=Object.assign?Object.assign.bind():function(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Qe=arguments[Pe];for(var nt in Qe)({}).hasOwnProperty.call(Qe,nt)&&(Te[nt]=Qe[nt])}return Te},G.apply(null,arguments)}function ie(Te,Pe){for(var Qe=0;Qe<Pe.length;Qe++){var nt=Pe[Qe];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,_e(nt.key),nt)}}function _e(Te){var Pe=function(Qe,nt){if(te(Qe)!="object"||!Qe)return Qe;var $e=Qe[Symbol.toPrimitive];if($e!==void 0){var st=$e.call(Qe,"string");if(te(st)!="object")return st;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Qe)}(Te);return te(Pe)=="symbol"?Pe:Pe+""}function he(Te,Pe,Qe){return Pe=me(Pe),Ce(Te,fe()?Reflect.construct(Pe,Qe||[],me(Te).constructor):Pe.apply(Te,Qe))}function Ce(Te,Pe){if(Pe&&(te(Pe)=="object"||typeof Pe=="function"))return Pe;if(Pe!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Qe){if(Qe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Qe}(Te)}function fe(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fe=function(){return!!Te})()}function me(Te){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},me(Te)}function Ne(Te,Pe){return Ne=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Qe,nt){return Qe.__proto__=nt,Qe},Ne(Te,Pe)}var Fe=function(){return typeof window>"u"?0:window.scrollX||window.pageXOffset},je=function(){return typeof window>"u"?0:window.scrollY||window.pageYOffset};const Ve=function(Te){var Pe=function(Qe){function nt(_n){var Dt;if(function(en,qt){if(!(en instanceof qt))throw new TypeError("Cannot call a class as a function")}(this,nt),(Dt=he(this,nt,[_n])).useIntersectionObserver=_n.useIntersectionObserver&&p(),Dt.useIntersectionObserver)return Ce(Dt);var nn=Dt.onChangeScroll.bind(Dt);return _n.delayMethod==="debounce"?Dt.delayedScroll=$()(nn,_n.delayTime):_n.delayMethod==="throttle"&&(Dt.delayedScroll=Y()(nn,_n.delayTime)),Dt.state={scrollPosition:{x:Fe(),y:je()}},Dt.baseComponentRef=d().createRef(),Dt}return function(_n,Dt){if(typeof Dt!="function"&&Dt!==null)throw new TypeError("Super expression must either be null or a function");_n.prototype=Object.create(Dt&&Dt.prototype,{constructor:{value:_n,writable:!0,configurable:!0}}),Object.defineProperty(_n,"prototype",{writable:!1}),Dt&&Ne(_n,Dt)}(nt,Qe),$e=nt,st=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){typeof window>"u"||this.useIntersectionObserver||ae(this.baseComponentRef.current)!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement=ae(this.baseComponentRef.current),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){typeof window>"u"||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:Fe(),y:je()}})}},{key:"render",value:function(){var _n=this.props,Dt=(_n.delayMethod,_n.delayTime,function(en,qt){if(en==null)return{};var Jt,mn,Kn=function(Tn,Ui){if(Tn==null)return{};var xr={};for(var bi in Tn)if({}.hasOwnProperty.call(Tn,bi)){if(Ui.indexOf(bi)>=0)continue;xr[bi]=Tn[bi]}return xr}(en,qt);if(Object.getOwnPropertySymbols){var Nn=Object.getOwnPropertySymbols(en);for(mn=0;mn<Nn.length;mn++)Jt=Nn[mn],qt.indexOf(Jt)>=0||{}.propertyIsEnumerable.call(en,Jt)&&(Kn[Jt]=en[Jt])}return Kn}(_n,de)),nn=this.useIntersectionObserver?null:this.state.scrollPosition;return d().createElement(Te,G({forwardRef:this.baseComponentRef,scrollPosition:nn},Dt))}}],st&&ie($e.prototype,st),Object.defineProperty($e,"prototype",{writable:!1}),$e;var $e,st}(d().Component);return Pe.propTypes={delayMethod:u.PropTypes.oneOf(["debounce","throttle"]),delayTime:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool},Pe.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},Pe};function Re(Te){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},Re(Te)}function Be(Te,Pe){for(var Qe=0;Qe<Pe.length;Qe++){var nt=Pe[Qe];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,Xe(nt.key),nt)}}function Xe(Te){var Pe=function(Qe,nt){if(Re(Qe)!="object"||!Qe)return Qe;var $e=Qe[Symbol.toPrimitive];if($e!==void 0){var st=$e.call(Qe,"string");if(Re(st)!="object")return st;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Qe)}(Te);return Re(Pe)=="symbol"?Pe:Pe+""}function we(Te,Pe,Qe){return Pe=rt(Pe),function(nt,$e){if($e&&(Re($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(st){if(st===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return st}(nt)}(Te,Ge()?Reflect.construct(Pe,Qe||[],rt(Te).constructor):Pe.apply(Te,Qe))}function Ge(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ge=function(){return!!Te})()}function rt(Te){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},rt(Te)}function pt(Te,Pe){return pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Qe,nt){return Qe.__proto__=nt,Qe},pt(Te,Pe)}var Ze=function(Te){function Pe($e){return function(st,_n){if(!(st instanceof _n))throw new TypeError("Cannot call a class as a function")}(this,Pe),we(this,Pe,[$e])}return function($e,st){if(typeof st!="function"&&st!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(st&&st.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),st&&pt($e,st)}(Pe,Te),Qe=Pe,(nt=[{key:"render",value:function(){return d().createElement(V,this.props)}}])&&Be(Qe.prototype,nt),Object.defineProperty(Qe,"prototype",{writable:!1}),Qe;var Qe,nt}(d().Component);const Je=Ve(Ze);function _t(Te){return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},_t(Te)}function Xt(Te,Pe){for(var Qe=0;Qe<Pe.length;Qe++){var nt=Pe[Qe];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,Ht(nt.key),nt)}}function Ht(Te){var Pe=function(Qe,nt){if(_t(Qe)!="object"||!Qe)return Qe;var $e=Qe[Symbol.toPrimitive];if($e!==void 0){var st=$e.call(Qe,"string");if(_t(st)!="object")return st;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Qe)}(Te);return _t(Pe)=="symbol"?Pe:Pe+""}function gn(Te,Pe,Qe){return Pe=xt(Pe),function(nt,$e){if($e&&(_t($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(st){if(st===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return st}(nt)}(Te,It()?Reflect.construct(Pe,Qe||[],xt(Te).constructor):Pe.apply(Te,Qe))}function It(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(It=function(){return!!Te})()}function xt(Te){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},xt(Te)}function mt(Te,Pe){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Qe,nt){return Qe.__proto__=nt,Qe},mt(Te,Pe)}var dt=function(Te){function Pe($e){var st;(function(qt,Jt){if(!(qt instanceof Jt))throw new TypeError("Cannot call a class as a function")})(this,Pe),st=gn(this,Pe,[$e]);var _n=$e.afterLoad,Dt=$e.beforeLoad,nn=$e.scrollPosition,en=$e.visibleByDefault;return st.state={visible:en},en&&(Dt(),_n()),st.onVisible=st.onVisible.bind(st),st.isScrollTracked=!!(nn&&Number.isFinite(nn.x)&&nn.x>=0&&Number.isFinite(nn.y)&&nn.y>=0),st}return function($e,st){if(typeof st!="function"&&st!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(st&&st.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),st&&mt($e,st)}(Pe,Te),Qe=Pe,(nt=[{key:"componentDidUpdate",value:function($e,st){st.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var $e=this.props,st=$e.className,_n=$e.delayMethod,Dt=$e.delayTime,nn=$e.height,en=$e.placeholder,qt=$e.scrollPosition,Jt=$e.style,mn=$e.threshold,Kn=$e.useIntersectionObserver,Nn=$e.width;return this.isScrollTracked||Kn&&p()?d().createElement(V,{className:st,height:nn,onVisible:this.onVisible,placeholder:en,scrollPosition:qt,style:Jt,threshold:mn,useIntersectionObserver:Kn,width:Nn}):d().createElement(Je,{className:st,delayMethod:_n,delayTime:Dt,height:nn,onVisible:this.onVisible,placeholder:en,style:Jt,threshold:mn,width:Nn})}}])&&Xt(Qe.prototype,nt),Object.defineProperty(Qe,"prototype",{writable:!1}),Qe;var Qe,nt}(d().Component);dt.propTypes={afterLoad:u.PropTypes.func,beforeLoad:u.PropTypes.func,useIntersectionObserver:u.PropTypes.bool,visibleByDefault:u.PropTypes.bool},dt.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const it=dt;function Me(Te){return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Pe){return typeof Pe}:function(Pe){return Pe&&typeof Symbol=="function"&&Pe.constructor===Symbol&&Pe!==Symbol.prototype?"symbol":typeof Pe},Me(Te)}var We=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function bt(Te,Pe){var Qe=Object.keys(Te);if(Object.getOwnPropertySymbols){var nt=Object.getOwnPropertySymbols(Te);Pe&&(nt=nt.filter(function($e){return Object.getOwnPropertyDescriptor(Te,$e).enumerable})),Qe.push.apply(Qe,nt)}return Qe}function St(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Qe=arguments[Pe]!=null?arguments[Pe]:{};Pe%2?bt(Object(Qe),!0).forEach(function(nt){Lt(Te,nt,Qe[nt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Te,Object.getOwnPropertyDescriptors(Qe)):bt(Object(Qe)).forEach(function(nt){Object.defineProperty(Te,nt,Object.getOwnPropertyDescriptor(Qe,nt))})}return Te}function Lt(Te,Pe,Qe){return(Pe=an(Pe))in Te?Object.defineProperty(Te,Pe,{value:Qe,enumerable:!0,configurable:!0,writable:!0}):Te[Pe]=Qe,Te}function tn(){return tn=Object.assign?Object.assign.bind():function(Te){for(var Pe=1;Pe<arguments.length;Pe++){var Qe=arguments[Pe];for(var nt in Qe)({}).hasOwnProperty.call(Qe,nt)&&(Te[nt]=Qe[nt])}return Te},tn.apply(null,arguments)}function un(Te,Pe){for(var Qe=0;Qe<Pe.length;Qe++){var nt=Pe[Qe];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(Te,an(nt.key),nt)}}function an(Te){var Pe=function(Qe,nt){if(Me(Qe)!="object"||!Qe)return Qe;var $e=Qe[Symbol.toPrimitive];if($e!==void 0){var st=$e.call(Qe,"string");if(Me(st)!="object")return st;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(Qe)}(Te);return Me(Pe)=="symbol"?Pe:Pe+""}function ye(Te,Pe,Qe){return Pe=ne(Pe),function(nt,$e){if($e&&(Me($e)=="object"||typeof $e=="function"))return $e;if($e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(st){if(st===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return st}(nt)}(Te,J()?Reflect.construct(Pe,Qe||[],ne(Te).constructor):Pe.apply(Te,Qe))}function J(){try{var Te=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(J=function(){return!!Te})()}function ne(Te){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Pe){return Pe.__proto__||Object.getPrototypeOf(Pe)},ne(Te)}function Se(Te,Pe){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Qe,nt){return Qe.__proto__=nt,Qe},Se(Te,Pe)}var Ue=function(Te){function Pe($e){var st;return function(_n,Dt){if(!(_n instanceof Dt))throw new TypeError("Cannot call a class as a function")}(this,Pe),(st=ye(this,Pe,[$e])).state={loaded:!1},st}return function($e,st){if(typeof st!="function"&&st!==null)throw new TypeError("Super expression must either be null or a function");$e.prototype=Object.create(st&&st.prototype,{constructor:{value:$e,writable:!0,configurable:!0}}),Object.defineProperty($e,"prototype",{writable:!1}),st&&Se($e,st)}(Pe,Te),Qe=Pe,nt=[{key:"onImageLoad",value:function(){var $e=this;return this.state.loaded?null:function(st){$e.props.onLoad(st),$e.props.afterLoad(),$e.setState({loaded:!0})}}},{key:"getImg",value:function(){var $e=this.props,st=($e.afterLoad,$e.beforeLoad,$e.delayMethod,$e.delayTime,$e.effect,$e.placeholder,$e.placeholderSrc,$e.scrollPosition,$e.threshold,$e.useIntersectionObserver,$e.visibleByDefault,$e.wrapperClassName,$e.wrapperProps,function(_n,Dt){if(_n==null)return{};var nn,en,qt=function(mn,Kn){if(mn==null)return{};var Nn={};for(var Tn in mn)if({}.hasOwnProperty.call(mn,Tn)){if(Kn.indexOf(Tn)>=0)continue;Nn[Tn]=mn[Tn]}return Nn}(_n,Dt);if(Object.getOwnPropertySymbols){var Jt=Object.getOwnPropertySymbols(_n);for(en=0;en<Jt.length;en++)nn=Jt[en],Dt.indexOf(nn)>=0||{}.propertyIsEnumerable.call(_n,nn)&&(qt[nn]=_n[nn])}return qt}($e,We));return d().createElement("img",tn({},st,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var $e=this.props,st=$e.beforeLoad,_n=$e.className,Dt=$e.delayMethod,nn=$e.delayTime,en=$e.height,qt=$e.placeholder,Jt=$e.scrollPosition,mn=$e.style,Kn=$e.threshold,Nn=$e.useIntersectionObserver,Tn=$e.visibleByDefault,Ui=$e.width;return d().createElement(it,{beforeLoad:st,className:_n,delayMethod:Dt,delayTime:nn,height:en,placeholder:qt,scrollPosition:Jt,style:mn,threshold:Kn,useIntersectionObserver:Nn,visibleByDefault:Tn,width:Ui},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function($e){var st=this.props,_n=st.effect,Dt=st.height,nn=st.placeholderSrc,en=st.width,qt=st.wrapperClassName,Jt=st.wrapperProps,mn=this.state.loaded,Kn=mn?" lazy-load-image-loaded":"",Nn=mn||!nn?{}:{backgroundImage:"url(".concat(nn,")"),backgroundSize:"100% 100%"};return d().createElement("span",tn({className:qt+" lazy-load-image-background "+_n+Kn,style:St(St({},Nn),{},{color:"transparent",display:"inline-block",height:Dt,width:en})},Jt),$e)}},{key:"render",value:function(){var $e=this.props,st=$e.effect,_n=$e.placeholderSrc,Dt=$e.visibleByDefault,nn=$e.wrapperClassName,en=$e.wrapperProps,qt=this.getLazyLoadImage();return(st||_n)&&!Dt||nn||en?this.getWrappedLazyLoadImage(qt):qt}}],nt&&un(Qe.prototype,nt),Object.defineProperty(Qe,"prototype",{writable:!1}),Qe;var Qe,nt}(d().Component);Ue.propTypes={onLoad:u.PropTypes.func,afterLoad:u.PropTypes.func,beforeLoad:u.PropTypes.func,delayMethod:u.PropTypes.string,delayTime:u.PropTypes.number,effect:u.PropTypes.string,placeholderSrc:u.PropTypes.string,threshold:u.PropTypes.number,useIntersectionObserver:u.PropTypes.bool,visibleByDefault:u.PropTypes.bool,wrapperClassName:u.PropTypes.string,wrapperProps:u.PropTypes.object},Ue.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const tt=Ue})(),wye.exports=s})();var gBe=wye.exports;function us({src:n,alt:t,loadedimageprops:i,wrapperClassName:s}){const l=h.jsx("div",{className:"p-3 rounded-4 bg-gray-lighter1 w-100",style:{height:200},children:h.jsx("h1",{children:"Placeholder DIV"})});return h.jsx(gBe.LazyLoadImage,{alt:t,title:t,src:n,placeholder:l,visibleByDefault:!0,loadedimageprops:i,effect:"blur",width:"100%",wrapperClassName:`custom-image-container ${s}`})}function TQ(n){const t=Ii(),i=n!=null&&n.className?n==null?void 0:n.className:"",s=n!=null&&n.profileImg?n==null?void 0:n.profileImg:"/img/profile-pic.png",l=n!=null&&n.profileName?n==null?void 0:n.profileName:"Guest User",d=n!=null&&n.profileDesig?n==null?void 0:n.profileDesig:"NA",u=n!=null&&n.isEdit?n==null?void 0:n.isEdit:!1,p=Ai.getLoginSchemeFromLocal();return h.jsxs(et,{className:`card-theme border-0 profile-card ${i}`,children:[h.jsx(et.Body,{className:"text-center",children:h.jsxs("div",{className:"d-flex profile-info-container align-items-center",children:[h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[u&&h.jsx(Pt,{type:"button",className:"btn-theme btn-icon btn-white position-absolute rounded-circle align-self-start",style:{right:"-0.5rem",top:"-0.5rem",zIndex:1},onClick:()=>n.handleShowUpdateProfilePhotoModal(),children:h.jsx(Zt,{tag:"camera1",className:"text-purple font-20"})}),h.jsx("div",{className:"media-icon-wrapper rounded-circle overflow-hidden",children:h.jsx(us,{src:s,alt:`${l} image`,className:"img-fluid"})})]}),h.jsxs("div",{className:"text-start flex-grow-1 ms-3 media-info-container",children:[h.jsx("span",{className:"welcome-user text-truncate d-block",children:`${l} `}),h.jsx("span",{className:"d-block font-13",children:$R(d)}),u&&p!=="password"&&h.jsxs(Pt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-2 px-2 py-1",onClick:n.handleEditProfile,children:[h.jsx(Zt,{tag:"edit1",className:"text-purple font-14 me-1"}),"Edit Profile"]})]})]})}),u&&p==="password"&&h.jsx(h.Fragment,{children:h.jsxs(et.Footer,{className:"bg-transparent pt-0 pb-3 border-0 d-flex",children:[u&&h.jsxs(Pt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-0 px-2 py-1 flex-grow-1 me-1",onClick:n.handleEditProfile,children:[h.jsx(Zt,{tag:"edit3",className:"text-purple font-14 me-1"}),"Edit Profile"]}),u&&p==="password"&&h.jsxs(Pt,{type:"button",className:"btn-theme btn-sm btn-white position-relative rounded-1 mt-0 px-2 py-1 flex-grow-1 ms-1",onClick:()=>t("/profile/change-password",{state:{pageTitle:"Change Password"}}),children:[h.jsx(Zt,{tag:"key4",className:"text-purple font-14 me-1"}),"Change Password"]})]})})]})}function vBe(n){var i,s,l;const t=Ai.getAppCurrentVersion();return h.jsxs(OI,{show:n.showNavigation,onHide:n.handleCloseNavigation,className:"app-sidenav",children:[h.jsx(OI.Header,{closeButton:!0,children:h.jsx(OI.Title,{})}),h.jsxs(OI.Body,{children:[h.jsx("div",{className:"text-center pb-3 pb-sm-5 pt-sm-5",children:h.jsx("img",{src:"/img/logo-small.png",alt:"rapport logo small",className:"img-fluid"})}),h.jsx("div",{className:"border-top border-bottom py-4 navigation-profile-wrapper",children:h.jsx(Yu,{to:"/profile",className:"d-flex align-items-center",onClick:n.handleCloseNavigation,children:h.jsx(TQ,{userProfile:n.userProfile,profileImg:(i=n.userProfile)==null?void 0:i.avatar,profileName:(s=n.userProfile)==null?void 0:s.name,profileDesig:(l=n.userProfile)==null?void 0:l.designation,isEdit:!1,className:"profile-card-navigation bg-transparent"})})}),h.jsxs("div",{className:"list-group py-3",children:[h.jsxs(Yu,{to:"/dashboard",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(Zt,{tag:"dashboard1",className:""})}),"Dashboard"]}),h.jsxs(Yu,{to:"/profile",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(Zt,{tag:"consult8",className:""})}),"Profile"]}),h.jsxs(Yu,{to:"/quick-actions",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(Zt,{tag:"add1",className:""})}),"Quick Actions"]}),h.jsxs(Yu,{to:"/appreciations",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx("img",{src:"/img/appreciations-icon.png",alt:"Appreciations Icon"})}),"Appreciations"]}),h.jsxs(Yu,{to:"/badges",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx("img",{src:"/img/badges-icon.png",alt:"Badges Icon"})}),"Badges"]}),h.jsxs(Yu,{to:"/notifications",className:"list-group-item",onClick:n.handleCloseNavigation,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(Zt,{tag:"notifications2",className:""})}),"Notifications"]}),h.jsxs(Pt,{type:"button",className:"list-group-item text-start",onClick:n.handleLogout,children:[h.jsx("span",{className:"icon-wrapper",children:h.jsx(Zt,{tag:"logout4",className:""})}),"Logout"]})]})]}),h.jsxs("div",{className:"app-sidenav-footer fw-sb",children:["Version ",t||null]})]})}const QR=k.createContext();function NR(n){var g,_,y,E,b,A,N,O;let t="",i="",s="",l="Cancel",d={backdrop:"static",keyboard:!1},u={closeButton:!1};const p=()=>{switch(n.content_type){case"logout-modal":n.handlePrimaryAction();break;case"submission-delete-modal":n.handlePrimaryAction(n.primaryActionData);break;case"reattempt-submission-delete-modal":console.log("Started deleting response for re-attempt."),n.handlePrimaryAction(n.primaryActionData);break;case"force-evaluation-submission-modal":const D={...n.primaryActionData,force:!0};n.handlePrimaryAction(D),console.log("Started force submission of response evaluation.");break;case"force-upload-submission-cancel-modal":n.handlePrimaryAction();break}};switch(n.content_type){case"logout-modal":t="Are you sure you want to logout from app? This action cannot be undone.",s="Logout";break;case"submission-delete-modal":t="Are you sure you want to delete a contest response? This action cannot be undone.",s="Delete";break;case"reattempt-submission-delete-modal":t="Are you sure you want to delete a contest response for a re-attempt? This action cannot be undone.",s="Delete";break;case"force-evaluation-submission-modal":i="Score matched!",t=(g=n==null?void 0:n.data)!=null&&g.message?(_=n==null?void 0:n.data)==null?void 0:_.message:"Are you sure you want to submit a same contest response evaluation? This action cannot be undone.",d={backdrop:"static",keyboard:!1},u={closeButton:!1},s=((y=n==null?void 0:n.data)==null?void 0:y.btnOptions.length)>0&&((E=n==null?void 0:n.data)!=null&&E.btnOptions.includes("continue"))?"Continue":"",l=((b=n==null?void 0:n.data)==null?void 0:b.btnOptions.length)>0?(A=n==null?void 0:n.data)==null?void 0:A.btnOptions.filter(D=>D.toLowerCase()==="edit"):"Cancel";break;case"force-upload-submission-cancel-modal":i="About to Cancel Uploading!",t=(N=n==null?void 0:n.data)!=null&&N.message?(O=n==null?void 0:n.data)==null?void 0:O.message:"Your uploading will be cancelled and you need to reupload a response again. Do you still want to go back?",d={backdrop:"static",keyboard:!1},u={closeButton:!1},s="Cancel Upload",l="Continue Upload";break}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",...d,show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-2",...u,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(GO,{})})}),h.jsx("div",{className:"heading flex-grow-1 ms-3",children:"Confirmation"})]})}),h.jsxs(vn.Body,{children:[i!==""&&h.jsx("div",{className:"font-16 fw-sb mb-2",style:{color:"#684609"},children:i}),h.jsx("div",{className:"modal-helper-text",children:t}),h.jsxs("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:[h.jsx(Pt,{type:"submit",className:`btn-theme\r
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:l}),s!==""&&h.jsx(Pt,{type:"submit",className:`btn-theme\r
btn-yellow btn-md flex-grow-1`,onClick:p,style:{paddingLeft:6,paddingRight:6},children:n.loading?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):h.jsx(h.Fragment,{children:s})})]})]})]})})}function Sye(n){let t={backdrop:"static",keyboard:!1},i={closeButton:!1};return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",...t,show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-1",...i,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:h.jsx("div",{className:"heading flex-grow-1 ms-0",children:"Terms & Conditions"})})}),h.jsxs(vn.Body,{children:[h.jsx("div",{className:"modal-helper-text",children:n.terms}),h.jsx("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:h.jsx(Pt,{type:"submit",className:`btn-theme
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:"Ok"})})]})]})})}function yBe(n){const t=n.page,i=Ii(),s=Xo(),[l,d]=k.useState(""),{userProfile:u,notificationStats:p,backLink:g,setBackLink:_}=k.useContext(QR),y=JSON.parse(Ai.getAuthUser());k.useEffect(()=>{var Q,Y;let M=X6e(t);(Q=s.state)!=null&&Q.pageTitle&&(M=(Y=s.state)==null?void 0:Y.pageTitle),d(M);const H=s.pathname.split("/").filter((le,ae)=>le!=="");let $="";H.length>2?$=`/${H[0]}/${H[1]}`:H.length>1?($=`/${H[0]}`,t==="approve-reject-form-submission"&&($="/notifications")):$="/dashboard",$!==""&&_($)},[s.pathname]);const[E,b]=k.useState(!1),[A,N]=k.useState(!1);function O(){s.pathname&&s.pathname.split("/").length>2,i(g)}const D=()=>{b(!1)},P=()=>{b(!0)};function j(M){localStorage.clear(),n.handleCloseNavigation(),Qt("Logout successfully!","success"),i("/")}return h.jsxs("div",{children:[h.jsxs(Qve,{expand:"lg",fixed:"top",className:"navbar-header",children:[h.jsxs(Yn,{className:"justify-content-start",children:[t!=="dashboard"&&h.jsx(Pt,{type:"button",className:"btn-theme btn-transparent btn-icon btn-menu px-1 text-white ps-0 pe-2",style:{width:25,minWidth:0},onClick:O,children:h.jsx(Zt,{tag:"arrow-left1",className:""})}),h.jsx("div",{className:`${t!=="dashboard"&&"ms-1"} d-flex flex-row align-items-center flex-fill`,style:{width:"calc(100% - 10vw)"},children:t==="dashboard"?h.jsx(h.Fragment,{children:h.jsx(Yu,{to:"/profile",className:"text-decoration-none overflow-hidden",children:h.jsx(TQ,{userProfile:y,profileImg:y==null?void 0:y.avatar,profileName:y==null?void 0:y.name,profileDesig:y==null?void 0:y.designation,isEdit:!1,className:"profile-card-sm profile-card-navigation bg-transparent"})})}):h.jsx("h5",{className:"page-title mb-0 font-16 text-white",children:l})}),t==="dashboard"&&h.jsx(h.Fragment,{children:h.jsxs(Yu,{to:"/notifications",className:"btn btn-theme btn-icon btn-white btn-notification position-relative",children:[(p==null?void 0:p.not_read)>0&&h.jsx("span",{className:`position-absolute top-0 start-100 translate-middle p-1 bg-danger border border-light rounded-circle -${p==null?void 0:p.not_read}-`,children:h.jsx("span",{className:"visually-hidden",children:"New alerts"})}),h.jsx(Zt,{tag:"notifications2",className:"font-22"})]})})]}),h.jsx(vBe,{showNavigation:n.showNavigation,handleCloseNavigation:n.handleCloseNavigation,handleShowNavigation:n.handleShowNavigation,handleLogout:P,userProfile:y})]}),h.jsx(NR,{show:E,loading:A,handleClose:D,primaryActionData:null,content_type:"logout-modal",handlePrimaryAction:j})]})}const _Be="up",EBe="down";function wBe(){const[n,t]=k.useState();return k.useEffect(()=>{let i=window.scrollY;const s=()=>{let l=i<window.scrollY?EBe:_Be;i=window.scrollY,t(l)};return window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}},[]),{direction:n}}function SBe(n){const t=Ii(),i=n.page,{state:s,pathname:l}=Xo(),{direction:d}=wBe();return h.jsx(h.Fragment,{children:h.jsx(Qve,{expand:"lg",fixed:"bottom",className:`navbar-footer ${s!=null&&s.hideFooterNav?"navbar-hidden":""} ${d!=="down"?"":"navbar-hidden"}
${i==="messages"&&l.split("/").length>2?"navbar-hidden":""}
`,children:h.jsxs(Yn,{className:"justify-content-between px-0 flex-nowrap",children:[h.jsxs(Pt,{type:"button",className:"btn-theme btn-white btn-menu p-1",onClick:()=>{l==="/dashboard"&&Qt("Already on Dashboard!"),t("/dashboard")},children:[h.jsx(Zt,{tag:"home1",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Home"})]}),h.jsxs(Pt,{type:"button",className:"btn-theme btn-white btn-menu p-1",onClick:()=>{l==="/magazines"&&Qt("Already on Magazines!"),t("/magazines")},children:[h.jsx(Zt,{tag:"dictionary2",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Magazine"})]}),h.jsx(Pt,{type:"button",variant:"primary",className:"btn-theme btn-icon btn-action position-relative border-0 rounded-circle",onClick:()=>{l==="/quick-actions"&&Qt("Already on Quick actions!"),t("/quick-actions")},children:h.jsx(Zt,{tag:"add3",className:"font-32"})}),h.jsxs(Pt,{type:"button",className:"btn-theme btn-white btn-message p-1",onClick:()=>{l==="/messages"&&Qt("Already on Messages!"),t("/messages")},children:[h.jsx(Zt,{tag:"message5",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Message"})]}),h.jsxs(Pt,{type:"button",className:"btn-theme btn-white btn-message p-1",onClick:n.handleShowNavigation,children:[h.jsx(Zt,{tag:"menubar1",className:"font-22"})," ",h.jsx("span",{className:"d-block font-12",children:"Menu"})]})]})})})}function Mc(n){const[t,i]=k.useState(!1),s=()=>i(!1),l=()=>i(!0);return h.jsxs(h.Fragment,{children:[h.jsx(yBe,{page:n.page,showNavigation:t,handleCloseNavigation:s,handleShowNavigation:l}),h.jsx(b6e,{}),h.jsx(SBe,{page:n.page,showNavigation:t,handleCloseNavigation:s,handleShowNavigation:l})]})}function ar({item:n}){const t=async()=>{if(navigator.clipboard)try{await navigator.clipboard.writeText(`${n.tag}`),console.log("Successfully copied - ",n.tag),Qt(`Copied to clipboard - '${n.tag}'`,"success")}catch(i){console.log("Failed to copy to clipboard...",i),Qt("Failed to copy","error")}};return h.jsxs(et,{children:[h.jsxs(et.Body,{className:"text-center position-relative p-2",children:[h.jsxs("div",{className:"d-flex justify-content-between",children:[h.jsx("div",{className:"me-0 font-15 fw_sb custom_tag tag_secondary_light",children:n.category}),h.jsx(Pt,{type:"button",className:"btn btn-theme btn-yellow btn-icon pe-none",children:n.familyCode})]}),h.jsx("div",{className:"lh-1",style:{fontSize:"40px"},children:h.jsx(Zt,{title:n.title,tag:n.tag,className:`custom-icon icon-${n.category}`})}),h.jsx("div",{className:"mt-2 me-0 font-15 fw_sb",children:n.title}),h.jsx("div",{className:"mt-2 mb-2",children:`( ${n.familyName} )`})]}),h.jsx(et.Footer,{className:"p-0 border-top-0",children:h.jsxs(Pt,{type:"button",className:"btn btn-theme btn-primary w-100 border-0 position-relative",title:"Click to copy",onClick:t,children:["Tag: ",h.jsx("span",{className:"fw_sb",children:n.tag}),h.jsx(GFe,{className:"position-absolute font-20",style:{right:"12px"}})]})})]})}function bBe(){return h.jsxs(Yn,{fluid:!0,className:"py-5",children:[h.jsx("h4",{children:"All React Icons used in App:"}),h.jsx("hr",{}),wn.filter(n=>n.category==="general").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"General:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="general").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="file").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Files:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="file").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="arrows").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Arrows:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="arrows").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="sort").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Sorting / Filter:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="sort").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="exp-bank").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Experience Bank:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="exp-bank").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="dashboard").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dashboard:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="dashboard").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="associate").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Associate:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="associate").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="share").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Share:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="share").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="network").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Network:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="network").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="discover").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Discover:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="discover").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="consult").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Consult / Consulting session:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="consult").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="message").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Message:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="message").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="achievements").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Achievements:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="achievements").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="star").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Star:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="star").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="delete").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Delete / Trash:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="delete").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="analyze").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Analyze:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="analyze").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="edit").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Edit:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="edit").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="dictionary").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dictionary:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="dictionary").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="reload").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Reload:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="reload").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="shop").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Shop:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="shop").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="connect").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Connect:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="connect").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="invitation").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Invitation:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="invitation").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="details").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Details:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="details").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="experience").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Experience:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="experience").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="dreams").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Dreams:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="dreams").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="events").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Events:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="events").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="thoughts").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Thoughts:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="thoughts").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="out of body").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Out of body:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="out of body").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="favorite").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Favorite:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="favorite").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="resolution").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Resolution:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="resolution").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="notifications").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Notifications:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="notifications").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="leaderboard").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Leaderboard:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="leaderboard").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="popular insights").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Popular insights:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="popular insights").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="add user").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Add user / friend:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="add user").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]}),wn.filter(n=>n.category==="social").length>0&&h.jsxs(h.Fragment,{children:[h.jsx("h6",{children:"Social:"}),h.jsx(fn,{className:"row-cols-2 row-cols-md-3 row-cols-lg-4 row-cols-xl-6 g-3 mb-4",children:wn.filter(n=>n.category==="social").map(n=>h.jsx(Gt,{children:h.jsx(ar,{item:n})},n.title))})]})]})}var CBe=function(t){return TBe(t)&&!RBe(t)};function TBe(n){return!!n&&typeof n=="object"}function RBe(n){var t=Object.prototype.toString.call(n);return t==="[object RegExp]"||t==="[object Date]"||IBe(n)}var xBe=typeof Symbol=="function"&&Symbol.for,ABe=xBe?Symbol.for("react.element"):60103;function IBe(n){return n.$$typeof===ABe}function NBe(n){return Array.isArray(n)?[]:{}}function E7(n,t){return t.clone!==!1&&t.isMergeableObject(n)?W4(NBe(n),n,t):n}function OBe(n,t,i){return n.concat(t).map(function(s){return E7(s,i)})}function PBe(n,t,i){var s={};return i.isMergeableObject(n)&&Object.keys(n).forEach(function(l){s[l]=E7(n[l],i)}),Object.keys(t).forEach(function(l){!i.isMergeableObject(t[l])||!n[l]?s[l]=E7(t[l],i):s[l]=W4(n[l],t[l],i)}),s}function W4(n,t,i){i=i||{},i.arrayMerge=i.arrayMerge||OBe,i.isMergeableObject=i.isMergeableObject||CBe;var s=Array.isArray(t),l=Array.isArray(n),d=s===l;return d?s?i.arrayMerge(n,t,i):PBe(n,t,i):E7(t,i)}W4.all=function(t,i){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,l){return W4(s,l,i)},{})};var Uq=W4,bye=typeof Wo=="object"&&Wo&&Wo.Object===Object&&Wo,LBe=typeof self=="object"&&self&&self.Object===Object&&self,zp=bye||LBe||Function("return this")(),Lv=zp.Symbol,Cye=Object.prototype,DBe=Cye.hasOwnProperty,kBe=Cye.toString,mI=Lv?Lv.toStringTag:void 0;function MBe(n){var t=DBe.call(n,mI),i=n[mI];try{n[mI]=void 0;var s=!0}catch{}var l=kBe.call(n);return s&&(t?n[mI]=i:delete n[mI]),l}var jBe=Object.prototype,UBe=jBe.toString;function FBe(n){return UBe.call(n)}var BBe="[object Null]",VBe="[object Undefined]",Que=Lv?Lv.toStringTag:void 0;function zE(n){return n==null?n===void 0?VBe:BBe:Que&&Que in Object(n)?MBe(n):FBe(n)}function Tye(n,t){return function(i){return n(t(i))}}var RQ=Tye(Object.getPrototypeOf,Object);function HE(n){return n!=null&&typeof n=="object"}var zBe="[object Object]",HBe=Function.prototype,GBe=Object.prototype,Rye=HBe.toString,WBe=GBe.hasOwnProperty,$Be=Rye.call(Object);function Zue(n){if(!HE(n)||zE(n)!=zBe)return!1;var t=RQ(n);if(t===null)return!0;var i=WBe.call(t,"constructor")&&t.constructor;return typeof i=="function"&&i instanceof i&&Rye.call(i)==$Be}var ehe=Array.isArray,the=Object.keys,KBe=Object.prototype.hasOwnProperty,qBe=typeof Element<"u";function Fq(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){var i=ehe(n),s=ehe(t),l,d,u;if(i&&s){if(d=n.length,d!=t.length)return!1;for(l=d;l--!==0;)if(!Fq(n[l],t[l]))return!1;return!0}if(i!=s)return!1;var p=n instanceof Date,g=t instanceof Date;if(p!=g)return!1;if(p&&g)return n.getTime()==t.getTime();var _=n instanceof RegExp,y=t instanceof RegExp;if(_!=y)return!1;if(_&&y)return n.toString()==t.toString();var E=the(n);if(d=E.length,d!==the(t).length)return!1;for(l=d;l--!==0;)if(!KBe.call(t,E[l]))return!1;if(qBe&&n instanceof Element&&t instanceof Element)return n===t;for(l=d;l--!==0;)if(u=E[l],!(u==="_owner"&&n.$$typeof)&&!Fq(n[u],t[u]))return!1;return!0}return n!==n&&t!==t}var YBe=function(t,i){try{return Fq(t,i)}catch(s){if(s.message&&s.message.match(/stack|recursion/i)||s.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",s.name,s.message),!1;throw s}};const __=Mv(YBe);function XBe(){this.__data__=[],this.size=0}function xye(n,t){return n===t||n!==n&&t!==t}function yU(n,t){for(var i=n.length;i--;)if(xye(n[i][0],t))return i;return-1}var JBe=Array.prototype,QBe=JBe.splice;function ZBe(n){var t=this.__data__,i=yU(t,n);if(i<0)return!1;var s=t.length-1;return i==s?t.pop():QBe.call(t,i,1),--this.size,!0}function eVe(n){var t=this.__data__,i=yU(t,n);return i<0?void 0:t[i][1]}function tVe(n){return yU(this.__data__,n)>-1}function nVe(n,t){var i=this.__data__,s=yU(i,n);return s<0?(++this.size,i.push([n,t])):i[s][1]=t,this}function jg(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}jg.prototype.clear=XBe;jg.prototype.delete=ZBe;jg.prototype.get=eVe;jg.prototype.has=tVe;jg.prototype.set=nVe;function iVe(){this.__data__=new jg,this.size=0}function rVe(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}function sVe(n){return this.__data__.get(n)}function aVe(n){return this.__data__.has(n)}function WO(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}var oVe="[object AsyncFunction]",lVe="[object Function]",cVe="[object GeneratorFunction]",dVe="[object Proxy]";function Aye(n){if(!WO(n))return!1;var t=zE(n);return t==lVe||t==cVe||t==oVe||t==dVe}var j$=zp["__core-js_shared__"],nhe=function(){var n=/[^.]+$/.exec(j$&&j$.keys&&j$.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function uVe(n){return!!nhe&&nhe in n}var hVe=Function.prototype,fVe=hVe.toString;function GE(n){if(n!=null){try{return fVe.call(n)}catch{}try{return n+""}catch{}}return""}var pVe=/[\\^$.*+?()[\]{}|]/g,mVe=/^\[object .+?Constructor\]$/,gVe=Function.prototype,vVe=Object.prototype,yVe=gVe.toString,_Ve=vVe.hasOwnProperty,EVe=RegExp("^"+yVe.call(_Ve).replace(pVe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wVe(n){if(!WO(n)||uVe(n))return!1;var t=Aye(n)?EVe:mVe;return t.test(GE(n))}function SVe(n,t){return n==null?void 0:n[t]}function WE(n,t){var i=SVe(n,t);return wVe(i)?i:void 0}var $4=WE(zp,"Map"),K4=WE(Object,"create");function bVe(){this.__data__=K4?K4(null):{},this.size=0}function CVe(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}var TVe="__lodash_hash_undefined__",RVe=Object.prototype,xVe=RVe.hasOwnProperty;function AVe(n){var t=this.__data__;if(K4){var i=t[n];return i===TVe?void 0:i}return xVe.call(t,n)?t[n]:void 0}var IVe=Object.prototype,NVe=IVe.hasOwnProperty;function OVe(n){var t=this.__data__;return K4?t[n]!==void 0:NVe.call(t,n)}var PVe="__lodash_hash_undefined__";function LVe(n,t){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=K4&&t===void 0?PVe:t,this}function RE(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}RE.prototype.clear=bVe;RE.prototype.delete=CVe;RE.prototype.get=AVe;RE.prototype.has=OVe;RE.prototype.set=LVe;function DVe(){this.size=0,this.__data__={hash:new RE,map:new($4||jg),string:new RE}}function kVe(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function _U(n,t){var i=n.__data__;return kVe(t)?i[typeof t=="string"?"string":"hash"]:i.map}function MVe(n){var t=_U(this,n).delete(n);return this.size-=t?1:0,t}function jVe(n){return _U(this,n).get(n)}function UVe(n){return _U(this,n).has(n)}function FVe(n,t){var i=_U(this,n),s=i.size;return i.set(n,t),this.size+=i.size==s?0:1,this}function zv(n){var t=-1,i=n==null?0:n.length;for(this.clear();++t<i;){var s=n[t];this.set(s[0],s[1])}}zv.prototype.clear=DVe;zv.prototype.delete=MVe;zv.prototype.get=jVe;zv.prototype.has=UVe;zv.prototype.set=FVe;var BVe=200;function VVe(n,t){var i=this.__data__;if(i instanceof jg){var s=i.__data__;if(!$4||s.length<BVe-1)return s.push([n,t]),this.size=++i.size,this;i=this.__data__=new zv(s)}return i.set(n,t),this.size=i.size,this}function ZR(n){var t=this.__data__=new jg(n);this.size=t.size}ZR.prototype.clear=iVe;ZR.prototype.delete=rVe;ZR.prototype.get=sVe;ZR.prototype.has=aVe;ZR.prototype.set=VVe;function zVe(n,t){for(var i=-1,s=n==null?0:n.length;++i<s&&t(n[i],i,n)!==!1;);return n}var ihe=function(){try{var n=WE(Object,"defineProperty");return n({},"",{}),n}catch{}}();function Iye(n,t,i){t=="__proto__"&&ihe?ihe(n,t,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[t]=i}var HVe=Object.prototype,GVe=HVe.hasOwnProperty;function Nye(n,t,i){var s=n[t];(!(GVe.call(n,t)&&xye(s,i))||i===void 0&&!(t in n))&&Iye(n,t,i)}function EU(n,t,i,s){var l=!i;i||(i={});for(var d=-1,u=t.length;++d<u;){var p=t[d],g=s?s(i[p],n[p],p,i,n):void 0;g===void 0&&(g=n[p]),l?Iye(i,p,g):Nye(i,p,g)}return i}function WVe(n,t){for(var i=-1,s=Array(n);++i<n;)s[i]=t(i);return s}var $Ve="[object Arguments]";function rhe(n){return HE(n)&&zE(n)==$Ve}var Oye=Object.prototype,KVe=Oye.hasOwnProperty,qVe=Oye.propertyIsEnumerable,YVe=rhe(function(){return arguments}())?rhe:function(n){return HE(n)&&KVe.call(n,"callee")&&!qVe.call(n,"callee")},$O=Array.isArray;function XVe(){return!1}var Pye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,she=Pye&&typeof module=="object"&&module&&!module.nodeType&&module,JVe=she&&she.exports===Pye,ahe=JVe?zp.Buffer:void 0,QVe=ahe?ahe.isBuffer:void 0,Lye=QVe||XVe,ZVe=9007199254740991,eze=/^(?:0|[1-9]\d*)$/;function tze(n,t){var i=typeof n;return t=t??ZVe,!!t&&(i=="number"||i!="symbol"&&eze.test(n))&&n>-1&&n%1==0&&n<t}var nze=9007199254740991;function Dye(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=nze}var ize="[object Arguments]",rze="[object Array]",sze="[object Boolean]",aze="[object Date]",oze="[object Error]",lze="[object Function]",cze="[object Map]",dze="[object Number]",uze="[object Object]",hze="[object RegExp]",fze="[object Set]",pze="[object String]",mze="[object WeakMap]",gze="[object ArrayBuffer]",vze="[object DataView]",yze="[object Float32Array]",_ze="[object Float64Array]",Eze="[object Int8Array]",wze="[object Int16Array]",Sze="[object Int32Array]",bze="[object Uint8Array]",Cze="[object Uint8ClampedArray]",Tze="[object Uint16Array]",Rze="[object Uint32Array]",ws={};ws[yze]=ws[_ze]=ws[Eze]=ws[wze]=ws[Sze]=ws[bze]=ws[Cze]=ws[Tze]=ws[Rze]=!0;ws[ize]=ws[rze]=ws[gze]=ws[sze]=ws[vze]=ws[aze]=ws[oze]=ws[lze]=ws[cze]=ws[dze]=ws[uze]=ws[hze]=ws[fze]=ws[pze]=ws[mze]=!1;function xze(n){return HE(n)&&Dye(n.length)&&!!ws[zE(n)]}function xQ(n){return function(t){return n(t)}}var kye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,p4=kye&&typeof module=="object"&&module&&!module.nodeType&&module,Aze=p4&&p4.exports===kye,U$=Aze&&bye.process,OR=function(){try{var n=p4&&p4.require&&p4.require("util").types;return n||U$&&U$.binding&&U$.binding("util")}catch{}}(),ohe=OR&&OR.isTypedArray,Ize=ohe?xQ(ohe):xze,Nze=Object.prototype,Oze=Nze.hasOwnProperty;function Mye(n,t){var i=$O(n),s=!i&&YVe(n),l=!i&&!s&&Lye(n),d=!i&&!s&&!l&&Ize(n),u=i||s||l||d,p=u?WVe(n.length,String):[],g=p.length;for(var _ in n)(t||Oze.call(n,_))&&!(u&&(_=="length"||l&&(_=="offset"||_=="parent")||d&&(_=="buffer"||_=="byteLength"||_=="byteOffset")||tze(_,g)))&&p.push(_);return p}var Pze=Object.prototype;function AQ(n){var t=n&&n.constructor,i=typeof t=="function"&&t.prototype||Pze;return n===i}var Lze=Tye(Object.keys,Object),Dze=Object.prototype,kze=Dze.hasOwnProperty;function Mze(n){if(!AQ(n))return Lze(n);var t=[];for(var i in Object(n))kze.call(n,i)&&i!="constructor"&&t.push(i);return t}function jye(n){return n!=null&&Dye(n.length)&&!Aye(n)}function IQ(n){return jye(n)?Mye(n):Mze(n)}function jze(n,t){return n&&EU(t,IQ(t),n)}function Uze(n){var t=[];if(n!=null)for(var i in Object(n))t.push(i);return t}var Fze=Object.prototype,Bze=Fze.hasOwnProperty;function Vze(n){if(!WO(n))return Uze(n);var t=AQ(n),i=[];for(var s in n)s=="constructor"&&(t||!Bze.call(n,s))||i.push(s);return i}function NQ(n){return jye(n)?Mye(n,!0):Vze(n)}function zze(n,t){return n&&EU(t,NQ(t),n)}var Uye=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lhe=Uye&&typeof module=="object"&&module&&!module.nodeType&&module,Hze=lhe&&lhe.exports===Uye,che=Hze?zp.Buffer:void 0,dhe=che?che.allocUnsafe:void 0;function Gze(n,t){if(t)return n.slice();var i=n.length,s=dhe?dhe(i):new n.constructor(i);return n.copy(s),s}function Fye(n,t){var i=-1,s=n.length;for(t||(t=Array(s));++i<s;)t[i]=n[i];return t}function Wze(n,t){for(var i=-1,s=n==null?0:n.length,l=0,d=[];++i<s;){var u=n[i];t(u,i,n)&&(d[l++]=u)}return d}function Bye(){return[]}var $ze=Object.prototype,Kze=$ze.propertyIsEnumerable,uhe=Object.getOwnPropertySymbols,OQ=uhe?function(n){return n==null?[]:(n=Object(n),Wze(uhe(n),function(t){return Kze.call(n,t)}))}:Bye;function qze(n,t){return EU(n,OQ(n),t)}function Vye(n,t){for(var i=-1,s=t.length,l=n.length;++i<s;)n[l+i]=t[i];return n}var Yze=Object.getOwnPropertySymbols,zye=Yze?function(n){for(var t=[];n;)Vye(t,OQ(n)),n=RQ(n);return t}:Bye;function Xze(n,t){return EU(n,zye(n),t)}function Hye(n,t,i){var s=t(n);return $O(n)?s:Vye(s,i(n))}function Jze(n){return Hye(n,IQ,OQ)}function Qze(n){return Hye(n,NQ,zye)}var Bq=WE(zp,"DataView"),Vq=WE(zp,"Promise"),zq=WE(zp,"Set"),Hq=WE(zp,"WeakMap"),hhe="[object Map]",Zze="[object Object]",fhe="[object Promise]",phe="[object Set]",mhe="[object WeakMap]",ghe="[object DataView]",eHe=GE(Bq),tHe=GE($4),nHe=GE(Vq),iHe=GE(zq),rHe=GE(Hq),E_=zE;(Bq&&E_(new Bq(new ArrayBuffer(1)))!=ghe||$4&&E_(new $4)!=hhe||Vq&&E_(Vq.resolve())!=fhe||zq&&E_(new zq)!=phe||Hq&&E_(new Hq)!=mhe)&&(E_=function(n){var t=zE(n),i=t==Zze?n.constructor:void 0,s=i?GE(i):"";if(s)switch(s){case eHe:return ghe;case tHe:return hhe;case nHe:return fhe;case iHe:return phe;case rHe:return mhe}return t});const PQ=E_;var sHe=Object.prototype,aHe=sHe.hasOwnProperty;function oHe(n){var t=n.length,i=new n.constructor(t);return t&&typeof n[0]=="string"&&aHe.call(n,"index")&&(i.index=n.index,i.input=n.input),i}var vhe=zp.Uint8Array;function LQ(n){var t=new n.constructor(n.byteLength);return new vhe(t).set(new vhe(n)),t}function lHe(n,t){var i=t?LQ(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}var cHe=/\w*$/;function dHe(n){var t=new n.constructor(n.source,cHe.exec(n));return t.lastIndex=n.lastIndex,t}var yhe=Lv?Lv.prototype:void 0,_he=yhe?yhe.valueOf:void 0;function uHe(n){return _he?Object(_he.call(n)):{}}function hHe(n,t){var i=t?LQ(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}var fHe="[object Boolean]",pHe="[object Date]",mHe="[object Map]",gHe="[object Number]",vHe="[object RegExp]",yHe="[object Set]",_He="[object String]",EHe="[object Symbol]",wHe="[object ArrayBuffer]",SHe="[object DataView]",bHe="[object Float32Array]",CHe="[object Float64Array]",THe="[object Int8Array]",RHe="[object Int16Array]",xHe="[object Int32Array]",AHe="[object Uint8Array]",IHe="[object Uint8ClampedArray]",NHe="[object Uint16Array]",OHe="[object Uint32Array]";function PHe(n,t,i){var s=n.constructor;switch(t){case wHe:return LQ(n);case fHe:case pHe:return new s(+n);case SHe:return lHe(n,i);case bHe:case CHe:case THe:case RHe:case xHe:case AHe:case IHe:case NHe:case OHe:return hHe(n,i);case mHe:return new s;case gHe:case _He:return new s(n);case vHe:return dHe(n);case yHe:return new s;case EHe:return uHe(n)}}var Ehe=Object.create,LHe=function(){function n(){}return function(t){if(!WO(t))return{};if(Ehe)return Ehe(t);n.prototype=t;var i=new n;return n.prototype=void 0,i}}();function DHe(n){return typeof n.constructor=="function"&&!AQ(n)?LHe(RQ(n)):{}}var kHe="[object Map]";function MHe(n){return HE(n)&&PQ(n)==kHe}var whe=OR&&OR.isMap,jHe=whe?xQ(whe):MHe,UHe="[object Set]";function FHe(n){return HE(n)&&PQ(n)==UHe}var She=OR&&OR.isSet,BHe=She?xQ(She):FHe,VHe=1,zHe=2,HHe=4,Gye="[object Arguments]",GHe="[object Array]",WHe="[object Boolean]",$He="[object Date]",KHe="[object Error]",Wye="[object Function]",qHe="[object GeneratorFunction]",YHe="[object Map]",XHe="[object Number]",$ye="[object Object]",JHe="[object RegExp]",QHe="[object Set]",ZHe="[object String]",eGe="[object Symbol]",tGe="[object WeakMap]",nGe="[object ArrayBuffer]",iGe="[object DataView]",rGe="[object Float32Array]",sGe="[object Float64Array]",aGe="[object Int8Array]",oGe="[object Int16Array]",lGe="[object Int32Array]",cGe="[object Uint8Array]",dGe="[object Uint8ClampedArray]",uGe="[object Uint16Array]",hGe="[object Uint32Array]",ls={};ls[Gye]=ls[GHe]=ls[nGe]=ls[iGe]=ls[WHe]=ls[$He]=ls[rGe]=ls[sGe]=ls[aGe]=ls[oGe]=ls[lGe]=ls[YHe]=ls[XHe]=ls[$ye]=ls[JHe]=ls[QHe]=ls[ZHe]=ls[eGe]=ls[cGe]=ls[dGe]=ls[uGe]=ls[hGe]=!0;ls[KHe]=ls[Wye]=ls[tGe]=!1;function Zk(n,t,i,s,l,d){var u,p=t&VHe,g=t&zHe,_=t&HHe;if(i&&(u=l?i(n,s,l,d):i(n)),u!==void 0)return u;if(!WO(n))return n;var y=$O(n);if(y){if(u=oHe(n),!p)return Fye(n,u)}else{var E=PQ(n),b=E==Wye||E==qHe;if(Lye(n))return Gze(n,p);if(E==$ye||E==Gye||b&&!l){if(u=g||b?{}:DHe(n),!p)return g?Xze(n,zze(u,n)):qze(n,jze(u,n))}else{if(!ls[E])return l?n:{};u=PHe(n,E,p)}}d||(d=new ZR);var A=d.get(n);if(A)return A;d.set(n,u),BHe(n)?n.forEach(function(D){u.add(Zk(D,t,i,D,n,d))}):jHe(n)&&n.forEach(function(D,P){u.set(P,Zk(D,t,i,P,n,d))});var N=_?g?Qze:Jze:g?NQ:IQ,O=y?void 0:N(n);return zVe(O||n,function(D,P){O&&(P=D,D=n[P]),Nye(u,P,Zk(D,t,i,P,n,d))}),u}var fGe=4;function bhe(n){return Zk(n,fGe)}function Kye(n,t){for(var i=-1,s=n==null?0:n.length,l=Array(s);++i<s;)l[i]=t(n[i],i,n);return l}var pGe="[object Symbol]";function DQ(n){return typeof n=="symbol"||HE(n)&&zE(n)==pGe}var mGe="Expected a function";function kQ(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError(mGe);var i=function(){var s=arguments,l=t?t.apply(this,s):s[0],d=i.cache;if(d.has(l))return d.get(l);var u=n.apply(this,s);return i.cache=d.set(l,u)||d,u};return i.cache=new(kQ.Cache||zv),i}kQ.Cache=zv;var gGe=500;function vGe(n){var t=kQ(n,function(s){return i.size===gGe&&i.clear(),s}),i=t.cache;return t}var yGe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_Ge=/\\(\\)?/g,EGe=vGe(function(n){var t=[];return n.charCodeAt(0)===46&&t.push(""),n.replace(yGe,function(i,s,l,d){t.push(l?d.replace(_Ge,"$1"):s||i)}),t});const wGe=EGe;var SGe=1/0;function bGe(n){if(typeof n=="string"||DQ(n))return n;var t=n+"";return t=="0"&&1/n==-SGe?"-0":t}var CGe=1/0,Che=Lv?Lv.prototype:void 0,The=Che?Che.toString:void 0;function qye(n){if(typeof n=="string")return n;if($O(n))return Kye(n,qye)+"";if(DQ(n))return The?The.call(n):"";var t=n+"";return t=="0"&&1/n==-CGe?"-0":t}function TGe(n){return n==null?"":qye(n)}function Yye(n){return $O(n)?Kye(n,bGe):DQ(n)?[n]:Fye(wGe(TGe(n)))}var Xye={exports:{}},Hr={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Co=typeof Symbol=="function"&&Symbol.for,MQ=Co?Symbol.for("react.element"):60103,jQ=Co?Symbol.for("react.portal"):60106,wU=Co?Symbol.for("react.fragment"):60107,SU=Co?Symbol.for("react.strict_mode"):60108,bU=Co?Symbol.for("react.profiler"):60114,CU=Co?Symbol.for("react.provider"):60109,TU=Co?Symbol.for("react.context"):60110,UQ=Co?Symbol.for("react.async_mode"):60111,RU=Co?Symbol.for("react.concurrent_mode"):60111,xU=Co?Symbol.for("react.forward_ref"):60112,AU=Co?Symbol.for("react.suspense"):60113,RGe=Co?Symbol.for("react.suspense_list"):60120,IU=Co?Symbol.for("react.memo"):60115,NU=Co?Symbol.for("react.lazy"):60116,xGe=Co?Symbol.for("react.block"):60121,AGe=Co?Symbol.for("react.fundamental"):60117,IGe=Co?Symbol.for("react.responder"):60118,NGe=Co?Symbol.for("react.scope"):60119;function tu(n){if(typeof n=="object"&&n!==null){var t=n.$$typeof;switch(t){case MQ:switch(n=n.type,n){case UQ:case RU:case wU:case bU:case SU:case AU:return n;default:switch(n=n&&n.$$typeof,n){case TU:case xU:case NU:case IU:case CU:return n;default:return t}}case jQ:return t}}}function Jye(n){return tu(n)===RU}Hr.AsyncMode=UQ;Hr.ConcurrentMode=RU;Hr.ContextConsumer=TU;Hr.ContextProvider=CU;Hr.Element=MQ;Hr.ForwardRef=xU;Hr.Fragment=wU;Hr.Lazy=NU;Hr.Memo=IU;Hr.Portal=jQ;Hr.Profiler=bU;Hr.StrictMode=SU;Hr.Suspense=AU;Hr.isAsyncMode=function(n){return Jye(n)||tu(n)===UQ};Hr.isConcurrentMode=Jye;Hr.isContextConsumer=function(n){return tu(n)===TU};Hr.isContextProvider=function(n){return tu(n)===CU};Hr.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===MQ};Hr.isForwardRef=function(n){return tu(n)===xU};Hr.isFragment=function(n){return tu(n)===wU};Hr.isLazy=function(n){return tu(n)===NU};Hr.isMemo=function(n){return tu(n)===IU};Hr.isPortal=function(n){return tu(n)===jQ};Hr.isProfiler=function(n){return tu(n)===bU};Hr.isStrictMode=function(n){return tu(n)===SU};Hr.isSuspense=function(n){return tu(n)===AU};Hr.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===wU||n===RU||n===bU||n===SU||n===AU||n===RGe||typeof n=="object"&&n!==null&&(n.$$typeof===NU||n.$$typeof===IU||n.$$typeof===CU||n.$$typeof===TU||n.$$typeof===xU||n.$$typeof===AGe||n.$$typeof===IGe||n.$$typeof===NGe||n.$$typeof===xGe)};Hr.typeOf=tu;Xye.exports=Hr;var OGe=Xye.exports,Qye=OGe,PGe={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},LGe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Zye={};Zye[Qye.ForwardRef]=PGe;Zye[Qye.Memo]=LGe;function yo(){return yo=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])}return n},yo.apply(this,arguments)}function e_e(n,t){if(n==null)return{};var i={},s=Object.keys(n),l,d;for(d=0;d<s.length;d++)l=s[d],!(t.indexOf(l)>=0)&&(i[l]=n[l]);return i}var OU=k.createContext(void 0);OU.displayName="FormikContext";var DGe=OU.Provider;OU.Consumer;function kGe(){var n=k.useContext(OU);return n}var ju=function(t){return typeof t=="function"},PU=function(t){return t!==null&&typeof t=="object"},MGe=function(t){return String(Math.floor(Number(t)))===t},F$=function(t){return Object.prototype.toString.call(t)==="[object String]"},jGe=function(t){return k.Children.count(t)===0},B$=function(t){return PU(t)&&ju(t.then)};function Sd(n,t,i,s){s===void 0&&(s=0);for(var l=Yye(t);n&&s<l.length;)n=n[l[s++]];return s!==l.length&&!n||n===void 0?i:n}function mE(n,t,i){for(var s=bhe(n),l=s,d=0,u=Yye(t);d<u.length-1;d++){var p=u[d],g=Sd(n,u.slice(0,d+1));if(g&&(PU(g)||Array.isArray(g)))l=l[p]=bhe(g);else{var _=u[d+1];l=l[p]=MGe(_)&&Number(_)>=0?[]:{}}}return(d===0?n:l)[u[d]]===i?n:(i===void 0?delete l[u[d]]:l[u[d]]=i,d===0&&i===void 0&&delete s[u[d]],s)}function t_e(n,t,i,s){i===void 0&&(i=new WeakMap),s===void 0&&(s={});for(var l=0,d=Object.keys(n);l<d.length;l++){var u=d[l],p=n[u];PU(p)?i.get(p)||(i.set(p,!0),s[u]=Array.isArray(p)?[]:{},t_e(p,t,i,s[u])):s[u]=t}return s}function UGe(n,t){switch(t.type){case"SET_VALUES":return yo({},n,{values:t.payload});case"SET_TOUCHED":return yo({},n,{touched:t.payload});case"SET_ERRORS":return __(n.errors,t.payload)?n:yo({},n,{errors:t.payload});case"SET_STATUS":return yo({},n,{status:t.payload});case"SET_ISSUBMITTING":return yo({},n,{isSubmitting:t.payload});case"SET_ISVALIDATING":return yo({},n,{isValidating:t.payload});case"SET_FIELD_VALUE":return yo({},n,{values:mE(n.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return yo({},n,{touched:mE(n.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return yo({},n,{errors:mE(n.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return yo({},n,t.payload);case"SET_FORMIK_STATE":return t.payload(n);case"SUBMIT_ATTEMPT":return yo({},n,{touched:t_e(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return yo({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return yo({},n,{isSubmitting:!1});default:return n}}var p_={},wk={};function FGe(n){var t=n.validateOnChange,i=t===void 0?!0:t,s=n.validateOnBlur,l=s===void 0?!0:s,d=n.validateOnMount,u=d===void 0?!1:d,p=n.isInitialValid,g=n.enableReinitialize,_=g===void 0?!1:g,y=n.onSubmit,E=e_e(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),b=yo({validateOnChange:i,validateOnBlur:l,validateOnMount:u,onSubmit:y},E),A=k.useRef(b.initialValues),N=k.useRef(b.initialErrors||p_),O=k.useRef(b.initialTouched||wk),D=k.useRef(b.initialStatus),P=k.useRef(!1),j=k.useRef({});k.useEffect(function(){return P.current=!0,function(){P.current=!1}},[]);var M=k.useState(0),V=M[1],H=k.useRef({values:b.initialValues,errors:b.initialErrors||p_,touched:b.initialTouched||wk,status:b.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),$=H.current,Q=k.useCallback(function(Me){var We=H.current;H.current=UGe(We,Me),We!==H.current&&V(function(bt){return bt+1})},[]),Y=k.useCallback(function(Me,We){return new Promise(function(bt,St){var Lt=b.validate(Me,We);Lt==null?bt(p_):B$(Lt)?Lt.then(function(tn){bt(tn||p_)},function(tn){St(tn)}):bt(Lt)})},[b.validate]),le=k.useCallback(function(Me,We){var bt=b.validationSchema,St=ju(bt)?bt(We):bt,Lt=We&&St.validateAt?St.validateAt(We,Me):VGe(Me,St);return new Promise(function(tn,un){Lt.then(function(){tn(p_)},function(an){an.name==="ValidationError"?tn(BGe(an)):un(an)})})},[b.validationSchema]),ae=k.useCallback(function(Me,We){return new Promise(function(bt){return bt(j.current[Me].validate(We))})},[]),te=k.useCallback(function(Me){var We=Object.keys(j.current).filter(function(St){return ju(j.current[St].validate)}),bt=We.length>0?We.map(function(St){return ae(St,Sd(Me,St))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(bt).then(function(St){return St.reduce(function(Lt,tn,un){return tn==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||tn&&(Lt=mE(Lt,We[un],tn)),Lt},{})})},[ae]),de=k.useCallback(function(Me){return Promise.all([te(Me),b.validationSchema?le(Me):{},b.validate?Y(Me):{}]).then(function(We){var bt=We[0],St=We[1],Lt=We[2],tn=Uq.all([bt,St,Lt],{arrayMerge:zGe});return tn})},[b.validate,b.validationSchema,te,Y,le]),G=Pu(function(Me){return Me===void 0&&(Me=$.values),Q({type:"SET_ISVALIDATING",payload:!0}),de(Me).then(function(We){return P.current&&(Q({type:"SET_ISVALIDATING",payload:!1}),Q({type:"SET_ERRORS",payload:We})),We})});k.useEffect(function(){u&&P.current===!0&&__(A.current,b.initialValues)&&G(A.current)},[u,G]);var ie=k.useCallback(function(Me){var We=Me&&Me.values?Me.values:A.current,bt=Me&&Me.errors?Me.errors:N.current?N.current:b.initialErrors||{},St=Me&&Me.touched?Me.touched:O.current?O.current:b.initialTouched||{},Lt=Me&&Me.status?Me.status:D.current?D.current:b.initialStatus;A.current=We,N.current=bt,O.current=St,D.current=Lt;var tn=function(){Q({type:"RESET_FORM",payload:{isSubmitting:!!Me&&!!Me.isSubmitting,errors:bt,touched:St,status:Lt,values:We,isValidating:!!Me&&!!Me.isValidating,submitCount:Me&&Me.submitCount&&typeof Me.submitCount=="number"?Me.submitCount:0}})};if(b.onReset){var un=b.onReset($.values,_t);B$(un)?un.then(tn):tn()}else tn()},[b.initialErrors,b.initialStatus,b.initialTouched,b.onReset]);k.useEffect(function(){P.current===!0&&!__(A.current,b.initialValues)&&_&&(A.current=b.initialValues,ie(),u&&G(A.current))},[_,b.initialValues,ie,u,G]),k.useEffect(function(){_&&P.current===!0&&!__(N.current,b.initialErrors)&&(N.current=b.initialErrors||p_,Q({type:"SET_ERRORS",payload:b.initialErrors||p_}))},[_,b.initialErrors]),k.useEffect(function(){_&&P.current===!0&&!__(O.current,b.initialTouched)&&(O.current=b.initialTouched||wk,Q({type:"SET_TOUCHED",payload:b.initialTouched||wk}))},[_,b.initialTouched]),k.useEffect(function(){_&&P.current===!0&&!__(D.current,b.initialStatus)&&(D.current=b.initialStatus,Q({type:"SET_STATUS",payload:b.initialStatus}))},[_,b.initialStatus,b.initialTouched]);var _e=Pu(function(Me){if(j.current[Me]&&ju(j.current[Me].validate)){var We=Sd($.values,Me),bt=j.current[Me].validate(We);return B$(bt)?(Q({type:"SET_ISVALIDATING",payload:!0}),bt.then(function(St){return St}).then(function(St){Q({type:"SET_FIELD_ERROR",payload:{field:Me,value:St}}),Q({type:"SET_ISVALIDATING",payload:!1})})):(Q({type:"SET_FIELD_ERROR",payload:{field:Me,value:bt}}),Promise.resolve(bt))}else if(b.validationSchema)return Q({type:"SET_ISVALIDATING",payload:!0}),le($.values,Me).then(function(St){return St}).then(function(St){Q({type:"SET_FIELD_ERROR",payload:{field:Me,value:Sd(St,Me)}}),Q({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),he=k.useCallback(function(Me,We){var bt=We.validate;j.current[Me]={validate:bt}},[]),Ce=k.useCallback(function(Me){delete j.current[Me]},[]),fe=Pu(function(Me,We){Q({type:"SET_TOUCHED",payload:Me});var bt=We===void 0?l:We;return bt?G($.values):Promise.resolve()}),me=k.useCallback(function(Me){Q({type:"SET_ERRORS",payload:Me})},[]),Ne=Pu(function(Me,We){var bt=ju(Me)?Me($.values):Me;Q({type:"SET_VALUES",payload:bt});var St=We===void 0?i:We;return St?G(bt):Promise.resolve()}),Fe=k.useCallback(function(Me,We){Q({type:"SET_FIELD_ERROR",payload:{field:Me,value:We}})},[]),je=Pu(function(Me,We,bt){Q({type:"SET_FIELD_VALUE",payload:{field:Me,value:We}});var St=bt===void 0?i:bt;return St?G(mE($.values,Me,We)):Promise.resolve()}),Ve=k.useCallback(function(Me,We){var bt=We,St=Me,Lt;if(!F$(Me)){Me.persist&&Me.persist();var tn=Me.target?Me.target:Me.currentTarget,un=tn.type,an=tn.name,ye=tn.id,J=tn.value,ne=tn.checked,Se=tn.outerHTML,Ue=tn.options,tt=tn.multiple;bt=We||an||ye,St=/number|range/.test(un)?(Lt=parseFloat(J),isNaN(Lt)?"":Lt):/checkbox/.test(un)?GGe(Sd($.values,bt),ne,J):Ue&&tt?HGe(Ue):J}bt&&je(bt,St)},[je,$.values]),Re=Pu(function(Me){if(F$(Me))return function(We){return Ve(We,Me)};Ve(Me)}),Be=Pu(function(Me,We,bt){We===void 0&&(We=!0),Q({type:"SET_FIELD_TOUCHED",payload:{field:Me,value:We}});var St=bt===void 0?l:bt;return St?G($.values):Promise.resolve()}),Xe=k.useCallback(function(Me,We){Me.persist&&Me.persist();var bt=Me.target,St=bt.name,Lt=bt.id,tn=bt.outerHTML,un=We||St||Lt;Be(un,!0)},[Be]),we=Pu(function(Me){if(F$(Me))return function(We){return Xe(We,Me)};Xe(Me)}),Ge=k.useCallback(function(Me){ju(Me)?Q({type:"SET_FORMIK_STATE",payload:Me}):Q({type:"SET_FORMIK_STATE",payload:function(){return Me}})},[]),rt=k.useCallback(function(Me){Q({type:"SET_STATUS",payload:Me})},[]),pt=k.useCallback(function(Me){Q({type:"SET_ISSUBMITTING",payload:Me})},[]),Ze=Pu(function(){return Q({type:"SUBMIT_ATTEMPT"}),G().then(function(Me){var We=Me instanceof Error,bt=!We&&Object.keys(Me).length===0;if(bt){var St;try{if(St=Xt(),St===void 0)return}catch(Lt){throw Lt}return Promise.resolve(St).then(function(Lt){return P.current&&Q({type:"SUBMIT_SUCCESS"}),Lt}).catch(function(Lt){if(P.current)throw Q({type:"SUBMIT_FAILURE"}),Lt})}else if(P.current&&(Q({type:"SUBMIT_FAILURE"}),We))throw Me})}),Je=Pu(function(Me){Me&&Me.preventDefault&&ju(Me.preventDefault)&&Me.preventDefault(),Me&&Me.stopPropagation&&ju(Me.stopPropagation)&&Me.stopPropagation(),Ze().catch(function(We){console.warn("Warning: An unhandled error was caught from submitForm()",We)})}),_t={resetForm:ie,validateForm:G,validateField:_e,setErrors:me,setFieldError:Fe,setFieldTouched:Be,setFieldValue:je,setStatus:rt,setSubmitting:pt,setTouched:fe,setValues:Ne,setFormikState:Ge,submitForm:Ze},Xt=Pu(function(){return y($.values,_t)}),Ht=Pu(function(Me){Me&&Me.preventDefault&&ju(Me.preventDefault)&&Me.preventDefault(),Me&&Me.stopPropagation&&ju(Me.stopPropagation)&&Me.stopPropagation(),ie()}),gn=k.useCallback(function(Me){return{value:Sd($.values,Me),error:Sd($.errors,Me),touched:!!Sd($.touched,Me),initialValue:Sd(A.current,Me),initialTouched:!!Sd(O.current,Me),initialError:Sd(N.current,Me)}},[$.errors,$.touched,$.values]),It=k.useCallback(function(Me){return{setValue:function(bt,St){return je(Me,bt,St)},setTouched:function(bt,St){return Be(Me,bt,St)},setError:function(bt){return Fe(Me,bt)}}},[je,Be,Fe]),xt=k.useCallback(function(Me){var We=PU(Me),bt=We?Me.name:Me,St=Sd($.values,bt),Lt={name:bt,value:St,onChange:Re,onBlur:we};if(We){var tn=Me.type,un=Me.value,an=Me.as,ye=Me.multiple;tn==="checkbox"?un===void 0?Lt.checked=!!St:(Lt.checked=!!(Array.isArray(St)&&~St.indexOf(un)),Lt.value=un):tn==="radio"?(Lt.checked=St===un,Lt.value=un):an==="select"&&ye&&(Lt.value=Lt.value||[],Lt.multiple=!0)}return Lt},[we,Re,$.values]),mt=k.useMemo(function(){return!__(A.current,$.values)},[A.current,$.values]),dt=k.useMemo(function(){return typeof p<"u"?mt?$.errors&&Object.keys($.errors).length===0:p!==!1&&ju(p)?p(b):p:$.errors&&Object.keys($.errors).length===0},[p,mt,$.errors,b]),it=yo({},$,{initialValues:A.current,initialErrors:N.current,initialTouched:O.current,initialStatus:D.current,handleBlur:we,handleChange:Re,handleReset:Ht,handleSubmit:Je,resetForm:ie,setErrors:me,setFormikState:Ge,setFieldTouched:Be,setFieldValue:je,setFieldError:Fe,setStatus:rt,setSubmitting:pt,setTouched:fe,setValues:Ne,submitForm:Ze,validateForm:G,validateField:_e,isValid:dt,dirty:mt,unregisterField:Ce,registerField:he,getFieldProps:xt,getFieldMeta:gn,getFieldHelpers:It,validateOnBlur:l,validateOnChange:i,validateOnMount:u});return it}function id(n){var t=FGe(n),i=n.component,s=n.children,l=n.render,d=n.innerRef;return k.useImperativeHandle(d,function(){return t}),k.createElement(DGe,{value:t},i?k.createElement(i,t):l?l(t):s?ju(s)?s(t):jGe(s)?null:k.Children.only(s):null)}function BGe(n){var t={};if(n.inner){if(n.inner.length===0)return mE(t,n.path,n.message);for(var l=n.inner,i=Array.isArray(l),s=0,l=i?l:l[Symbol.iterator]();;){var d;if(i){if(s>=l.length)break;d=l[s++]}else{if(s=l.next(),s.done)break;d=s.value}var u=d;Sd(t,u.path)||(t=mE(t,u.path,u.message))}}return t}function VGe(n,t,i,s){i===void 0&&(i=!1);var l=Gq(n);return t[i?"validateSync":"validate"](l,{abortEarly:!1,context:s||l})}function Gq(n){var t=Array.isArray(n)?[]:{};for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var s=String(i);Array.isArray(n[s])===!0?t[s]=n[s].map(function(l){return Array.isArray(l)===!0||Zue(l)?Gq(l):l!==""?l:void 0}):Zue(n[s])?t[s]=Gq(n[s]):t[s]=n[s]!==""?n[s]:void 0}return t}function zGe(n,t,i){var s=n.slice();return t.forEach(function(d,u){if(typeof s[u]>"u"){var p=i.clone!==!1,g=p&&i.isMergeableObject(d);s[u]=g?Uq(Array.isArray(d)?[]:{},d,i):d}else i.isMergeableObject(d)?s[u]=Uq(n[u],d,i):n.indexOf(d)===-1&&s.push(d)}),s}function HGe(n){return Array.from(n).filter(function(t){return t.selected}).map(function(t){return t.value})}function GGe(n,t,i){if(typeof n=="boolean")return!!t;var s=[],l=!1,d=-1;if(Array.isArray(n))s=n,d=n.indexOf(i),l=d>=0;else if(!i||i=="true"||i=="false")return!!t;return t&&i&&!l?s.concat(i):l?s.slice(0,d).concat(s.slice(d+1)):s}var WGe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?k.useLayoutEffect:k.useEffect;function Pu(n){var t=k.useRef(n);return WGe(function(){t.current=n}),k.useCallback(function(){for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return t.current.apply(void 0,s)},[])}var $Ge=k.forwardRef(function(n,t){var i=n.action,s=e_e(n,["action"]),l=i??"#",d=kGe(),u=d.handleReset,p=d.handleSubmit;return k.createElement("form",yo({onSubmit:p,ref:t,onReset:u,action:l},s))});$Ge.displayName="Form";function $E(n){this._maxSize=n,this.clear()}$E.prototype.clear=function(){this._size=0,this._values=Object.create(null)};$E.prototype.get=function(n){return this._values[n]};$E.prototype.set=function(n,t){return this._size>=this._maxSize&&this.clear(),n in this._values||this._size++,this._values[n]=t};var KGe=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n_e=/^\d+$/,qGe=/^\d/,YGe=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,XGe=/^\s*(['"]?)(.*?)(\1)\s*$/,FQ=512,Rhe=new $E(FQ),xhe=new $E(FQ),Ahe=new $E(FQ),gE={Cache:$E,split:Wq,normalizePath:V$,setter:function(n){var t=V$(n);return xhe.get(n)||xhe.set(n,function(s,l){for(var d=0,u=t.length,p=s;d<u-1;){var g=t[d];if(g==="__proto__"||g==="constructor"||g==="prototype")return s;p=p[t[d++]]}p[t[d]]=l})},getter:function(n,t){var i=V$(n);return Ahe.get(n)||Ahe.set(n,function(l){for(var d=0,u=i.length;d<u;)if(l!=null||!t)l=l[i[d++]];else return;return l})},join:function(n){return n.reduce(function(t,i){return t+(BQ(i)||n_e.test(i)?"["+i+"]":(t?".":"")+i)},"")},forEach:function(n,t,i){JGe(Array.isArray(n)?n:Wq(n),t,i)}};function V$(n){return Rhe.get(n)||Rhe.set(n,Wq(n).map(function(t){return t.replace(XGe,"$2")}))}function Wq(n){return n.match(KGe)||[""]}function JGe(n,t,i){var s=n.length,l,d,u,p;for(d=0;d<s;d++)l=n[d],l&&(eWe(l)&&(l='"'+l+'"'),p=BQ(l),u=!p&&/^\d+$/.test(l),t.call(i,l,p,u,d,n))}function BQ(n){return typeof n=="string"&&n&&["'",'"'].indexOf(n.charAt(0))!==-1}function QGe(n){return n.match(qGe)&&!n.match(n_e)}function ZGe(n){return YGe.test(n)}function eWe(n){return!BQ(n)&&(QGe(n)||ZGe(n))}const tWe=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,LU=n=>n.match(tWe)||[],DU=n=>n[0].toUpperCase()+n.slice(1),VQ=(n,t)=>LU(n).join(t).toLowerCase(),i_e=n=>LU(n).reduce((t,i)=>`${t}${t?i[0].toUpperCase()+i.slice(1).toLowerCase():i.toLowerCase()}`,""),nWe=n=>DU(i_e(n)),iWe=n=>VQ(n,"_"),rWe=n=>VQ(n,"-"),sWe=n=>DU(VQ(n," ")),aWe=n=>LU(n).map(DU).join(" ");var z$={words:LU,upperFirst:DU,camelCase:i_e,pascalCase:nWe,snakeCase:iWe,kebabCase:rWe,sentenceCase:sWe,titleCase:aWe},zQ={exports:{}};zQ.exports=function(n){return r_e(oWe(n),n)};zQ.exports.array=r_e;function r_e(n,t){var i=n.length,s=new Array(i),l={},d=i,u=lWe(t),p=cWe(n);for(t.forEach(function(_){if(!p.has(_[0])||!p.has(_[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});d--;)l[d]||g(n[d],d,new Set);return s;function g(_,y,E){if(E.has(_)){var b;try{b=", node was:"+JSON.stringify(_)}catch{b=""}throw new Error("Cyclic dependency"+b)}if(!p.has(_))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(_));if(!l[y]){l[y]=!0;var A=u.get(_)||new Set;if(A=Array.from(A),y=A.length){E.add(_);do{var N=A[--y];g(N,p.get(N),E)}while(y);E.delete(_)}s[--i]=_}}}function oWe(n){for(var t=new Set,i=0,s=n.length;i<s;i++){var l=n[i];t.add(l[0]),t.add(l[1])}return Array.from(t)}function lWe(n){for(var t=new Map,i=0,s=n.length;i<s;i++){var l=n[i];t.has(l[0])||t.set(l[0],new Set),t.has(l[1])||t.set(l[1],new Set),t.get(l[0]).add(l[1])}return t}function cWe(n){for(var t=new Map,i=0,s=n.length;i<s;i++)t.set(n[i],i);return t}var dWe=zQ.exports;const uWe=Mv(dWe),hWe=Object.prototype.toString,fWe=Error.prototype.toString,pWe=RegExp.prototype.toString,mWe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",gWe=/^Symbol\((.*)\)(.*)$/;function vWe(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function Ihe(n,t=!1){if(n==null||n===!0||n===!1)return""+n;const i=typeof n;if(i==="number")return vWe(n);if(i==="string")return t?`"${n}"`:n;if(i==="function")return"[Function "+(n.name||"anonymous")+"]";if(i==="symbol")return mWe.call(n).replace(gWe,"Symbol($1)");const s=hWe.call(n).slice(8,-1);return s==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):s==="Error"||n instanceof Error?"["+fWe.call(n)+"]":s==="RegExp"?pWe.call(n):null}function xv(n,t){let i=Ihe(n,t);return i!==null?i:JSON.stringify(n,function(s,l){let d=Ihe(this[s],t);return d!==null?d:l},2)}function s_e(n){return n==null?[]:[].concat(n)}let a_e,yWe=/\$\{\s*(\w+)\s*\}/g;a_e=Symbol.toStringTag;class Qc extends Error{static formatError(t,i){const s=i.label||i.path||"this";return s!==i.path&&(i=Object.assign({},i,{path:s})),typeof t=="string"?t.replace(yWe,(l,d)=>xv(i[d])):typeof t=="function"?t(i):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,i,s,l,d){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this[a_e]="Error",this.name="ValidationError",this.value=i,this.path=s,this.type=l,this.errors=[],this.inner=[],s_e(t).forEach(u=>{if(Qc.isError(u)){this.errors.push(...u.errors);const p=u.inner.length?u.inner:[u];this.inner.push(...p)}else this.errors.push(u)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],!d&&Error.captureStackTrace&&Error.captureStackTrace(this,Qc)}}let sp={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:t,value:i,originalValue:s})=>{const l=s!=null&&s!==i?` (cast from the value \`${xv(s,!0)}\`).`:".";return t!=="mixed"?`${n} must be a \`${t}\` type, but the final value was: \`${xv(i,!0)}\``+l:`${n} must match the configured type. The validated value was: \`${xv(i,!0)}\``+l}},kh={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},_We={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},$q={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},EWe={isValue:"${path} field must be ${value}"},Kq={noUnknown:"${path} field has unspecified keys: ${unknown}"},wWe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},SWe={notType:n=>{const{path:t,value:i,spec:s}=n,l=s.types.length;if(Array.isArray(i)){if(i.length<l)return`${t} tuple value has too few items, expected a length of ${l} but got ${i.length} for value: \`${xv(i,!0)}\``;if(i.length>l)return`${t} tuple value has too many items, expected a length of ${l} but got ${i.length} for value: \`${xv(i,!0)}\``}return Qc.formatError(sp.notType,n)}};Object.assign(Object.create(null),{mixed:sp,string:kh,number:_We,date:$q,object:Kq,array:wWe,boolean:EWe,tuple:SWe});const HQ=n=>n&&n.__isYupSchema__;class w7{static fromOptions(t,i){if(!i.then&&!i.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:s,then:l,otherwise:d}=i,u=typeof s=="function"?s:(...p)=>p.every(g=>g===s);return new w7(t,(p,g)=>{var _;let y=u(...p)?l:d;return(_=y==null?void 0:y(g))!=null?_:g})}constructor(t,i){this.fn=void 0,this.refs=t,this.refs=t,this.fn=i}resolve(t,i){let s=this.refs.map(d=>d.getValue(i==null?void 0:i.value,i==null?void 0:i.parent,i==null?void 0:i.context)),l=this.fn(s,t,i);if(l===void 0||l===t)return t;if(!HQ(l))throw new TypeError("conditions must return a schema object");return l.resolve(i)}}const Sk={context:"$",value:"."};class KE{constructor(t,i={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Sk.context,this.isValue=this.key[0]===Sk.value,this.isSibling=!this.isContext&&!this.isValue;let s=this.isContext?Sk.context:this.isValue?Sk.value:"";this.path=this.key.slice(s.length),this.getter=this.path&&gE.getter(this.path,!0),this.map=i.map}getValue(t,i,s){let l=this.isContext?s:this.isValue?t:i;return this.getter&&(l=this.getter(l||{})),this.map&&(l=this.map(l)),l}cast(t,i){return this.getValue(t,i==null?void 0:i.parent,i==null?void 0:i.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}KE.prototype.__isYupRef=!0;const k_=n=>n==null;function Nb(n){function t({value:i,path:s="",options:l,originalValue:d,schema:u},p,g){const{name:_,test:y,params:E,message:b,skipAbsent:A}=n;let{parent:N,context:O,abortEarly:D=u.spec.abortEarly,disableStackTrace:P=u.spec.disableStackTrace}=l;function j(te){return KE.isRef(te)?te.getValue(i,N,O):te}function M(te={}){var de;const G=Object.assign({value:i,originalValue:d,label:u.spec.label,path:te.path||s,spec:u.spec},E,te.params);for(const _e of Object.keys(G))G[_e]=j(G[_e]);const ie=new Qc(Qc.formatError(te.message||b,G),i,G.path,te.type||_,(de=te.disableStackTrace)!=null?de:P);return ie.params=G,ie}const V=D?p:g;let H={path:s,parent:N,type:_,from:l.from,createError:M,resolve:j,options:l,originalValue:d,schema:u};const $=te=>{Qc.isError(te)?V(te):te?g(null):V(M())},Q=te=>{Qc.isError(te)?V(te):p(te)};if(A&&k_(i))return $(!0);let le;try{var ae;if(le=y.call(H,i,H),typeof((ae=le)==null?void 0:ae.then)=="function"){if(l.sync)throw new Error(`Validation test of type: "${H.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(le).then($,Q)}}catch(te){Q(te);return}$(le)}return t.OPTIONS=n,t}function bWe(n,t,i,s=i){let l,d,u;return t?(gE.forEach(t,(p,g,_)=>{let y=g?p.slice(1,p.length-1):p;n=n.resolve({context:s,parent:l,value:i});let E=n.type==="tuple",b=_?parseInt(y,10):0;if(n.innerType||E){if(E&&!_)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${u}" must contain an index to the tuple element, e.g. "${u}[0]"`);if(i&&b>=i.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${p}, in the path: ${t}. because there is no value at that index. `);l=i,i=i&&i[b],n=E?n.spec.types[b]:n.innerType}if(!_){if(!n.fields||!n.fields[y])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${u} which is a type: "${n.type}")`);l=i,i=i&&i[y],n=n.fields[y]}d=y,u=g?"["+p+"]":"."+p}),{schema:n,parent:l,parentPath:d}):{parent:l,parentPath:t,schema:n}}class S7 extends Set{describe(){const t=[];for(const i of this.values())t.push(KE.isRef(i)?i.describe():i);return t}resolveAll(t){let i=[];for(const s of this.values())i.push(t(s));return i}clone(){return new S7(this.values())}merge(t,i){const s=this.clone();return t.forEach(l=>s.add(l)),i.forEach(l=>s.delete(l)),s}}function uC(n,t=new Map){if(HQ(n)||!n||typeof n!="object")return n;if(t.has(n))return t.get(n);let i;if(n instanceof Date)i=new Date(n.getTime()),t.set(n,i);else if(n instanceof RegExp)i=new RegExp(n),t.set(n,i);else if(Array.isArray(n)){i=new Array(n.length),t.set(n,i);for(let s=0;s<n.length;s++)i[s]=uC(n[s],t)}else if(n instanceof Map){i=new Map,t.set(n,i);for(const[s,l]of n.entries())i.set(s,uC(l,t))}else if(n instanceof Set){i=new Set,t.set(n,i);for(const s of n)i.add(uC(s,t))}else if(n instanceof Object){i={},t.set(n,i);for(const[s,l]of Object.entries(n))i[s]=uC(l,t)}else throw Error(`Unable to clone ${n}`);return i}class jp{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new S7,this._blacklist=new S7,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(sp.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(i=>{i.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const i=Object.create(Object.getPrototypeOf(this));return i.type=this.type,i._typeCheck=this._typeCheck,i._whitelist=this._whitelist.clone(),i._blacklist=this._blacklist.clone(),i.internalTests=Object.assign({},this.internalTests),i.exclusiveTests=Object.assign({},this.exclusiveTests),i.deps=[...this.deps],i.conditions=[...this.conditions],i.tests=[...this.tests],i.transforms=[...this.transforms],i.spec=uC(Object.assign({},this.spec,t)),i}label(t){let i=this.clone();return i.spec.label=t,i}meta(...t){if(t.length===0)return this.spec.meta;let i=this.clone();return i.spec.meta=Object.assign(i.spec.meta||{},t[0]),i}withMutation(t){let i=this._mutate;this._mutate=!0;let s=t(this);return this._mutate=i,s}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let i=this,s=t.clone();const l=Object.assign({},i.spec,s.spec);return s.spec=l,s.internalTests=Object.assign({},i.internalTests,s.internalTests),s._whitelist=i._whitelist.merge(t._whitelist,t._blacklist),s._blacklist=i._blacklist.merge(t._blacklist,t._whitelist),s.tests=i.tests,s.exclusiveTests=i.exclusiveTests,s.withMutation(d=>{t.tests.forEach(u=>{d.test(u.OPTIONS)})}),s.transforms=[...i.transforms,...s.transforms],s}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let i=this;if(i.conditions.length){let s=i.conditions;i=i.clone(),i.conditions=[],i=s.reduce((l,d)=>d.resolve(l,t),i),i=i.resolve(t)}return i}resolveOptions(t){var i,s,l,d;return Object.assign({},t,{from:t.from||[],strict:(i=t.strict)!=null?i:this.spec.strict,abortEarly:(s=t.abortEarly)!=null?s:this.spec.abortEarly,recursive:(l=t.recursive)!=null?l:this.spec.recursive,disableStackTrace:(d=t.disableStackTrace)!=null?d:this.spec.disableStackTrace})}cast(t,i={}){let s=this.resolve(Object.assign({value:t},i)),l=i.assert==="ignore-optionality",d=s._cast(t,i);if(i.assert!==!1&&!s.isType(d)){if(l&&k_(d))return d;let u=xv(t),p=xv(d);throw new TypeError(`The value of ${i.path||"field"} could not be cast to a value that satisfies the schema type: "${s.type}".
attempted value: ${u}
`+(p!==u?`result of cast: ${p}`:""))}return d}_cast(t,i){let s=t===void 0?t:this.transforms.reduce((l,d)=>d.call(this,l,t,this),t);return s===void 0&&(s=this.getDefault(i)),s}_validate(t,i={},s,l){let{path:d,originalValue:u=t,strict:p=this.spec.strict}=i,g=t;p||(g=this._cast(g,Object.assign({assert:!1},i)));let _=[];for(let y of Object.values(this.internalTests))y&&_.push(y);this.runTests({path:d,value:g,originalValue:u,options:i,tests:_},s,y=>{if(y.length)return l(y,g);this.runTests({path:d,value:g,originalValue:u,options:i,tests:this.tests},s,l)})}runTests(t,i,s){let l=!1,{tests:d,value:u,originalValue:p,path:g,options:_}=t,y=O=>{l||(l=!0,i(O,u))},E=O=>{l||(l=!0,s(O,u))},b=d.length,A=[];if(!b)return E([]);let N={value:u,originalValue:p,path:g,options:_,schema:this};for(let O=0;O<d.length;O++){const D=d[O];D(N,y,function(j){j&&(Array.isArray(j)?A.push(...j):A.push(j)),--b<=0&&E(A)})}}asNestedTest({key:t,index:i,parent:s,parentPath:l,originalParent:d,options:u}){const p=t??i;if(p==null)throw TypeError("Must include `key` or `index` for nested validations");const g=typeof p=="number";let _=s[p];const y=Object.assign({},u,{strict:!0,parent:s,value:_,originalValue:d[p],key:void 0,[g?"index":"key"]:p,path:g||p.includes(".")?`${l||""}[${_?p:`"${p}"`}]`:(l?`${l}.`:"")+t});return(E,b,A)=>this.resolve(y)._validate(_,y,b,A)}validate(t,i){var s;let l=this.resolve(Object.assign({},i,{value:t})),d=(s=i==null?void 0:i.disableStackTrace)!=null?s:l.spec.disableStackTrace;return new Promise((u,p)=>l._validate(t,i,(g,_)=>{Qc.isError(g)&&(g.value=_),p(g)},(g,_)=>{g.length?p(new Qc(g,_,void 0,void 0,d)):u(_)}))}validateSync(t,i){var s;let l=this.resolve(Object.assign({},i,{value:t})),d,u=(s=i==null?void 0:i.disableStackTrace)!=null?s:l.spec.disableStackTrace;return l._validate(t,Object.assign({},i,{sync:!0}),(p,g)=>{throw Qc.isError(p)&&(p.value=g),p},(p,g)=>{if(p.length)throw new Qc(p,t,void 0,void 0,u);d=g}),d}isValid(t,i){return this.validate(t,i).then(()=>!0,s=>{if(Qc.isError(s))return!1;throw s})}isValidSync(t,i){try{return this.validateSync(t,i),!0}catch(s){if(Qc.isError(s))return!1;throw s}}_getDefault(t){let i=this.spec.default;return i==null?i:typeof i=="function"?i.call(this,t):uC(i)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,i){const s=this.clone({nullable:t});return s.internalTests.nullable=Nb({message:i,name:"nullable",test(l){return l===null?this.schema.spec.nullable:!0}}),s}optionality(t,i){const s=this.clone({optional:t});return s.internalTests.optionality=Nb({message:i,name:"optionality",test(l){return l===void 0?this.schema.spec.optional:!0}}),s}optional(){return this.optionality(!0)}defined(t=sp.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=sp.notNull){return this.nullability(!1,t)}required(t=sp.required){return this.clone().withMutation(i=>i.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let i=this.clone();return i.transforms.push(t),i}test(...t){let i;if(t.length===1?typeof t[0]=="function"?i={test:t[0]}:i=t[0]:t.length===2?i={name:t[0],test:t[1]}:i={name:t[0],message:t[1],test:t[2]},i.message===void 0&&(i.message=sp.default),typeof i.test!="function")throw new TypeError("`test` is a required parameters");let s=this.clone(),l=Nb(i),d=i.exclusive||i.name&&s.exclusiveTests[i.name]===!0;if(i.exclusive&&!i.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return i.name&&(s.exclusiveTests[i.name]=!!i.exclusive),s.tests=s.tests.filter(u=>!(u.OPTIONS.name===i.name&&(d||u.OPTIONS.test===l.OPTIONS.test))),s.tests.push(l),s}when(t,i){!Array.isArray(t)&&typeof t!="string"&&(i=t,t=".");let s=this.clone(),l=s_e(t).map(d=>new KE(d));return l.forEach(d=>{d.isSibling&&s.deps.push(d.key)}),s.conditions.push(typeof i=="function"?new w7(l,i):w7.fromOptions(l,i)),s}typeError(t){let i=this.clone();return i.internalTests.typeError=Nb({message:t,name:"typeError",skipAbsent:!0,test(s){return this.schema._typeCheck(s)?!0:this.createError({params:{type:this.schema.type}})}}),i}oneOf(t,i=sp.oneOf){let s=this.clone();return t.forEach(l=>{s._whitelist.add(l),s._blacklist.delete(l)}),s.internalTests.whiteList=Nb({message:i,name:"oneOf",skipAbsent:!0,test(l){let d=this.schema._whitelist,u=d.resolveAll(this.resolve);return u.includes(l)?!0:this.createError({params:{values:Array.from(d).join(", "),resolved:u}})}}),s}notOneOf(t,i=sp.notOneOf){let s=this.clone();return t.forEach(l=>{s._blacklist.add(l),s._whitelist.delete(l)}),s.internalTests.blacklist=Nb({message:i,name:"notOneOf",test(l){let d=this.schema._blacklist,u=d.resolveAll(this.resolve);return u.includes(l)?this.createError({params:{values:Array.from(d).join(", "),resolved:u}}):!0}}),s}strip(t=!0){let i=this.clone();return i.spec.strip=t,i}describe(t){const i=(t?this.resolve(t):this).clone(),{label:s,meta:l,optional:d,nullable:u}=i.spec;return{meta:l,label:s,optional:d,nullable:u,default:i.getDefault(t),type:i.type,oneOf:i._whitelist.describe(),notOneOf:i._blacklist.describe(),tests:i.tests.map(g=>({name:g.OPTIONS.name,params:g.OPTIONS.params})).filter((g,_,y)=>y.findIndex(E=>E.name===g.name)===_)}}}jp.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])jp.prototype[`${n}At`]=function(t,i,s={}){const{parent:l,parentPath:d,schema:u}=bWe(this,t,i,s.context);return u[n](l&&l[d],Object.assign({},s,{parent:l,path:t}))};for(const n of["equals","is"])jp.prototype[n]=jp.prototype.oneOf;for(const n of["not","nope"])jp.prototype[n]=jp.prototype.notOneOf;let CWe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,TWe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,RWe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,xWe=n=>k_(n)||n===n.trim(),AWe={}.toString();function hf(){return new o_e}class o_e extends jp{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,i,s)=>{if(!s.spec.coerce||s.isType(t)||Array.isArray(t))return t;const l=t!=null&&t.toString?t.toString():t;return l===AWe?t:l})})}required(t){return super.required(t).withMutation(i=>i.test({message:t||sp.required,name:"required",skipAbsent:!0,test:s=>!!s.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(i=>i.OPTIONS.name!=="required"),t))}length(t,i=kh.length){return this.test({message:i,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(s){return s.length===this.resolve(t)}})}min(t,i=kh.min){return this.test({message:i,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s.length>=this.resolve(t)}})}max(t,i=kh.max){return this.test({name:"max",exclusive:!0,message:i,params:{max:t},skipAbsent:!0,test(s){return s.length<=this.resolve(t)}})}matches(t,i){let s=!1,l,d;return i&&(typeof i=="object"?{excludeEmptyString:s=!1,message:l,name:d}=i:l=i),this.test({name:d||"matches",message:l||kh.matches,params:{regex:t},skipAbsent:!0,test:u=>u===""&&s||u.search(t)!==-1})}email(t=kh.email){return this.matches(CWe,{name:"email",message:t,excludeEmptyString:!0})}url(t=kh.url){return this.matches(TWe,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=kh.uuid){return this.matches(RWe,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=kh.trim){return this.transform(i=>i!=null?i.trim():i).test({message:t,name:"trim",test:xWe})}lowercase(t=kh.lowercase){return this.transform(i=>k_(i)?i:i.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:i=>k_(i)||i===i.toLowerCase()})}uppercase(t=kh.uppercase){return this.transform(i=>k_(i)?i:i.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:i=>k_(i)||i===i.toUpperCase()})}}hf.prototype=o_e.prototype;const IWe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function xm(n,t=0){return Number(n)||t}function NWe(n){const t=IWe.exec(n);if(!t)return Date.parse?Date.parse(n):Number.NaN;const i={year:xm(t[1]),month:xm(t[2],1)-1,day:xm(t[3],1),hour:xm(t[4]),minute:xm(t[5]),second:xm(t[6]),millisecond:t[7]?xm(t[7].substring(0,3)):0,z:t[8]||void 0,plusMinus:t[9]||void 0,hourOffset:xm(t[10]),minuteOffset:xm(t[11])};if(i.z===void 0&&i.plusMinus===void 0)return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).valueOf();let s=0;return i.z!=="Z"&&i.plusMinus!==void 0&&(s=i.hourOffset*60+i.minuteOffset,i.plusMinus==="+"&&(s=0-s)),Date.UTC(i.year,i.month,i.day,i.hour,i.minute+s,i.second,i.millisecond)}let OWe=new Date(""),PWe=n=>Object.prototype.toString.call(n)==="[object Date]";class kU extends jp{constructor(){super({type:"date",check(t){return PWe(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,i,s)=>!s.spec.coerce||s.isType(t)||t===null?t:(t=NWe(t),isNaN(t)?kU.INVALID_DATE:new Date(t)))})}prepareParam(t,i){let s;if(KE.isRef(t))s=t;else{let l=this.cast(t);if(!this._typeCheck(l))throw new TypeError(`\`${i}\` must be a Date or a value that can be \`cast()\` to a Date`);s=l}return s}min(t,i=$q.min){let s=this.prepareParam(t,"min");return this.test({message:i,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(l){return l>=this.resolve(s)}})}max(t,i=$q.max){let s=this.prepareParam(t,"max");return this.test({message:i,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(l){return l<=this.resolve(s)}})}}kU.INVALID_DATE=OWe;kU.prototype;function LWe(n,t=[]){let i=[],s=new Set,l=new Set(t.map(([u,p])=>`${u}-${p}`));function d(u,p){let g=gE.split(u)[0];s.add(g),l.has(`${p}-${g}`)||i.push([p,g])}for(const u of Object.keys(n)){let p=n[u];s.add(u),KE.isRef(p)&&p.isSibling?d(p.path,u):HQ(p)&&"deps"in p&&p.deps.forEach(g=>d(g,u))}return uWe.array(Array.from(s),i).reverse()}function Nhe(n,t){let i=1/0;return n.some((s,l)=>{var d;if((d=t.path)!=null&&d.includes(s))return i=l,!0}),i}function l_e(n){return(t,i)=>Nhe(n,t)-Nhe(n,i)}const DWe=(n,t,i)=>{if(typeof n!="string")return n;let s=n;try{s=JSON.parse(n)}catch{}return i.isType(s)?s:n};function eM(n){if("fields"in n){const t={};for(const[i,s]of Object.entries(n.fields))t[i]=eM(s);return n.setFields(t)}if(n.type==="array"){const t=n.optional();return t.innerType&&(t.innerType=eM(t.innerType)),t}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(eM)}):"optional"in n?n.optional():n}const kWe=(n,t)=>{const i=[...gE.normalizePath(t)];if(i.length===1)return i[0]in n;let s=i.pop(),l=gE.getter(gE.join(i),!0)(n);return!!(l&&s in l)};let Ohe=n=>Object.prototype.toString.call(n)==="[object Object]";function MWe(n,t){let i=Object.keys(n.fields);return Object.keys(t).filter(s=>i.indexOf(s)===-1)}const jWe=l_e([]);function uc(n){return new c_e(n)}class c_e extends jp{constructor(t){super({type:"object",check(i){return Ohe(i)||typeof i=="function"}}),this.fields=Object.create(null),this._sortErrors=jWe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,i={}){var s;let l=super._cast(t,i);if(l===void 0)return this.getDefault(i);if(!this._typeCheck(l))return l;let d=this.fields,u=(s=i.stripUnknown)!=null?s:this.spec.noUnknown,p=[].concat(this._nodes,Object.keys(l).filter(E=>!this._nodes.includes(E))),g={},_=Object.assign({},i,{parent:g,__validating:i.__validating||!1}),y=!1;for(const E of p){let b=d[E],A=E in l;if(b){let N,O=l[E];_.path=(i.path?`${i.path}.`:"")+E,b=b.resolve({value:O,context:i.context,parent:g});let D=b instanceof jp?b.spec:void 0,P=D==null?void 0:D.strict;if(D!=null&&D.strip){y=y||E in l;continue}N=!i.__validating||!P?b.cast(l[E],_):l[E],N!==void 0&&(g[E]=N)}else A&&!u&&(g[E]=l[E]);(A!==E in g||g[E]!==l[E])&&(y=!0)}return y?g:l}_validate(t,i={},s,l){let{from:d=[],originalValue:u=t,recursive:p=this.spec.recursive}=i;i.from=[{schema:this,value:u},...d],i.__validating=!0,i.originalValue=u,super._validate(t,i,s,(g,_)=>{if(!p||!Ohe(_)){l(g,_);return}u=u||_;let y=[];for(let E of this._nodes){let b=this.fields[E];!b||KE.isRef(b)||y.push(b.asNestedTest({options:i,key:E,parent:_,parentPath:i.path,originalParent:u}))}this.runTests({tests:y,value:_,originalValue:u,options:i},s,E=>{l(E.sort(this._sortErrors).concat(g),_)})})}clone(t){const i=super.clone(t);return i.fields=Object.assign({},this.fields),i._nodes=this._nodes,i._excludedEdges=this._excludedEdges,i._sortErrors=this._sortErrors,i}concat(t){let i=super.concat(t),s=i.fields;for(let[l,d]of Object.entries(this.fields)){const u=s[l];s[l]=u===void 0?d:u}return i.withMutation(l=>l.setFields(s,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let i={};return this._nodes.forEach(s=>{var l;const d=this.fields[s];let u=t;(l=u)!=null&&l.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[s]})),i[s]=d&&"getDefault"in d?d.getDefault(u):void 0}),i}setFields(t,i){let s=this.clone();return s.fields=t,s._nodes=LWe(t,i),s._sortErrors=l_e(Object.keys(t)),i&&(s._excludedEdges=i),s}shape(t,i=[]){return this.clone().withMutation(s=>{let l=s._excludedEdges;return i.length&&(Array.isArray(i[0])||(i=[i]),l=[...s._excludedEdges,...i]),s.setFields(Object.assign(s.fields,t),l)})}partial(){const t={};for(const[i,s]of Object.entries(this.fields))t[i]="optional"in s&&s.optional instanceof Function?s.optional():s;return this.setFields(t)}deepPartial(){return eM(this)}pick(t){const i={};for(const s of t)this.fields[s]&&(i[s]=this.fields[s]);return this.setFields(i,this._excludedEdges.filter(([s,l])=>t.includes(s)&&t.includes(l)))}omit(t){const i=[];for(const s of Object.keys(this.fields))t.includes(s)||i.push(s);return this.pick(i)}from(t,i,s){let l=gE.getter(t,!0);return this.transform(d=>{if(!d)return d;let u=d;return kWe(d,t)&&(u=Object.assign({},d),s||delete u[t],u[i]=l(d)),u})}json(){return this.transform(DWe)}noUnknown(t=!0,i=Kq.noUnknown){typeof t!="boolean"&&(i=t,t=!0);let s=this.test({name:"noUnknown",exclusive:!0,message:i,test(l){if(l==null)return!0;const d=MWe(this.schema,l);return!t||d.length===0||this.createError({params:{unknown:d.join(", ")}})}});return s.spec.noUnknown=t,s}unknown(t=!0,i=Kq.noUnknown){return this.noUnknown(!t,i)}transformKeys(t){return this.transform(i=>{if(!i)return i;const s={};for(const l of Object.keys(i))s[t(l)]=i[l];return s})}camelCase(){return this.transformKeys(z$.camelCase)}snakeCase(){return this.transformKeys(z$.snakeCase)}constantCase(){return this.transformKeys(t=>z$.snakeCase(t).toUpperCase())}describe(t){const i=(t?this.resolve(t):this).clone(),s=super.describe(t);s.fields={};for(const[d,u]of Object.entries(i.fields)){var l;let p=t;(l=p)!=null&&l.value&&(p=Object.assign({},p,{parent:p.value,value:p.value[d]})),s.fields[d]=u.describe(p)}return s}}uc.prototype=c_e.prototype;function d_e({otp:n,totalDigits:t,handleUpdateOTP:i}){const[s,l]=k.useState(new Array(t).fill("")),[d,u]=k.useState(""),[p,g]=k.useState(!1),_=k.useRef([]);function y(b,A){if(b.length>1){A<t-1&&_.current[A+1].focus();return}let N=[...s];N[A]=b,l(N),b&&A<t-1&&_.current[A+1].focus()}function E(b,A){b.key==="Backspace"&&!b.target.value&&A>0&&_.current[A-1].focus(),b.key==="Enter"&&b.target.value&&A<t-1&&_.current[A+1].focus()}return k.useEffect(()=>{s.includes("")?(g(!1),u("Enter OTP")):(g(!0),u(""));const b=s.join("");i(b)},[s]),k.useEffect(()=>{n===0&&l(new Array(t).fill(""))},[n]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-around align-items-center otp-input-wrap",children:s.map((b,A)=>h.jsx("input",{type:"number",value:b,min:"0",max:"9",step:"1",maxLength:1,inputMode:"numeric",pattern:"[0-9]*",onChange:N=>y(N.target.value,A),onKeyUp:N=>E(N,A),ref:N=>_.current[A]=N,className:"otp-field text-center"},A))}),d&&h.jsx("p",{className:"text-danger font-13 text-center py-2",children:d})]})}function UWe(n){var H;const i=Ii(),[s,l]=k.useState(!1),[d,u]=k.useState(!1),[p,g]=k.useState(""),[_,y]=k.useState(!1),[E,b]=k.useState(!1),[A,N]=k.useState(!1);k.useEffect(()=>{window.scrollTo(0,0)},[]);const O=()=>{b(!1)},D=()=>{b(!0)};function P($){$.toString().length===6?y(!0):y(!1),g($)}async function j($){if($.preventDefault(),!A){Qt("Please accept Terms & Conditions.","error");return}l(!0);let Q={email:n.data.email,otp:p,device:localStorage.getItem("deviceID"),application:n.data.application,domain:n.data.domain};Ai.verifyAuth(Q).then(Y=>{Y.data.status==="success"&&(Qt(Y.data.message,"success"),l(!1),Ai.setToken(Y.data.data),Ai.registerDeviceForPushNotification(),i("/dashboard")),Y.data.status==="failed"&&(console.log("Failed ERROR response : ",Y.data),Qt(Y.data.message,"error"),l(!1),P(0))}).catch(Y=>{var le,ae;l(!1),((le=Y.response)==null?void 0:le.data.status)==="failed"&&Qt((ae=Y.response)==null?void 0:ae.data.message,"error"),console.log("Verify OTP Error = ",Y)})}async function M(){u(!0);let $={email:n.data.email,application:n.data.application,domain:n.data.domain};Ai.login($).then(Q=>{Q.data.status==="success"&&(Qt(Q.data.message,"success"),u(!1)),Q.data.status==="failed"&&(console.log("Failed ERROR response : ",Q.data),Qt(Q.data.message,"error"),u(!1))}).catch(Q=>{u(!1),Q.response.data.status==="failed"&&Qt(Q.response.data.message,"error"),console.log("Resend Code Error = ",Q)})}function V($){N(!A),D()}return h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsxs("div",{className:"mb-5 text-center",children:[h.jsx("div",{className:"secondary-text mb-4 text-center",children:h.jsx("h2",{children:"Verify Code"})}),h.jsx("div",{className:"helper-text",children:"We have sent you OTP on your email."})]}),h.jsx("div",{className:"form-container",children:h.jsxs(kt,{onSubmit:j,children:[h.jsx(kt.Group,{className:"form-group",children:h.jsx(kt.Control,{type:"text",placeholder:"Enter OTP",name:"otp",value:p,required:!0,autoComplete:"off",readOnly:!0,style:{width:"0.1px",height:"0.1px",overflow:"hidden",position:"absolute",zIndex:"-1",opacity:0,visibility:"hidden"}})}),h.jsx(kt.Group,{className:"form-group mb-3",children:h.jsx(d_e,{totalDigits:6,handleUpdateOTP:P,otp:p})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-3",children:h.jsx(kt.Group,{className:"form-group mb-2 fw-sb",children:h.jsx(kt.Check,{onChange:V,value:"test",type:"checkbox",id:"terms",label:"Terms & Conditions"})})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-4 pb-5 px-2",children:h.jsx(Pt,{type:"button",variant:"link",className:"btn-theme font-14 fw-sb text-decoration-none",onClick:M,children:d?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Sending"]}):h.jsx(h.Fragment,{children:"Send me a new code"})})}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Pt,{type:"submit",size:"lg",disabled:!_,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:s?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):_?"Verify OTP":"Please fill out all info"})}),h.jsx(Sye,{show:E,handleClose:O,terms:(H=n.data)==null?void 0:H.terms})]})})]})})}function FWe(n){const[i,s]=k.useState(""),[l,d]=k.useState(!1),[u,p]=k.useState("password"),[g,_]=k.useState(!1),y=()=>{p(u==="password"?"text":"password")},E={password:""},b=uc().shape({password:hf().min(6,"Password is too short").required("Please enter a valid password")});function A(O){console.log("handleUpdateOTP",O,"Type of = ",typeof O),O.toString().length===6?_(!0):_(!1),s(O)}async function N(O,{resetForm:D}){if(console.log("Forgot Pwd otp",O),!g){console.log("isValidOTP = ",g),Qt("Please enter correct otp.","error");return}d(!0),console.log(i),console.log("data from Login form = ",n.data);let P={email:n.data.email,application:n.data.application,domain:n.data.domain,otp:i,password:O.password};console.log("newValues from Forgot Password Modal form = ",P),Ai.forgotPassword(P).then(j=>{console.log("forgotPassword Response: ",j),j.data.status==="success"&&(console.log("Success response =",j.data),Qt("Your password has been updated successfully!","success"),d(!1),setTimeout(()=>{n.handleClose()},1500),D()),j.data.status==="failed"&&(console.log("Failed ERROR response : ",j.data),Qt(j.data.message,"error"),d(!1),A(0),D())}).catch(j=>{var M,V,H;d(!1),((M=j.response)==null?void 0:M.data.status)==="failed"&&Qt((V=j.response)==null?void 0:V.data.message,"error"),console.log("forgotPassword Error = ",j),console.log("forgotPassword Error response = ",(H=j.response)==null?void 0:H.data)})}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom forgot-pwd-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:"Forgot Password"})}),h.jsxs(vn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx("div",{className:"mb-3 text-cente",children:h.jsx("div",{className:"p-2 d-flex align-items-center bg-warning-lighter font-13 rounded-2",children:n.loadingCode?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-2",children:"Sending OTP..."})]}):h.jsxs(h.Fragment,{children:[h.jsx(Zt,{tag:"warning3",className:"me-2 font-22 text-theme-warning"})," ","We have sent OTP on your email."]})})}),h.jsx("div",{className:"form-container",children:h.jsx(id,{initialValues:E,validationSchema:b,onSubmit:N,children:O=>h.jsxs(kt,{onSubmit:O.handleSubmit,children:[h.jsx(kt.Group,{className:"form-group",children:h.jsx(kt.Control,{type:"text",placeholder:"Enter OTP",name:"otp",value:i,required:!0,autoComplete:"off",readOnly:!0,style:{width:"0.1px",height:"0.1px",overflow:"hidden",position:"absolute",zIndex:"-1",opacity:0,visibility:"hidden"}})}),h.jsx(kt.Group,{className:"form-group mb-3",children:h.jsx(d_e,{totalDigits:6,handleUpdateOTP:A,otp:i})}),h.jsx("div",{className:"pb-2 text-gray9",children:h.jsx("hr",{style:{borderStyle:"dashed"}})}),h.jsxs(kt.Group,{className:"form-group mb-3 position-relative",children:[h.jsx(kt.Label,{className:"pe-none",children:"Enter New Password"}),h.jsx(kt.Control,{type:u,placeholder:"New Password",name:"password",value:O.values.password,onBlur:O.handleBlur,onChange:O.handleChange,required:!0,autoComplete:"off"}),h.jsx("span",{className:"p-2 d-flex position-absolute font-22 text-gray6",style:{right:0,top:35},onClick:y,children:h.jsx(Zt,{tag:u==="password"?"view1":"hide1"})}),O.touched.password&&O.errors.password?h.jsx("p",{className:"form-error",children:O.errors.password}):null]}),h.jsx("div",{className:"btn-wrap pt-3 d-flex justify-content-center position-fixed bg-white border-top pt-3 pb-4 px-3",style:{bottom:0,right:0,left:0},children:h.jsx(Pt,{type:"submit",size:"lg",disabled:!O.isValid&&!g,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:l?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):!O.isValid&&!g?"Please fill out all info":"Update Password"})})]})})})]})]})})}function BWe({data:n}){const t=Ii(),[i,s]=k.useState(!1),[l,d]=k.useState(!1),[u,p]=k.useState(!1),[g,_]=k.useState(!1),[y,E]=k.useState(!1),[b,A]=k.useState("password"),[N,O]=k.useState(!1);k.useEffect(()=>{window.scrollTo(0,0)},[]);const D=()=>{A(b==="password"?"text":"password")},P=()=>{_(!1)},j=()=>{_(!0)},M=()=>{O(!1)},V=()=>{O(!0),H()};async function H(){d(!0);let ae={email:n.email,application:n.application,domain:n.domain};console.log("forgotPasswordOTP newValues = ",ae),Ai.forgotPasswordOTP(ae).then(te=>{console.log("forgotPasswordOTP Response: ",te),te.data.status==="success"&&(console.log("Success response =",te.data),Qt("OTP sent successfully!","success"),d(!1)),te.data.status==="failed"&&(console.log("Failed ERROR response : ",te.data),Qt(te.data.message,"error"),d(!1))}).catch(te=>{d(!1),te.response.data.status==="failed"&&Qt(te.response.data.message,"error"),console.log("forgotPasswordOTP Error = ",te),console.log("forgotPasswordOTP Error response = ",te.response.data)})}async function $(ae,{resetForm:te}){if(!y){console.log("Terms = ",y),Qt("Please accept Terms & Conditions.","error");return}s(!0),console.log("data from Login form = ",n),console.log("deviceID = ",localStorage.getItem("deviceID"));let de={email:n.email,password:ae.password,device:localStorage.getItem("deviceID"),application:n.application,domain:n.domain};console.log("newValues from Verify Password form = ",de),Ai.verifyAuth(de).then(G=>{var ie,_e;console.log("verifyAuth Response: ",G),G.data.status==="success"&&(console.log("Success response =",G.data),Qt(G.data.message,"success"),s(!1),Ai.setToken(G.data.data),Ai.registerDeviceForPushNotification(),((_e=(ie=G.data)==null?void 0:ie.data)==null?void 0:_e.force_change_password.toLowerCase())==="yes"?t("/profile/change-password",{state:{pageTitle:"Change Password"}}):t("/dashboard")),G.data.status==="failed"&&(console.log("Failed ERROR response : ",G.data),Qt(G.data.message,"error"),s(!1))}).catch(G=>{var ie,_e,he;s(!1),((ie=G.response)==null?void 0:ie.data.status)==="failed"&&Qt((_e=G.response)==null?void 0:_e.data.message,"error"),console.log("Verify Password Error = ",G),console.log("Verify Password Error response = ",(he=G.response)==null?void 0:he.data)})}function Q(ae){console.log("Inside handleCheckboxChange...",y),y&&E(!1),y||(E(!0),p(!0),j())}const Y={password:""},le=uc().shape({password:hf().min(6,"Password is too short").required("Please enter a valid password")});return h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"mb-5 text-center",children:h.jsx("div",{className:"secondary-text mb-4 text-center",children:h.jsx("h2",{children:"Enter Password"})})}),h.jsxs("div",{className:"form-container",children:[h.jsx(id,{initialValues:Y,validationSchema:le,onSubmit:$,children:ae=>h.jsxs(kt,{onSubmit:ae.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-3 position-relative",children:[h.jsx(kt.Label,{className:"pe-none",children:"Password"}),h.jsx(kt.Control,{type:b,placeholder:"Password",name:"password",value:ae.values.password,onBlur:ae.handleBlur,onChange:ae.handleChange,required:!0,autoComplete:"off"}),h.jsx("span",{className:"p-2 d-flex position-absolute font-22 text-gray6",style:{right:0,top:35},onClick:D,children:h.jsx(Zt,{tag:b==="password"?"view1":"hide1"})}),ae.touched.password&&ae.errors.password?h.jsx("p",{className:"form-error",children:ae.errors.password}):null]}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-2 pb-3 px-2",children:h.jsx(Pt,{type:"button",variant:"link",className:"btn-theme font-14 fw-sb text-decoration-none",onClick:V,children:h.jsx(h.Fragment,{children:"Forgot Password?"})})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center pt-3 pb-3",children:h.jsx(kt.Group,{className:"form-group mb-2 fw-sb",children:h.jsx(kt.Check,{onChange:Q,value:"test",type:"checkbox",id:"terms",label:"Terms & Conditions"})})}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Pt,{type:"submit",size:"lg",disabled:!ae.isValid&&!u,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:i?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):u?"Verify Password":"Please fill out all info"})})]})}),h.jsx(Sye,{show:g,handleClose:P,terms:n==null?void 0:n.terms}),h.jsx(FWe,{show:N,handleClose:M,data:n,loadingCode:l})]})]})})}function VWe(){Ii();const[n,t]=k.useState(!1),[i,s]=k.useState(!1),[l,d]=k.useState(null),u={domain:"",email:""},p=uc().shape({domain:hf().required("Please enter a valid URL"),email:hf().required("Please enter a valid email")});async function g(_,{resetForm:y}){t(!0);let E={..._,application:"rapport",domain:_.domain.trim()};Ai.login(E).then(b=>{var A,N,O,D,P;if(b.data.status==="success"){Qt(b.data.message,"success"),t(!1);const j={...E,...(A=b.data)==null?void 0:A.data};let M=(O=(N=b.data)==null?void 0:N.data)==null?void 0:O.login_scheme.toLowerCase();d(j),Ai.setLoginSchemeToLocal(M),s(!0)}((D=b==null?void 0:b.data)==null?void 0:D.status)==="failed"&&(console.log("Failed ERROR response : ",b.data),Qt((P=b==null?void 0:b.data)==null?void 0:P.message,"error"),t(!1),d(null),s(!1))}).catch(b=>{var A,N,O,D;t(!1),d(null),s(!1),((N=(A=b.response)==null?void 0:A.data)==null?void 0:N.status)==="failed"&&Qt((D=(O=b.response)==null?void 0:O.data)==null?void 0:D.message,"error"),console.log("Login Error = ",b)})}return h.jsxs(h.Fragment,{children:[!i&&h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"welcome-text mb-4 text-center",children:h.jsx("h1",{children:"Welcome Back!"})}),h.jsx("div",{className:"secondary-text mb-5 text-center",children:h.jsxs("h2",{children:["Sign In To Your ",h.jsx("br",{}),"Account"]})}),h.jsx("div",{className:"form-container",children:h.jsx(id,{initialValues:u,validationSchema:p,onSubmit:g,children:_=>h.jsxs(kt,{onSubmit:_.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-4 visibility-hidde opacity-",children:[h.jsx(kt.Label,{className:"pe-none",children:"Your team URL"}),h.jsx(kt.Control,{type:"text",placeholder:"Your team URL",name:"domain",value:_.values.domain,onBlur:_.handleBlur,onChange:_.handleChange,required:!0,autoComplete:"off"}),_.touched.domain&&_.errors.domain?h.jsx("p",{className:"form-error",children:_.errors.domain}):null]}),h.jsxs(kt.Group,{className:"form-group mb-4",children:[h.jsx(kt.Label,{children:"Your company email id"}),h.jsx(kt.Control,{type:"email",placeholder:"Your Company Email Id",name:"email",value:_.values.email,onBlur:_.handleBlur,onChange:_.handleChange,required:!0,autoComplete:"off"}),_.touched.email&&_.errors.email?h.jsx("p",{className:"form-error",children:_.errors.email}):null]}),h.jsx("div",{className:"btn-wrapper",children:h.jsx(Pt,{type:"submit",size:"lg",disabled:!_.isValid,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:n?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):_.isValid?"Sign in":"Please fill out all info"})})]})})})]})}),i&&(l==null?void 0:l.login_scheme)==="Password"&&h.jsx(BWe,{data:l}),i&&(l==null?void 0:l.login_scheme)==="OTP"&&h.jsx(UWe,{data:l})]})}function zWe(){return h.jsx("section",{className:"home-page-content-wrapper container-fluid d-flex",children:h.jsx(VWe,{})})}var u_e={},GQ={};function Phe(n){return n!==null&&typeof n=="object"&&"constructor"in n&&n.constructor===Object}function WQ(n,t){n===void 0&&(n={}),t===void 0&&(t={}),Object.keys(t).forEach(i=>{typeof n[i]>"u"?n[i]=t[i]:Phe(t[i])&&Phe(n[i])&&Object.keys(t[i]).length>0&&WQ(n[i],t[i])})}const h_e={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function lc(){const n=typeof document<"u"?document:{};return WQ(n,h_e),n}const HWe={document:h_e,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(n){return typeof setTimeout>"u"?(n(),null):setTimeout(n,0)},cancelAnimationFrame(n){typeof setTimeout>"u"||clearTimeout(n)}};function ea(){const n=typeof window<"u"?window:{};return WQ(n,HWe),n}function Z0(n){return n===void 0&&(n=""),n.trim().split(" ").filter(t=>!!t.trim())}function GWe(n){const t=n;Object.keys(t).forEach(i=>{try{t[i]=null}catch{}try{delete t[i]}catch{}})}function xE(n,t){return t===void 0&&(t=0),setTimeout(n,t)}function Zu(){return Date.now()}function WWe(n){const t=ea();let i;return t.getComputedStyle&&(i=t.getComputedStyle(n,null)),!i&&n.currentStyle&&(i=n.currentStyle),i||(i=n.style),i}function qq(n,t){t===void 0&&(t="x");const i=ea();let s,l,d;const u=WWe(n);return i.WebKitCSSMatrix?(l=u.transform||u.webkitTransform,l.split(",").length>6&&(l=l.split(", ").map(p=>p.replace(",",".")).join(", ")),d=new i.WebKitCSSMatrix(l==="none"?"":l)):(d=u.MozTransform||u.OTransform||u.MsTransform||u.msTransform||u.transform||u.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),s=d.toString().split(",")),t==="x"&&(i.WebKitCSSMatrix?l=d.m41:s.length===16?l=parseFloat(s[12]):l=parseFloat(s[4])),t==="y"&&(i.WebKitCSSMatrix?l=d.m42:s.length===16?l=parseFloat(s[13]):l=parseFloat(s[5])),l||0}function PI(n){return typeof n=="object"&&n!==null&&n.constructor&&Object.prototype.toString.call(n).slice(8,-1)==="Object"}function $We(n){return typeof window<"u"&&typeof window.HTMLElement<"u"?n instanceof HTMLElement:n&&(n.nodeType===1||n.nodeType===11)}function Vd(){const n=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let i=1;i<arguments.length;i+=1){const s=i<0||arguments.length<=i?void 0:arguments[i];if(s!=null&&!$We(s)){const l=Object.keys(Object(s)).filter(d=>t.indexOf(d)<0);for(let d=0,u=l.length;d<u;d+=1){const p=l[d],g=Object.getOwnPropertyDescriptor(s,p);g!==void 0&&g.enumerable&&(PI(n[p])&&PI(s[p])?s[p].__swiper__?n[p]=s[p]:Vd(n[p],s[p]):!PI(n[p])&&PI(s[p])?(n[p]={},s[p].__swiper__?n[p]=s[p]:Vd(n[p],s[p])):n[p]=s[p])}}}return n}function LI(n,t,i){n.style.setProperty(t,i)}function f_e(n){let{swiper:t,targetPosition:i,side:s}=n;const l=ea(),d=-t.translate;let u=null,p;const g=t.params.speed;t.wrapperEl.style.scrollSnapType="none",l.cancelAnimationFrame(t.cssModeFrameID);const _=i>d?"next":"prev",y=(b,A)=>_==="next"&&b>=A||_==="prev"&&b<=A,E=()=>{p=new Date().getTime(),u===null&&(u=p);const b=Math.max(Math.min((p-u)/g,1),0),A=.5-Math.cos(b*Math.PI)/2;let N=d+A*(i-d);if(y(N,i)&&(N=i),t.wrapperEl.scrollTo({[s]:N}),y(N,i)){t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[s]:N})}),l.cancelAnimationFrame(t.cssModeFrameID);return}t.cssModeFrameID=l.requestAnimationFrame(E)};E()}function qE(n){return n.querySelector(".swiper-slide-transform")||n.shadowRoot&&n.shadowRoot.querySelector(".swiper-slide-transform")||n}function $o(n,t){return t===void 0&&(t=""),[...n.children].filter(i=>i.matches(t))}function b7(n){try{console.warn(n);return}catch{}}function Kd(n,t){t===void 0&&(t=[]);const i=document.createElement(n);return i.classList.add(...Array.isArray(t)?t:Z0(t)),i}function C7(n){const t=ea(),i=lc(),s=n.getBoundingClientRect(),l=i.body,d=n.clientTop||l.clientTop||0,u=n.clientLeft||l.clientLeft||0,p=n===t?t.scrollY:n.scrollTop,g=n===t?t.scrollX:n.scrollLeft;return{top:s.top+p-d,left:s.left+g-u}}function KWe(n,t){const i=[];for(;n.previousElementSibling;){const s=n.previousElementSibling;t?s.matches(t)&&i.push(s):i.push(s),n=s}return i}function qWe(n,t){const i=[];for(;n.nextElementSibling;){const s=n.nextElementSibling;t?s.matches(t)&&i.push(s):i.push(s),n=s}return i}function mv(n,t){return ea().getComputedStyle(n,null).getPropertyValue(t)}function q4(n){let t=n,i;if(t){for(i=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(i+=1);return i}}function vE(n,t){const i=[];let s=n.parentElement;for(;s;)t?s.matches(t)&&i.push(s):i.push(s),s=s.parentElement;return i}function m4(n,t){function i(s){s.target===n&&(t.call(n,s),n.removeEventListener("transitionend",i))}t&&n.addEventListener("transitionend",i)}function Yq(n,t,i){const s=ea();return i?n[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(s.getComputedStyle(n,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(s.getComputedStyle(n,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom")):n.offsetWidth}function lr(n){return(Array.isArray(n)?n:[n]).filter(t=>!!t)}let H$;function YWe(){const n=ea(),t=lc();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in n||n.DocumentTouch&&t instanceof n.DocumentTouch)}}function p_e(){return H$||(H$=YWe()),H$}let G$;function XWe(n){let{userAgent:t}=n===void 0?{}:n;const i=p_e(),s=ea(),l=s.navigator.platform,d=t||s.navigator.userAgent,u={ios:!1,android:!1},p=s.screen.width,g=s.screen.height,_=d.match(/(Android);?[\s\/]+([\d.]+)?/);let y=d.match(/(iPad).*OS\s([\d_]+)/);const E=d.match(/(iPod)(.*OS\s([\d_]+))?/),b=!y&&d.match(/(iPhone\sOS|iOS)\s([\d_]+)/),A=l==="Win32";let N=l==="MacIntel";const O=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!y&&N&&i.touch&&O.indexOf(`${p}x${g}`)>=0&&(y=d.match(/(Version)\/([\d.]+)/),y||(y=[0,1,"13_0_0"]),N=!1),_&&!A&&(u.os="android",u.android=!0),(y||b||E)&&(u.os="ios",u.ios=!0),u}function m_e(n){return n===void 0&&(n={}),G$||(G$=XWe(n)),G$}let W$;function JWe(){const n=ea(),t=m_e();let i=!1;function s(){const p=n.navigator.userAgent.toLowerCase();return p.indexOf("safari")>=0&&p.indexOf("chrome")<0&&p.indexOf("android")<0}if(s()){const p=String(n.navigator.userAgent);if(p.includes("Version/")){const[g,_]=p.split("Version/")[1].split(" ")[0].split(".").map(y=>Number(y));i=g<16||g===16&&_<2}}const l=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(n.navigator.userAgent),d=s(),u=d||l&&t.ios;return{isSafari:i||d,needPerspectiveFix:i,need3dFix:u,isWebView:l}}function QWe(){return W$||(W$=JWe()),W$}function ZWe(n){let{swiper:t,on:i,emit:s}=n;const l=ea();let d=null,u=null;const p=()=>{!t||t.destroyed||!t.initialized||(s("beforeResize"),s("resize"))},g=()=>{!t||t.destroyed||!t.initialized||(d=new ResizeObserver(E=>{u=l.requestAnimationFrame(()=>{const{width:b,height:A}=t;let N=b,O=A;E.forEach(D=>{let{contentBoxSize:P,contentRect:j,target:M}=D;M&&M!==t.el||(N=j?j.width:(P[0]||P).inlineSize,O=j?j.height:(P[0]||P).blockSize)}),(N!==b||O!==A)&&p()})}),d.observe(t.el))},_=()=>{u&&l.cancelAnimationFrame(u),d&&d.unobserve&&t.el&&(d.unobserve(t.el),d=null)},y=()=>{!t||t.destroyed||!t.initialized||s("orientationchange")};i("init",()=>{if(t.params.resizeObserver&&typeof l.ResizeObserver<"u"){g();return}l.addEventListener("resize",p),l.addEventListener("orientationchange",y)}),i("destroy",()=>{_(),l.removeEventListener("resize",p),l.removeEventListener("orientationchange",y)})}function e$e(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=[],u=ea(),p=function(y,E){E===void 0&&(E={});const b=u.MutationObserver||u.WebkitMutationObserver,A=new b(N=>{if(t.__preventObserver__)return;if(N.length===1){l("observerUpdate",N[0]);return}const O=function(){l("observerUpdate",N[0])};u.requestAnimationFrame?u.requestAnimationFrame(O):u.setTimeout(O,0)});A.observe(y,{attributes:typeof E.attributes>"u"?!0:E.attributes,childList:typeof E.childList>"u"?!0:E.childList,characterData:typeof E.characterData>"u"?!0:E.characterData}),d.push(A)},g=()=>{if(t.params.observer){if(t.params.observeParents){const y=vE(t.hostEl);for(let E=0;E<y.length;E+=1)p(y[E])}p(t.hostEl,{childList:t.params.observeSlideChildren}),p(t.wrapperEl,{attributes:!1})}},_=()=>{d.forEach(y=>{y.disconnect()}),d.splice(0,d.length)};i({observer:!1,observeParents:!1,observeSlideChildren:!1}),s("init",g),s("destroy",_)}var t$e={on(n,t,i){const s=this;if(!s.eventsListeners||s.destroyed||typeof t!="function")return s;const l=i?"unshift":"push";return n.split(" ").forEach(d=>{s.eventsListeners[d]||(s.eventsListeners[d]=[]),s.eventsListeners[d][l](t)}),s},once(n,t,i){const s=this;if(!s.eventsListeners||s.destroyed||typeof t!="function")return s;function l(){s.off(n,l),l.__emitterProxy&&delete l.__emitterProxy;for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];t.apply(s,u)}return l.__emitterProxy=t,s.on(n,l,i)},onAny(n,t){const i=this;if(!i.eventsListeners||i.destroyed||typeof n!="function")return i;const s=t?"unshift":"push";return i.eventsAnyListeners.indexOf(n)<0&&i.eventsAnyListeners[s](n),i},offAny(n){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const i=t.eventsAnyListeners.indexOf(n);return i>=0&&t.eventsAnyListeners.splice(i,1),t},off(n,t){const i=this;return!i.eventsListeners||i.destroyed||!i.eventsListeners||n.split(" ").forEach(s=>{typeof t>"u"?i.eventsListeners[s]=[]:i.eventsListeners[s]&&i.eventsListeners[s].forEach((l,d)=>{(l===t||l.__emitterProxy&&l.__emitterProxy===t)&&i.eventsListeners[s].splice(d,1)})}),i},emit(){const n=this;if(!n.eventsListeners||n.destroyed||!n.eventsListeners)return n;let t,i,s;for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];return typeof d[0]=="string"||Array.isArray(d[0])?(t=d[0],i=d.slice(1,d.length),s=n):(t=d[0].events,i=d[0].data,s=d[0].context||n),i.unshift(s),(Array.isArray(t)?t:t.split(" ")).forEach(g=>{n.eventsAnyListeners&&n.eventsAnyListeners.length&&n.eventsAnyListeners.forEach(_=>{_.apply(s,[g,...i])}),n.eventsListeners&&n.eventsListeners[g]&&n.eventsListeners[g].forEach(_=>{_.apply(s,i)})}),n}};function n$e(){const n=this;let t,i;const s=n.el;typeof n.params.width<"u"&&n.params.width!==null?t=n.params.width:t=s.clientWidth,typeof n.params.height<"u"&&n.params.height!==null?i=n.params.height:i=s.clientHeight,!(t===0&&n.isHorizontal()||i===0&&n.isVertical())&&(t=t-parseInt(mv(s,"padding-left")||0,10)-parseInt(mv(s,"padding-right")||0,10),i=i-parseInt(mv(s,"padding-top")||0,10)-parseInt(mv(s,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(i)&&(i=0),Object.assign(n,{width:t,height:i,size:n.isHorizontal()?t:i}))}function i$e(){const n=this;function t(ae,te){return parseFloat(ae.getPropertyValue(n.getDirectionLabel(te))||0)}const i=n.params,{wrapperEl:s,slidesEl:l,size:d,rtlTranslate:u,wrongRTL:p}=n,g=n.virtual&&i.virtual.enabled,_=g?n.virtual.slides.length:n.slides.length,y=$o(l,`.${n.params.slideClass}, swiper-slide`),E=g?n.virtual.slides.length:y.length;let b=[];const A=[],N=[];let O=i.slidesOffsetBefore;typeof O=="function"&&(O=i.slidesOffsetBefore.call(n));let D=i.slidesOffsetAfter;typeof D=="function"&&(D=i.slidesOffsetAfter.call(n));const P=n.snapGrid.length,j=n.slidesGrid.length;let M=i.spaceBetween,V=-O,H=0,$=0;if(typeof d>"u")return;typeof M=="string"&&M.indexOf("%")>=0?M=parseFloat(M.replace("%",""))/100*d:typeof M=="string"&&(M=parseFloat(M)),n.virtualSize=-M,y.forEach(ae=>{u?ae.style.marginLeft="":ae.style.marginRight="",ae.style.marginBottom="",ae.style.marginTop=""}),i.centeredSlides&&i.cssMode&&(LI(s,"--swiper-centered-offset-before",""),LI(s,"--swiper-centered-offset-after",""));const Q=i.grid&&i.grid.rows>1&&n.grid;Q?n.grid.initSlides(y):n.grid&&n.grid.unsetSlides();let Y;const le=i.slidesPerView==="auto"&&i.breakpoints&&Object.keys(i.breakpoints).filter(ae=>typeof i.breakpoints[ae].slidesPerView<"u").length>0;for(let ae=0;ae<E;ae+=1){Y=0;let te;if(y[ae]&&(te=y[ae]),Q&&n.grid.updateSlide(ae,te,y),!(y[ae]&&mv(te,"display")==="none")){if(i.slidesPerView==="auto"){le&&(y[ae].style[n.getDirectionLabel("width")]="");const de=getComputedStyle(te),G=te.style.transform,ie=te.style.webkitTransform;if(G&&(te.style.transform="none"),ie&&(te.style.webkitTransform="none"),i.roundLengths)Y=n.isHorizontal()?Yq(te,"width",!0):Yq(te,"height",!0);else{const _e=t(de,"width"),he=t(de,"padding-left"),Ce=t(de,"padding-right"),fe=t(de,"margin-left"),me=t(de,"margin-right"),Ne=de.getPropertyValue("box-sizing");if(Ne&&Ne==="border-box")Y=_e+fe+me;else{const{clientWidth:Fe,offsetWidth:je}=te;Y=_e+he+Ce+fe+me+(je-Fe)}}G&&(te.style.transform=G),ie&&(te.style.webkitTransform=ie),i.roundLengths&&(Y=Math.floor(Y))}else Y=(d-(i.slidesPerView-1)*M)/i.slidesPerView,i.roundLengths&&(Y=Math.floor(Y)),y[ae]&&(y[ae].style[n.getDirectionLabel("width")]=`${Y}px`);y[ae]&&(y[ae].swiperSlideSize=Y),N.push(Y),i.centeredSlides?(V=V+Y/2+H/2+M,H===0&&ae!==0&&(V=V-d/2-M),ae===0&&(V=V-d/2-M),Math.abs(V)<1/1e3&&(V=0),i.roundLengths&&(V=Math.floor(V)),$%i.slidesPerGroup===0&&b.push(V),A.push(V)):(i.roundLengths&&(V=Math.floor(V)),($-Math.min(n.params.slidesPerGroupSkip,$))%n.params.slidesPerGroup===0&&b.push(V),A.push(V),V=V+Y+M),n.virtualSize+=Y+M,H=Y,$+=1}}if(n.virtualSize=Math.max(n.virtualSize,d)+D,u&&p&&(i.effect==="slide"||i.effect==="coverflow")&&(s.style.width=`${n.virtualSize+M}px`),i.setWrapperSize&&(s.style[n.getDirectionLabel("width")]=`${n.virtualSize+M}px`),Q&&n.grid.updateWrapperSize(Y,b),!i.centeredSlides){const ae=[];for(let te=0;te<b.length;te+=1){let de=b[te];i.roundLengths&&(de=Math.floor(de)),b[te]<=n.virtualSize-d&&ae.push(de)}b=ae,Math.floor(n.virtualSize-d)-Math.floor(b[b.length-1])>1&&b.push(n.virtualSize-d)}if(g&&i.loop){const ae=N[0]+M;if(i.slidesPerGroup>1){const te=Math.ceil((n.virtual.slidesBefore+n.virtual.slidesAfter)/i.slidesPerGroup),de=ae*i.slidesPerGroup;for(let G=0;G<te;G+=1)b.push(b[b.length-1]+de)}for(let te=0;te<n.virtual.slidesBefore+n.virtual.slidesAfter;te+=1)i.slidesPerGroup===1&&b.push(b[b.length-1]+ae),A.push(A[A.length-1]+ae),n.virtualSize+=ae}if(b.length===0&&(b=[0]),M!==0){const ae=n.isHorizontal()&&u?"marginLeft":n.getDirectionLabel("marginRight");y.filter((te,de)=>!i.cssMode||i.loop?!0:de!==y.length-1).forEach(te=>{te.style[ae]=`${M}px`})}if(i.centeredSlides&&i.centeredSlidesBounds){let ae=0;N.forEach(de=>{ae+=de+(M||0)}),ae-=M;const te=ae-d;b=b.map(de=>de<=0?-O:de>te?te+D:de)}if(i.centerInsufficientSlides){let ae=0;if(N.forEach(te=>{ae+=te+(M||0)}),ae-=M,ae<d){const te=(d-ae)/2;b.forEach((de,G)=>{b[G]=de-te}),A.forEach((de,G)=>{A[G]=de+te})}}if(Object.assign(n,{slides:y,snapGrid:b,slidesGrid:A,slidesSizesGrid:N}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){LI(s,"--swiper-centered-offset-before",`${-b[0]}px`),LI(s,"--swiper-centered-offset-after",`${n.size/2-N[N.length-1]/2}px`);const ae=-n.snapGrid[0],te=-n.slidesGrid[0];n.snapGrid=n.snapGrid.map(de=>de+ae),n.slidesGrid=n.slidesGrid.map(de=>de+te)}if(E!==_&&n.emit("slidesLengthChange"),b.length!==P&&(n.params.watchOverflow&&n.checkOverflow(),n.emit("snapGridLengthChange")),A.length!==j&&n.emit("slidesGridLengthChange"),i.watchSlidesProgress&&n.updateSlidesOffset(),n.emit("slidesUpdated"),!g&&!i.cssMode&&(i.effect==="slide"||i.effect==="fade")){const ae=`${i.containerModifierClass}backface-hidden`,te=n.el.classList.contains(ae);E<=i.maxBackfaceHiddenSlides?te||n.el.classList.add(ae):te&&n.el.classList.remove(ae)}}function r$e(n){const t=this,i=[],s=t.virtual&&t.params.virtual.enabled;let l=0,d;typeof n=="number"?t.setTransition(n):n===!0&&t.setTransition(t.params.speed);const u=p=>s?t.slides[t.getSlideIndexByData(p)]:t.slides[p];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(p=>{i.push(p)});else for(d=0;d<Math.ceil(t.params.slidesPerView);d+=1){const p=t.activeIndex+d;if(p>t.slides.length&&!s)break;i.push(u(p))}else i.push(u(t.activeIndex));for(d=0;d<i.length;d+=1)if(typeof i[d]<"u"){const p=i[d].offsetHeight;l=p>l?p:l}(l||l===0)&&(t.wrapperEl.style.height=`${l}px`)}function s$e(){const n=this,t=n.slides,i=n.isElement?n.isHorizontal()?n.wrapperEl.offsetLeft:n.wrapperEl.offsetTop:0;for(let s=0;s<t.length;s+=1)t[s].swiperSlideOffset=(n.isHorizontal()?t[s].offsetLeft:t[s].offsetTop)-i-n.cssOverflowAdjustment()}function a$e(n){n===void 0&&(n=this&&this.translate||0);const t=this,i=t.params,{slides:s,rtlTranslate:l,snapGrid:d}=t;if(s.length===0)return;typeof s[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let u=-n;l&&(u=n),s.forEach(g=>{g.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass)}),t.visibleSlidesIndexes=[],t.visibleSlides=[];let p=i.spaceBetween;typeof p=="string"&&p.indexOf("%")>=0?p=parseFloat(p.replace("%",""))/100*t.size:typeof p=="string"&&(p=parseFloat(p));for(let g=0;g<s.length;g+=1){const _=s[g];let y=_.swiperSlideOffset;i.cssMode&&i.centeredSlides&&(y-=s[0].swiperSlideOffset);const E=(u+(i.centeredSlides?t.minTranslate():0)-y)/(_.swiperSlideSize+p),b=(u-d[0]+(i.centeredSlides?t.minTranslate():0)-y)/(_.swiperSlideSize+p),A=-(u-y),N=A+t.slidesSizesGrid[g],O=A>=0&&A<=t.size-t.slidesSizesGrid[g];(A>=0&&A<t.size-1||N>1&&N<=t.size||A<=0&&N>=t.size)&&(t.visibleSlides.push(_),t.visibleSlidesIndexes.push(g),s[g].classList.add(i.slideVisibleClass)),O&&s[g].classList.add(i.slideFullyVisibleClass),_.progress=l?-E:E,_.originalProgress=l?-b:b}}function o$e(n){const t=this;if(typeof n>"u"){const y=t.rtlTranslate?-1:1;n=t&&t.translate&&t.translate*y||0}const i=t.params,s=t.maxTranslate()-t.minTranslate();let{progress:l,isBeginning:d,isEnd:u,progressLoop:p}=t;const g=d,_=u;if(s===0)l=0,d=!0,u=!0;else{l=(n-t.minTranslate())/s;const y=Math.abs(n-t.minTranslate())<1,E=Math.abs(n-t.maxTranslate())<1;d=y||l<=0,u=E||l>=1,y&&(l=0),E&&(l=1)}if(i.loop){const y=t.getSlideIndexByData(0),E=t.getSlideIndexByData(t.slides.length-1),b=t.slidesGrid[y],A=t.slidesGrid[E],N=t.slidesGrid[t.slidesGrid.length-1],O=Math.abs(n);O>=b?p=(O-b)/N:p=(O+N-A)/N,p>1&&(p-=1)}Object.assign(t,{progress:l,progressLoop:p,isBeginning:d,isEnd:u}),(i.watchSlidesProgress||i.centeredSlides&&i.autoHeight)&&t.updateSlidesProgress(n),d&&!g&&t.emit("reachBeginning toEdge"),u&&!_&&t.emit("reachEnd toEdge"),(g&&!d||_&&!u)&&t.emit("fromEdge"),t.emit("progress",l)}function l$e(){const n=this,{slides:t,params:i,slidesEl:s,activeIndex:l}=n,d=n.virtual&&i.virtual.enabled,u=n.grid&&i.grid&&i.grid.rows>1,p=E=>$o(s,`.${i.slideClass}${E}, swiper-slide${E}`)[0];t.forEach(E=>{E.classList.remove(i.slideActiveClass,i.slideNextClass,i.slidePrevClass)});let g,_,y;if(d)if(i.loop){let E=l-n.virtual.slidesBefore;E<0&&(E=n.virtual.slides.length+E),E>=n.virtual.slides.length&&(E-=n.virtual.slides.length),g=p(`[data-swiper-slide-index="${E}"]`)}else g=p(`[data-swiper-slide-index="${l}"]`);else u?(g=t.filter(E=>E.column===l)[0],y=t.filter(E=>E.column===l+1)[0],_=t.filter(E=>E.column===l-1)[0]):g=t[l];g&&(g.classList.add(i.slideActiveClass),u?(y&&y.classList.add(i.slideNextClass),_&&_.classList.add(i.slidePrevClass)):(y=qWe(g,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!y&&(y=t[0]),y&&y.classList.add(i.slideNextClass),_=KWe(g,`.${i.slideClass}, swiper-slide`)[0],i.loop&&!_===0&&(_=t[t.length-1]),_&&_.classList.add(i.slidePrevClass))),n.emitSlidesClasses()}const tM=(n,t)=>{if(!n||n.destroyed||!n.params)return;const i=()=>n.isElement?"swiper-slide":`.${n.params.slideClass}`,s=t.closest(i());if(s){let l=s.querySelector(`.${n.params.lazyPreloaderClass}`);!l&&n.isElement&&(s.shadowRoot?l=s.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{s.shadowRoot&&(l=s.shadowRoot.querySelector(`.${n.params.lazyPreloaderClass}`),l&&l.remove())})),l&&l.remove()}},$$=(n,t)=>{if(!n.slides[t])return;const i=n.slides[t].querySelector('[loading="lazy"]');i&&i.removeAttribute("loading")},Xq=n=>{if(!n||n.destroyed||!n.params)return;let t=n.params.lazyPreloadPrevNext;const i=n.slides.length;if(!i||!t||t<0)return;t=Math.min(t,i);const s=n.params.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(n.params.slidesPerView),l=n.activeIndex;if(n.params.grid&&n.params.grid.rows>1){const u=l,p=[u-t];p.push(...Array.from({length:t}).map((g,_)=>u+s+_)),n.slides.forEach((g,_)=>{p.includes(g.column)&&$$(n,_)});return}const d=l+s-1;if(n.params.rewind||n.params.loop)for(let u=l-t;u<=d+t;u+=1){const p=(u%i+i)%i;(p<l||p>d)&&$$(n,p)}else for(let u=Math.max(l-t,0);u<=Math.min(d+t,i-1);u+=1)u!==l&&(u>d||u<l)&&$$(n,u)};function c$e(n){const{slidesGrid:t,params:i}=n,s=n.rtlTranslate?n.translate:-n.translate;let l;for(let d=0;d<t.length;d+=1)typeof t[d+1]<"u"?s>=t[d]&&s<t[d+1]-(t[d+1]-t[d])/2?l=d:s>=t[d]&&s<t[d+1]&&(l=d+1):s>=t[d]&&(l=d);return i.normalizeSlideIndex&&(l<0||typeof l>"u")&&(l=0),l}function d$e(n){const t=this,i=t.rtlTranslate?t.translate:-t.translate,{snapGrid:s,params:l,activeIndex:d,realIndex:u,snapIndex:p}=t;let g=n,_;const y=A=>{let N=A-t.virtual.slidesBefore;return N<0&&(N=t.virtual.slides.length+N),N>=t.virtual.slides.length&&(N-=t.virtual.slides.length),N};if(typeof g>"u"&&(g=c$e(t)),s.indexOf(i)>=0)_=s.indexOf(i);else{const A=Math.min(l.slidesPerGroupSkip,g);_=A+Math.floor((g-A)/l.slidesPerGroup)}if(_>=s.length&&(_=s.length-1),g===d&&!t.params.loop){_!==p&&(t.snapIndex=_,t.emit("snapIndexChange"));return}if(g===d&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=y(g);return}const E=t.grid&&l.grid&&l.grid.rows>1;let b;if(t.virtual&&l.virtual.enabled&&l.loop)b=y(g);else if(E){const A=t.slides.filter(O=>O.column===g)[0];let N=parseInt(A.getAttribute("data-swiper-slide-index"),10);Number.isNaN(N)&&(N=Math.max(t.slides.indexOf(A),0)),b=Math.floor(N/l.grid.rows)}else if(t.slides[g]){const A=t.slides[g].getAttribute("data-swiper-slide-index");A?b=parseInt(A,10):b=g}else b=g;Object.assign(t,{previousSnapIndex:p,snapIndex:_,previousRealIndex:u,realIndex:b,previousIndex:d,activeIndex:g}),t.initialized&&Xq(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(u!==b&&t.emit("realIndexChange"),t.emit("slideChange"))}function u$e(n,t){const i=this,s=i.params;let l=n.closest(`.${s.slideClass}, swiper-slide`);!l&&i.isElement&&t&&t.length>1&&t.includes(n)&&[...t.slice(t.indexOf(n)+1,t.length)].forEach(p=>{!l&&p.matches&&p.matches(`.${s.slideClass}, swiper-slide`)&&(l=p)});let d=!1,u;if(l){for(let p=0;p<i.slides.length;p+=1)if(i.slides[p]===l){d=!0,u=p;break}}if(l&&d)i.clickedSlide=l,i.virtual&&i.params.virtual.enabled?i.clickedIndex=parseInt(l.getAttribute("data-swiper-slide-index"),10):i.clickedIndex=u;else{i.clickedSlide=void 0,i.clickedIndex=void 0;return}s.slideToClickedSlide&&i.clickedIndex!==void 0&&i.clickedIndex!==i.activeIndex&&i.slideToClickedSlide()}var h$e={updateSize:n$e,updateSlides:i$e,updateAutoHeight:r$e,updateSlidesOffset:s$e,updateSlidesProgress:a$e,updateProgress:o$e,updateSlidesClasses:l$e,updateActiveIndex:d$e,updateClickedSlide:u$e};function f$e(n){n===void 0&&(n=this.isHorizontal()?"x":"y");const t=this,{params:i,rtlTranslate:s,translate:l,wrapperEl:d}=t;if(i.virtualTranslate)return s?-l:l;if(i.cssMode)return l;let u=qq(d,n);return u+=t.cssOverflowAdjustment(),s&&(u=-u),u||0}function p$e(n,t){const i=this,{rtlTranslate:s,params:l,wrapperEl:d,progress:u}=i;let p=0,g=0;const _=0;i.isHorizontal()?p=s?-n:n:g=n,l.roundLengths&&(p=Math.floor(p),g=Math.floor(g)),i.previousTranslate=i.translate,i.translate=i.isHorizontal()?p:g,l.cssMode?d[i.isHorizontal()?"scrollLeft":"scrollTop"]=i.isHorizontal()?-p:-g:l.virtualTranslate||(i.isHorizontal()?p-=i.cssOverflowAdjustment():g-=i.cssOverflowAdjustment(),d.style.transform=`translate3d(${p}px, ${g}px, ${_}px)`);let y;const E=i.maxTranslate()-i.minTranslate();E===0?y=0:y=(n-i.minTranslate())/E,y!==u&&i.updateProgress(n),i.emit("setTranslate",i.translate,t)}function m$e(){return-this.snapGrid[0]}function g$e(){return-this.snapGrid[this.snapGrid.length-1]}function v$e(n,t,i,s,l){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),s===void 0&&(s=!0);const d=this,{params:u,wrapperEl:p}=d;if(d.animating&&u.preventInteractionOnTransition)return!1;const g=d.minTranslate(),_=d.maxTranslate();let y;if(s&&n>g?y=g:s&&n<_?y=_:y=n,d.updateProgress(y),u.cssMode){const E=d.isHorizontal();if(t===0)p[E?"scrollLeft":"scrollTop"]=-y;else{if(!d.support.smoothScroll)return f_e({swiper:d,targetPosition:-y,side:E?"left":"top"}),!0;p.scrollTo({[E?"left":"top"]:-y,behavior:"smooth"})}return!0}return t===0?(d.setTransition(0),d.setTranslate(y),i&&(d.emit("beforeTransitionStart",t,l),d.emit("transitionEnd"))):(d.setTransition(t),d.setTranslate(y),i&&(d.emit("beforeTransitionStart",t,l),d.emit("transitionStart")),d.animating||(d.animating=!0,d.onTranslateToWrapperTransitionEnd||(d.onTranslateToWrapperTransitionEnd=function(b){!d||d.destroyed||b.target===this&&(d.wrapperEl.removeEventListener("transitionend",d.onTranslateToWrapperTransitionEnd),d.onTranslateToWrapperTransitionEnd=null,delete d.onTranslateToWrapperTransitionEnd,i&&d.emit("transitionEnd"))}),d.wrapperEl.addEventListener("transitionend",d.onTranslateToWrapperTransitionEnd))),!0}var y$e={getTranslate:f$e,setTranslate:p$e,minTranslate:m$e,maxTranslate:g$e,translateTo:v$e};function _$e(n,t){const i=this;i.params.cssMode||(i.wrapperEl.style.transitionDuration=`${n}ms`,i.wrapperEl.style.transitionDelay=n===0?"0ms":""),i.emit("setTransition",n,t)}function g_e(n){let{swiper:t,runCallbacks:i,direction:s,step:l}=n;const{activeIndex:d,previousIndex:u}=t;let p=s;if(p||(d>u?p="next":d<u?p="prev":p="reset"),t.emit(`transition${l}`),i&&d!==u){if(p==="reset"){t.emit(`slideResetTransition${l}`);return}t.emit(`slideChangeTransition${l}`),p==="next"?t.emit(`slideNextTransition${l}`):t.emit(`slidePrevTransition${l}`)}}function E$e(n,t){n===void 0&&(n=!0);const i=this,{params:s}=i;s.cssMode||(s.autoHeight&&i.updateAutoHeight(),g_e({swiper:i,runCallbacks:n,direction:t,step:"Start"}))}function w$e(n,t){n===void 0&&(n=!0);const i=this,{params:s}=i;i.animating=!1,!s.cssMode&&(i.setTransition(0),g_e({swiper:i,runCallbacks:n,direction:t,step:"End"}))}var S$e={setTransition:_$e,transitionStart:E$e,transitionEnd:w$e};function b$e(n,t,i,s,l){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),typeof n=="string"&&(n=parseInt(n,10));const d=this;let u=n;u<0&&(u=0);const{params:p,snapGrid:g,slidesGrid:_,previousIndex:y,activeIndex:E,rtlTranslate:b,wrapperEl:A,enabled:N}=d;if(d.animating&&p.preventInteractionOnTransition||!N&&!s&&!l||d.destroyed)return!1;const O=Math.min(d.params.slidesPerGroupSkip,u);let D=O+Math.floor((u-O)/d.params.slidesPerGroup);D>=g.length&&(D=g.length-1);const P=-g[D];if(p.normalizeSlideIndex)for(let M=0;M<_.length;M+=1){const V=-Math.floor(P*100),H=Math.floor(_[M]*100),$=Math.floor(_[M+1]*100);typeof _[M+1]<"u"?V>=H&&V<$-($-H)/2?u=M:V>=H&&V<$&&(u=M+1):V>=H&&(u=M)}if(d.initialized&&u!==E&&(!d.allowSlideNext&&(b?P>d.translate&&P>d.minTranslate():P<d.translate&&P<d.minTranslate())||!d.allowSlidePrev&&P>d.translate&&P>d.maxTranslate()&&(E||0)!==u))return!1;u!==(y||0)&&i&&d.emit("beforeSlideChangeStart"),d.updateProgress(P);let j;if(u>E?j="next":u<E?j="prev":j="reset",b&&-P===d.translate||!b&&P===d.translate)return d.updateActiveIndex(u),p.autoHeight&&d.updateAutoHeight(),d.updateSlidesClasses(),p.effect!=="slide"&&d.setTranslate(P),j!=="reset"&&(d.transitionStart(i,j),d.transitionEnd(i,j)),!1;if(p.cssMode){const M=d.isHorizontal(),V=b?P:-P;if(t===0){const H=d.virtual&&d.params.virtual.enabled;H&&(d.wrapperEl.style.scrollSnapType="none",d._immediateVirtual=!0),H&&!d._cssModeVirtualInitialSet&&d.params.initialSlide>0?(d._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{A[M?"scrollLeft":"scrollTop"]=V})):A[M?"scrollLeft":"scrollTop"]=V,H&&requestAnimationFrame(()=>{d.wrapperEl.style.scrollSnapType="",d._immediateVirtual=!1})}else{if(!d.support.smoothScroll)return f_e({swiper:d,targetPosition:V,side:M?"left":"top"}),!0;A.scrollTo({[M?"left":"top"]:V,behavior:"smooth"})}return!0}return d.setTransition(t),d.setTranslate(P),d.updateActiveIndex(u),d.updateSlidesClasses(),d.emit("beforeTransitionStart",t,s),d.transitionStart(i,j),t===0?d.transitionEnd(i,j):d.animating||(d.animating=!0,d.onSlideToWrapperTransitionEnd||(d.onSlideToWrapperTransitionEnd=function(V){!d||d.destroyed||V.target===this&&(d.wrapperEl.removeEventListener("transitionend",d.onSlideToWrapperTransitionEnd),d.onSlideToWrapperTransitionEnd=null,delete d.onSlideToWrapperTransitionEnd,d.transitionEnd(i,j))}),d.wrapperEl.addEventListener("transitionend",d.onSlideToWrapperTransitionEnd)),!0}function C$e(n,t,i,s){n===void 0&&(n=0),t===void 0&&(t=this.params.speed),i===void 0&&(i=!0),typeof n=="string"&&(n=parseInt(n,10));const l=this;if(l.destroyed)return;const d=l.grid&&l.params.grid&&l.params.grid.rows>1;let u=n;if(l.params.loop)if(l.virtual&&l.params.virtual.enabled)u=u+l.virtual.slidesBefore;else{let p;if(d){const b=u*l.params.grid.rows;p=l.slides.filter(A=>A.getAttribute("data-swiper-slide-index")*1===b)[0].column}else p=l.getSlideIndexByData(u);const g=d?Math.ceil(l.slides.length/l.params.grid.rows):l.slides.length,{centeredSlides:_}=l.params;let y=l.params.slidesPerView;y==="auto"?y=l.slidesPerViewDynamic():(y=Math.ceil(parseFloat(l.params.slidesPerView,10)),_&&y%2===0&&(y=y+1));let E=g-p<y;if(_&&(E=E||p<Math.ceil(y/2)),E){const b=_?p<l.activeIndex?"prev":"next":p-l.activeIndex-1<l.params.slidesPerView?"next":"prev";l.loopFix({direction:b,slideTo:!0,activeSlideIndex:b==="next"?p+1:p-g+1,slideRealIndex:b==="next"?l.realIndex:void 0})}if(d){const b=u*l.params.grid.rows;u=l.slides.filter(A=>A.getAttribute("data-swiper-slide-index")*1===b)[0].column}else u=l.getSlideIndexByData(u)}return requestAnimationFrame(()=>{l.slideTo(u,t,i,s)}),l}function T$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this,{enabled:l,params:d,animating:u}=s;if(!l||s.destroyed)return s;let p=d.slidesPerGroup;d.slidesPerView==="auto"&&d.slidesPerGroup===1&&d.slidesPerGroupAuto&&(p=Math.max(s.slidesPerViewDynamic("current",!0),1));const g=s.activeIndex<d.slidesPerGroupSkip?1:p,_=s.virtual&&d.virtual.enabled;if(d.loop){if(u&&!_&&d.loopPreventsSliding)return!1;if(s.loopFix({direction:"next"}),s._clientLeft=s.wrapperEl.clientLeft,s.activeIndex===s.slides.length-1&&d.cssMode)return requestAnimationFrame(()=>{s.slideTo(s.activeIndex+g,n,t,i)}),!0}return d.rewind&&s.isEnd?s.slideTo(0,n,t,i):s.slideTo(s.activeIndex+g,n,t,i)}function R$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this,{params:l,snapGrid:d,slidesGrid:u,rtlTranslate:p,enabled:g,animating:_}=s;if(!g||s.destroyed)return s;const y=s.virtual&&l.virtual.enabled;if(l.loop){if(_&&!y&&l.loopPreventsSliding)return!1;s.loopFix({direction:"prev"}),s._clientLeft=s.wrapperEl.clientLeft}const E=p?s.translate:-s.translate;function b(P){return P<0?-Math.floor(Math.abs(P)):Math.floor(P)}const A=b(E),N=d.map(P=>b(P));let O=d[N.indexOf(A)-1];if(typeof O>"u"&&l.cssMode){let P;d.forEach((j,M)=>{A>=j&&(P=M)}),typeof P<"u"&&(O=d[P>0?P-1:P])}let D=0;if(typeof O<"u"&&(D=u.indexOf(O),D<0&&(D=s.activeIndex-1),l.slidesPerView==="auto"&&l.slidesPerGroup===1&&l.slidesPerGroupAuto&&(D=D-s.slidesPerViewDynamic("previous",!0)+1,D=Math.max(D,0))),l.rewind&&s.isBeginning){const P=s.params.virtual&&s.params.virtual.enabled&&s.virtual?s.virtual.slides.length-1:s.slides.length-1;return s.slideTo(P,n,t,i)}else if(l.loop&&s.activeIndex===0&&l.cssMode)return requestAnimationFrame(()=>{s.slideTo(D,n,t,i)}),!0;return s.slideTo(D,n,t,i)}function x$e(n,t,i){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0);const s=this;if(!s.destroyed)return s.slideTo(s.activeIndex,n,t,i)}function A$e(n,t,i,s){n===void 0&&(n=this.params.speed),t===void 0&&(t=!0),s===void 0&&(s=.5);const l=this;if(l.destroyed)return;let d=l.activeIndex;const u=Math.min(l.params.slidesPerGroupSkip,d),p=u+Math.floor((d-u)/l.params.slidesPerGroup),g=l.rtlTranslate?l.translate:-l.translate;if(g>=l.snapGrid[p]){const _=l.snapGrid[p],y=l.snapGrid[p+1];g-_>(y-_)*s&&(d+=l.params.slidesPerGroup)}else{const _=l.snapGrid[p-1],y=l.snapGrid[p];g-_<=(y-_)*s&&(d-=l.params.slidesPerGroup)}return d=Math.max(d,0),d=Math.min(d,l.slidesGrid.length-1),l.slideTo(d,n,t,i)}function I$e(){const n=this;if(n.destroyed)return;const{params:t,slidesEl:i}=n,s=t.slidesPerView==="auto"?n.slidesPerViewDynamic():t.slidesPerView;let l=n.clickedIndex,d;const u=n.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(n.animating)return;d=parseInt(n.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?l<n.loopedSlides-s/2||l>n.slides.length-n.loopedSlides+s/2?(n.loopFix(),l=n.getSlideIndex($o(i,`${u}[data-swiper-slide-index="${d}"]`)[0]),xE(()=>{n.slideTo(l)})):n.slideTo(l):l>n.slides.length-s?(n.loopFix(),l=n.getSlideIndex($o(i,`${u}[data-swiper-slide-index="${d}"]`)[0]),xE(()=>{n.slideTo(l)})):n.slideTo(l)}else n.slideTo(l)}var N$e={slideTo:b$e,slideToLoop:C$e,slideNext:T$e,slidePrev:R$e,slideReset:x$e,slideToClosest:A$e,slideToClickedSlide:I$e};function O$e(n){const t=this,{params:i,slidesEl:s}=t;if(!i.loop||t.virtual&&t.params.virtual.enabled)return;const l=()=>{$o(s,`.${i.slideClass}, swiper-slide`).forEach((E,b)=>{E.setAttribute("data-swiper-slide-index",b)})},d=t.grid&&i.grid&&i.grid.rows>1,u=i.slidesPerGroup*(d?i.grid.rows:1),p=t.slides.length%u!==0,g=d&&t.slides.length%i.grid.rows!==0,_=y=>{for(let E=0;E<y;E+=1){const b=t.isElement?Kd("swiper-slide",[i.slideBlankClass]):Kd("div",[i.slideClass,i.slideBlankClass]);t.slidesEl.append(b)}};if(p){if(i.loopAddBlankSlides){const y=u-t.slides.length%u;_(y),t.recalcSlides(),t.updateSlides()}else b7("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else if(g){if(i.loopAddBlankSlides){const y=i.grid.rows-t.slides.length%i.grid.rows;_(y),t.recalcSlides(),t.updateSlides()}else b7("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");l()}else l();t.loopFix({slideRealIndex:n,direction:i.centeredSlides?void 0:"next"})}function P$e(n){let{slideRealIndex:t,slideTo:i=!0,direction:s,setTranslate:l,activeSlideIndex:d,byController:u,byMousewheel:p}=n===void 0?{}:n;const g=this;if(!g.params.loop)return;g.emit("beforeLoopFix");const{slides:_,allowSlidePrev:y,allowSlideNext:E,slidesEl:b,params:A}=g,{centeredSlides:N}=A;if(g.allowSlidePrev=!0,g.allowSlideNext=!0,g.virtual&&A.virtual.enabled){i&&(!A.centeredSlides&&g.snapIndex===0?g.slideTo(g.virtual.slides.length,0,!1,!0):A.centeredSlides&&g.snapIndex<A.slidesPerView?g.slideTo(g.virtual.slides.length+g.snapIndex,0,!1,!0):g.snapIndex===g.snapGrid.length-1&&g.slideTo(g.virtual.slidesBefore,0,!1,!0)),g.allowSlidePrev=y,g.allowSlideNext=E,g.emit("loopFix");return}let O=A.slidesPerView;O==="auto"?O=g.slidesPerViewDynamic():(O=Math.ceil(parseFloat(A.slidesPerView,10)),N&&O%2===0&&(O=O+1));const D=A.slidesPerGroupAuto?O:A.slidesPerGroup;let P=D;P%D!==0&&(P+=D-P%D),P+=A.loopAdditionalSlides,g.loopedSlides=P;const j=g.grid&&A.grid&&A.grid.rows>1;_.length<O+P?b7("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):j&&A.grid.fill==="row"&&b7("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const M=[],V=[];let H=g.activeIndex;typeof d>"u"?d=g.getSlideIndex(_.filter(G=>G.classList.contains(A.slideActiveClass))[0]):H=d;const $=s==="next"||!s,Q=s==="prev"||!s;let Y=0,le=0;const ae=j?Math.ceil(_.length/A.grid.rows):_.length,de=(j?_[d].column:d)+(N&&typeof l>"u"?-O/2+.5:0);if(de<P){Y=Math.max(P-de,D);for(let G=0;G<P-de;G+=1){const ie=G-Math.floor(G/ae)*ae;if(j){const _e=ae-ie-1;for(let he=_.length-1;he>=0;he-=1)_[he].column===_e&&M.push(he)}else M.push(ae-ie-1)}}else if(de+O>ae-P){le=Math.max(de-(ae-P*2),D);for(let G=0;G<le;G+=1){const ie=G-Math.floor(G/ae)*ae;j?_.forEach((_e,he)=>{_e.column===ie&&V.push(he)}):V.push(ie)}}if(g.__preventObserver__=!0,requestAnimationFrame(()=>{g.__preventObserver__=!1}),Q&&M.forEach(G=>{_[G].swiperLoopMoveDOM=!0,b.prepend(_[G]),_[G].swiperLoopMoveDOM=!1}),$&&V.forEach(G=>{_[G].swiperLoopMoveDOM=!0,b.append(_[G]),_[G].swiperLoopMoveDOM=!1}),g.recalcSlides(),A.slidesPerView==="auto"?g.updateSlides():j&&(M.length>0&&Q||V.length>0&&$)&&g.slides.forEach((G,ie)=>{g.grid.updateSlide(ie,G,g.slides)}),A.watchSlidesProgress&&g.updateSlidesOffset(),i){if(M.length>0&&Q){if(typeof t>"u"){const G=g.slidesGrid[H],_e=g.slidesGrid[H+Y]-G;p?g.setTranslate(g.translate-_e):(g.slideTo(H+Y,0,!1,!0),l&&(g.touchEventsData.startTranslate=g.touchEventsData.startTranslate-_e,g.touchEventsData.currentTranslate=g.touchEventsData.currentTranslate-_e))}else if(l){const G=j?M.length/A.grid.rows:M.length;g.slideTo(g.activeIndex+G,0,!1,!0),g.touchEventsData.currentTranslate=g.translate}}else if(V.length>0&&$)if(typeof t>"u"){const G=g.slidesGrid[H],_e=g.slidesGrid[H-le]-G;p?g.setTranslate(g.translate-_e):(g.slideTo(H-le,0,!1,!0),l&&(g.touchEventsData.startTranslate=g.touchEventsData.startTranslate-_e,g.touchEventsData.currentTranslate=g.touchEventsData.currentTranslate-_e))}else{const G=j?V.length/A.grid.rows:V.length;g.slideTo(g.activeIndex-G,0,!1,!0)}}if(g.allowSlidePrev=y,g.allowSlideNext=E,g.controller&&g.controller.control&&!u){const G={slideRealIndex:t,direction:s,setTranslate:l,activeSlideIndex:d,byController:!0};Array.isArray(g.controller.control)?g.controller.control.forEach(ie=>{!ie.destroyed&&ie.params.loop&&ie.loopFix({...G,slideTo:ie.params.slidesPerView===A.slidesPerView?i:!1})}):g.controller.control instanceof g.constructor&&g.controller.control.params.loop&&g.controller.control.loopFix({...G,slideTo:g.controller.control.params.slidesPerView===A.slidesPerView?i:!1})}g.emit("loopFix")}function L$e(){const n=this,{params:t,slidesEl:i}=n;if(!t.loop||n.virtual&&n.params.virtual.enabled)return;n.recalcSlides();const s=[];n.slides.forEach(l=>{const d=typeof l.swiperSlideIndex>"u"?l.getAttribute("data-swiper-slide-index")*1:l.swiperSlideIndex;s[d]=l}),n.slides.forEach(l=>{l.removeAttribute("data-swiper-slide-index")}),s.forEach(l=>{i.append(l)}),n.recalcSlides(),n.slideTo(n.realIndex,0)}var D$e={loopCreate:O$e,loopFix:P$e,loopDestroy:L$e};function k$e(n){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const i=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),i.style.cursor="move",i.style.cursor=n?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function M$e(){const n=this;n.params.watchOverflow&&n.isLocked||n.params.cssMode||(n.isElement&&(n.__preventObserver__=!0),n[n.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",n.isElement&&requestAnimationFrame(()=>{n.__preventObserver__=!1}))}var j$e={setGrabCursor:k$e,unsetGrabCursor:M$e};function U$e(n,t){t===void 0&&(t=this);function i(s){if(!s||s===lc()||s===ea())return null;s.assignedSlot&&(s=s.assignedSlot);const l=s.closest(n);return!l&&!s.getRootNode?null:l||i(s.getRootNode().host)}return i(t)}function Lhe(n,t,i){const s=ea(),{params:l}=n,d=l.edgeSwipeDetection,u=l.edgeSwipeThreshold;return d&&(i<=u||i>=s.innerWidth-u)?d==="prevent"?(t.preventDefault(),!0):!1:!0}function F$e(n){const t=this,i=lc();let s=n;s.originalEvent&&(s=s.originalEvent);const l=t.touchEventsData;if(s.type==="pointerdown"){if(l.pointerId!==null&&l.pointerId!==s.pointerId)return;l.pointerId=s.pointerId}else s.type==="touchstart"&&s.targetTouches.length===1&&(l.touchId=s.targetTouches[0].identifier);if(s.type==="touchstart"){Lhe(t,s,s.targetTouches[0].pageX);return}const{params:d,touches:u,enabled:p}=t;if(!p||!d.simulateTouch&&s.pointerType==="mouse"||t.animating&&d.preventInteractionOnTransition)return;!t.animating&&d.cssMode&&d.loop&&t.loopFix();let g=s.target;if(d.touchEventsTarget==="wrapper"&&!t.wrapperEl.contains(g)||"which"in s&&s.which===3||"button"in s&&s.button>0||l.isTouched&&l.isMoved)return;const _=!!d.noSwipingClass&&d.noSwipingClass!=="",y=s.composedPath?s.composedPath():s.path;_&&s.target&&s.target.shadowRoot&&y&&(g=y[0]);const E=d.noSwipingSelector?d.noSwipingSelector:`.${d.noSwipingClass}`,b=!!(s.target&&s.target.shadowRoot);if(d.noSwiping&&(b?U$e(E,g):g.closest(E))){t.allowClick=!0;return}if(d.swipeHandler&&!g.closest(d.swipeHandler))return;u.currentX=s.pageX,u.currentY=s.pageY;const A=u.currentX,N=u.currentY;if(!Lhe(t,s,A))return;Object.assign(l,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),u.startX=A,u.startY=N,l.touchStartTime=Zu(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,d.threshold>0&&(l.allowThresholdMove=!1);let O=!0;g.matches(l.focusableElements)&&(O=!1,g.nodeName==="SELECT"&&(l.isTouched=!1)),i.activeElement&&i.activeElement.matches(l.focusableElements)&&i.activeElement!==g&&i.activeElement.blur();const D=O&&t.allowTouchMove&&d.touchStartPreventDefault;(d.touchStartForcePreventDefault||D)&&!g.isContentEditable&&s.preventDefault(),d.freeMode&&d.freeMode.enabled&&t.freeMode&&t.animating&&!d.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",s)}function B$e(n){const t=lc(),i=this,s=i.touchEventsData,{params:l,touches:d,rtlTranslate:u,enabled:p}=i;if(!p||!l.simulateTouch&&n.pointerType==="mouse")return;let g=n;if(g.originalEvent&&(g=g.originalEvent),g.type==="pointermove"&&(s.touchId!==null||g.pointerId!==s.pointerId))return;let _;if(g.type==="touchmove"){if(_=[...g.changedTouches].filter($=>$.identifier===s.touchId)[0],!_||_.identifier!==s.touchId)return}else _=g;if(!s.isTouched){s.startMoving&&s.isScrolling&&i.emit("touchMoveOpposite",g);return}const y=_.pageX,E=_.pageY;if(g.preventedByNestedSwiper){d.startX=y,d.startY=E;return}if(!i.allowTouchMove){g.target.matches(s.focusableElements)||(i.allowClick=!1),s.isTouched&&(Object.assign(d,{startX:y,startY:E,currentX:y,currentY:E}),s.touchStartTime=Zu());return}if(l.touchReleaseOnEdges&&!l.loop){if(i.isVertical()){if(E<d.startY&&i.translate<=i.maxTranslate()||E>d.startY&&i.translate>=i.minTranslate()){s.isTouched=!1,s.isMoved=!1;return}}else if(y<d.startX&&i.translate<=i.maxTranslate()||y>d.startX&&i.translate>=i.minTranslate())return}if(t.activeElement&&g.target===t.activeElement&&g.target.matches(s.focusableElements)){s.isMoved=!0,i.allowClick=!1;return}s.allowTouchCallbacks&&i.emit("touchMove",g),d.previousX=d.currentX,d.previousY=d.currentY,d.currentX=y,d.currentY=E;const b=d.currentX-d.startX,A=d.currentY-d.startY;if(i.params.threshold&&Math.sqrt(b**2+A**2)<i.params.threshold)return;if(typeof s.isScrolling>"u"){let $;i.isHorizontal()&&d.currentY===d.startY||i.isVertical()&&d.currentX===d.startX?s.isScrolling=!1:b*b+A*A>=25&&($=Math.atan2(Math.abs(A),Math.abs(b))*180/Math.PI,s.isScrolling=i.isHorizontal()?$>l.touchAngle:90-$>l.touchAngle)}if(s.isScrolling&&i.emit("touchMoveOpposite",g),typeof s.startMoving>"u"&&(d.currentX!==d.startX||d.currentY!==d.startY)&&(s.startMoving=!0),s.isScrolling){s.isTouched=!1;return}if(!s.startMoving)return;i.allowClick=!1,!l.cssMode&&g.cancelable&&g.preventDefault(),l.touchMoveStopPropagation&&!l.nested&&g.stopPropagation();let N=i.isHorizontal()?b:A,O=i.isHorizontal()?d.currentX-d.previousX:d.currentY-d.previousY;l.oneWayMovement&&(N=Math.abs(N)*(u?1:-1),O=Math.abs(O)*(u?1:-1)),d.diff=N,N*=l.touchRatio,u&&(N=-N,O=-O);const D=i.touchesDirection;i.swipeDirection=N>0?"prev":"next",i.touchesDirection=O>0?"prev":"next";const P=i.params.loop&&!l.cssMode,j=i.touchesDirection==="next"&&i.allowSlideNext||i.touchesDirection==="prev"&&i.allowSlidePrev;if(!s.isMoved){if(P&&j&&i.loopFix({direction:i.swipeDirection}),s.startTranslate=i.getTranslate(),i.setTransition(0),i.animating){const $=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});i.wrapperEl.dispatchEvent($)}s.allowMomentumBounce=!1,l.grabCursor&&(i.allowSlideNext===!0||i.allowSlidePrev===!0)&&i.setGrabCursor(!0),i.emit("sliderFirstMove",g)}let M;if(new Date().getTime(),s.isMoved&&s.allowThresholdMove&&D!==i.touchesDirection&&P&&j&&Math.abs(N)>=1){Object.assign(d,{startX:y,startY:E,currentX:y,currentY:E,startTranslate:s.currentTranslate}),s.loopSwapReset=!0,s.startTranslate=s.currentTranslate;return}i.emit("sliderMove",g),s.isMoved=!0,s.currentTranslate=N+s.startTranslate;let V=!0,H=l.resistanceRatio;if(l.touchReleaseOnEdges&&(H=0),N>0?(P&&j&&!M&&s.allowThresholdMove&&s.currentTranslate>(l.centeredSlides?i.minTranslate()-i.slidesSizesGrid[i.activeIndex+1]:i.minTranslate())&&i.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),s.currentTranslate>i.minTranslate()&&(V=!1,l.resistance&&(s.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+s.startTranslate+N)**H))):N<0&&(P&&j&&!M&&s.allowThresholdMove&&s.currentTranslate<(l.centeredSlides?i.maxTranslate()+i.slidesSizesGrid[i.slidesSizesGrid.length-1]:i.maxTranslate())&&i.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:i.slides.length-(l.slidesPerView==="auto"?i.slidesPerViewDynamic():Math.ceil(parseFloat(l.slidesPerView,10)))}),s.currentTranslate<i.maxTranslate()&&(V=!1,l.resistance&&(s.currentTranslate=i.maxTranslate()+1-(i.maxTranslate()-s.startTranslate-N)**H))),V&&(g.preventedByNestedSwiper=!0),!i.allowSlideNext&&i.swipeDirection==="next"&&s.currentTranslate<s.startTranslate&&(s.currentTranslate=s.startTranslate),!i.allowSlidePrev&&i.swipeDirection==="prev"&&s.currentTranslate>s.startTranslate&&(s.currentTranslate=s.startTranslate),!i.allowSlidePrev&&!i.allowSlideNext&&(s.currentTranslate=s.startTranslate),l.threshold>0)if(Math.abs(N)>l.threshold||s.allowThresholdMove){if(!s.allowThresholdMove){s.allowThresholdMove=!0,d.startX=d.currentX,d.startY=d.currentY,s.currentTranslate=s.startTranslate,d.diff=i.isHorizontal()?d.currentX-d.startX:d.currentY-d.startY;return}}else{s.currentTranslate=s.startTranslate;return}!l.followFinger||l.cssMode||((l.freeMode&&l.freeMode.enabled&&i.freeMode||l.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),l.freeMode&&l.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(s.currentTranslate),i.setTranslate(s.currentTranslate))}function V$e(n){const t=this,i=t.touchEventsData;let s=n;s.originalEvent&&(s=s.originalEvent);let l;if(s.type==="touchend"||s.type==="touchcancel"){if(l=[...s.changedTouches].filter(H=>H.identifier===i.touchId)[0],!l||l.identifier!==i.touchId)return}else{if(i.touchId!==null||s.pointerId!==i.pointerId)return;l=s}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(s.type)&&!(["pointercancel","contextmenu"].includes(s.type)&&(t.browser.isSafari||t.browser.isWebView)))return;i.pointerId=null,i.touchId=null;const{params:u,touches:p,rtlTranslate:g,slidesGrid:_,enabled:y}=t;if(!y||!u.simulateTouch&&s.pointerType==="mouse")return;if(i.allowTouchCallbacks&&t.emit("touchEnd",s),i.allowTouchCallbacks=!1,!i.isTouched){i.isMoved&&u.grabCursor&&t.setGrabCursor(!1),i.isMoved=!1,i.startMoving=!1;return}u.grabCursor&&i.isMoved&&i.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const E=Zu(),b=E-i.touchStartTime;if(t.allowClick){const H=s.path||s.composedPath&&s.composedPath();t.updateClickedSlide(H&&H[0]||s.target,H),t.emit("tap click",s),b<300&&E-i.lastClickTime<300&&t.emit("doubleTap doubleClick",s)}if(i.lastClickTime=Zu(),xE(()=>{t.destroyed||(t.allowClick=!0)}),!i.isTouched||!i.isMoved||!t.swipeDirection||p.diff===0&&!i.loopSwapReset||i.currentTranslate===i.startTranslate&&!i.loopSwapReset){i.isTouched=!1,i.isMoved=!1,i.startMoving=!1;return}i.isTouched=!1,i.isMoved=!1,i.startMoving=!1;let A;if(u.followFinger?A=g?t.translate:-t.translate:A=-i.currentTranslate,u.cssMode)return;if(u.freeMode&&u.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:A});return}const N=A>=-t.maxTranslate()&&!t.params.loop;let O=0,D=t.slidesSizesGrid[0];for(let H=0;H<_.length;H+=H<u.slidesPerGroupSkip?1:u.slidesPerGroup){const $=H<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;typeof _[H+$]<"u"?(N||A>=_[H]&&A<_[H+$])&&(O=H,D=_[H+$]-_[H]):(N||A>=_[H])&&(O=H,D=_[_.length-1]-_[_.length-2])}let P=null,j=null;u.rewind&&(t.isBeginning?j=u.virtual&&u.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(P=0));const M=(A-_[O])/D,V=O<u.slidesPerGroupSkip-1?1:u.slidesPerGroup;if(b>u.longSwipesMs){if(!u.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(M>=u.longSwipesRatio?t.slideTo(u.rewind&&t.isEnd?P:O+V):t.slideTo(O)),t.swipeDirection==="prev"&&(M>1-u.longSwipesRatio?t.slideTo(O+V):j!==null&&M<0&&Math.abs(M)>u.longSwipesRatio?t.slideTo(j):t.slideTo(O))}else{if(!u.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(s.target===t.navigation.nextEl||s.target===t.navigation.prevEl)?s.target===t.navigation.nextEl?t.slideTo(O+V):t.slideTo(O):(t.swipeDirection==="next"&&t.slideTo(P!==null?P:O+V),t.swipeDirection==="prev"&&t.slideTo(j!==null?j:O))}}function Dhe(){const n=this,{params:t,el:i}=n;if(i&&i.offsetWidth===0)return;t.breakpoints&&n.setBreakpoint();const{allowSlideNext:s,allowSlidePrev:l,snapGrid:d}=n,u=n.virtual&&n.params.virtual.enabled;n.allowSlideNext=!0,n.allowSlidePrev=!0,n.updateSize(),n.updateSlides(),n.updateSlidesClasses();const p=u&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&n.isEnd&&!n.isBeginning&&!n.params.centeredSlides&&!p?n.slideTo(n.slides.length-1,0,!1,!0):n.params.loop&&!u?n.slideToLoop(n.realIndex,0,!1,!0):n.slideTo(n.activeIndex,0,!1,!0),n.autoplay&&n.autoplay.running&&n.autoplay.paused&&(clearTimeout(n.autoplay.resizeTimeout),n.autoplay.resizeTimeout=setTimeout(()=>{n.autoplay&&n.autoplay.running&&n.autoplay.paused&&n.autoplay.resume()},500)),n.allowSlidePrev=l,n.allowSlideNext=s,n.params.watchOverflow&&d!==n.snapGrid&&n.checkOverflow()}function z$e(n){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&n.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(n.stopPropagation(),n.stopImmediatePropagation())))}function H$e(){const n=this,{wrapperEl:t,rtlTranslate:i,enabled:s}=n;if(!s)return;n.previousTranslate=n.translate,n.isHorizontal()?n.translate=-t.scrollLeft:n.translate=-t.scrollTop,n.translate===0&&(n.translate=0),n.updateActiveIndex(),n.updateSlidesClasses();let l;const d=n.maxTranslate()-n.minTranslate();d===0?l=0:l=(n.translate-n.minTranslate())/d,l!==n.progress&&n.updateProgress(i?-n.translate:n.translate),n.emit("setTranslate",n.translate,!1)}function G$e(n){const t=this;tM(t,n.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}function W$e(){const n=this;n.documentTouchHandlerProceeded||(n.documentTouchHandlerProceeded=!0,n.params.touchReleaseOnEdges&&(n.el.style.touchAction="auto"))}const v_e=(n,t)=>{const i=lc(),{params:s,el:l,wrapperEl:d,device:u}=n,p=!!s.nested,g=t==="on"?"addEventListener":"removeEventListener",_=t;i[g]("touchstart",n.onDocumentTouchStart,{passive:!1,capture:p}),l[g]("touchstart",n.onTouchStart,{passive:!1}),l[g]("pointerdown",n.onTouchStart,{passive:!1}),i[g]("touchmove",n.onTouchMove,{passive:!1,capture:p}),i[g]("pointermove",n.onTouchMove,{passive:!1,capture:p}),i[g]("touchend",n.onTouchEnd,{passive:!0}),i[g]("pointerup",n.onTouchEnd,{passive:!0}),i[g]("pointercancel",n.onTouchEnd,{passive:!0}),i[g]("touchcancel",n.onTouchEnd,{passive:!0}),i[g]("pointerout",n.onTouchEnd,{passive:!0}),i[g]("pointerleave",n.onTouchEnd,{passive:!0}),i[g]("contextmenu",n.onTouchEnd,{passive:!0}),(s.preventClicks||s.preventClicksPropagation)&&l[g]("click",n.onClick,!0),s.cssMode&&d[g]("scroll",n.onScroll),s.updateOnWindowResize?n[_](u.ios||u.android?"resize orientationchange observerUpdate":"resize observerUpdate",Dhe,!0):n[_]("observerUpdate",Dhe,!0),l[g]("load",n.onLoad,{capture:!0})};function $$e(){const n=this,{params:t}=n;n.onTouchStart=F$e.bind(n),n.onTouchMove=B$e.bind(n),n.onTouchEnd=V$e.bind(n),n.onDocumentTouchStart=W$e.bind(n),t.cssMode&&(n.onScroll=H$e.bind(n)),n.onClick=z$e.bind(n),n.onLoad=G$e.bind(n),v_e(n,"on")}function K$e(){v_e(this,"off")}var q$e={attachEvents:$$e,detachEvents:K$e};const khe=(n,t)=>n.grid&&t.grid&&t.grid.rows>1;function Y$e(){const n=this,{realIndex:t,initialized:i,params:s,el:l}=n,d=s.breakpoints;if(!d||d&&Object.keys(d).length===0)return;const u=n.getBreakpoint(d,n.params.breakpointsBase,n.el);if(!u||n.currentBreakpoint===u)return;const g=(u in d?d[u]:void 0)||n.originalParams,_=khe(n,s),y=khe(n,g),E=s.enabled;_&&!y?(l.classList.remove(`${s.containerModifierClass}grid`,`${s.containerModifierClass}grid-column`),n.emitContainerClasses()):!_&&y&&(l.classList.add(`${s.containerModifierClass}grid`),(g.grid.fill&&g.grid.fill==="column"||!g.grid.fill&&s.grid.fill==="column")&&l.classList.add(`${s.containerModifierClass}grid-column`),n.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(P=>{if(typeof g[P]>"u")return;const j=s[P]&&s[P].enabled,M=g[P]&&g[P].enabled;j&&!M&&n[P].disable(),!j&&M&&n[P].enable()});const b=g.direction&&g.direction!==s.direction,A=s.loop&&(g.slidesPerView!==s.slidesPerView||b),N=s.loop;b&&i&&n.changeDirection(),Vd(n.params,g);const O=n.params.enabled,D=n.params.loop;Object.assign(n,{allowTouchMove:n.params.allowTouchMove,allowSlideNext:n.params.allowSlideNext,allowSlidePrev:n.params.allowSlidePrev}),E&&!O?n.disable():!E&&O&&n.enable(),n.currentBreakpoint=u,n.emit("_beforeBreakpoint",g),i&&(A?(n.loopDestroy(),n.loopCreate(t),n.updateSlides()):!N&&D?(n.loopCreate(t),n.updateSlides()):N&&!D&&n.loopDestroy()),n.emit("breakpoint",g)}function X$e(n,t,i){if(t===void 0&&(t="window"),!n||t==="container"&&!i)return;let s=!1;const l=ea(),d=t==="window"?l.innerHeight:i.clientHeight,u=Object.keys(n).map(p=>{if(typeof p=="string"&&p.indexOf("@")===0){const g=parseFloat(p.substr(1));return{value:d*g,point:p}}return{value:p,point:p}});u.sort((p,g)=>parseInt(p.value,10)-parseInt(g.value,10));for(let p=0;p<u.length;p+=1){const{point:g,value:_}=u[p];t==="window"?l.matchMedia(`(min-width: ${_}px)`).matches&&(s=g):_<=i.clientWidth&&(s=g)}return s||"max"}var J$e={setBreakpoint:Y$e,getBreakpoint:X$e};function Q$e(n,t){const i=[];return n.forEach(s=>{typeof s=="object"?Object.keys(s).forEach(l=>{s[l]&&i.push(t+l)}):typeof s=="string"&&i.push(t+s)}),i}function Z$e(){const n=this,{classNames:t,params:i,rtl:s,el:l,device:d}=n,u=Q$e(["initialized",i.direction,{"free-mode":n.params.freeMode&&i.freeMode.enabled},{autoheight:i.autoHeight},{rtl:s},{grid:i.grid&&i.grid.rows>1},{"grid-column":i.grid&&i.grid.rows>1&&i.grid.fill==="column"},{android:d.android},{ios:d.ios},{"css-mode":i.cssMode},{centered:i.cssMode&&i.centeredSlides},{"watch-progress":i.watchSlidesProgress}],i.containerModifierClass);t.push(...u),l.classList.add(...t),n.emitContainerClasses()}function eKe(){const n=this,{el:t,classNames:i}=n;t.classList.remove(...i),n.emitContainerClasses()}var tKe={addClasses:Z$e,removeClasses:eKe};function nKe(){const n=this,{isLocked:t,params:i}=n,{slidesOffsetBefore:s}=i;if(s){const l=n.slides.length-1,d=n.slidesGrid[l]+n.slidesSizesGrid[l]+s*2;n.isLocked=n.size>d}else n.isLocked=n.snapGrid.length===1;i.allowSlideNext===!0&&(n.allowSlideNext=!n.isLocked),i.allowSlidePrev===!0&&(n.allowSlidePrev=!n.isLocked),t&&t!==n.isLocked&&(n.isEnd=!1),t!==n.isLocked&&n.emit(n.isLocked?"lock":"unlock")}var iKe={checkOverflow:nKe},Mhe={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function rKe(n,t){return function(s){s===void 0&&(s={});const l=Object.keys(s)[0],d=s[l];if(typeof d!="object"||d===null){Vd(t,s);return}if(n[l]===!0&&(n[l]={enabled:!0}),l==="navigation"&&n[l]&&n[l].enabled&&!n[l].prevEl&&!n[l].nextEl&&(n[l].auto=!0),["pagination","scrollbar"].indexOf(l)>=0&&n[l]&&n[l].enabled&&!n[l].el&&(n[l].auto=!0),!(l in n&&"enabled"in d)){Vd(t,s);return}typeof n[l]=="object"&&!("enabled"in n[l])&&(n[l].enabled=!0),n[l]||(n[l]={enabled:!1}),Vd(t,s)}}const K$={eventsEmitter:t$e,update:h$e,translate:y$e,transition:S$e,slide:N$e,loop:D$e,grabCursor:j$e,events:q$e,breakpoints:J$e,checkOverflow:iKe,classes:tKe},q$={};class qc{constructor(){let t,i;for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];l.length===1&&l[0].constructor&&Object.prototype.toString.call(l[0]).slice(8,-1)==="Object"?i=l[0]:[t,i]=l,i||(i={}),i=Vd({},i),t&&!i.el&&(i.el=t);const u=lc();if(i.el&&typeof i.el=="string"&&u.querySelectorAll(i.el).length>1){const y=[];return u.querySelectorAll(i.el).forEach(E=>{const b=Vd({},i,{el:E});y.push(new qc(b))}),y}const p=this;p.__swiper__=!0,p.support=p_e(),p.device=m_e({userAgent:i.userAgent}),p.browser=QWe(),p.eventsListeners={},p.eventsAnyListeners=[],p.modules=[...p.__modules__],i.modules&&Array.isArray(i.modules)&&p.modules.push(...i.modules);const g={};p.modules.forEach(y=>{y({params:i,swiper:p,extendParams:rKe(i,g),on:p.on.bind(p),once:p.once.bind(p),off:p.off.bind(p),emit:p.emit.bind(p)})});const _=Vd({},Mhe,g);return p.params=Vd({},_,q$,i),p.originalParams=Vd({},p.params),p.passedParams=Vd({},i),p.params&&p.params.on&&Object.keys(p.params.on).forEach(y=>{p.on(y,p.params.on[y])}),p.params&&p.params.onAny&&p.onAny(p.params.onAny),Object.assign(p,{enabled:p.params.enabled,el:t,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return p.params.direction==="horizontal"},isVertical(){return p.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:p.params.allowSlideNext,allowSlidePrev:p.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:p.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:p.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),p.emit("_swiper"),p.params.init&&p.init(),p}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:i,params:s}=this,l=$o(i,`.${s.slideClass}, swiper-slide`),d=q4(l[0]);return q4(t)-d}getSlideIndexByData(t){return this.getSlideIndex(this.slides.filter(i=>i.getAttribute("data-swiper-slide-index")*1===t)[0])}recalcSlides(){const t=this,{slidesEl:i,params:s}=t;t.slides=$o(i,`.${s.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,i){const s=this;t=Math.min(Math.max(t,0),1);const l=s.minTranslate(),u=(s.maxTranslate()-l)*t+l;s.translateTo(u,typeof i>"u"?0:i),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const i=t.el.className.split(" ").filter(s=>s.indexOf("swiper")===0||s.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",i.join(" "))}getSlideClasses(t){const i=this;return i.destroyed?"":t.className.split(" ").filter(s=>s.indexOf("swiper-slide")===0||s.indexOf(i.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const i=[];t.slides.forEach(s=>{const l=t.getSlideClasses(s);i.push({slideEl:s,classNames:l}),t.emit("_slideClass",s,l)}),t.emit("_slideClasses",i)}slidesPerViewDynamic(t,i){t===void 0&&(t="current"),i===void 0&&(i=!1);const s=this,{params:l,slides:d,slidesGrid:u,slidesSizesGrid:p,size:g,activeIndex:_}=s;let y=1;if(typeof l.slidesPerView=="number")return l.slidesPerView;if(l.centeredSlides){let E=d[_]?Math.ceil(d[_].swiperSlideSize):0,b;for(let A=_+1;A<d.length;A+=1)d[A]&&!b&&(E+=Math.ceil(d[A].swiperSlideSize),y+=1,E>g&&(b=!0));for(let A=_-1;A>=0;A-=1)d[A]&&!b&&(E+=d[A].swiperSlideSize,y+=1,E>g&&(b=!0))}else if(t==="current")for(let E=_+1;E<d.length;E+=1)(i?u[E]+p[E]-u[_]<g:u[E]-u[_]<g)&&(y+=1);else for(let E=_-1;E>=0;E-=1)u[_]-u[E]<g&&(y+=1);return y}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:i,params:s}=t;s.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(u=>{u.complete&&tM(t,u)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function l(){const u=t.rtlTranslate?t.translate*-1:t.translate,p=Math.min(Math.max(u,t.maxTranslate()),t.minTranslate());t.setTranslate(p),t.updateActiveIndex(),t.updateSlidesClasses()}let d;if(s.freeMode&&s.freeMode.enabled&&!s.cssMode)l(),s.autoHeight&&t.updateAutoHeight();else{if((s.slidesPerView==="auto"||s.slidesPerView>1)&&t.isEnd&&!s.centeredSlides){const u=t.virtual&&s.virtual.enabled?t.virtual.slides:t.slides;d=t.slideTo(u.length-1,0,!1,!0)}else d=t.slideTo(t.activeIndex,0,!1,!0);d||l()}s.watchOverflow&&i!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,i){i===void 0&&(i=!0);const s=this,l=s.params.direction;return t||(t=l==="horizontal"?"vertical":"horizontal"),t===l||t!=="horizontal"&&t!=="vertical"||(s.el.classList.remove(`${s.params.containerModifierClass}${l}`),s.el.classList.add(`${s.params.containerModifierClass}${t}`),s.emitContainerClasses(),s.params.direction=t,s.slides.forEach(d=>{t==="vertical"?d.style.width="":d.style.height=""}),s.emit("changeDirection"),i&&s.update()),s}changeLanguageDirection(t){const i=this;i.rtl&&t==="rtl"||!i.rtl&&t==="ltr"||(i.rtl=t==="rtl",i.rtlTranslate=i.params.direction==="horizontal"&&i.rtl,i.rtl?(i.el.classList.add(`${i.params.containerModifierClass}rtl`),i.el.dir="rtl"):(i.el.classList.remove(`${i.params.containerModifierClass}rtl`),i.el.dir="ltr"),i.update())}mount(t){const i=this;if(i.mounted)return!0;let s=t||i.params.el;if(typeof s=="string"&&(s=document.querySelector(s)),!s)return!1;s.swiper=i,s.parentNode&&s.parentNode.host&&s.parentNode.host.nodeName===i.params.swiperElementNodeName.toUpperCase()&&(i.isElement=!0);const l=()=>`.${(i.params.wrapperClass||"").trim().split(" ").join(".")}`;let u=s&&s.shadowRoot&&s.shadowRoot.querySelector?s.shadowRoot.querySelector(l()):$o(s,l())[0];return!u&&i.params.createElements&&(u=Kd("div",i.params.wrapperClass),s.append(u),$o(s,`.${i.params.slideClass}`).forEach(p=>{u.append(p)})),Object.assign(i,{el:s,wrapperEl:u,slidesEl:i.isElement&&!s.parentNode.host.slideSlots?s.parentNode.host:u,hostEl:i.isElement?s.parentNode.host:s,mounted:!0,rtl:s.dir.toLowerCase()==="rtl"||mv(s,"direction")==="rtl",rtlTranslate:i.params.direction==="horizontal"&&(s.dir.toLowerCase()==="rtl"||mv(s,"direction")==="rtl"),wrongRTL:mv(u,"display")==="-webkit-box"}),!0}init(t){const i=this;if(i.initialized||i.mount(t)===!1)return i;i.emit("beforeInit"),i.params.breakpoints&&i.setBreakpoint(),i.addClasses(),i.updateSize(),i.updateSlides(),i.params.watchOverflow&&i.checkOverflow(),i.params.grabCursor&&i.enabled&&i.setGrabCursor(),i.params.loop&&i.virtual&&i.params.virtual.enabled?i.slideTo(i.params.initialSlide+i.virtual.slidesBefore,0,i.params.runCallbacksOnInit,!1,!0):i.slideTo(i.params.initialSlide,0,i.params.runCallbacksOnInit,!1,!0),i.params.loop&&i.loopCreate(),i.attachEvents();const l=[...i.el.querySelectorAll('[loading="lazy"]')];return i.isElement&&l.push(...i.hostEl.querySelectorAll('[loading="lazy"]')),l.forEach(d=>{d.complete?tM(i,d):d.addEventListener("load",u=>{tM(i,u.target)})}),Xq(i),i.initialized=!0,Xq(i),i.emit("init"),i.emit("afterInit"),i}destroy(t,i){t===void 0&&(t=!0),i===void 0&&(i=!0);const s=this,{params:l,el:d,wrapperEl:u,slides:p}=s;return typeof s.params>"u"||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),l.loop&&s.loopDestroy(),i&&(s.removeClasses(),d.removeAttribute("style"),u.removeAttribute("style"),p&&p.length&&p.forEach(g=>{g.classList.remove(l.slideVisibleClass,l.slideFullyVisibleClass,l.slideActiveClass,l.slideNextClass,l.slidePrevClass),g.removeAttribute("style"),g.removeAttribute("data-swiper-slide-index")})),s.emit("destroy"),Object.keys(s.eventsListeners).forEach(g=>{s.off(g)}),t!==!1&&(s.el.swiper=null,GWe(s)),s.destroyed=!0),null}static extendDefaults(t){Vd(q$,t)}static get extendedDefaults(){return q$}static get defaults(){return Mhe}static installModule(t){qc.prototype.__modules__||(qc.prototype.__modules__=[]);const i=qc.prototype.__modules__;typeof t=="function"&&i.indexOf(t)<0&&i.push(t)}static use(t){return Array.isArray(t)?(t.forEach(i=>qc.installModule(i)),qc):(qc.installModule(t),qc)}}Object.keys(K$).forEach(n=>{Object.keys(K$[n]).forEach(t=>{qc.prototype[t]=K$[n][t]})});qc.use([ZWe,e$e]);const sKe=Object.freeze(Object.defineProperty({__proto__:null,Swiper:qc,default:qc},Symbol.toStringTag,{value:"Module"})),aKe=Wpe(sKe);/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var jhe=Object.getOwnPropertySymbols,oKe=Object.prototype.hasOwnProperty,lKe=Object.prototype.propertyIsEnumerable;function cKe(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function dKe(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var s=Object.getOwnPropertyNames(t).map(function(d){return t[d]});if(s.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var uKe=dKe()?Object.assign:function(n,t){for(var i,s=cKe(n),l,d=1;d<arguments.length;d++){i=Object(arguments[d]);for(var u in i)oKe.call(i,u)&&(s[u]=i[u]);if(jhe){l=jhe(i);for(var p=0;p<l.length;p++)lKe.call(i,l[p])&&(s[l[p]]=i[l[p]])}}return s},Hd={};Object.defineProperty(Hd,"__esModule",{value:!0});Hd.setRef=Hd.isModuleAvailable=Hd.isReactElement=Hd.validateChildren=Hd.classNames=void 0;var nM=k;Hd.classNames=function(n){return typeof n=="string"?n.split(".").join(" ").trim():n instanceof HTMLElement?n.className:""};Hd.validateChildren=function(n){var t=!0;return Array.isArray(n)?nM.Children.forEach(n,function(i){nM.isValidElement(i)||(t=!1)}):t=nM.isValidElement(n),t};Hd.isReactElement=function(n){return nM.isValidElement(n)&&(typeof n.type=="string"||typeof n.type=="function"||typeof n.type=="object")};Hd.isModuleAvailable=function(n,t){for(var i=!1,s=0;s<n.length;s++)if(n[s].name===t){i=!0;break}return i};Hd.setRef=function(n,t){typeof n=="function"?n(t):n&&(n.current=t)};var MU={};Object.defineProperty(MU,"__esModule",{value:!0});MU.useForkRef=void 0;var hKe=k,Uhe=Hd;MU.useForkRef=function(n,t){return hKe.useMemo(function(){return n==null&&t==null?null:function(i){Uhe.setRef(n,i),Uhe.setRef(t,i)}},[n,t])};var T7=Vs&&Vs.__assign||function(){return T7=Object.assign||function(n){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(n[l]=t[l])}return n},T7.apply(this,arguments)},fKe=Vs&&Vs.__createBinding||(Object.create?function(n,t,i,s){s===void 0&&(s=i),Object.defineProperty(n,s,{enumerable:!0,get:function(){return t[i]}})}:function(n,t,i,s){s===void 0&&(s=i),n[s]=t[i]}),pKe=Vs&&Vs.__setModuleDefault||(Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n.default=t}),mKe=Vs&&Vs.__importStar||function(n){if(n&&n.__esModule)return n;var t={};if(n!=null)for(var i in n)i!=="default"&&Object.hasOwnProperty.call(n,i)&&fKe(t,n,i);return pKe(t,n),t},y_e=Vs&&Vs.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(GQ,"__esModule",{value:!0});var Va=mKe(k),gKe=y_e(aKe),vKe=y_e(uKe),Sg=Hd,yKe=MU,$Q=Va.forwardRef(function(n,t){var i=n.activeSlideKey,s=n.ContainerEl,l=n.children,d=n.containerClass,u=n.navigation,p=n.noSwiping,g=n.pagination,_=n.parallax,y=n.parallaxEl,E=n.WrapperEl,b=n.wrapperClass,A=n.rebuildOnUpdate,N=n.renderScrollbar,O=n.renderPagination,D=n.renderPrevButton,P=n.renderNextButton,j=n.renderParallax,M=n.rtl,V=n.scrollbar,H=n.shouldSwiperUpdate,$=n.slideClass,Q=n.loop,Y=Va.useRef(null),le=Va.useRef(null),ae=yKe.useForkRef(le,t),te=Va.useCallback(function(){if(!i)return null;var _e=0,he=Q?1:0;return Va.Children.forEach(l,function(Ce){Va.isValidElement(Ce)&&(Ce.key===i&&(_e=he),he+=1)}),_e},[i,l,Q]),de=Va.useCallback(function(){Y.current!==null&&(Y.current.destroy(!0,!0),Sg.setRef(Y,null))},[]),G=Va.useCallback(function(){le.current&&Y.current===null&&Sg.setRef(Y,new gKe.default(le.current,vKe.default({},n)))},[n]),ie=function(_e){if(!Sg.isReactElement(_e))return null;var he=[$,_e.props.className];return p&&he.push("swiper-no-swiping"),Va.cloneElement(_e,T7(T7({},_e.props),{className:he.join(" ").trim()}))};return Va.useEffect(function(){return function(){return de()}},[de]),Va.useEffect(function(){if(G(),Y.current!==null){A?(de(),G()):H&&Y.current.update();var _e=Y.current.slides.length;if(_e<=Y.current.activeIndex){var he=Math.max(_e-1,0);Y.current.slideTo(he)}var Ce=te();Ce!==null&&Y.current.slideTo(Ce)}},[de,te,A,H,G]),!l||!s||!E||!Sg.validateChildren(l)?null:Va.default.createElement(s,{className:d,dir:M&&"rtl",ref:ae},_&&y&&j&&j(n),Va.default.createElement(E,{className:b},Va.Children.map(l,ie)),g&&g.el&&O&&O(n),V&&V.el&&N&&N(n),u&&u.nextEl&&P&&P(n),u&&u.prevEl&&D&&D(n))});$Q.defaultProps={containerClass:"swiper-container",wrapperClass:"swiper-wrapper",slideClass:"swiper-slide",ContainerEl:"div",WrapperEl:"div",renderScrollbar:function(n){var t=n.scrollbar;return t?Va.default.createElement("div",{className:Sg.classNames(t.el)}):null},renderPagination:function(n){var t=n.pagination;return t?Va.default.createElement("div",{className:Sg.classNames(t.el)}):null},renderPrevButton:function(n){var t=n.navigation;return t?Va.default.createElement("div",{className:Sg.classNames(t.prevEl)}):null},renderNextButton:function(n){var t=n.navigation;return t?Va.default.createElement("div",{className:Sg.classNames(t.nextEl)}):null},renderParallax:function(n){var t=n.parallaxEl;return t?Va.default.createElement("div",{className:Sg.classNames(t.el),"data-swiper-parallax":t.value}):null}};$Q.displayName="ReactIdSwiper";GQ.default=$Q;var _Ke=Vs&&Vs.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(u_e,"__esModule",{value:!0});var EKe=_Ke(GQ),KQ=u_e.default=EKe.default;function wKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;i({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});let d;const u=lc();t.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const p=u.createElement("div");function g(N,O){const D=t.params.virtual;if(D.cache&&t.virtual.cache[O])return t.virtual.cache[O];let P;return D.renderSlide?(P=D.renderSlide.call(t,N,O),typeof P=="string"&&(p.innerHTML=P,P=p.children[0])):t.isElement?P=Kd("swiper-slide"):P=Kd("div",t.params.slideClass),P.setAttribute("data-swiper-slide-index",O),D.renderSlide||(P.innerHTML=N),D.cache&&(t.virtual.cache[O]=P),P}function _(N){const{slidesPerView:O,slidesPerGroup:D,centeredSlides:P,loop:j}=t.params,{addSlidesBefore:M,addSlidesAfter:V}=t.params.virtual,{from:H,to:$,slides:Q,slidesGrid:Y,offset:le}=t.virtual;t.params.cssMode||t.updateActiveIndex();const ae=t.activeIndex||0;let te;t.rtlTranslate?te="right":te=t.isHorizontal()?"left":"top";let de,G;P?(de=Math.floor(O/2)+D+V,G=Math.floor(O/2)+D+M):(de=O+(D-1)+V,G=(j?O:D)+M);let ie=ae-G,_e=ae+de;j||(ie=Math.max(ie,0),_e=Math.min(_e,Q.length-1));let he=(t.slidesGrid[ie]||0)-(t.slidesGrid[0]||0);j&&ae>=G?(ie-=G,P||(he+=t.slidesGrid[0])):j&&ae<G&&(ie=-G,P&&(he+=t.slidesGrid[0])),Object.assign(t.virtual,{from:ie,to:_e,offset:he,slidesGrid:t.slidesGrid,slidesBefore:G,slidesAfter:de});function Ce(){t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),l("virtualUpdate")}if(H===ie&&$===_e&&!N){t.slidesGrid!==Y&&he!==le&&t.slides.forEach(Ve=>{Ve.style[te]=`${he-Math.abs(t.cssOverflowAdjustment())}px`}),t.updateProgress(),l("virtualUpdate");return}if(t.params.virtual.renderExternal){t.params.virtual.renderExternal.call(t,{offset:he,from:ie,to:_e,slides:function(){const Re=[];for(let Be=ie;Be<=_e;Be+=1)Re.push(Q[Be]);return Re}()}),t.params.virtual.renderExternalUpdate?Ce():l("virtualUpdate");return}const fe=[],me=[],Ne=Ve=>{let Re=Ve;return Ve<0?Re=Q.length+Ve:Re>=Q.length&&(Re=Re-Q.length),Re};if(N)t.slides.filter(Ve=>Ve.matches(`.${t.params.slideClass}, swiper-slide`)).forEach(Ve=>{Ve.remove()});else for(let Ve=H;Ve<=$;Ve+=1)if(Ve<ie||Ve>_e){const Re=Ne(Ve);t.slides.filter(Be=>Be.matches(`.${t.params.slideClass}[data-swiper-slide-index="${Re}"], swiper-slide[data-swiper-slide-index="${Re}"]`)).forEach(Be=>{Be.remove()})}const Fe=j?-Q.length:0,je=j?Q.length*2:Q.length;for(let Ve=Fe;Ve<je;Ve+=1)if(Ve>=ie&&Ve<=_e){const Re=Ne(Ve);typeof $>"u"||N?me.push(Re):(Ve>$&&me.push(Re),Ve<H&&fe.push(Re))}if(me.forEach(Ve=>{t.slidesEl.append(g(Q[Ve],Ve))}),j)for(let Ve=fe.length-1;Ve>=0;Ve-=1){const Re=fe[Ve];t.slidesEl.prepend(g(Q[Re],Re))}else fe.sort((Ve,Re)=>Re-Ve),fe.forEach(Ve=>{t.slidesEl.prepend(g(Q[Ve],Ve))});$o(t.slidesEl,".swiper-slide, swiper-slide").forEach(Ve=>{Ve.style[te]=`${he-Math.abs(t.cssOverflowAdjustment())}px`}),Ce()}function y(N){if(typeof N=="object"&&"length"in N)for(let O=0;O<N.length;O+=1)N[O]&&t.virtual.slides.push(N[O]);else t.virtual.slides.push(N);_(!0)}function E(N){const O=t.activeIndex;let D=O+1,P=1;if(Array.isArray(N)){for(let j=0;j<N.length;j+=1)N[j]&&t.virtual.slides.unshift(N[j]);D=O+N.length,P=N.length}else t.virtual.slides.unshift(N);if(t.params.virtual.cache){const j=t.virtual.cache,M={};Object.keys(j).forEach(V=>{const H=j[V],$=H.getAttribute("data-swiper-slide-index");$&&H.setAttribute("data-swiper-slide-index",parseInt($,10)+P),M[parseInt(V,10)+P]=H}),t.virtual.cache=M}_(!0),t.slideTo(D,0)}function b(N){if(typeof N>"u"||N===null)return;let O=t.activeIndex;if(Array.isArray(N))for(let D=N.length-1;D>=0;D-=1)t.params.virtual.cache&&(delete t.virtual.cache[N[D]],Object.keys(t.virtual.cache).forEach(P=>{P>N&&(t.virtual.cache[P-1]=t.virtual.cache[P],t.virtual.cache[P-1].setAttribute("data-swiper-slide-index",P-1),delete t.virtual.cache[P])})),t.virtual.slides.splice(N[D],1),N[D]<O&&(O-=1),O=Math.max(O,0);else t.params.virtual.cache&&(delete t.virtual.cache[N],Object.keys(t.virtual.cache).forEach(D=>{D>N&&(t.virtual.cache[D-1]=t.virtual.cache[D],t.virtual.cache[D-1].setAttribute("data-swiper-slide-index",D-1),delete t.virtual.cache[D])})),t.virtual.slides.splice(N,1),N<O&&(O-=1),O=Math.max(O,0);_(!0),t.slideTo(O,0)}function A(){t.virtual.slides=[],t.params.virtual.cache&&(t.virtual.cache={}),_(!0),t.slideTo(0,0)}s("beforeInit",()=>{if(!t.params.virtual.enabled)return;let N;if(typeof t.passedParams.virtual.slides>"u"){const O=[...t.slidesEl.children].filter(D=>D.matches(`.${t.params.slideClass}, swiper-slide`));O&&O.length&&(t.virtual.slides=[...O],N=!0,O.forEach((D,P)=>{D.setAttribute("data-swiper-slide-index",P),t.virtual.cache[P]=D,D.remove()}))}N||(t.virtual.slides=t.params.virtual.slides),t.classNames.push(`${t.params.containerModifierClass}virtual`),t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0,_()}),s("setTranslate",()=>{t.params.virtual.enabled&&(t.params.cssMode&&!t._immediateVirtual?(clearTimeout(d),d=setTimeout(()=>{_()},100)):_())}),s("init update resize",()=>{t.params.virtual.enabled&&t.params.cssMode&&LI(t.wrapperEl,"--swiper-virtual-size",`${t.virtualSize}px`)}),Object.assign(t.virtual,{appendSlide:y,prependSlide:E,removeSlide:b,removeAllSlides:A,update:_})}function SKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=lc(),u=ea();t.keyboard={enabled:!1},i({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function p(y){if(!t.enabled)return;const{rtlTranslate:E}=t;let b=y;b.originalEvent&&(b=b.originalEvent);const A=b.keyCode||b.charCode,N=t.params.keyboard.pageUpDown,O=N&&A===33,D=N&&A===34,P=A===37,j=A===39,M=A===38,V=A===40;if(!t.allowSlideNext&&(t.isHorizontal()&&j||t.isVertical()&&V||D)||!t.allowSlidePrev&&(t.isHorizontal()&&P||t.isVertical()&&M||O))return!1;if(!(b.shiftKey||b.altKey||b.ctrlKey||b.metaKey)&&!(d.activeElement&&d.activeElement.nodeName&&(d.activeElement.nodeName.toLowerCase()==="input"||d.activeElement.nodeName.toLowerCase()==="textarea"))){if(t.params.keyboard.onlyInViewport&&(O||D||P||j||M||V)){let H=!1;if(vE(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&vE(t.el,`.${t.params.slideActiveClass}`).length===0)return;const $=t.el,Q=$.clientWidth,Y=$.clientHeight,le=u.innerWidth,ae=u.innerHeight,te=C7($);E&&(te.left-=$.scrollLeft);const de=[[te.left,te.top],[te.left+Q,te.top],[te.left,te.top+Y],[te.left+Q,te.top+Y]];for(let G=0;G<de.length;G+=1){const ie=de[G];if(ie[0]>=0&&ie[0]<=le&&ie[1]>=0&&ie[1]<=ae){if(ie[0]===0&&ie[1]===0)continue;H=!0}}if(!H)return}t.isHorizontal()?((O||D||P||j)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),((D||j)&&!E||(O||P)&&E)&&t.slideNext(),((O||P)&&!E||(D||j)&&E)&&t.slidePrev()):((O||D||M||V)&&(b.preventDefault?b.preventDefault():b.returnValue=!1),(D||V)&&t.slideNext(),(O||M)&&t.slidePrev()),l("keyPress",A)}}function g(){t.keyboard.enabled||(d.addEventListener("keydown",p),t.keyboard.enabled=!0)}function _(){t.keyboard.enabled&&(d.removeEventListener("keydown",p),t.keyboard.enabled=!1)}s("init",()=>{t.params.keyboard.enabled&&g()}),s("destroy",()=>{t.keyboard.enabled&&_()}),Object.assign(t.keyboard,{enable:g,disable:_})}function bKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=ea();i({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let u,p=Zu(),g;const _=[];function y(M){let Q=0,Y=0,le=0,ae=0;return"detail"in M&&(Y=M.detail),"wheelDelta"in M&&(Y=-M.wheelDelta/120),"wheelDeltaY"in M&&(Y=-M.wheelDeltaY/120),"wheelDeltaX"in M&&(Q=-M.wheelDeltaX/120),"axis"in M&&M.axis===M.HORIZONTAL_AXIS&&(Q=Y,Y=0),le=Q*10,ae=Y*10,"deltaY"in M&&(ae=M.deltaY),"deltaX"in M&&(le=M.deltaX),M.shiftKey&&!le&&(le=ae,ae=0),(le||ae)&&M.deltaMode&&(M.deltaMode===1?(le*=40,ae*=40):(le*=800,ae*=800)),le&&!Q&&(Q=le<1?-1:1),ae&&!Y&&(Y=ae<1?-1:1),{spinX:Q,spinY:Y,pixelX:le,pixelY:ae}}function E(){t.enabled&&(t.mouseEntered=!0)}function b(){t.enabled&&(t.mouseEntered=!1)}function A(M){return t.params.mousewheel.thresholdDelta&&M.delta<t.params.mousewheel.thresholdDelta||t.params.mousewheel.thresholdTime&&Zu()-p<t.params.mousewheel.thresholdTime?!1:M.delta>=6&&Zu()-p<60?!0:(M.direction<0?(!t.isEnd||t.params.loop)&&!t.animating&&(t.slideNext(),l("scroll",M.raw)):(!t.isBeginning||t.params.loop)&&!t.animating&&(t.slidePrev(),l("scroll",M.raw)),p=new d.Date().getTime(),!1)}function N(M){const V=t.params.mousewheel;if(M.direction<0){if(t.isEnd&&!t.params.loop&&V.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&V.releaseOnEdges)return!0;return!1}function O(M){let V=M,H=!0;if(!t.enabled||M.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const $=t.params.mousewheel;t.params.cssMode&&V.preventDefault();let Q=t.el;t.params.mousewheel.eventsTarget!=="container"&&(Q=document.querySelector(t.params.mousewheel.eventsTarget));const Y=Q&&Q.contains(V.target);if(!t.mouseEntered&&!Y&&!$.releaseOnEdges)return!0;V.originalEvent&&(V=V.originalEvent);let le=0;const ae=t.rtlTranslate?-1:1,te=y(V);if($.forceToAxis)if(t.isHorizontal())if(Math.abs(te.pixelX)>Math.abs(te.pixelY))le=-te.pixelX*ae;else return!0;else if(Math.abs(te.pixelY)>Math.abs(te.pixelX))le=-te.pixelY;else return!0;else le=Math.abs(te.pixelX)>Math.abs(te.pixelY)?-te.pixelX*ae:-te.pixelY;if(le===0)return!0;$.invert&&(le=-le);let de=t.getTranslate()+le*$.sensitivity;if(de>=t.minTranslate()&&(de=t.minTranslate()),de<=t.maxTranslate()&&(de=t.maxTranslate()),H=t.params.loop?!0:!(de===t.minTranslate()||de===t.maxTranslate()),H&&t.params.nested&&V.stopPropagation(),!t.params.freeMode||!t.params.freeMode.enabled){const G={time:Zu(),delta:Math.abs(le),direction:Math.sign(le),raw:M};_.length>=2&&_.shift();const ie=_.length?_[_.length-1]:void 0;if(_.push(G),ie?(G.direction!==ie.direction||G.delta>ie.delta||G.time>ie.time+150)&&A(G):A(G),N(G))return!0}else{const G={time:Zu(),delta:Math.abs(le),direction:Math.sign(le)},ie=g&&G.time<g.time+500&&G.delta<=g.delta&&G.direction===g.direction;if(!ie){g=void 0;let _e=t.getTranslate()+le*$.sensitivity;const he=t.isBeginning,Ce=t.isEnd;if(_e>=t.minTranslate()&&(_e=t.minTranslate()),_e<=t.maxTranslate()&&(_e=t.maxTranslate()),t.setTransition(0),t.setTranslate(_e),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!he&&t.isBeginning||!Ce&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:G.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(u),u=void 0,_.length>=15&&_.shift();const fe=_.length?_[_.length-1]:void 0,me=_[0];if(_.push(G),fe&&(G.delta>fe.delta||G.direction!==fe.direction))_.splice(0);else if(_.length>=15&&G.time-me.time<500&&me.delta-G.delta>=1&&G.delta<=6){const Ne=le>0?.8:.2;g=G,_.splice(0),u=xE(()=>{t.slideToClosest(t.params.speed,!0,void 0,Ne)},0)}u||(u=xE(()=>{g=G,_.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5)},500))}if(ie||l("scroll",V),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),$.releaseOnEdges&&(_e===t.minTranslate()||_e===t.maxTranslate()))return!0}}return V.preventDefault?V.preventDefault():V.returnValue=!1,!1}function D(M){let V=t.el;t.params.mousewheel.eventsTarget!=="container"&&(V=document.querySelector(t.params.mousewheel.eventsTarget)),V[M]("mouseenter",E),V[M]("mouseleave",b),V[M]("wheel",O)}function P(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",O),!0):t.mousewheel.enabled?!1:(D("addEventListener"),t.mousewheel.enabled=!0,!0)}function j(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,O),!0):t.mousewheel.enabled?(D("removeEventListener"),t.mousewheel.enabled=!1,!0):!1}s("init",()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&j(),t.params.mousewheel.enabled&&P()}),s("destroy",()=>{t.params.cssMode&&P(),t.mousewheel.enabled&&j()}),Object.assign(t.mousewheel,{enable:P,disable:j})}function qQ(n,t,i,s){return n.params.createElements&&Object.keys(s).forEach(l=>{if(!i[l]&&i.auto===!0){let d=$o(n.el,`.${s[l]}`)[0];d||(d=Kd("div",s[l]),d.className=s[l],n.el.append(d)),i[l]=d,t[l]=d}}),i}function CKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;i({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};function d(N){let O;return N&&typeof N=="string"&&t.isElement&&(O=t.el.querySelector(N),O)?O:(N&&(typeof N=="string"&&(O=[...document.querySelectorAll(N)]),t.params.uniqueNavElements&&typeof N=="string"&&O.length>1&&t.el.querySelectorAll(N).length===1&&(O=t.el.querySelector(N))),N&&!O?N:O)}function u(N,O){const D=t.params.navigation;N=lr(N),N.forEach(P=>{P&&(P.classList[O?"add":"remove"](...D.disabledClass.split(" ")),P.tagName==="BUTTON"&&(P.disabled=O),t.params.watchOverflow&&t.enabled&&P.classList[t.isLocked?"add":"remove"](D.lockClass))})}function p(){const{nextEl:N,prevEl:O}=t.navigation;if(t.params.loop){u(O,!1),u(N,!1);return}u(O,t.isBeginning&&!t.params.rewind),u(N,t.isEnd&&!t.params.rewind)}function g(N){N.preventDefault(),!(t.isBeginning&&!t.params.loop&&!t.params.rewind)&&(t.slidePrev(),l("navigationPrev"))}function _(N){N.preventDefault(),!(t.isEnd&&!t.params.loop&&!t.params.rewind)&&(t.slideNext(),l("navigationNext"))}function y(){const N=t.params.navigation;if(t.params.navigation=qQ(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(N.nextEl||N.prevEl))return;let O=d(N.nextEl),D=d(N.prevEl);Object.assign(t.navigation,{nextEl:O,prevEl:D}),O=lr(O),D=lr(D);const P=(j,M)=>{j&&j.addEventListener("click",M==="next"?_:g),!t.enabled&&j&&j.classList.add(...N.lockClass.split(" "))};O.forEach(j=>P(j,"next")),D.forEach(j=>P(j,"prev"))}function E(){let{nextEl:N,prevEl:O}=t.navigation;N=lr(N),O=lr(O);const D=(P,j)=>{P.removeEventListener("click",j==="next"?_:g),P.classList.remove(...t.params.navigation.disabledClass.split(" "))};N.forEach(P=>D(P,"next")),O.forEach(P=>D(P,"prev"))}s("init",()=>{t.params.navigation.enabled===!1?A():(y(),p())}),s("toEdge fromEdge lock unlock",()=>{p()}),s("destroy",()=>{E()}),s("enable disable",()=>{let{nextEl:N,prevEl:O}=t.navigation;if(N=lr(N),O=lr(O),t.enabled){p();return}[...N,...O].filter(D=>!!D).forEach(D=>D.classList.add(t.params.navigation.lockClass))}),s("click",(N,O)=>{let{nextEl:D,prevEl:P}=t.navigation;D=lr(D),P=lr(P);const j=O.target;if(t.params.navigation.hideOnClick&&!P.includes(j)&&!D.includes(j)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===j||t.pagination.el.contains(j)))return;let M;D.length?M=D[0].classList.contains(t.params.navigation.hiddenClass):P.length&&(M=P[0].classList.contains(t.params.navigation.hiddenClass)),l(M===!0?"navigationShow":"navigationHide"),[...D,...P].filter(V=>!!V).forEach(V=>V.classList.toggle(t.params.navigation.hiddenClass))}});const b=()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),y(),p()},A=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),E()};Object.assign(t.navigation,{enable:b,disable:A,update:p,init:y,destroy:E})}function bg(n){return n===void 0&&(n=""),`.${n.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function TKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d="swiper-pagination";i({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:P=>P,formatFractionTotal:P=>P,bulletClass:`${d}-bullet`,bulletActiveClass:`${d}-bullet-active`,modifierClass:`${d}-`,currentClass:`${d}-current`,totalClass:`${d}-total`,hiddenClass:`${d}-hidden`,progressbarFillClass:`${d}-progressbar-fill`,progressbarOppositeClass:`${d}-progressbar-opposite`,clickableClass:`${d}-clickable`,lockClass:`${d}-lock`,horizontalClass:`${d}-horizontal`,verticalClass:`${d}-vertical`,paginationDisabledClass:`${d}-disabled`}}),t.pagination={el:null,bullets:[]};let u,p=0;function g(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&t.pagination.el.length===0}function _(P,j){const{bulletActiveClass:M}=t.params.pagination;P&&(P=P[`${j==="prev"?"previous":"next"}ElementSibling`],P&&(P.classList.add(`${M}-${j}`),P=P[`${j==="prev"?"previous":"next"}ElementSibling`],P&&P.classList.add(`${M}-${j}-${j}`)))}function y(P){const j=P.target.closest(bg(t.params.pagination.bulletClass));if(!j)return;P.preventDefault();const M=q4(j)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===M)return;t.slideToLoop(M)}else t.slideTo(M)}function E(){const P=t.rtl,j=t.params.pagination;if(g())return;let M=t.pagination.el;M=lr(M);let V,H;const $=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,Q=t.params.loop?Math.ceil($/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(H=t.previousRealIndex||0,V=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):typeof t.snapIndex<"u"?(V=t.snapIndex,H=t.previousSnapIndex):(H=t.previousIndex||0,V=t.activeIndex||0),j.type==="bullets"&&t.pagination.bullets&&t.pagination.bullets.length>0){const Y=t.pagination.bullets;let le,ae,te;if(j.dynamicBullets&&(u=Yq(Y[0],t.isHorizontal()?"width":"height",!0),M.forEach(de=>{de.style[t.isHorizontal()?"width":"height"]=`${u*(j.dynamicMainBullets+4)}px`}),j.dynamicMainBullets>1&&H!==void 0&&(p+=V-(H||0),p>j.dynamicMainBullets-1?p=j.dynamicMainBullets-1:p<0&&(p=0)),le=Math.max(V-p,0),ae=le+(Math.min(Y.length,j.dynamicMainBullets)-1),te=(ae+le)/2),Y.forEach(de=>{const G=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(ie=>`${j.bulletActiveClass}${ie}`)].map(ie=>typeof ie=="string"&&ie.includes(" ")?ie.split(" "):ie).flat();de.classList.remove(...G)}),M.length>1)Y.forEach(de=>{const G=q4(de);G===V?de.classList.add(...j.bulletActiveClass.split(" ")):t.isElement&&de.setAttribute("part","bullet"),j.dynamicBullets&&(G>=le&&G<=ae&&de.classList.add(...`${j.bulletActiveClass}-main`.split(" ")),G===le&&_(de,"prev"),G===ae&&_(de,"next"))});else{const de=Y[V];if(de&&de.classList.add(...j.bulletActiveClass.split(" ")),t.isElement&&Y.forEach((G,ie)=>{G.setAttribute("part",ie===V?"bullet-active":"bullet")}),j.dynamicBullets){const G=Y[le],ie=Y[ae];for(let _e=le;_e<=ae;_e+=1)Y[_e]&&Y[_e].classList.add(...`${j.bulletActiveClass}-main`.split(" "));_(G,"prev"),_(ie,"next")}}if(j.dynamicBullets){const de=Math.min(Y.length,j.dynamicMainBullets+4),G=(u*de-u)/2-te*u,ie=P?"right":"left";Y.forEach(_e=>{_e.style[t.isHorizontal()?ie:"top"]=`${G}px`})}}M.forEach((Y,le)=>{if(j.type==="fraction"&&(Y.querySelectorAll(bg(j.currentClass)).forEach(ae=>{ae.textContent=j.formatFractionCurrent(V+1)}),Y.querySelectorAll(bg(j.totalClass)).forEach(ae=>{ae.textContent=j.formatFractionTotal(Q)})),j.type==="progressbar"){let ae;j.progressbarOpposite?ae=t.isHorizontal()?"vertical":"horizontal":ae=t.isHorizontal()?"horizontal":"vertical";const te=(V+1)/Q;let de=1,G=1;ae==="horizontal"?de=te:G=te,Y.querySelectorAll(bg(j.progressbarFillClass)).forEach(ie=>{ie.style.transform=`translate3d(0,0,0) scaleX(${de}) scaleY(${G})`,ie.style.transitionDuration=`${t.params.speed}ms`})}j.type==="custom"&&j.renderCustom?(Y.innerHTML=j.renderCustom(t,V+1,Q),le===0&&l("paginationRender",Y)):(le===0&&l("paginationRender",Y),l("paginationUpdate",Y)),t.params.watchOverflow&&t.enabled&&Y.classList[t.isLocked?"add":"remove"](j.lockClass)})}function b(){const P=t.params.pagination;if(g())return;const j=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let M=t.pagination.el;M=lr(M);let V="";if(P.type==="bullets"){let H=t.params.loop?Math.ceil(j/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&H>j&&(H=j);for(let $=0;$<H;$+=1)P.renderBullet?V+=P.renderBullet.call(t,$,P.bulletClass):V+=`<${P.bulletElement} ${t.isElement?'part="bullet"':""} class="${P.bulletClass}"></${P.bulletElement}>`}P.type==="fraction"&&(P.renderFraction?V=P.renderFraction.call(t,P.currentClass,P.totalClass):V=`<span class="${P.currentClass}"></span> / <span class="${P.totalClass}"></span>`),P.type==="progressbar"&&(P.renderProgressbar?V=P.renderProgressbar.call(t,P.progressbarFillClass):V=`<span class="${P.progressbarFillClass}"></span>`),t.pagination.bullets=[],M.forEach(H=>{P.type!=="custom"&&(H.innerHTML=V||""),P.type==="bullets"&&t.pagination.bullets.push(...H.querySelectorAll(bg(P.bulletClass)))}),P.type!=="custom"&&l("paginationRender",M[0])}function A(){t.params.pagination=qQ(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const P=t.params.pagination;if(!P.el)return;let j;typeof P.el=="string"&&t.isElement&&(j=t.el.querySelector(P.el)),!j&&typeof P.el=="string"&&(j=[...document.querySelectorAll(P.el)]),j||(j=P.el),!(!j||j.length===0)&&(t.params.uniqueNavElements&&typeof P.el=="string"&&Array.isArray(j)&&j.length>1&&(j=[...t.el.querySelectorAll(P.el)],j.length>1&&(j=j.filter(M=>vE(M,".swiper")[0]===t.el)[0])),Array.isArray(j)&&j.length===1&&(j=j[0]),Object.assign(t.pagination,{el:j}),j=lr(j),j.forEach(M=>{P.type==="bullets"&&P.clickable&&M.classList.add(...(P.clickableClass||"").split(" ")),M.classList.add(P.modifierClass+P.type),M.classList.add(t.isHorizontal()?P.horizontalClass:P.verticalClass),P.type==="bullets"&&P.dynamicBullets&&(M.classList.add(`${P.modifierClass}${P.type}-dynamic`),p=0,P.dynamicMainBullets<1&&(P.dynamicMainBullets=1)),P.type==="progressbar"&&P.progressbarOpposite&&M.classList.add(P.progressbarOppositeClass),P.clickable&&M.addEventListener("click",y),t.enabled||M.classList.add(P.lockClass)}))}function N(){const P=t.params.pagination;if(g())return;let j=t.pagination.el;j&&(j=lr(j),j.forEach(M=>{M.classList.remove(P.hiddenClass),M.classList.remove(P.modifierClass+P.type),M.classList.remove(t.isHorizontal()?P.horizontalClass:P.verticalClass),P.clickable&&(M.classList.remove(...(P.clickableClass||"").split(" ")),M.removeEventListener("click",y))})),t.pagination.bullets&&t.pagination.bullets.forEach(M=>M.classList.remove(...P.bulletActiveClass.split(" ")))}s("changeDirection",()=>{if(!t.pagination||!t.pagination.el)return;const P=t.params.pagination;let{el:j}=t.pagination;j=lr(j),j.forEach(M=>{M.classList.remove(P.horizontalClass,P.verticalClass),M.classList.add(t.isHorizontal()?P.horizontalClass:P.verticalClass)})}),s("init",()=>{t.params.pagination.enabled===!1?D():(A(),b(),E())}),s("activeIndexChange",()=>{typeof t.snapIndex>"u"&&E()}),s("snapIndexChange",()=>{E()}),s("snapGridLengthChange",()=>{b(),E()}),s("destroy",()=>{N()}),s("enable disable",()=>{let{el:P}=t.pagination;P&&(P=lr(P),P.forEach(j=>j.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass)))}),s("lock unlock",()=>{E()}),s("click",(P,j)=>{const M=j.target,V=lr(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&V&&V.length>0&&!M.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&M===t.navigation.nextEl||t.navigation.prevEl&&M===t.navigation.prevEl))return;const H=V[0].classList.contains(t.params.pagination.hiddenClass);l(H===!0?"paginationShow":"paginationHide"),V.forEach($=>$.classList.toggle(t.params.pagination.hiddenClass))}});const O=()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:P}=t.pagination;P&&(P=lr(P),P.forEach(j=>j.classList.remove(t.params.pagination.paginationDisabledClass))),A(),b(),E()},D=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:P}=t.pagination;P&&(P=lr(P),P.forEach(j=>j.classList.add(t.params.pagination.paginationDisabledClass))),N()};Object.assign(t.pagination,{enable:O,disable:D,render:b,update:E,init:A,destroy:N})}function RKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=lc();let u=!1,p=null,g=null,_,y,E,b;i({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null};function A(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:de,rtlTranslate:G}=t,{dragEl:ie,el:_e}=de,he=t.params.scrollbar,Ce=t.params.loop?t.progressLoop:t.progress;let fe=y,me=(E-y)*Ce;G?(me=-me,me>0?(fe=y-me,me=0):-me+y>E&&(fe=E+me)):me<0?(fe=y+me,me=0):me+y>E&&(fe=E-me),t.isHorizontal()?(ie.style.transform=`translate3d(${me}px, 0, 0)`,ie.style.width=`${fe}px`):(ie.style.transform=`translate3d(0px, ${me}px, 0)`,ie.style.height=`${fe}px`),he.hide&&(clearTimeout(p),_e.style.opacity=1,p=setTimeout(()=>{_e.style.opacity=0,_e.style.transitionDuration="400ms"},1e3))}function N(de){!t.params.scrollbar.el||!t.scrollbar.el||(t.scrollbar.dragEl.style.transitionDuration=`${de}ms`)}function O(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:de}=t,{dragEl:G,el:ie}=de;G.style.width="",G.style.height="",E=t.isHorizontal()?ie.offsetWidth:ie.offsetHeight,b=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),t.params.scrollbar.dragSize==="auto"?y=E*b:y=parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?G.style.width=`${y}px`:G.style.height=`${y}px`,b>=1?ie.style.display="none":ie.style.display="",t.params.scrollbar.hide&&(ie.style.opacity=0),t.params.watchOverflow&&t.enabled&&de.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function D(de){return t.isHorizontal()?de.clientX:de.clientY}function P(de){const{scrollbar:G,rtlTranslate:ie}=t,{el:_e}=G;let he;he=(D(de)-C7(_e)[t.isHorizontal()?"left":"top"]-(_!==null?_:y/2))/(E-y),he=Math.max(Math.min(he,1),0),ie&&(he=1-he);const Ce=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*he;t.updateProgress(Ce),t.setTranslate(Ce),t.updateActiveIndex(),t.updateSlidesClasses()}function j(de){const G=t.params.scrollbar,{scrollbar:ie,wrapperEl:_e}=t,{el:he,dragEl:Ce}=ie;u=!0,_=de.target===Ce?D(de)-de.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,de.preventDefault(),de.stopPropagation(),_e.style.transitionDuration="100ms",Ce.style.transitionDuration="100ms",P(de),clearTimeout(g),he.style.transitionDuration="0ms",G.hide&&(he.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),l("scrollbarDragStart",de)}function M(de){const{scrollbar:G,wrapperEl:ie}=t,{el:_e,dragEl:he}=G;u&&(de.preventDefault?de.preventDefault():de.returnValue=!1,P(de),ie.style.transitionDuration="0ms",_e.style.transitionDuration="0ms",he.style.transitionDuration="0ms",l("scrollbarDragMove",de))}function V(de){const G=t.params.scrollbar,{scrollbar:ie,wrapperEl:_e}=t,{el:he}=ie;u&&(u=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",_e.style.transitionDuration=""),G.hide&&(clearTimeout(g),g=xE(()=>{he.style.opacity=0,he.style.transitionDuration="400ms"},1e3)),l("scrollbarDragEnd",de),G.snapOnRelease&&t.slideToClosest())}function H(de){const{scrollbar:G,params:ie}=t,_e=G.el;if(!_e)return;const he=_e,Ce=ie.passiveListeners?{passive:!1,capture:!1}:!1,fe=ie.passiveListeners?{passive:!0,capture:!1}:!1;if(!he)return;const me=de==="on"?"addEventListener":"removeEventListener";he[me]("pointerdown",j,Ce),d[me]("pointermove",M,Ce),d[me]("pointerup",V,fe)}function $(){!t.params.scrollbar.el||!t.scrollbar.el||H("on")}function Q(){!t.params.scrollbar.el||!t.scrollbar.el||H("off")}function Y(){const{scrollbar:de,el:G}=t;t.params.scrollbar=qQ(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const ie=t.params.scrollbar;if(!ie.el)return;let _e;if(typeof ie.el=="string"&&t.isElement&&(_e=t.el.querySelector(ie.el)),!_e&&typeof ie.el=="string"){if(_e=d.querySelectorAll(ie.el),!_e.length)return}else _e||(_e=ie.el);t.params.uniqueNavElements&&typeof ie.el=="string"&&_e.length>1&&G.querySelectorAll(ie.el).length===1&&(_e=G.querySelector(ie.el)),_e.length>0&&(_e=_e[0]),_e.classList.add(t.isHorizontal()?ie.horizontalClass:ie.verticalClass);let he;_e&&(he=_e.querySelector(bg(t.params.scrollbar.dragClass)),he||(he=Kd("div",t.params.scrollbar.dragClass),_e.append(he))),Object.assign(de,{el:_e,dragEl:he}),ie.draggable&&$(),_e&&_e.classList[t.enabled?"remove":"add"](...Z0(t.params.scrollbar.lockClass))}function le(){const de=t.params.scrollbar,G=t.scrollbar.el;G&&G.classList.remove(...Z0(t.isHorizontal()?de.horizontalClass:de.verticalClass)),Q()}s("changeDirection",()=>{if(!t.scrollbar||!t.scrollbar.el)return;const de=t.params.scrollbar;let{el:G}=t.scrollbar;G=lr(G),G.forEach(ie=>{ie.classList.remove(de.horizontalClass,de.verticalClass),ie.classList.add(t.isHorizontal()?de.horizontalClass:de.verticalClass)})}),s("init",()=>{t.params.scrollbar.enabled===!1?te():(Y(),O(),A())}),s("update resize observerUpdate lock unlock changeDirection",()=>{O()}),s("setTranslate",()=>{A()}),s("setTransition",(de,G)=>{N(G)}),s("enable disable",()=>{const{el:de}=t.scrollbar;de&&de.classList[t.enabled?"remove":"add"](...Z0(t.params.scrollbar.lockClass))}),s("destroy",()=>{le()});const ae=()=>{t.el.classList.remove(...Z0(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.remove(...Z0(t.params.scrollbar.scrollbarDisabledClass)),Y(),O(),A()},te=()=>{t.el.classList.add(...Z0(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.add(...Z0(t.params.scrollbar.scrollbarDisabledClass)),le()};Object.assign(t.scrollbar,{enable:ae,disable:te,updateSize:O,setTranslate:A,init:Y,destroy:le})}function xKe(n){let{swiper:t,extendParams:i,on:s}=n;i({parallax:{enabled:!1}});const l="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",d=(g,_)=>{const{rtl:y}=t,E=y?-1:1,b=g.getAttribute("data-swiper-parallax")||"0";let A=g.getAttribute("data-swiper-parallax-x"),N=g.getAttribute("data-swiper-parallax-y");const O=g.getAttribute("data-swiper-parallax-scale"),D=g.getAttribute("data-swiper-parallax-opacity"),P=g.getAttribute("data-swiper-parallax-rotate");if(A||N?(A=A||"0",N=N||"0"):t.isHorizontal()?(A=b,N="0"):(N=b,A="0"),A.indexOf("%")>=0?A=`${parseInt(A,10)*_*E}%`:A=`${A*_*E}px`,N.indexOf("%")>=0?N=`${parseInt(N,10)*_}%`:N=`${N*_}px`,typeof D<"u"&&D!==null){const M=D-(D-1)*(1-Math.abs(_));g.style.opacity=M}let j=`translate3d(${A}, ${N}, 0px)`;if(typeof O<"u"&&O!==null){const M=O-(O-1)*(1-Math.abs(_));j+=` scale(${M})`}if(P&&typeof P<"u"&&P!==null){const M=P*_*-1;j+=` rotate(${M}deg)`}g.style.transform=j},u=()=>{const{el:g,slides:_,progress:y,snapGrid:E,isElement:b}=t,A=$o(g,l);t.isElement&&A.push(...$o(t.hostEl,l)),A.forEach(N=>{d(N,y)}),_.forEach((N,O)=>{let D=N.progress;t.params.slidesPerGroup>1&&t.params.slidesPerView!=="auto"&&(D+=Math.ceil(O/2)-y*(E.length-1)),D=Math.min(Math.max(D,-1),1),N.querySelectorAll(`${l}, [data-swiper-parallax-rotate]`).forEach(P=>{d(P,D)})})},p=function(g){g===void 0&&(g=t.params.speed);const{el:_,hostEl:y}=t,E=[..._.querySelectorAll(l)];t.isElement&&E.push(...y.querySelectorAll(l)),E.forEach(b=>{let A=parseInt(b.getAttribute("data-swiper-parallax-duration"),10)||g;g===0&&(A=0),b.style.transitionDuration=`${A}ms`})};s("beforeInit",()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)}),s("init",()=>{t.params.parallax.enabled&&u()}),s("setTranslate",()=>{t.params.parallax.enabled&&u()}),s("setTransition",(g,_)=>{t.params.parallax.enabled&&p(_)})}function AKe(n){let{swiper:t,extendParams:i,on:s,emit:l}=n;const d=ea();i({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let u=1,p=!1,g,_;const y=[],E={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},b={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},A={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let N=1;Object.defineProperty(t.zoom,"scale",{get(){return N},set(Ce){if(N!==Ce){const fe=E.imageEl,me=E.slideEl;l("zoomChange",Ce,fe,me)}N=Ce}});function O(){if(y.length<2)return 1;const Ce=y[0].pageX,fe=y[0].pageY,me=y[1].pageX,Ne=y[1].pageY;return Math.sqrt((me-Ce)**2+(Ne-fe)**2)}function D(){if(y.length<2)return{x:null,y:null};const Ce=E.imageEl.getBoundingClientRect();return[(y[0].pageX+(y[1].pageX-y[0].pageX)/2-Ce.x-d.scrollX)/u,(y[0].pageY+(y[1].pageY-y[0].pageY)/2-Ce.y-d.scrollY)/u]}function P(){return t.isElement?"swiper-slide":`.${t.params.slideClass}`}function j(Ce){const fe=P();return!!(Ce.target.matches(fe)||t.slides.filter(me=>me.contains(Ce.target)).length>0)}function M(Ce){const fe=`.${t.params.zoom.containerClass}`;return!!(Ce.target.matches(fe)||[...t.hostEl.querySelectorAll(fe)].filter(me=>me.contains(Ce.target)).length>0)}function V(Ce){if(Ce.pointerType==="mouse"&&y.splice(0,y.length),!j(Ce))return;const fe=t.params.zoom;if(g=!1,_=!1,y.push(Ce),!(y.length<2)){if(g=!0,E.scaleStart=O(),!E.slideEl){E.slideEl=Ce.target.closest(`.${t.params.slideClass}, swiper-slide`),E.slideEl||(E.slideEl=t.slides[t.activeIndex]);let me=E.slideEl.querySelector(`.${fe.containerClass}`);if(me&&(me=me.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=me,me?E.imageWrapEl=vE(E.imageEl,`.${fe.containerClass}`)[0]:E.imageWrapEl=void 0,!E.imageWrapEl){E.imageEl=void 0;return}E.maxRatio=E.imageWrapEl.getAttribute("data-swiper-zoom")||fe.maxRatio}if(E.imageEl){const[me,Ne]=D();E.originX=me,E.originY=Ne,E.imageEl.style.transitionDuration="0ms"}p=!0}}function H(Ce){if(!j(Ce))return;const fe=t.params.zoom,me=t.zoom,Ne=y.findIndex(Fe=>Fe.pointerId===Ce.pointerId);Ne>=0&&(y[Ne]=Ce),!(y.length<2)&&(_=!0,E.scaleMove=O(),E.imageEl&&(me.scale=E.scaleMove/E.scaleStart*u,me.scale>E.maxRatio&&(me.scale=E.maxRatio-1+(me.scale-E.maxRatio+1)**.5),me.scale<fe.minRatio&&(me.scale=fe.minRatio+1-(fe.minRatio-me.scale+1)**.5),E.imageEl.style.transform=`translate3d(0,0,0) scale(${me.scale})`))}function $(Ce){if(!j(Ce)||Ce.pointerType==="mouse"&&Ce.type==="pointerout")return;const fe=t.params.zoom,me=t.zoom,Ne=y.findIndex(Fe=>Fe.pointerId===Ce.pointerId);Ne>=0&&y.splice(Ne,1),!(!g||!_)&&(g=!1,_=!1,E.imageEl&&(me.scale=Math.max(Math.min(me.scale,E.maxRatio),fe.minRatio),E.imageEl.style.transitionDuration=`${t.params.speed}ms`,E.imageEl.style.transform=`translate3d(0,0,0) scale(${me.scale})`,u=me.scale,p=!1,me.scale>1&&E.slideEl?E.slideEl.classList.add(`${fe.zoomedSlideClass}`):me.scale<=1&&E.slideEl&&E.slideEl.classList.remove(`${fe.zoomedSlideClass}`),me.scale===1&&(E.originX=0,E.originY=0,E.slideEl=void 0)))}function Q(Ce){const fe=t.device;if(!E.imageEl||b.isTouched)return;fe.android&&Ce.cancelable&&Ce.preventDefault(),b.isTouched=!0;const me=y.length>0?y[0]:Ce;b.touchesStart.x=me.pageX,b.touchesStart.y=me.pageY}function Y(Ce){if(!j(Ce)||!M(Ce))return;const fe=t.zoom;if(!E.imageEl||!b.isTouched||!E.slideEl)return;b.isMoved||(b.width=E.imageEl.offsetWidth,b.height=E.imageEl.offsetHeight,b.startX=qq(E.imageWrapEl,"x")||0,b.startY=qq(E.imageWrapEl,"y")||0,E.slideWidth=E.slideEl.offsetWidth,E.slideHeight=E.slideEl.offsetHeight,E.imageWrapEl.style.transitionDuration="0ms");const me=b.width*fe.scale,Ne=b.height*fe.scale;if(me<E.slideWidth&&Ne<E.slideHeight)return;if(b.minX=Math.min(E.slideWidth/2-me/2,0),b.maxX=-b.minX,b.minY=Math.min(E.slideHeight/2-Ne/2,0),b.maxY=-b.minY,b.touchesCurrent.x=y.length>0?y[0].pageX:Ce.pageX,b.touchesCurrent.y=y.length>0?y[0].pageY:Ce.pageY,Math.max(Math.abs(b.touchesCurrent.x-b.touchesStart.x),Math.abs(b.touchesCurrent.y-b.touchesStart.y))>5&&(t.allowClick=!1),!b.isMoved&&!p){if(t.isHorizontal()&&(Math.floor(b.minX)===Math.floor(b.startX)&&b.touchesCurrent.x<b.touchesStart.x||Math.floor(b.maxX)===Math.floor(b.startX)&&b.touchesCurrent.x>b.touchesStart.x)){b.isTouched=!1;return}if(!t.isHorizontal()&&(Math.floor(b.minY)===Math.floor(b.startY)&&b.touchesCurrent.y<b.touchesStart.y||Math.floor(b.maxY)===Math.floor(b.startY)&&b.touchesCurrent.y>b.touchesStart.y)){b.isTouched=!1;return}}Ce.cancelable&&Ce.preventDefault(),Ce.stopPropagation(),b.isMoved=!0;const je=(fe.scale-u)/(E.maxRatio-t.params.zoom.minRatio),{originX:Ve,originY:Re}=E;b.currentX=b.touchesCurrent.x-b.touchesStart.x+b.startX+je*(b.width-Ve*2),b.currentY=b.touchesCurrent.y-b.touchesStart.y+b.startY+je*(b.height-Re*2),b.currentX<b.minX&&(b.currentX=b.minX+1-(b.minX-b.currentX+1)**.8),b.currentX>b.maxX&&(b.currentX=b.maxX-1+(b.currentX-b.maxX+1)**.8),b.currentY<b.minY&&(b.currentY=b.minY+1-(b.minY-b.currentY+1)**.8),b.currentY>b.maxY&&(b.currentY=b.maxY-1+(b.currentY-b.maxY+1)**.8),A.prevPositionX||(A.prevPositionX=b.touchesCurrent.x),A.prevPositionY||(A.prevPositionY=b.touchesCurrent.y),A.prevTime||(A.prevTime=Date.now()),A.x=(b.touchesCurrent.x-A.prevPositionX)/(Date.now()-A.prevTime)/2,A.y=(b.touchesCurrent.y-A.prevPositionY)/(Date.now()-A.prevTime)/2,Math.abs(b.touchesCurrent.x-A.prevPositionX)<2&&(A.x=0),Math.abs(b.touchesCurrent.y-A.prevPositionY)<2&&(A.y=0),A.prevPositionX=b.touchesCurrent.x,A.prevPositionY=b.touchesCurrent.y,A.prevTime=Date.now(),E.imageWrapEl.style.transform=`translate3d(${b.currentX}px, ${b.currentY}px,0)`}function le(){const Ce=t.zoom;if(!E.imageEl)return;if(!b.isTouched||!b.isMoved){b.isTouched=!1,b.isMoved=!1;return}b.isTouched=!1,b.isMoved=!1;let fe=300,me=300;const Ne=A.x*fe,Fe=b.currentX+Ne,je=A.y*me,Ve=b.currentY+je;A.x!==0&&(fe=Math.abs((Fe-b.currentX)/A.x)),A.y!==0&&(me=Math.abs((Ve-b.currentY)/A.y));const Re=Math.max(fe,me);b.currentX=Fe,b.currentY=Ve;const Be=b.width*Ce.scale,Xe=b.height*Ce.scale;b.minX=Math.min(E.slideWidth/2-Be/2,0),b.maxX=-b.minX,b.minY=Math.min(E.slideHeight/2-Xe/2,0),b.maxY=-b.minY,b.currentX=Math.max(Math.min(b.currentX,b.maxX),b.minX),b.currentY=Math.max(Math.min(b.currentY,b.maxY),b.minY),E.imageWrapEl.style.transitionDuration=`${Re}ms`,E.imageWrapEl.style.transform=`translate3d(${b.currentX}px, ${b.currentY}px,0)`}function ae(){const Ce=t.zoom;E.slideEl&&t.activeIndex!==t.slides.indexOf(E.slideEl)&&(E.imageEl&&(E.imageEl.style.transform="translate3d(0,0,0) scale(1)"),E.imageWrapEl&&(E.imageWrapEl.style.transform="translate3d(0,0,0)"),E.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),Ce.scale=1,u=1,E.slideEl=void 0,E.imageEl=void 0,E.imageWrapEl=void 0,E.originX=0,E.originY=0)}function te(Ce){const fe=t.zoom,me=t.params.zoom;if(!E.slideEl){Ce&&Ce.target&&(E.slideEl=Ce.target.closest(`.${t.params.slideClass}, swiper-slide`)),E.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?E.slideEl=$o(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:E.slideEl=t.slides[t.activeIndex]);let mt=E.slideEl.querySelector(`.${me.containerClass}`);mt&&(mt=mt.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=mt,mt?E.imageWrapEl=vE(E.imageEl,`.${me.containerClass}`)[0]:E.imageWrapEl=void 0}if(!E.imageEl||!E.imageWrapEl)return;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),E.slideEl.classList.add(`${me.zoomedSlideClass}`);let Ne,Fe,je,Ve,Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t,Xt,Ht,gn,It;typeof b.touchesStart.x>"u"&&Ce?(Ne=Ce.pageX,Fe=Ce.pageY):(Ne=b.touchesStart.x,Fe=b.touchesStart.y);const xt=typeof Ce=="number"?Ce:null;u===1&&xt&&(Ne=void 0,Fe=void 0),fe.scale=xt||E.imageWrapEl.getAttribute("data-swiper-zoom")||me.maxRatio,u=xt||E.imageWrapEl.getAttribute("data-swiper-zoom")||me.maxRatio,Ce&&!(u===1&&xt)?(gn=E.slideEl.offsetWidth,It=E.slideEl.offsetHeight,je=C7(E.slideEl).left+d.scrollX,Ve=C7(E.slideEl).top+d.scrollY,Re=je+gn/2-Ne,Be=Ve+It/2-Fe,Ge=E.imageEl.offsetWidth,rt=E.imageEl.offsetHeight,pt=Ge*fe.scale,Ze=rt*fe.scale,Je=Math.min(gn/2-pt/2,0),_t=Math.min(It/2-Ze/2,0),Xt=-Je,Ht=-_t,Xe=Re*fe.scale,we=Be*fe.scale,Xe<Je&&(Xe=Je),Xe>Xt&&(Xe=Xt),we<_t&&(we=_t),we>Ht&&(we=Ht)):(Xe=0,we=0),xt&&fe.scale===1&&(E.originX=0,E.originY=0),E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform=`translate3d(${Xe}px, ${we}px,0)`,E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform=`translate3d(0,0,0) scale(${fe.scale})`}function de(){const Ce=t.zoom,fe=t.params.zoom;if(!E.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?E.slideEl=$o(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:E.slideEl=t.slides[t.activeIndex];let me=E.slideEl.querySelector(`.${fe.containerClass}`);me&&(me=me.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),E.imageEl=me,me?E.imageWrapEl=vE(E.imageEl,`.${fe.containerClass}`)[0]:E.imageWrapEl=void 0}!E.imageEl||!E.imageWrapEl||(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),Ce.scale=1,u=1,E.imageWrapEl.style.transitionDuration="300ms",E.imageWrapEl.style.transform="translate3d(0,0,0)",E.imageEl.style.transitionDuration="300ms",E.imageEl.style.transform="translate3d(0,0,0) scale(1)",E.slideEl.classList.remove(`${fe.zoomedSlideClass}`),E.slideEl=void 0,E.originX=0,E.originY=0)}function G(Ce){const fe=t.zoom;fe.scale&&fe.scale!==1?de():te(Ce)}function ie(){const Ce=t.params.passiveListeners?{passive:!0,capture:!1}:!1,fe=t.params.passiveListeners?{passive:!1,capture:!0}:!0;return{passiveListener:Ce,activeListenerWithCapture:fe}}function _e(){const Ce=t.zoom;if(Ce.enabled)return;Ce.enabled=!0;const{passiveListener:fe,activeListenerWithCapture:me}=ie();t.wrapperEl.addEventListener("pointerdown",V,fe),t.wrapperEl.addEventListener("pointermove",H,me),["pointerup","pointercancel","pointerout"].forEach(Ne=>{t.wrapperEl.addEventListener(Ne,$,fe)}),t.wrapperEl.addEventListener("pointermove",Y,me)}function he(){const Ce=t.zoom;if(!Ce.enabled)return;Ce.enabled=!1;const{passiveListener:fe,activeListenerWithCapture:me}=ie();t.wrapperEl.removeEventListener("pointerdown",V,fe),t.wrapperEl.removeEventListener("pointermove",H,me),["pointerup","pointercancel","pointerout"].forEach(Ne=>{t.wrapperEl.removeEventListener(Ne,$,fe)}),t.wrapperEl.removeEventListener("pointermove",Y,me)}s("init",()=>{t.params.zoom.enabled&&_e()}),s("destroy",()=>{he()}),s("touchStart",(Ce,fe)=>{t.zoom.enabled&&Q(fe)}),s("touchEnd",(Ce,fe)=>{t.zoom.enabled&&le()}),s("doubleTap",(Ce,fe)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&G(fe)}),s("transitionEnd",()=>{t.zoom.enabled&&t.params.zoom.enabled&&ae()}),s("slideChange",()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&ae()}),Object.assign(t.zoom,{enable:_e,disable:he,in:te,out:de,toggle:G})}function IKe(n){let{swiper:t,extendParams:i,on:s}=n;i({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0};function l(_,y){const E=function(){let O,D,P;return(j,M)=>{for(D=-1,O=j.length;O-D>1;)P=O+D>>1,j[P]<=M?D=P:O=P;return O}}();this.x=_,this.y=y,this.lastIndex=_.length-1;let b,A;return this.interpolate=function(O){return O?(A=E(this.x,O),b=A-1,(O-this.x[b])*(this.y[A]-this.y[b])/(this.x[A]-this.x[b])+this.y[b]):0},this}function d(_){t.controller.spline=t.params.loop?new l(t.slidesGrid,_.slidesGrid):new l(t.snapGrid,_.snapGrid)}function u(_,y){const E=t.controller.control;let b,A;const N=t.constructor;function O(D){if(D.destroyed)return;const P=t.rtlTranslate?-t.translate:t.translate;t.params.controller.by==="slide"&&(d(D),A=-t.controller.spline.interpolate(-P)),(!A||t.params.controller.by==="container")&&(b=(D.maxTranslate()-D.minTranslate())/(t.maxTranslate()-t.minTranslate()),(Number.isNaN(b)||!Number.isFinite(b))&&(b=1),A=(P-t.minTranslate())*b+D.minTranslate()),t.params.controller.inverse&&(A=D.maxTranslate()-A),D.updateProgress(A),D.setTranslate(A,t),D.updateActiveIndex(),D.updateSlidesClasses()}if(Array.isArray(E))for(let D=0;D<E.length;D+=1)E[D]!==y&&E[D]instanceof N&&O(E[D]);else E instanceof N&&y!==E&&O(E)}function p(_,y){const E=t.constructor,b=t.controller.control;let A;function N(O){O.destroyed||(O.setTransition(_,t),_!==0&&(O.transitionStart(),O.params.autoHeight&&xE(()=>{O.updateAutoHeight()}),m4(O.wrapperEl,()=>{b&&O.transitionEnd()})))}if(Array.isArray(b))for(A=0;A<b.length;A+=1)b[A]!==y&&b[A]instanceof E&&N(b[A]);else b instanceof E&&y!==b&&N(b)}function g(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}s("beforeInit",()=>{if(typeof window<"u"&&(typeof t.params.controller.control=="string"||t.params.controller.control instanceof HTMLElement)){const _=document.querySelector(t.params.controller.control);if(_&&_.swiper)t.controller.control=_.swiper;else if(_){const y=E=>{t.controller.control=E.detail[0],t.update(),_.removeEventListener("init",y)};_.addEventListener("init",y)}return}t.controller.control=t.params.controller.control}),s("update",()=>{g()}),s("resize",()=>{g()}),s("observerUpdate",()=>{g()}),s("setTranslate",(_,y,E)=>{!t.controller.control||t.controller.control.destroyed||t.controller.setTranslate(y,E)}),s("setTransition",(_,y,E)=>{!t.controller.control||t.controller.control.destroyed||t.controller.setTransition(y,E)}),Object.assign(t.controller,{setTranslate:u,setTransition:p})}function NKe(n){let{swiper:t,extendParams:i,on:s}=n;i({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),t.a11y={clicked:!1};let l=null;function d(G){const ie=l;ie.length!==0&&(ie.innerHTML="",ie.innerHTML=G)}function u(G){G===void 0&&(G=16);const ie=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(G).replace(/x/g,ie)}function p(G){G=lr(G),G.forEach(ie=>{ie.setAttribute("tabIndex","0")})}function g(G){G=lr(G),G.forEach(ie=>{ie.setAttribute("tabIndex","-1")})}function _(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("role",ie)})}function y(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("aria-roledescription",ie)})}function E(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("aria-controls",ie)})}function b(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("aria-label",ie)})}function A(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("id",ie)})}function N(G,ie){G=lr(G),G.forEach(_e=>{_e.setAttribute("aria-live",ie)})}function O(G){G=lr(G),G.forEach(ie=>{ie.setAttribute("aria-disabled",!0)})}function D(G){G=lr(G),G.forEach(ie=>{ie.setAttribute("aria-disabled",!1)})}function P(G){if(G.keyCode!==13&&G.keyCode!==32)return;const ie=t.params.a11y,_e=G.target;t.pagination&&t.pagination.el&&(_e===t.pagination.el||t.pagination.el.contains(G.target))&&!G.target.matches(bg(t.params.pagination.bulletClass))||(t.navigation&&t.navigation.nextEl&&_e===t.navigation.nextEl&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?d(ie.lastSlideMessage):d(ie.nextSlideMessage)),t.navigation&&t.navigation.prevEl&&_e===t.navigation.prevEl&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?d(ie.firstSlideMessage):d(ie.prevSlideMessage)),t.pagination&&_e.matches(bg(t.params.pagination.bulletClass))&&_e.click())}function j(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:G,prevEl:ie}=t.navigation;ie&&(t.isBeginning?(O(ie),g(ie)):(D(ie),p(ie))),G&&(t.isEnd?(O(G),g(G)):(D(G),p(G)))}function M(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function V(){return M()&&t.params.pagination.clickable}function H(){const G=t.params.a11y;M()&&t.pagination.bullets.forEach(ie=>{t.params.pagination.clickable&&(p(ie),t.params.pagination.renderBullet||(_(ie,"button"),b(ie,G.paginationBulletMessage.replace(/\{\{index\}\}/,q4(ie)+1)))),ie.matches(bg(t.params.pagination.bulletActiveClass))?ie.setAttribute("aria-current","true"):ie.removeAttribute("aria-current")})}const $=(G,ie,_e)=>{p(G),G.tagName!=="BUTTON"&&(_(G,"button"),G.addEventListener("keydown",P)),b(G,_e),E(G,ie)},Q=()=>{t.a11y.clicked=!0},Y=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.destroyed||(t.a11y.clicked=!1)})})},le=G=>{if(t.a11y.clicked)return;const ie=G.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!ie||!t.slides.includes(ie))return;const _e=t.slides.indexOf(ie)===t.activeIndex,he=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(ie);_e||he||G.sourceCapabilities&&G.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,t.slideTo(t.slides.indexOf(ie),0))},ae=()=>{const G=t.params.a11y;G.itemRoleDescriptionMessage&&y(t.slides,G.itemRoleDescriptionMessage),G.slideRole&&_(t.slides,G.slideRole);const ie=t.slides.length;G.slideLabelMessage&&t.slides.forEach((_e,he)=>{const Ce=t.params.loop?parseInt(_e.getAttribute("data-swiper-slide-index"),10):he,fe=G.slideLabelMessage.replace(/\{\{index\}\}/,Ce+1).replace(/\{\{slidesLength\}\}/,ie);b(_e,fe)})},te=()=>{const G=t.params.a11y;t.el.append(l);const ie=t.el;G.containerRoleDescriptionMessage&&y(ie,G.containerRoleDescriptionMessage),G.containerMessage&&b(ie,G.containerMessage);const _e=t.wrapperEl,he=G.id||_e.getAttribute("id")||`swiper-wrapper-${u(16)}`,Ce=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite";A(_e,he),N(_e,Ce),ae();let{nextEl:fe,prevEl:me}=t.navigation?t.navigation:{};fe=lr(fe),me=lr(me),fe&&fe.forEach(Ne=>$(Ne,he,G.nextSlideMessage)),me&&me.forEach(Ne=>$(Ne,he,G.prevSlideMessage)),V()&&lr(t.pagination.el).forEach(Fe=>{Fe.addEventListener("keydown",P)}),t.el.addEventListener("focus",le,!0),t.el.addEventListener("pointerdown",Q,!0),t.el.addEventListener("pointerup",Y,!0)};function de(){l&&l.remove();let{nextEl:G,prevEl:ie}=t.navigation?t.navigation:{};G=lr(G),ie=lr(ie),G&&G.forEach(_e=>_e.removeEventListener("keydown",P)),ie&&ie.forEach(_e=>_e.removeEventListener("keydown",P)),V()&&lr(t.pagination.el).forEach(he=>{he.removeEventListener("keydown",P)}),t.el.removeEventListener("focus",le,!0),t.el.removeEventListener("pointerdown",Q,!0),t.el.removeEventListener("pointerup",Y,!0)}s("beforeInit",()=>{l=Kd("span",t.params.a11y.notificationClass),l.setAttribute("aria-live","assertive"),l.setAttribute("aria-atomic","true")}),s("afterInit",()=>{t.params.a11y.enabled&&te()}),s("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{t.params.a11y.enabled&&ae()}),s("fromEdge toEdge afterInit lock unlock",()=>{t.params.a11y.enabled&&j()}),s("paginationUpdate",()=>{t.params.a11y.enabled&&H()}),s("destroy",()=>{t.params.a11y.enabled&&de()})}function OKe(n){let{swiper:t,extendParams:i,on:s}=n;i({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let l=!1,d={};const u=A=>A.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),p=A=>{const N=ea();let O;A?O=new URL(A):O=N.location;const D=O.pathname.slice(1).split("/").filter(V=>V!==""),P=D.length,j=D[P-2],M=D[P-1];return{key:j,value:M}},g=(A,N)=>{const O=ea();if(!l||!t.params.history.enabled)return;let D;t.params.url?D=new URL(t.params.url):D=O.location;const P=t.slides[N];let j=u(P.getAttribute("data-history"));if(t.params.history.root.length>0){let V=t.params.history.root;V[V.length-1]==="/"&&(V=V.slice(0,V.length-1)),j=`${V}/${A?`${A}/`:""}${j}`}else D.pathname.includes(A)||(j=`${A?`${A}/`:""}${j}`);t.params.history.keepQuery&&(j+=D.search);const M=O.history.state;M&&M.value===j||(t.params.history.replaceState?O.history.replaceState({value:j},null,j):O.history.pushState({value:j},null,j))},_=(A,N,O)=>{if(N)for(let D=0,P=t.slides.length;D<P;D+=1){const j=t.slides[D];if(u(j.getAttribute("data-history"))===N){const V=t.getSlideIndex(j);t.slideTo(V,A,O)}}else t.slideTo(0,A,O)},y=()=>{d=p(t.params.url),_(t.params.speed,d.value,!1)},E=()=>{const A=ea();if(t.params.history){if(!A.history||!A.history.pushState){t.params.history.enabled=!1,t.params.hashNavigation.enabled=!0;return}if(l=!0,d=p(t.params.url),!d.key&&!d.value){t.params.history.replaceState||A.addEventListener("popstate",y);return}_(0,d.value,t.params.runCallbacksOnInit),t.params.history.replaceState||A.addEventListener("popstate",y)}},b=()=>{const A=ea();t.params.history.replaceState||A.removeEventListener("popstate",y)};s("init",()=>{t.params.history.enabled&&E()}),s("destroy",()=>{t.params.history.enabled&&b()}),s("transitionEnd _freeModeNoMomentumRelease",()=>{l&&g(t.params.history.key,t.activeIndex)}),s("slideChange",()=>{l&&t.params.cssMode&&g(t.params.history.key,t.activeIndex)})}function PKe(n){let{swiper:t,extendParams:i,emit:s,on:l}=n,d=!1;const u=lc(),p=ea();i({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(b,A){if(t.virtual&&t.params.virtual.enabled){const N=t.slides.filter(D=>D.getAttribute("data-hash")===A)[0];return N?parseInt(N.getAttribute("data-swiper-slide-index"),10):0}return t.getSlideIndex($o(t.slidesEl,`.${t.params.slideClass}[data-hash="${A}"], swiper-slide[data-hash="${A}"]`)[0])}}});const g=()=>{s("hashChange");const b=u.location.hash.replace("#",""),A=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],N=A?A.getAttribute("data-hash"):"";if(b!==N){const O=t.params.hashNavigation.getSlideIndex(t,b);if(typeof O>"u"||Number.isNaN(O))return;t.slideTo(O)}},_=()=>{if(!d||!t.params.hashNavigation.enabled)return;const b=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],A=b?b.getAttribute("data-hash")||b.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&p.history&&p.history.replaceState?(p.history.replaceState(null,null,`#${A}`||""),s("hashSet")):(u.location.hash=A||"",s("hashSet"))},y=()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;d=!0;const b=u.location.hash.replace("#","");if(b){const N=t.params.hashNavigation.getSlideIndex(t,b);t.slideTo(N||0,0,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&p.addEventListener("hashchange",g)},E=()=>{t.params.hashNavigation.watchState&&p.removeEventListener("hashchange",g)};l("init",()=>{t.params.hashNavigation.enabled&&y()}),l("destroy",()=>{t.params.hashNavigation.enabled&&E()}),l("transitionEnd _freeModeNoMomentumRelease",()=>{d&&_()}),l("slideChange",()=>{d&&t.params.cssMode&&_()})}function LKe(n){let{swiper:t,extendParams:i,on:s,emit:l,params:d}=n;t.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let u,p,g=d&&d.autoplay?d.autoplay.delay:3e3,_=d&&d.autoplay?d.autoplay.delay:3e3,y,E=new Date().getTime(),b,A,N,O,D,P,j;function M(fe){!t||t.destroyed||!t.wrapperEl||fe.target===t.wrapperEl&&(t.wrapperEl.removeEventListener("transitionend",M),!j&&ae())}const V=()=>{if(t.destroyed||!t.autoplay.running)return;t.autoplay.paused?b=!0:b&&(_=y,b=!1);const fe=t.autoplay.paused?y:E+_-new Date().getTime();t.autoplay.timeLeft=fe,l("autoplayTimeLeft",fe,fe/g),p=requestAnimationFrame(()=>{V()})},H=()=>{let fe;return t.virtual&&t.params.virtual.enabled?fe=t.slides.filter(Ne=>Ne.classList.contains("swiper-slide-active"))[0]:fe=t.slides[t.activeIndex],fe?parseInt(fe.getAttribute("data-swiper-autoplay"),10):void 0},$=fe=>{if(t.destroyed||!t.autoplay.running)return;cancelAnimationFrame(p),V();let me=typeof fe>"u"?t.params.autoplay.delay:fe;g=t.params.autoplay.delay,_=t.params.autoplay.delay;const Ne=H();!Number.isNaN(Ne)&&Ne>0&&typeof fe>"u"&&(me=Ne,g=Ne,_=Ne),y=me;const Fe=t.params.speed,je=()=>{!t||t.destroyed||(t.params.autoplay.reverseDirection?!t.isBeginning||t.params.loop||t.params.rewind?(t.slidePrev(Fe,!0,!0),l("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(t.slides.length-1,Fe,!0,!0),l("autoplay")):!t.isEnd||t.params.loop||t.params.rewind?(t.slideNext(Fe,!0,!0),l("autoplay")):t.params.autoplay.stopOnLastSlide||(t.slideTo(0,Fe,!0,!0),l("autoplay")),t.params.cssMode&&(E=new Date().getTime(),requestAnimationFrame(()=>{$()})))};return me>0?(clearTimeout(u),u=setTimeout(()=>{je()},me)):requestAnimationFrame(()=>{je()}),me},Q=()=>{E=new Date().getTime(),t.autoplay.running=!0,$(),l("autoplayStart")},Y=()=>{t.autoplay.running=!1,clearTimeout(u),cancelAnimationFrame(p),l("autoplayStop")},le=(fe,me)=>{if(t.destroyed||!t.autoplay.running)return;clearTimeout(u),fe||(P=!0);const Ne=()=>{l("autoplayPause"),t.params.autoplay.waitForTransition?t.wrapperEl.addEventListener("transitionend",M):ae()};if(t.autoplay.paused=!0,me){D&&(y=t.params.autoplay.delay),D=!1,Ne();return}y=(y||t.params.autoplay.delay)-(new Date().getTime()-E),!(t.isEnd&&y<0&&!t.params.loop)&&(y<0&&(y=0),Ne())},ae=()=>{t.isEnd&&y<0&&!t.params.loop||t.destroyed||!t.autoplay.running||(E=new Date().getTime(),P?(P=!1,$(y)):$(),t.autoplay.paused=!1,l("autoplayResume"))},te=()=>{if(t.destroyed||!t.autoplay.running)return;const fe=lc();fe.visibilityState==="hidden"&&(P=!0,le(!0)),fe.visibilityState==="visible"&&ae()},de=fe=>{fe.pointerType==="mouse"&&(P=!0,j=!0,!(t.animating||t.autoplay.paused)&&le(!0))},G=fe=>{fe.pointerType==="mouse"&&(j=!1,t.autoplay.paused&&ae())},ie=()=>{t.params.autoplay.pauseOnMouseEnter&&(t.el.addEventListener("pointerenter",de),t.el.addEventListener("pointerleave",G))},_e=()=>{t.el.removeEventListener("pointerenter",de),t.el.removeEventListener("pointerleave",G)},he=()=>{lc().addEventListener("visibilitychange",te)},Ce=()=>{lc().removeEventListener("visibilitychange",te)};s("init",()=>{t.params.autoplay.enabled&&(ie(),he(),Q())}),s("destroy",()=>{_e(),Ce(),t.autoplay.running&&Y()}),s("_freeModeStaticRelease",()=>{(N||P)&&ae()}),s("_freeModeNoMomentumRelease",()=>{t.params.autoplay.disableOnInteraction?Y():le(!0,!0)}),s("beforeTransitionStart",(fe,me,Ne)=>{t.destroyed||!t.autoplay.running||(Ne||!t.params.autoplay.disableOnInteraction?le(!0,!0):Y())}),s("sliderFirstMove",()=>{if(!(t.destroyed||!t.autoplay.running)){if(t.params.autoplay.disableOnInteraction){Y();return}A=!0,N=!1,P=!1,O=setTimeout(()=>{P=!0,N=!0,le(!0)},200)}}),s("touchEnd",()=>{if(!(t.destroyed||!t.autoplay.running||!A)){if(clearTimeout(O),clearTimeout(u),t.params.autoplay.disableOnInteraction){N=!1,A=!1;return}N&&t.params.cssMode&&ae(),N=!1,A=!1}}),s("slideChange",()=>{t.destroyed||!t.autoplay.running||(D=!0)}),Object.assign(t.autoplay,{start:Q,stop:Y,pause:le,resume:ae})}function DKe(n){let{swiper:t,extendParams:i,on:s}=n;i({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let l=!1,d=!1;t.thumbs={swiper:null};function u(){const _=t.thumbs.swiper;if(!_||_.destroyed)return;const y=_.clickedIndex,E=_.clickedSlide;if(E&&E.classList.contains(t.params.thumbs.slideThumbActiveClass)||typeof y>"u"||y===null)return;let b;_.params.loop?b=parseInt(_.clickedSlide.getAttribute("data-swiper-slide-index"),10):b=y,t.params.loop?t.slideToLoop(b):t.slideTo(b)}function p(){const{thumbs:_}=t.params;if(l)return!1;l=!0;const y=t.constructor;if(_.swiper instanceof y)t.thumbs.swiper=_.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update();else if(PI(_.swiper)){const E=Object.assign({},_.swiper);Object.assign(E,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new y(E),d=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",u),!0}function g(_){const y=t.thumbs.swiper;if(!y||y.destroyed)return;const E=y.params.slidesPerView==="auto"?y.slidesPerViewDynamic():y.params.slidesPerView;let b=1;const A=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(b=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(b=1),b=Math.floor(b),y.slides.forEach(D=>D.classList.remove(A)),y.params.loop||y.params.virtual&&y.params.virtual.enabled)for(let D=0;D<b;D+=1)$o(y.slidesEl,`[data-swiper-slide-index="${t.realIndex+D}"]`).forEach(P=>{P.classList.add(A)});else for(let D=0;D<b;D+=1)y.slides[t.realIndex+D]&&y.slides[t.realIndex+D].classList.add(A);const N=t.params.thumbs.autoScrollOffset,O=N&&!y.params.loop;if(t.realIndex!==y.realIndex||O){const D=y.activeIndex;let P,j;if(y.params.loop){const M=y.slides.filter(V=>V.getAttribute("data-swiper-slide-index")===`${t.realIndex}`)[0];P=y.slides.indexOf(M),j=t.activeIndex>t.previousIndex?"next":"prev"}else P=t.realIndex,j=P>t.previousIndex?"next":"prev";O&&(P+=j==="next"?N:-1*N),y.visibleSlidesIndexes&&y.visibleSlidesIndexes.indexOf(P)<0&&(y.params.centeredSlides?P>D?P=P-Math.floor(E/2)+1:P=P+Math.floor(E/2)-1:P>D&&y.params.slidesPerGroup,y.slideTo(P,_?0:void 0))}}s("beforeInit",()=>{const{thumbs:_}=t.params;if(!(!_||!_.swiper))if(typeof _.swiper=="string"||_.swiper instanceof HTMLElement){const y=lc(),E=()=>{const A=typeof _.swiper=="string"?y.querySelector(_.swiper):_.swiper;if(A&&A.swiper)_.swiper=A.swiper,p(),g(!0);else if(A){const N=O=>{_.swiper=O.detail[0],A.removeEventListener("init",N),p(),g(!0),_.swiper.update(),t.update()};A.addEventListener("init",N)}return A},b=()=>{if(t.destroyed)return;E()||requestAnimationFrame(b)};requestAnimationFrame(b)}else p(),g(!0)}),s("slideChange update resize observerUpdate",()=>{g()}),s("setTransition",(_,y)=>{const E=t.thumbs.swiper;!E||E.destroyed||E.setTransition(y)}),s("beforeDestroy",()=>{const _=t.thumbs.swiper;!_||_.destroyed||d&&_.destroy()}),Object.assign(t.thumbs,{init:p,update:g})}function kKe(n){let{swiper:t,extendParams:i,emit:s,once:l}=n;i({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}});function d(){if(t.params.cssMode)return;const g=t.getTranslate();t.setTranslate(g),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})}function u(){if(t.params.cssMode)return;const{touchEventsData:g,touches:_}=t;g.velocities.length===0&&g.velocities.push({position:_[t.isHorizontal()?"startX":"startY"],time:g.touchStartTime}),g.velocities.push({position:_[t.isHorizontal()?"currentX":"currentY"],time:Zu()})}function p(g){let{currentPos:_}=g;if(t.params.cssMode)return;const{params:y,wrapperEl:E,rtlTranslate:b,snapGrid:A,touchEventsData:N}=t,D=Zu()-N.touchStartTime;if(_<-t.minTranslate()){t.slideTo(t.activeIndex);return}if(_>-t.maxTranslate()){t.slides.length<A.length?t.slideTo(A.length-1):t.slideTo(t.slides.length-1);return}if(y.freeMode.momentum){if(N.velocities.length>1){const Y=N.velocities.pop(),le=N.velocities.pop(),ae=Y.position-le.position,te=Y.time-le.time;t.velocity=ae/te,t.velocity/=2,Math.abs(t.velocity)<y.freeMode.minimumVelocity&&(t.velocity=0),(te>150||Zu()-Y.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=y.freeMode.momentumVelocityRatio,N.velocities.length=0;let P=1e3*y.freeMode.momentumRatio;const j=t.velocity*P;let M=t.translate+j;b&&(M=-M);let V=!1,H;const $=Math.abs(t.velocity)*20*y.freeMode.momentumBounceRatio;let Q;if(M<t.maxTranslate())y.freeMode.momentumBounce?(M+t.maxTranslate()<-$&&(M=t.maxTranslate()-$),H=t.maxTranslate(),V=!0,N.allowMomentumBounce=!0):M=t.maxTranslate(),y.loop&&y.centeredSlides&&(Q=!0);else if(M>t.minTranslate())y.freeMode.momentumBounce?(M-t.minTranslate()>$&&(M=t.minTranslate()+$),H=t.minTranslate(),V=!0,N.allowMomentumBounce=!0):M=t.minTranslate(),y.loop&&y.centeredSlides&&(Q=!0);else if(y.freeMode.sticky){let Y;for(let le=0;le<A.length;le+=1)if(A[le]>-M){Y=le;break}Math.abs(A[Y]-M)<Math.abs(A[Y-1]-M)||t.swipeDirection==="next"?M=A[Y]:M=A[Y-1],M=-M}if(Q&&l("transitionEnd",()=>{t.loopFix()}),t.velocity!==0){if(b?P=Math.abs((-M-t.translate)/t.velocity):P=Math.abs((M-t.translate)/t.velocity),y.freeMode.sticky){const Y=Math.abs((b?-M:M)-t.translate),le=t.slidesSizesGrid[t.activeIndex];Y<le?P=y.speed:Y<2*le?P=y.speed*1.5:P=y.speed*2.5}}else if(y.freeMode.sticky){t.slideToClosest();return}y.freeMode.momentumBounce&&V?(t.updateProgress(H),t.setTransition(P),t.setTranslate(M),t.transitionStart(!0,t.swipeDirection),t.animating=!0,m4(E,()=>{!t||t.destroyed||!N.allowMomentumBounce||(s("momentumBounce"),t.setTransition(y.speed),setTimeout(()=>{t.setTranslate(H),m4(E,()=>{!t||t.destroyed||t.transitionEnd()})},0))})):t.velocity?(s("_freeModeNoMomentumRelease"),t.updateProgress(M),t.setTransition(P),t.setTranslate(M),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,m4(E,()=>{!t||t.destroyed||t.transitionEnd()}))):t.updateProgress(M),t.updateActiveIndex(),t.updateSlidesClasses()}else if(y.freeMode.sticky){t.slideToClosest();return}else y.freeMode&&s("_freeModeNoMomentumRelease");(!y.freeMode.momentum||D>=y.longSwipesMs)&&(s("_freeModeStaticRelease"),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}Object.assign(t,{freeMode:{onTouchStart:d,onTouchMove:u,onTouchEnd:p}})}function MKe(n){let{swiper:t,extendParams:i,on:s}=n;i({grid:{rows:1,fill:"column"}});let l,d,u,p;const g=()=>{let O=t.params.spaceBetween;return typeof O=="string"&&O.indexOf("%")>=0?O=parseFloat(O.replace("%",""))/100*t.size:typeof O=="string"&&(O=parseFloat(O)),O},_=O=>{const{slidesPerView:D}=t.params,{rows:P,fill:j}=t.params.grid,M=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:O.length;u=Math.floor(M/P),Math.floor(M/P)===M/P?l=M:l=Math.ceil(M/P)*P,D!=="auto"&&j==="row"&&(l=Math.max(l,D*P)),d=l/P},y=()=>{t.slides&&t.slides.forEach(O=>{O.swiperSlideGridSet&&(O.style.height="",O.style[t.getDirectionLabel("margin-top")]="")})},E=(O,D,P)=>{const{slidesPerGroup:j}=t.params,M=g(),{rows:V,fill:H}=t.params.grid,$=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:P.length;let Q,Y,le;if(H==="row"&&j>1){const ae=Math.floor(O/(j*V)),te=O-V*j*ae,de=ae===0?j:Math.min(Math.ceil(($-ae*V*j)/V),j);le=Math.floor(te/de),Y=te-le*de+ae*j,Q=Y+le*l/V,D.style.order=Q}else H==="column"?(Y=Math.floor(O/V),le=O-Y*V,(Y>u||Y===u&&le===V-1)&&(le+=1,le>=V&&(le=0,Y+=1))):(le=Math.floor(O/d),Y=O-le*d);D.row=le,D.column=Y,D.style.height=`calc((100% - ${(V-1)*M}px) / ${V})`,D.style[t.getDirectionLabel("margin-top")]=le!==0?M&&`${M}px`:"",D.swiperSlideGridSet=!0},b=(O,D)=>{const{centeredSlides:P,roundLengths:j}=t.params,M=g(),{rows:V}=t.params.grid;if(t.virtualSize=(O+M)*l,t.virtualSize=Math.ceil(t.virtualSize/V)-M,t.params.cssMode||(t.wrapperEl.style[t.getDirectionLabel("width")]=`${t.virtualSize+M}px`),P){const H=[];for(let $=0;$<D.length;$+=1){let Q=D[$];j&&(Q=Math.floor(Q)),D[$]<t.virtualSize+D[0]&&H.push(Q)}D.splice(0,D.length),D.push(...H)}},A=()=>{p=t.params.grid&&t.params.grid.rows>1},N=()=>{const{params:O,el:D}=t,P=O.grid&&O.grid.rows>1;p&&!P?(D.classList.remove(`${O.containerModifierClass}grid`,`${O.containerModifierClass}grid-column`),u=1,t.emitContainerClasses()):!p&&P&&(D.classList.add(`${O.containerModifierClass}grid`),O.grid.fill==="column"&&D.classList.add(`${O.containerModifierClass}grid-column`),t.emitContainerClasses()),p=P};s("init",A),s("update",N),t.grid={initSlides:_,unsetSlides:y,updateSlide:E,updateWrapperSize:b}}function jKe(n){const t=this,{params:i,slidesEl:s}=t;i.loop&&t.loopDestroy();const l=d=>{if(typeof d=="string"){const u=document.createElement("div");u.innerHTML=d,s.append(u.children[0]),u.innerHTML=""}else s.append(d)};if(typeof n=="object"&&"length"in n)for(let d=0;d<n.length;d+=1)n[d]&&l(n[d]);else l(n);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update()}function UKe(n){const t=this,{params:i,activeIndex:s,slidesEl:l}=t;i.loop&&t.loopDestroy();let d=s+1;const u=p=>{if(typeof p=="string"){const g=document.createElement("div");g.innerHTML=p,l.prepend(g.children[0]),g.innerHTML=""}else l.prepend(p)};if(typeof n=="object"&&"length"in n){for(let p=0;p<n.length;p+=1)n[p]&&u(n[p]);d=s+n.length}else u(n);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),t.slideTo(d,0,!1)}function FKe(n,t){const i=this,{params:s,activeIndex:l,slidesEl:d}=i;let u=l;s.loop&&(u-=i.loopedSlides,i.loopDestroy(),i.recalcSlides());const p=i.slides.length;if(n<=0){i.prependSlide(t);return}if(n>=p){i.appendSlide(t);return}let g=u>n?u+1:u;const _=[];for(let y=p-1;y>=n;y-=1){const E=i.slides[y];E.remove(),_.unshift(E)}if(typeof t=="object"&&"length"in t){for(let y=0;y<t.length;y+=1)t[y]&&d.append(t[y]);g=u>n?u+t.length:u}else d.append(t);for(let y=0;y<_.length;y+=1)d.append(_[y]);i.recalcSlides(),s.loop&&i.loopCreate(),(!s.observer||i.isElement)&&i.update(),s.loop?i.slideTo(g+i.loopedSlides,0,!1):i.slideTo(g,0,!1)}function BKe(n){const t=this,{params:i,activeIndex:s}=t;let l=s;i.loop&&(l-=t.loopedSlides,t.loopDestroy());let d=l,u;if(typeof n=="object"&&"length"in n){for(let p=0;p<n.length;p+=1)u=n[p],t.slides[u]&&t.slides[u].remove(),u<d&&(d-=1);d=Math.max(d,0)}else u=n,t.slides[u]&&t.slides[u].remove(),u<d&&(d-=1),d=Math.max(d,0);t.recalcSlides(),i.loop&&t.loopCreate(),(!i.observer||t.isElement)&&t.update(),i.loop?t.slideTo(d+t.loopedSlides,0,!1):t.slideTo(d,0,!1)}function VKe(){const n=this,t=[];for(let i=0;i<n.slides.length;i+=1)t.push(i);n.removeSlide(t)}function zKe(n){let{swiper:t}=n;Object.assign(t,{appendSlide:jKe.bind(t),prependSlide:UKe.bind(t),addSlide:FKe.bind(t),removeSlide:BKe.bind(t),removeAllSlides:VKe.bind(t)})}function ex(n){const{effect:t,swiper:i,on:s,setTranslate:l,setTransition:d,overwriteParams:u,perspective:p,recreateShadows:g,getEffectParams:_}=n;s("beforeInit",()=>{if(i.params.effect!==t)return;i.classNames.push(`${i.params.containerModifierClass}${t}`),p&&p()&&i.classNames.push(`${i.params.containerModifierClass}3d`);const E=u?u():{};Object.assign(i.params,E),Object.assign(i.originalParams,E)}),s("setTranslate",()=>{i.params.effect===t&&l()}),s("setTransition",(E,b)=>{i.params.effect===t&&d(b)}),s("transitionEnd",()=>{if(i.params.effect===t&&g){if(!_||!_().slideShadows)return;i.slides.forEach(E=>{E.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>b.remove())}),g()}});let y;s("virtualUpdate",()=>{i.params.effect===t&&(i.slides.length||(y=!0),requestAnimationFrame(()=>{y&&i.slides&&i.slides.length&&(l(),y=!1)}))})}function KO(n,t){const i=qE(t);return i!==t&&(i.style.backfaceVisibility="hidden",i.style["-webkit-backface-visibility"]="hidden"),i}function jU(n){let{swiper:t,duration:i,transformElements:s,allSlides:l}=n;const{activeIndex:d}=t,u=p=>p.parentElement?p.parentElement:t.slides.filter(_=>_.shadowRoot&&_.shadowRoot===p.parentNode)[0];if(t.params.virtualTranslate&&i!==0){let p=!1,g;l?g=s:g=s.filter(_=>{const y=_.classList.contains("swiper-slide-transform")?u(_):_;return t.getSlideIndex(y)===d}),g.forEach(_=>{m4(_,()=>{if(p||!t||t.destroyed)return;p=!0,t.animating=!1;const y=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(y)})})}}function HKe(n){let{swiper:t,extendParams:i,on:s}=n;i({fadeEffect:{crossFade:!1}}),ex({effect:"fade",swiper:t,on:s,setTranslate:()=>{const{slides:u}=t,p=t.params.fadeEffect;for(let g=0;g<u.length;g+=1){const _=t.slides[g];let E=-_.swiperSlideOffset;t.params.virtualTranslate||(E-=t.translate);let b=0;t.isHorizontal()||(b=E,E=0);const A=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(_.progress),0):1+Math.min(Math.max(_.progress,-1),0),N=KO(p,_);N.style.opacity=A,N.style.transform=`translate3d(${E}px, ${b}px, 0px)`}},setTransition:u=>{const p=t.slides.map(g=>qE(g));p.forEach(g=>{g.style.transitionDuration=`${u}ms`}),jU({swiper:t,duration:u,transformElements:p,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}function GKe(n){let{swiper:t,extendParams:i,on:s}=n;i({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const l=(g,_,y)=>{let E=y?g.querySelector(".swiper-slide-shadow-left"):g.querySelector(".swiper-slide-shadow-top"),b=y?g.querySelector(".swiper-slide-shadow-right"):g.querySelector(".swiper-slide-shadow-bottom");E||(E=Kd("div",`swiper-slide-shadow-cube swiper-slide-shadow-${y?"left":"top"}`.split(" ")),g.append(E)),b||(b=Kd("div",`swiper-slide-shadow-cube swiper-slide-shadow-${y?"right":"bottom"}`.split(" ")),g.append(b)),E&&(E.style.opacity=Math.max(-_,0)),b&&(b.style.opacity=Math.max(_,0))};ex({effect:"cube",swiper:t,on:s,setTranslate:()=>{const{el:g,wrapperEl:_,slides:y,width:E,height:b,rtlTranslate:A,size:N,browser:O}=t,D=t.params.cubeEffect,P=t.isHorizontal(),j=t.virtual&&t.params.virtual.enabled;let M=0,V;D.shadow&&(P?(V=t.wrapperEl.querySelector(".swiper-cube-shadow"),V||(V=Kd("div","swiper-cube-shadow"),t.wrapperEl.append(V)),V.style.height=`${E}px`):(V=g.querySelector(".swiper-cube-shadow"),V||(V=Kd("div","swiper-cube-shadow"),g.append(V))));for(let $=0;$<y.length;$+=1){const Q=y[$];let Y=$;j&&(Y=parseInt(Q.getAttribute("data-swiper-slide-index"),10));let le=Y*90,ae=Math.floor(le/360);A&&(le=-le,ae=Math.floor(-le/360));const te=Math.max(Math.min(Q.progress,1),-1);let de=0,G=0,ie=0;Y%4===0?(de=-ae*4*N,ie=0):(Y-1)%4===0?(de=0,ie=-ae*4*N):(Y-2)%4===0?(de=N+ae*4*N,ie=N):(Y-3)%4===0&&(de=-N,ie=3*N+N*4*ae),A&&(de=-de),P||(G=de,de=0);const _e=`rotateX(${P?0:-le}deg) rotateY(${P?le:0}deg) translate3d(${de}px, ${G}px, ${ie}px)`;te<=1&&te>-1&&(M=Y*90+te*90,A&&(M=-Y*90-te*90),t.browser&&t.browser.need3dFix&&Math.abs(M)/90%2===1&&(M+=.001)),Q.style.transform=_e,D.slideShadows&&l(Q,te,P)}if(_.style.transformOrigin=`50% 50% -${N/2}px`,_.style["-webkit-transform-origin"]=`50% 50% -${N/2}px`,D.shadow)if(P)V.style.transform=`translate3d(0px, ${E/2+D.shadowOffset}px, ${-E/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${D.shadowScale})`;else{const $=Math.abs(M)-Math.floor(Math.abs(M)/90)*90,Q=1.5-(Math.sin($*2*Math.PI/360)/2+Math.cos($*2*Math.PI/360)/2),Y=D.shadowScale,le=D.shadowScale/Q,ae=D.shadowOffset;V.style.transform=`scale3d(${Y}, 1, ${le}) translate3d(0px, ${b/2+ae}px, ${-b/2/le}px) rotateX(-89.99deg)`}const H=(O.isSafari||O.isWebView)&&O.needPerspectiveFix?-N/2:0;_.style.transform=`translate3d(0px,0,${H}px) rotateX(${t.isHorizontal()?0:M}deg) rotateY(${t.isHorizontal()?-M:0}deg)`,_.style.setProperty("--swiper-cube-translate-z",`${H}px`)},setTransition:g=>{const{el:_,slides:y}=t;if(y.forEach(E=>{E.style.transitionDuration=`${g}ms`,E.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(b=>{b.style.transitionDuration=`${g}ms`})}),t.params.cubeEffect.shadow&&!t.isHorizontal()){const E=_.querySelector(".swiper-cube-shadow");E&&(E.style.transitionDuration=`${g}ms`)}},recreateShadows:()=>{const g=t.isHorizontal();t.slides.forEach(_=>{const y=Math.max(Math.min(_.progress,1),-1);l(_,y,g)})},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})}function PR(n,t,i){const s=`swiper-slide-shadow${i?`-${i}`:""}${n?` swiper-slide-shadow-${n}`:""}`,l=qE(t);let d=l.querySelector(`.${s.split(" ").join(".")}`);return d||(d=Kd("div",s.split(" ")),l.append(d)),d}function WKe(n){let{swiper:t,extendParams:i,on:s}=n;i({flipEffect:{slideShadows:!0,limitRotation:!0}});const l=(g,_)=>{let y=t.isHorizontal()?g.querySelector(".swiper-slide-shadow-left"):g.querySelector(".swiper-slide-shadow-top"),E=t.isHorizontal()?g.querySelector(".swiper-slide-shadow-right"):g.querySelector(".swiper-slide-shadow-bottom");y||(y=PR("flip",g,t.isHorizontal()?"left":"top")),E||(E=PR("flip",g,t.isHorizontal()?"right":"bottom")),y&&(y.style.opacity=Math.max(-_,0)),E&&(E.style.opacity=Math.max(_,0))};ex({effect:"flip",swiper:t,on:s,setTranslate:()=>{const{slides:g,rtlTranslate:_}=t,y=t.params.flipEffect;for(let E=0;E<g.length;E+=1){const b=g[E];let A=b.progress;t.params.flipEffect.limitRotation&&(A=Math.max(Math.min(b.progress,1),-1));const N=b.swiperSlideOffset;let D=-180*A,P=0,j=t.params.cssMode?-N-t.translate:-N,M=0;t.isHorizontal()?_&&(D=-D):(M=j,j=0,P=-D,D=0),t.browser&&t.browser.need3dFix&&(Math.abs(D)/90%2===1&&(D+=.001),Math.abs(P)/90%2===1&&(P+=.001)),b.style.zIndex=-Math.abs(Math.round(A))+g.length,y.slideShadows&&l(b,A);const V=`translate3d(${j}px, ${M}px, 0px) rotateX(${P}deg) rotateY(${D}deg)`,H=KO(y,b);H.style.transform=V}},setTransition:g=>{const _=t.slides.map(y=>qE(y));_.forEach(y=>{y.style.transitionDuration=`${g}ms`,y.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(E=>{E.style.transitionDuration=`${g}ms`})}),jU({swiper:t,duration:g,transformElements:_})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach(g=>{let _=g.progress;t.params.flipEffect.limitRotation&&(_=Math.max(Math.min(g.progress,1),-1)),l(g,_)})},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})}function $Ke(n){let{swiper:t,extendParams:i,on:s}=n;i({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),ex({effect:"coverflow",swiper:t,on:s,setTranslate:()=>{const{width:u,height:p,slides:g,slidesSizesGrid:_}=t,y=t.params.coverflowEffect,E=t.isHorizontal(),b=t.translate,A=E?-b+u/2:-b+p/2,N=E?y.rotate:-y.rotate,O=y.depth;for(let D=0,P=g.length;D<P;D+=1){const j=g[D],M=_[D],V=j.swiperSlideOffset,H=(A-V-M/2)/M,$=typeof y.modifier=="function"?y.modifier(H):H*y.modifier;let Q=E?N*$:0,Y=E?0:N*$,le=-O*Math.abs($),ae=y.stretch;typeof ae=="string"&&ae.indexOf("%")!==-1&&(ae=parseFloat(y.stretch)/100*M);let te=E?0:ae*$,de=E?ae*$:0,G=1-(1-y.scale)*Math.abs($);Math.abs(de)<.001&&(de=0),Math.abs(te)<.001&&(te=0),Math.abs(le)<.001&&(le=0),Math.abs(Q)<.001&&(Q=0),Math.abs(Y)<.001&&(Y=0),Math.abs(G)<.001&&(G=0),t.browser&&t.browser.need3dFix&&(Math.abs(Q)/90%2===1&&(Q+=.001),Math.abs(Y)/90%2===1&&(Y+=.001));const ie=`translate3d(${de}px,${te}px,${le}px) rotateX(${Y}deg) rotateY(${Q}deg) scale(${G})`,_e=KO(y,j);if(_e.style.transform=ie,j.style.zIndex=-Math.abs(Math.round($))+1,y.slideShadows){let he=E?j.querySelector(".swiper-slide-shadow-left"):j.querySelector(".swiper-slide-shadow-top"),Ce=E?j.querySelector(".swiper-slide-shadow-right"):j.querySelector(".swiper-slide-shadow-bottom");he||(he=PR("coverflow",j,E?"left":"top")),Ce||(Ce=PR("coverflow",j,E?"right":"bottom")),he&&(he.style.opacity=$>0?$:0),Ce&&(Ce.style.opacity=-$>0?-$:0)}}},setTransition:u=>{t.slides.map(g=>qE(g)).forEach(g=>{g.style.transitionDuration=`${u}ms`,g.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(_=>{_.style.transitionDuration=`${u}ms`})})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}function KKe(n){let{swiper:t,extendParams:i,on:s}=n;i({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const l=p=>typeof p=="string"?p:`${p}px`;ex({effect:"creative",swiper:t,on:s,setTranslate:()=>{const{slides:p,wrapperEl:g,slidesSizesGrid:_}=t,y=t.params.creativeEffect,{progressMultiplier:E}=y,b=t.params.centeredSlides;if(b){const A=_[0]/2-t.params.slidesOffsetBefore||0;g.style.transform=`translateX(calc(50% - ${A}px))`}for(let A=0;A<p.length;A+=1){const N=p[A],O=N.progress,D=Math.min(Math.max(N.progress,-y.limitProgress),y.limitProgress);let P=D;b||(P=Math.min(Math.max(N.originalProgress,-y.limitProgress),y.limitProgress));const j=N.swiperSlideOffset,M=[t.params.cssMode?-j-t.translate:-j,0,0],V=[0,0,0];let H=!1;t.isHorizontal()||(M[1]=M[0],M[0]=0);let $={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};D<0?($=y.next,H=!0):D>0&&($=y.prev,H=!0),M.forEach((G,ie)=>{M[ie]=`calc(${G}px + (${l($.translate[ie])} * ${Math.abs(D*E)}))`}),V.forEach((G,ie)=>{let _e=$.rotate[ie]*Math.abs(D*E);t.browser&&t.browser.need3dFix&&Math.abs(_e)/90%2===1&&(_e+=.001),V[ie]=_e}),N.style.zIndex=-Math.abs(Math.round(O))+p.length;const Q=M.join(", "),Y=`rotateX(${V[0]}deg) rotateY(${V[1]}deg) rotateZ(${V[2]}deg)`,le=P<0?`scale(${1+(1-$.scale)*P*E})`:`scale(${1-(1-$.scale)*P*E})`,ae=P<0?1+(1-$.opacity)*P*E:1-(1-$.opacity)*P*E,te=`translate3d(${Q}) ${Y} ${le}`;if(H&&$.shadow||!H){let G=N.querySelector(".swiper-slide-shadow");if(!G&&$.shadow&&(G=PR("creative",N)),G){const ie=y.shadowPerProgress?D*(1/y.limitProgress):D;G.style.opacity=Math.min(Math.max(Math.abs(ie),0),1)}}const de=KO(y,N);de.style.transform=te,de.style.opacity=ae,$.origin&&(de.style.transformOrigin=$.origin)}},setTransition:p=>{const g=t.slides.map(_=>qE(_));g.forEach(_=>{_.style.transitionDuration=`${p}ms`,_.querySelectorAll(".swiper-slide-shadow").forEach(y=>{y.style.transitionDuration=`${p}ms`})}),jU({swiper:t,duration:p,transformElements:g,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}function qKe(n){let{swiper:t,extendParams:i,on:s}=n;i({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),ex({effect:"cards",swiper:t,on:s,setTranslate:()=>{const{slides:u,activeIndex:p,rtlTranslate:g}=t,_=t.params.cardsEffect,{startTranslate:y,isTouched:E}=t.touchEventsData,b=g?-t.translate:t.translate;for(let A=0;A<u.length;A+=1){const N=u[A],O=N.progress,D=Math.min(Math.max(O,-4),4);let P=N.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(P-=u[0].swiperSlideOffset);let j=t.params.cssMode?-P-t.translate:-P,M=0;const V=-100*Math.abs(D);let H=1,$=-_.perSlideRotate*D,Q=_.perSlideOffset-Math.abs(D)*.75;const Y=t.virtual&&t.params.virtual.enabled?t.virtual.from+A:A,le=(Y===p||Y===p-1)&&D>0&&D<1&&(E||t.params.cssMode)&&b<y,ae=(Y===p||Y===p+1)&&D<0&&D>-1&&(E||t.params.cssMode)&&b>y;if(le||ae){const ie=(1-Math.abs((Math.abs(D)-.5)/.5))**.5;$+=-28*D*ie,H+=-.5*ie,Q+=96*ie,M=`${-25*ie*Math.abs(D)}%`}if(D<0?j=`calc(${j}px ${g?"-":"+"} (${Q*Math.abs(D)}%))`:D>0?j=`calc(${j}px ${g?"-":"+"} (-${Q*Math.abs(D)}%))`:j=`${j}px`,!t.isHorizontal()){const ie=M;M=j,j=ie}const te=D<0?`${1+(1-H)*D}`:`${1-(1-H)*D}`,de=`
translate3d(${j}, ${M}, ${V}px)
rotateZ(${_.rotate?g?-$:$:0}deg)
scale(${te})
`;if(_.slideShadows){let ie=N.querySelector(".swiper-slide-shadow");ie||(ie=PR("cards",N)),ie&&(ie.style.opacity=Math.min(Math.max((Math.abs(D)-.5)/.5,0),1))}N.style.zIndex=-Math.abs(Math.round(O))+u.length;const G=KO(_,N);G.style.transform=de}},setTransition:u=>{const p=t.slides.map(g=>qE(g));p.forEach(g=>{g.style.transitionDuration=`${u}ms`,g.querySelectorAll(".swiper-slide-shadow").forEach(_=>{_.style.transitionDuration=`${u}ms`})}),jU({swiper:t,duration:u,transformElements:p})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}const YKe=[wKe,SKe,bKe,CKe,TKe,RKe,xKe,AKe,IKe,NKe,OKe,PKe,LKe,DKe,kKe,MKe,zKe,HKe,GKe,WKe,$Ke,KKe,qKe];qc.use(YKe);const hs={getAllUsers:async()=>(console.log("Inside Service getAllUsers() ..."),await On.get("ums/users/dropdown")),getAllRecipients:async n=>(console.log("Inside Service getAllRecipients() ..."),await On.get(`ums/users/recipients?type=${n}`)),getUserProfile:async()=>(console.log("Inside Service getUserProfile() ..."),await On.get("ums/users/profile")),updateUserProfile:async n=>(console.log("Inside Service updateUserProfile() ...",n),await On.post("ums/users/saveprofile",n)),getDashboardWallBanners:async()=>(console.log("Inside Service getDashboardWallBanners() ..."),await On.get("wall/wallbanner/dashboard")),getDashboardUserStats:async n=>(console.log("Inside Service getDashboardUserStats() ...",n),await On.get(`metric/metric_report/dashboard_stats${n.isRefresh?"?refresh=1":""}`)),getReloadedDashboardUserStats:async()=>(console.log("Inside Service getReloadedDashboardUserStats() ..."),await On.get("metric/metric_report/dashboard_stats?refresh=1")),getFormQuickActions:async()=>(console.log("Inside Service getFormQuickActions() ..."),await On.get("form/formaction/list")),getSignedUploadUrl:async n=>(console.log("Inside Service getSignedUploadUrl() data ...",n),await On.post("wall/wallmessage/getsigneduploadurl",n)),uploadFileToS3:async n=>{},completeChunkUpload:async n=>(console.log("Inside Service completeChunkUpload() data ...",n),await On.post("wall/wallmessage/completechunkupload",n)),getDashboardMagazines:async()=>(console.log("Inside Service getDashboardMagazines() ..."),await On.get("mag/magazine/dashboard")),getAllMagazines:async()=>(console.log("Inside Service getAllMagazines() ..."),await On.get("mag/magazine/list")),getMagazineDetails:async n=>(console.log("Inside Service getMagazineDetails() ..."),await On.get(`mag/magazine/details?id=${n}`)),getMagazineMediaDetails:async n=>(console.log("Inside Service getMagazineMediaDetails() ..."),await On.get(`mag/mag_media/details?id=${n}`)),getMagazineMediaLike:async n=>(console.log("Inside Service getMagazineMediaLike() ..."),await On.get(`mag/mag_media/like?id=${n}`)),getMagazineMediaLikesList:async n=>(console.log("Inside Service getMagazineMediaLikesList() ..."),await On.get(`mag/mag_media/likes?id=${n}`)),getAllMagazineMediaCommentList:async n=>(console.log("Inside Service getAllMagazineMediaCommentList() ..."),await On.get(`mag/mag_media/comments?id=${n}`)),addMagazineMediaComment:async n=>(console.log("Inside Service addMagazineMediaComment() ...",n),await On.post("mag/mag_media/comment",n))},Wa={getAllDashboardContests:async()=>(console.log("Inside Service getAllDashboardContests() ..."),await On.get("detailing/contest/dashboard")),getAllContests:async()=>(console.log("Inside Service getAllContests() ..."),await On.get("detailing/contest/list")),getContestDetails:async n=>(console.log("Inside Service getContestDetails() ..."),await On.get(`detailing/contest/details?id=${n}`)),getContestSubmissionLike:async n=>(console.log("Inside Service getContestResponseLike() ..."),await On.get(`detailing/contest_response/like?id=${n}`)),getContestSubmissionLikesList:async n=>(console.log("Inside Service getContestSubmissionLikesList() ..."),await On.get(`detailing/contest_response/likes?id=${n}`)),getAllContestSubmissionCommentList:async n=>(console.log("Inside Service getAllContestSubmissionCommentList() ..."),await On.get(`detailing/contest_response/comments?id=${n}`)),addContestSubmissionComment:async n=>(console.log("Inside Service addContestSubmissionComment() ...",n),await On.post("detailing/contest_response/comment",n)),addContestResponseRecord:async n=>(console.log("Inside Service addContestResponseRecord() ...",n),await On.post("detailing/contest_response/record",n)),deleteContestResponseRecord:async n=>(console.log("Inside Service deleteContestResponseRecord() ...",n),await On.get(`detailing/contest_response/delete?id=${n}`)),deleteContestResponseRecordForReattempt:async n=>(console.log("Inside Service deleteContestResponseRecordForReattempt() ...",n),await On.get(`detailing/contest_response/deleteforreattempt?id=${n}`)),getDetailingContestParameters:async n=>(console.log("Inside Service getDetailingContestParameters() ...",n),await On.get(`detailing/parameter/list?contest_id=${n}`)),evaluateDetailingContestResponse:async n=>(console.log("Inside Service evaluateDetailingContestResponse() ...",n),await On.post("detailing/contest_response/evaluate",n)),initializeCallAndGetDetails:async n=>await On.get(`wall/wallmessage/initializecall?contest_id=${n}`),startVideoRecording:async n=>await On.get(`wall/wallmessage/startrecording?record_id=${n}`),stopVideoRecording:async n=>await On.get(`wall/wallmessage/stoprecording?record_id=${n}`),getAllCompetitionContests:async()=>(console.log("Inside Service getAllCompetitionContests() ..."),await On.get("competition/contest/dashboard"))};function qi(n){const t=Xo(),i=n.className?n.className:"";return k.useEffect(()=>{window.scrollTo(0,0)},[t]),h.jsx("div",{className:`page-content-wrapper ${i}`,children:n.children})}function ci(n){let t=n!=null&&n.className?n==null?void 0:n.className:"",i=null;switch(n.type){case"user-profile":i=h.jsxs(et,{className:"placeholder-card shadow1 border-0 mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"pb-0",children:h.jsx("div",{className:"d-flex align-items-center justify-content-between",children:h.jsxs("div",{className:"flex-grow-1 ms-0 text-start",children:[h.jsx("div",{className:"w-100 mb-1",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:5,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn.Button,{"aria-hidden":"true",style:{borderRadius:"20px",width:"100px",height:"20px"},className:"btn-theme btn-sm btn-gray",animation:"glow"})})]})})}),h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb-3 text-center",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{style:{height:"30px",borderRadius:"5px"},xs:4,bg:"secondary"})})}),h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"200px"},bg:"secondary",as:"div"})})})]})]});break;case"quick-actions":i=h.jsx(et,{className:`card-theme placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p2 text-center",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{className:"rounded-4",style:{width:"80px",height:"80px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:10,bg:"secondary"})})})]})});break;case"simple-stats":i=h.jsxs(et,{className:`placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:[h.jsx(et.Header,{children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsx(et.Body,{className:"p2 text-center",children:h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:4,bg:"secondary"})]})})})]});break;case"banners":i=h.jsx(et,{className:`placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsx(et.Body,{className:"p2",children:h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})})})});break;case"magazine":i=h.jsxs(et,{className:"card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"border-bottom-0 bg-transparent",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsxs(et.Body,{className:"p-",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]});break;case"dashboard-magazine":i=h.jsx(et,{className:`card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p-0",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-2 px-2",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:9,bg:"secondary"})})})]})});break;case"competition-contest":i=h.jsxs(et,{className:"card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{className:"border-bottom-0 bg-transparent",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"flex-grow-1 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})})}),h.jsxs(et.Body,{className:"p-",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"150px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]});break;case"dashboard-competition-contest":i=h.jsx(et,{className:`card-theme placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden ${t}`,children:h.jsxs(et.Body,{className:"p-0",children:[h.jsx("div",{className:"w-100 mb-2",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"50px"},bg:"secondary",as:"div"})})}),h.jsx("div",{className:"w-100 mb-2 px-2",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:8,bg:"secondary"})]})})]})});break;case"likes-list":i=h.jsx(et,{className:"card-theme placeholder-card likes-list-placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:h.jsx(et.Header,{children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-5"})})}),h.jsx("div",{className:"flex-grow-1 ms-3 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})})})]})})});break;case"notifications-list":i=h.jsx(et,{className:"card-theme placeholder-card notifications-list-placeholder-card border-0 border-bottom bg-transparent rounded-0 mb2 text-left overflow-hidden",children:h.jsx(et.Header,{className:"px-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-3"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:3,bg:"secondary"})})})]})]})})});break;case"appreciations-list":i=h.jsx(et,{className:"card-theme placeholder-card appreciation-list-placeholder-card shadow-sm border-0 bg-transparent rounded-0 mb2 text-left overflow-hidden",children:h.jsx(et.Header,{className:"px-2",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-3"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:3,bg:"secondary"})})})]})]})})});break;case"comment-list":i=h.jsx(et,{className:"card-theme placeholder-card comment-list-placeholder-card border- shadow-s mb2 text-left overflow-hidden",children:h.jsxs(et.Body,{className:"p-2",children:[h.jsx("div",{className:"d-flex align-items-center flex-column mb-2",children:h.jsx("div",{className:"w-100",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:5,bg:"secondary"})]})})}),h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-5"})})}),h.jsx("div",{className:"flex-grow-1 ms-2 text-left",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:4,bg:"secondary"})})})})]})]})});break;case"details":i=h.jsx(et,{className:"placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:12,bg:"secondary"}),h.jsx(cn,{xs:10,bg:"secondary"}),h.jsx(cn,{xs:12,bg:"secondary"})]})})]})});break;case"iframe-loader":i=h.jsx(et,{className:`placeholder-card shadow1 border-0 mb2 text-left overflow-hidden ${t}`,children:h.jsx(et.Body,{className:"p-0",children:h.jsx("div",{className:"w-100",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{xs:12,style:{height:"500px"},bg:"secondary",as:"div"})})})})});break;default:i=h.jsxs(et,{className:"placeholder-card border-0 shadow-sm mb2 text-left overflow-hidden",children:[h.jsx(et.Header,{children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(cn,{as:"div",animation:"glow",children:h.jsx(cn,{bg:"secondary",as:"div",className:"placeholder-profile-img rounded-circle"})})}),h.jsxs("div",{className:"flex-grow-1 ms-3 text-left",children:[h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:6,bg:"secondary"})})}),h.jsx("div",{className:"w-100",children:h.jsx(cn,{animation:"glow",children:h.jsx(cn,{xs:4,bg:"secondary"})})})]})]})}),h.jsxs(et.Body,{className:"p2",children:[h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})}),h.jsx("br",{}),h.jsx("div",{className:"w-100 mb-1",children:h.jsxs(cn,{animation:"glow",children:[h.jsx(cn,{xs:9,bg:"secondary"}),h.jsx(cn,{xs:6,bg:"secondary"})]})})]})]})}return h.jsx(h.Fragment,{children:i})}function XKe(n){var u,p,g,_,y,E;const t=(u=n==null?void 0:n.item)!=null&&u.title?(p=n==null?void 0:n.item)==null?void 0:p.title:"Default title",i=(g=n==null?void 0:n.item)==null?void 0:g.value_title;(_=n==null?void 0:n.item)!=null&&_.type;const s=Z6e((y=n==null?void 0:n.item)==null?void 0:y.text);(E=n==null?void 0:n.item)==null||E.report_view_url;let l=n!=null&&n.className?n==null?void 0:n.className:"";function d(b){console.log("HandleClick item =",b);let A=`${b.report_view_url}&authorization=${Ai.getToken()}`;console.log("url = ",A),n.handleStatsCardClick(A)}return h.jsxs(et,{className:`border-0 card-theme overflow-hidden me-3 ${l}`,onClick:()=>d(n.item),children:[h.jsx(et.Header,{className:"font-13 border-bottom-0 p-2 p-md-3",children:t}),h.jsx(et.Body,{className:"px-2 py-3",children:h.jsx(fn,{className:"row-cols-1 g-0 d-flex align-items-sm-center pt-sm-3",children:h.jsxs(Gt,{className:"d-flex flex-column text-center",children:[h.jsx("span",{className:"font-20 fw-sb mb-1",children:s}),h.jsx("span",{className:"font-13 mb-0",children:i})]})})})]})}var qO=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},AE=typeof window>"u"||"Deno"in globalThis;function Yc(){}function JKe(n,t){return typeof n=="function"?n(t):n}function Jq(n){return typeof n=="number"&&n>=0&&n!==1/0}function __e(n,t){return Math.max(n+(t||0)-Date.now(),0)}function Av(n,t){return typeof n=="function"?n(t):n}function Xu(n,t){return typeof n=="function"?n(t):n}function Fhe(n,t){const{type:i="all",exact:s,fetchStatus:l,predicate:d,queryKey:u,stale:p}=n;if(u){if(s){if(t.queryHash!==YQ(u,t.options))return!1}else if(!X4(t.queryKey,u))return!1}if(i!=="all"){const g=t.isActive();if(i==="active"&&!g||i==="inactive"&&g)return!1}return!(typeof p=="boolean"&&t.isStale()!==p||l&&l!==t.state.fetchStatus||d&&!d(t))}function Bhe(n,t){const{exact:i,status:s,predicate:l,mutationKey:d}=n;if(d){if(!t.options.mutationKey)return!1;if(i){if(Y4(t.options.mutationKey)!==Y4(d))return!1}else if(!X4(t.options.mutationKey,d))return!1}return!(s&&t.state.status!==s||l&&!l(t))}function YQ(n,t){return((t==null?void 0:t.queryKeyHashFn)||Y4)(n)}function Y4(n){return JSON.stringify(n,(t,i)=>Zq(i)?Object.keys(i).sort().reduce((s,l)=>(s[l]=i[l],s),{}):i)}function X4(n,t){return n===t?!0:typeof n!=typeof t?!1:n&&t&&typeof n=="object"&&typeof t=="object"?Object.keys(t).every(i=>X4(n[i],t[i])):!1}function E_e(n,t){if(n===t)return n;const i=Vhe(n)&&Vhe(t);if(i||Zq(n)&&Zq(t)){const s=i?n:Object.keys(n),l=s.length,d=i?t:Object.keys(t),u=d.length,p=i?[]:{},g=new Set(s);let _=0;for(let y=0;y<u;y++){const E=i?y:d[y];(!i&&g.has(E)||i)&&n[E]===void 0&&t[E]===void 0?(p[E]=void 0,_++):(p[E]=E_e(n[E],t[E]),p[E]===n[E]&&n[E]!==void 0&&_++)}return l===u&&_===l?n:p}return t}function Qq(n,t){if(!t||Object.keys(n).length!==Object.keys(t).length)return!1;for(const i in n)if(n[i]!==t[i])return!1;return!0}function Vhe(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Zq(n){if(!zhe(n))return!1;const t=n.constructor;if(t===void 0)return!0;const i=t.prototype;return!(!zhe(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function zhe(n){return Object.prototype.toString.call(n)==="[object Object]"}function QKe(n){return new Promise(t=>{setTimeout(t,n)})}function eY(n,t,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,t):i.structuralSharing!==!1?E_e(n,t):t}function ZKe(n,t,i=0){const s=[...n,t];return i&&s.length>i?s.slice(1):s}function eqe(n,t,i=0){const s=[t,...n];return i&&s.length>i?s.slice(0,-1):s}var XQ=Symbol();function w_e(n,t){return!n.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!n.queryFn||n.queryFn===XQ?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function tqe(n,t){return typeof n=="function"?n(...t):!!n}var M_,d1,xC,kpe,nqe=(kpe=class extends qO{constructor(){super();ee(this,M_,void 0);ee(this,d1,void 0);ee(this,xC,void 0);re(this,xC,t=>{if(!AE&&window.addEventListener){const i=()=>t();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){T(this,d1)||this.setEventListener(T(this,xC))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,d1))==null||t.call(this),re(this,d1,void 0))}setEventListener(t){var i;re(this,xC,t),(i=T(this,d1))==null||i.call(this),re(this,d1,t(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(t){T(this,M_)!==t&&(re(this,M_,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(i=>{i(t)})}isFocused(){var t;return typeof T(this,M_)=="boolean"?T(this,M_):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},M_=new WeakMap,d1=new WeakMap,xC=new WeakMap,kpe),JQ=new nqe,AC,u1,IC,Mpe,iqe=(Mpe=class extends qO{constructor(){super();ee(this,AC,!0);ee(this,u1,void 0);ee(this,IC,void 0);re(this,IC,t=>{if(!AE&&window.addEventListener){const i=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}})}onSubscribe(){T(this,u1)||this.setEventListener(T(this,IC))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,u1))==null||t.call(this),re(this,u1,void 0))}setEventListener(t){var i;re(this,IC,t),(i=T(this,u1))==null||i.call(this),re(this,u1,t(this.setOnline.bind(this)))}setOnline(t){T(this,AC)!==t&&(re(this,AC,t),this.listeners.forEach(s=>{s(t)}))}isOnline(){return T(this,AC)}},AC=new WeakMap,u1=new WeakMap,IC=new WeakMap,Mpe),R7=new iqe;function tY(){let n,t;const i=new Promise((l,d)=>{n=l,t=d});i.status="pending",i.catch(()=>{});function s(l){Object.assign(i,l),delete i.resolve,delete i.reject}return i.resolve=l=>{s({status:"fulfilled",value:l}),n(l)},i.reject=l=>{s({status:"rejected",reason:l}),t(l)},i}function rqe(n){return Math.min(1e3*2**n,3e4)}function S_e(n){return(n??"online")==="online"?R7.isOnline():!0}var b_e=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function C_e(n){let t=!1,i=0,s;const l=tY(),d=()=>l.status!=="pending",u=O=>{var D;d()||(b(new b_e(O)),(D=n.abort)==null||D.call(n))},p=()=>{t=!0},g=()=>{t=!1},_=()=>JQ.isFocused()&&(n.networkMode==="always"||R7.isOnline())&&n.canRun(),y=()=>S_e(n.networkMode)&&n.canRun(),E=O=>{d()||(s==null||s(),l.resolve(O))},b=O=>{d()||(s==null||s(),l.reject(O))},A=()=>new Promise(O=>{var D;s=P=>{(d()||_())&&O(P)},(D=n.onPause)==null||D.call(n)}).then(()=>{var O;s=void 0,d()||(O=n.onContinue)==null||O.call(n)}),N=()=>{if(d())return;let O;const D=i===0?n.initialPromise:void 0;try{O=D??n.fn()}catch(P){O=Promise.reject(P)}Promise.resolve(O).then(E).catch(P=>{var $;if(d())return;const j=n.retry??(AE?0:3),M=n.retryDelay??rqe,V=typeof M=="function"?M(i,P):M,H=j===!0||typeof j=="number"&&i<j||typeof j=="function"&&j(i,P);if(t||!H){b(P);return}i++,($=n.onFail)==null||$.call(n,i,P),QKe(V).then(()=>_()?void 0:A()).then(()=>{t?b(P):N()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(s==null||s(),l),cancelRetry:p,continueRetry:g,canStart:y,start:()=>(y()?N():A().then(N),l)}}var sqe=n=>setTimeout(n,0);function aqe(){let n=[],t=0,i=p=>{p()},s=p=>{p()},l=sqe;const d=p=>{t?n.push(p):l(()=>{i(p)})},u=()=>{const p=n;n=[],p.length&&l(()=>{s(()=>{p.forEach(g=>{i(g)})})})};return{batch:p=>{let g;t++;try{g=p()}finally{t--,t||u()}return g},batchCalls:p=>(...g)=>{d(()=>{p(...g)})},schedule:d,setNotifyFunction:p=>{i=p},setBatchNotifyFunction:p=>{s=p},setScheduler:p=>{l=p}}}var Go=aqe(),j_,jpe,T_e=(jpe=class{constructor(){ee(this,j_,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jq(this.gcTime)&&re(this,j_,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(AE?1/0:5*60*1e3))}clearGcTimeout(){T(this,j_)&&(clearTimeout(T(this,j_)),re(this,j_,void 0))}},j_=new WeakMap,jpe),NC,OC,Fu,U_,lo,sN,F_,Vh,Am,Upe,oqe=(Upe=class extends T_e{constructor(t){super();ee(this,Vh);ee(this,NC,void 0);ee(this,OC,void 0);ee(this,Fu,void 0);ee(this,U_,void 0);ee(this,lo,void 0);ee(this,sN,void 0);ee(this,F_,void 0);re(this,F_,!1),re(this,sN,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,U_,t.client),re(this,Fu,T(this,U_).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,NC,lqe(this.options)),this.state=t.state??T(this,NC),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,lo))==null?void 0:t.promise}setOptions(t){this.options={...T(this,sN),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Fu).remove(this)}setData(t,i){const s=eY(this.state.data,t,this.options);return pe(this,Vh,Am).call(this,{data:s,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),s}setState(t,i){pe(this,Vh,Am).call(this,{type:"setState",state:t,setStateOptions:i})}cancel(t){var s,l;const i=(s=T(this,lo))==null?void 0:s.promise;return(l=T(this,lo))==null||l.cancel(t),i?i.then(Yc).catch(Yc):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,NC))}isActive(){return this.observers.some(t=>Xu(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===XQ||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Av(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!__e(this.state.dataUpdatedAt,t)}onFocus(){var i;const t=this.observers.find(s=>s.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(i=T(this,lo))==null||i.continue()}onOnline(){var i;const t=this.observers.find(s=>s.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(i=T(this,lo))==null||i.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Fu).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(i=>i!==t),this.observers.length||(T(this,lo)&&(T(this,F_)?T(this,lo).cancel({revert:!0}):T(this,lo).cancelRetry()),this.scheduleGc()),T(this,Fu).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Vh,Am).call(this,{type:"invalidate"})}async fetch(t,i){var g,_,y,E,b,A,N,O,D,P,j,M;if(this.state.fetchStatus!=="idle"&&((g=T(this,lo))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(T(this,lo))return T(this,lo).continueRetry(),T(this,lo).promise}if(t&&this.setOptions(t),!this.options.queryFn){const V=this.observers.find(H=>H.options.queryFn);V&&this.setOptions(V.options)}const s=new AbortController,l=V=>{Object.defineProperty(V,"signal",{enumerable:!0,get:()=>(re(this,F_,!0),s.signal)})},d=()=>{const V=w_e(this.options,i),$=(()=>{const Q={client:T(this,U_),queryKey:this.queryKey,meta:this.meta};return l(Q),Q})();return re(this,F_,!1),this.options.persister?this.options.persister(V,$,this):V($)},p=(()=>{const V={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:T(this,U_),state:this.state,fetchFn:d};return l(V),V})();(_=this.options.behavior)==null||_.onFetch(p,this),re(this,OC,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=p.fetchOptions)==null?void 0:y.meta))&&pe(this,Vh,Am).call(this,{type:"fetch",meta:(E=p.fetchOptions)==null?void 0:E.meta}),re(this,lo,C_e({initialPromise:i==null?void 0:i.initialPromise,fn:p.fetchFn,abort:s.abort.bind(s),onFail:(V,H)=>{pe(this,Vh,Am).call(this,{type:"failed",failureCount:V,error:H})},onPause:()=>{pe(this,Vh,Am).call(this,{type:"pause"})},onContinue:()=>{pe(this,Vh,Am).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{const V=await T(this,lo).start();if(V===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(V),(A=(b=T(this,Fu).config).onSuccess)==null||A.call(b,V,this),(O=(N=T(this,Fu).config).onSettled)==null||O.call(N,V,this.state.error,this),V}catch(V){if(V instanceof b_e){if(V.silent)return T(this,lo).promise;if(V.revert){if(this.setState({...T(this,OC),fetchStatus:"idle"}),this.state.data===void 0)throw V;return this.state.data}}throw pe(this,Vh,Am).call(this,{type:"error",error:V}),(P=(D=T(this,Fu).config).onError)==null||P.call(D,V,this),(M=(j=T(this,Fu).config).onSettled)==null||M.call(j,this.state.data,V,this),V}finally{this.scheduleGc()}}},NC=new WeakMap,OC=new WeakMap,Fu=new WeakMap,U_=new WeakMap,lo=new WeakMap,sN=new WeakMap,F_=new WeakMap,Vh=new WeakSet,Am=function(t){const i=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...R_e(s.data,this.options),fetchMeta:t.meta??null};case"success":const l={...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return re(this,OC,t.manual?l:void 0),l;case"error":const d=t.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=i(this.state),Go.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),T(this,Fu).notify({query:this,type:"updated",action:t})})},Upe);function R_e(n,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S_e(t.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function lqe(n){const t=typeof n.initialData=="function"?n.initialData():n.initialData,i=t!==void 0,s=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var ap,Fpe,cqe=(Fpe=class extends qO{constructor(t={}){super();ee(this,ap,void 0);this.config=t,re(this,ap,new Map)}build(t,i,s){const l=i.queryKey,d=i.queryHash??YQ(l,i);let u=this.get(d);return u||(u=new oqe({client:t,queryKey:l,queryHash:d,options:t.defaultQueryOptions(i),state:s,defaultOptions:t.getQueryDefaults(l)}),this.add(u)),u}add(t){T(this,ap).has(t.queryHash)||(T(this,ap).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const i=T(this,ap).get(t.queryHash);i&&(t.destroy(),i===t&&T(this,ap).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Go.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,ap).get(t)}getAll(){return[...T(this,ap).values()]}find(t){const i={exact:!0,...t};return this.getAll().find(s=>Fhe(i,s))}findAll(t={}){const i=this.getAll();return Object.keys(t).length>0?i.filter(s=>Fhe(t,s)):i}notify(t){Go.batch(()=>{this.listeners.forEach(i=>{i(t)})})}onFocus(){Go.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Go.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ap=new WeakMap,Fpe),op,Yl,B_,lp,e1,Bpe,dqe=(Bpe=class extends T_e{constructor(t){super();ee(this,lp);ee(this,op,void 0);ee(this,Yl,void 0);ee(this,B_,void 0);this.mutationId=t.mutationId,re(this,Yl,t.mutationCache),re(this,op,[]),this.state=t.state||uqe(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,op).includes(t)||(T(this,op).push(t),this.clearGcTimeout(),T(this,Yl).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,op,T(this,op).filter(i=>i!==t)),this.scheduleGc(),T(this,Yl).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,op).length||(this.state.status==="pending"?this.scheduleGc():T(this,Yl).remove(this))}continue(){var t;return((t=T(this,B_))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var d,u,p,g,_,y,E,b,A,N,O,D,P,j,M,V,H,$,Q,Y;const i=()=>{pe(this,lp,e1).call(this,{type:"continue"})};re(this,B_,C_e({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(le,ae)=>{pe(this,lp,e1).call(this,{type:"failed",failureCount:le,error:ae})},onPause:()=>{pe(this,lp,e1).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Yl).canRun(this)}));const s=this.state.status==="pending",l=!T(this,B_).canStart();try{if(s)i();else{pe(this,lp,e1).call(this,{type:"pending",variables:t,isPaused:l}),await((u=(d=T(this,Yl).config).onMutate)==null?void 0:u.call(d,t,this));const ae=await((g=(p=this.options).onMutate)==null?void 0:g.call(p,t));ae!==this.state.context&&pe(this,lp,e1).call(this,{type:"pending",context:ae,variables:t,isPaused:l})}const le=await T(this,B_).start();return await((y=(_=T(this,Yl).config).onSuccess)==null?void 0:y.call(_,le,t,this.state.context,this)),await((b=(E=this.options).onSuccess)==null?void 0:b.call(E,le,t,this.state.context)),await((N=(A=T(this,Yl).config).onSettled)==null?void 0:N.call(A,le,null,this.state.variables,this.state.context,this)),await((D=(O=this.options).onSettled)==null?void 0:D.call(O,le,null,t,this.state.context)),pe(this,lp,e1).call(this,{type:"success",data:le}),le}catch(le){try{throw await((j=(P=T(this,Yl).config).onError)==null?void 0:j.call(P,le,t,this.state.context,this)),await((V=(M=this.options).onError)==null?void 0:V.call(M,le,t,this.state.context)),await(($=(H=T(this,Yl).config).onSettled)==null?void 0:$.call(H,void 0,le,this.state.variables,this.state.context,this)),await((Y=(Q=this.options).onSettled)==null?void 0:Y.call(Q,void 0,le,t,this.state.context)),le}finally{pe(this,lp,e1).call(this,{type:"error",error:le})}}finally{T(this,Yl).runNext(this)}}},op=new WeakMap,Yl=new WeakMap,B_=new WeakMap,lp=new WeakSet,e1=function(t){const i=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Go.batch(()=>{T(this,op).forEach(s=>{s.onMutationUpdate(t)}),T(this,Yl).notify({mutation:this,type:"updated",action:t})})},Bpe);function uqe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jm,zh,aN,Vpe,hqe=(Vpe=class extends qO{constructor(t={}){super();ee(this,jm,void 0);ee(this,zh,void 0);ee(this,aN,void 0);this.config=t,re(this,jm,new Set),re(this,zh,new Map),re(this,aN,0)}build(t,i,s){const l=new dqe({mutationCache:this,mutationId:++ao(this,aN)._,options:t.defaultMutationOptions(i),state:s});return this.add(l),l}add(t){T(this,jm).add(t);const i=bk(t);if(typeof i=="string"){const s=T(this,zh).get(i);s?s.push(t):T(this,zh).set(i,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,jm).delete(t)){const i=bk(t);if(typeof i=="string"){const s=T(this,zh).get(i);if(s)if(s.length>1){const l=s.indexOf(t);l!==-1&&s.splice(l,1)}else s[0]===t&&T(this,zh).delete(i)}}this.notify({type:"removed",mutation:t})}canRun(t){const i=bk(t);if(typeof i=="string"){const s=T(this,zh).get(i),l=s==null?void 0:s.find(d=>d.state.status==="pending");return!l||l===t}else return!0}runNext(t){var s;const i=bk(t);if(typeof i=="string"){const l=(s=T(this,zh).get(i))==null?void 0:s.find(d=>d!==t&&d.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Go.batch(()=>{T(this,jm).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,jm).clear(),T(this,zh).clear()})}getAll(){return Array.from(T(this,jm))}find(t){const i={exact:!0,...t};return this.getAll().find(s=>Bhe(i,s))}findAll(t={}){return this.getAll().filter(i=>Bhe(t,i))}notify(t){Go.batch(()=>{this.listeners.forEach(i=>{i(t)})})}resumePausedMutations(){const t=this.getAll().filter(i=>i.state.isPaused);return Go.batch(()=>Promise.all(t.map(i=>i.continue().catch(Yc))))}},jm=new WeakMap,zh=new WeakMap,aN=new WeakMap,Vpe);function bk(n){var t;return(t=n.options.scope)==null?void 0:t.id}function Hhe(n){return{onFetch:(t,i)=>{var y,E,b,A,N;const s=t.options,l=(b=(E=(y=t.fetchOptions)==null?void 0:y.meta)==null?void 0:E.fetchMore)==null?void 0:b.direction,d=((A=t.state.data)==null?void 0:A.pages)||[],u=((N=t.state.data)==null?void 0:N.pageParams)||[];let p={pages:[],pageParams:[]},g=0;const _=async()=>{let O=!1;const D=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(t.signal.aborted?O=!0:t.signal.addEventListener("abort",()=>{O=!0}),t.signal)})},P=w_e(t.options,t.fetchOptions),j=async(M,V,H)=>{if(O)return Promise.reject();if(V==null&&M.pages.length)return Promise.resolve(M);const Q=(()=>{const te={client:t.client,queryKey:t.queryKey,pageParam:V,direction:H?"backward":"forward",meta:t.options.meta};return D(te),te})(),Y=await P(Q),{maxPages:le}=t.options,ae=H?eqe:ZKe;return{pages:ae(M.pages,Y,le),pageParams:ae(M.pageParams,V,le)}};if(l&&d.length){const M=l==="backward",V=M?fqe:Ghe,H={pages:d,pageParams:u},$=V(s,H);p=await j(H,$,M)}else{const M=n??d.length;do{const V=g===0?u[0]??s.initialPageParam:Ghe(s,p);if(g>0&&V==null)break;p=await j(p,V),g++}while(g<M)}return p};t.options.persister?t.fetchFn=()=>{var O,D;return(D=(O=t.options).persister)==null?void 0:D.call(O,_,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i)}:t.fetchFn=_}}}function Ghe(n,{pages:t,pageParams:i}){const s=t.length-1;return t.length>0?n.getNextPageParam(t[s],t,i[s],i):void 0}function fqe(n,{pages:t,pageParams:i}){var s;return t.length>0?(s=n.getPreviousPageParam)==null?void 0:s.call(n,t[0],t,i[0],i):void 0}var Js,h1,f1,PC,LC,p1,DC,kC,zpe,pqe=(zpe=class{constructor(n={}){ee(this,Js,void 0);ee(this,h1,void 0);ee(this,f1,void 0);ee(this,PC,void 0);ee(this,LC,void 0);ee(this,p1,void 0);ee(this,DC,void 0);ee(this,kC,void 0);re(this,Js,n.queryCache||new cqe),re(this,h1,n.mutationCache||new hqe),re(this,f1,n.defaultOptions||{}),re(this,PC,new Map),re(this,LC,new Map),re(this,p1,0)}mount(){ao(this,p1)._++,T(this,p1)===1&&(re(this,DC,JQ.subscribe(async n=>{n&&(await this.resumePausedMutations(),T(this,Js).onFocus())})),re(this,kC,R7.subscribe(async n=>{n&&(await this.resumePausedMutations(),T(this,Js).onOnline())})))}unmount(){var n,t;ao(this,p1)._--,T(this,p1)===0&&((n=T(this,DC))==null||n.call(this),re(this,DC,void 0),(t=T(this,kC))==null||t.call(this),re(this,kC,void 0))}isFetching(n){return T(this,Js).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return T(this,h1).findAll({...n,status:"pending"}).length}getQueryData(n){var i;const t=this.defaultQueryOptions({queryKey:n});return(i=T(this,Js).get(t.queryHash))==null?void 0:i.state.data}ensureQueryData(n){const t=this.defaultQueryOptions(n),i=T(this,Js).build(this,t),s=i.state.data;return s===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(Av(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(n){return T(this,Js).findAll(n).map(({queryKey:t,state:i})=>{const s=i.data;return[t,s]})}setQueryData(n,t,i){const s=this.defaultQueryOptions({queryKey:n}),l=T(this,Js).get(s.queryHash),d=l==null?void 0:l.state.data,u=JKe(t,d);if(u!==void 0)return T(this,Js).build(this,s).setData(u,{...i,manual:!0})}setQueriesData(n,t,i){return Go.batch(()=>T(this,Js).findAll(n).map(({queryKey:s})=>[s,this.setQueryData(s,t,i)]))}getQueryState(n){var i;const t=this.defaultQueryOptions({queryKey:n});return(i=T(this,Js).get(t.queryHash))==null?void 0:i.state}removeQueries(n){const t=T(this,Js);Go.batch(()=>{t.findAll(n).forEach(i=>{t.remove(i)})})}resetQueries(n,t){const i=T(this,Js);return Go.batch(()=>(i.findAll(n).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...n},t)))}cancelQueries(n,t={}){const i={revert:!0,...t},s=Go.batch(()=>T(this,Js).findAll(n).map(l=>l.cancel(i)));return Promise.all(s).then(Yc).catch(Yc)}invalidateQueries(n,t={}){return Go.batch(()=>(T(this,Js).findAll(n).forEach(i=>{i.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},t)))}refetchQueries(n,t={}){const i={...t,cancelRefetch:t.cancelRefetch??!0},s=Go.batch(()=>T(this,Js).findAll(n).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let d=l.fetch(void 0,i);return i.throwOnError||(d=d.catch(Yc)),l.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(s).then(Yc)}fetchQuery(n){const t=this.defaultQueryOptions(n);t.retry===void 0&&(t.retry=!1);const i=T(this,Js).build(this,t);return i.isStaleByTime(Av(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Yc).catch(Yc)}fetchInfiniteQuery(n){return n.behavior=Hhe(n.pages),this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Yc).catch(Yc)}ensureInfiniteQueryData(n){return n.behavior=Hhe(n.pages),this.ensureQueryData(n)}resumePausedMutations(){return R7.isOnline()?T(this,h1).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Js)}getMutationCache(){return T(this,h1)}getDefaultOptions(){return T(this,f1)}setDefaultOptions(n){re(this,f1,n)}setQueryDefaults(n,t){T(this,PC).set(Y4(n),{queryKey:n,defaultOptions:t})}getQueryDefaults(n){const t=[...T(this,PC).values()],i={};return t.forEach(s=>{X4(n,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(n,t){T(this,LC).set(Y4(n),{mutationKey:n,defaultOptions:t})}getMutationDefaults(n){const t=[...T(this,LC).values()],i={};return t.forEach(s=>{X4(n,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const t={...T(this,f1).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return t.queryHash||(t.queryHash=YQ(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===XQ&&(t.enabled=!1),t}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...T(this,f1).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){T(this,Js).clear(),T(this,h1).clear()}},Js=new WeakMap,h1=new WeakMap,f1=new WeakMap,PC=new WeakMap,LC=new WeakMap,p1=new WeakMap,DC=new WeakMap,kC=new WeakMap,zpe),Hc,or,oN,Xl,V_,MC,Um,m1,lN,jC,UC,z_,H_,g1,FC,G_,DI,cN,nY,dN,iY,uN,rY,hN,sY,fN,aY,pN,oY,mN,lY,G7,x_e,Hpe,mqe=(Hpe=class extends qO{constructor(t,i){super();ee(this,G_);ee(this,cN);ee(this,dN);ee(this,uN);ee(this,hN);ee(this,fN);ee(this,pN);ee(this,mN);ee(this,G7);ee(this,Hc,void 0);ee(this,or,void 0);ee(this,oN,void 0);ee(this,Xl,void 0);ee(this,V_,void 0);ee(this,MC,void 0);ee(this,Um,void 0);ee(this,m1,void 0);ee(this,lN,void 0);ee(this,jC,void 0);ee(this,UC,void 0);ee(this,z_,void 0);ee(this,H_,void 0);ee(this,g1,void 0);ee(this,FC,new Set);this.options=i,re(this,Hc,t),re(this,m1,null),re(this,Um,tY()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,or).addObserver(this),Whe(T(this,or),this.options)?pe(this,G_,DI).call(this):this.updateResult(),pe(this,hN,sY).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cY(T(this,or),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cY(T(this,or),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,fN,aY).call(this),pe(this,pN,oY).call(this),T(this,or).removeObserver(this)}setOptions(t){const i=this.options,s=T(this,or);if(this.options=T(this,Hc).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xu(this.options.enabled,T(this,or))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,mN,lY).call(this),T(this,or).setOptions(this.options),i._defaulted&&!Qq(this.options,i)&&T(this,Hc).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,or),observer:this});const l=this.hasListeners();l&&$he(T(this,or),s,this.options,i)&&pe(this,G_,DI).call(this),this.updateResult(),l&&(T(this,or)!==s||Xu(this.options.enabled,T(this,or))!==Xu(i.enabled,T(this,or))||Av(this.options.staleTime,T(this,or))!==Av(i.staleTime,T(this,or)))&&pe(this,cN,nY).call(this);const d=pe(this,dN,iY).call(this);l&&(T(this,or)!==s||Xu(this.options.enabled,T(this,or))!==Xu(i.enabled,T(this,or))||d!==T(this,g1))&&pe(this,uN,rY).call(this,d)}getOptimisticResult(t){const i=T(this,Hc).getQueryCache().build(T(this,Hc),t),s=this.createResult(i,t);return vqe(this,s)&&(re(this,Xl,s),re(this,MC,this.options),re(this,V_,T(this,or).state)),s}getCurrentResult(){return T(this,Xl)}trackResult(t,i){return new Proxy(t,{get:(s,l)=>(this.trackProp(l),i==null||i(l),l==="promise"&&!this.options.experimental_prefetchInRender&&T(this,Um).status==="pending"&&T(this,Um).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,l))})}trackProp(t){T(this,FC).add(t)}getCurrentQuery(){return T(this,or)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const i=T(this,Hc).defaultQueryOptions(t),s=T(this,Hc).getQueryCache().build(T(this,Hc),i);return s.fetch().then(()=>this.createResult(s,i))}fetch(t){return pe(this,G_,DI).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Xl)))}createResult(t,i){var le;const s=T(this,or),l=this.options,d=T(this,Xl),u=T(this,V_),p=T(this,MC),_=t!==s?t.state:T(this,oN),{state:y}=t;let E={...y},b=!1,A;if(i._optimisticResults){const ae=this.hasListeners(),te=!ae&&Whe(t,i),de=ae&&$he(t,s,i,l);(te||de)&&(E={...E,...R_e(y.data,t.options)}),i._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:N,errorUpdatedAt:O,status:D}=E;A=E.data;let P=!1;if(i.placeholderData!==void 0&&A===void 0&&D==="pending"){let ae;d!=null&&d.isPlaceholderData&&i.placeholderData===(p==null?void 0:p.placeholderData)?(ae=d.data,P=!0):ae=typeof i.placeholderData=="function"?i.placeholderData((le=T(this,UC))==null?void 0:le.state.data,T(this,UC)):i.placeholderData,ae!==void 0&&(D="success",A=eY(d==null?void 0:d.data,ae,i),b=!0)}if(i.select&&A!==void 0&&!P)if(d&&A===(u==null?void 0:u.data)&&i.select===T(this,lN))A=T(this,jC);else try{re(this,lN,i.select),A=i.select(A),A=eY(d==null?void 0:d.data,A,i),re(this,jC,A),re(this,m1,null)}catch(ae){re(this,m1,ae)}T(this,m1)&&(N=T(this,m1),A=T(this,jC),O=Date.now(),D="error");const j=E.fetchStatus==="fetching",M=D==="pending",V=D==="error",H=M&&j,$=A!==void 0,Y={status:D,fetchStatus:E.fetchStatus,isPending:M,isSuccess:D==="success",isError:V,isInitialLoading:H,isLoading:H,data:A,dataUpdatedAt:E.dataUpdatedAt,error:N,errorUpdatedAt:O,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:E.dataUpdateCount>0||E.errorUpdateCount>0,isFetchedAfterMount:E.dataUpdateCount>_.dataUpdateCount||E.errorUpdateCount>_.errorUpdateCount,isFetching:j,isRefetching:j&&!M,isLoadingError:V&&!$,isPaused:E.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:V&&$,isStale:QQ(t,i),refetch:this.refetch,promise:T(this,Um),isEnabled:Xu(i.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const ae=G=>{Y.status==="error"?G.reject(Y.error):Y.data!==void 0&&G.resolve(Y.data)},te=()=>{const G=re(this,Um,Y.promise=tY());ae(G)},de=T(this,Um);switch(de.status){case"pending":t.queryHash===s.queryHash&&ae(de);break;case"fulfilled":(Y.status==="error"||Y.data!==de.value)&&te();break;case"rejected":(Y.status!=="error"||Y.error!==de.reason)&&te();break}}return Y}updateResult(){const t=T(this,Xl),i=this.createResult(T(this,or),this.options);if(re(this,V_,T(this,or).state),re(this,MC,this.options),T(this,V_).data!==void 0&&re(this,UC,T(this,or)),Qq(i,t))return;re(this,Xl,i);const s=()=>{if(!t)return!0;const{notifyOnChangeProps:l}=this.options,d=typeof l=="function"?l():l;if(d==="all"||!d&&!T(this,FC).size)return!0;const u=new Set(d??T(this,FC));return this.options.throwOnError&&u.add("error"),Object.keys(T(this,Xl)).some(p=>{const g=p;return T(this,Xl)[g]!==t[g]&&u.has(g)})};pe(this,G7,x_e).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,hN,sY).call(this)}},Hc=new WeakMap,or=new WeakMap,oN=new WeakMap,Xl=new WeakMap,V_=new WeakMap,MC=new WeakMap,Um=new WeakMap,m1=new WeakMap,lN=new WeakMap,jC=new WeakMap,UC=new WeakMap,z_=new WeakMap,H_=new WeakMap,g1=new WeakMap,FC=new WeakMap,G_=new WeakSet,DI=function(t){pe(this,mN,lY).call(this);let i=T(this,or).fetch(this.options,t);return t!=null&&t.throwOnError||(i=i.catch(Yc)),i},cN=new WeakSet,nY=function(){pe(this,fN,aY).call(this);const t=Av(this.options.staleTime,T(this,or));if(AE||T(this,Xl).isStale||!Jq(t))return;const s=__e(T(this,Xl).dataUpdatedAt,t)+1;re(this,z_,setTimeout(()=>{T(this,Xl).isStale||this.updateResult()},s))},dN=new WeakSet,iY=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,or)):this.options.refetchInterval)??!1},uN=new WeakSet,rY=function(t){pe(this,pN,oY).call(this),re(this,g1,t),!(AE||Xu(this.options.enabled,T(this,or))===!1||!Jq(T(this,g1))||T(this,g1)===0)&&re(this,H_,setInterval(()=>{(this.options.refetchIntervalInBackground||JQ.isFocused())&&pe(this,G_,DI).call(this)},T(this,g1)))},hN=new WeakSet,sY=function(){pe(this,cN,nY).call(this),pe(this,uN,rY).call(this,pe(this,dN,iY).call(this))},fN=new WeakSet,aY=function(){T(this,z_)&&(clearTimeout(T(this,z_)),re(this,z_,void 0))},pN=new WeakSet,oY=function(){T(this,H_)&&(clearInterval(T(this,H_)),re(this,H_,void 0))},mN=new WeakSet,lY=function(){const t=T(this,Hc).getQueryCache().build(T(this,Hc),this.options);if(t===T(this,or))return;const i=T(this,or);re(this,or,t),re(this,oN,t.state),this.hasListeners()&&(i==null||i.removeObserver(this),t.addObserver(this))},G7=new WeakSet,x_e=function(t){Go.batch(()=>{t.listeners&&this.listeners.forEach(i=>{i(T(this,Xl))}),T(this,Hc).getQueryCache().notify({query:T(this,or),type:"observerResultsUpdated"})})},Hpe);function gqe(n,t){return Xu(t.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&t.retryOnMount===!1)}function Whe(n,t){return gqe(n,t)||n.state.data!==void 0&&cY(n,t,t.refetchOnMount)}function cY(n,t,i){if(Xu(t.enabled,n)!==!1&&Av(t.staleTime,n)!=="static"){const s=typeof i=="function"?i(n):i;return s==="always"||s!==!1&&QQ(n,t)}return!1}function $he(n,t,i,s){return(n!==t||Xu(s.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&QQ(n,i)}function QQ(n,t){return Xu(t.enabled,n)!==!1&&n.isStaleByTime(Av(t.staleTime,n))}function vqe(n,t){return!Qq(n.getCurrentResult(),t)}var A_e=k.createContext(void 0),yqe=n=>{const t=k.useContext(A_e);if(n)return n;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_qe=({client:n,children:t})=>(k.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),h.jsx(A_e.Provider,{value:n,children:t})),I_e=k.createContext(!1),Eqe=()=>k.useContext(I_e);I_e.Provider;function wqe(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var Sqe=k.createContext(wqe()),bqe=()=>k.useContext(Sqe),Cqe=(n,t)=>{(n.suspense||n.throwOnError||n.experimental_prefetchInRender)&&(t.isReset()||(n.retryOnMount=!1))},Tqe=n=>{k.useEffect(()=>{n.clearReset()},[n])},Rqe=({result:n,errorResetBoundary:t,throwOnError:i,query:s,suspense:l})=>n.isError&&!t.isReset()&&!n.isFetching&&s&&(l&&n.data===void 0||tqe(i,[n.error,s])),xqe=n=>{if(n.suspense){const t=s=>s==="static"?s:Math.max(s??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...s)=>t(i(...s)):t(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Aqe=(n,t)=>n.isLoading&&n.isFetching&&!t,Iqe=(n,t)=>(n==null?void 0:n.suspense)&&t.isPending,Khe=(n,t,i)=>t.fetchOptimistic(n).catch(()=>{i.clearReset()});function Nqe(n,t,i){var E,b,A,N,O;const s=Eqe(),l=bqe(),d=yqe(i),u=d.defaultQueryOptions(n);(b=(E=d.getDefaultOptions().queries)==null?void 0:E._experimental_beforeQuery)==null||b.call(E,u),u._optimisticResults=s?"isRestoring":"optimistic",xqe(u),Cqe(u,l),Tqe(l);const p=!d.getQueryCache().get(u.queryHash),[g]=k.useState(()=>new t(d,u)),_=g.getOptimisticResult(u),y=!s&&n.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(D=>{const P=y?g.subscribe(Go.batchCalls(D)):Yc;return g.updateResult(),P},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),k.useEffect(()=>{g.setOptions(u)},[u,g]),Iqe(u,_))throw Khe(u,g,l);if(Rqe({result:_,errorResetBoundary:l,throwOnError:u.throwOnError,query:d.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw _.error;if((N=(A=d.getDefaultOptions().queries)==null?void 0:A._experimental_afterQuery)==null||N.call(A,u,_),u.experimental_prefetchInRender&&!AE&&Aqe(_,s)){const D=p?Khe(u,g,l):(O=d.getQueryCache().get(u.queryHash))==null?void 0:O.promise;D==null||D.catch(Yc).finally(()=>{g.updateResult()})}return u.notifyOnChangeProps?_:g.trackResult(_)}function Qd(n,t){return Nqe(n,mqe,t)}const Oqe="modulepreload",Pqe=function(n){return"/"+n},qhe={},Xi=function(t,i,s){let l=Promise.resolve();if(i&&i.length>0){const d=document.getElementsByTagName("link");l=Promise.all(i.map(u=>{if(u=Pqe(u),u in qhe)return;qhe[u]=!0;const p=u.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(!!s)for(let E=d.length-1;E>=0;E--){const b=d[E];if(b.href===u&&(!p||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${g}`))return;const y=document.createElement("link");if(y.rel=p?"stylesheet":Oqe,p||(y.as="script",y.crossOrigin=""),y.href=u,document.head.appendChild(y),p)return new Promise((E,b)=>{y.addEventListener("load",E),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}return l.then(()=>t()).catch(d=>{const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=d,window.dispatchEvent(u),!u.defaultPrevented)throw d})};/*! Capacitor: https://capacitorjs.com/ - MIT License */var LR;(function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"})(LR||(LR={}));class Y$ extends Error{constructor(t,i,s){super(t),this.message=t,this.code=i,this.data=s}}const Lqe=n=>{var t,i;return n!=null&&n.androidBridge?"android":!((i=(t=n==null?void 0:n.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||i===void 0)&&i.bridge?"ios":"web"},Dqe=n=>{const t=n.CapacitorCustomPlatform||null,i=n.Capacitor||{},s=i.Plugins=i.Plugins||{},l=()=>t!==null?t.name:Lqe(n),d=()=>l()!=="web",u=E=>{const b=_.get(E);return!!(b!=null&&b.platforms.has(l())||p(E))},p=E=>{var b;return(b=i.PluginHeaders)===null||b===void 0?void 0:b.find(A=>A.name===E)},g=E=>n.console.error(E),_=new Map,y=(E,b={})=>{const A=_.get(E);if(A)return console.warn(`Capacitor plugin "${E}" already registered. Cannot register plugins twice.`),A.proxy;const N=l(),O=p(E);let D;const P=async()=>(!D&&N in b?D=typeof b[N]=="function"?D=await b[N]():D=b[N]:t!==null&&!D&&"web"in b&&(D=typeof b.web=="function"?D=await b.web():D=b.web),D),j=(Y,le)=>{var ae,te;if(O){const de=O==null?void 0:O.methods.find(G=>le===G.name);if(de)return de.rtype==="promise"?G=>i.nativePromise(E,le.toString(),G):(G,ie)=>i.nativeCallback(E,le.toString(),G,ie);if(Y)return(ae=Y[le])===null||ae===void 0?void 0:ae.bind(Y)}else{if(Y)return(te=Y[le])===null||te===void 0?void 0:te.bind(Y);throw new Y$(`"${E}" plugin is not implemented on ${N}`,LR.Unimplemented)}},M=Y=>{let le;const ae=(...te)=>{const de=P().then(G=>{const ie=j(G,Y);if(ie){const _e=ie(...te);return le=_e==null?void 0:_e.remove,_e}else throw new Y$(`"${E}.${Y}()" is not implemented on ${N}`,LR.Unimplemented)});return Y==="addListener"&&(de.remove=async()=>le()),de};return ae.toString=()=>`${Y.toString()}() { [capacitor code] }`,Object.defineProperty(ae,"name",{value:Y,writable:!1,configurable:!1}),ae},V=M("addListener"),H=M("removeListener"),$=(Y,le)=>{const ae=V({eventName:Y},le),te=async()=>{const G=await ae;H({eventName:Y,callbackId:G},le)},de=new Promise(G=>ae.then(()=>G({remove:te})));return de.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await te()},de},Q=new Proxy({},{get(Y,le){switch(le){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return O?$:V;case"removeListener":return H;default:return M(le)}}});return s[E]=Q,_.set(E,{name:E,proxy:Q,platforms:new Set([...Object.keys(b),...O?[N]:[]])}),Q};return i.convertFileSrc||(i.convertFileSrc=E=>E),i.getPlatform=l,i.handleError=g,i.isNativePlatform=d,i.isPluginAvailable=u,i.registerPlugin=y,i.Exception=Y$,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i},kqe=n=>n.Capacitor=Dqe(n),dY=kqe(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof Wo<"u"?Wo:{}),hc=dY.registerPlugin;class N_e{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,i){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(i);const d=this.windowListeners[t];d&&!d.registered&&this.addWindowListener(d),s&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,i);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,i,s){const l=this.listeners[t];if(!l){if(s){let d=this.retainedEventArguments[t];d||(d=[]),d.push(i),this.retainedEventArguments[t]=d}return}l.forEach(d=>d(i))}hasListeners(t){var i;return!!(!((i=this.listeners[t])===null||i===void 0)&&i.length)}registerWindowListener(t,i){this.windowListeners[i]={registered:!1,windowEventName:t,pluginEventName:i,handler:s=>{this.notifyListeners(i,s)}}}unimplemented(t="not implemented"){return new dY.Exception(t,LR.Unimplemented)}unavailable(t="not available"){return new dY.Exception(t,LR.Unavailable)}async removeListener(t,i){const s=this.listeners[t];if(!s)return;const l=s.indexOf(i);this.listeners[t].splice(l,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const i=this.retainedEventArguments[t];i&&(delete this.retainedEventArguments[t],i.forEach(s=>{this.notifyListeners(t,s)}))}}const Yhe=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Xhe=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Mqe extends N_e{async getCookies(){const t=document.cookie,i={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[l,d]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=Xhe(l).trim(),d=Xhe(d).trim(),i[l]=d}),i}async setCookie(t){try{const i=Yhe(t.key),s=Yhe(t.value),l=`; expires=${(t.expires||"").replace("expires=","")}`,d=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${i}=${s||""}${l}; path=${d}; ${u};`}catch(i){return Promise.reject(i)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(i){return Promise.reject(i)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const i of t)document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}hc("CapacitorCookies",{web:()=>new Mqe});const jqe=async n=>new Promise((t,i)=>{const s=new FileReader;s.onload=()=>{const l=s.result;t(l.indexOf(",")>=0?l.split(",")[1]:l)},s.onerror=l=>i(l),s.readAsDataURL(n)}),Uqe=(n={})=>{const t=Object.keys(n);return Object.keys(n).map(l=>l.toLocaleLowerCase()).reduce((l,d,u)=>(l[d]=n[t[u]],l),{})},Fqe=(n,t=!0)=>n?Object.entries(n).reduce((s,l)=>{const[d,u]=l;let p,g;return Array.isArray(u)?(g="",u.forEach(_=>{p=t?encodeURIComponent(_):_,g+=`${d}=${p}&`}),g.slice(0,-1)):(p=t?encodeURIComponent(u):u,g=`${d}=${p}`),`${s}&${g}`},"").substr(1):null,Bqe=(n,t={})=>{const i=Object.assign({method:n.method||"GET",headers:n.headers},t),l=Uqe(n.headers)["content-type"]||"";if(typeof n.data=="string")i.body=n.data;else if(l.includes("application/x-www-form-urlencoded")){const d=new URLSearchParams;for(const[u,p]of Object.entries(n.data||{}))d.set(u,p);i.body=d.toString()}else if(l.includes("multipart/form-data")||n.data instanceof FormData){const d=new FormData;if(n.data instanceof FormData)n.data.forEach((p,g)=>{d.append(g,p)});else for(const p of Object.keys(n.data))d.append(p,n.data[p]);i.body=d;const u=new Headers(i.headers);u.delete("content-type"),i.headers=u}else(l.includes("application/json")||typeof n.data=="object")&&(i.body=JSON.stringify(n.data));return i};class Vqe extends N_e{async request(t){const i=Bqe(t,t.webFetchExtra),s=Fqe(t.params,t.shouldEncodeUrlParams),l=s?`${t.url}?${s}`:t.url,d=await fetch(l,i),u=d.headers.get("content-type")||"";let{responseType:p="text"}=d.ok?t:{};u.includes("application/json")&&(p="json");let g,_;switch(p){case"arraybuffer":case"blob":_=await d.blob(),g=await jqe(_);break;case"json":g=await d.json();break;case"document":case"text":default:g=await d.text()}const y={};return d.headers.forEach((E,b)=>{y[b]=E}),{data:g,headers:y,status:d.status,url:d.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}hc("CapacitorHttp",{web:()=>new Vqe});const DR=hc("Browser",{web:()=>Xi(()=>import("./web-C7IvoHDb.js"),__vite__mapDeps([])).then(n=>new n.BrowserWeb)}),IE="#00aed9",O_e="#fafafa",Jhe="messageUsers",zqe="messageUserListFetchedOn";function Hqe(){Ii();const[n,t]=k.useState(!1),i=async({queryKey:E})=>{var N,O;const[b,A]=E;try{const D=await hs.getDashboardUserStats(A);return D.data.status==="success"?(console.log("## Dashboard User Stats Res --",D),(O=(N=D.data)==null?void 0:N.data)==null?void 0:O.stats):null}catch{throw new Error("Error fetching quick actions")}},{isFetching:s,isPending:l,isError:d,data:u,error:p,refetch:g}=Qd({queryKey:["dashboardUserStatsQuery",{isRefresh:n}],queryFn:i});async function _(){t(!0)}const y=async E=>{await DR.open({url:E,toolbarColor:IE})};return l?h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((E,b)=>h.jsx(ci,{type:"simple-stats",className:"card-theme overflow-hidden card-width-40 me-3"},b))})}):d?h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more stats"})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((E,b)=>h.jsx(ci,{type:"simple-stats",className:"card-theme overflow-hidden card-width-40 me-3"},b))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-1 pb-1 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Performance stats"}),h.jsx(Pt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb pe-0 d-none",children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u.map((E,b)=>h.jsx(XKe,{item:E,className:"card-width-40 shadow-sm dashboard-stats-card",handleStatsCardClick:y},`${E==null?void 0:E.value_title}-${b}`))}),h.jsx("div",{className:"text-center pt-2 pb-1",children:h.jsxs(Pt,{variant:"secondary",size:"sm",className:"btn-theme btn-secondary rounded- font-14",onClick:_,disabled:s,children:[h.jsx(Zt,{tag:"reload3",className:`${s?"rotate-anime":""}`})," ","Reload Stats"]})})]})})})}(function(n){var t={};function i(s){if(t[s])return t[s].exports;var l=t[s]={i:s,l:!1,exports:{}};return n[s].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=n,i.c=t,i.d=function(s,l,d){i.o(s,l)||Object.defineProperty(s,l,{enumerable:!0,get:d})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,l){if(1&l&&(s=i(s)),8&l||4&l&&typeof s=="object"&&s&&s.__esModule)return s;var d=Object.create(null);if(i.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:s}),2&l&&typeof s!="string")for(var u in s)i.d(d,u,(function(p){return s[p]}).bind(null,u));return d},i.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(l,"a",l),l},i.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},i.p="",i(i.s=32)})([function(n,t,i){n.exports=i(27)()},function(n,t,i){n.exports=i(25)},function(n,t,i){n.exports=i(21)},function(n,t,i){var s=i(20);n.exports=function(l){for(var d=1;d<arguments.length;d++)if(d%2){var u=arguments[d]!=null?arguments[d]:{},p=Object.keys(u);typeof Object.getOwnPropertySymbols=="function"&&(p=p.concat(Object.getOwnPropertySymbols(u).filter(function(g){return Object.getOwnPropertyDescriptor(u,g).enumerable}))),p.forEach(function(g){s(l,g,u[g])})}else Object.defineProperties(l,Object.getOwnPropertyDescriptors(arguments[d]));return l}},function(n,t){function i(s,l,d,u,p,g,_){try{var y=s[g](_),E=y.value}catch(b){return void d(b)}y.done?l(E):Promise.resolve(E).then(u,p)}n.exports=function(s){return function(){var l=this,d=arguments;return new Promise(function(u,p){var g=s.apply(l,d);function _(E){i(g,u,p,_,y,"next",E)}function y(E){i(g,u,p,_,y,"throw",E)}_(void 0)})}}},function(n,t){function i(s){return n.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(l){return l.__proto__||Object.getPrototypeOf(l)},i(s)}n.exports=i},function(n,t){n.exports=function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}},function(n,t){function i(s,l){for(var d=0;d<l.length;d++){var u=l[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(s,u.key,u)}}n.exports=function(s,l,d){return l&&i(s.prototype,l),d&&i(s,d),s}},function(n,t,i){var s=i(22),l=i(9);n.exports=function(d,u){return!u||s(u)!=="object"&&typeof u!="function"?l(d):u}},function(n,t){n.exports=function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}},function(n,t,i){var s=i(23);n.exports=function(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),d&&s(l,d)}},function(n,t,i){var s=i(29),l=i(30),d=i(31);n.exports=function(u,p){return s(u)||l(u,p)||d()}},function(n,t,i){var s=i(17),l=i(18),d=i(19);n.exports=function(u){return s(u)||l(u)||d()}},function(n,t,i){i(5);var s=i(24);function l(d,u,p){return typeof Reflect<"u"&&Reflect.get?n.exports=l=Reflect.get:n.exports=l=function(g,_,y){var E=s(g,_);if(E){var b=Object.getOwnPropertyDescriptor(E,_);return b.get?b.get.call(y):b.value}},l(d,u,p||d)}n.exports=l},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgOCAxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjMzMzMzMzIj48cGF0aCBkPSJNMSwxNCBDMC40LDE0IDAsMTMuNiAwLDEzIEwwLDEgQzAsMC40IDAuNCwwIDEsMCBDMS42LDAgMiwwLjQgMiwxIEwyLDEzIEMyLDEzLjYgMS42LDE0IDEsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48cGF0aCBkPSJNNywxNCBDNi40LDE0IDYsMTMuNiA2LDEzIEw2LDEgQzYsMC40IDYuNCwwIDcsMCBDNy42LDAgOCwwLjQgOCwxIEw4LDEzIEM4LDEzLjYgNy42LDE0IDcsMTQgWiIgaWQ9IlBhdGgiPjwvcGF0aD48L2c+PC9zdmc+Cg=="},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTQgMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUuMCwgMC4wKSIgZmlsbD0iIzMzMzMzMyI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNC4wLCAwLjApIj48cG9seWdvbiBwb2ludHM9IjcuNzE5IDQuOTY0IDEyLjY5MiAwLjAxNyAxNC4zODkgMS43MTUgOS40MTIgNi42NjYgMTQuMzU0IDExLjYzNCAxMi42NTcgMTMuMzMxIDYuMDE3IDYuNjU3IDcuNzE1IDQuOTYwIj48L3BvbHlnb24+PHBvbHlnb24gcG9pbnRzPSI3LjYxMiA0Ljk2NCA3LjYxNiA0Ljk2MCA5LjMxMyA2LjY1NyAyLjY3NCAxMy4zMzEgMC45NzcgMTEuNjM0IDUuOTE5IDYuNjY2IDAuOTQyIDEuNzE1IDIuNjM5IDAuMDE3Ij48L3BvbHlnb24+PC9nPjwvZz48L3N2Zz4K"},function(n,t){n.exports="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTEgMTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHBhdGggZD0iTTAuNSwxNC45IEMwLjIsMTQuNyAwLDE0LjQgMCwxNCBMMCwyIEMwLDEuNiAwLjIsMS4zIDAuNSwxLjEgQzAuOCwwLjkgMS4yLDAuOSAxLjUsMS4xIEwxMC41LDcuMSBDMTAuOCw3LjMgMTAuOSw3LjYgMTAuOSw3LjkgQzEwLjksOC4yIDEwLjcsOC41IDEwLjUsOC43IEwxLjUsMTQuNyBDMS40LDE0LjkgMC44LDE1LjEgMC41LDE0LjkgWiBNMiwzLjkgTDIsMTIuMiBMOC4yLDguMSBMMiwzLjkgWiI+PC9wYXRoPjwvZz48L3N2Zz4K"},function(n,t){n.exports=function(i){if(Array.isArray(i)){for(var s=0,l=new Array(i.length);s<i.length;s++)l[s]=i[s];return l}}},function(n,t){n.exports=function(i){if(Symbol.iterator in Object(i)||Object.prototype.toString.call(i)==="[object Arguments]")return Array.from(i)}},function(n,t){n.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(n,t){n.exports=function(i,s,l){return s in i?Object.defineProperty(i,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[s]=l,i}},function(n,t,i){var s=function(l){var d,u=Object.prototype,p=u.hasOwnProperty,g=typeof Symbol=="function"?Symbol:{},_=g.iterator||"@@iterator",y=g.asyncIterator||"@@asyncIterator",E=g.toStringTag||"@@toStringTag";function b(fe,me,Ne,Fe){var je=me&&me.prototype instanceof M?me:M,Ve=Object.create(je.prototype),Re=new _e(Fe||[]);return Ve._invoke=function(Be,Xe,we){var Ge=N;return function(rt,pt){if(Ge===D)throw new Error("Generator is already running");if(Ge===P){if(rt==="throw")throw pt;return Ce()}for(we.method=rt,we.arg=pt;;){var Ze=we.delegate;if(Ze){var Je=de(Ze,we);if(Je){if(Je===j)continue;return Je}}if(we.method==="next")we.sent=we._sent=we.arg;else if(we.method==="throw"){if(Ge===N)throw Ge=P,we.arg;we.dispatchException(we.arg)}else we.method==="return"&&we.abrupt("return",we.arg);Ge=D;var _t=A(Be,Xe,we);if(_t.type==="normal"){if(Ge=we.done?P:O,_t.arg===j)continue;return{value:_t.arg,done:we.done}}_t.type==="throw"&&(Ge=P,we.method="throw",we.arg=_t.arg)}}}(fe,Ne,Re),Ve}function A(fe,me,Ne){try{return{type:"normal",arg:fe.call(me,Ne)}}catch(Fe){return{type:"throw",arg:Fe}}}l.wrap=b;var N="suspendedStart",O="suspendedYield",D="executing",P="completed",j={};function M(){}function V(){}function H(){}var $={};$[_]=function(){return this};var Q=Object.getPrototypeOf,Y=Q&&Q(Q(he([])));Y&&Y!==u&&p.call(Y,_)&&($=Y);var le=H.prototype=M.prototype=Object.create($);function ae(fe){["next","throw","return"].forEach(function(me){fe[me]=function(Ne){return this._invoke(me,Ne)}})}function te(fe){var me;this._invoke=function(Ne,Fe){function je(){return new Promise(function(Ve,Re){(function Be(Xe,we,Ge,rt){var pt=A(fe[Xe],fe,we);if(pt.type!=="throw"){var Ze=pt.arg,Je=Ze.value;return Je&&typeof Je=="object"&&p.call(Je,"__await")?Promise.resolve(Je.__await).then(function(_t){Be("next",_t,Ge,rt)},function(_t){Be("throw",_t,Ge,rt)}):Promise.resolve(Je).then(function(_t){Ze.value=_t,Ge(Ze)},function(_t){return Be("throw",_t,Ge,rt)})}rt(pt.arg)})(Ne,Fe,Ve,Re)})}return me=me?me.then(je,je):je()}}function de(fe,me){var Ne=fe.iterator[me.method];if(Ne===d){if(me.delegate=null,me.method==="throw"){if(fe.iterator.return&&(me.method="return",me.arg=d,de(fe,me),me.method==="throw"))return j;me.method="throw",me.arg=new TypeError("The iterator does not provide a 'throw' method")}return j}var Fe=A(Ne,fe.iterator,me.arg);if(Fe.type==="throw")return me.method="throw",me.arg=Fe.arg,me.delegate=null,j;var je=Fe.arg;return je?je.done?(me[fe.resultName]=je.value,me.next=fe.nextLoc,me.method!=="return"&&(me.method="next",me.arg=d),me.delegate=null,j):je:(me.method="throw",me.arg=new TypeError("iterator result is not an object"),me.delegate=null,j)}function G(fe){var me={tryLoc:fe[0]};1 in fe&&(me.catchLoc=fe[1]),2 in fe&&(me.finallyLoc=fe[2],me.afterLoc=fe[3]),this.tryEntries.push(me)}function ie(fe){var me=fe.completion||{};me.type="normal",delete me.arg,fe.completion=me}function _e(fe){this.tryEntries=[{tryLoc:"root"}],fe.forEach(G,this),this.reset(!0)}function he(fe){if(fe){var me=fe[_];if(me)return me.call(fe);if(typeof fe.next=="function")return fe;if(!isNaN(fe.length)){var Ne=-1,Fe=function je(){for(;++Ne<fe.length;)if(p.call(fe,Ne))return je.value=fe[Ne],je.done=!1,je;return je.value=d,je.done=!0,je};return Fe.next=Fe}}return{next:Ce}}function Ce(){return{value:d,done:!0}}return V.prototype=le.constructor=H,H.constructor=V,H[E]=V.displayName="GeneratorFunction",l.isGeneratorFunction=function(fe){var me=typeof fe=="function"&&fe.constructor;return!!me&&(me===V||(me.displayName||me.name)==="GeneratorFunction")},l.mark=function(fe){return Object.setPrototypeOf?Object.setPrototypeOf(fe,H):(fe.__proto__=H,E in fe||(fe[E]="GeneratorFunction")),fe.prototype=Object.create(le),fe},l.awrap=function(fe){return{__await:fe}},ae(te.prototype),te.prototype[y]=function(){return this},l.AsyncIterator=te,l.async=function(fe,me,Ne,Fe){var je=new te(b(fe,me,Ne,Fe));return l.isGeneratorFunction(me)?je:je.next().then(function(Ve){return Ve.done?Ve.value:je.next()})},ae(le),le[E]="Generator",le[_]=function(){return this},le.toString=function(){return"[object Generator]"},l.keys=function(fe){var me=[];for(var Ne in fe)me.push(Ne);return me.reverse(),function Fe(){for(;me.length;){var je=me.pop();if(je in fe)return Fe.value=je,Fe.done=!1,Fe}return Fe.done=!0,Fe}},l.values=he,_e.prototype={constructor:_e,reset:function(fe){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(ie),!fe)for(var me in this)me.charAt(0)==="t"&&p.call(this,me)&&!isNaN(+me.slice(1))&&(this[me]=d)},stop:function(){this.done=!0;var fe=this.tryEntries[0].completion;if(fe.type==="throw")throw fe.arg;return this.rval},dispatchException:function(fe){if(this.done)throw fe;var me=this;function Ne(Xe,we){return Ve.type="throw",Ve.arg=fe,me.next=Xe,we&&(me.method="next",me.arg=d),!!we}for(var Fe=this.tryEntries.length-1;0<=Fe;--Fe){var je=this.tryEntries[Fe],Ve=je.completion;if(je.tryLoc==="root")return Ne("end");if(je.tryLoc<=this.prev){var Re=p.call(je,"catchLoc"),Be=p.call(je,"finallyLoc");if(Re&&Be){if(this.prev<je.catchLoc)return Ne(je.catchLoc,!0);if(this.prev<je.finallyLoc)return Ne(je.finallyLoc)}else if(Re){if(this.prev<je.catchLoc)return Ne(je.catchLoc,!0)}else{if(!Be)throw new Error("try statement without catch or finally");if(this.prev<je.finallyLoc)return Ne(je.finallyLoc)}}}},abrupt:function(fe,me){for(var Ne=this.tryEntries.length-1;0<=Ne;--Ne){var Fe=this.tryEntries[Ne];if(Fe.tryLoc<=this.prev&&p.call(Fe,"finallyLoc")&&this.prev<Fe.finallyLoc){var je=Fe;break}}je&&(fe==="break"||fe==="continue")&&je.tryLoc<=me&&me<=je.finallyLoc&&(je=null);var Ve=je?je.completion:{};return Ve.type=fe,Ve.arg=me,je?(this.method="next",this.next=je.finallyLoc,j):this.complete(Ve)},complete:function(fe,me){if(fe.type==="throw")throw fe.arg;return fe.type==="break"||fe.type==="continue"?this.next=fe.arg:fe.type==="return"?(this.rval=this.arg=fe.arg,this.method="return",this.next="end"):fe.type==="normal"&&me&&(this.next=me),j},finish:function(fe){for(var me=this.tryEntries.length-1;0<=me;--me){var Ne=this.tryEntries[me];if(Ne.finallyLoc===fe)return this.complete(Ne.completion,Ne.afterLoc),ie(Ne),j}},catch:function(fe){for(var me=this.tryEntries.length-1;0<=me;--me){var Ne=this.tryEntries[me];if(Ne.tryLoc===fe){var Fe=Ne.completion;if(Fe.type==="throw"){var je=Fe.arg;ie(Ne)}return je}}throw new Error("illegal catch attempt")},delegateYield:function(fe,me,Ne){return this.delegate={iterator:he(fe),resultName:me,nextLoc:Ne},this.method==="next"&&(this.arg=d),j}},l}(n.exports);try{regeneratorRuntime=s}catch{Function("r","regeneratorRuntime = r")(s)}},function(n,t){function i(l){return(i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d})(l)}function s(l){return typeof Symbol=="function"&&i(Symbol.iterator)==="symbol"?n.exports=s=function(d){return i(d)}:n.exports=s=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":i(d)},s(l)}n.exports=s},function(n,t){function i(s,l){return n.exports=i=Object.setPrototypeOf||function(d,u){return d.__proto__=u,d},i(s,l)}n.exports=i},function(n,t,i){var s=i(5);n.exports=function(l,d){for(;!Object.prototype.hasOwnProperty.call(l,d)&&(l=s(l))!==null;);return l}},function(n,t,i){/** @license React v16.8.6
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var s=i(26),l=typeof Symbol=="function"&&Symbol.for,d=l?Symbol.for("react.element"):60103,u=l?Symbol.for("react.portal"):60106,p=l?Symbol.for("react.fragment"):60107,g=l?Symbol.for("react.strict_mode"):60108,_=l?Symbol.for("react.profiler"):60114,y=l?Symbol.for("react.provider"):60109,E=l?Symbol.for("react.context"):60110,b=l?Symbol.for("react.concurrent_mode"):60111,A=l?Symbol.for("react.forward_ref"):60112,N=l?Symbol.for("react.suspense"):60113,O=l?Symbol.for("react.memo"):60115,D=l?Symbol.for("react.lazy"):60116,P=typeof Symbol=="function"&&Symbol.iterator;function j(we){for(var Ge=arguments.length-1,rt="https://reactjs.org/docs/error-decoder.html?invariant="+we,pt=0;pt<Ge;pt++)rt+="&args[]="+encodeURIComponent(arguments[pt+1]);(function(Ze,Je,_t,Xt,Ht,gn,It,xt){if(!Ze){if((Ze=void 0)===Je)Ze=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var mt=[_t,Xt,Ht,gn,It,xt],dt=0;(Ze=Error(Je.replace(/%s/g,function(){return mt[dt++]}))).name="Invariant Violation"}throw Ze.framesToPop=1,Ze}})(!1,"Minified React error #"+we+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",rt)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V={};function H(we,Ge,rt){this.props=we,this.context=Ge,this.refs=V,this.updater=rt||M}function $(){}function Q(we,Ge,rt){this.props=we,this.context=Ge,this.refs=V,this.updater=rt||M}H.prototype.isReactComponent={},H.prototype.setState=function(we,Ge){typeof we!="object"&&typeof we!="function"&&we!=null&&j("85"),this.updater.enqueueSetState(this,we,Ge,"setState")},H.prototype.forceUpdate=function(we){this.updater.enqueueForceUpdate(this,we,"forceUpdate")},$.prototype=H.prototype;var Y=Q.prototype=new $;Y.constructor=Q,s(Y,H.prototype),Y.isPureReactComponent=!0;var le={current:null},ae={current:null},te=Object.prototype.hasOwnProperty,de={key:!0,ref:!0,__self:!0,__source:!0};function G(we,Ge,rt){var pt=void 0,Ze={},Je=null,_t=null;if(Ge!=null)for(pt in Ge.ref!==void 0&&(_t=Ge.ref),Ge.key!==void 0&&(Je=""+Ge.key),Ge)te.call(Ge,pt)&&!de.hasOwnProperty(pt)&&(Ze[pt]=Ge[pt]);var Xt=arguments.length-2;if(Xt===1)Ze.children=rt;else if(1<Xt){for(var Ht=Array(Xt),gn=0;gn<Xt;gn++)Ht[gn]=arguments[gn+2];Ze.children=Ht}if(we&&we.defaultProps)for(pt in Xt=we.defaultProps)Ze[pt]===void 0&&(Ze[pt]=Xt[pt]);return{$$typeof:d,type:we,key:Je,ref:_t,props:Ze,_owner:ae.current}}function ie(we){return typeof we=="object"&&we!==null&&we.$$typeof===d}var _e=/\/+/g,he=[];function Ce(we,Ge,rt,pt){if(he.length){var Ze=he.pop();return Ze.result=we,Ze.keyPrefix=Ge,Ze.func=rt,Ze.context=pt,Ze.count=0,Ze}return{result:we,keyPrefix:Ge,func:rt,context:pt,count:0}}function fe(we){we.result=null,we.keyPrefix=null,we.func=null,we.context=null,we.count=0,he.length<10&&he.push(we)}function me(we,Ge,rt){return we==null?0:function pt(Ze,Je,_t,Xt){var Ht=typeof Ze;Ht!=="undefined"&&Ht!=="boolean"||(Ze=null);var gn=!1;if(Ze===null)gn=!0;else switch(Ht){case"string":case"number":gn=!0;break;case"object":switch(Ze.$$typeof){case d:case u:gn=!0}}if(gn)return _t(Xt,Ze,Je===""?"."+Ne(Ze,0):Je),1;if(gn=0,Je=Je===""?".":Je+":",Array.isArray(Ze))for(var It=0;It<Ze.length;It++){var xt=Je+Ne(Ht=Ze[It],It);gn+=pt(Ht,xt,_t,Xt)}else if(typeof(xt=Ze===null||typeof Ze!="object"?null:typeof(xt=P&&Ze[P]||Ze["@@iterator"])=="function"?xt:null)=="function")for(Ze=xt.call(Ze),It=0;!(Ht=Ze.next()).done;)gn+=pt(Ht=Ht.value,xt=Je+Ne(Ht,It++),_t,Xt);else Ht==="object"&&j("31",(_t=""+Ze)=="[object Object]"?"object with keys {"+Object.keys(Ze).join(", ")+"}":_t,"");return gn}(we,"",Ge,rt)}function Ne(we,Ge){return typeof we=="object"&&we!==null&&we.key!=null?function(rt){var pt={"=":"=0",":":"=2"};return"$"+(""+rt).replace(/[=:]/g,function(Ze){return pt[Ze]})}(we.key):Ge.toString(36)}function Fe(we,Ge){we.func.call(we.context,Ge,we.count++)}function je(we,Ge,rt){var pt=we.result,Ze=we.keyPrefix;we=we.func.call(we.context,Ge,we.count++),Array.isArray(we)?Ve(we,pt,rt,function(Je){return Je}):we!=null&&(ie(we)&&(we=function(Je,_t){return{$$typeof:d,type:Je.type,key:_t,ref:Je.ref,props:Je.props,_owner:Je._owner}}(we,Ze+(!we.key||Ge&&Ge.key===we.key?"":(""+we.key).replace(_e,"$&/")+"/")+rt)),pt.push(we))}function Ve(we,Ge,rt,pt,Ze){var Je="";rt!=null&&(Je=(""+rt).replace(_e,"$&/")+"/"),me(we,je,Ge=Ce(Ge,Je,pt,Ze)),fe(Ge)}function Re(){var we=le.current;return we===null&&j("321"),we}var Be={Children:{map:function(we,Ge,rt){if(we==null)return we;var pt=[];return Ve(we,pt,null,Ge,rt),pt},forEach:function(we,Ge,rt){if(we==null)return we;me(we,Fe,Ge=Ce(null,null,Ge,rt)),fe(Ge)},count:function(we){return me(we,function(){return null},null)},toArray:function(we){var Ge=[];return Ve(we,Ge,null,function(rt){return rt}),Ge},only:function(we){return ie(we)||j("143"),we}},createRef:function(){return{current:null}},Component:H,PureComponent:Q,createContext:function(we,Ge){return Ge===void 0&&(Ge=null),(we={$$typeof:E,_calculateChangedBits:Ge,_currentValue:we,_currentValue2:we,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:y,_context:we},we.Consumer=we},forwardRef:function(we){return{$$typeof:A,render:we}},lazy:function(we){return{$$typeof:D,_ctor:we,_status:-1,_result:null}},memo:function(we,Ge){return{$$typeof:O,type:we,compare:Ge===void 0?null:Ge}},useCallback:function(we,Ge){return Re().useCallback(we,Ge)},useContext:function(we,Ge){return Re().useContext(we,Ge)},useEffect:function(we,Ge){return Re().useEffect(we,Ge)},useImperativeHandle:function(we,Ge,rt){return Re().useImperativeHandle(we,Ge,rt)},useDebugValue:function(){},useLayoutEffect:function(we,Ge){return Re().useLayoutEffect(we,Ge)},useMemo:function(we,Ge){return Re().useMemo(we,Ge)},useReducer:function(we,Ge,rt){return Re().useReducer(we,Ge,rt)},useRef:function(we){return Re().useRef(we)},useState:function(we){return Re().useState(we)},Fragment:p,StrictMode:g,Suspense:N,createElement:G,cloneElement:function(we,Ge,rt){we==null&&j("267",we);var pt=void 0,Ze=s({},we.props),Je=we.key,_t=we.ref,Xt=we._owner;if(Ge!=null){Ge.ref!==void 0&&(_t=Ge.ref,Xt=ae.current),Ge.key!==void 0&&(Je=""+Ge.key);var Ht=void 0;for(pt in we.type&&we.type.defaultProps&&(Ht=we.type.defaultProps),Ge)te.call(Ge,pt)&&!de.hasOwnProperty(pt)&&(Ze[pt]=Ge[pt]===void 0&&Ht!==void 0?Ht[pt]:Ge[pt])}if((pt=arguments.length-2)===1)Ze.children=rt;else if(1<pt){Ht=Array(pt);for(var gn=0;gn<pt;gn++)Ht[gn]=arguments[gn+2];Ze.children=Ht}return{$$typeof:d,type:we.type,key:Je,ref:_t,props:Ze,_owner:Xt}},createFactory:function(we){var Ge=G.bind(null,we);return Ge.type=we,Ge},isValidElement:ie,version:"16.8.6",unstable_ConcurrentMode:b,unstable_Profiler:_,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:le,ReactCurrentOwner:ae,assign:s}},Xe=Be;n.exports=Xe.default||Xe},function(n,t,i){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var s=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;n.exports=function(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var p={},g=0;g<10;g++)p["_"+String.fromCharCode(g)]=g;if(Object.getOwnPropertyNames(p).map(function(y){return p[y]}).join("")!=="0123456789")return!1;var _={};return"abcdefghijklmnopqrst".split("").forEach(function(y){_[y]=y}),Object.keys(Object.assign({},_)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}()?Object.assign:function(u,p){for(var g,_,y=function(N){if(N==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(N)}(u),E=1;E<arguments.length;E++){for(var b in g=Object(arguments[E]))l.call(g,b)&&(y[b]=g[b]);if(s){_=s(g);for(var A=0;A<_.length;A++)d.call(g,_[A])&&(y[_[A]]=g[_[A]])}}return y}},function(n,t,i){var s=i(28);function l(){}function d(){}d.resetWarningCache=l,n.exports=function(){function u(_,y,E,b,A,N){if(N!==s){var O=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw O.name="Invariant Violation",O}}function p(){return u}var g={array:u.isRequired=u,bool:u,func:u,number:u,object:u,string:u,symbol:u,any:u,arrayOf:p,element:u,elementType:u,instanceOf:p,node:u,objectOf:p,oneOf:p,oneOfType:p,shape:p,exact:p,checkPropTypes:d,resetWarningCache:l};return g.PropTypes=g}},function(n,t,i){n.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(n,t){n.exports=function(i){if(Array.isArray(i))return i}},function(n,t){n.exports=function(i,s){var l=[],d=!0,u=!1,p=void 0;try{for(var g,_=i[Symbol.iterator]();!(d=(g=_.next()).done)&&(l.push(g.value),!s||l.length!==s);d=!0);}catch(y){u=!0,p=y}finally{try{d||_.return==null||_.return()}finally{if(u)throw p}}return l}},function(n,t){n.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(n,t,i){i.r(t);function s(It){var xt=It.input,mt=It.previews,dt=It.submitButton,it=It.dropzoneProps,Me=It.files,We=It.extra.maxFiles;return te.a.createElement("div",Object.assign({},it),mt,Me.length<We&&xt,0<Me.length&&dt)}var l=i(12),d=i.n(l),u=i(3),p=i.n(u),g=i(2),_=i.n(g),y=i(4),E=i.n(y),b=i(6),A=i.n(b),N=i(7),O=i.n(N),D=i(8),P=i.n(D),j=i(9),M=i.n(j),V=i(10),H=i.n(V),$=i(5),Q=i.n($),Y=i(13),le=i.n(Y),ae=i(1),te=i.n(ae),de=i(0),G=i.n(de);s.propTypes={input:G.a.node,previews:G.a.arrayOf(G.a.node),submitButton:G.a.node,dropzoneProps:G.a.shape({ref:G.a.any.isRequired,className:G.a.string.isRequired,style:G.a.object,onDragEnter:G.a.func.isRequired,onDragOver:G.a.func.isRequired,onDragLeave:G.a.func.isRequired,onDrop:G.a.func.isRequired}).isRequired,files:G.a.arrayOf(G.a.any).isRequired,extra:G.a.shape({active:G.a.bool.isRequired,reject:G.a.bool.isRequired,dragged:G.a.arrayOf(G.a.any).isRequired,accept:G.a.string.isRequired,multiple:G.a.bool.isRequired,minSizeBytes:G.a.number.isRequired,maxSizeBytes:G.a.number.isRequired,maxFiles:G.a.number.isRequired,onFiles:G.a.func.isRequired,onCancelFile:G.a.func.isRequired,onRemoveFile:G.a.func.isRequired,onRestartFile:G.a.func.isRequired}).isRequired};function ie(It){var xt,mt=It.className,dt=It.labelClassName,it=It.labelWithFilesClassName,Me=It.style,We=It.labelStyle,bt=It.labelWithFilesStyle,St=It.getFilesFromEvent,Lt=It.accept,tn=It.multiple,un=It.disabled,an=It.content,ye=It.withFilesContent,J=It.onFiles,ne=It.files;return te.a.createElement("label",{className:0<ne.length?it:dt,style:0<ne.length?bt:We},0<ne.length?ye:an,te.a.createElement("input",{className:mt,style:Me,type:"file",accept:Lt,multiple:tn,disabled:un,onChange:(xt=E()(_.a.mark(function Se(Ue){var tt,Te;return _.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return tt=Ue.target,Pe.next=3,St(Ue);case 3:Te=Pe.sent,J(Te),tt.value=null;case 6:case"end":return Pe.stop()}},Se)})),function(Se){return xt.apply(this,arguments)})}))}var _e=s;ie.propTypes={className:G.a.string,labelClassName:G.a.string,labelWithFilesClassName:G.a.string,style:G.a.object,labelStyle:G.a.object,labelWithFilesStyle:G.a.object,getFilesFromEvent:G.a.func.isRequired,accept:G.a.string.isRequired,multiple:G.a.bool.isRequired,disabled:G.a.bool.isRequired,content:G.a.node,withFilesContent:G.a.node,onFiles:G.a.func.isRequired,files:G.a.arrayOf(G.a.any).isRequired,extra:G.a.shape({active:G.a.bool.isRequired,reject:G.a.bool.isRequired,dragged:G.a.arrayOf(G.a.any).isRequired,accept:G.a.string.isRequired,multiple:G.a.bool.isRequired,minSizeBytes:G.a.number.isRequired,maxSizeBytes:G.a.number.isRequired,maxFiles:G.a.number.isRequired}).isRequired};function he(It){for(var xt=0,mt=It;1024<=mt;)mt/=1024,xt+=1;return"".concat(mt.toFixed(10<=mt||xt<1?0:1)).concat(["bytes","kB","MB","GB","TB","PB","EB","ZB","YB"][xt])}function Ce(It){var xt=new Date(0);xt.setSeconds(It);var mt=xt.toISOString().slice(11,19);return It<3600?mt.slice(3):mt}function fe(It,xt){if(!xt||xt==="*")return!0;var mt=It.type||"",dt=mt.replace(/\/.*$/,"");return xt.split(",").map(function(it){return it.trim()}).some(function(it){return it.charAt(0)==="."?It.name===void 0||It.name.toLowerCase().endsWith(it.toLowerCase()):it.endsWith("/*")?dt===it.replace(/\/.*$/,""):mt===it})}function me(It){for(var xt=arguments.length,mt=new Array(1<xt?xt-1:0),dt=1;dt<xt;dt++)mt[dt-1]=arguments[dt];return typeof It=="function"?It.apply(void 0,mt):It}function Ne(It){var xt=null;if("dataTransfer"in It){var mt=It.dataTransfer;"files"in mt&&mt.files.length?xt=mt.files:mt.items&&mt.items.length&&(xt=mt.items)}else It.target&&It.target.files&&(xt=It.target.files);return Array.prototype.slice.call(xt)}var Fe=ie,je=i(11),Ve=i.n(je),Re={dropzone:"dzu-dropzone",dropzoneActive:"dzu-dropzoneActive",dropzoneReject:"dzu-dropzoneActive",dropzoneDisabled:"dzu-dropzoneDisabled",input:"dzu-input",inputLabel:"dzu-inputLabel",inputLabelWithFiles:"dzu-inputLabelWithFiles",preview:"dzu-previewContainer",previewImage:"dzu-previewImage",submitButtonContainer:"dzu-submitButtonContainer",submitButton:"dzu-submitButton"},Be=i(14),Xe=i.n(Be),we=i(15),Ge=i.n(we),rt=i(16),pt=i.n(rt),Ze={cancel:{backgroundImage:"url(".concat(Xe.a,")")},remove:{backgroundImage:"url(".concat(Ge.a,")")},restart:{backgroundImage:"url(".concat(pt.a,")")}},Je=function(It){function xt(){return A()(this,xt),P()(this,Q()(xt).apply(this,arguments))}return H()(xt,It),O()(xt,[{key:"render",value:function(){var mt=this.props,dt=mt.className,it=mt.imageClassName,Me=mt.style,We=mt.imageStyle,bt=mt.fileWithMeta,St=bt.cancel,Lt=bt.remove,tn=bt.restart,un=mt.meta,an=un.name,ye=an===void 0?"":an,J=un.percent,ne=J===void 0?0:J,Se=un.size,Ue=Se===void 0?0:Se,tt=un.previewUrl,Te=un.status,Pe=un.duration,Qe=un.validationError,nt=mt.isUpload,$e=mt.canCancel,st=mt.canRemove,_n=mt.canRestart,Dt=mt.extra.minSizeBytes,nn="".concat(ye||"?",", ").concat(he(Ue));return Pe&&(nn="".concat(nn,", ").concat(Ce(Pe))),Te==="error_file_size"||Te==="error_validation"?te.a.createElement("div",{className:dt,style:Me},te.a.createElement("span",{className:"dzu-previewFileNameError"},nn),Te==="error_file_size"&&te.a.createElement("span",null,Ue<Dt?"File too small":"File too big"),Te==="error_validation"&&te.a.createElement("span",null,String(Qe)),st&&te.a.createElement("span",{className:"dzu-previewButton",style:Ze.remove,onClick:Lt})):(Te!=="error_upload_params"&&Te!=="exception_upload"&&Te!=="error_upload"||(nn="".concat(nn," (upload failed)")),Te==="aborted"&&(nn="".concat(nn," (cancelled)")),te.a.createElement("div",{className:dt,style:Me},tt&&te.a.createElement("img",{className:it,style:We,src:tt,alt:nn,title:nn}),!tt&&te.a.createElement("span",{className:"dzu-previewFileName"},nn),te.a.createElement("div",{className:"dzu-previewStatusContainer"},nt&&te.a.createElement("progress",{max:100,value:Te==="done"||Te==="headers_received"?100:ne}),Te==="uploading"&&$e&&te.a.createElement("span",{className:"dzu-previewButton",style:Ze.cancel,onClick:St}),Te!=="preparing"&&Te!=="getting_upload_params"&&Te!=="uploading"&&st&&te.a.createElement("span",{className:"dzu-previewButton",style:Ze.remove,onClick:Lt}),["error_upload_params","exception_upload","error_upload","aborted","ready"].includes(Te)&&_n&&te.a.createElement("span",{className:"dzu-previewButton",style:Ze.restart,onClick:tn}))))}}]),xt}(te.a.PureComponent);Je.propTypes={className:G.a.string,imageClassName:G.a.string,style:G.a.object,imageStyle:G.a.object,fileWithMeta:G.a.shape({file:G.a.any.isRequired,meta:G.a.object.isRequired,cancel:G.a.func.isRequired,restart:G.a.func.isRequired,remove:G.a.func.isRequired,xhr:G.a.any}).isRequired,meta:G.a.shape({status:G.a.oneOf(["preparing","error_file_size","error_validation","ready","getting_upload_params","error_upload_params","uploading","exception_upload","aborted","error_upload","headers_received","done"]).isRequired,type:G.a.string.isRequired,name:G.a.string,uploadedDate:G.a.string.isRequired,percent:G.a.number,size:G.a.number,lastModifiedDate:G.a.string,previewUrl:G.a.string,duration:G.a.number,width:G.a.number,height:G.a.number,videoWidth:G.a.number,videoHeight:G.a.number,validationError:G.a.any}).isRequired,isUpload:G.a.bool.isRequired,canCancel:G.a.bool.isRequired,canRemove:G.a.bool.isRequired,canRestart:G.a.bool.isRequired,files:G.a.arrayOf(G.a.any).isRequired,extra:G.a.shape({active:G.a.bool.isRequired,reject:G.a.bool.isRequired,dragged:G.a.arrayOf(G.a.any).isRequired,accept:G.a.string.isRequired,multiple:G.a.bool.isRequired,minSizeBytes:G.a.number.isRequired,maxSizeBytes:G.a.number.isRequired,maxFiles:G.a.number.isRequired}).isRequired};function _t(It){var xt=It.className,mt=It.buttonClassName,dt=It.style,it=It.buttonStyle,Me=It.disabled,We=It.content,bt=It.onSubmit,St=It.files,Lt=St.some(function(tn){return["preparing","getting_upload_params","uploading"].includes(tn.meta.status)})||!St.some(function(tn){return["headers_received","done"].includes(tn.meta.status)});return te.a.createElement("div",{className:xt,style:dt},te.a.createElement("button",{className:mt,style:it,onClick:function(){bt(St.filter(function(tn){return["headers_received","done"].includes(tn.meta.status)}))},disabled:Me||Lt},We))}var Xt=Je;_t.propTypes={className:G.a.string,buttonClassName:G.a.string,style:G.a.object,buttonStyle:G.a.object,disabled:G.a.bool.isRequired,content:G.a.node,onSubmit:G.a.func.isRequired,files:G.a.arrayOf(G.a.object).isRequired,extra:G.a.shape({active:G.a.bool.isRequired,reject:G.a.bool.isRequired,dragged:G.a.arrayOf(G.a.any).isRequired,accept:G.a.string.isRequired,multiple:G.a.bool.isRequired,minSizeBytes:G.a.number.isRequired,maxSizeBytes:G.a.number.isRequired,maxFiles:G.a.number.isRequired}).isRequired};var Ht=_t;i.d(t,"Layout",function(){return _e}),i.d(t,"Input",function(){return Fe}),i.d(t,"Preview",function(){return Xt}),i.d(t,"SubmitButton",function(){return Ht}),i.d(t,"formatBytes",function(){return he}),i.d(t,"formatDuration",function(){return Ce}),i.d(t,"accepts",function(){return fe}),i.d(t,"defaultClassNames",function(){return Re}),i.d(t,"getFilesFromEvent",function(){return Ne});var gn=function(It){function xt(mt){var dt;return A()(this,xt),(dt=P()(this,Q()(xt).call(this,mt))).forceUpdate=function(){dt.mounted&&le()(Q()(xt.prototype),"forceUpdate",M()(dt)).call(M()(dt))},dt.getFilesFromEvent=function(){return dt.props.getFilesFromEvent||Ne},dt.getDataTransferItemsFromEvent=function(){return dt.props.getDataTransferItemsFromEvent||Ne},dt.handleDragEnter=function(){var it=E()(_.a.mark(function Me(We){var bt;return _.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return We.preventDefault(),We.stopPropagation(),St.next=4,dt.getDataTransferItemsFromEvent()(We);case 4:bt=St.sent,dt.setState({active:!0,dragged:bt});case 6:case"end":return St.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDragOver=function(){var it=E()(_.a.mark(function Me(We){var bt;return _.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return We.preventDefault(),We.stopPropagation(),clearTimeout(dt.dragTimeoutId),St.next=5,dt.getDataTransferItemsFromEvent()(We);case 5:bt=St.sent,dt.setState({active:!0,dragged:bt});case 7:case"end":return St.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDragLeave=function(it){it.preventDefault(),it.stopPropagation(),dt.dragTimeoutId=window.setTimeout(function(){return dt.setState({active:!1,dragged:[]})},150)},dt.handleDrop=function(){var it=E()(_.a.mark(function Me(We){var bt;return _.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return We.preventDefault(),We.stopPropagation(),dt.setState({active:!1,dragged:[]}),St.next=5,dt.getFilesFromEvent()(We);case 5:bt=St.sent,dt.handleFiles(bt);case 7:case"end":return St.stop()}},Me)}));return function(Me){return it.apply(this,arguments)}}(),dt.handleDropDisabled=function(it){it.preventDefault(),it.stopPropagation(),dt.setState({active:!1,dragged:[]})},dt.handleChangeStatus=function(it){if(dt.props.onChangeStatus){var Me=(dt.props.onChangeStatus(it,it.meta.status,dt.files)||{}).meta,We=Me===void 0?{}:Me;We&&(delete We.status,it.meta=p()({},it.meta,{},We),dt.forceUpdate())}},dt.handleSubmit=function(it){dt.props.onSubmit&&dt.props.onSubmit(it,d()(dt.files))},dt.handleCancel=function(it){it.meta.status==="uploading"&&(it.meta.status="aborted",it.xhr&&it.xhr.abort(),dt.handleChangeStatus(it),dt.forceUpdate())},dt.handleRemove=function(it){var Me=dt.files.findIndex(function(We){return We===it});Me!==-1&&(URL.revokeObjectURL(it.meta.previewUrl||""),it.meta.status="removed",dt.handleChangeStatus(it),dt.files.splice(Me,1),dt.forceUpdate())},dt.handleRestart=function(it){dt.props.getUploadParams&&(it.meta.status==="ready"?it.meta.status="started":it.meta.status="restarted",dt.handleChangeStatus(it),it.meta.status="getting_upload_params",it.meta.percent=0,dt.handleChangeStatus(it),dt.forceUpdate(),dt.uploadFile(it))},dt.handleFiles=function(it){it.forEach(function(We,bt){return dt.handleFile(We,"".concat(new Date().getTime(),"-").concat(bt))});var Me=dt.dropzone.current;Me&&setTimeout(function(){return Me.scroll({top:Me.scrollHeight,behavior:"smooth"})},150)},dt.handleFile=function(){var it=E()(_.a.mark(function Me(We,bt){var St,Lt,tn,un,an,ye,J,ne,Se,Ue,tt,Te,Pe,Qe,nt,$e;return _.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(St=We.name,Lt=We.size,tn=We.type,un=We.lastModified,an=dt.props,ye=an.minSizeBytes,J=an.maxSizeBytes,ne=an.maxFiles,Se=an.accept,Ue=an.getUploadParams,tt=an.autoUpload,Te=an.validate,Pe=new Date().toISOString(),Qe=un&&new Date(un).toISOString(),nt={file:We,meta:{name:St,size:Lt,type:tn,lastModifiedDate:Qe,uploadedDate:Pe,percent:0,id:bt}},We.type==="application/x-moz-file"||fe(We,Se)){st.next=9;break}return nt.meta.status="rejected_file_type",dt.handleChangeStatus(nt),st.abrupt("return");case 9:if(dt.files.length>=ne)return nt.meta.status="rejected_max_files",dt.handleChangeStatus(nt),st.abrupt("return");st.next=13;break;case 13:if(nt.cancel=function(){return dt.handleCancel(nt)},nt.remove=function(){return dt.handleRemove(nt)},nt.restart=function(){return dt.handleRestart(nt)},nt.meta.status="preparing",dt.files.push(nt),dt.handleChangeStatus(nt),dt.forceUpdate(),Lt<ye||J<Lt)return nt.meta.status="error_file_size",dt.handleChangeStatus(nt),dt.forceUpdate(),st.abrupt("return");st.next=25;break;case 25:return st.next=27,dt.generatePreview(nt);case 27:if(!Te){st.next=35;break}if($e=Te(nt))return nt.meta.status="error_validation",nt.meta.validationError=$e,dt.handleChangeStatus(nt),dt.forceUpdate(),st.abrupt("return");st.next=35;break;case 35:Ue?tt?(dt.uploadFile(nt),nt.meta.status="getting_upload_params"):nt.meta.status="ready":nt.meta.status="done",dt.handleChangeStatus(nt),dt.forceUpdate();case 38:case"end":return st.stop()}},Me)}));return function(Me,We){return it.apply(this,arguments)}}(),dt.generatePreview=function(){var it=E()(_.a.mark(function Me(We){var bt,St,Lt,tn,un,an,ye,J,ne,Se;return _.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(bt=We.meta.type,St=We.file,Lt=bt.startsWith("image/"),tn=bt.startsWith("audio/"),un=bt.startsWith("video/"),Lt||tn||un){Ue.next=6;break}return Ue.abrupt("return");case 6:if(an=URL.createObjectURL(St),ye=function(tt){return Promise.race([new Promise(function(Te){tt instanceof HTMLImageElement?tt.onload=Te:tt.onloadedmetadata=Te}),new Promise(function(Te,Pe){setTimeout(Pe,1e3)})])},Ue.prev=8,Lt)return(J=new Image).src=an,We.meta.previewUrl=an,Ue.next=15,ye(J);Ue.next=17;break;case 15:We.meta.width=J.width,We.meta.height=J.height;case 17:if(tn)return(ne=new Audio).src=an,Ue.next=22,ye(ne);Ue.next=23;break;case 22:We.meta.duration=ne.duration;case 23:if(un)return(Se=document.createElement("video")).src=an,Ue.next=28,ye(Se);Ue.next=31;break;case 28:We.meta.duration=Se.duration,We.meta.videoWidth=Se.videoWidth,We.meta.videoHeight=Se.videoHeight;case 31:Lt||URL.revokeObjectURL(an),Ue.next=37;break;case 34:Ue.prev=34,Ue.t0=Ue.catch(8),URL.revokeObjectURL(an);case 37:dt.forceUpdate();case 38:case"end":return Ue.stop()}},Me,null,[[8,34]])}));return function(Me){return it.apply(this,arguments)}}(),dt.uploadFile=function(){var it=E()(_.a.mark(function Me(We){var bt,St,Lt,tn,un,an,ye,J,ne,Se,Ue,tt,Te,Pe,Qe,nt,$e,st,_n,Dt,nn;return _.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:if(bt=dt.props.getUploadParams){en.next=3;break}return en.abrupt("return");case 3:return St=null,en.prev=4,en.next=7,bt(We);case 7:St=en.sent,en.next=13;break;case 10:en.prev=10,en.t0=en.catch(4),console.error("Error Upload Params",en.t0.stack);case 13:if(St===null)return en.abrupt("return");en.next=15;break;case 15:if(tn=(Lt=St).url,un=Lt.method,an=un===void 0?"POST":un,ye=Lt.body,J=Lt.fields,ne=J===void 0?{}:J,Se=Lt.headers,Ue=Se===void 0?{}:Se,tt=Lt.meta,delete(Te=tt===void 0?{}:tt).status,tn){en.next=22;break}return We.meta.status="error_upload_params",dt.handleChangeStatus(We),dt.forceUpdate(),en.abrupt("return");case 22:for(Pe=new XMLHttpRequest,Qe=new FormData,Pe.open(an,tn,!0),nt=0,$e=Object.keys(ne);nt<$e.length;nt++)st=$e[nt],Qe.append(st,ne[st]);for(Pe.setRequestHeader("X-Requested-With","XMLHttpRequest"),_n=0,Dt=Object.keys(Ue);_n<Dt.length;_n++)nn=Dt[_n],Pe.setRequestHeader(nn,Ue[nn]);We.meta=p()({},We.meta,{},Te),Pe.upload.addEventListener("progress",function(qt){We.meta.percent=100*qt.loaded/qt.total||100,dt.forceUpdate()}),Pe.addEventListener("readystatechange",function(){Pe.readyState!==2&&Pe.readyState!==4||(Pe.status===0&&We.meta.status!=="aborted"&&(We.meta.status="exception_upload",dt.handleChangeStatus(We),dt.forceUpdate()),0<Pe.status&&Pe.status<400&&(We.meta.percent=100,Pe.readyState===2&&(We.meta.status="headers_received"),Pe.readyState===4&&(We.meta.status="done"),dt.handleChangeStatus(We),dt.forceUpdate()),400<=Pe.status&&We.meta.status!=="error_upload"&&(We.meta.status="error_upload",dt.handleChangeStatus(We),dt.forceUpdate()))}),Qe.append("file",We.file),dt.props.timeout&&(Pe.timeout=dt.props.timeout),Pe.send(ye||Qe),We.xhr=Pe,We.meta.status="uploading",dt.handleChangeStatus(We),dt.forceUpdate();case 38:case"end":return en.stop()}},Me,null,[[4,10]])}));return function(Me){return it.apply(this,arguments)}}(),dt.state={active:!1,dragged:[]},dt.files=[],dt.mounted=!0,dt.dropzone=te.a.createRef(),dt}return H()(xt,It),O()(xt,[{key:"componentDidMount",value:function(){this.props.initialFiles&&this.handleFiles(this.props.initialFiles)}},{key:"componentDidUpdate",value:function(mt){var dt=this.props.initialFiles;mt.initialFiles!==dt&&dt&&this.handleFiles(dt)}},{key:"componentWillUnmount",value:function(){var mt=!(this.mounted=!1),dt=!1,it=void 0;try{for(var Me,We=this.files[Symbol.iterator]();!(mt=(Me=We.next()).done);mt=!0){var bt=Me.value;this.handleCancel(bt)}}catch(St){dt=!0,it=St}finally{try{mt||We.return==null||We.return()}finally{if(dt)throw it}}}},{key:"render",value:function(){var mt=this.props,dt=mt.accept,it=mt.multiple,Me=mt.maxFiles,We=mt.minSizeBytes,bt=mt.maxSizeBytes,St=mt.onSubmit,Lt=mt.getUploadParams,tn=mt.disabled,un=mt.canCancel,an=mt.canRemove,ye=mt.canRestart,J=mt.inputContent,ne=mt.inputWithFilesContent,Se=mt.submitButtonDisabled,Ue=mt.submitButtonContent,tt=mt.classNames,Te=mt.styles,Pe=mt.addClassNames,Qe=mt.InputComponent,nt=mt.PreviewComponent,$e=mt.SubmitButtonComponent,st=mt.LayoutComponent,_n=this.state,Dt=_n.active,nn=_n.dragged,en=nn.some(function(qa){return qa.type!=="application/x-moz-file"&&!fe(qa,dt)}),qt={active:Dt,reject:en,dragged:nn,accept:dt,multiple:it,minSizeBytes:We,maxSizeBytes:bt,maxFiles:Me},Jt=d()(this.files),mn=me(tn,Jt,qt),Kn=function(qa,Hp,Kv){for(var Qi=p()({},Re),qv=p()({},Hp),oh=arguments.length,gf=new Array(3<oh?oh-3:0),Hg=3;Hg<oh;Hg++)gf[Hg-3]=arguments[Hg];for(var Gg=0,Yv=Object.entries(qa);Gg<Yv.length;Gg++){var Wg=Ve()(Yv[Gg],2),vf=Wg[0],yf=Wg[1];Qi[vf]=me.apply(void 0,[yf].concat(gf))}for(var ru=0,Gp=Object.entries(Kv);ru<Gp.length;ru++){var rd=Ve()(Gp[ru],2);vf=rd[0],yf=rd[1],Qi[vf]="".concat(Qi[vf]," ").concat(me.apply(void 0,[yf].concat(gf)))}for(var $g=0,Wp=Object.entries(Hp);$g<Wp.length;$g++){var aw=Ve()(Wp[$g],2);vf=aw[0],yf=aw[1],qv[vf]=me.apply(void 0,[yf].concat(gf))}return{classNames:Qi,styles:qv}}(tt,Te,Pe,Jt,qt),Nn=Kn.classNames,Tn=Nn.dropzone,Ui=Nn.dropzoneActive,xr=Nn.dropzoneReject,bi=Nn.dropzoneDisabled,Ia=Nn.input,Sl=Nn.inputLabel,mc=Nn.inputLabelWithFiles,nu=Nn.preview,To=Nn.previewImage,Fg=Nn.submitButtonContainer,Bg=Nn.submitButton,Ka=Kn.styles,ew=Ka.dropzone,$v=Ka.dropzoneActive,tw=Ka.dropzoneReject,mf=Ka.dropzoneDisabled,sx=Ka.input,ax=Ka.inputLabel,Ro=Ka.inputLabelWithFiles,ox=Ka.preview,Vg=Ka.previewImage,fs=Ka.submitButtonContainer,lx=Ka.submitButton,cx=Qe||Fe,nw=nt||Xt,iw=$e||Ht,zg=st||_e,rw=null;nt!==null&&(rw=Jt.map(function(qa){return te.a.createElement(nw,{className:nu,imageClassName:To,style:ox,imageStyle:Vg,key:qa.meta.id,fileWithMeta:qa,meta:p()({},qa.meta),isUpload:!!Lt,canCancel:me(un,Jt,qt),canRemove:me(an,Jt,qt),canRestart:me(ye,Jt,qt),files:Jt,extra:qt})}));var sw=Qe!==null?te.a.createElement(cx,{className:Ia,labelClassName:Sl,labelWithFilesClassName:mc,style:sx,labelStyle:ax,labelWithFilesStyle:Ro,getFilesFromEvent:this.getFilesFromEvent(),accept:dt,multiple:it,disabled:mn,content:me(J,Jt,qt),withFilesContent:me(ne,Jt,qt),onFiles:this.handleFiles,files:Jt,extra:qt}):null,dx=St&&$e!==null?te.a.createElement(iw,{className:Fg,buttonClassName:Bg,style:fs,buttonStyle:lx,disabled:me(Se,Jt,qt),content:me(Ue,Jt,qt),onSubmit:this.handleSubmit,files:Jt,extra:qt}):null,ah=Tn,iu=ew;return mn?(ah="".concat(ah," ").concat(bi),iu=p()({},iu||{},{},mf||{})):en?(ah="".concat(ah," ").concat(xr),iu=p()({},iu||{},{},tw||{})):Dt&&(ah="".concat(ah," ").concat(Ui),iu=p()({},iu||{},{},$v||{})),te.a.createElement(zg,{input:sw,previews:rw,submitButton:dx,dropzoneProps:{ref:this.dropzone,className:ah,style:iu,onDragEnter:this.handleDragEnter,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:mn?this.handleDropDisabled:this.handleDrop},files:Jt,extra:p()({},qt,{onFiles:this.handleFiles,onCancelFile:this.handleCancel,onRemoveFile:this.handleRemove,onRestartFile:this.handleRestart})})}}]),xt}(te.a.Component);gn.defaultProps={accept:"*",multiple:!0,minSizeBytes:0,maxSizeBytes:Number.MAX_SAFE_INTEGER,maxFiles:Number.MAX_SAFE_INTEGER,autoUpload:!0,disabled:!1,canCancel:!0,canRemove:!0,canRestart:!0,inputContent:"Drag Files or Click to Browse",inputWithFilesContent:"Add Files",submitButtonDisabled:!1,submitButtonContent:"Submit",classNames:{},styles:{},addClassNames:{}},gn.propTypes={onChangeStatus:G.a.func,getUploadParams:G.a.func,onSubmit:G.a.func,getFilesFromEvent:G.a.func,getDataTransferItemsFromEvent:G.a.func,accept:G.a.string,multiple:G.a.bool,minSizeBytes:G.a.number.isRequired,maxSizeBytes:G.a.number.isRequired,maxFiles:G.a.number.isRequired,validate:G.a.func,autoUpload:G.a.bool,timeout:G.a.number,initialFiles:G.a.arrayOf(G.a.any),disabled:G.a.oneOfType([G.a.bool,G.a.func]),canCancel:G.a.oneOfType([G.a.bool,G.a.func]),canRemove:G.a.oneOfType([G.a.bool,G.a.func]),canRestart:G.a.oneOfType([G.a.bool,G.a.func]),inputContent:G.a.oneOfType([G.a.node,G.a.func]),inputWithFilesContent:G.a.oneOfType([G.a.node,G.a.func]),submitButtonDisabled:G.a.oneOfType([G.a.bool,G.a.func]),submitButtonContent:G.a.oneOfType([G.a.node,G.a.func]),classNames:G.a.object.isRequired,styles:G.a.object.isRequired,addClassNames:G.a.object.isRequired,InputComponent:G.a.func,PreviewComponent:G.a.func,SubmitButtonComponent:G.a.func,LayoutComponent:G.a.func},t.default=gn}]);function Gqe(n){var g,_,y,E,b,A,N,O,D,P;const t=(g=n==null?void 0:n.item)!=null&&g.name?(_=n==null?void 0:n.item)==null?void 0:_.name:"Default title",i=n!=null&&n.bgImg?n==null?void 0:n.bgImg:"/img/default-bg.jpg";let s=n!=null&&n.className?n==null?void 0:n.className:"";const l=(E=(y=n.item)==null?void 0:y.completion)!=null&&E.count?(A=(b=n.item)==null?void 0:b.completion)==null?void 0:A.count:0,d=(O=(N=n.item)==null?void 0:N.completion)!=null&&O.total?(P=(D=n.item)==null?void 0:D.completion)==null?void 0:P.total:0,u=isNaN(Math.round(l/d*100))?0:Math.round(l/d*100);function p(j){n.handleMagazineCardClick(j.id)}return h.jsxs(et,{className:`border-0 card-theme dashboard-magazine-card overflow-hidden me-3 ${s}`,onClick:()=>p(n.item),children:[h.jsx(us,{src:i,alt:`${t} image`,wrapperClassName:"card-img"}),h.jsxs("div",{className:"card-img-overlay bg-primary-overlay p-2 p-sm-3 d-flex flex-column justify-content-end",children:[h.jsx("div",{className:"font-14 fw-sb text-truncate text-white mb-sm-2",children:t}),h.jsx("div",{className:"d-flex align-items-center",children:d!==0&&h.jsxs(h.Fragment,{children:[h.jsx(bQ,{now:u,className:"flex-grow-1"}),h.jsxs("div",{className:"d-flex font-12 ps-2 text-white",children:[h.jsx("span",{className:"fw-b",children:l}),"/",h.jsx("span",{children:d})]})]})})]})]})}function Wqe(n){const t=Ii(),i=async()=>{var _,y;try{const E=await hs.getDashboardMagazines();return E.data.status==="success"?(y=(_=E.data)==null?void 0:_.data)==null?void 0:y.items:null}catch{throw new Error("Error fetching dashboard magazines")}},{isFetching:s,isPending:l,isError:d,data:u,error:p}=Qd({queryKey:["dashboardMagazinesQuery"],queryFn:i});function g(_){console.log("Magazine ID = ",_),_&&t(`/magazines/${_}`,{state:{pageTitle:"Magazine Details"}})}return l?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((_,y)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},y))})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((_,y)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},y))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Magazines"}),h.jsx(Pt,{variant:"link",size:"sm",className:"btn-theme font-13 fw-sb pe-0",onClick:()=>t("/magazines"),children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u==null?void 0:u.map(_=>h.jsx(Gqe,{item:_,bgImg:_.image,title:_.name,className:"card-width-40 shadow-sm ",handleMagazineCardClick:g},_.id))})]})})})}function $qe(n){var p,g,_,y;let t=n!=null&&n.className?n==null?void 0:n.className:"";const i=n!=null&&n.title?n==null?void 0:n.title:"Default title",s=n!=null&&n.bgImg?n==null?void 0:n.bgImg:"/img/default-bg.jpg",l=(p=n==null?void 0:n.item)!=null&&p.button?(g=n==null?void 0:n.item)==null?void 0:g.button:null,d=(_=n==null?void 0:n.item)!=null&&_.expires_in?(y=n==null?void 0:n.item)==null?void 0:y.expires_in:"";function u(E){console.log("handleClick in Dashbaord Contest = ",E),n.handleContestCardClick(E.id)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme dashboard-contest-card overflow-hidden me-3 ${t}`,onClick:()=>u(n.item),children:[h.jsx(us,{src:s,alt:`${i} image`,wrapperClassName:"card-img"}),h.jsx("span",{className:"d-flex font-11 expiry-tag position-absolute top- end-0",children:d}),h.jsxs("div",{className:"card-img-overlay bg-gray-overlay p- p-0 d-flex flex-column justify-content-end",children:[h.jsx("div",{className:"font-13 fw-sb text-truncat line-clamp text-white mb-1 mb-sm-3 px-2 px-sm-3",children:i}),h.jsx("div",{className:"d-flex btn-wrap align-items-center justify-content-center",children:h.jsx(Pt,{type:"button",className:"btn btn-theme btn-sm btn-secondary px-1 text-nowrap w-100",children:l==null?void 0:l.title})})]})]})})}function Kqe(n){const t=Ii(),i=async()=>{var _,y;try{const E=await Wa.getAllDashboardContests();return E.data.status==="success"?(y=(_=E.data)==null?void 0:_.data)==null?void 0:y.items:null}catch{throw new Error("Error fetching dashboard contest")}},{isFetching:s,isPending:l,isError:d,data:u,error:p}=Qd({queryKey:["dashboardContestsQuery"],queryFn:i});function g(_){console.log("Contest ID = ",_),_&&t(`/contests/${_}`,{state:{pageTitle:"Detailing Contest Details"}})}return l?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((_,y)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},`DCPC-${y}`))})}):h.jsx(h.Fragment,{children:s&&(u==null?void 0:u.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((_,y)=>h.jsx(ci,{type:"dashboard-magazine",className:"card-theme overflow-hidden card-width-40 me-3"},`DCPC-${y}`))})})}):h.jsx(h.Fragment,{children:(u==null?void 0:u.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Detailing Contest"}),h.jsx(Pt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb pe-0",onClick:()=>t("/contests"),children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:u==null?void 0:u.map(_=>h.jsx(dn.Fragment,{children:h.jsx($qe,{item:_,bgImg:_.cover_image,title:_.title,className:"card-width-40 shadow-sm ",handleContestCardClick:g},_.id)},_.id))})]})})})}function qqe(n){function t(i){console.log("handleURLRedirection url = ",i),window.open(encodeURI(i),"_system","location=yes")}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,fullscreen:!1,backdrop:"static",keyboard:!1,className:"theme-modal app-version-check-update-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-2 border-0 d-flex justify-content-center align-items-center",children:h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(GO,{})})})}),h.jsx(vn.Body,{className:"no-scrollbar text-center d-flex flex-wrap justify-content-center align-items-center",children:n.loading?h.jsx(h.Fragment,{children:h.jsx(Ji,{animation:"border",variant:"dark"})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[h.jsx("div",{className:"w-100 d-block",children:h.jsx("p",{className:"font-15 mb-3",style:{lineHeight:1.6},children:"It appears you're using an older version of our app. To continue, kindly update to the latest version."})}),h.jsx("div",{className:"btn-wrap d-grid gap-3 pt-1",children:(n==null?void 0:n.platform)==="ios"?h.jsx(h.Fragment,{children:h.jsxs(Pt,{type:"button",className:"btn-theme btn-black btn-lg w-100 text-white text-decoration-none rounded-3",onClick:()=>{var i;return t((i=n.appUpdatedInfo)==null?void 0:i.store_link)},children:[h.jsx(h.Fragment,{children:h.jsx(Hje,{className:"font-32 me-2"})}),"Update Now"]})}):h.jsx(h.Fragment,{children:h.jsxs(Pt,{type:"button",className:"btn-theme btn-black btn-lg w-100 text-white text-decoration-none rounded-3",onClick:()=>{var i;return t((i=n.appUpdatedInfo)==null?void 0:i.store_link)},children:[h.jsx(h.Fragment,{children:h.jsx(Wje,{className:"font-30 me-2"})}),"Update Now"]})})})]})})})]})})}function Yqe({contest:n,className:t,handleCompetitionContestBtnClick:i}){const s=n!=null&&n.role?n==null?void 0:n.role:"",l=n!=null&&n.contest_name?n==null?void 0:n.contest_name:"";n!=null&&n.cover_image&&(n==null||n.cover_image);const d=n!=null&&n.points_unit?n==null?void 0:n.points_unit:"Points",u=n!=null&&n.points?n==null?void 0:n.points:0,p=n!=null&&n.team_points?n==null?void 0:n.team_points:0,g=n!=null&&n.team_rank?n==null?void 0:n.team_rank:0,_=n!=null&&n.team_rank_out_of?n==null?void 0:n.team_rank_out_of:0,y=n!=null&&n.rank_in_team?n==null?void 0:n.rank_in_team:0,E=n!=null&&n.rank_in_team_out_of?n==null?void 0:n.rank_in_team_out_of:0;n!=null&&n.team_dashboard&&(n==null||n.team_dashboard);const b=n!=null&&n.contest_dashboard?n==null?void 0:n.contest_dashboard:null,A=n!=null&&n.top3?n==null?void 0:n.top3:[];function N(O,D){console.log("----- Inside handleCardClick ----"),i(O,D)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:"border-0 shadow-sm card-theme overflow-hidden card-width-90 me-3",onClick:()=>{N(n,b)},children:[h.jsx(et.Header,{className:"font-13 border-bottom-0 p-2",children:l}),h.jsxs(et.Body,{className:"px-2 py-3",children:[s.toLowerCase()==="player"&&h.jsx(h.Fragment,{children:h.jsxs(fn,{className:"row-cols-3 g-0",children:[h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(Zt,{tag:"insights1",className:"font-24 text-theme-primary"})}),h.jsx("span",{className:"font-20 fw-sb",children:u}),h.jsx("span",{className:"font-13 fw-sb",children:`My ${d}`})]}),h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(Zt,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[y," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",E,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Rank In Team"})]}),h.jsxs(Gt,{className:"d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(Zt,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[g," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",_,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Team Rank"})]})]})}),s.toLowerCase()==="observer"&&h.jsx(h.Fragment,{children:(A==null?void 0:A.length)>0?h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-3 g-0",children:A==null?void 0:A.map((O,D)=>{const P=O!=null&&O.team_image?O==null?void 0:O.team_image:"/img/default-bg.jpg",j=O!=null&&O.team_name?O==null?void 0:O.team_name:"",M=O!=null&&O.rank?O==null?void 0:O.rank:"";return h.jsx(Gt,{className:"",children:h.jsxs(et,{className:`border-0 campaigns-counter-card bg-primary-lighter bg-transparent rounded-0 h-100 ${D+1!==(A==null?void 0:A.length)?"border-end":""}`,children:[h.jsx(et.Header,{className:"border-0 text-center pt-1 pb-0 px-1 bg-transparent",children:h.jsx("div",{className:"ms-2 font-13 fw-sb text-center lh-sm text-gray6",children:j})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center justify-content-center p-1 pt- position-relative",children:h.jsx("div",{className:"d-flex align-items-center mb-2",children:h.jsx("div",{className:"flex-shrink-0",style:{width:32},children:h.jsx(us,{src:P,alt:j,wrapperClassName:"img-fluid"})})})}),h.jsx(et.Footer,{className:"border-theme-top border-0 p-1 pt-0 bg-transparent text-center",children:h.jsx("div",{className:"btn btn-theme btn-icon btn-sm bg-primary-light-overlay rounded-circle fw-sb shadow-sm",children:M})})]})},O==null?void 0:O.team_name)})})}):h.jsx(h.Fragment,{})}),s.toLowerCase()==="non_player"&&h.jsx(h.Fragment,{children:h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsxs(Gt,{className:"border-end d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(Zt,{tag:"insights1",className:"font-24 text-theme-primary"})}),h.jsx("span",{className:"font-20 fw-sb",children:p}),h.jsx("span",{className:"font-13 fw-sb",children:`Team ${d}`})]}),h.jsxs(Gt,{className:"d-flex flex-column text-center text-gray7 py-2",children:[h.jsx("span",{className:"mb-2",children:h.jsx(Zt,{tag:"crown1",className:"font-24 text-theme-primary"})}),h.jsxs("div",{className:"font-20 fw-sb",children:[g," ",h.jsxs("span",{className:"font-12 text-gray8",children:["(",_,")"]})]}),h.jsx("span",{className:"font-13 fw-sb",children:"Team Rank"})]})]})})]})]})})}function Xqe(){const n=Ii(),t=async()=>{var g,_;try{const y=await Wa.getAllCompetitionContests();return y.data.status==="success"?(_=(g=y.data)==null?void 0:g.data)==null?void 0:_.items:null}catch{throw new Error("Error fetching dashboard competition contest")}},{isFetching:i,isPending:s,isError:l,data:d,error:u}=Qd({queryKey:["dashboardCompetitionContestsQuery"],queryFn:t});function p(g,_){g&&n("/competition-contests/competition-contest-details",{state:{item:g,url:_,pageTitle:g==null?void 0:g.contest_name}})}return s?h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((g,_)=>h.jsx(ci,{type:"dashboard-competition-contest",className:"card-theme overflow-hidden card-width-90 me-3"},_))})}):h.jsx(h.Fragment,{children:i&&(d==null?void 0:d.length)===0?h.jsx(h.Fragment,{children:h.jsx(Yn,{className:"pt-2 pb-2 py-sm-3",children:h.jsx("div",{className:"d-flex flex-nowrap justify-content-betwee overflow-auto py-3",children:[0,1].map((g,_)=>h.jsx(ci,{type:"dashboard-competition-contest",className:"card-theme overflow-hidden card-width-90 me-3"},_))})})}):h.jsx(h.Fragment,{children:(d==null?void 0:d.length)>0&&h.jsxs(Yn,{className:"pt-2 pb-2 py-sm-3",children:[h.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[h.jsx("h4",{className:"section-title mb-0",children:"Contests"}),h.jsx(Yu,{to:"/competition-contests",variant:"link",size:"sm",className:"btn-theme btn-link font-13 fw-sb",children:"View all"})]}),h.jsx("div",{className:"d-flex no-scrollbar flex-nowrap justify-content-betwee overflow-auto py-3 ",children:d==null?void 0:d.map(g=>h.jsx(Yqe,{contest:g,className:"",handleCompetitionContestBtnClick:p},g))})]})})})}function Qhe({loading:n,banners:t,itemClassName:i,className:s}){const l=i||"",d=Ii(),u={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,effect:"slide",autoplay:{delay:4e3,disableOnInteraction:!1},pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:30,grabCursor:!0};async function p(g){if(console.log("Banner clicked = ",g),(g==null?void 0:g.has_cta)!=="no"&&(g==null?void 0:g.has_cta)==="yes")if((g==null?void 0:g.action_type)==="web_view")console.log("Banner action Web view = ",g==null?void 0:g.url),await DR.open({url:g==null?void 0:g.url,toolbarColor:IE});else if((g==null?void 0:g.action_type)==="web_view_with_token"){console.log("Banner action internal = ",g==null?void 0:g.url);let _=`${g==null?void 0:g.url}&authorization=${Ai.getToken()}`;console.log("urlWithToken = ",_),await DR.open({url:_,toolbarColor:IE})}else(g==null?void 0:g.action_type)==="internal_action"&&(console.log("Banner action internal = ",g==null?void 0:g.url),d(g==null?void 0:g.url,{state:null}))}return h.jsx(h.Fragment,{children:n?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"banners"})}):h.jsx(h.Fragment,{children:(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:h.jsx(KQ,{...u,containerClass:"swiper-container theme-swiper dashboard-swiper mb-2 position-relative",children:t.map((g,_)=>h.jsx(et,{className:`card-slide border-0 overflow-hidden bg-transparent ${l}`,onClick:()=>{p(g)},children:h.jsx(et.Body,{className:"p-0",children:h.jsx(us,{src:g==null?void 0:g.media_url,alt:`Wall Banner ${_+1}`})})},g==null?void 0:g.id))})}):h.jsx(h.Fragment,{})})})}function Jqe({show:n,handleClose:t,className:i,banners:s}){const l=Ii(),d={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,effect:"slide",pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:30,grabCursor:!0};async function u(p){(p==null?void 0:p.has_cta)!=="no"&&(p==null?void 0:p.has_cta)==="yes"&&((p==null?void 0:p.action_type)==="web_view"?await DR.open({url:p==null?void 0:p.url,toolbarColor:IE}):(p==null?void 0:p.action_type)==="internal_action"&&l(p==null?void 0:p.url,{state:null}))}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal likes-list-modal",show:n,onHide:t,children:[h.jsx(Pt,{className:"btn-theme btn-icon shadow-sm btn-red rounded-2 position-absolute end-0",style:{zIndex:10},onClick:t,children:h.jsx(Zt,{tag:"delete7",className:"font-24"})}),h.jsx(vn.Body,{className:"no-scrollbar p-1",children:h.jsx(KQ,{...d,containerClass:"swiper-container theme-swiper dashboard-swiper popup-media-swiper mb-0 position-relative",children:s.map((p,g)=>h.jsx(et,{className:"card-slide border-0 overflow-hidden bg-transparent",onClick:()=>{u(p)},children:h.jsx(et.Body,{className:"p-0",children:h.jsx(us,{src:p==null?void 0:p.media_url,alt:`Popup Banner ${g+1}`})})},p==null?void 0:p.id))})})]})})}const Qqe="https://png.pngtree.com/background/20250212/original/pngtree-a-photo-of-rainbow-watercolor-background-with-smoky-texture-picture-image_15774631.jpg";function P_e({show:n,handleClose:t,data:i}){var g,_,y,E;const s=Ii();function l(b){var N,O;if(!(b!=null&&b.payload))return;let A=null;return((N=b==null?void 0:b.payload)==null?void 0:N.type)==="overlay_appreciation"?A={...b,title:b==null?void 0:b.title,description:b==null?void 0:b.description,icon:b==null?void 0:b.icon,time_ago:b==null?void 0:b.time_ago,url:"/appreciations",button_title:"View More"}:((O=b==null?void 0:b.payload)==null?void 0:O.type)==="overlay_badge"&&(A={...b,title:b==null?void 0:b.title,description:b==null?void 0:b.description,icon:b==null?void 0:b.icon,time_ago:b==null?void 0:b.time_ago,url:"/badges",button_title:"View More"}),A}const d=l(i);function u(){s(d==null?void 0:d.url)}const p=(g=i==null?void 0:i.payload)!=null&&g.bg_image?{backgroundImage:`url(${(_=i==null?void 0:i.payload)!=null&&_.bg_image?(y=i==null?void 0:i.payload)==null?void 0:y.bg_image:Qqe})`,backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center center"}:null;return h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal overlay-notification-modal",show:n,onHide:t,children:[h.jsx(Pt,{className:"btn-theme btn-icon shadow-sm btn-light btn-close-modal rounded-2 position-absolute end-0",style:{zIndex:10},onClick:t,children:h.jsx(Zt,{tag:"delete7",className:"font-24"})}),h.jsx(vn.Body,{className:`no-scrollbar d-flex align-items-center ${!((E=i==null?void 0:i.payload)!=null&&E.bg_image)&&"bg-pattern-default"}`,style:p,children:h.jsxs("div",{className:"d-flex flex-column",children:[h.jsx("div",{className:"d-flex justify-content-center overlay-symbol-container mx-auto",children:h.jsx("div",{className:"media-img-wrapper rounded-3 shadow-sm mb-1",children:h.jsx(us,{src:d==null?void 0:d.icon,alt:d==null?void 0:d.title,wrapperClassName:"img-fluid mx-auto"})})}),h.jsx("div",{className:"d-flex justify-content-center align-items-center py-2 font-16 fw-sb text-gray4",children:h.jsx("div",{className:"",children:d==null?void 0:d.time_ago})}),h.jsx("div",{className:"font-22 fw-sb pt-4 pb-2 d-flex justify-content-center text-center",children:d==null?void 0:d.title}),h.jsx("div",{className:"font-18 fw-sb text-gray4 pb-2 px-1 d-flex justify-content-center",children:h.jsx("div",{className:"mx-auto my-3 text-center",children:d==null?void 0:d.description})}),h.jsx("div",{className:"text-center pt-4 pb-2",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-lg btn-white fw-sb",style:{width:"80%"},onClick:u,children:d==null?void 0:d.button_title})})]})})]})}const J4={getAllNotifications:async n=>{const t=n?`&lastkey=${n}`:"";return await On.get(`ums/notification/list?paginate=yes${t}`)},getNotificationStats:async()=>await On.get("ums/notification/stats"),markReadNotification:async n=>{const{id:t}=n;return await On.get(`ums/notification/markread?id=${t}`)}},bC=hc("App",{web:()=>Xi(()=>import("./web-D0EvZq7o.js"),__vite__mapDeps([])).then(n=>new n.AppWeb)});function Zqe(){Ii();const{getNotificationStats:n}=k.useContext(QR);Xo();const[t,i]=k.useState([]),[s,l]=k.useState([]),[d,u]=k.useState([]),[p,g]=k.useState(null),[_,y]=k.useState(!0),[E,b]=k.useState(!0),[A,N]=k.useState(!1),[O,D]=k.useState(!1),[P,j]=k.useState([]),M=()=>{N(!1)},V=()=>{N(!0)},H=()=>{D(!1)},$=()=>{D(!0)};async function Q(G){const ie=await bC.getInfo();b(!0),Ai.appInfoFromServer(G).then(_e=>{var he,Ce;if(console.log("appInfoFromServer called == ",JSON.stringify(_e.data)),_e.data.status==="success"){const fe=(Ce=(he=_e.data)==null?void 0:he.data)==null?void 0:Ce.app_info;g(fe);const me=parseFloat(ie==null?void 0:ie.version).toFixed(2),Ne=parseFloat(fe.min_version).toFixed(2);b(!1),parseFloat(me)<parseFloat(Ne)&&V()}}).catch(_e=>{console.log("ERROR in appInfoFromServer ",JSON.stringify(_e)),b(!1),g(null)})}async function Y(){var _e,he,Ce,fe,me;const G=[];let ie=null;for(;;){const Ne=await J4.getAllNotifications(ie);if(((_e=Ne.data)==null?void 0:_e.status)!=="success")break;const Fe=((Ce=(he=Ne.data)==null?void 0:he.data)==null?void 0:Ce.notifications)??[];G.push(...Fe);const je=(me=(fe=Ne.data)==null?void 0:fe.data)==null?void 0:me.lastkey;if(!je)break;ie=je}return G}async function le(){try{const ie=(await Y()).filter(_e=>(_e==null?void 0:_e.notification_type)==="overlay"&&!(_e!=null&&_e.is_read));console.log("overlays - ",ie),j(ie)}catch(G){console.log("Error in loadUnreadOverlayNotifications = ",G),j([])}}const ae=()=>{j(G=>G.slice(1))};async function te(){hs.getDashboardWallBanners().then(G=>{var ie,_e;if(console.log("getDashboardWallBanners RES = ",G.data),G.data.status==="success"){let he=(_e=(ie=G.data)==null?void 0:ie.data)==null?void 0:_e.items,Ce=he.length>0?he.filter(Ne=>Ne.position==="default"):[],fe=he.length>0?he.filter(Ne=>Ne.position!=="default"&&Ne.position!=="popup"):[],me=he.length>0?he.filter(Ne=>Ne.position==="popup"):[];i(Ce),l(fe),u(me),y(!1)}}).catch(G=>{y(!1),i([]),l([]),u([]),console.log("Error in getDashboardWallBanners = ",G)})}k.useEffect(()=>{te(),n(),le(),Q({platform:Ai.getDevicePlatform(),package_name:Ai.getAppID()})},[]);const de=P[0]??null;return k.useEffect(()=>{de!=null&&de.id&&J4.markReadNotification({id:de.id}).then(G=>{var ie;((ie=G.data)==null?void 0:ie.status)==="success"&&n()}).catch(G=>console.log("Error marking overlay notification read = ",G))},[de==null?void 0:de.id]),k.useEffect(()=>{sessionStorage.getItem("showPopup")||d.length>0&&setTimeout(()=>{$(),sessionStorage.setItem("showPopup",!0)},500)},[d]),h.jsxs(qi,{className:"dashboard-content-wrapper",children:[h.jsxs(Yn,{className:"mb-2 banner-container bg-primary-lighter",children:[h.jsxs(fn,{className:"row-cols-2 gx-2 mb-1 justify-content-center px-4",children:[h.jsx(Gt,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm h-100",style:{background:"var(--color-kudos-light)"},children:h.jsx(Yu,{to:"/appreciations",children:h.jsxs(et.Body,{className:"p-2 text-center d-flex align-items-center",children:[h.jsx("div",{className:"pe-none icon-wrap wrap-sm",style:{background:"var(--color-kudos)"},children:h.jsx("img",{src:"/img/appreciations-icon.png",alt:"Appreciations Icon"})}),h.jsx("span",{className:"d-block font-12 ms-2 text-truncate",children:"Appreciations"})]})})})}),h.jsx(Gt,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm h-100",style:{background:"var(--color-badges-light)"},children:h.jsx(Yu,{to:"/badges",children:h.jsxs(et.Body,{className:"p-2 text-center d-flex align-items-center",children:[h.jsx("div",{className:"pe-none icon-wrap wrap-sm",style:{background:"var(--color-badges)"},children:h.jsx("img",{src:"/img/badges-icon.png",alt:"Badges Icon"})}),h.jsx("span",{className:"d-block font-12 ms-2",children:"Badges"})]})})})})]}),h.jsxs("section",{className:`${t.length>0?"py-1 pb-3 py-sm-3":""}`,children:[_&&h.jsx(ci,{type:"banners"}),!_&&t.length>0&&h.jsx(Qhe,{loading:_,banners:t,itemClassName:"rounded-1 shadow-none",className:""})]})]}),h.jsx(Hqe,{}),(s==null?void 0:s.length)>0&&h.jsxs("section",{className:`overflow-hidden ${s.length>0?"py-3 px-4 py-sm-3 bg-red-lighter1":"d-none"}`,children:[_&&h.jsx(ci,{type:"banners"}),!_&&s.length>0&&h.jsx(Qhe,{loading:_,banners:s,itemClassName:"rounded-4 shadow-sm cta-slide"})]}),h.jsx(Xqe,{}),h.jsx(Wqe,{}),h.jsx(Kqe,{}),h.jsx(Jqe,{show:O,loading:_,banners:d,handleClose:H}),h.jsx(qqe,{show:A,loading:E,handleClose:M,platform:Ai.getDevicePlatform(),appUpdatedInfo:p}),h.jsx(P_e,{show:!!de,handleClose:ae,data:de}),h.jsx("div",{className:"d-block",style:{height:150}})]})}/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var uY=function(n,t){return uY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var l in s)s.hasOwnProperty(l)&&(i[l]=s[l])},uY(n,t)};function eYe(n,t){uY(n,t);function i(){this.constructor=n}n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var g4=function(){return g4=Object.assign||function(t){for(var i,s=1,l=arguments.length;s<l;s++){i=arguments[s];for(var d in i)Object.prototype.hasOwnProperty.call(i,d)&&(t[d]=i[d])}return t},g4.apply(this,arguments)};function tYe(n,t,i,s){var l,d=!1,u=0;function p(){l&&clearTimeout(l)}function g(){p(),d=!0}typeof t!="boolean"&&(s=i,i=t,t=void 0);function _(){var y=this,E=Date.now()-u,b=arguments;if(d)return;function A(){u=Date.now(),i.apply(y,b)}function N(){l=void 0}s&&!l&&A(),p(),s===void 0&&E>n?A():t!==!0&&(l=setTimeout(s?N:A,s===void 0?n-E:n))}return _.cancel=g,_}var CC={Pixel:"Pixel",Percent:"Percent"},Zhe={unit:CC.Percent,value:.8};function efe(n){return typeof n=="number"?{unit:CC.Percent,value:n*100}:typeof n=="string"?n.match(/^(\d*(\.\d+)?)px$/)?{unit:CC.Pixel,value:parseFloat(n)}:n.match(/^(\d*(\.\d+)?)%$/)?{unit:CC.Percent,value:parseFloat(n)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),Zhe):(console.warn("scrollThreshold should be string or number"),Zhe)}var L_e=function(n){eYe(t,n);function t(i){var s=n.call(this,i)||this;return s.lastScrollTop=0,s.actionTriggered=!1,s.startY=0,s.currentY=0,s.dragging=!1,s.maxPullDownDistance=0,s.getScrollableTarget=function(){return s.props.scrollableTarget instanceof HTMLElement?s.props.scrollableTarget:typeof s.props.scrollableTarget=="string"?document.getElementById(s.props.scrollableTarget):(s.props.scrollableTarget===null&&console.warn(`You are trying to pass scrollableTarget but it is null. This might
happen because the element may not have been added to DOM yet.
See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.
`),null)},s.onStart=function(l){s.lastScrollTop||(s.dragging=!0,l instanceof MouseEvent?s.startY=l.pageY:l instanceof TouchEvent&&(s.startY=l.touches[0].pageY),s.currentY=s.startY,s._infScroll&&(s._infScroll.style.willChange="transform",s._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},s.onMove=function(l){s.dragging&&(l instanceof MouseEvent?s.currentY=l.pageY:l instanceof TouchEvent&&(s.currentY=l.touches[0].pageY),!(s.currentY<s.startY)&&(s.currentY-s.startY>=Number(s.props.pullDownToRefreshThreshold)&&s.setState({pullToRefreshThresholdBreached:!0}),!(s.currentY-s.startY>s.maxPullDownDistance*1.5)&&s._infScroll&&(s._infScroll.style.overflow="visible",s._infScroll.style.transform="translate3d(0px, "+(s.currentY-s.startY)+"px, 0px)")))},s.onEnd=function(){s.startY=0,s.currentY=0,s.dragging=!1,s.state.pullToRefreshThresholdBreached&&(s.props.refreshFunction&&s.props.refreshFunction(),s.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){s._infScroll&&(s._infScroll.style.overflow="auto",s._infScroll.style.transform="none",s._infScroll.style.willChange="unset")})},s.onScrollListener=function(l){typeof s.props.onScroll=="function"&&setTimeout(function(){return s.props.onScroll&&s.props.onScroll(l)},0);var d=s.props.height||s._scrollableNode?l.target:document.documentElement.scrollTop?document.documentElement:document.body;if(!s.actionTriggered){var u=s.props.inverse?s.isElementAtTop(d,s.props.scrollThreshold):s.isElementAtBottom(d,s.props.scrollThreshold);u&&s.props.hasMore&&(s.actionTriggered=!0,s.setState({showLoader:!0}),s.props.next&&s.props.next()),s.lastScrollTop=d.scrollTop}},s.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:i.dataLength},s.throttledOnScrollListener=tYe(150,s.onScrollListener).bind(s),s.onStart=s.onStart.bind(s),s.onMove=s.onMove.bind(s),s.onEnd=s.onEnd.bind(s),s}return t.prototype.componentDidMount=function(){if(typeof this.props.dataLength>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),typeof this.props.initialScrollY=="number"&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),typeof this.props.refreshFunction!="function"))throw new Error(`Mandatory prop "refreshFunction" missing.
Pull Down To Refresh functionality will not work
as expected. Check README.md for usage'`)},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(i){this.props.dataLength!==i.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(i,s){var l=i.dataLength!==s.prevDataLength;return l?g4(g4({},s),{prevDataLength:i.dataLength}):null},t.prototype.isElementAtTop=function(i,s){s===void 0&&(s=.8);var l=i===document.body||i===document.documentElement?window.screen.availHeight:i.clientHeight,d=efe(s);return d.unit===CC.Pixel?i.scrollTop<=d.value+l-i.scrollHeight+1:i.scrollTop<=d.value/100+l-i.scrollHeight+1},t.prototype.isElementAtBottom=function(i,s){s===void 0&&(s=.8);var l=i===document.body||i===document.documentElement?window.screen.availHeight:i.clientHeight,d=efe(s);return d.unit===CC.Pixel?i.scrollTop+l>=i.scrollHeight-d.value:i.scrollTop+l>=d.value/100*i.scrollHeight},t.prototype.render=function(){var i=this,s=g4({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),l=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),d=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return dn.createElement("div",{style:d,className:"infinite-scroll-component__outerdiv"},dn.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(u){return i._infScroll=u},style:s},this.props.pullDownToRefresh&&dn.createElement("div",{style:{position:"relative"},ref:function(u){return i._pullDown=u}},dn.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!l&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(k.Component);const Ck=[{type:"form_approval",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_reminder",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_approved",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_reject",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"form_submitted",icon:"details4",color:"#ca8a04",bgColor:"#f9edd1"},{type:"broadcast_created",icon:"invitation2",color:"#32ad7c",bgColor:"#baf6dc"},{type:"broadcast_liked",icon:"invitation2",color:"#32ad7c",bgColor:"#baf6dc"},{type:"broadcast_comment",icon:"invitation2",color:"#32ad7c",bgColor:"#baf6dc"},{type:"magazine_created",icon:"dictionary2",color:"#5970ac",bgColor:"#91a7df"},{type:"magazine_media_created",icon:"dictionary2",color:"#5970ac",bgColor:"#91a7df"},{type:"appreciation_recieved",icon:"upvote3",color:"#da5570",bgColor:"#ffd8e1"},{type:"overlay_appreciation",icon:"upvote3",color:"#da5570",bgColor:"#ffd8e1"},{type:"detailing_contest_created",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"detailing_contest_upload_response",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"detailing_contest_evaluated",icon:"notifications2",color:"#1099bb",bgColor:"#d9f7ff"},{type:"badge_recieved",icon:"insights8",color:"#5970ac",bgColor:"#ccd9fe"},{type:"overlay_badge",icon:"insights8",color:"#5970ac",bgColor:"#ccd9fe"},{type:"target_achieved",icon:"insights16",color:"#32ad7c",bgColor:"#baf6dc"}];function YO({text:n,linesToShow:t=2,containerClass:i="",buttonClass:s="",buttonStyles:l=null}){const d={WebkitLineClamp:t,WebkitBoxOrient:"vertical",overflow:"hidden",display:"-webkit-box"},[u,p]=k.useState(!1),[g,_]=k.useState(!1),y=k.useRef(null);return k.useEffect(()=>{if(y.current){const E=y.current.scrollHeight!==y.current.clientHeight;_(E)}},[]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:`${i}`,style:u?null:d,ref:y,children:n}),g&&h.jsx("button",{type:"button",className:`${s}`,style:l,onClick:E=>{E.stopPropagation(),p(!u)},children:u?"Read less":"Read more"})]})}function nYe(n){var O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe,me,Ne;const t=Ii();k.useState(null);const[i,s]=k.useState(!1),l=n.className?n.className:"";((O=n.data)==null?void 0:O.icon)!==""&&((D=n.data)==null||D.icon),(P=n.data)!=null&&P.bg_color&&`${(j=n.data)==null?void 0:j.bg_color}`;const d=(M=n.data)!=null&&M.title?(V=n.data)==null?void 0:V.title:"Default Title",u=(H=n.data)!=null&&H.description?($=n.data)==null?void 0:$.description:"",p=(Q=n.data)!=null&&Q.time_ago?(Y=n.data)==null?void 0:Y.time_ago:"",g=(le=n.data)!=null&&le.payload?(te=(ae=n.data)==null?void 0:ae.payload)==null?void 0:te.type:"";(de=n.data)!=null&&de.payload&&((ie=(G=n.data)==null?void 0:G.payload)==null||ie.entity_id);const _=b(g),y=()=>{s(!1)},E=()=>{s(!0)};function b(Fe){let je=[];return Fe&&(Ck==null?void 0:Ck.length)>0&&(je=Ck.filter(Ve=>Ve.type===Fe)),je.length>0?je[0]:je}async function A(){var je,Ve,Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t;if(console.log("handleButtonClick called..."),(je=n==null?void 0:n.data)!=null&&je.is_read||n==null||n.markReadNotification({id:(Ve=n==null?void 0:n.data)==null?void 0:Ve.id}),((Re=n==null?void 0:n.data)==null?void 0:Re.notification_type)==="overlay"){E();return}let Fe=v1e((Be=n.data)==null?void 0:Be.payload);if(console.log("handleRedirection url =",Fe),((we=(Xe=n.data)==null?void 0:Xe.payload)==null?void 0:we.type)===O8e||((rt=(Ge=n.data)==null?void 0:Ge.payload)==null?void 0:rt.type)===P8e||((Ze=(pt=n.data)==null?void 0:pt.payload)==null?void 0:Ze.type)===L8e||((_t=(Je=n.data)==null?void 0:Je.payload)==null?void 0:_t.type)===D8e){console.log("Do nothing");return}t(Fe)}const N=h.jsx(Pt,{type:"button",className:`btn-theme btn-sm btn-green stretched-link ${((he=(_e=n.data)==null?void 0:_e.payload)==null?void 0:he.type)!==Due&&"opacity-0"}`,onClick:A,children:((fe=(Ce=n.data)==null?void 0:Ce.payload)==null?void 0:fe.type)===Due?"Approve / Reject":"Details"});return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:`media-list-card notification-list-card border-0 ${l}`,children:h.jsx(et.Body,{className:"px-0 py-2",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsxs("div",{className:"flex-shrink-0 media-icon-wrapper d-flex align-items-center justify-content-center position-relative",style:{backgroundColor:`${_.bgColor}`},children:[!((me=n==null?void 0:n.data)!=null&&me.is_read)&&h.jsx("span",{className:"unread-badge"}),h.jsx(Zt,{tag:_.icon||"notifications2",style:{color:`${_.color}`},className:""})]}),h.jsxs("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:[h.jsx("div",{className:"font-13 fw-sb mb-1",children:d}),h.jsx(YO,{text:u,linesToShow:1,containerClass:"font-13 text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}}),h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("span",{className:"text-start media-time-text",children:p}),((Ne=n.data)==null?void 0:Ne.payload)&&h.jsx(h.Fragment,{children:N})]})]})]})})}),h.jsx(P_e,{show:i,handleClose:y,data:n.data})]})}function D_e(){return h.jsx("div",{className:"d-flex align-items-center justify-content-center w-100 p-3",children:h.jsxs("div",{className:"d-flex align-items-center py-2 px-3 rounded-3 bg-gray-normal-overlay text-white font-15",style:{maxWidth:300},children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-2",children:"Loading more..."})]})})}function iYe(){const{getNotificationStats:n}=k.useContext(QR),[t,i]=k.useState([]),[s,l]=k.useState(0),[d,u]=k.useState(null),[p,g]=k.useState(!0);function _(){console.log("handleNotificationAction Button Clicked...")}async function y(){let b;d&&(b=d),J4.getAllNotifications(b).then(A=>{var N,O,D,P,j,M;if(console.log("getAllNotifications RES = ",A.data),A.data.status==="success"){const V=(O=(N=A.data)==null?void 0:N.data)==null?void 0:O.notifications,H=(P=(D=A.data)==null?void 0:D.data)==null?void 0:P.count,$=(M=(j=A.data)==null?void 0:j.data)==null?void 0:M.lastkey;i(Q=>[...Q,...V]),l(H),u($),g(!1)}}).catch(A=>{g(!1),i([]),l(0),u(null),console.log("Error in getAllNotifications = ",A)})}async function E(b){const A=t.map((N,O)=>(N==null?void 0:N.id)===(b==null?void 0:b.id)?{...N,is_read:!0}:N);i(A),J4.markReadNotification(b).then(N=>{if(console.log("markReadNotification RES = ",N.data),N.data.status==="success"&&n(),N.data.status==="failed"){const O=t.map((D,P)=>(D==null?void 0:D.id)===(b==null?void 0:b.id)?{...D,is_read:!1}:D);i(O)}}).catch(N=>{console.log("Error in markReadNotification = ",N);const O=t.map((D,P)=>(D==null?void 0:D.id)===(b==null?void 0:b.id)?{...D,is_read:!1}:D);i(O)})}return k.useEffect(()=>{y()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:p?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:[0,1,2].map((b,A)=>h.jsx(ci,{type:"notifications-list"},`notification-list-card-${A}`))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsx(h.Fragment,{children:h.jsx(L_e,{dataLength:t.length,next:y,scrollThreshold:1,hasMore:!!d,loader:h.jsx(D_e,{}),children:h.jsx("div",{className:"d-grid gap-2",children:t.map((b,A)=>h.jsx(nYe,{cardType:"list",data:b,handlePrimaryAction:_,markReadNotification:E,className:"rounded-0 border-bottom bg-transparent"},b.id))})})}):h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more notifications"})})})})}function Ga({children:n,size:t,className:i}){let s=i||"",l="",d="heading";switch(t){case"xs":l=`${d}-xs`;break;case"sm":l=`${d}-sm`;break;case"md":l=`${d}-md`;break;case"lg":l=`${d}-lg`;break;case"xl":l=`${d}-xl`;break;case"2xl":l=`${d}-2xl`;break;case"3xl":l=`${d}-3xl`;break;case"4xl":l=`${d}-4xl`;break;case"5xl":l=`${d}-5xl`;break;default:l=""}return h.jsx(h.Fragment,{children:h.jsx("div",{className:`section-heading ${l} ${s}`,children:n})})}function hY(n){const t=n.message_title?n.message_title:"",i=n.message_text?n.message_text:"This is a sample message text.",s=n.show_action_button?n.show_action_button:!1,l={closeButton:!0};return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",className:"theme-modal confirmation-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-2",...l,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(GO,{})})}),h.jsx("div",{className:"heading flex-grow-1 ms-3",children:t!==""?h.jsx(h.Fragment,{children:t}):"Information"})]})}),h.jsxs(vn.Body,{children:[h.jsx("div",{className:"modal-helper-text",children:i}),s&&h.jsx("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:h.jsx(Pt,{type:"submit",className:`btn-theme
btn-gray btn-md flex-grow-1 text-capitalize`,onClick:n.handleClose,children:"Cancel"})})]})]})})}function rYe(n){n.CapacitorUtils.Synapse=new Proxy({},{get(t,i){return new Proxy({},{get(s,l){return(d,u,p)=>{const g=n.Capacitor.Plugins[i];if(g===void 0){p(new Error(`Capacitor plugin ${i} not found`));return}if(typeof g[l]!="function"){p(new Error(`Method ${l} not found in Capacitor plugin ${i}`));return}(async()=>{try{const _=await g[l](d);u(_)}catch(_){p(_)}})()}}})}})}function sYe(n){n.CapacitorUtils.Synapse=new Proxy({},{get(t,i){return n.cordova.plugins[i]}})}function aYe(n=!1){typeof window>"u"||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!n?rYe(window):window.cordova!==void 0&&sYe(window))}const X$=hc("Geolocation",{web:()=>Xi(()=>import("./web-CihKQVmt.js"),__vite__mapDeps([])).then(n=>new n.GeolocationWeb)});aYe();function oYe(n){var A,N;Ii(),k.useState(null);const[t,i]=k.useState(!1),[s,l]=k.useState(!1);n!=null&&n.className&&(n==null||n.className);const d=(A=n==null?void 0:n.item)!=null&&A.name?(N=n==null?void 0:n.item)==null?void 0:N.name:"Default title",u=n!=null&&n.item.icon?n==null?void 0:n.item.icon:"/img/quick-action-icon.png";n!=null&&n.item.url&&(n==null||n.item.url);const p=()=>{i(!1)},g=()=>{i(!0)},_=()=>{l(!1)},y=()=>{l(!0)};async function E(O){console.log("HandleClick item =",O);let D=O!=null&&O.action_type?O==null?void 0:O.action_type:"web_view",P=O!=null&&O.url?`${O==null?void 0:O.url}`:O!=null&&O.route?O==null?void 0:O.route:"";const j=(O==null?void 0:O.requires_location)||!1;if(console.log("url = ",P),console.log("actionType = ",D),!j)n.handleQuickAction(P,D);else{console.log("Inside Else part of if (!requiresGeo)....");try{const M=await X$.checkPermissions();if(console.log("check permission data - ",JSON.stringify(M)),(M==null?void 0:M.location)!=="granted"){const V=await X$.requestPermissions();if(console.log("requestPermissions data - ",JSON.stringify(V)),(V==null?void 0:V.location)==="granted"){const H=await b();if(H){console.log("**--** coordData:",H.coords);let $=H.coords,Q=P+`?latitude=${$.latitude}&longitude=${$.longitude}`;console.log("newUrl -- ",Q),n.handleQuickAction(Q,D)}else g()}else console.log("Inside if (reqPermissionResult?.location === 'granted') else ....NEED PERMISSIONS"),g()}else{const V=await b();if(console.log("**--** coordData:",V),V){console.log("In If **--** coordData:",V.coords);let H=V.coords,$=P+`?latitude=${H.latitude}&longitude=${H.longitude}`;console.log("newUrl -- ",$),n.handleQuickAction($,D)}else console.log("Inside if (coordData) else ....NEED PERMISSIONS"),g()}}catch(M){y(),console.log("## --- LOCATION ERROR -- ",M)}}}const b=async()=>{try{const O=await X$.getCurrentPosition();return console.log("**--** User coordinates:",O.coords),O}catch(O){console.error("Error fetching coordinates:",O)}};return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:"border-0 shadow-sm h-100 action-card",onClick:()=>E(n.item),children:h.jsxs(et.Body,{className:"text-center px-1",children:[h.jsx("img",{src:u,alt:`${d} Form Icon`,className:"mx-auto img-fluid"}),h.jsx("div",{className:"d-flex align-items-center justify-content-center w-100 pt-1",children:h.jsx("div",{className:"pt-1 font-12 fw-sb overflow-hidden line-clamp",children:d})})]})}),h.jsx(hY,{show:t,handleClose:p,message_title:"Required Location",message_text:"This form requires access to your location. Please enable location access by going to your phone's Settings > Apps > T3 Unstoppables > Permissions, and allow Location access. On iOS, go to Settings > T3 Unstoppables > Location, and choose 'While Using the App' or 'Always'."}),h.jsx(hY,{show:s,handleClose:_,message_title:"Location is Off",message_text:"Location not available. Please check if your device location is turned on."})]})}var x7={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/x7.exports;(function(n,t){(function(){var i,s="4.17.21",l=200,d="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",u="Expected a function",p="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",_=500,y="__lodash_placeholder__",E=1,b=2,A=4,N=1,O=2,D=1,P=2,j=4,M=8,V=16,H=32,$=64,Q=128,Y=256,le=512,ae=30,te="...",de=800,G=16,ie=1,_e=2,he=3,Ce=1/0,fe=9007199254740991,me=17976931348623157e292,Ne=NaN,Fe=4294967295,je=Fe-1,Ve=Fe>>>1,Re=[["ary",Q],["bind",D],["bindKey",P],["curry",M],["curryRight",V],["flip",le],["partial",H],["partialRight",$],["rearg",Y]],Be="[object Arguments]",Xe="[object Array]",we="[object AsyncFunction]",Ge="[object Boolean]",rt="[object Date]",pt="[object DOMException]",Ze="[object Error]",Je="[object Function]",_t="[object GeneratorFunction]",Xt="[object Map]",Ht="[object Number]",gn="[object Null]",It="[object Object]",xt="[object Promise]",mt="[object Proxy]",dt="[object RegExp]",it="[object Set]",Me="[object String]",We="[object Symbol]",bt="[object Undefined]",St="[object WeakMap]",Lt="[object WeakSet]",tn="[object ArrayBuffer]",un="[object DataView]",an="[object Float32Array]",ye="[object Float64Array]",J="[object Int8Array]",ne="[object Int16Array]",Se="[object Int32Array]",Ue="[object Uint8Array]",tt="[object Uint8ClampedArray]",Te="[object Uint16Array]",Pe="[object Uint32Array]",Qe=/\b__p \+= '';/g,nt=/\b(__p \+=) '' \+/g,$e=/(__e\(.*?\)|\b__t\)) \+\n'';/g,st=/&(?:amp|lt|gt|quot|#39);/g,_n=/[&<>"']/g,Dt=RegExp(st.source),nn=RegExp(_n.source),en=/<%-([\s\S]+?)%>/g,qt=/<%([\s\S]+?)%>/g,Jt=/<%=([\s\S]+?)%>/g,mn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Kn=/^\w*$/,Nn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tn=/[\\^$.*+?()[\]{}|]/g,Ui=RegExp(Tn.source),xr=/^\s+/,bi=/\s/,Ia=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Sl=/\{\n\/\* \[wrapped with (.+)\] \*/,mc=/,? & /,nu=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,To=/[()=,{}\[\]\/\s]/,Fg=/\\(\\)?/g,Bg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ka=/\w*$/,ew=/^[-+]0x[0-9a-f]+$/i,$v=/^0b[01]+$/i,tw=/^\[object .+?Constructor\]$/,mf=/^0o[0-7]+$/i,sx=/^(?:0|[1-9]\d*)$/,ax=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ro=/($^)/,ox=/['\n\r\u2028\u2029\\]/g,Vg="\\ud800-\\udfff",fs="\\u0300-\\u036f",lx="\\ufe20-\\ufe2f",cx="\\u20d0-\\u20ff",nw=fs+lx+cx,iw="\\u2700-\\u27bf",zg="a-z\\xdf-\\xf6\\xf8-\\xff",rw="\\xac\\xb1\\xd7\\xf7",sw="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dx="\\u2000-\\u206f",ah=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",iu="A-Z\\xc0-\\xd6\\xd8-\\xde",qa="\\ufe0e\\ufe0f",Hp=rw+sw+dx+ah,Kv="['’]",Qi="["+Vg+"]",qv="["+Hp+"]",oh="["+nw+"]",gf="\\d+",Hg="["+iw+"]",Gg="["+zg+"]",Yv="[^"+Vg+Hp+gf+iw+zg+iu+"]",Wg="\\ud83c[\\udffb-\\udfff]",vf="(?:"+oh+"|"+Wg+")",yf="[^"+Vg+"]",ru="(?:\\ud83c[\\udde6-\\uddff]){2}",Gp="[\\ud800-\\udbff][\\udc00-\\udfff]",rd="["+iu+"]",$g="\\u200d",Wp="(?:"+Gg+"|"+Yv+")",aw="(?:"+rd+"|"+Yv+")",ux="(?:"+Kv+"(?:d|ll|m|re|s|t|ve))?",uP="(?:"+Kv+"(?:D|LL|M|RE|S|T|VE))?",hP=vf+"?",fP="["+qa+"]?",dF="(?:"+$g+"(?:"+[yf,ru,Gp].join("|")+")"+fP+hP+")*",uF="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",hF="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",pP=fP+hP+dF,fF="(?:"+[Hg,ru,Gp].join("|")+")"+pP,mP="(?:"+[yf+oh+"?",oh,ru,Gp,Qi].join("|")+")",pF=RegExp(Kv,"g"),mF=RegExp(oh,"g"),hx=RegExp(Wg+"(?="+Wg+")|"+mP+pP,"g"),Xv=RegExp([rd+"?"+Gg+"+"+ux+"(?="+[qv,rd,"$"].join("|")+")",aw+"+"+uP+"(?="+[qv,rd+Wp,"$"].join("|")+")",rd+"?"+Wp+"+"+ux,rd+"+"+uP,hF,uF,gf,fF].join("|"),"g"),gF=RegExp("["+$g+Vg+nw+qa+"]"),vF=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,yF=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_F=-1,Gr={};Gr[an]=Gr[ye]=Gr[J]=Gr[ne]=Gr[Se]=Gr[Ue]=Gr[tt]=Gr[Te]=Gr[Pe]=!0,Gr[Be]=Gr[Xe]=Gr[tn]=Gr[Ge]=Gr[un]=Gr[rt]=Gr[Ze]=Gr[Je]=Gr[Xt]=Gr[Ht]=Gr[It]=Gr[dt]=Gr[it]=Gr[Me]=Gr[St]=!1;var Wr={};Wr[Be]=Wr[Xe]=Wr[tn]=Wr[un]=Wr[Ge]=Wr[rt]=Wr[an]=Wr[ye]=Wr[J]=Wr[ne]=Wr[Se]=Wr[Xt]=Wr[Ht]=Wr[It]=Wr[dt]=Wr[it]=Wr[Me]=Wr[We]=Wr[Ue]=Wr[tt]=Wr[Te]=Wr[Pe]=!0,Wr[Ze]=Wr[Je]=Wr[St]=!1;var EF={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},wF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_f={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},gc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gP=parseFloat,SF=parseInt,vP=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,bF=typeof self=="object"&&self&&self.Object===Object&&self,dr=vP||bF||Function("return this")(),fx=t&&!t.nodeType&&t,$p=fx&&!0&&n&&!n.nodeType&&n,yP=$p&&$p.exports===fx,Kg=yP&&vP.process,bl=function(){try{var ot=$p&&$p.require&&$p.require("util").types;return ot||Kg&&Kg.binding&&Kg.binding("util")}catch{}}(),_P=bl&&bl.isArrayBuffer,ow=bl&&bl.isDate,EP=bl&&bl.isMap,lw=bl&&bl.isRegExp,cw=bl&&bl.isSet,dw=bl&&bl.isTypedArray;function Cl(ot,Ot,Et){switch(Et.length){case 0:return ot.call(Ot);case 1:return ot.call(Ot,Et[0]);case 2:return ot.call(Ot,Et[0],Et[1]);case 3:return ot.call(Ot,Et[0],Et[1],Et[2])}return ot.apply(Ot,Et)}function CF(ot,Ot,Et,Cn){for(var di=-1,ur=ot==null?0:ot.length;++di<ur;){var na=ot[di];Ot(Cn,na,Et(na),ot)}return Cn}function ta(ot,Ot){for(var Et=-1,Cn=ot==null?0:ot.length;++Et<Cn&&Ot(ot[Et],Et,ot)!==!1;);return ot}function uw(ot,Ot){for(var Et=ot==null?0:ot.length;Et--&&Ot(ot[Et],Et,ot)!==!1;);return ot}function wP(ot,Ot){for(var Et=-1,Cn=ot==null?0:ot.length;++Et<Cn;)if(!Ot(ot[Et],Et,ot))return!1;return!0}function Ef(ot,Ot){for(var Et=-1,Cn=ot==null?0:ot.length,di=0,ur=[];++Et<Cn;){var na=ot[Et];Ot(na,Et,ot)&&(ur[di++]=na)}return ur}function hw(ot,Ot){var Et=ot==null?0:ot.length;return!!Et&&Yg(ot,Ot,0)>-1}function px(ot,Ot,Et){for(var Cn=-1,di=ot==null?0:ot.length;++Cn<di;)if(Et(Ot,ot[Cn]))return!0;return!1}function ss(ot,Ot){for(var Et=-1,Cn=ot==null?0:ot.length,di=Array(Cn);++Et<Cn;)di[Et]=Ot(ot[Et],Et,ot);return di}function Tl(ot,Ot){for(var Et=-1,Cn=Ot.length,di=ot.length;++Et<Cn;)ot[di+Et]=Ot[Et];return ot}function mx(ot,Ot,Et,Cn){var di=-1,ur=ot==null?0:ot.length;for(Cn&&ur&&(Et=ot[++di]);++di<ur;)Et=Ot(Et,ot[di],di,ot);return Et}function qg(ot,Ot,Et,Cn){var di=ot==null?0:ot.length;for(Cn&&di&&(Et=ot[--di]);di--;)Et=Ot(Et,ot[di],di,ot);return Et}function fw(ot,Ot){for(var Et=-1,Cn=ot==null?0:ot.length;++Et<Cn;)if(Ot(ot[Et],Et,ot))return!0;return!1}var TF=vx("length");function Ni(ot){return ot.split("")}function RF(ot){return ot.match(nu)||[]}function SP(ot,Ot,Et){var Cn;return Et(ot,function(di,ur,na){if(Ot(di,ur,na))return Cn=ur,!1}),Cn}function pw(ot,Ot,Et,Cn){for(var di=ot.length,ur=Et+(Cn?1:-1);Cn?ur--:++ur<di;)if(Ot(ot[ur],ur,ot))return ur;return-1}function Yg(ot,Ot,Et){return Ot===Ot?yw(ot,Ot,Et):pw(ot,bP,Et)}function gx(ot,Ot,Et,Cn){for(var di=Et-1,ur=ot.length;++di<ur;)if(Cn(ot[di],Ot))return di;return-1}function bP(ot){return ot!==ot}function CP(ot,Ot){var Et=ot==null?0:ot.length;return Et?mw(ot,Ot)/Et:Ne}function vx(ot){return function(Ot){return Ot==null?i:Ot[ot]}}function Jv(ot){return function(Ot){return ot==null?i:ot[Ot]}}function TP(ot,Ot,Et,Cn,di){return di(ot,function(ur,na,Dr){Et=Cn?(Cn=!1,ur):Ot(Et,ur,na,Dr)}),Et}function xF(ot,Ot){var Et=ot.length;for(ot.sort(Ot);Et--;)ot[Et]=ot[Et].value;return ot}function mw(ot,Ot){for(var Et,Cn=-1,di=ot.length;++Cn<di;){var ur=Ot(ot[Cn]);ur!==i&&(Et=Et===i?ur:Et+ur)}return Et}function yx(ot,Ot){for(var Et=-1,Cn=Array(ot);++Et<ot;)Cn[Et]=Ot(Et);return Cn}function lh(ot,Ot){return ss(Ot,function(Et){return[Et,ot[Et]]})}function RP(ot){return ot&&ot.slice(0,ad(ot)+1).replace(xr,"")}function Rl(ot){return function(Ot){return ot(Ot)}}function _x(ot,Ot){return ss(Ot,function(Et){return ot[Et]})}function Xg(ot,Ot){return ot.has(Ot)}function gw(ot,Ot){for(var Et=-1,Cn=ot.length;++Et<Cn&&Yg(Ot,ot[Et],0)>-1;);return Et}function xP(ot,Ot){for(var Et=ot.length;Et--&&Yg(Ot,ot[Et],0)>-1;);return Et}function AF(ot,Ot){for(var Et=ot.length,Cn=0;Et--;)ot[Et]===Ot&&++Cn;return Cn}var vc=Jv(EF),IF=Jv(wF);function NF(ot){return"\\"+gc[ot]}function OF(ot,Ot){return ot==null?i:ot[Ot]}function Jg(ot){return gF.test(ot)}function AP(ot){return vF.test(ot)}function PF(ot){for(var Ot,Et=[];!(Ot=ot.next()).done;)Et.push(Ot.value);return Et}function Ex(ot){var Ot=-1,Et=Array(ot.size);return ot.forEach(function(Cn,di){Et[++Ot]=[di,Cn]}),Et}function wx(ot,Ot){return function(Et){return ot(Ot(Et))}}function su(ot,Ot){for(var Et=-1,Cn=ot.length,di=0,ur=[];++Et<Cn;){var na=ot[Et];(na===Ot||na===y)&&(ot[Et]=y,ur[di++]=Et)}return ur}function vw(ot){var Ot=-1,Et=Array(ot.size);return ot.forEach(function(Cn){Et[++Ot]=Cn}),Et}function LF(ot){var Ot=-1,Et=Array(ot.size);return ot.forEach(function(Cn){Et[++Ot]=[Cn,Cn]}),Et}function yw(ot,Ot,Et){for(var Cn=Et-1,di=ot.length;++Cn<di;)if(ot[Cn]===Ot)return Cn;return-1}function DF(ot,Ot,Et){for(var Cn=Et+1;Cn--;)if(ot[Cn]===Ot)return Cn;return Cn}function Qg(ot){return Jg(ot)?MF(ot):TF(ot)}function sd(ot){return Jg(ot)?xl(ot):Ni(ot)}function ad(ot){for(var Ot=ot.length;Ot--&&bi.test(ot.charAt(Ot)););return Ot}var kF=Jv(_f);function MF(ot){for(var Ot=hx.lastIndex=0;hx.test(ot);)++Ot;return Ot}function xl(ot){return ot.match(hx)||[]}function jF(ot){return ot.match(Xv)||[]}var UF=function ot(Ot){Ot=Ot==null?dr:Zg.defaults(dr.Object(),Ot,Zg.pick(dr,yF));var Et=Ot.Array,Cn=Ot.Date,di=Ot.Error,ur=Ot.Function,na=Ot.Math,Dr=Ot.Object,Qv=Ot.RegExp,Sx=Ot.String,yc=Ot.TypeError,Tt=Et.prototype,FF=ur.prototype,e0=Dr.prototype,_w=Ot["__core-js_shared__"],Ew=FF.toString,Tr=e0.hasOwnProperty,IP=0,NP=function(){var S=/[^.]+$/.exec(_w&&_w.keys&&_w.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),ww=e0.toString,Sw=Ew.call(Dr),Zv=dr._,BF=Qv("^"+Ew.call(Tr).replace(Tn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bw=yP?Ot.Buffer:i,wf=Ot.Symbol,Cw=Ot.Uint8Array,Tw=bw?bw.allocUnsafe:i,Rw=wx(Dr.getPrototypeOf,Dr),bx=Dr.create,_c=e0.propertyIsEnumerable,ey=Tt.splice,Cx=wf?wf.isConcatSpreadable:i,Sf=wf?wf.iterator:i,Al=wf?wf.toStringTag:i,xw=function(){try{var S=sm(Dr,"defineProperty");return S({},"",{}),S}catch{}}(),VF=Ot.clearTimeout!==dr.clearTimeout&&Ot.clearTimeout,OP=Cn&&Cn.now!==dr.Date.now&&Cn.now,Tx=Ot.setTimeout!==dr.setTimeout&&Ot.setTimeout,ty=na.ceil,ny=na.floor,iy=Dr.getOwnPropertySymbols,PP=bw?bw.isBuffer:i,LP=Ot.isFinite,DP=Tt.join,Aw=wx(Dr.keys,Dr),ia=na.max,Ya=na.min,zF=Cn.now,HF=Ot.parseInt,kP=na.random,MP=Tt.reverse,ry=sm(Ot,"DataView"),sy=sm(Ot,"Map"),ay=sm(Ot,"Promise"),t0=sm(Ot,"Set"),oy=sm(Ot,"WeakMap"),ly=sm(Dr,"create"),Iw=oy&&new oy,n0={},GF=om(ry),WF=om(sy),$F=om(ay),KF=om(t0),Nw=om(oy),Kp=wf?wf.prototype:i,qp=Kp?Kp.valueOf:i,jP=Kp?Kp.toString:i;function be(S){if(bs(S)&&!ui(S)&&!(S instanceof Fi)){if(S instanceof Il)return S;if(Tr.call(S,"__wrapped__"))return I6(S)}return new Il(S)}var i0=function(){function S(){}return function(I){if(!ps(I))return{};if(bx)return bx(I);S.prototype=I;var B=new S;return S.prototype=i,B}}();function cy(){}function Il(S,I){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!I,this.__index__=0,this.__values__=i}be.templateSettings={escape:en,evaluate:qt,interpolate:Jt,variable:"",imports:{_:be}},be.prototype=cy.prototype,be.prototype.constructor=be,Il.prototype=i0(cy.prototype),Il.prototype.constructor=Il;function Fi(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Fe,this.__views__=[]}function qF(){var S=new Fi(this.__wrapped__);return S.__actions__=Jo(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=Jo(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=Jo(this.__views__),S}function YF(){if(this.__filtered__){var S=new Fi(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function dy(){var S=this.__wrapped__.value(),I=this.__dir__,B=ui(S),se=I<0,ge=B?S.length:0,Ie=w6(0,ge,this.__views__),ze=Ie.start,Ye=Ie.end,ct=Ye-ze,jt=se?Ye:ze-1,Ft=this.__iteratees__,Yt=Ft.length,yn=0,Pn=Ya(ct,this.__takeCount__);if(!B||!se&&ge==ct&&Pn==ct)return r6(S,this.__actions__);var qn=[];e:for(;ct--&&yn<Pn;){jt+=I;for(var Ci=-1,ei=S[jt];++Ci<Yt;){var Bi=Ft[Ci],Yi=Bi.iteratee,nl=Bi.type,Qa=Yi(ei);if(nl==_e)ei=Qa;else if(!Qa){if(nl==ie)continue e;break e}}qn[yn++]=ei}return qn}Fi.prototype=i0(cy.prototype),Fi.prototype.constructor=Fi;function Yp(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function XF(){this.__data__=ly?ly(null):{},this.size=0}function JF(S){var I=this.has(S)&&delete this.__data__[S];return this.size-=I?1:0,I}function QF(S){var I=this.__data__;if(ly){var B=I[S];return B===g?i:B}return Tr.call(I,S)?I[S]:i}function ZF(S){var I=this.__data__;return ly?I[S]!==i:Tr.call(I,S)}function eB(S,I){var B=this.__data__;return this.size+=this.has(S)?0:1,B[S]=ly&&I===i?g:I,this}Yp.prototype.clear=XF,Yp.prototype.delete=JF,Yp.prototype.get=QF,Yp.prototype.has=ZF,Yp.prototype.set=eB;function au(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function tB(){this.__data__=[],this.size=0}function nB(S){var I=this.__data__,B=hy(I,S);if(B<0)return!1;var se=I.length-1;return B==se?I.pop():ey.call(I,B,1),--this.size,!0}function iB(S){var I=this.__data__,B=hy(I,S);return B<0?i:I[B][1]}function Rx(S){return hy(this.__data__,S)>-1}function rB(S,I){var B=this.__data__,se=hy(B,S);return se<0?(++this.size,B.push([S,I])):B[se][1]=I,this}au.prototype.clear=tB,au.prototype.delete=nB,au.prototype.get=iB,au.prototype.has=Rx,au.prototype.set=rB;function ch(S){var I=-1,B=S==null?0:S.length;for(this.clear();++I<B;){var se=S[I];this.set(se[0],se[1])}}function Ow(){this.size=0,this.__data__={hash:new Yp,map:new(sy||au),string:new Yp}}function sB(S){var I=by(this,S).delete(S);return this.size-=I?1:0,I}function aB(S){return by(this,S).get(S)}function oB(S){return by(this,S).has(S)}function lB(S,I){var B=by(this,S),se=B.size;return B.set(S,I),this.size+=B.size==se?0:1,this}ch.prototype.clear=Ow,ch.prototype.delete=sB,ch.prototype.get=aB,ch.prototype.has=oB,ch.prototype.set=lB;function Xp(S){var I=-1,B=S==null?0:S.length;for(this.__data__=new ch;++I<B;)this.add(S[I])}function cB(S){return this.__data__.set(S,g),this}function Pw(S){return this.__data__.has(S)}Xp.prototype.add=Xp.prototype.push=cB,Xp.prototype.has=Pw;function Ec(S){var I=this.__data__=new au(S);this.size=I.size}function dB(){this.__data__=new au,this.size=0}function uB(S){var I=this.__data__,B=I.delete(S);return this.size=I.size,B}function UP(S){return this.__data__.get(S)}function hB(S){return this.__data__.has(S)}function fB(S,I){var B=this.__data__;if(B instanceof au){var se=B.__data__;if(!sy||se.length<l-1)return se.push([S,I]),this.size=++B.size,this;B=this.__data__=new ch(se)}return B.set(S,I),this.size=B.size,this}Ec.prototype.clear=dB,Ec.prototype.delete=uB,Ec.prototype.get=UP,Ec.prototype.has=hB,Ec.prototype.set=fB;function FP(S,I){var B=ui(S),se=!B&&If(S),ge=!B&&!se&&ld(S),Ie=!B&&!se&&!ge&&g0(S),ze=B||se||ge||Ie,Ye=ze?yx(S.length,Sx):[],ct=Ye.length;for(var jt in S)(I||Tr.call(S,jt))&&!(ze&&(jt=="length"||ge&&(jt=="offset"||jt=="parent")||Ie&&(jt=="buffer"||jt=="byteLength"||jt=="byteOffset")||cu(jt,ct)))&&Ye.push(jt);return Ye}function Lw(S){var I=S.length;return I?S[Mx(0,I-1)]:i}function xx(S,I){return Ry(Jo(S),Jp(I,0,S.length))}function BP(S){return Ry(Jo(S))}function uy(S,I,B){(B!==i&&!Ja(S[I],B)||B===i&&!(I in S))&&dh(S,I,B)}function r0(S,I,B){var se=S[I];(!(Tr.call(S,I)&&Ja(se,B))||B===i&&!(I in S))&&dh(S,I,B)}function hy(S,I){for(var B=S.length;B--;)if(Ja(S[B][0],I))return B;return-1}function Dw(S,I,B,se){return bf(S,function(ge,Ie,ze){I(se,ge,B(ge),ze)}),se}function s0(S,I){return S&&lu(I,Ea(I),S)}function pB(S,I){return S&&lu(I,Zo(I),S)}function dh(S,I,B){I=="__proto__"&&xw?xw(S,I,{configurable:!0,enumerable:!0,value:B,writable:!0}):S[I]=B}function kw(S,I){for(var B=-1,se=I.length,ge=Et(se),Ie=S==null;++B<se;)ge[B]=Ie?i:OA(S,I[B]);return ge}function Jp(S,I,B){return S===S&&(B!==i&&(S=S<=B?S:B),I!==i&&(S=S>=I?S:I)),S}function wc(S,I,B,se,ge,Ie){var ze,Ye=I&E,ct=I&b,jt=I&A;if(B&&(ze=ge?B(S,se,ge,Ie):B(S)),ze!==i)return ze;if(!ps(S))return S;var Ft=ui(S);if(Ft){if(ze=UB(S),!Ye)return Jo(S,ze)}else{var Yt=Oa(S),yn=Yt==Je||Yt==_t;if(ld(S))return Tf(S,Ye);if(Yt==It||Yt==Be||yn&&!ge){if(ze=ct||yn?{}:Ty(S),!Ye)return ct?o6(S,pB(ze,S)):OB(S,s0(ze,S))}else{if(!Wr[Yt])return ge?S:{};ze=FB(S,Yt,Ye)}}Ie||(Ie=new Ec);var Pn=Ie.get(S);if(Pn)return Pn;Ie.set(S,ze),hL(S)?S.forEach(function(ei){ze.add(wc(ei,I,B,ei,S,Ie))}):cL(S)&&S.forEach(function(ei,Bi){ze.set(Bi,wc(ei,I,B,Bi,S,Ie))});var qn=jt?ct?Sy:c0:ct?Zo:Ea,Ci=Ft?i:qn(S);return ta(Ci||S,function(ei,Bi){Ci&&(Bi=ei,ei=S[Bi]),r0(ze,Bi,wc(ei,I,B,Bi,S,Ie))}),ze}function VP(S){var I=Ea(S);return function(B){return zP(B,S,I)}}function zP(S,I,B){var se=B.length;if(S==null)return!se;for(S=Dr(S);se--;){var ge=B[se],Ie=I[ge],ze=S[ge];if(ze===i&&!(ge in S)||!Ie(ze))return!1}return!0}function HP(S,I,B){if(typeof S!="function")throw new yc(u);return mh(function(){S.apply(i,B)},I)}function fy(S,I,B,se){var ge=-1,Ie=hw,ze=!0,Ye=S.length,ct=[],jt=I.length;if(!Ye)return ct;B&&(I=ss(I,Rl(B))),se?(Ie=px,ze=!1):I.length>=l&&(Ie=Xg,ze=!1,I=new Xp(I));e:for(;++ge<Ye;){var Ft=S[ge],Yt=B==null?Ft:B(Ft);if(Ft=se||Ft!==0?Ft:0,ze&&Yt===Yt){for(var yn=jt;yn--;)if(I[yn]===Yt)continue e;ct.push(Ft)}else Ie(I,Yt,se)||ct.push(Ft)}return ct}var bf=Hx(ou),GP=Hx(Mw,!0);function mB(S,I){var B=!0;return bf(S,function(se,ge,Ie){return B=!!I(se,ge,Ie),B}),B}function py(S,I,B){for(var se=-1,ge=S.length;++se<ge;){var Ie=S[se],ze=I(Ie);if(ze!=null&&(Ye===i?ze===ze&&!Dl(ze):B(ze,Ye)))var Ye=ze,ct=Ie}return ct}function Qp(S,I,B,se){var ge=S.length;for(B=wi(B),B<0&&(B=-B>ge?0:ge+B),se=se===i||se>ge?ge:wi(se),se<0&&(se+=ge),se=B>se?0:AA(se);B<se;)S[B++]=I;return S}function WP(S,I){var B=[];return bf(S,function(se,ge,Ie){I(se,ge,Ie)&&B.push(se)}),B}function Na(S,I,B,se,ge){var Ie=-1,ze=S.length;for(B||(B=VB),ge||(ge=[]);++Ie<ze;){var Ye=S[Ie];I>0&&B(Ye)?I>1?Na(Ye,I-1,B,se,ge):Tl(ge,Ye):se||(ge[ge.length]=Ye)}return ge}var Ax=l6(),Ix=l6(!0);function ou(S,I){return S&&Ax(S,I,Ea)}function Mw(S,I){return S&&Ix(S,I,Ea)}function jw(S,I){return Ef(I,function(B){return gh(S[B])})}function Zp(S,I){I=Ol(I,S);for(var B=0,se=I.length;S!=null&&B<se;)S=S[Pl(I[B++])];return B&&B==se?S:i}function $P(S,I,B){var se=I(S);return ui(S)?se:Tl(se,B(S))}function _a(S){return S==null?S===i?bt:gn:Al&&Al in Dr(S)?_6(S):R6(S)}function Nx(S,I){return S>I}function gB(S,I){return S!=null&&Tr.call(S,I)}function vB(S,I){return S!=null&&I in Dr(S)}function yB(S,I,B){return S>=Ya(I,B)&&S<ia(I,B)}function Ox(S,I,B){for(var se=B?px:hw,ge=S[0].length,Ie=S.length,ze=Ie,Ye=Et(Ie),ct=1/0,jt=[];ze--;){var Ft=S[ze];ze&&I&&(Ft=ss(Ft,Rl(I))),ct=Ya(Ft.length,ct),Ye[ze]=!B&&(I||ge>=120&&Ft.length>=120)?new Xp(ze&&Ft):i}Ft=S[0];var Yt=-1,yn=Ye[0];e:for(;++Yt<ge&&jt.length<ct;){var Pn=Ft[Yt],qn=I?I(Pn):Pn;if(Pn=B||Pn!==0?Pn:0,!(yn?Xg(yn,qn):se(jt,qn,B))){for(ze=Ie;--ze;){var Ci=Ye[ze];if(!(Ci?Xg(Ci,qn):se(S[ze],qn,B)))continue e}yn&&yn.push(qn),jt.push(Pn)}}return jt}function _B(S,I,B,se){return ou(S,function(ge,Ie,ze){I(se,B(ge),Ie,ze)}),se}function em(S,I,B){I=Ol(I,S),S=Jx(S,I);var se=S==null?S:S[Pl(Qo(I))];return se==null?i:Cl(se,S,B)}function KP(S){return bs(S)&&_a(S)==Be}function qP(S){return bs(S)&&_a(S)==tn}function EB(S){return bs(S)&&_a(S)==rt}function a0(S,I,B,se,ge){return S===I?!0:S==null||I==null||!bs(S)&&!bs(I)?S!==S&&I!==I:wB(S,I,B,se,a0,ge)}function wB(S,I,B,se,ge,Ie){var ze=ui(S),Ye=ui(I),ct=ze?Xe:Oa(S),jt=Ye?Xe:Oa(I);ct=ct==Be?It:ct,jt=jt==Be?It:jt;var Ft=ct==It,Yt=jt==It,yn=ct==jt;if(yn&&ld(S)){if(!ld(I))return!1;ze=!0,Ft=!1}if(yn&&!Ft)return Ie||(Ie=new Ec),ze||g0(S)?$x(S,I,B,se,ge,Ie):y6(S,I,ct,B,se,ge,Ie);if(!(B&N)){var Pn=Ft&&Tr.call(S,"__wrapped__"),qn=Yt&&Tr.call(I,"__wrapped__");if(Pn||qn){var Ci=Pn?S.value():S,ei=qn?I.value():I;return Ie||(Ie=new Ec),ge(Ci,ei,B,se,Ie)}}return yn?(Ie||(Ie=new Ec),MB(S,I,B,se,ge,Ie)):!1}function SB(S){return bs(S)&&Oa(S)==Xt}function Px(S,I,B,se){var ge=B.length,Ie=ge,ze=!se;if(S==null)return!Ie;for(S=Dr(S);ge--;){var Ye=B[ge];if(ze&&Ye[2]?Ye[1]!==S[Ye[0]]:!(Ye[0]in S))return!1}for(;++ge<Ie;){Ye=B[ge];var ct=Ye[0],jt=S[ct],Ft=Ye[1];if(ze&&Ye[2]){if(jt===i&&!(ct in S))return!1}else{var Yt=new Ec;if(se)var yn=se(jt,Ft,ct,S,I,Yt);if(!(yn===i?a0(Ft,jt,N|O,se,Yt):yn))return!1}}return!0}function YP(S){if(!ps(S)||Xx(S))return!1;var I=gh(S)?BF:tw;return I.test(om(S))}function bB(S){return bs(S)&&_a(S)==dt}function CB(S){return bs(S)&&Oa(S)==it}function XP(S){return bs(S)&&_S(S.length)&&!!Gr[_a(S)]}function JP(S){return typeof S=="function"?S:S==null?el:typeof S=="object"?ui(S)?o0(S[0],S[1]):kx(S):My(S)}function Lx(S){if(!d0(S))return Aw(S);var I=[];for(var B in Dr(S))Tr.call(S,B)&&B!="constructor"&&I.push(B);return I}function QP(S){if(!ps(S))return GB(S);var I=d0(S),B=[];for(var se in S)se=="constructor"&&(I||!Tr.call(S,se))||B.push(se);return B}function Dx(S,I){return S<I}function my(S,I){var B=-1,se=Ao(S)?Et(S.length):[];return bf(S,function(ge,Ie,ze){se[++B]=I(ge,Ie,ze)}),se}function kx(S){var I=Cy(S);return I.length==1&&I[0][2]?C6(I[0][0],I[0][1]):function(B){return B===S||Px(B,S,I)}}function o0(S,I){return Kx(S)&&b6(I)?C6(Pl(S),I):function(B){var se=OA(B,S);return se===i&&se===I?SS(B,S):a0(I,se,N|O)}}function Uw(S,I,B,se,ge){S!==I&&Ax(I,function(Ie,ze){if(ge||(ge=new Ec),ps(Ie))TB(S,I,ze,B,Uw,se,ge);else{var Ye=se?se(Zx(S,ze),Ie,ze+"",S,I,ge):i;Ye===i&&(Ye=Ie),uy(S,ze,Ye)}},Zo)}function TB(S,I,B,se,ge,Ie,ze){var Ye=Zx(S,B),ct=Zx(I,B),jt=ze.get(ct);if(jt){uy(S,B,jt);return}var Ft=Ie?Ie(Ye,ct,B+"",S,I,ze):i,Yt=Ft===i;if(Yt){var yn=ui(ct),Pn=!yn&&ld(ct),qn=!yn&&!Pn&&g0(ct);Ft=ct,yn||Pn||qn?ui(Ye)?Ft=Ye:Ds(Ye)?Ft=Jo(Ye):Pn?(Yt=!1,Ft=Tf(ct,!0)):qn?(Yt=!1,Ft=Xw(ct,!0)):Ft=[]:Ly(ct)||If(ct)?(Ft=Ye,If(Ye)?Ft=wS(Ye):(!ps(Ye)||gh(Ye))&&(Ft=Ty(ct))):Yt=!1}Yt&&(ze.set(ct,Ft),ge(Ft,ct,se,Ie,ze),ze.delete(ct)),uy(S,B,Ft)}function ZP(S,I){var B=S.length;if(B)return I+=I<0?B:0,cu(I,B)?S[I]:i}function e6(S,I,B){I.length?I=ss(I,function(Ie){return ui(Ie)?function(ze){return Zp(ze,Ie.length===1?Ie[0]:Ie)}:Ie}):I=[el];var se=-1;I=ss(I,Rl(Xn()));var ge=my(S,function(Ie,ze,Ye){var ct=ss(I,function(jt){return jt(Ie)});return{criteria:ct,index:++se,value:Ie}});return xF(ge,function(Ie,ze){return NB(Ie,ze,B)})}function Fw(S,I){return t6(S,I,function(B,se){return SS(S,se)})}function t6(S,I,B){for(var se=-1,ge=I.length,Ie={};++se<ge;){var ze=I[se],Ye=Zp(S,ze);B(Ye,ze)&&vy(Ie,Ol(ze,S),Ye)}return Ie}function n6(S){return function(I){return Zp(I,S)}}function gy(S,I,B,se){var ge=se?gx:Yg,Ie=-1,ze=I.length,Ye=S;for(S===I&&(I=Jo(I)),B&&(Ye=ss(S,Rl(B)));++Ie<ze;)for(var ct=0,jt=I[Ie],Ft=B?B(jt):jt;(ct=ge(Ye,Ft,ct,se))>-1;)Ye!==S&&ey.call(Ye,ct,1),ey.call(S,ct,1);return S}function Bw(S,I){for(var B=S?I.length:0,se=B-1;B--;){var ge=I[B];if(B==se||ge!==Ie){var Ie=ge;cu(ge)?ey.call(S,ge,1):yy(S,ge)}}return S}function Mx(S,I){return S+ny(kP()*(I-S+1))}function RB(S,I,B,se){for(var ge=-1,Ie=ia(ty((I-S)/(B||1)),0),ze=Et(Ie);Ie--;)ze[se?Ie:++ge]=S,S+=B;return ze}function jx(S,I){var B="";if(!S||I<1||I>fe)return B;do I%2&&(B+=S),I=ny(I/2),I&&(S+=S);while(I);return B}function Oi(S,I){return iS(x6(S,I,el),S+"")}function xB(S){return Lw(dm(S))}function Vw(S,I){var B=dm(S);return Ry(B,Jp(I,0,B.length))}function vy(S,I,B,se){if(!ps(S))return S;I=Ol(I,S);for(var ge=-1,Ie=I.length,ze=Ie-1,Ye=S;Ye!=null&&++ge<Ie;){var ct=Pl(I[ge]),jt=B;if(ct==="__proto__"||ct==="constructor"||ct==="prototype")return S;if(ge!=ze){var Ft=Ye[ct];jt=se?se(Ft,ct,Ye):i,jt===i&&(jt=ps(Ft)?Ft:cu(I[ge+1])?[]:{})}r0(Ye,ct,jt),Ye=Ye[ct]}return S}var tm=Iw?function(S,I){return Iw.set(S,I),S}:el,Ux=xw?function(S,I){return xw(S,"toString",{configurable:!0,enumerable:!1,value:VA(I),writable:!0})}:el;function zw(S){return Ry(dm(S))}function Xa(S,I,B){var se=-1,ge=S.length;I<0&&(I=-I>ge?0:ge+I),B=B>ge?ge:B,B<0&&(B+=ge),ge=I>B?0:B-I>>>0,I>>>=0;for(var Ie=Et(ge);++se<ge;)Ie[se]=S[se+I];return Ie}function Hw(S,I){var B;return bf(S,function(se,ge,Ie){return B=I(se,ge,Ie),!B}),!!B}function Gw(S,I,B){var se=0,ge=S==null?se:S.length;if(typeof I=="number"&&I===I&&ge<=Ve){for(;se<ge;){var Ie=se+ge>>>1,ze=S[Ie];ze!==null&&!Dl(ze)&&(B?ze<=I:ze<I)?se=Ie+1:ge=Ie}return ge}return Ww(S,I,el,B)}function Ww(S,I,B,se){var ge=0,Ie=S==null?0:S.length;if(Ie===0)return 0;I=B(I);for(var ze=I!==I,Ye=I===null,ct=Dl(I),jt=I===i;ge<Ie;){var Ft=ny((ge+Ie)/2),Yt=B(S[Ft]),yn=Yt!==i,Pn=Yt===null,qn=Yt===Yt,Ci=Dl(Yt);if(ze)var ei=se||qn;else jt?ei=qn&&(se||yn):Ye?ei=qn&&yn&&(se||!Pn):ct?ei=qn&&yn&&!Pn&&(se||!Ci):Pn||Ci?ei=!1:ei=se?Yt<=I:Yt<I;ei?ge=Ft+1:Ie=Ft}return Ya(Ie,je)}function i6(S,I){for(var B=-1,se=S.length,ge=0,Ie=[];++B<se;){var ze=S[B],Ye=I?I(ze):ze;if(!B||!Ja(Ye,ct)){var ct=Ye;Ie[ge++]=ze===0?0:ze}}return Ie}function Fx(S){return typeof S=="number"?S:Dl(S)?Ne:+S}function Nl(S){if(typeof S=="string")return S;if(ui(S))return ss(S,Nl)+"";if(Dl(S))return jP?jP.call(S):"";var I=S+"";return I=="0"&&1/S==-Ce?"-0":I}function Cf(S,I,B){var se=-1,ge=hw,Ie=S.length,ze=!0,Ye=[],ct=Ye;if(B)ze=!1,ge=px;else if(Ie>=l){var jt=I?null:DB(S);if(jt)return vw(jt);ze=!1,ge=Xg,ct=new Xp}else ct=I?[]:Ye;e:for(;++se<Ie;){var Ft=S[se],Yt=I?I(Ft):Ft;if(Ft=B||Ft!==0?Ft:0,ze&&Yt===Yt){for(var yn=ct.length;yn--;)if(ct[yn]===Yt)continue e;I&&ct.push(Yt),Ye.push(Ft)}else ge(ct,Yt,B)||(ct!==Ye&&ct.push(Yt),Ye.push(Ft))}return Ye}function yy(S,I){return I=Ol(I,S),S=Jx(S,I),S==null||delete S[Pl(Qo(I))]}function $w(S,I,B,se){return vy(S,I,B(Zp(S,I)),se)}function Kw(S,I,B,se){for(var ge=S.length,Ie=se?ge:-1;(se?Ie--:++Ie<ge)&&I(S[Ie],Ie,S););return B?Xa(S,se?0:Ie,se?Ie+1:ge):Xa(S,se?Ie+1:0,se?ge:Ie)}function r6(S,I){var B=S;return B instanceof Fi&&(B=B.value()),mx(I,function(se,ge){return ge.func.apply(ge.thisArg,Tl([se],ge.args))},B)}function qw(S,I,B){var se=S.length;if(se<2)return se?Cf(S[0]):[];for(var ge=-1,Ie=Et(se);++ge<se;)for(var ze=S[ge],Ye=-1;++Ye<se;)Ye!=ge&&(Ie[ge]=fy(Ie[ge]||ze,S[Ye],I,B));return Cf(Na(Ie,1),I,B)}function Yw(S,I,B){for(var se=-1,ge=S.length,Ie=I.length,ze={};++se<ge;){var Ye=se<Ie?I[se]:i;B(ze,S[se],Ye)}return ze}function Bx(S){return Ds(S)?S:[]}function Sc(S){return typeof S=="function"?S:el}function Ol(S,I){return ui(S)?S:Kx(S,I)?[S]:rS(Sr(S))}var nm=Oi;function uh(S,I,B){var se=S.length;return B=B===i?se:B,!I&&B>=se?S:Xa(S,I,B)}var Vx=VF||function(S){return dr.clearTimeout(S)};function Tf(S,I){if(I)return S.slice();var B=S.length,se=Tw?Tw(B):new S.constructor(B);return S.copy(se),se}function _y(S){var I=new S.constructor(S.byteLength);return new Cw(I).set(new Cw(S)),I}function AB(S,I){var B=I?_y(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.byteLength)}function s6(S){var I=new S.constructor(S.source,Ka.exec(S));return I.lastIndex=S.lastIndex,I}function IB(S){return qp?Dr(qp.call(S)):{}}function Xw(S,I){var B=I?_y(S.buffer):S.buffer;return new S.constructor(B,S.byteOffset,S.length)}function zx(S,I){if(S!==I){var B=S!==i,se=S===null,ge=S===S,Ie=Dl(S),ze=I!==i,Ye=I===null,ct=I===I,jt=Dl(I);if(!Ye&&!jt&&!Ie&&S>I||Ie&&ze&&ct&&!Ye&&!jt||se&&ze&&ct||!B&&ct||!ge)return 1;if(!se&&!Ie&&!jt&&S<I||jt&&B&&ge&&!se&&!Ie||Ye&&B&&ge||!ze&&ge||!ct)return-1}return 0}function NB(S,I,B){for(var se=-1,ge=S.criteria,Ie=I.criteria,ze=ge.length,Ye=B.length;++se<ze;){var ct=zx(ge[se],Ie[se]);if(ct){if(se>=Ye)return ct;var jt=B[se];return ct*(jt=="desc"?-1:1)}}return S.index-I.index}function hh(S,I,B,se){for(var ge=-1,Ie=S.length,ze=B.length,Ye=-1,ct=I.length,jt=ia(Ie-ze,0),Ft=Et(ct+jt),Yt=!se;++Ye<ct;)Ft[Ye]=I[Ye];for(;++ge<ze;)(Yt||ge<Ie)&&(Ft[B[ge]]=S[ge]);for(;jt--;)Ft[Ye++]=S[ge++];return Ft}function a6(S,I,B,se){for(var ge=-1,Ie=S.length,ze=-1,Ye=B.length,ct=-1,jt=I.length,Ft=ia(Ie-Ye,0),Yt=Et(Ft+jt),yn=!se;++ge<Ft;)Yt[ge]=S[ge];for(var Pn=ge;++ct<jt;)Yt[Pn+ct]=I[ct];for(;++ze<Ye;)(yn||ge<Ie)&&(Yt[Pn+B[ze]]=S[ge++]);return Yt}function Jo(S,I){var B=-1,se=S.length;for(I||(I=Et(se));++B<se;)I[B]=S[B];return I}function lu(S,I,B,se){var ge=!B;B||(B={});for(var Ie=-1,ze=I.length;++Ie<ze;){var Ye=I[Ie],ct=se?se(B[Ye],S[Ye],Ye,B,S):i;ct===i&&(ct=S[Ye]),ge?dh(B,Ye,ct):r0(B,Ye,ct)}return B}function OB(S,I){return lu(S,nS(S),I)}function o6(S,I){return lu(S,E6(S),I)}function Jw(S,I){return function(B,se){var ge=ui(B)?CF:Dw,Ie=I?I():{};return ge(B,S,Xn(se,2),Ie)}}function Rf(S){return Oi(function(I,B){var se=-1,ge=B.length,Ie=ge>1?B[ge-1]:i,ze=ge>2?B[2]:i;for(Ie=S.length>3&&typeof Ie=="function"?(ge--,Ie):i,ze&&xo(B[0],B[1],ze)&&(Ie=ge<3?i:Ie,ge=1),I=Dr(I);++se<ge;){var Ye=B[se];Ye&&S(I,Ye,se,Ie)}return I})}function Hx(S,I){return function(B,se){if(B==null)return B;if(!Ao(B))return S(B,se);for(var ge=B.length,Ie=I?ge:-1,ze=Dr(B);(I?Ie--:++Ie<ge)&&se(ze[Ie],Ie,ze)!==!1;);return B}}function l6(S){return function(I,B,se){for(var ge=-1,Ie=Dr(I),ze=se(I),Ye=ze.length;Ye--;){var ct=ze[S?Ye:++ge];if(B(Ie[ct],ct,Ie)===!1)break}return I}}function c6(S,I,B){var se=I&D,ge=Ey(S);function Ie(){var ze=this&&this!==dr&&this instanceof Ie?ge:S;return ze.apply(se?B:this,arguments)}return Ie}function d6(S){return function(I){I=Sr(I);var B=Jg(I)?sd(I):i,se=B?B[0]:I.charAt(0),ge=B?uh(B,1).join(""):I.slice(1);return se[S]()+ge}}function l0(S){return function(I){return mx(JL(FA(I).replace(pF,"")),S,"")}}function Ey(S){return function(){var I=arguments;switch(I.length){case 0:return new S;case 1:return new S(I[0]);case 2:return new S(I[0],I[1]);case 3:return new S(I[0],I[1],I[2]);case 4:return new S(I[0],I[1],I[2],I[3]);case 5:return new S(I[0],I[1],I[2],I[3],I[4]);case 6:return new S(I[0],I[1],I[2],I[3],I[4],I[5]);case 7:return new S(I[0],I[1],I[2],I[3],I[4],I[5],I[6])}var B=i0(S.prototype),se=S.apply(B,I);return ps(se)?se:B}}function PB(S,I,B){var se=Ey(S);function ge(){for(var Ie=arguments.length,ze=Et(Ie),Ye=Ie,ct=rm(ge);Ye--;)ze[Ye]=arguments[Ye];var jt=Ie<3&&ze[0]!==ct&&ze[Ie-1]!==ct?[]:su(ze,ct);if(Ie-=jt.length,Ie<B)return p6(S,I,Qw,ge.placeholder,i,ze,jt,i,i,B-Ie);var Ft=this&&this!==dr&&this instanceof ge?se:S;return Cl(Ft,this,ze)}return ge}function u6(S){return function(I,B,se){var ge=Dr(I);if(!Ao(I)){var Ie=Xn(B,3);I=Ea(I),B=function(Ye){return Ie(ge[Ye],Ye,ge)}}var ze=S(I,B,se);return ze>-1?ge[Ie?I[ze]:ze]:i}}function h6(S){return ph(function(I){var B=I.length,se=B,ge=Il.prototype.thru;for(S&&I.reverse();se--;){var Ie=I[se];if(typeof Ie!="function")throw new yc(u);if(ge&&!ze&&im(Ie)=="wrapper")var ze=new Il([],!0)}for(se=ze?se:B;++se<B;){Ie=I[se];var Ye=im(Ie),ct=Ye=="wrapper"?tS(Ie):i;ct&&Yx(ct[0])&&ct[1]==(Q|M|H|Y)&&!ct[4].length&&ct[9]==1?ze=ze[im(ct[0])].apply(ze,ct[3]):ze=Ie.length==1&&Yx(Ie)?ze[Ye]():ze.thru(Ie)}return function(){var jt=arguments,Ft=jt[0];if(ze&&jt.length==1&&ui(Ft))return ze.plant(Ft).value();for(var Yt=0,yn=B?I[Yt].apply(this,jt):Ft;++Yt<B;)yn=I[Yt].call(this,yn);return yn}})}function Qw(S,I,B,se,ge,Ie,ze,Ye,ct,jt){var Ft=I&Q,Yt=I&D,yn=I&P,Pn=I&(M|V),qn=I&le,Ci=yn?i:Ey(S);function ei(){for(var Bi=arguments.length,Yi=Et(Bi),nl=Bi;nl--;)Yi[nl]=arguments[nl];if(Pn)var Qa=rm(ei),Gs=AF(Yi,Qa);if(se&&(Yi=hh(Yi,se,ge,Pn)),Ie&&(Yi=a6(Yi,Ie,ze,Pn)),Bi-=Gs,Pn&&Bi<jt){var Cs=su(Yi,Qa);return p6(S,I,Qw,ei.placeholder,B,Yi,Cs,Ye,ct,jt-Bi)}var cd=Yt?B:this,yh=yn?cd[S]:S;return Bi=Yi.length,Ye?Yi=Qx(Yi,Ye):qn&&Bi>1&&Yi.reverse(),Ft&&ct<Bi&&(Yi.length=ct),this&&this!==dr&&this instanceof ei&&(yh=Ci||Ey(yh)),yh.apply(cd,Yi)}return ei}function Gx(S,I){return function(B,se){return _B(B,S,I(se),{})}}function od(S,I){return function(B,se){var ge;if(B===i&&se===i)return I;if(B!==i&&(ge=B),se!==i){if(ge===i)return se;typeof B=="string"||typeof se=="string"?(B=Nl(B),se=Nl(se)):(B=Fx(B),se=Fx(se)),ge=S(B,se)}return ge}}function Wx(S){return ph(function(I){return I=ss(I,Rl(Xn())),Oi(function(B){var se=this;return S(I,function(ge){return Cl(ge,se,B)})})})}function Zw(S,I){I=I===i?" ":Nl(I);var B=I.length;if(B<2)return B?jx(I,S):I;var se=jx(I,ty(S/Qg(I)));return Jg(I)?uh(sd(se),0,S).join(""):se.slice(0,S)}function LB(S,I,B,se){var ge=I&D,Ie=Ey(S);function ze(){for(var Ye=-1,ct=arguments.length,jt=-1,Ft=se.length,Yt=Et(Ft+ct),yn=this&&this!==dr&&this instanceof ze?Ie:S;++jt<Ft;)Yt[jt]=se[jt];for(;ct--;)Yt[jt++]=arguments[++Ye];return Cl(yn,ge?B:this,Yt)}return ze}function f6(S){return function(I,B,se){return se&&typeof se!="number"&&xo(I,B,se)&&(B=se=i),I=vh(I),B===i?(B=I,I=0):B=vh(B),se=se===i?I<B?1:-1:vh(se),RB(I,B,se,S)}}function eS(S){return function(I,B){return typeof I=="string"&&typeof B=="string"||(I=bc(I),B=bc(B)),S(I,B)}}function p6(S,I,B,se,ge,Ie,ze,Ye,ct,jt){var Ft=I&M,Yt=Ft?ze:i,yn=Ft?i:ze,Pn=Ft?Ie:i,qn=Ft?i:Ie;I|=Ft?H:$,I&=~(Ft?$:H),I&j||(I&=~(D|P));var Ci=[S,I,ge,Pn,Yt,qn,yn,Ye,ct,jt],ei=B.apply(i,Ci);return Yx(S)&&A6(ei,Ci),ei.placeholder=se,u0(ei,S,I)}function wy(S){var I=na[S];return function(B,se){if(B=bc(B),se=se==null?0:Ya(wi(se),292),se&&LP(B)){var ge=(Sr(B)+"e").split("e"),Ie=I(ge[0]+"e"+(+ge[1]+se));return ge=(Sr(Ie)+"e").split("e"),+(ge[0]+"e"+(+ge[1]-se))}return I(B)}}var DB=t0&&1/vw(new t0([,-0]))[1]==Ce?function(S){return new t0(S)}:_0;function m6(S){return function(I){var B=Oa(I);return B==Xt?Ex(I):B==it?LF(I):lh(I,S(I))}}function fh(S,I,B,se,ge,Ie,ze,Ye){var ct=I&P;if(!ct&&typeof S!="function")throw new yc(u);var jt=se?se.length:0;if(jt||(I&=~(H|$),se=ge=i),ze=ze===i?ze:ia(wi(ze),0),Ye=Ye===i?Ye:wi(Ye),jt-=ge?ge.length:0,I&$){var Ft=se,Yt=ge;se=ge=i}var yn=ct?i:tS(S),Pn=[S,I,B,se,ge,Ft,Yt,Ie,ze,Ye];if(yn&&HB(Pn,yn),S=Pn[0],I=Pn[1],B=Pn[2],se=Pn[3],ge=Pn[4],Ye=Pn[9]=Pn[9]===i?ct?0:S.length:ia(Pn[9]-jt,0),!Ye&&I&(M|V)&&(I&=~(M|V)),!I||I==D)var qn=c6(S,I,B);else I==M||I==V?qn=PB(S,I,Ye):(I==H||I==(D|H))&&!ge.length?qn=LB(S,I,B,se):qn=Qw.apply(i,Pn);var Ci=yn?tm:A6;return u0(Ci(qn,Pn),S,I)}function g6(S,I,B,se){return S===i||Ja(S,e0[B])&&!Tr.call(se,B)?I:S}function v6(S,I,B,se,ge,Ie){return ps(S)&&ps(I)&&(Ie.set(I,S),Uw(S,I,i,v6,Ie),Ie.delete(I)),S}function kB(S){return Ly(S)?i:S}function $x(S,I,B,se,ge,Ie){var ze=B&N,Ye=S.length,ct=I.length;if(Ye!=ct&&!(ze&&ct>Ye))return!1;var jt=Ie.get(S),Ft=Ie.get(I);if(jt&&Ft)return jt==I&&Ft==S;var Yt=-1,yn=!0,Pn=B&O?new Xp:i;for(Ie.set(S,I),Ie.set(I,S);++Yt<Ye;){var qn=S[Yt],Ci=I[Yt];if(se)var ei=ze?se(Ci,qn,Yt,I,S,Ie):se(qn,Ci,Yt,S,I,Ie);if(ei!==i){if(ei)continue;yn=!1;break}if(Pn){if(!fw(I,function(Bi,Yi){if(!Xg(Pn,Yi)&&(qn===Bi||ge(qn,Bi,B,se,Ie)))return Pn.push(Yi)})){yn=!1;break}}else if(!(qn===Ci||ge(qn,Ci,B,se,Ie))){yn=!1;break}}return Ie.delete(S),Ie.delete(I),yn}function y6(S,I,B,se,ge,Ie,ze){switch(B){case un:if(S.byteLength!=I.byteLength||S.byteOffset!=I.byteOffset)return!1;S=S.buffer,I=I.buffer;case tn:return!(S.byteLength!=I.byteLength||!Ie(new Cw(S),new Cw(I)));case Ge:case rt:case Ht:return Ja(+S,+I);case Ze:return S.name==I.name&&S.message==I.message;case dt:case Me:return S==I+"";case Xt:var Ye=Ex;case it:var ct=se&N;if(Ye||(Ye=vw),S.size!=I.size&&!ct)return!1;var jt=ze.get(S);if(jt)return jt==I;se|=O,ze.set(S,I);var Ft=$x(Ye(S),Ye(I),se,ge,Ie,ze);return ze.delete(S),Ft;case We:if(qp)return qp.call(S)==qp.call(I)}return!1}function MB(S,I,B,se,ge,Ie){var ze=B&N,Ye=c0(S),ct=Ye.length,jt=c0(I),Ft=jt.length;if(ct!=Ft&&!ze)return!1;for(var Yt=ct;Yt--;){var yn=Ye[Yt];if(!(ze?yn in I:Tr.call(I,yn)))return!1}var Pn=Ie.get(S),qn=Ie.get(I);if(Pn&&qn)return Pn==I&&qn==S;var Ci=!0;Ie.set(S,I),Ie.set(I,S);for(var ei=ze;++Yt<ct;){yn=Ye[Yt];var Bi=S[yn],Yi=I[yn];if(se)var nl=ze?se(Yi,Bi,yn,I,S,Ie):se(Bi,Yi,yn,S,I,Ie);if(!(nl===i?Bi===Yi||ge(Bi,Yi,B,se,Ie):nl)){Ci=!1;break}ei||(ei=yn=="constructor")}if(Ci&&!ei){var Qa=S.constructor,Gs=I.constructor;Qa!=Gs&&"constructor"in S&&"constructor"in I&&!(typeof Qa=="function"&&Qa instanceof Qa&&typeof Gs=="function"&&Gs instanceof Gs)&&(Ci=!1)}return Ie.delete(S),Ie.delete(I),Ci}function ph(S){return iS(x6(S,i,L6),S+"")}function c0(S){return $P(S,Ea,nS)}function Sy(S){return $P(S,Zo,E6)}var tS=Iw?function(S){return Iw.get(S)}:_0;function im(S){for(var I=S.name+"",B=n0[I],se=Tr.call(n0,I)?B.length:0;se--;){var ge=B[se],Ie=ge.func;if(Ie==null||Ie==S)return ge.name}return I}function rm(S){var I=Tr.call(be,"placeholder")?be:S;return I.placeholder}function Xn(){var S=be.iteratee||ks;return S=S===ks?JP:S,arguments.length?S(arguments[0],arguments[1]):S}function by(S,I){var B=S.__data__;return qx(I)?B[typeof I=="string"?"string":"hash"]:B.map}function Cy(S){for(var I=Ea(S),B=I.length;B--;){var se=I[B],ge=S[se];I[B]=[se,ge,b6(ge)]}return I}function sm(S,I){var B=OF(S,I);return YP(B)?B:i}function _6(S){var I=Tr.call(S,Al),B=S[Al];try{S[Al]=i;var se=!0}catch{}var ge=ww.call(S);return se&&(I?S[Al]=B:delete S[Al]),ge}var nS=iy?function(S){return S==null?[]:(S=Dr(S),Ef(iy(S),function(I){return _c.call(S,I)}))}:$A,E6=iy?function(S){for(var I=[];S;)Tl(I,nS(S)),S=Rw(S);return I}:$A,Oa=_a;(ry&&Oa(new ry(new ArrayBuffer(1)))!=un||sy&&Oa(new sy)!=Xt||ay&&Oa(ay.resolve())!=xt||t0&&Oa(new t0)!=it||oy&&Oa(new oy)!=St)&&(Oa=function(S){var I=_a(S),B=I==It?S.constructor:i,se=B?om(B):"";if(se)switch(se){case GF:return un;case WF:return Xt;case $F:return xt;case KF:return it;case Nw:return St}return I});function w6(S,I,B){for(var se=-1,ge=B.length;++se<ge;){var Ie=B[se],ze=Ie.size;switch(Ie.type){case"drop":S+=ze;break;case"dropRight":I-=ze;break;case"take":I=Ya(I,S+ze);break;case"takeRight":S=ia(S,I-ze);break}}return{start:S,end:I}}function jB(S){var I=S.match(Sl);return I?I[1].split(mc):[]}function S6(S,I,B){I=Ol(I,S);for(var se=-1,ge=I.length,Ie=!1;++se<ge;){var ze=Pl(I[se]);if(!(Ie=S!=null&&B(S,ze)))break;S=S[ze]}return Ie||++se!=ge?Ie:(ge=S==null?0:S.length,!!ge&&_S(ge)&&cu(ze,ge)&&(ui(S)||If(S)))}function UB(S){var I=S.length,B=new S.constructor(I);return I&&typeof S[0]=="string"&&Tr.call(S,"index")&&(B.index=S.index,B.input=S.input),B}function Ty(S){return typeof S.constructor=="function"&&!d0(S)?i0(Rw(S)):{}}function FB(S,I,B){var se=S.constructor;switch(I){case tn:return _y(S);case Ge:case rt:return new se(+S);case un:return AB(S,B);case an:case ye:case J:case ne:case Se:case Ue:case tt:case Te:case Pe:return Xw(S,B);case Xt:return new se;case Ht:case Me:return new se(S);case dt:return s6(S);case it:return new se;case We:return IB(S)}}function BB(S,I){var B=I.length;if(!B)return S;var se=B-1;return I[se]=(B>1?"& ":"")+I[se],I=I.join(B>2?", ":" "),S.replace(Ia,`{
/* [wrapped with `+I+`] */
`)}function VB(S){return ui(S)||If(S)||!!(Cx&&S&&S[Cx])}function cu(S,I){var B=typeof S;return I=I??fe,!!I&&(B=="number"||B!="symbol"&&sx.test(S))&&S>-1&&S%1==0&&S<I}function xo(S,I,B){if(!ps(B))return!1;var se=typeof I;return(se=="number"?Ao(B)&&cu(I,B.length):se=="string"&&I in B)?Ja(B[I],S):!1}function Kx(S,I){if(ui(S))return!1;var B=typeof S;return B=="number"||B=="symbol"||B=="boolean"||S==null||Dl(S)?!0:Kn.test(S)||!mn.test(S)||I!=null&&S in Dr(I)}function qx(S){var I=typeof S;return I=="string"||I=="number"||I=="symbol"||I=="boolean"?S!=="__proto__":S===null}function Yx(S){var I=im(S),B=be[I];if(typeof B!="function"||!(I in Fi.prototype))return!1;if(S===B)return!0;var se=tS(B);return!!se&&S===se[0]}function Xx(S){return!!NP&&NP in S}var zB=_w?gh:KA;function d0(S){var I=S&&S.constructor,B=typeof I=="function"&&I.prototype||e0;return S===B}function b6(S){return S===S&&!ps(S)}function C6(S,I){return function(B){return B==null?!1:B[S]===I&&(I!==i||S in Dr(B))}}function T6(S){var I=mS(S,function(se){return B.size===_&&B.clear(),se}),B=I.cache;return I}function HB(S,I){var B=S[1],se=I[1],ge=B|se,Ie=ge<(D|P|Q),ze=se==Q&&B==M||se==Q&&B==Y&&S[7].length<=I[8]||se==(Q|Y)&&I[7].length<=I[8]&&B==M;if(!(Ie||ze))return S;se&D&&(S[2]=I[2],ge|=B&D?0:j);var Ye=I[3];if(Ye){var ct=S[3];S[3]=ct?hh(ct,Ye,I[4]):Ye,S[4]=ct?su(S[3],y):I[4]}return Ye=I[5],Ye&&(ct=S[5],S[5]=ct?a6(ct,Ye,I[6]):Ye,S[6]=ct?su(S[5],y):I[6]),Ye=I[7],Ye&&(S[7]=Ye),se&Q&&(S[8]=S[8]==null?I[8]:Ya(S[8],I[8])),S[9]==null&&(S[9]=I[9]),S[0]=I[0],S[1]=ge,S}function GB(S){var I=[];if(S!=null)for(var B in Dr(S))I.push(B);return I}function R6(S){return ww.call(S)}function x6(S,I,B){return I=ia(I===i?S.length-1:I,0),function(){for(var se=arguments,ge=-1,Ie=ia(se.length-I,0),ze=Et(Ie);++ge<Ie;)ze[ge]=se[I+ge];ge=-1;for(var Ye=Et(I+1);++ge<I;)Ye[ge]=se[ge];return Ye[I]=B(ze),Cl(S,this,Ye)}}function Jx(S,I){return I.length<2?S:Zp(S,Xa(I,0,-1))}function Qx(S,I){for(var B=S.length,se=Ya(I.length,B),ge=Jo(S);se--;){var Ie=I[se];S[se]=cu(Ie,B)?ge[Ie]:i}return S}function Zx(S,I){if(!(I==="constructor"&&typeof S[I]=="function")&&I!="__proto__")return S[I]}var A6=am(tm),mh=Tx||function(S,I){return dr.setTimeout(S,I)},iS=am(Ux);function u0(S,I,B){var se=I+"";return iS(S,BB(se,WB(jB(se),B)))}function am(S){var I=0,B=0;return function(){var se=zF(),ge=G-(se-B);if(B=se,ge>0){if(++I>=de)return arguments[0]}else I=0;return S.apply(i,arguments)}}function Ry(S,I){var B=-1,se=S.length,ge=se-1;for(I=I===i?se:I;++B<I;){var Ie=Mx(B,ge),ze=S[Ie];S[Ie]=S[B],S[B]=ze}return S.length=I,S}var rS=T6(function(S){var I=[];return S.charCodeAt(0)===46&&I.push(""),S.replace(Nn,function(B,se,ge,Ie){I.push(ge?Ie.replace(Fg,"$1"):se||B)}),I});function Pl(S){if(typeof S=="string"||Dl(S))return S;var I=S+"";return I=="0"&&1/S==-Ce?"-0":I}function om(S){if(S!=null){try{return Ew.call(S)}catch{}try{return S+""}catch{}}return""}function WB(S,I){return ta(Re,function(B){var se="_."+B[0];I&B[1]&&!hw(S,se)&&S.push(se)}),S.sort()}function I6(S){if(S instanceof Fi)return S.clone();var I=new Il(S.__wrapped__,S.__chain__);return I.__actions__=Jo(S.__actions__),I.__index__=S.__index__,I.__values__=S.__values__,I}function N6(S,I,B){(B?xo(S,I,B):I===i)?I=1:I=ia(wi(I),0);var se=S==null?0:S.length;if(!se||I<1)return[];for(var ge=0,Ie=0,ze=Et(ty(se/I));ge<se;)ze[Ie++]=Xa(S,ge,ge+=I);return ze}function $B(S){for(var I=-1,B=S==null?0:S.length,se=0,ge=[];++I<B;){var Ie=S[I];Ie&&(ge[se++]=Ie)}return ge}function KB(){var S=arguments.length;if(!S)return[];for(var I=Et(S-1),B=arguments[0],se=S;se--;)I[se-1]=arguments[se];return Tl(ui(B)?Jo(B):[B],Na(I,1))}var qB=Oi(function(S,I){return Ds(S)?fy(S,Na(I,1,Ds,!0)):[]}),eA=Oi(function(S,I){var B=Qo(I);return Ds(B)&&(B=i),Ds(S)?fy(S,Na(I,1,Ds,!0),Xn(B,2)):[]}),tA=Oi(function(S,I){var B=Qo(I);return Ds(B)&&(B=i),Ds(S)?fy(S,Na(I,1,Ds,!0),i,B):[]});function YB(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),Xa(S,I<0?0:I,se)):[]}function sS(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),I=se-I,Xa(S,0,I<0?0:I)):[]}function O6(S,I){return S&&S.length?Kw(S,Xn(I,3),!0,!0):[]}function Ll(S,I){return S&&S.length?Kw(S,Xn(I,3),!0):[]}function XB(S,I,B,se){var ge=S==null?0:S.length;return ge?(B&&typeof B!="number"&&xo(S,I,B)&&(B=0,se=ge),Qp(S,I,B,se)):[]}function P6(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=B==null?0:wi(B);return ge<0&&(ge=ia(se+ge,0)),pw(S,Xn(I,3),ge)}function nA(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=se-1;return B!==i&&(ge=wi(B),ge=B<0?ia(se+ge,0):Ya(ge,se-1)),pw(S,Xn(I,3),ge,!0)}function L6(S){var I=S==null?0:S.length;return I?Na(S,1):[]}function D6(S){var I=S==null?0:S.length;return I?Na(S,Ce):[]}function k6(S,I){var B=S==null?0:S.length;return B?(I=I===i?1:wi(I),Na(S,I)):[]}function JB(S){for(var I=-1,B=S==null?0:S.length,se={};++I<B;){var ge=S[I];se[ge[0]]=ge[1]}return se}function iA(S){return S&&S.length?S[0]:i}function QB(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=B==null?0:wi(B);return ge<0&&(ge=ia(se+ge,0)),Yg(S,I,ge)}function ZB(S){var I=S==null?0:S.length;return I?Xa(S,0,-1):[]}var eV=Oi(function(S){var I=ss(S,Bx);return I.length&&I[0]===S[0]?Ox(I):[]}),rA=Oi(function(S){var I=Qo(S),B=ss(S,Bx);return I===Qo(B)?I=i:B.pop(),B.length&&B[0]===S[0]?Ox(B,Xn(I,2)):[]}),sA=Oi(function(S){var I=Qo(S),B=ss(S,Bx);return I=typeof I=="function"?I:i,I&&B.pop(),B.length&&B[0]===S[0]?Ox(B,i,I):[]});function tV(S,I){return S==null?"":DP.call(S,I)}function Qo(S){var I=S==null?0:S.length;return I?S[I-1]:i}function nV(S,I,B){var se=S==null?0:S.length;if(!se)return-1;var ge=se;return B!==i&&(ge=wi(B),ge=ge<0?ia(se+ge,0):Ya(ge,se-1)),I===I?DF(S,I,ge):pw(S,bP,ge,!0)}function M6(S,I){return S&&S.length?ZP(S,wi(I)):i}var iV=Oi(aS);function aS(S,I){return S&&S.length&&I&&I.length?gy(S,I):S}function xy(S,I,B){return S&&S.length&&I&&I.length?gy(S,I,Xn(B,2)):S}function j6(S,I,B){return S&&S.length&&I&&I.length?gy(S,I,i,B):S}var aA=ph(function(S,I){var B=S==null?0:S.length,se=kw(S,I);return Bw(S,ss(I,function(ge){return cu(ge,B)?+ge:ge}).sort(zx)),se});function oA(S,I){var B=[];if(!(S&&S.length))return B;var se=-1,ge=[],Ie=S.length;for(I=Xn(I,3);++se<Ie;){var ze=S[se];I(ze,se,S)&&(B.push(ze),ge.push(se))}return Bw(S,ge),B}function oS(S){return S==null?S:MP.call(S)}function U6(S,I,B){var se=S==null?0:S.length;return se?(B&&typeof B!="number"&&xo(S,I,B)?(I=0,B=se):(I=I==null?0:wi(I),B=B===i?se:wi(B)),Xa(S,I,B)):[]}function F6(S,I){return Gw(S,I)}function B6(S,I,B){return Ww(S,I,Xn(B,2))}function h0(S,I){var B=S==null?0:S.length;if(B){var se=Gw(S,I);if(se<B&&Ja(S[se],I))return se}return-1}function lA(S,I){return Gw(S,I,!0)}function cA(S,I,B){return Ww(S,I,Xn(B,2),!0)}function dA(S,I){var B=S==null?0:S.length;if(B){var se=Gw(S,I,!0)-1;if(Ja(S[se],I))return se}return-1}function V6(S){return S&&S.length?i6(S):[]}function z6(S,I){return S&&S.length?i6(S,Xn(I,2)):[]}function rV(S){var I=S==null?0:S.length;return I?Xa(S,1,I):[]}function sV(S,I,B){return S&&S.length?(I=B||I===i?1:wi(I),Xa(S,0,I<0?0:I)):[]}function lm(S,I,B){var se=S==null?0:S.length;return se?(I=B||I===i?1:wi(I),I=se-I,Xa(S,I<0?0:I,se)):[]}function H6(S,I){return S&&S.length?Kw(S,Xn(I,3),!1,!0):[]}function aV(S,I){return S&&S.length?Kw(S,Xn(I,3)):[]}var uA=Oi(function(S){return Cf(Na(S,1,Ds,!0))}),oV=Oi(function(S){var I=Qo(S);return Ds(I)&&(I=i),Cf(Na(S,1,Ds,!0),Xn(I,2))}),lV=Oi(function(S){var I=Qo(S);return I=typeof I=="function"?I:i,Cf(Na(S,1,Ds,!0),i,I)});function cV(S){return S&&S.length?Cf(S):[]}function dV(S,I){return S&&S.length?Cf(S,Xn(I,2)):[]}function hA(S,I){return I=typeof I=="function"?I:i,S&&S.length?Cf(S,i,I):[]}function lS(S){if(!(S&&S.length))return[];var I=0;return S=Ef(S,function(B){if(Ds(B))return I=ia(B.length,I),!0}),yx(I,function(B){return ss(S,vx(B))})}function fA(S,I){if(!(S&&S.length))return[];var B=lS(S);return I==null?B:ss(B,function(se){return Cl(I,i,se)})}var G6=Oi(function(S,I){return Ds(S)?fy(S,I):[]}),cS=Oi(function(S){return qw(Ef(S,Ds))}),W6=Oi(function(S){var I=Qo(S);return Ds(I)&&(I=i),qw(Ef(S,Ds),Xn(I,2))}),pA=Oi(function(S){var I=Qo(S);return I=typeof I=="function"?I:i,qw(Ef(S,Ds),i,I)}),dS=Oi(lS);function uS(S,I){return Yw(S||[],I||[],r0)}function uV(S,I){return Yw(S||[],I||[],vy)}var f0=Oi(function(S){var I=S.length,B=I>1?S[I-1]:i;return B=typeof B=="function"?(S.pop(),B):i,fA(S,B)});function xf(S){var I=be(S);return I.__chain__=!0,I}function $6(S,I){return I(S),S}function hS(S,I){return I(S)}var hV=ph(function(S){var I=S.length,B=I?S[0]:0,se=this.__wrapped__,ge=function(Ie){return kw(Ie,S)};return I>1||this.__actions__.length||!(se instanceof Fi)||!cu(B)?this.thru(ge):(se=se.slice(B,+B+(I?1:0)),se.__actions__.push({func:hS,args:[ge],thisArg:i}),new Il(se,this.__chain__).thru(function(Ie){return I&&!Ie.length&&Ie.push(i),Ie}))});function Ay(){return xf(this)}function fV(){return new Il(this.value(),this.__chain__)}function pV(){this.__values__===i&&(this.__values__=fL(this.value()));var S=this.__index__>=this.__values__.length,I=S?i:this.__values__[this.__index__++];return{done:S,value:I}}function mV(){return this}function gV(S){for(var I,B=this;B instanceof cy;){var se=I6(B);se.__index__=0,se.__values__=i,I?ge.__wrapped__=se:I=se;var ge=se;B=B.__wrapped__}return ge.__wrapped__=S,I}function vV(){var S=this.__wrapped__;if(S instanceof Fi){var I=S;return this.__actions__.length&&(I=new Fi(this)),I=I.reverse(),I.__actions__.push({func:hS,args:[oS],thisArg:i}),new Il(I,this.__chain__)}return this.thru(oS)}function yV(){return r6(this.__wrapped__,this.__actions__)}var mA=Jw(function(S,I,B){Tr.call(S,B)?++S[B]:dh(S,B,1)});function K6(S,I,B){var se=ui(S)?wP:mB;return B&&xo(S,I,B)&&(I=i),se(S,Xn(I,3))}function _V(S,I){var B=ui(S)?Ef:WP;return B(S,Xn(I,3))}var q6=u6(P6),Y6=u6(nA);function EV(S,I){return Na(cm(S,I),1)}function Iy(S,I){return Na(cm(S,I),Ce)}function du(S,I,B){return B=B===i?1:wi(B),Na(cm(S,I),B)}function gA(S,I){var B=ui(S)?ta:bf;return B(S,Xn(I,3))}function X6(S,I){var B=ui(S)?uw:GP;return B(S,Xn(I,3))}var wV=Jw(function(S,I,B){Tr.call(S,B)?S[B].push(I):dh(S,B,[I])});function vA(S,I,B,se){S=Ao(S)?S:dm(S),B=B&&!se?wi(B):0;var ge=S.length;return B<0&&(B=ia(ge+B,0)),ES(S)?B<=ge&&S.indexOf(I,B)>-1:!!ge&&Yg(S,I,B)>-1}var J6=Oi(function(S,I,B){var se=-1,ge=typeof I=="function",Ie=Ao(S)?Et(S.length):[];return bf(S,function(ze){Ie[++se]=ge?Cl(I,ze,B):em(ze,I,B)}),Ie}),SV=Jw(function(S,I,B){dh(S,B,I)});function cm(S,I){var B=ui(S)?ss:my;return B(S,Xn(I,3))}function Af(S,I,B,se){return S==null?[]:(ui(I)||(I=I==null?[]:[I]),B=se?i:B,ui(B)||(B=B==null?[]:[B]),e6(S,I,B))}var Ny=Jw(function(S,I,B){S[B?0:1].push(I)},function(){return[[],[]]});function bV(S,I,B){var se=ui(S)?mx:TP,ge=arguments.length<3;return se(S,Xn(I,4),B,ge,bf)}function CV(S,I,B){var se=ui(S)?qg:TP,ge=arguments.length<3;return se(S,Xn(I,4),B,ge,GP)}function TV(S,I){var B=ui(S)?Ef:WP;return B(S,gS(Xn(I,3)))}function RV(S){var I=ui(S)?Lw:xB;return I(S)}function yA(S,I,B){(B?xo(S,I,B):I===i)?I=1:I=wi(I);var se=ui(S)?xx:Vw;return se(S,I)}function xV(S){var I=ui(S)?BP:zw;return I(S)}function AV(S){if(S==null)return 0;if(Ao(S))return ES(S)?Qg(S):S.length;var I=Oa(S);return I==Xt||I==it?S.size:Lx(S).length}function IV(S,I,B){var se=ui(S)?fw:Hw;return B&&xo(S,I,B)&&(I=i),se(S,Xn(I,3))}var Q6=Oi(function(S,I){if(S==null)return[];var B=I.length;return B>1&&xo(S,I[0],I[1])?I=[]:B>2&&xo(I[0],I[1],I[2])&&(I=[I[0]]),e6(S,Na(I,1),[])}),p0=OP||function(){return dr.Date.now()};function NV(S,I){if(typeof I!="function")throw new yc(u);return S=wi(S),function(){if(--S<1)return I.apply(this,arguments)}}function Z6(S,I,B){return I=B?i:I,I=S&&I==null?S.length:I,fh(S,Q,i,i,i,i,I)}function eL(S,I){var B;if(typeof I!="function")throw new yc(u);return S=wi(S),function(){return--S>0&&(B=I.apply(this,arguments)),S<=1&&(I=i),B}}var fS=Oi(function(S,I,B){var se=D;if(B.length){var ge=su(B,rm(fS));se|=H}return fh(S,se,I,B,ge)}),pS=Oi(function(S,I,B){var se=D|P;if(B.length){var ge=su(B,rm(pS));se|=H}return fh(I,se,S,B,ge)});function _A(S,I,B){I=B?i:I;var se=fh(S,M,i,i,i,i,i,I);return se.placeholder=_A.placeholder,se}function EA(S,I,B){I=B?i:I;var se=fh(S,V,i,i,i,i,i,I);return se.placeholder=EA.placeholder,se}function Oy(S,I,B){var se,ge,Ie,ze,Ye,ct,jt=0,Ft=!1,Yt=!1,yn=!0;if(typeof S!="function")throw new yc(u);I=bc(I)||0,ps(B)&&(Ft=!!B.leading,Yt="maxWait"in B,Ie=Yt?ia(bc(B.maxWait)||0,I):Ie,yn="trailing"in B?!!B.trailing:yn);function Pn(Cs){var cd=se,yh=ge;return se=ge=i,jt=Cs,ze=S.apply(yh,cd),ze}function qn(Cs){return jt=Cs,Ye=mh(Bi,I),Ft?Pn(Cs):ze}function Ci(Cs){var cd=Cs-ct,yh=Cs-jt,s8=I-cd;return Yt?Ya(s8,Ie-yh):s8}function ei(Cs){var cd=Cs-ct,yh=Cs-jt;return ct===i||cd>=I||cd<0||Yt&&yh>=Ie}function Bi(){var Cs=p0();if(ei(Cs))return Yi(Cs);Ye=mh(Bi,Ci(Cs))}function Yi(Cs){return Ye=i,yn&&se?Pn(Cs):(se=ge=i,ze)}function nl(){Ye!==i&&Vx(Ye),jt=0,se=ct=ge=Ye=i}function Qa(){return Ye===i?ze:Yi(p0())}function Gs(){var Cs=p0(),cd=ei(Cs);if(se=arguments,ge=this,ct=Cs,cd){if(Ye===i)return qn(ct);if(Yt)return Vx(Ye),Ye=mh(Bi,I),Pn(ct)}return Ye===i&&(Ye=mh(Bi,I)),ze}return Gs.cancel=nl,Gs.flush=Qa,Gs}var tL=Oi(function(S,I){return HP(S,1,I)}),OV=Oi(function(S,I,B){return HP(S,bc(I)||0,B)});function wA(S){return fh(S,le)}function mS(S,I){if(typeof S!="function"||I!=null&&typeof I!="function")throw new yc(u);var B=function(){var se=arguments,ge=I?I.apply(this,se):se[0],Ie=B.cache;if(Ie.has(ge))return Ie.get(ge);var ze=S.apply(this,se);return B.cache=Ie.set(ge,ze)||Ie,ze};return B.cache=new(mS.Cache||ch),B}mS.Cache=ch;function gS(S){if(typeof S!="function")throw new yc(u);return function(){var I=arguments;switch(I.length){case 0:return!S.call(this);case 1:return!S.call(this,I[0]);case 2:return!S.call(this,I[0],I[1]);case 3:return!S.call(this,I[0],I[1],I[2])}return!S.apply(this,I)}}function Py(S){return eL(2,S)}var SA=nm(function(S,I){I=I.length==1&&ui(I[0])?ss(I[0],Rl(Xn())):ss(Na(I,1),Rl(Xn()));var B=I.length;return Oi(function(se){for(var ge=-1,Ie=Ya(se.length,B);++ge<Ie;)se[ge]=I[ge].call(this,se[ge]);return Cl(S,this,se)})}),vS=Oi(function(S,I){var B=su(I,rm(vS));return fh(S,H,i,I,B)}),yS=Oi(function(S,I){var B=su(I,rm(yS));return fh(S,$,i,I,B)}),bA=ph(function(S,I){return fh(S,Y,i,i,i,I)});function CA(S,I){if(typeof S!="function")throw new yc(u);return I=I===i?I:wi(I),Oi(S,I)}function PV(S,I){if(typeof S!="function")throw new yc(u);return I=I==null?0:ia(wi(I),0),Oi(function(B){var se=B[I],ge=uh(B,0,I);return se&&Tl(ge,se),Cl(S,this,ge)})}function LV(S,I,B){var se=!0,ge=!0;if(typeof S!="function")throw new yc(u);return ps(B)&&(se="leading"in B?!!B.leading:se,ge="trailing"in B?!!B.trailing:ge),Oy(S,I,{leading:se,maxWait:I,trailing:ge})}function nL(S){return Z6(S,1)}function iL(S,I){return vS(Sc(I),S)}function rL(){if(!arguments.length)return[];var S=arguments[0];return ui(S)?S:[S]}function sL(S){return wc(S,A)}function aL(S,I){return I=typeof I=="function"?I:i,wc(S,A,I)}function DV(S){return wc(S,E|A)}function oL(S,I){return I=typeof I=="function"?I:i,wc(S,E|A,I)}function kV(S,I){return I==null||zP(S,I,Ea(I))}function Ja(S,I){return S===I||S!==S&&I!==I}var m0=eS(Nx),TA=eS(function(S,I){return S>=I}),If=KP(function(){return arguments}())?KP:function(S){return bs(S)&&Tr.call(S,"callee")&&!_c.call(S,"callee")},ui=Et.isArray,MV=_P?Rl(_P):qP;function Ao(S){return S!=null&&_S(S.length)&&!gh(S)}function Ds(S){return bs(S)&&Ao(S)}function jV(S){return S===!0||S===!1||bs(S)&&_a(S)==Ge}var ld=PP||KA,UV=ow?Rl(ow):EB;function FV(S){return bs(S)&&S.nodeType===1&&!Ly(S)}function BV(S){if(S==null)return!0;if(Ao(S)&&(ui(S)||typeof S=="string"||typeof S.splice=="function"||ld(S)||g0(S)||If(S)))return!S.length;var I=Oa(S);if(I==Xt||I==it)return!S.size;if(d0(S))return!Lx(S).length;for(var B in S)if(Tr.call(S,B))return!1;return!0}function VV(S,I){return a0(S,I)}function zV(S,I,B){B=typeof B=="function"?B:i;var se=B?B(S,I):i;return se===i?a0(S,I,i,B):!!se}function RA(S){if(!bs(S))return!1;var I=_a(S);return I==Ze||I==pt||typeof S.message=="string"&&typeof S.name=="string"&&!Ly(S)}function HV(S){return typeof S=="number"&&LP(S)}function gh(S){if(!ps(S))return!1;var I=_a(S);return I==Je||I==_t||I==we||I==mt}function lL(S){return typeof S=="number"&&S==wi(S)}function _S(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=fe}function ps(S){var I=typeof S;return S!=null&&(I=="object"||I=="function")}function bs(S){return S!=null&&typeof S=="object"}var cL=EP?Rl(EP):SB;function GV(S,I){return S===I||Px(S,I,Cy(I))}function WV(S,I,B){return B=typeof B=="function"?B:i,Px(S,I,Cy(I),B)}function $V(S){return uL(S)&&S!=+S}function KV(S){if(zB(S))throw new di(d);return YP(S)}function dL(S){return S===null}function qV(S){return S==null}function uL(S){return typeof S=="number"||bs(S)&&_a(S)==Ht}function Ly(S){if(!bs(S)||_a(S)!=It)return!1;var I=Rw(S);if(I===null)return!0;var B=Tr.call(I,"constructor")&&I.constructor;return typeof B=="function"&&B instanceof B&&Ew.call(B)==Sw}var xA=lw?Rl(lw):bB;function YV(S){return lL(S)&&S>=-fe&&S<=fe}var hL=cw?Rl(cw):CB;function ES(S){return typeof S=="string"||!ui(S)&&bs(S)&&_a(S)==Me}function Dl(S){return typeof S=="symbol"||bs(S)&&_a(S)==We}var g0=dw?Rl(dw):XP;function XV(S){return S===i}function JV(S){return bs(S)&&Oa(S)==St}function QV(S){return bs(S)&&_a(S)==Lt}var ZV=eS(Dx),ez=eS(function(S,I){return S<=I});function fL(S){if(!S)return[];if(Ao(S))return ES(S)?sd(S):Jo(S);if(Sf&&S[Sf])return PF(S[Sf]());var I=Oa(S),B=I==Xt?Ex:I==it?vw:dm;return B(S)}function vh(S){if(!S)return S===0?S:0;if(S=bc(S),S===Ce||S===-Ce){var I=S<0?-1:1;return I*me}return S===S?S:0}function wi(S){var I=vh(S),B=I%1;return I===I?B?I-B:I:0}function AA(S){return S?Jp(wi(S),0,Fe):0}function bc(S){if(typeof S=="number")return S;if(Dl(S))return Ne;if(ps(S)){var I=typeof S.valueOf=="function"?S.valueOf():S;S=ps(I)?I+"":I}if(typeof S!="string")return S===0?S:+S;S=RP(S);var B=$v.test(S);return B||mf.test(S)?SF(S.slice(2),B?2:8):ew.test(S)?Ne:+S}function wS(S){return lu(S,Zo(S))}function tz(S){return S?Jp(wi(S),-fe,fe):S===0?S:0}function Sr(S){return S==null?"":Nl(S)}var nz=Rf(function(S,I){if(d0(I)||Ao(I)){lu(I,Ea(I),S);return}for(var B in I)Tr.call(I,B)&&r0(S,B,I[B])}),pL=Rf(function(S,I){lu(I,Zo(I),S)}),Dy=Rf(function(S,I,B,se){lu(I,Zo(I),S,se)}),iz=Rf(function(S,I,B,se){lu(I,Ea(I),S,se)}),IA=ph(kw);function rz(S,I){var B=i0(S);return I==null?B:s0(B,I)}var sz=Oi(function(S,I){S=Dr(S);var B=-1,se=I.length,ge=se>2?I[2]:i;for(ge&&xo(I[0],I[1],ge)&&(se=1);++B<se;)for(var Ie=I[B],ze=Zo(Ie),Ye=-1,ct=ze.length;++Ye<ct;){var jt=ze[Ye],Ft=S[jt];(Ft===i||Ja(Ft,e0[jt])&&!Tr.call(S,jt))&&(S[jt]=Ie[jt])}return S}),az=Oi(function(S){return S.push(i,v6),Cl(PA,i,S)});function oz(S,I){return SP(S,Xn(I,3),ou)}function mL(S,I){return SP(S,Xn(I,3),Mw)}function lz(S,I){return S==null?S:Ax(S,Xn(I,3),Zo)}function gL(S,I){return S==null?S:Ix(S,Xn(I,3),Zo)}function NA(S,I){return S&&ou(S,Xn(I,3))}function cz(S,I){return S&&Mw(S,Xn(I,3))}function dz(S){return S==null?[]:jw(S,Ea(S))}function vL(S){return S==null?[]:jw(S,Zo(S))}function OA(S,I,B){var se=S==null?i:Zp(S,I);return se===i?B:se}function yL(S,I){return S!=null&&S6(S,I,gB)}function SS(S,I){return S!=null&&S6(S,I,vB)}var uz=Gx(function(S,I,B){I!=null&&typeof I.toString!="function"&&(I=ww.call(I)),S[I]=B},VA(el)),hz=Gx(function(S,I,B){I!=null&&typeof I.toString!="function"&&(I=ww.call(I)),Tr.call(S,I)?S[I].push(B):S[I]=[B]},Xn),fz=Oi(em);function Ea(S){return Ao(S)?FP(S):Lx(S)}function Zo(S){return Ao(S)?FP(S,!0):QP(S)}function pz(S,I){var B={};return I=Xn(I,3),ou(S,function(se,ge,Ie){dh(B,I(se,ge,Ie),se)}),B}function mz(S,I){var B={};return I=Xn(I,3),ou(S,function(se,ge,Ie){dh(B,ge,I(se,ge,Ie))}),B}var _L=Rf(function(S,I,B){Uw(S,I,B)}),PA=Rf(function(S,I,B,se){Uw(S,I,B,se)}),LA=ph(function(S,I){var B={};if(S==null)return B;var se=!1;I=ss(I,function(Ie){return Ie=Ol(Ie,S),se||(se=Ie.length>1),Ie}),lu(S,Sy(S),B),se&&(B=wc(B,E|b|A,kB));for(var ge=I.length;ge--;)yy(B,I[ge]);return B});function EL(S,I){return kA(S,gS(Xn(I)))}var DA=ph(function(S,I){return S==null?{}:Fw(S,I)});function kA(S,I){if(S==null)return{};var B=ss(Sy(S),function(se){return[se]});return I=Xn(I),t6(S,B,function(se,ge){return I(se,ge[0])})}function Ct(S,I,B){I=Ol(I,S);var se=-1,ge=I.length;for(ge||(ge=1,S=i);++se<ge;){var Ie=S==null?i:S[Pl(I[se])];Ie===i&&(se=ge,Ie=B),S=gh(Ie)?Ie.call(S):Ie}return S}function wL(S,I,B){return S==null?S:vy(S,I,B)}function SL(S,I,B,se){return se=typeof se=="function"?se:i,S==null?S:vy(S,I,B,se)}var MA=m6(Ea),jA=m6(Zo);function bL(S,I,B){var se=ui(S),ge=se||ld(S)||g0(S);if(I=Xn(I,4),B==null){var Ie=S&&S.constructor;ge?B=se?new Ie:[]:ps(S)?B=gh(Ie)?i0(Rw(S)):{}:B={}}return(ge?ta:ou)(S,function(ze,Ye,ct){return I(B,ze,Ye,ct)}),B}function CL(S,I){return S==null?!0:yy(S,I)}function TL(S,I,B){return S==null?S:$w(S,I,Sc(B))}function RL(S,I,B,se){return se=typeof se=="function"?se:i,S==null?S:$w(S,I,Sc(B),se)}function dm(S){return S==null?[]:_x(S,Ea(S))}function UA(S){return S==null?[]:_x(S,Zo(S))}function xL(S,I,B){return B===i&&(B=I,I=i),B!==i&&(B=bc(B),B=B===B?B:0),I!==i&&(I=bc(I),I=I===I?I:0),Jp(bc(S),I,B)}function AL(S,I,B){return I=vh(I),B===i?(B=I,I=0):B=vh(B),S=bc(S),yB(S,I,B)}function IL(S,I,B){if(B&&typeof B!="boolean"&&xo(S,I,B)&&(I=B=i),B===i&&(typeof I=="boolean"?(B=I,I=i):typeof S=="boolean"&&(B=S,S=i)),S===i&&I===i?(S=0,I=1):(S=vh(S),I===i?(I=S,S=0):I=vh(I)),S>I){var se=S;S=I,I=se}if(B||S%1||I%1){var ge=kP();return Ya(S+ge*(I-S+gP("1e-"+((ge+"").length-1))),I)}return Mx(S,I)}var NL=l0(function(S,I,B){return I=I.toLowerCase(),S+(B?bS(I):I)});function bS(S){return ky(Sr(S).toLowerCase())}function FA(S){return S=Sr(S),S&&S.replace(ax,vc).replace(mF,"")}function OL(S,I,B){S=Sr(S),I=Nl(I);var se=S.length;B=B===i?se:Jp(wi(B),0,se);var ge=B;return B-=I.length,B>=0&&S.slice(B,ge)==I}function PL(S){return S=Sr(S),S&&nn.test(S)?S.replace(_n,IF):S}function LL(S){return S=Sr(S),S&&Ui.test(S)?S.replace(Tn,"\\$&"):S}var DL=l0(function(S,I,B){return S+(B?"-":"")+I.toLowerCase()}),kL=l0(function(S,I,B){return S+(B?" ":"")+I.toLowerCase()}),ML=d6("toLowerCase");function jL(S,I,B){S=Sr(S),I=wi(I);var se=I?Qg(S):0;if(!I||se>=I)return S;var ge=(I-se)/2;return Zw(ny(ge),B)+S+Zw(ty(ge),B)}function UL(S,I,B){S=Sr(S),I=wi(I);var se=I?Qg(S):0;return I&&se<I?S+Zw(I-se,B):S}function FL(S,I,B){S=Sr(S),I=wi(I);var se=I?Qg(S):0;return I&&se<I?Zw(I-se,B)+S:S}function BL(S,I,B){return B||I==null?I=0:I&&(I=+I),HF(Sr(S).replace(xr,""),I||0)}function VL(S,I,B){return(B?xo(S,I,B):I===i)?I=1:I=wi(I),jx(Sr(S),I)}function zL(){var S=arguments,I=Sr(S[0]);return S.length<3?I:I.replace(S[1],S[2])}var HL=l0(function(S,I,B){return S+(B?"_":"")+I.toLowerCase()});function GL(S,I,B){return B&&typeof B!="number"&&xo(S,I,B)&&(I=B=i),B=B===i?Fe:B>>>0,B?(S=Sr(S),S&&(typeof I=="string"||I!=null&&!xA(I))&&(I=Nl(I),!I&&Jg(S))?uh(sd(S),0,B):S.split(I,B)):[]}var WL=l0(function(S,I,B){return S+(B?" ":"")+ky(I)});function $L(S,I,B){return S=Sr(S),B=B==null?0:Jp(wi(B),0,S.length),I=Nl(I),S.slice(B,B+I.length)==I}function KL(S,I,B){var se=be.templateSettings;B&&xo(S,I,B)&&(I=i),S=Sr(S),I=Dy({},I,se,g6);var ge=Dy({},I.imports,se.imports,g6),Ie=Ea(ge),ze=_x(ge,Ie),Ye,ct,jt=0,Ft=I.interpolate||Ro,Yt="__p += '",yn=Qv((I.escape||Ro).source+"|"+Ft.source+"|"+(Ft===Jt?Bg:Ro).source+"|"+(I.evaluate||Ro).source+"|$","g"),Pn="//# sourceURL="+(Tr.call(I,"sourceURL")?(I.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_F+"]")+`
`;S.replace(yn,function(ei,Bi,Yi,nl,Qa,Gs){return Yi||(Yi=nl),Yt+=S.slice(jt,Gs).replace(ox,NF),Bi&&(Ye=!0,Yt+=`' +
__e(`+Bi+`) +
'`),Qa&&(ct=!0,Yt+=`';
`+Qa+`;
__p += '`),Yi&&(Yt+=`' +
((__t = (`+Yi+`)) == null ? '' : __t) +
'`),jt=Gs+ei.length,ei}),Yt+=`';
`;var qn=Tr.call(I,"variable")&&I.variable;if(!qn)Yt=`with (obj) {
`+Yt+`
}
`;else if(To.test(qn))throw new di(p);Yt=(ct?Yt.replace(Qe,""):Yt).replace(nt,"$1").replace($e,"$1;"),Yt="function("+(qn||"obj")+`) {
`+(qn?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Ye?", __e = _.escape":"")+(ct?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Yt+`return __p
}`;var Ci=QL(function(){return ur(Ie,Pn+"return "+Yt).apply(i,ze)});if(Ci.source=Yt,RA(Ci))throw Ci;return Ci}function qL(S){return Sr(S).toLowerCase()}function YL(S){return Sr(S).toUpperCase()}function gz(S,I,B){if(S=Sr(S),S&&(B||I===i))return RP(S);if(!S||!(I=Nl(I)))return S;var se=sd(S),ge=sd(I),Ie=gw(se,ge),ze=xP(se,ge)+1;return uh(se,Ie,ze).join("")}function vz(S,I,B){if(S=Sr(S),S&&(B||I===i))return S.slice(0,ad(S)+1);if(!S||!(I=Nl(I)))return S;var se=sd(S),ge=xP(se,sd(I))+1;return uh(se,0,ge).join("")}function BA(S,I,B){if(S=Sr(S),S&&(B||I===i))return S.replace(xr,"");if(!S||!(I=Nl(I)))return S;var se=sd(S),ge=gw(se,sd(I));return uh(se,ge).join("")}function XL(S,I){var B=ae,se=te;if(ps(I)){var ge="separator"in I?I.separator:ge;B="length"in I?wi(I.length):B,se="omission"in I?Nl(I.omission):se}S=Sr(S);var Ie=S.length;if(Jg(S)){var ze=sd(S);Ie=ze.length}if(B>=Ie)return S;var Ye=B-Qg(se);if(Ye<1)return se;var ct=ze?uh(ze,0,Ye).join(""):S.slice(0,Ye);if(ge===i)return ct+se;if(ze&&(Ye+=ct.length-Ye),xA(ge)){if(S.slice(Ye).search(ge)){var jt,Ft=ct;for(ge.global||(ge=Qv(ge.source,Sr(Ka.exec(ge))+"g")),ge.lastIndex=0;jt=ge.exec(Ft);)var Yt=jt.index;ct=ct.slice(0,Yt===i?Ye:Yt)}}else if(S.indexOf(Nl(ge),Ye)!=Ye){var yn=ct.lastIndexOf(ge);yn>-1&&(ct=ct.slice(0,yn))}return ct+se}function yz(S){return S=Sr(S),S&&Dt.test(S)?S.replace(st,kF):S}var _z=l0(function(S,I,B){return S+(B?" ":"")+I.toUpperCase()}),ky=d6("toUpperCase");function JL(S,I,B){return S=Sr(S),I=B?i:I,I===i?AP(S)?jF(S):RF(S):S.match(I)||[]}var QL=Oi(function(S,I){try{return Cl(S,i,I)}catch(B){return RA(B)?B:new di(B)}}),Ez=ph(function(S,I){return ta(I,function(B){B=Pl(B),dh(S,B,fS(S[B],S))}),S});function ZL(S){var I=S==null?0:S.length,B=Xn();return S=I?ss(S,function(se){if(typeof se[1]!="function")throw new yc(u);return[B(se[0]),se[1]]}):[],Oi(function(se){for(var ge=-1;++ge<I;){var Ie=S[ge];if(Cl(Ie[0],this,se))return Cl(Ie[1],this,se)}})}function wz(S){return VP(wc(S,E))}function VA(S){return function(){return S}}function Sz(S,I){return S==null||S!==S?I:S}var bz=h6(),zA=h6(!0);function el(S){return S}function ks(S){return JP(typeof S=="function"?S:wc(S,E))}function e8(S){return kx(wc(S,E))}function t8(S,I){return o0(S,wc(I,E))}var v0=Oi(function(S,I){return function(B){return em(B,S,I)}}),Cz=Oi(function(S,I){return function(B){return em(S,B,I)}});function y0(S,I,B){var se=Ea(I),ge=jw(I,se);B==null&&!(ps(I)&&(ge.length||!se.length))&&(B=I,I=S,S=this,ge=jw(I,Ea(I)));var Ie=!(ps(B)&&"chain"in B)||!!B.chain,ze=gh(S);return ta(ge,function(Ye){var ct=I[Ye];S[Ye]=ct,ze&&(S.prototype[Ye]=function(){var jt=this.__chain__;if(Ie||jt){var Ft=S(this.__wrapped__),Yt=Ft.__actions__=Jo(this.__actions__);return Yt.push({func:ct,args:arguments,thisArg:S}),Ft.__chain__=jt,Ft}return ct.apply(S,Tl([this.value()],arguments))})}),S}function HA(){return dr._===this&&(dr._=Zv),this}function _0(){}function CS(S){return S=wi(S),Oi(function(I){return ZP(I,S)})}var GA=Wx(ss),WA=Wx(wP),TS=Wx(fw);function My(S){return Kx(S)?vx(Pl(S)):n6(S)}function Tz(S){return function(I){return S==null?i:Zp(S,I)}}var Rz=f6(),xz=f6(!0);function $A(){return[]}function KA(){return!1}function Az(){return{}}function qA(){return""}function Iz(){return!0}function Nz(S,I){if(S=wi(S),S<1||S>fe)return[];var B=Fe,se=Ya(S,Fe);I=Xn(I),S-=Fe;for(var ge=yx(se,I);++B<S;)I(B);return ge}function tl(S){return ui(S)?ss(S,Pl):Dl(S)?[S]:Jo(rS(Sr(S)))}function n8(S){var I=++IP;return Sr(S)+I}var Oz=od(function(S,I){return S+I},0),Pz=wy("ceil"),Lz=od(function(S,I){return S/I},1),Dz=wy("floor");function RS(S){return S&&S.length?py(S,el,Nx):i}function i8(S,I){return S&&S.length?py(S,Xn(I,2),Nx):i}function kz(S){return CP(S,el)}function Mz(S,I){return CP(S,Xn(I,2))}function jz(S){return S&&S.length?py(S,el,Dx):i}function Uz(S,I){return S&&S.length?py(S,Xn(I,2),Dx):i}var YA=od(function(S,I){return S*I},1),r8=wy("round"),Fz=od(function(S,I){return S-I},0);function XA(S){return S&&S.length?mw(S,el):0}function Bz(S,I){return S&&S.length?mw(S,Xn(I,2)):0}return be.after=NV,be.ary=Z6,be.assign=nz,be.assignIn=pL,be.assignInWith=Dy,be.assignWith=iz,be.at=IA,be.before=eL,be.bind=fS,be.bindAll=Ez,be.bindKey=pS,be.castArray=rL,be.chain=xf,be.chunk=N6,be.compact=$B,be.concat=KB,be.cond=ZL,be.conforms=wz,be.constant=VA,be.countBy=mA,be.create=rz,be.curry=_A,be.curryRight=EA,be.debounce=Oy,be.defaults=sz,be.defaultsDeep=az,be.defer=tL,be.delay=OV,be.difference=qB,be.differenceBy=eA,be.differenceWith=tA,be.drop=YB,be.dropRight=sS,be.dropRightWhile=O6,be.dropWhile=Ll,be.fill=XB,be.filter=_V,be.flatMap=EV,be.flatMapDeep=Iy,be.flatMapDepth=du,be.flatten=L6,be.flattenDeep=D6,be.flattenDepth=k6,be.flip=wA,be.flow=bz,be.flowRight=zA,be.fromPairs=JB,be.functions=dz,be.functionsIn=vL,be.groupBy=wV,be.initial=ZB,be.intersection=eV,be.intersectionBy=rA,be.intersectionWith=sA,be.invert=uz,be.invertBy=hz,be.invokeMap=J6,be.iteratee=ks,be.keyBy=SV,be.keys=Ea,be.keysIn=Zo,be.map=cm,be.mapKeys=pz,be.mapValues=mz,be.matches=e8,be.matchesProperty=t8,be.memoize=mS,be.merge=_L,be.mergeWith=PA,be.method=v0,be.methodOf=Cz,be.mixin=y0,be.negate=gS,be.nthArg=CS,be.omit=LA,be.omitBy=EL,be.once=Py,be.orderBy=Af,be.over=GA,be.overArgs=SA,be.overEvery=WA,be.overSome=TS,be.partial=vS,be.partialRight=yS,be.partition=Ny,be.pick=DA,be.pickBy=kA,be.property=My,be.propertyOf=Tz,be.pull=iV,be.pullAll=aS,be.pullAllBy=xy,be.pullAllWith=j6,be.pullAt=aA,be.range=Rz,be.rangeRight=xz,be.rearg=bA,be.reject=TV,be.remove=oA,be.rest=CA,be.reverse=oS,be.sampleSize=yA,be.set=wL,be.setWith=SL,be.shuffle=xV,be.slice=U6,be.sortBy=Q6,be.sortedUniq=V6,be.sortedUniqBy=z6,be.split=GL,be.spread=PV,be.tail=rV,be.take=sV,be.takeRight=lm,be.takeRightWhile=H6,be.takeWhile=aV,be.tap=$6,be.throttle=LV,be.thru=hS,be.toArray=fL,be.toPairs=MA,be.toPairsIn=jA,be.toPath=tl,be.toPlainObject=wS,be.transform=bL,be.unary=nL,be.union=uA,be.unionBy=oV,be.unionWith=lV,be.uniq=cV,be.uniqBy=dV,be.uniqWith=hA,be.unset=CL,be.unzip=lS,be.unzipWith=fA,be.update=TL,be.updateWith=RL,be.values=dm,be.valuesIn=UA,be.without=G6,be.words=JL,be.wrap=iL,be.xor=cS,be.xorBy=W6,be.xorWith=pA,be.zip=dS,be.zipObject=uS,be.zipObjectDeep=uV,be.zipWith=f0,be.entries=MA,be.entriesIn=jA,be.extend=pL,be.extendWith=Dy,y0(be,be),be.add=Oz,be.attempt=QL,be.camelCase=NL,be.capitalize=bS,be.ceil=Pz,be.clamp=xL,be.clone=sL,be.cloneDeep=DV,be.cloneDeepWith=oL,be.cloneWith=aL,be.conformsTo=kV,be.deburr=FA,be.defaultTo=Sz,be.divide=Lz,be.endsWith=OL,be.eq=Ja,be.escape=PL,be.escapeRegExp=LL,be.every=K6,be.find=q6,be.findIndex=P6,be.findKey=oz,be.findLast=Y6,be.findLastIndex=nA,be.findLastKey=mL,be.floor=Dz,be.forEach=gA,be.forEachRight=X6,be.forIn=lz,be.forInRight=gL,be.forOwn=NA,be.forOwnRight=cz,be.get=OA,be.gt=m0,be.gte=TA,be.has=yL,be.hasIn=SS,be.head=iA,be.identity=el,be.includes=vA,be.indexOf=QB,be.inRange=AL,be.invoke=fz,be.isArguments=If,be.isArray=ui,be.isArrayBuffer=MV,be.isArrayLike=Ao,be.isArrayLikeObject=Ds,be.isBoolean=jV,be.isBuffer=ld,be.isDate=UV,be.isElement=FV,be.isEmpty=BV,be.isEqual=VV,be.isEqualWith=zV,be.isError=RA,be.isFinite=HV,be.isFunction=gh,be.isInteger=lL,be.isLength=_S,be.isMap=cL,be.isMatch=GV,be.isMatchWith=WV,be.isNaN=$V,be.isNative=KV,be.isNil=qV,be.isNull=dL,be.isNumber=uL,be.isObject=ps,be.isObjectLike=bs,be.isPlainObject=Ly,be.isRegExp=xA,be.isSafeInteger=YV,be.isSet=hL,be.isString=ES,be.isSymbol=Dl,be.isTypedArray=g0,be.isUndefined=XV,be.isWeakMap=JV,be.isWeakSet=QV,be.join=tV,be.kebabCase=DL,be.last=Qo,be.lastIndexOf=nV,be.lowerCase=kL,be.lowerFirst=ML,be.lt=ZV,be.lte=ez,be.max=RS,be.maxBy=i8,be.mean=kz,be.meanBy=Mz,be.min=jz,be.minBy=Uz,be.stubArray=$A,be.stubFalse=KA,be.stubObject=Az,be.stubString=qA,be.stubTrue=Iz,be.multiply=YA,be.nth=M6,be.noConflict=HA,be.noop=_0,be.now=p0,be.pad=jL,be.padEnd=UL,be.padStart=FL,be.parseInt=BL,be.random=IL,be.reduce=bV,be.reduceRight=CV,be.repeat=VL,be.replace=zL,be.result=Ct,be.round=r8,be.runInContext=ot,be.sample=RV,be.size=AV,be.snakeCase=HL,be.some=IV,be.sortedIndex=F6,be.sortedIndexBy=B6,be.sortedIndexOf=h0,be.sortedLastIndex=lA,be.sortedLastIndexBy=cA,be.sortedLastIndexOf=dA,be.startCase=WL,be.startsWith=$L,be.subtract=Fz,be.sum=XA,be.sumBy=Bz,be.template=KL,be.times=Nz,be.toFinite=vh,be.toInteger=wi,be.toLength=AA,be.toLower=qL,be.toNumber=bc,be.toSafeInteger=tz,be.toString=Sr,be.toUpper=YL,be.trim=gz,be.trimEnd=vz,be.trimStart=BA,be.truncate=XL,be.unescape=yz,be.uniqueId=n8,be.upperCase=_z,be.upperFirst=ky,be.each=gA,be.eachRight=X6,be.first=iA,y0(be,function(){var S={};return ou(be,function(I,B){Tr.call(be.prototype,B)||(S[B]=I)}),S}(),{chain:!1}),be.VERSION=s,ta(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){be[S].placeholder=be}),ta(["drop","take"],function(S,I){Fi.prototype[S]=function(B){B=B===i?1:ia(wi(B),0);var se=this.__filtered__&&!I?new Fi(this):this.clone();return se.__filtered__?se.__takeCount__=Ya(B,se.__takeCount__):se.__views__.push({size:Ya(B,Fe),type:S+(se.__dir__<0?"Right":"")}),se},Fi.prototype[S+"Right"]=function(B){return this.reverse()[S](B).reverse()}}),ta(["filter","map","takeWhile"],function(S,I){var B=I+1,se=B==ie||B==he;Fi.prototype[S]=function(ge){var Ie=this.clone();return Ie.__iteratees__.push({iteratee:Xn(ge,3),type:B}),Ie.__filtered__=Ie.__filtered__||se,Ie}}),ta(["head","last"],function(S,I){var B="take"+(I?"Right":"");Fi.prototype[S]=function(){return this[B](1).value()[0]}}),ta(["initial","tail"],function(S,I){var B="drop"+(I?"":"Right");Fi.prototype[S]=function(){return this.__filtered__?new Fi(this):this[B](1)}}),Fi.prototype.compact=function(){return this.filter(el)},Fi.prototype.find=function(S){return this.filter(S).head()},Fi.prototype.findLast=function(S){return this.reverse().find(S)},Fi.prototype.invokeMap=Oi(function(S,I){return typeof S=="function"?new Fi(this):this.map(function(B){return em(B,S,I)})}),Fi.prototype.reject=function(S){return this.filter(gS(Xn(S)))},Fi.prototype.slice=function(S,I){S=wi(S);var B=this;return B.__filtered__&&(S>0||I<0)?new Fi(B):(S<0?B=B.takeRight(-S):S&&(B=B.drop(S)),I!==i&&(I=wi(I),B=I<0?B.dropRight(-I):B.take(I-S)),B)},Fi.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},Fi.prototype.toArray=function(){return this.take(Fe)},ou(Fi.prototype,function(S,I){var B=/^(?:filter|find|map|reject)|While$/.test(I),se=/^(?:head|last)$/.test(I),ge=be[se?"take"+(I=="last"?"Right":""):I],Ie=se||/^find/.test(I);ge&&(be.prototype[I]=function(){var ze=this.__wrapped__,Ye=se?[1]:arguments,ct=ze instanceof Fi,jt=Ye[0],Ft=ct||ui(ze),Yt=function(Bi){var Yi=ge.apply(be,Tl([Bi],Ye));return se&&yn?Yi[0]:Yi};Ft&&B&&typeof jt=="function"&&jt.length!=1&&(ct=Ft=!1);var yn=this.__chain__,Pn=!!this.__actions__.length,qn=Ie&&!yn,Ci=ct&&!Pn;if(!Ie&&Ft){ze=Ci?ze:new Fi(this);var ei=S.apply(ze,Ye);return ei.__actions__.push({func:hS,args:[Yt],thisArg:i}),new Il(ei,yn)}return qn&&Ci?S.apply(this,Ye):(ei=this.thru(Yt),qn?se?ei.value()[0]:ei.value():ei)})}),ta(["pop","push","shift","sort","splice","unshift"],function(S){var I=Tt[S],B=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",se=/^(?:pop|shift)$/.test(S);be.prototype[S]=function(){var ge=arguments;if(se&&!this.__chain__){var Ie=this.value();return I.apply(ui(Ie)?Ie:[],ge)}return this[B](function(ze){return I.apply(ui(ze)?ze:[],ge)})}}),ou(Fi.prototype,function(S,I){var B=be[I];if(B){var se=B.name+"";Tr.call(n0,se)||(n0[se]=[]),n0[se].push({name:I,func:B})}}),n0[Qw(i,P).name]=[{name:"wrapper",func:i}],Fi.prototype.clone=qF,Fi.prototype.reverse=YF,Fi.prototype.value=dy,be.prototype.at=hV,be.prototype.chain=Ay,be.prototype.commit=fV,be.prototype.next=pV,be.prototype.plant=gV,be.prototype.reverse=vV,be.prototype.toJSON=be.prototype.valueOf=be.prototype.value=yV,be.prototype.first=be.prototype.head,Sf&&(be.prototype[Sf]=mV),be},Zg=UF();$p?(($p.exports=Zg)._=Zg,fx._=Zg):dr._=Zg}).call(Vs)})(x7,x7.exports);var tx=x7.exports;const XO=({filters:n,onSearch:t,className:i=""})=>{var p;const s=i||"",l=k.useRef(),d=()=>{l.current&&(l.current.value="",t(""))},u=tx.debounce(g=>{t(g)},500);return h.jsx("div",{className:`search-bar position-relative pb-1 ${s}`,children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-0",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:g=>{u(g.target.value)},ref:l,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off",className:"mb-"}),((p=l==null?void 0:l.current)==null?void 0:p.value.length)>0&&h.jsx(Pt,{onClick:d,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(VE,{})},"search-clear-btn")]})})};function lYe(){const n=Ii(),[t,i]=k.useState(""),s=["name","target"],l=async()=>{var b,A;try{const N=await hs.getFormQuickActions();return N.data.status==="success"?(console.log("## actionRes --",N),(A=(b=N.data)==null?void 0:b.data)==null?void 0:A.actions):null}catch{throw new Error("Error fetching quick actions")}},{isFetching:d,isPending:u,isError:p,data:g,error:_}=Qd({queryKey:["formQuickActionsQuery"],queryFn:l}),y=k.useMemo(()=>FO(g,t,s),[g,t]),E=async(b,A)=>{if(console.log("handleUrl is called...",b," ",A),A==="internal_action"){let N=null;b.includes("send-message")&&(console.log('url.includes("send-message") = ',b.includes("send-message")),N={pageTitle:"Send a Message",hideFooterNav:!0}),n(b,{state:N})}else await DR.open({url:b,toolbarColor:IE})};return u?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:[0,1,2].map((b,A)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions"})},A))})})}):p?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more actions"})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[(g==null?void 0:g.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"py-0 pt-2 sticky-to",style:{},children:h.jsxs("div",{className:"pb-0",children:[h.jsx(XO,{filters:s,onSearch:b=>i(b),className:"mb-"}),(y==null?void 0:y.length)>0&&t.length>0&&h.jsx(Ga,{size:"sm",className:"px-1 text-gray9",children:`Results found ${y==null?void 0:y.length}`})]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-2",children:d&&(y==null?void 0:y.length)===0?h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:[0,1,2].map((b,A)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions"})},A))}):h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:y==null?void 0:y.map((b,A)=>h.jsx(Gt,{children:h.jsx(oYe,{className:"",item:b,handleQuickAction:E})},(b==null?void 0:b.form_id)+(b==null?void 0:b.name)))})})})]})})}function ZQ({btnTitle:n,className:t,isWide:i,icon:s,style:l,primaryActionHandler:d}){const u=k.useRef(null),p=i||!1,g=s||"add3",_=n||"Add",y=t||"",E={bottom:120,right:10},b=l?{...E,...l}:E;function A(){const N=window.scrollY;Math.round(N)>=100?u.current.classList.remove("expanded"):u.current.classList.add("expanded")}return k.useEffect(()=>(A(),window.addEventListener("scroll",A),()=>{window.removeEventListener("scroll",A)}),[]),h.jsx(h.Fragment,{children:h.jsxs(Pt,{type:"button",ref:u,className:`btn-theme btn-icon btn-lg btn-secondary btn-quick-action position-fixed border-0 rounded-5 shadow expanded ${y} ${p?"btn-wide":""}`,style:b,onClick:d,children:[h.jsx(Zt,{tag:g,className:"font-22"}),h.jsx("span",{className:"text-white fw-sb font-14 btn-title",children:_})]})})}function k_e(n){var u,p,g;const t=n!=null&&n.className?n==null?void 0:n.className:"",i=n!=null&&n.bodyClassName?n==null?void 0:n.bodyClassName:"",s=(u=n.item)==null?void 0:u.name,l=(p=n.item)==null?void 0:p.avatar,d=(g=n.item)==null?void 0:g.date;return h.jsx(h.Fragment,{children:h.jsx(et,{className:`list-view-card list-view-card-sm border-0 border-bottom rounded-0 shado ${t}`,children:h.jsx(et.Body,{className:`p-2 ${i}`,children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 list-icon-container position-relative d-flex align-items-center",children:h.jsx("div",{className:"list-icon-wrapper rounded-circle overflow-hidden",children:h.jsx("img",{src:l,alt:`${s} image`,className:"img-fluid"})})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 list-info-container",children:[h.jsx("span",{className:"font-13 fw-sb",children:`${s} `}),h.jsx("span",{className:"d-block font-12 text-gray9",children:d})]})]})})})})}function nx({isLiked:n,loadingMediaLike:t,loadingLikesList:i,likesData:s,likeActionHandler:l,parentId:d}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center p-2 bg-gray-lighter3 rounded-3 mb-2",children:[h.jsx("span",{className:"font-13 fw-sb",children:n?"You liked it":"You did not like it yet!"}),h.jsxs(Pt,{className:`btn-theme btn-sm btn-likes-light ms-2 px-2 ${n&&"active"}`,onClick:()=>l(d),children:[t?h.jsx(Ji,{size:"sm",className:"me-1"}):h.jsx(Zt,{tag:"favorite3",className:"font-18 me-1"}),h.jsx("span",{className:"",children:n?"Dislike now":"Like now"})]})]}),i&&h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:[0,1,2].map((u,p)=>h.jsx(ci,{type:"likes-list"},p))})}),!i&&(s==null?void 0:s.length)>0&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:s.map(u=>h.jsx(k_e,{item:u,className:"",bodyClassName:"px-0"},u.name+u.date))})})})]})}function cYe(n,t){k.useEffect(()=>{if(n){console.log("textAreaRef = ",n);const i=n.scrollHeight;console.log("scrollHeight = ",i),i<=100&&(n.style.height="0px",n.style.height=i+"px")}},[n,t])}const So={getAllWallMessages:async n=>{const t=n?`&lastkey=${n}`:"";return await On.get(`wall/wallmessage/list?paginate=yes${t}`)},getWallMessageDetails:async n=>await On.get(`wall/wallmessage/details?id=${n}`),getAllWallMessageRecipients:async()=>await On.get("ums/users/recipients"),sendWallMessage:async n=>await On.post("wall/wallmessage/sendbroadcast",n),getWallMessageLike:async n=>await On.get(`wall/wallmessage/like?id=${n}`),getWallMessageLikesList:async n=>await On.get(`wall/wallmessage/likes?id=${n}`),getAllWallMessageCommentList:async n=>await On.get(`wall/wallmessage/comments?id=${n}`),addWallMessageComment:async n=>await On.post("wall/wallmessage/comment",n)},dYe=40;function uYe(n){const[t,i]=k.useState(!1),[s,l]=k.useState(""),[d,u]=k.useState(!1),p=k.useRef(null);cYe(p.current,s);const g=b=>{var N;console.log("handleTextAreaChange called ...",b),u(!1);const A=(N=b.target)==null?void 0:N.value;l(A),A!==""&&u(!0)},_=b=>{l(""),i(!1),u(!1)};let y="";switch(n.addPlacement){case"modal":y="";break;case"fixed-bottom":y="fixed-bottom";break}const E=async b=>{if(b.preventDefault(),s===""){handleAlert("Comment should not be empty!","error"),u(!1);return}i(!0);let A={comment:s};switch(console.log("handleSubmit called...",b),n.comment_type){case"media":A={...A,media_id:n.parent_id},console.log("Calling add thread comment..."),hs.addMagazineMediaComment(A).then(N=>{console.log("addMagazineMediaComment RES = ",N.data),N.data.status==="success"?(console.log('Inside AddComment case "thread" : ',N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),_()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),_())}).catch(N=>{console.log(N)});break;case"message":A={...A,message_id:n.parent_id},console.log("Calling add message comment..."),So.addWallMessageComment(A).then(N=>{N.data.status==="success"?(console.log(N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),_()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),_())}).catch(N=>{console.log(N)});break;case"contest":A={...A,submission_id:n.parent_id},console.log("Calling add contest comment..."),Wa.addContestSubmissionComment(A).then(N=>{N.data.status==="success"?(console.log(N.data),n.setCommentsCount(O=>O+1),n.handleCommentList(n.parent_id),i(!1),_()):N.data.status==="failed"&&(console.log("ERROR:",N.data.error),handleAlert("Failed to add a comment!","error"),i(!1),_())}).catch(N=>{console.log(N)});break}};return h.jsx(h.Fragment,{children:h.jsx(et,{className:`border-0 pt-3 pb-2 px-0 add_comment_card ${y}`,children:h.jsx(kt,{className:"form_style",onSubmit:E,children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"flex-fill pe-2",children:h.jsx(kt.Group,{className:"form-group rounded_corners mb-0",children:h.jsx(kt.Control,{as:"textarea",ref:p,rows:1,style:{height:s===""&&dYe,resize:"auto"},placeholder:"Add comment",name:"comment",value:s,onChange:g,autoComplete:"off"})})}),h.jsx("div",{className:"btn-wrap",children:h.jsx(Pt,{type:"submit",className:"btn btn-theme btn-primary btn_comment_submit",disabled:!d,children:t?h.jsx(h.Fragment,{children:h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})}):h.jsx(Eye,{})})})]})})})})}function hYe(n){var i,s,l,d,u,p;const t=((i=n.comment)==null?void 0:i.avatar)!=="NULL"?(s=n.comment)==null?void 0:s.avatar:"/img/profile-pic.png";return h.jsx(h.Fragment,{children:h.jsxs(et,{className:"comment_card border- shadow-s mb-0 overflow-hidden",children:[h.jsx(et.Body,{className:"pb-0",children:h.jsx("p",{className:"mb-0 font-14 text-gray5 ps-1",children:(l=n.comment)==null?void 0:l.comment})}),h.jsx(et.Header,{className:"bg_transparent border-0 pt-2",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:t,className:"rounded-circle media_img",alt:`${(d=n.comment)==null?void 0:d.name} profile`})}),h.jsxs("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:[h.jsx("div",{className:"mb-0 font-12 text-gray6 fw-",children:(u=n.comment)==null?void 0:u.name}),h.jsx("span",{className:"dot-seperator"}),h.jsx("div",{className:"font-12 text-gray6",children:(p=n.comment)==null?void 0:p.date})]})]})})]})})}function fYe(n){var t;return h.jsxs("div",{className:"d-grid gap-3 comment_list_wrap px-0 pt-0",children:[h.jsx(uYe,{comment_type:n.comment_type,parent_id:n.parent_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:n.addPlacement}),n.loading?h.jsx(h.Fragment,{children:[0,1,2].map((i,s)=>h.jsx(ci,{type:"comment-list"},`placeholder-comment-card-${s}`))}):h.jsxs(h.Fragment,{children:[!((t=n.comments)!=null&&t.length)>0&&h.jsxs(h.Fragment,{children:[" ",h.jsx("div",{className:"font-14 fw-sb",children:"No more comments!"})]}),n.comments.length>0&&n.comments.map(i=>h.jsx(hYe,{comment_type:n.comment_type,comment:i,parent_owner_id:n.parent_owner_id},n.parent_id+i.name+i.date))]})]})}function YE(n){const t=n.addPlacement?n.addPlacement:"modal";return h.jsx("div",{className:"position-relative pb-3 h-100",children:h.jsx(fYe,{loading:n.loading,comment_type:n.comment_type,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:t})})}function pYe(n){var g,_,y,E,b,A;const[t,i]=k.useState("msg_likes_tab"),s=((g=n.badge)==null?void 0:g.image)!==""?(_=n.badge)==null?void 0:_.image:"star-icon.png",l=((y=n.data)==null?void 0:y.title)&&((E=n.data)==null?void 0:E.title),d=n.likeCount?n.likeCount:(b=n.data)==null?void 0:b.likes_count,u=n.commentsCount?n.commentsCount:(A=n.data)==null?void 0:A.comments_count;k.useEffect(()=>{n.likesListHandler(n.parent_id)},[n.parent_id]);const p=N=>{console.log("Key in handleSelectedTab =",N),N=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab",n.parent_id),n.likesListHandler(n.parent_id)),N=="msg_comments_tab"&&n.handleCommentList(n.parent_id),i(N)};return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb border-0",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:n.badge.title})}),h.jsx(vn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-center badge-symbol-container mx-auto",children:h.jsx("div",{className:"media-img-wrapper rounded-3",children:h.jsx(us,{src:s,alt:n.badge.title,wrapperClassName:"img-fluid mx-auto "})})}),h.jsxs("div",{className:"d-flex justify-content-center align-items-center py-2 font-14 fw-sb text-gray9",children:[h.jsxs("div",{className:"",children:[n.badge.points," points"]}),h.jsx("div",{className:"dot-seperator"}),h.jsx("div",{className:"",children:n.badge.date})]}),h.jsx("div",{className:"font-14 fw-sb text-gray6 pb-2 d-flex justify-content-center",children:h.jsx("div",{className:"mx-auto my-3 text-center",children:l})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:N=>p(N),mountOnEnter:!0,unmountOnExit:!0,children:[h.jsx("div",{className:"tab_links",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${d} ${d===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${u} ${u===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.parent_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}function mYe({badge:n,className:t}){const[i,s]=k.useState(!1),[l,d]=k.useState(null),[u,p]=k.useState(l==null?void 0:l.is_liked),[g,_]=k.useState(l==null?void 0:l.likes_count),[y,E]=k.useState([]),[b,A]=k.useState(!0),[N,O]=k.useState(!1),[D,P]=k.useState(!1),[j,M]=k.useState(l==null?void 0:l.comments_count),[V,H]=k.useState([]),[$,Q]=k.useState(!0),Y=t||"",le=(n==null?void 0:n.image)!==""?n==null?void 0:n.image:"/img/warranty-icon.png",ae=(n==null?void 0:n.title)&&(n==null?void 0:n.title);n!=null&&n.points&&(n==null||n.points);const te=(n==null?void 0:n.date)&&(n==null?void 0:n.date);function de(me){ie(me)}const G=()=>{s(!1)},ie=me=>{const Ne=me.wall_message_id;_e(Ne),s(!0)};async function _e(me){P(!0),So.getWallMessageDetails(me).then(Ne=>{var Fe,je,Ve;if(console.log("getWallMessageDetails RES = ",(Fe=Ne.data)==null?void 0:Fe.data),Ne.data.status==="success"){const Re=(Ve=(je=Ne.data)==null?void 0:je.data)==null?void 0:Ve.message;d(Re),P(!1)}}).catch(Ne=>{P(!1),d(null),console.log("Error in getWallMessageDetails = ",Ne)})}async function he(me){O(!0),me&&So.getWallMessageLike(me).then(Ne=>{var Fe,je;Ne.data.status==="success"&&(console.log("Success in getWallMessageLike =",Ne.data.data),p((Fe=Ne.data.data)==null?void 0:Fe.is_liked),_((je=Ne.data.data)==null?void 0:je.likes_count),O(!1),Ce(me))}).catch(Ne=>{O(!1),p(appreciationDetails==null?void 0:appreciationDetails.is_liked),_(appreciationDetails==null?void 0:appreciationDetails.likes_count),console.log("Error in getWallMessageLike = ",Ne)})}async function Ce(me){me&&So.getWallMessageLikesList(me).then(Ne=>{var Fe;Ne.data.status==="success"&&(E((Fe=Ne.data.data)==null?void 0:Fe.likes),A(!1))}).catch(Ne=>{A(!1),E([]),console.log("Error in getWallMessageLikesList = ",Ne)})}async function fe(me){Q(!0),me&&So.getAllWallMessageCommentList(me).then(Ne=>{var Fe;Ne.data.status==="success"&&(H((Fe=Ne.data.data)==null?void 0:Fe.comments),Q(!1))}).catch(Ne=>{Q(!1),H([]),console.log("Error in getAllWallMessageCommentList = ",Ne)})}return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:`card-theme media-card badge-card border-0 ${Y}`,onClick:()=>de(n),children:h.jsxs(et.Body,{className:"p-2 text-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper text-center mx-auto",children:h.jsx("img",{src:le,alt:`${ae} Badge Icon`,className:"img-fluid"})}),h.jsxs("div",{className:"d-flex flex-column align-items-center justify-content-center w-100 pt-2 media-content-wrapper",children:[h.jsx("p",{className:"fw-sb",children:ae}),h.jsx("div",{className:"d-flex justify-content-betwee align-items-center",children:h.jsx("span",{className:"media-time-text",children:te})})]})]})}),h.jsx(pYe,{show:i,handleClose:G,badge:n,data:l,loadingData:D,likesData:y,likeCount:g,isLiked:u,likeActionHandler:he,loadingMediaLike:N,likesListHandler:Ce,loadingLikesList:b,comment_type:"message",loadingCommentsList:$,parent_id:n==null?void 0:n.wall_message_id,parent_owner_id:null,comments:V,handleCommentList:fe,setCommentsCount:M,commentsCount:j})]})}const Q4={getAllBadges:async()=>await On.get("recognition/badge/list"),getBadgeCreationHelpers:async()=>(console.log("Inside Service getBadgeCreationHelpers() ..."),await On.get("recognition/badge/createhelper")),sendBadge:async n=>(console.log("Inside Service sendBadge() ...",n),await On.post("recognition/badge/create",n))};function gYe(){var g,_,y;const n=Ii(),t=async()=>{var E;try{const b=await Q4.getAllBadges();return b.data.status==="success"?(E=b.data)==null?void 0:E.data:null}catch{throw new Error("Error fetching badges")}},{isFetching:i,isPending:s,isError:l,data:d,error:u}=Qd({queryKey:["allBadgesQuery"],queryFn:t}),p=()=>{n("/badges/send-badges",{state:{pageTitle:"Send a Badge",hideFooterNav:!0}})};return s?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:[0,1].map((E,b)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions",className:"card-theme overflow-hidden"})},b))})})}):l?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more badges"})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[i&&((g=d==null?void 0:d.received)==null?void 0:g.length)===0?h.jsx(h.Fragment,{children:h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:[0,1].map((E,b)=>h.jsx(Gt,{children:h.jsx(ci,{type:"quick-actions",className:"card-theme overflow-hidden"})},b))})}):h.jsx(h.Fragment,{children:((_=d==null?void 0:d.received)==null?void 0:_.length)>0?h.jsx(fn,{className:"row-cols-2 g-3 mb-4",children:(y=d==null?void 0:d.received)==null?void 0:y.map(E=>h.jsx(Gt,{className:"",children:h.jsx(mYe,{badge:E,className:"shadow-sm"})},E==null?void 0:E.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more badges"})})}),(d==null?void 0:d.cansend)&&h.jsx(ZQ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",primaryActionHandler:p})]})})}function vYe(n){var l,d,u,p;const t=n.className?n.className:"",i=((l=n.reward)==null?void 0:l.text)&&((d=n.reward)==null?void 0:d.text),s=((u=n.reward)==null?void 0:u.points)&&((p=n.reward)==null?void 0:p.points);return h.jsx(et,{className:`card-theme reward-card border-0 me-3 w-100 ${t}`,children:h.jsxs(et.Body,{className:"px-2 text-center d-flex flex-column justify-content-between",children:[h.jsx("div",{className:"font-14 text-gray7",children:i}),h.jsx("span",{className:"font-16 fw-sb",children:s})]})})}const fY=[{id:"reward-1",type:"reward",text:"Available points",time:"2 hours ago",points:1562,icon:"",isActionBtn:!1},{id:"reward-2",type:"reward",text:"Redeemed till date",time:"1 day ago",points:3452,icon:"",isActionBtn:!1},{id:"reward-3",type:"reward",text:"Available points",time:"1 day ago",points:1562,icon:"",isActionBtn:!1},{id:"reward-4",type:"reward",text:"Redeemed till date",time:"5 hours ago",points:3452,icon:"",isActionBtn:!1}];function yYe(n){const[t,i]=k.useState(fY);return console.log("Rewards data = ",fY),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(fn,{className:"row-cols-3 g-3 mb-4",children:t.map((s,l)=>h.jsx(Gt,{className:"",children:h.jsx(vYe,{reward:s,className:"shadow-sm"})},s.id))})})})}function _Ye(n){var b,A,N,O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de;const[t,i]=k.useState("msg_details_tab"),s=((b=n.data)==null?void 0:b.icon)!==""?(A=n.data)==null?void 0:A.icon:"/img/star-icon.png",l=(N=n.data)!=null&&N.sender?(O=n.data)==null?void 0:O.sender:"",d=((D=n.data)==null?void 0:D.sender_avatar)!==""?(P=n.data)==null?void 0:P.sender_avatar:"/img/user-profile.jpg",u=(j=n.data)!=null&&j.receiver?(M=n.data)==null?void 0:M.receiver:"",p=((V=n.data)==null?void 0:V.receiver_avatar)!==""?(H=n.data)==null?void 0:H.receiver_avatar:"/img/user-profile.jpg",g=(($=n.data)==null?void 0:$.message)&&((Q=n.data)==null?void 0:Q.message),_=n.likeCount?n.likeCount:(Y=n.data)==null?void 0:Y.likes_count,y=n.commentsCount?n.commentsCount:(le=n.data)==null?void 0:le.comments_count,E=G=>{var ie;console.log("Key in handleSelectedTab =",G),G=="msg_likes_tab"&&n.likesListHandler((ie=n.data)==null?void 0:ie.wall_message_id),G=="msg_comments_tab"&&n.handleCommentList(n.parent_id),i(G)};return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb border-0",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:"Appreciation Details"})}),h.jsx(vn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"d-flex w-100 justify-content-center appreciation-symbol-container",children:[h.jsx("div",{className:"flex-shrink-0 media-img-wrapper symbol-left",children:h.jsx("img",{src:`${d}`,alt:`${l} avatar`,className:"img-fluid"})}),h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper symbol-center",children:h.jsx("img",{src:`${s}`,alt:"Star Icon",className:"img-fluid"})}),h.jsx("div",{className:"flex-shrink-0 media-img-wrapper symbol-right",children:h.jsx("img",{src:`${p}`,alt:`${u} avatar`,className:"img-fluid"})})]}),h.jsx("div",{className:"font-14 text-gray6 pb-2 d-flex justify-content-between",children:h.jsxs("div",{className:"mx-auto my-3",children:[h.jsx("span",{className:"fw-sb text-theme-primary",children:l}),h.jsx("small",{className:"mx-1",children:"appreciated"}),h.jsx("span",{className:"fw-sb text-theme-primary",children:u})]})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:G=>E(G),mountOnEnter:!0,unmountOnExit:!0,children:[h.jsx("div",{className:"tab_links",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${_} ${_===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${y} ${y===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsx("div",{className:"py-2",children:((ae=n.data)==null?void 0:ae.image)&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(us,{src:(te=n.data)==null?void 0:te.image,alt:"appreciation image",wrapperClassName:"img-fluid mx-auto"})}),h.jsxs("div",{className:"font-14 fst-italic text-gray6 pb-2 d-block text-start",children:[h.jsxs("div",{className:"",children:[h.jsx("span",{className:"fw-sb",children:l}),h.jsx("small",{className:"mx-1",children:"appreciated"}),h.jsx("span",{className:"fw-sb",children:u})]}),h.jsx("div",{className:"font-14 my-1",children:"for"}),h.jsx("div",{className:"fw-sb",children:g})]})]})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(de=n.data)==null?void 0:de.wall_message_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}const Z4={getAllAppreciations:async()=>await On.get("recognition/appreciation/list"),getAppreciationDetails:async n=>await On.get(`recognition/appreciation/detail?id=${n}`),getAppreciationCreationHelpers:async()=>(console.log("Inside Service getAppreciationCreationHelpers() ..."),await On.get("recognition/appreciation/createhelper")),sendAppreciation:async n=>(console.log("Inside Service sendAppreciation() ...",n),await On.post("recognition/appreciation/create",n))};function M_e(n){var me,Ne,Fe,je,Ve,Re;const[t,i]=k.useState(!1),[s,l]=k.useState(null),[d,u]=k.useState(!1),[p,g]=k.useState(s==null?void 0:s.is_liked),[_,y]=k.useState(s==null?void 0:s.likes_count),[E,b]=k.useState([]),[A,N]=k.useState(!0),[O,D]=k.useState(!1),[P,j]=k.useState(s==null?void 0:s.comments_count),[M,V]=k.useState([]),[H,$]=k.useState(!0),Q=n.className?n.className:"",Y=((me=n.data)==null?void 0:me.icon)!==""?(Ne=n.data)==null?void 0:Ne.icon:"/img/star-icon.png",le=(Fe=n.data)!=null&&Fe.sender?(je=n.data)==null?void 0:je.sender:"",ae=(Ve=n.data)!=null&&Ve.receiver?(Re=n.data)==null?void 0:Re.receiver:"";n.data.text&&n.data.text;const te=n.data.date&&n.data.date;function de(Be){ie(Be)}const G=()=>{i(!1)},ie=Be=>{const Xe=Be.id;_e(Xe),i(!0)};async function _e(Be){u(!0),Z4.getAppreciationDetails(Be).then(Xe=>{var we,Ge,rt;if(console.log("getAppreciationDetails RES = ",(we=Xe.data)==null?void 0:we.data),Xe.data.status==="success"){const pt=(rt=(Ge=Xe.data)==null?void 0:Ge.data)==null?void 0:rt.appreciation;l(pt),u(!1)}}).catch(Xe=>{u(!1),l(null),console.log("Error in getAppreciationDetails = ",Xe)})}async function he(Be){D(!0),Be&&So.getWallMessageLike(Be).then(Xe=>{var we,Ge;Xe.data.status==="success"&&(console.log("Success in getWallMessageLike =",Xe.data.data),g((we=Xe.data.data)==null?void 0:we.is_liked),y((Ge=Xe.data.data)==null?void 0:Ge.likes_count),D(!1),Ce(Be))}).catch(Xe=>{D(!1),g(s==null?void 0:s.is_liked),y(s==null?void 0:s.likes_count),console.log("Error in getWallMessageLike = ",Xe)})}async function Ce(Be){Be&&So.getWallMessageLikesList(Be).then(Xe=>{var we;console.log("getWallMessageLikesList RES = ",Xe.data),Xe.data.status==="success"&&(b((we=Xe.data.data)==null?void 0:we.likes),N(!1))}).catch(Xe=>{N(!1),b([]),console.log("Error in getWallMessageLikesList = ",Xe)})}async function fe(Be){$(!0),Be&&So.getAllWallMessageCommentList(Be).then(Xe=>{var we;Xe.data.status==="success"&&(V((we=Xe.data.data)==null?void 0:we.comments),$(!1))}).catch(Xe=>{$(!1),V([]),console.log("Error in getAllWallMessageCommentList = ",Xe)})}return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:`card-theme media-list-card appreciation-list-card border-0 ${Q}`,onClick:()=>de(n.data),children:h.jsx(et.Body,{className:"p-2",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper",children:h.jsx("img",{src:`${Y}`,alt:"Star Icon",className:"img-fluid"})}),h.jsxs("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:[h.jsxs("p",{children:[h.jsx("span",{className:"fw-sb me-1",children:le}),h.jsx("small",{children:"appreciated"})," ",h.jsx("br",{}),h.jsx("span",{className:"fw-sb",children:ae})]}),h.jsx("div",{className:"d-flex justify-content-between align-items-center",children:h.jsx("span",{className:"text-start media-time-text",children:te})})]}),n.showRightIcon&&h.jsx(Zt,{tag:"arrow-right1",className:"font-22 align-self-center text-theme-primary"})]})})}),h.jsx(_Ye,{show:t,handleClose:G,data:s,loadingData:d,likesData:E,likeCount:_,isLiked:p,likeActionHandler:he,loadingMediaLike:O,likesListHandler:Ce,loadingLikesList:A,comment_type:"message",loadingCommentsList:H,parent_id:s==null?void 0:s.wall_message_id,parent_owner_id:null,comments:M,handleCommentList:fe,setCommentsCount:j,commentsCount:P})]})}function EYe({appreciations:n,loading:t,getAppreciationDetails:i}){return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t?h.jsx(h.Fragment,{children:[0,1,2].map((s,l)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${l}`))}):h.jsx(h.Fragment,{children:(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:n==null?void 0:n.map(s=>h.jsx(M_e,{cardType:"list",data:s,showRightIcon:!0,className:"card-theme shadow-sm",getAppreciationDetails:i},s==null?void 0:s.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})})})})}function wYe({appreciations:n,loading:t}){return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t?h.jsx(h.Fragment,{children:[0,1,2].map((i,s)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${s}`))}):h.jsx(h.Fragment,{children:(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:n==null?void 0:n.map((i,s)=>h.jsx(M_e,{cardType:"list",data:i,showRightIcon:!0,className:"card-theme shadow-sm"},i==null?void 0:i.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})})})})}function SYe(){var b;const n=Ii(),t=Xo(),[i,s]=k.useState(((b=t==null?void 0:t.state)==null?void 0:b.data)==="sent"?"appreciations-sent":"appreciations-received"),l=async()=>{var A;try{const N=await Z4.getAllAppreciations();return N.data.status==="success"?(A=N.data)==null?void 0:A.data:null}catch{throw new Error("Error fetching appreciations")}},{isFetching:d,isPending:u,isError:p,data:g,error:_}=Qd({queryKey:["allAppreciationsQuery"],queryFn:l}),y=A=>{s(A)},E=()=>{n("/appreciations/send-appreciations",{state:{pageTitle:"Send an Appreciation",hideFooterNav:!0}})};return u?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-grid gap-3",children:[0,1,2].map((A,N)=>h.jsx(ci,{type:"appreciations-list"},`appreciation-${N}`))})})}):p?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(Card,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more appreciations"})})}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsxs(vU,{activeKey:i,variant:"pills",justify:!0,id:"uncontrolled-tab-example",className:"mb-3 theme-tabs",onSelect:A=>{y(A)},children:[h.jsx(Zn,{eventKey:"appreciations-received",title:"Appreciations received",children:h.jsx(EYe,{appreciations:g==null?void 0:g.received,loading:u})}),h.jsx(Zn,{eventKey:"appreciations-sent",title:"Appreciations sent",children:h.jsx(wYe,{appreciations:g==null?void 0:g.sent,loading:u})})]}),(g==null?void 0:g.cansend)&&h.jsx(ZQ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",primaryActionHandler:E})]})})})}function tfe(n){let t="default",i=(n==null?void 0:n.contactType.split("").map((l,d)=>d===0?l.toUpperCase():l).join(""))||"Type",s=(n==null?void 0:n.contactValue)||"NA";switch(n==null?void 0:n.contactType){case"email":t="message5";break;case"mobile":t="call1";break;default:t="call1"}return h.jsx(h.Fragment,{children:h.jsx(et,{className:"media-list-card profile-contact-list-card border-0 rounded-0 bg-transparent",children:h.jsx(et.Body,{className:"p-0",children:h.jsxs("div",{className:"d-flex align-items-start",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-wrapper align-items-center d-flex justify-content-center",children:h.jsx(Zt,{tag:t,className:"font-20"})}),h.jsx("div",{className:"flex-grow-1 ms-3 media-content-wrapper",children:h.jsxs("span",{className:"welcome-user font-14 text-gray7",children:[`${i} `,h.jsx("span",{className:"d-block fw-sb text-gray3",children:s})]})})]})})})})}function bYe(n){const[t,i]=k.useState(!0),[s,l]=k.useState([]);k.useEffect(()=>{const u=Object.entries(n==null?void 0:n.userProfile).map(([g,_])=>{let y="";return y=g.split("").map((E,b)=>b===0?E.toUpperCase():E).join(""),{key:y,value:_}}),p=u.filter(g=>{if(["hq","territory","area","region","zone","city","state","pincode","address"].includes(g.key.toLowerCase()))return console.log("Item Key = ",g.key),{key:g.key,value:g.value}});l(p),console.log("userAdd = ",u),console.log("userAdd2 = ",p)},[n.userProfile]);function d(){console.log("handleProfileInfoCollapseToggle called..."),i(!t)}return h.jsxs(h.Fragment,{children:[h.jsx(pQ,{in:t,children:h.jsx("div",{id:"profile-info-collapse",className:"profile-other-info font-14",children:h.jsx(et,{className:"bg-transparent border-0",children:s.length>0?h.jsx(xMe,{hover:!0,className:"bg-transparent",children:h.jsx("tbody",{children:s.map((u,p)=>h.jsxs("tr",{children:[h.jsxs("td",{className:"text-gray7",children:[u.key,":"]}),h.jsx("td",{className:"fw-sb",children:u.value})]},p))})}):h.jsx("p",{children:"No more info..."})})})}),h.jsx("div",{className:"d-flex justify-content-end d-none",children:h.jsxs(Pt,{variant:"link",size:"sm",className:"btn-theme font-12 fw-sb text-decoration-none","aria-controls":"profile-info-collapse","aria-expanded":t,onClick:d,children:[t?"See less":"See more"," ",h.jsx(Zt,{tag:"arrow-down1",className:`font-10 theme-transition ${t&&"rotate-180"}`})]})})]})}function CYe(n){const[t,i]=k.useState(!1),[s,l]=k.useState({}),d=n.isAddMode,u=[{key:"Male",value:"male"},{key:"Female",value:"female"},{key:"Other",value:"other"}],p={firstname:"",lastname:"",email:"",phone:"",designation:"",gender:"male",date_of_birth:null,city:"",state:"",pincode:"",address:"",avatar:""},g=uc({firstname:hf().required("Required"),lastname:hf().required("Required")});k.useEffect(()=>{if(console.log("currentUser = ",n.currentUser),!d&&n.currentUser){let y={firstname:n.currentUser.firstname?n.currentUser.firstname:"",lastname:n.currentUser.lastname?n.currentUser.lastname:"",phone:n.currentUser.phone?n.currentUser.phone:"",gender:n.currentUser.gender?n.currentUser.gender:"male",date_of_birth:n.currentUser.date_of_birth?n.currentUser.date_of_birth:"",city:n.currentUser.city?n.currentUser.city:"",state:n.currentUser.state?n.currentUser.state:"",pincode:n.currentUser.pincode?n.currentUser.pincode:"",address:n.currentUser.address?n.currentUser.address:""};l(y)}},[n.currentUser]);const _=async(y,{resetForm:E})=>{i(!0),console.log("Form Values :",y),y.address&&y.address;const b={...y,city:y.city,state:y.state,pincode:y.pincode,date_of_birth:y.date_of_birth},A=Object.entries(b).reduce((N,[O,D])=>(D&&(N[O]=D),N),{});console.log("New values in Update Settings =",b),console.log("All Falsy removed in Update Settings =",A),d||(console.log("Updating existing user details"),hs.updateUserProfile(A).then(N=>{if(console.log(N),N.data.status==="success"){console.log("Suucess res from update = ",N.data.data.profile);const O=N.data.data.profile;Qt("You have successfully updated user details!","success"),E({}),i(!1),n.handleClose(),n.getUserProfile();const D={avatar:O.avatar,firstname:O.firstname,lastname:O.lastname,name:`${O.firstname} ${O.lastname}`,phone:O.phone};Ai.setAuthUser(D)}else N.data.status==="failed"&&(console.log("ERROR:",N.data.error),Qt("User details updation failed!","error"),E({}),i(!1),n.handleClose())}).catch(N=>{console.log(N)}))};return h.jsx(h.Fragment,{children:h.jsx(id,{initialValues:d?p:s,validationSchema:g,onSubmit:_,enableReinitialize:!0,children:y=>h.jsxs(kt,{className:"form_style",onSubmit:y.handleSubmit,children:[h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"First name"}),h.jsx(kt.Control,{type:"text",placeholder:"First name",name:"firstname",...y.getFieldProps("firstname"),autoComplete:"off"}),y.touched.firstname&&y.errors.firstname?h.jsx("p",{className:"error-state-text font-12 text-danger",children:y.errors.firstname}):null]})}),h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Last name"}),h.jsx(kt.Control,{type:"text",placeholder:"Last name",name:"lastname",...y.getFieldProps("lastname"),autoComplete:"off"}),y.touched.lastname&&y.errors.lastname?h.jsx("p",{className:"error-state-text font-12 text-danger",children:y.errors.lastname}):null]})})]}),h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Phone"}),h.jsx(kt.Control,{type:"text",placeholder:"Phone",name:"phone",...y.getFieldProps("phone"),autoComplete:"off"}),y.touched.phone&&y.errors.phone?h.jsx("p",{className:"error-state-text font-12 text-danger",children:y.errors.phone}):null]})}),h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners px-0 inline_radio_fields mb-2",children:[h.jsx("div",{className:"font-14 mb-1 fw-sb",children:"Gender"}),h.jsx("div",{className:"px-1",children:u.map(E=>{var b;return h.jsx(kt.Check,{inline:!0,label:E.key,name:"gender",type:"radio",id:`gender-${E.key}`,value:E.value,onChange:y.handleChange,onBlur:y.handleBlur,checked:((b=y.values)==null?void 0:b.gender)===E.value.toString()},E.value)})}),y.touched.gender&&y.errors.gender?h.jsx("p",{className:"error-state-text",children:y.errors.gender}):null]})})]}),h.jsx(fn,{children:h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Date of Birth"}),h.jsx(kt.Control,{type:"date",placeholder:"Date of Birth",name:"date_of_birth",...y.getFieldProps("date_of_birth"),autoComplete:"off",pattern:"\\d{4}-\\d{2}-\\d{2}"}),y.touched.date_of_birth&&y.errors.date_of_birth?h.jsx("p",{className:"error-state-text",children:y.errors.date_of_birth}):null]})})}),h.jsxs(fn,{className:"row-cols-1 row-cols-md-",children:[h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"City"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"City",name:"city",...y.getFieldProps("city"),autoComplete:"off"}),y.touched.city&&y.errors.city?h.jsx("p",{className:"error-state-text",children:y.errors.city}):null]})]}),h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"State"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"State",name:"state",...y.getFieldProps("state"),autoComplete:"off"}),y.touched.state&&y.errors.state?h.jsx("p",{className:"error-state-text",children:y.errors.state}):null]})]})]}),h.jsx(fn,{className:"row-cols-1 row-cols-md-",children:h.jsxs(Gt,{children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Pincode"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Control,{type:"text",placeholder:"Pincode",name:"pincode",...y.getFieldProps("pincode"),autoComplete:"off"}),y.touched.pincode&&y.errors.pincode?h.jsx("p",{className:"error-state-text",children:y.errors.pincode}):null]})]})}),h.jsx(fn,{children:h.jsx(Gt,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb mb-1",children:"Address"}),h.jsx(kt.Control,{type:"text",placeholder:"Addres",name:"address",...y.getFieldProps("address"),autoComplete:"off"}),y.touched.address&&y.errors.address?h.jsx("p",{className:"error-state-text",children:y.errors.address}):null]})})}),h.jsx("div",{className:"btn-wrap position-fixed px-2 pt-3 pb-4 bg-white",style:{bottom:0,left:0,right:0,zIndex:1},children:h.jsx(Pt,{type:"submit",className:"btn btn-theme btn-primary btn-md w-100",children:t?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Updating"]}):"Update"})})]})})})}function TYe(n){return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom update-profile-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:"Update Profile"})}),h.jsx(vn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:h.jsx(CYe,{isAddMode:!1,currentUser:n.userProfile,handleClose:n.handleClose,getUserProfile:n.getUserProfile})})]})})}/**
* filesize
*
* @copyright 2023 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 10.1.0
*/const RYe="array",xYe="bit",nfe="bits",AYe="byte",ife="bytes",Ob="",IYe="exponent",NYe="function",rfe="iec",OYe="Invalid number",PYe="Invalid rounding method",J$="jedec",LYe="object",sfe=".",DYe="round",kYe="s",MYe="si",jYe="kbit",UYe="kB",FYe=" ",BYe="string",VYe="0",Q$={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function kR(n,{bits:t=!1,pad:i=!1,base:s=-1,round:l=2,locale:d=Ob,localeOptions:u={},separator:p=Ob,spacer:g=FYe,symbols:_={},standard:y=Ob,output:E=BYe,fullform:b=!1,fullforms:A=[],exponent:N=-1,roundingMethod:O=DYe,precision:D=0}={}){let P=N,j=Number(n),M=[],V=0,H=Ob;y===MYe?(s=10,y=J$):y===rfe||y===J$?s=2:s===2?y=rfe:(s=10,y=J$);const $=s===10?1e3:1024,Q=b===!0,Y=j<0,le=Math[O];if(typeof n!="bigint"&&isNaN(n))throw new TypeError(OYe);if(typeof le!==NYe)throw new TypeError(PYe);if(Y&&(j=-j),(P===-1||isNaN(P))&&(P=Math.floor(Math.log(j)/Math.log($)),P<0&&(P=0)),P>8&&(D>0&&(D+=8-P),P=8),E===IYe)return P;if(j===0)M[0]=0,H=M[1]=Q$.symbol[y][t?nfe:ife][P];else{V=j/(s===2?Math.pow(2,P*10):Math.pow(1e3,P)),t&&(V=V*8,V>=$&&P<8&&(V=V/$,P++));const ae=Math.pow(10,P>0?l:0);M[0]=le(V*ae)/ae,M[0]===$&&P<8&&N===-1&&(M[0]=1,P++),H=M[1]=s===10&&P===1?t?jYe:UYe:Q$.symbol[y][t?nfe:ife][P]}if(Y&&(M[0]=-M[0]),D>0&&(M[0]=M[0].toPrecision(D)),M[1]=_[M[1]]||M[1],d===!0?M[0]=M[0].toLocaleString():d.length>0?M[0]=M[0].toLocaleString(d,u):p.length>0&&(M[0]=M[0].toString().replace(sfe,p)),i&&Number.isInteger(M[0])===!1&&l>0){const ae=p||sfe,te=M[0].toString().split(ae),de=te[1]||Ob,G=de.length,ie=l-G;M[0]=`${te[0]}${ae}${de.padEnd(G+ie,VYe)}`}return Q&&(M[1]=A[P]?A[P]:Q$.fullform[y][P]+(t?xYe:AYe)+(M[0]===1?Ob:kYe)),E===RYe?M:E===LYe?{value:M[0],symbol:M[1],exponent:P,unit:H}:M.join(g)}const A7={x:0,y:0,width:0,height:0,unit:"px"},Pb=(n,t,i)=>Math.min(Math.max(n,t),i),zYe=(...n)=>n.filter(t=>t&&typeof t=="string").join(" "),afe=(n,t)=>n===t||n.width===t.width&&n.height===t.height&&n.x===t.x&&n.y===t.y&&n.unit===t.unit;function HYe(n,t,i,s){const l=np(n,i,s);return n.width&&(l.height=l.width/t),n.height&&(l.width=l.height*t),l.y+l.height>s&&(l.height=s-l.y,l.width=l.height*t),l.x+l.width>i&&(l.width=i-l.x,l.height=l.width/t),n.unit==="%"?a1(l,i,s):l}function GYe(n,t,i){const s=np(n,t,i);return s.x=(t-s.width)/2,s.y=(i-s.height)/2,n.unit==="%"?a1(s,t,i):s}function a1(n,t,i){return n.unit==="%"?{...A7,...n,unit:"%"}:{unit:"%",x:n.x?n.x/t*100:0,y:n.y?n.y/i*100:0,width:n.width?n.width/t*100:0,height:n.height?n.height/i*100:0}}function np(n,t,i){return n.unit?n.unit==="px"?{...A7,...n,unit:"px"}:{unit:"px",x:n.x?n.x*t/100:0,y:n.y?n.y*i/100:0,width:n.width?n.width*t/100:0,height:n.height?n.height*i/100:0}:{...A7,...n,unit:"px"}}function ofe(n,t,i,s,l,d=0,u=0,p=s,g=l){const _={...n};let y=Math.min(d,s),E=Math.min(u,l),b=Math.min(p,s),A=Math.min(g,l);t&&(t>1?(y=u?u*t:y,E=y/t,b=p*t):(E=d?d/t:E,y=E*t,A=g/t)),_.y<0&&(_.height=Math.max(_.height+_.y,E),_.y=0),_.x<0&&(_.width=Math.max(_.width+_.x,y),_.x=0);const N=s-(_.x+_.width);N<0&&(_.x=Math.min(_.x,s-y),_.width+=N);const O=l-(_.y+_.height);if(O<0&&(_.y=Math.min(_.y,l-E),_.height+=O),_.width<y&&((i==="sw"||i=="nw")&&(_.x-=y-_.width),_.width=y),_.height<E&&((i==="nw"||i=="ne")&&(_.y-=E-_.height),_.height=E),_.width>b&&((i==="sw"||i=="nw")&&(_.x-=b-_.width),_.width=b),_.height>A&&((i==="nw"||i=="ne")&&(_.y-=A-_.height),_.height=A),t){const D=_.width/_.height;if(D<t){const P=Math.max(_.width/t,E);(i==="nw"||i=="ne")&&(_.y-=P-_.height),_.height=P}else if(D>t){const P=Math.max(_.height*t,y);(i==="sw"||i=="nw")&&(_.x-=P-_.width),_.width=P}}return _}function WYe(n,t,i,s){const l={...n};return t==="ArrowLeft"?s==="nw"?(l.x-=i,l.y-=i,l.width+=i,l.height+=i):s==="w"?(l.x-=i,l.width+=i):s==="sw"?(l.x-=i,l.width+=i,l.height+=i):s==="ne"?(l.y+=i,l.width-=i,l.height-=i):s==="e"?l.width-=i:s==="se"&&(l.width-=i,l.height-=i):t==="ArrowRight"&&(s==="nw"?(l.x+=i,l.y+=i,l.width-=i,l.height-=i):s==="w"?(l.x+=i,l.width-=i):s==="sw"?(l.x+=i,l.width-=i,l.height-=i):s==="ne"?(l.y-=i,l.width+=i,l.height+=i):s==="e"?l.width+=i:s==="se"&&(l.width+=i,l.height+=i)),t==="ArrowUp"?s==="nw"?(l.x-=i,l.y-=i,l.width+=i,l.height+=i):s==="n"?(l.y-=i,l.height+=i):s==="ne"?(l.y-=i,l.width+=i,l.height+=i):s==="sw"?(l.x+=i,l.width-=i,l.height-=i):s==="s"?l.height-=i:s==="se"&&(l.width-=i,l.height-=i):t==="ArrowDown"&&(s==="nw"?(l.x+=i,l.y+=i,l.width-=i,l.height-=i):s==="n"?(l.y+=i,l.height-=i):s==="ne"?(l.y+=i,l.width-=i,l.height-=i):s==="sw"?(l.x-=i,l.width+=i,l.height+=i):s==="s"?l.height+=i:s==="se"&&(l.width+=i,l.height+=i)),l}const Lb={capture:!0,passive:!1};let $Ye=0;const t1=class Mh extends k.PureComponent{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=k.createRef(),this.mediaRef=k.createRef(),this.initChangeCalled=!1,this.instanceId=`rc-${$Ye++}`,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=t=>{const{crop:i,disabled:s}=this.props,l=this.getBox();if(!i)return;const d=np(i,l.width,l.height);if(s)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const u=t.target.dataset.ord,p=!!u;let g=t.clientX,_=t.clientY,y=d.x,E=d.y;if(u){const b=t.clientX-l.x,A=t.clientY-l.y;let N=0,O=0;u==="ne"||u=="e"?(N=b-(d.x+d.width),O=A-d.y,y=d.x,E=d.y+d.height):u==="se"||u==="s"?(N=b-(d.x+d.width),O=A-(d.y+d.height),y=d.x,E=d.y):u==="sw"||u=="w"?(N=b-d.x,O=A-(d.y+d.height),y=d.x+d.width,E=d.y):(u==="nw"||u=="n")&&(N=b-d.x,O=A-d.y,y=d.x+d.width,E=d.y+d.height),g=y+l.x+N,_=E+l.y+O}this.evData={startClientX:g,startClientY:_,startCropX:y,startCropY:E,clientX:t.clientX,clientY:t.clientY,isResize:p,ord:u},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=t=>{const{crop:i,disabled:s,locked:l,keepSelection:d,onChange:u}=this.props,p=this.getBox();if(s||l||d&&i)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const g=t.clientX-p.x,_=t.clientY-p.y,y={unit:"px",x:g,y:_,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:g,startCropY:_,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,u(np(y,p.width,p.height),a1(y,p.width,p.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=t=>{const{crop:i,disabled:s,onChange:l,onDragStart:d}=this.props,u=this.getBox();if(s||!i||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,d&&d(t));const{evData:p}=this;p.clientX=t.clientX,p.clientY=t.clientY;let g;p.isResize?g=this.resizeCrop():g=this.dragCrop(),afe(i,g)||l(np(g,u.width,u.height),a1(g,u.width,u.height))},this.onComponentKeyDown=t=>{const{crop:i,disabled:s,onChange:l,onComplete:d}=this.props;if(s)return;const u=t.key;let p=!1;if(!i)return;const g=this.getBox(),_=this.makePixelCrop(g),y=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Mh.nudgeStepLarge:t.shiftKey?Mh.nudgeStepMedium:Mh.nudgeStep;if(u==="ArrowLeft"?(_.x-=y,p=!0):u==="ArrowRight"?(_.x+=y,p=!0):u==="ArrowUp"?(_.y-=y,p=!0):u==="ArrowDown"&&(_.y+=y,p=!0),p){t.cancelable&&t.preventDefault(),_.x=Pb(_.x,0,g.width-_.width),_.y=Pb(_.y,0,g.height-_.height);const E=np(_,g.width,g.height),b=a1(_,g.width,g.height);l(E,b),d&&d(E,b)}},this.onHandlerKeyDown=(t,i)=>{const{aspect:s=0,crop:l,disabled:d,minWidth:u=0,minHeight:p=0,maxWidth:g,maxHeight:_,onChange:y,onComplete:E}=this.props,b=this.getBox();if(d||!l)return;if(t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="ArrowLeft"||t.key==="ArrowRight")t.stopPropagation(),t.preventDefault();else return;const A=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?Mh.nudgeStepLarge:t.shiftKey?Mh.nudgeStepMedium:Mh.nudgeStep,N=np(l,b.width,b.height),O=WYe(N,t.key,A,i),D=ofe(O,s,i,b.width,b.height,u,p,g,_);if(!afe(l,D)){const P=a1(D,b.width,b.height);y(D,P),E&&E(D,P)}},this.onDocPointerDone=t=>{const{crop:i,disabled:s,onComplete:l,onDragEnd:d}=this.props,u=this.getBox();this.unbindDocMove(),!(s||!i)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,d&&d(t),l&&l(np(i,u.width,u.height),a1(i,u.width,u.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=()=>{var t;(t=this.componentRef.current)==null||t.scrollTo(0,0)}}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:i,y:s,width:l,height:d}=t.getBoundingClientRect();return{x:i,y:s,width:l,height:d}}componentDidUpdate(t){const{crop:i,onComplete:s}=this.props;if(s&&!t.crop&&i){const{width:l,height:d}=this.getBox();l&&d&&s(np(i,l,d),a1(i,l,d))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Lb),this.document.addEventListener("pointerup",this.onDocPointerDone,Lb),this.document.addEventListener("pointercancel",this.onDocPointerDone,Lb),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Lb),this.document.removeEventListener("pointerup",this.onDocPointerDone,Lb),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Lb),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,i=this.getBox(),s=this.makePixelCrop(i),l=t.clientX-t.startClientX,d=t.clientY-t.startClientY;return s.x=Pb(t.startCropX+l,0,i.width-s.width),s.y=Pb(t.startCropY+d,0,i.height-s.height),s}getPointRegion(t,i,s,l){const{evData:d}=this,u=d.clientX-t.x,p=d.clientY-t.y;let g;l&&i?g=i==="nw"||i==="n"||i==="ne":g=p<d.startCropY;let _;return s&&i?_=i==="nw"||i==="w"||i==="sw":_=u<d.startCropX,_?g?"nw":"sw":g?"ne":"se"}resolveMinDimensions(t,i,s=0,l=0){const d=Math.min(s,t.width),u=Math.min(l,t.height);return!i||!d&&!u?[d,u]:i>1?d?[d,d/i]:[u*i,u]:u?[u*i,u]:[d,d/i]}resizeCrop(){const{evData:t}=this,{aspect:i=0,maxWidth:s,maxHeight:l}=this.props,d=this.getBox(),[u,p]=this.resolveMinDimensions(d,i,this.props.minWidth,this.props.minHeight);let g=this.makePixelCrop(d);const _=this.getPointRegion(d,t.ord,u,p),y=t.ord||_;let E=t.clientX-t.startClientX,b=t.clientY-t.startClientY;(u&&y==="nw"||y==="w"||y==="sw")&&(E=Math.min(E,-u)),(p&&y==="nw"||y==="n"||y==="ne")&&(b=Math.min(b,-p));const A={unit:"px",x:0,y:0,width:0,height:0};_==="ne"?(A.x=t.startCropX,A.width=E,i?(A.height=A.width/i,A.y=t.startCropY-A.height):(A.height=Math.abs(b),A.y=t.startCropY-A.height)):_==="se"?(A.x=t.startCropX,A.y=t.startCropY,A.width=E,i?A.height=A.width/i:A.height=b):_==="sw"?(A.x=t.startCropX+E,A.y=t.startCropY,A.width=Math.abs(E),i?A.height=A.width/i:A.height=b):_==="nw"&&(A.x=t.startCropX+E,A.width=Math.abs(E),i?(A.height=A.width/i,A.y=t.startCropY-A.height):(A.height=Math.abs(b),A.y=t.startCropY+b));const N=ofe(A,i,_,d.width,d.height,u,p,s,l);return i||Mh.xyOrds.indexOf(y)>-1?g=N:Mh.xOrds.indexOf(y)>-1?(g.x=N.x,g.width=N.width):Mh.yOrds.indexOf(y)>-1&&(g.y=N.y,g.height=N.height),g.x=Pb(g.x,0,d.width-g.width),g.y=Pb(g.y,0,d.height-g.height),g}renderCropSelection(){const{ariaLabels:t=Mh.defaultProps.ariaLabels,disabled:i,locked:s,renderSelectionAddon:l,ruleOfThirds:d,crop:u}=this.props,p=this.getCropStyle();if(u)return dn.createElement("div",{style:p,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!s&&dn.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},dn.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),dn.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"nw"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"n"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"ne"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"e"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"se"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"s"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"sw"),role:"button"}),dn.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:g=>this.onHandlerKeyDown(g,"w"),role:"button"})),l&&dn.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:g=>g.stopPropagation()},l(this.state)),d&&dn.createElement(dn.Fragment,null,dn.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),dn.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(t){const i={...A7,...this.props.crop||{}};return np(i,t.width,t.height)}render(){const{aspect:t,children:i,circularCrop:s,className:l,crop:d,disabled:u,locked:p,style:g,ruleOfThirds:_}=this.props,{cropIsActive:y,newCropIsBeingDrawn:E}=this.state,b=d?this.renderCropSelection():null,A=zYe("ReactCrop",l,y&&"ReactCrop--active",u&&"ReactCrop--disabled",p&&"ReactCrop--locked",E&&"ReactCrop--new-crop",d&&t&&"ReactCrop--fixed-aspect",d&&s&&"ReactCrop--circular-crop",d&&_&&"ReactCrop--rule-of-thirds",!this.dragStarted&&d&&!d.width&&!d.height&&"ReactCrop--invisible-crop",s&&"ReactCrop--no-animate");return dn.createElement("div",{ref:this.componentRef,className:A,style:g},dn.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},i),d?dn.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},dn.createElement("defs",null,dn.createElement("mask",{id:`hole-${this.instanceId}`},dn.createElement("rect",{width:"100%",height:"100%",fill:"white"}),s?dn.createElement("ellipse",{cx:`${d.x+d.width/2}${d.unit}`,cy:`${d.y+d.height/2}${d.unit}`,rx:`${d.width/2}${d.unit}`,ry:`${d.height/2}${d.unit}`,fill:"black"}):dn.createElement("rect",{x:`${d.x}${d.unit}`,y:`${d.y}${d.unit}`,width:`${d.width}${d.unit}`,height:`${d.height}${d.unit}`,fill:"black"}))),dn.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,b)}};t1.xOrds=["e","w"],t1.yOrds=["n","s"],t1.xyOrds=["nw","ne","se","sw"],t1.nudgeStep=1,t1.nudgeStepMedium=10,t1.nudgeStepLarge=100,t1.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};let KYe=t1;function qYe(n,t,i){k.useEffect(()=>{const s=setTimeout(()=>{n.apply(void 0,i)},t);return()=>{clearTimeout(s)}},i)}const YYe=Math.PI/180;async function XYe(n,t,i,s=1,l=0){const d=t.getContext("2d");if(!d)throw new Error("No 2d context");const u=n.naturalWidth/n.width,p=n.naturalHeight/n.height,g=window.devicePixelRatio;t.width=Math.floor(i.width*u*g),t.height=Math.floor(i.height*p*g),d.scale(g,g),d.imageSmoothingQuality="low";const _=i.x*u,y=i.y*p,E=l*YYe,b=n.naturalWidth/2,A=n.naturalHeight/2;d.save(),d.translate(-_,-y),d.translate(b,A),d.rotate(E),d.scale(s,s),d.translate(-b,-A),d.drawImage(n,0,0,n.naturalWidth,n.naturalHeight,0,0,n.naturalWidth,n.naturalHeight),d.restore()}function JYe(n,t,i){return GYe(HYe({unit:"%",width:90},i,n,t),n,t)}function QYe({src:n,fileExtension:t,fileType:i,setCropFile:s,setCropFileURL:l,setShowCropper:d}){const[u,p]=k.useState(""),[g,_]=k.useState(),[y,E]=k.useState(),[b,A]=k.useState(1),[N,O]=k.useState(0),[D,P]=k.useState(1),j=k.useRef(null),M=k.useRef(null),V=k.useRef("");k.useRef(null),k.useEffect(()=>{p(n)},[n]);function H(Y){if(D){const{width:le,height:ae}=Y.currentTarget;_(JYe(le,ae,D))}}function $(){console.log("handleCancelCrop"),p(""),_(null),E(null),d(!1)}qYe(async()=>{y!=null&&y.width&&(y!=null&&y.height)&&j.current&&M.current&&(console.log(j.current),console.log(M.current),XYe(j.current,M.current,y,b,N))},100,[y,b,N]);async function Q(){console.log("handleSaveCrop called...");const Y=j.current,le=M.current;if(!Y||!le||!y)throw new Error("Crop canvas does not exist");console.log(le,"previewCanvas --");const ae=Y.naturalWidth/Y.width,te=Y.naturalHeight/Y.height;console.log("scaleX = ",ae),console.log("scaleY = ",te);const de=new OffscreenCanvas(y.width*b,y.height*b),G=de.getContext("2d");if(!G)throw new Error("No 2d context");G.drawImage(le,0,0,le.width,le.height,0,0,de.width,de.height);const ie=await de.convertToBlob(()=>{},{type:i||"image/jpg"});console.log("blob = ",ie),s(ie),V.current&&URL.revokeObjectURL(V.current),V.current=URL.createObjectURL(ie),l(V.current),d(!1),console.log("Download url = ",V.current)}return h.jsx(h.Fragment,{children:h.jsxs("div",{children:[!!y&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"d-flex justify-content-center mb-2 position-relative",children:[h.jsx(Pt,{type:"button",onClick:$,className:"btn-theme btn-gray flex-grow-1 me-1",children:"Cancel"},"cancel-crop"),h.jsx(Pt,{type:"button",onClick:Q,className:"btn-theme btn-secondary flex-grow-1 ms-1",children:"Submit"},"download-crop")]})}),!!u&&h.jsx(KYe,{crop:g,onChange:(Y,le)=>_(le),onComplete:Y=>{E(Y)},aspect:D,minHeight:100,children:h.jsx("img",{ref:j,alt:"Crop me",src:u,style:{transform:`scale(${b}) rotate(${N}deg)`},onLoad:H})}),!!y&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"opacity-0 visibility-hidden",style:{height:.1},children:h.jsx("canvas",{ref:M,style:{border:"1px solid black",objectFit:"contain",width:y.width,height:y.height}})})})]})})}function ZYe({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,getUserProfile:d}){Ii();const[p,g]=k.useState(),[_,y]=k.useState(!1),[E,b]=k.useState(0),[A,N]=k.useState(null),[O,D]=k.useState(""),[P,j]=k.useState(!1);k.useState(!1);const[M,V]=k.useState(!1);k.useState();const[H,$]=k.useState(),[Q,Y]=k.useState(),[le,ae]=k.useState(),[te,de]=k.useState(!1),G=k.useRef(null),ie=k.useRef(null),_e=k.useRef(null),he={title:""},Ce=uc({}),fe=n?n==="pdf"?".pdf":`${n}/*`:"image/*",me=n!==""?"user":"",Ne=n?`${n}-gallery-file`:"media-gallery-file",Fe=n?`${n}-camera-file`:"media-camera-file";function je(Be){if(console.log("Inside handleChange =",Be.target.files[0]),Be.target.files[0]){g(Be.target.files[0]),y(!0);const Xe=kR(Be.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",Xe," type = ",typeof Xe),N(Xe),n==="image"&&Be.target.files[0].size>25*1024*1024?D(""):D(Be.target.files[0].name),n){case"image":console.log("Image Preview =",G.current);let we=URL.createObjectURL(Be.target.files[0]);$(we),de(!0);break;default:console.log("No case matched...")}}}function Ve(){if(p)switch(g(null),y(!1),D(""),ie.current&&(ie.current.value=""),_e.current&&(_e.current.value=""),n){case"image":console.log("Image Preview =",G.current),G.current.src="",G.current.className="d-none",Y(null),ae("");break;default:console.log("No case matched...")}}const Re=async(Be,{resetForm:Xe})=>{if(console.log("Form Values :",Be),console.log("mediaUrl in onSubmit =",O),O===""){Qt("Upload Valid File","error");return}j(!0);const we={fileextention:p.name.substring(p.name.lastIndexOf(".")+1),modulename:"profile"};console.log("data for getSignedUrl = ",we);const Ge=await hs.getSignedUploadUrl(we),rt=Q,pt={headers:{},onUploadProgress:function(Je){const _t=Math.round(Je.loaded*100/Je.total);b(_t)}};console.log(pt);const Ze=await zr.put(Ge.data.data.uploadURL,rt,pt);if(console.log("result =",Ze),console.log("result status =",Ze.status),Ze.status===200){console.log("uploadProgress =",E);const Je={avatar:Ge.data.data.resourceUrl};console.log("uploadResponseData = ",Je),hs.updateUserProfile(Je).then(_t=>{if(console.log(_t),_t.data.status==="success"){console.log("Suucess res from update = ",_t.data.data.profile);const Xt=_t.data.data.profile;Qt("Profile Photo Updated","success"),Xe({}),V(!1),b(0),j(!1),g(null),y(!1),l(),d();const Ht={avatar:Xt.avatar,firstname:Xt.firstname,lastname:Xt.lastname,name:`${Xt.firstname} ${Xt.lastname}`,phone:Xt.phone};Ai.setAuthUser(Ht)}else _t.data.status==="failed"&&(console.log("ERROR:",_t.data.error),Qt("Failed to update Profile Photo!","error"),Xe({}),V(!1),b(0),j(!1),g(null),y(!1),l())}).catch(_t=>{console.log(_t)})}console.log("Outside if uploadProgress =",E)};return h.jsxs(h.Fragment,{children:[h.jsx(et,{className:"mb-1",children:h.jsxs(et.Body,{className:"p-1 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:"25 mb"})," ","."]})}),h.jsx(id,{initialValues:he,validationSchema:Ce,onSubmit:Re,children:Be=>{var Xe,we;return h.jsxs(kt,{className:"form_style",onSubmit:Be.handleSubmit,children:[h.jsxs(kt.Group,{className:`form-group rounded_corners mb-2 ${te?"opacity-0 visibility-hidden":""}`,style:{height:te?"0px":"auto"},children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex justify-content- mb-1 pt-2",children:h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:ie,name:Fe,id:Fe,className:"uploadMediafile",capture:me,accept:fe,onChange:je}),h.jsx("label",{htmlFor:Fe,className:"justify-content-center px-3 capture-btn",children:"Camera"})]}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:_e,name:Ne,id:Ne,className:"uploadMediafile",accept:fe,onChange:je}),h.jsx("label",{htmlFor:Ne,className:"justify-content-center px-3 gallery-btn",children:"Gallery"})]})]})})]}),E>0&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-0",children:[h.jsx("progress",{value:E,max:"100"}),h.jsx("span",{className:"font-12 fw-sb ps-2",children:`${E}%`})]}),!te&&le&&h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Pt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${_?"d-block":"d-none"}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:Ve,children:h.jsx(Zt,{tag:"delete7",className:"font-26"})}),h.jsx(Jd,{aspectRatio:"1x1",className:"preview-container",children:h.jsx(h.Fragment,{children:n==="image"&&h.jsx("img",{ref:G,src:le,alt:"preview image",className:`img-fluid mx-auto ${le?"d-block":"d-none"} `})})})]}),h.jsx("div",{className:`btn-wrap pt-3 d-flex justify-content-center position-fixed bg-white border-top pt-3 pb-4 px-3 ${te?"opacity-0 visibility-hidden":""}`,style:{bottom:0,right:0,left:0},children:h.jsx(Pt,{type:"submit",disabled:!Be.isValid,className:"btn-theme btn-primary btn-md w-100",children:P?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Be.isValid,"Update")})}),te&&h.jsx("div",{className:"my-1",children:H&&h.jsx(QYe,{src:H,fileExtension:(we=p==null?void 0:p.name)==null?void 0:we.substring(((Xe=p==null?void 0:p.name)==null?void 0:Xe.lastIndexOf("."))+1),fileType:p==null?void 0:p.type,setCropFile:Y,setCropFileURL:ae,setShowCropper:de})})]})}})]})}function eXe(n){return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:"Update Profile Photo"})}),h.jsx(vn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:h.jsx(ZYe,{mediaType:"image",handleClose:n.handleClose,getUserProfile:n.getUserProfile})})]})})}function tXe(n){var A,N,O,D,P,j,M;const[t,i]=k.useState(!1),[s,l]=k.useState(!1),d=Pv((A=n.userProfile)==null?void 0:A.firstname,(N=n.userProfile)==null?void 0:N.lastname),u=$R((O=n.userProfile)==null?void 0:O.designation),p=(D=n.userProfile)!=null&&D.phone?(P=n.userProfile)==null?void 0:P.phone:"",g=()=>{i(!1)},_=()=>{i(!0)},y=()=>{l(!1)},E=V=>{l(!0)},b=()=>{console.log("handleShowLikesBtnClick called..."),_()};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(TQ,{userProfile:n.userProfile,profileImg:(j=n.userProfile)==null?void 0:j.avatar,profileName:d,profileDesig:u,isEdit:!0,handleEditProfile:b,handleShowUpdateProfilePhotoModal:E}),h.jsxs("div",{className:"profile-quick-contact py-3 d-grid gap-2",children:[h.jsx(tfe,{contactType:"email",contactValue:(M=n.userProfile)==null?void 0:M.email}),h.jsx(tfe,{contactType:"mobile",contactValue:p}),h.jsx(bYe,{userProfile:n.userProfile})]})]}),h.jsx(TYe,{show:t,handleClose:g,userProfile:n.userProfile,getUserProfile:n.getUserProfile}),h.jsx(eXe,{show:s,handleClose:y,getUserProfile:n.getUserProfile})]})}const nXe=[{id:"appre-1",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"2 hours ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-2",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"5 hours ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-3",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"1 day ago",icon:"star-icon.png",isActionBtn:!1},{id:"appre-4",type:"appreciation",text:"Vishal Jagtap appreciated Sourabh Penkar",sender:"Vishal Jagtap",receiver:"Sourabh Penkar",time:"1 day ago",icon:"star-icon.png",isActionBtn:!1}],iXe=[{id:"badge-1",type:"badge",text:"Fatest fifty",time:"2 hours ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-2",type:"badge",text:"Fatest fifty",time:"1 day ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-3",type:"badge",text:"Fatest fifty",time:"1 day ago",points:44,icon:"warranty-icon.png",isActionBtn:!1},{id:"badge-4",type:"badge",text:"Fatest fifty",time:"5 hours ago",points:44,icon:"warranty-icon.png",isActionBtn:!1}];function rXe(n){k.useState(nXe),k.useState(iXe),k.useState(fY);const[t,i]=k.useState(null),[s,l]=k.useState(!1);k.useContext(QR);async function d(){l(!0),hs.getUserProfile().then(u=>{var p;u.data.status==="success"&&u.data.data&&(console.log("getUserProfile success =",u.data.data),i((p=u.data.data)==null?void 0:p.profile))}).catch(u=>{console.log("getUserProfile() catch block error =",u)}).finally(()=>{l(!1)})}return k.useEffect(()=>{d()},[]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[!t&&s&&h.jsx(ci,{type:""}),!t&&!s&&h.jsx(et,{className:"card-theme",children:h.jsx(et.Body,{children:"No data found."})}),t&&h.jsx(tXe,{userProfile:t,getUserProfile:d})]})})}function sXe(){const[n,t]=k.useState(!0),{state:i}=Xo();return console.log("Data passed via navigate = ",i),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"rati0 ratio-1x1 position-relativ px-0",style:{height:"calc(100vh - 160px)",zIndex:1},children:[n?h.jsx(ci,{type:"iframe-loader"}):null,h.jsx("iframe",{src:`${i.url}`,title:"Metric Reports",onLoad:()=>t(!1),className:`no-scrollbar ${n?"opacity-0":""}`,sandbox:"allow-scripts",height:"100%",width:"100%"})]})})}function aXe(){k.useState(!0);const{state:n}=Xo();return console.log("url = ",n.url),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"ratio ratio-1x1 position-relative",style:{height:"calc(100vh - 160px)",zIndex:1},children:h.jsx("iframe",{src:`${n.url}`,"default-src":"*",title:"QuickActionContent",height:"100%",width:"100%"})})})}function oXe(n){var N,O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe,me,Ne,Fe,je,Ve,Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t,Xt,Ht,gn,It;k.useState(!1);const t=(N=n==null?void 0:n.item)!=null&&N.name?(O=n==null?void 0:n.item)==null?void 0:O.name:"Default title",i=(D=n.item)!=null&&D.image?(P=n.item)==null?void 0:P.image:"/img/default-bg.jpg",s=(j=n.item)!=null&&j.description?(M=n.item)==null?void 0:M.description:"",l=(H=(V=n.item)==null?void 0:V.user_info)!=null&&H.name?(Q=($=n.item)==null?void 0:$.user_info)==null?void 0:Q.name:"";(le=(Y=n.item)==null?void 0:Y.user_info)!=null&&le.avatar&&((te=(ae=n.item)==null?void 0:ae.user_info)==null||te.avatar);const d=(de=n.item)!=null&&de.comment_count?(G=n.item)==null?void 0:G.comment_count:0,u=(ie=n.item)!=null&&ie.likes_count?(_e=n.item)==null?void 0:_e.likes_count:0,p=(Ce=(he=n.item)==null?void 0:he.completion)!=null&&Ce.count?(me=(fe=n.item)==null?void 0:fe.completion)==null?void 0:me.count:0,g=(Fe=(Ne=n.item)==null?void 0:Ne.completion)!=null&&Fe.total?(Ve=(je=n.item)==null?void 0:je.completion)==null?void 0:Ve.total:0,_=isNaN(Math.round(p/g*100))?0:Math.round(p/g*100);(Re=n.item)!=null&&Re.has_expiry&&((Be=n.item)==null||Be.has_expiry);const y=(we=(Xe=n.item)==null?void 0:Xe.expiry_date)!=null&&we.day?(rt=(Ge=n.item)==null?void 0:Ge.expiry_date)==null?void 0:rt.day:"",E=(Ze=(pt=n.item)==null?void 0:pt.expiry_date)!=null&&Ze.month?(_t=(Je=n.item)==null?void 0:Je.expiry_date)==null?void 0:_t.month:"";(Ht=(Xt=n.item)==null?void 0:Xt.expiry_date)!=null&&Ht.year&&((It=(gn=n.item)==null?void 0:gn.expiry_date)==null||It.year);let b=n!=null&&n.className?n==null?void 0:n.className:"";function A(xt){n.handleMagazineCardClick(xt.id)}return h.jsxs(et,{className:`border-0 card-theme magazine-card overflow-hidden ${b}`,onClick:()=>A(n.item),children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3",children:t}),h.jsx(us,{src:i,alt:`${t} image`,wrapperClassName:"card-img"}),h.jsx(et.Body,{className:"p-2 p-sm-3",children:h.jsxs("div",{className:"font-13 mb-1",children:[h.jsxs("div",{className:"mb-1",children:[h.jsx("span",{className:"text-theme-primary mb-2",children:"Published By: "})," ",l]}),h.jsx(YO,{text:s,linesToShow:2,containerClass:"magazine-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0"})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-2 py-sm-3 d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"120px"},children:g!==0&&h.jsxs(h.Fragment,{children:[h.jsx(bQ,{now:_,className:"flex-grow-1"}),h.jsxs("div",{className:"d-flex font-12 ps-2",children:[h.jsx("span",{className:"fw-b",children:p}),"/",h.jsx("span",{children:g})]})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Pt,{className:"btn-theme btn-sm btn-likes-light px-2 pe-none visibility-hidden opacity-0",children:[h.jsx(Zt,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Pt,{className:"btn-theme btn-sm btn-gray px-2 pe-none visibility-hidden opacity-0",children:[h.jsx(Zt,{tag:"message8",className:"font-18"})," ",d]}),h.jsxs(Pt,{className:"btn-theme btn-sm btn-date btn-transparent px-0 pe-none",children:[h.jsx(Zt,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"",children:`${y} ${E}`})]})]})]})]})}function lXe(){const n=Ii(),[t,i]=k.useState(""),s=["name","user_info.name"],l=async()=>{var A,N;try{const O=await hs.getAllMagazines();return console.log("fetchAllMagazines RES - ",O),O.data.status==="success"?(console.log("## Dashboard Mags res --",O),(N=(A=O.data)==null?void 0:A.data)==null?void 0:N.magazines):[]}catch{throw new Error("Error fetching all magazines")}},{isPending:d,isFetching:u,isError:p,data:g,error:_}=Qd({queryKey:["allMagazinesQuery"],queryFn:l});console.log("## fetchAllMagazines - ",g);const y=(A,N)=>N.split(".").reduce((O,D)=>O&&O[D],A);k.useMemo(()=>{if(!t.trim())return g;const A=t.toLowerCase();return g.filter(N=>s.some(O=>{const D=y(N,O);return D==null?void 0:D.toLowerCase().includes(A)}))},[g,t]),k.useMemo(()=>{if(!t.trim())return g;const A=t.toLowerCase().split(" ").filter(Boolean);return g.filter(N=>A.some(O=>s.some(D=>{const P=y(N,D);return P==null?void 0:P.toLowerCase().includes(O)})))},[g,t]);const E=k.useMemo(()=>FO(g,t,s),[g,t]);console.log("filteredData3 - ",E);function b(A){A&&n(`/magazines/${A}`,{state:{pageTitle:"Magazine Details"}})}return d?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"pt-1 pb-1 py-sm-3",children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((A,N)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},N))})})}):p?h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"d-grid gap-3",children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more responses found."})})})})})}):h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[(g==null?void 0:g.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"py-0 pt-2 sticky-to",style:{},children:h.jsxs("div",{className:"pb-0",children:[h.jsx(XO,{filters:s,onSearch:A=>i(A),className:"mb-"}),(E==null?void 0:E.length)>0&&t.length>0&&h.jsx(Ga,{size:"sm",className:"px-1 text-gray9",children:`Results found ${E==null?void 0:E.length}`})]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-2",children:u&&(E==null?void 0:E.length)===0?h.jsx(h.Fragment,{children:[0,1].map((A,N)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},N))}):h.jsx(h.Fragment,{children:(E==null?void 0:E.length)>0?h.jsx("div",{className:"d-grid gap-3",children:E==null?void 0:E.map((A,N)=>h.jsx(oXe,{item:A,className:"shadow-sm ",handleMagazineCardClick:b},A.id))}):h.jsx("div",{className:"d-grid gap-3",children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"Data not found."})})})})})})]})})}var j_e=function(t,i,s){var l=document.head||document.getElementsByTagName("head")[0],d=document.createElement("script");typeof i=="function"&&(s=i,i={}),i=i||{},s=s||function(){},d.type=i.type||"text/javascript",d.charset=i.charset||"utf8",d.async="async"in i?!!i.async:!0,d.src=t,i.attrs&&cXe(d,i.attrs),i.text&&(d.text=""+i.text);var u="onload"in d?lfe:dXe;u(d,s),d.onload||lfe(d,s),l.appendChild(d)};function cXe(n,t){for(var i in t)n.setAttribute(i,t[i])}function lfe(n,t){n.onload=function(){this.onerror=this.onload=null,t(null,n)},n.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),n)}}function dXe(n,t){n.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,n))}}var uXe=function(t){return hXe(t)&&!fXe(t)};function hXe(n){return!!n&&typeof n=="object"}function fXe(n){var t=Object.prototype.toString.call(n);return t==="[object RegExp]"||t==="[object Date]"||gXe(n)}var pXe=typeof Symbol=="function"&&Symbol.for,mXe=pXe?Symbol.for("react.element"):60103;function gXe(n){return n.$$typeof===mXe}function vXe(n){return Array.isArray(n)?[]:{}}function eN(n,t){return t.clone!==!1&&t.isMergeableObject(n)?MR(vXe(n),n,t):n}function yXe(n,t,i){return n.concat(t).map(function(s){return eN(s,i)})}function _Xe(n,t){if(!t.customMerge)return MR;var i=t.customMerge(n);return typeof i=="function"?i:MR}function EXe(n){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n).filter(function(t){return Object.propertyIsEnumerable.call(n,t)}):[]}function cfe(n){return Object.keys(n).concat(EXe(n))}function U_e(n,t){try{return t in n}catch{return!1}}function wXe(n,t){return U_e(n,t)&&!(Object.hasOwnProperty.call(n,t)&&Object.propertyIsEnumerable.call(n,t))}function SXe(n,t,i){var s={};return i.isMergeableObject(n)&&cfe(n).forEach(function(l){s[l]=eN(n[l],i)}),cfe(t).forEach(function(l){wXe(n,l)||(U_e(n,l)&&i.isMergeableObject(t[l])?s[l]=_Xe(l,i)(n[l],t[l],i):s[l]=eN(t[l],i))}),s}function MR(n,t,i){i=i||{},i.arrayMerge=i.arrayMerge||yXe,i.isMergeableObject=i.isMergeableObject||uXe,i.cloneUnlessOtherwiseSpecified=eN;var s=Array.isArray(t),l=Array.isArray(n),d=s===l;return d?s?i.arrayMerge(n,t,i):SXe(n,t,i):eN(t,i)}MR.all=function(t,i){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(s,l){return MR(s,l,i)},{})};var bXe=MR,UU=bXe,CXe=Object.create,FU=Object.defineProperty,TXe=Object.getOwnPropertyDescriptor,RXe=Object.getOwnPropertyNames,xXe=Object.getPrototypeOf,AXe=Object.prototype.hasOwnProperty,IXe=(n,t)=>{for(var i in t)FU(n,i,{get:t[i],enumerable:!0})},F_e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of RXe(t))!AXe.call(n,l)&&l!==i&&FU(n,l,{get:()=>t[l],enumerable:!(s=TXe(t,l))||s.enumerable});return n},eZ=(n,t,i)=>(i=n!=null?CXe(xXe(n)):{},F_e(t||!n||!n.__esModule?FU(i,"default",{value:n,enumerable:!0}):i,n)),NXe=n=>F_e(FU({},"__esModule",{value:!0}),n),B_e={};IXe(B_e,{callPlayer:()=>$Xe,getConfig:()=>GXe,getSDK:()=>HXe,isBlobUrl:()=>qXe,isMediaStream:()=>KXe,lazy:()=>DXe,omit:()=>WXe,parseEndTime:()=>BXe,parseStartTime:()=>FXe,queryString:()=>zXe,randomString:()=>VXe,supportsWebKitPresentationMode:()=>YXe});var BU=NXe(B_e),OXe=eZ(k),PXe=eZ(j_e),LXe=eZ(UU);const DXe=n=>OXe.default.lazy(async()=>{const t=await n();return typeof t.default=="function"?t:t.default}),kXe=/[?&#](?:start|t)=([0-9hms]+)/,MXe=/[?&#]end=([0-9hms]+)/,pY=/(\d+)(h|m|s)/g,jXe=/^\d+$/;function V_e(n,t){if(n instanceof Array)return;const i=n.match(t);if(i){const s=i[1];if(s.match(pY))return UXe(s);if(jXe.test(s))return parseInt(s)}}function UXe(n){let t=0,i=pY.exec(n);for(;i!==null;){const[,s,l]=i;l==="h"&&(t+=parseInt(s,10)*60*60),l==="m"&&(t+=parseInt(s,10)*60),l==="s"&&(t+=parseInt(s,10)),i=pY.exec(n)}return t}function FXe(n){return V_e(n,kXe)}function BXe(n){return V_e(n,MXe)}function VXe(){return Math.random().toString(36).substr(2,5)}function zXe(n){return Object.keys(n).map(t=>`${t}=${n[t]}`).join("&")}function Z$(n){return window[n]?window[n]:window.exports&&window.exports[n]?window.exports[n]:window.module&&window.module.exports&&window.module.exports[n]?window.module.exports[n]:null}const Db={},HXe=function(t,i,s=null,l=()=>!0,d=PXe.default){const u=Z$(i);return u&&l(u)?Promise.resolve(u):new Promise((p,g)=>{if(Db[t]){Db[t].push({resolve:p,reject:g});return}Db[t]=[{resolve:p,reject:g}];const _=y=>{Db[t].forEach(E=>E.resolve(y))};if(s){const y=window[s];window[s]=function(){y&&y(),_(Z$(i))}}d(t,y=>{y?(Db[t].forEach(E=>E.reject(y)),Db[t]=null):s||_(Z$(i))})})};function GXe(n,t){return(0,LXe.default)(t.config,n.config)}function WXe(n,...t){const i=[].concat(...t),s={},l=Object.keys(n);for(const d of l)i.indexOf(d)===-1&&(s[d]=n[d]);return s}function $Xe(n,...t){if(!this.player||!this.player[n]){let i=`ReactPlayer: ${this.constructor.displayName} player could not call %c${n}%c – `;return this.player?this.player[n]||(i+="The method was not available"):i+="The player was not available",console.warn(i,"font-weight: bold",""),null}return this.player[n](...t)}function KXe(n){return typeof window<"u"&&typeof window.MediaStream<"u"&&n instanceof window.MediaStream}function qXe(n){return/^blob:/.test(n)}function YXe(n=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return n.webkitSupportsPresentationMode&&typeof n.webkitSetPresentationMode=="function"&&t}var tZ=Object.defineProperty,XXe=Object.getOwnPropertyDescriptor,JXe=Object.getOwnPropertyNames,QXe=Object.prototype.hasOwnProperty,ZXe=(n,t)=>{for(var i in t)tZ(n,i,{get:t[i],enumerable:!0})},eJe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of JXe(t))!QXe.call(n,l)&&l!==i&&tZ(n,l,{get:()=>t[l],enumerable:!(s=XXe(t,l))||s.enumerable});return n},tJe=n=>eJe(tZ({},"__esModule",{value:!0}),n),z_e={};ZXe(z_e,{AUDIO_EXTENSIONS:()=>nZ,DASH_EXTENSIONS:()=>t2e,FLV_EXTENSIONS:()=>n2e,HLS_EXTENSIONS:()=>rZ,MATCH_URL_DAILYMOTION:()=>J_e,MATCH_URL_FACEBOOK:()=>W_e,MATCH_URL_FACEBOOK_WATCH:()=>$_e,MATCH_URL_KALTURA:()=>e2e,MATCH_URL_MIXCLOUD:()=>Q_e,MATCH_URL_SOUNDCLOUD:()=>H_e,MATCH_URL_STREAMABLE:()=>K_e,MATCH_URL_TWITCH_CHANNEL:()=>X_e,MATCH_URL_TWITCH_VIDEO:()=>Y_e,MATCH_URL_VIDYARD:()=>Z_e,MATCH_URL_VIMEO:()=>G_e,MATCH_URL_WISTIA:()=>q_e,MATCH_URL_YOUTUBE:()=>mY,VIDEO_EXTENSIONS:()=>iZ,canPlay:()=>iJe});var nJe=tJe(z_e),dfe=BU;const mY=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,H_e=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,G_e=/vimeo\.com\/(?!progressive_redirect).+/,W_e=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,$_e=/^https?:\/\/fb\.watch\/.+$/,K_e=/streamable\.com\/([a-z0-9]+)$/,q_e=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Y_e=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,X_e=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,J_e=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,Q_e=/mixcloud\.com\/([^/]+\/[^/]+)/,Z_e=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,e2e=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,nZ=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,iZ=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,rZ=/\.(m3u8)($|\?)/i,t2e=/\.(mpd)($|\?)/i,n2e=/\.(flv)($|\?)/i,gY=n=>{if(n instanceof Array){for(const t of n)if(typeof t=="string"&&gY(t)||gY(t.src))return!0;return!1}return(0,dfe.isMediaStream)(n)||(0,dfe.isBlobUrl)(n)?!0:nZ.test(n)||iZ.test(n)||rZ.test(n)||t2e.test(n)||n2e.test(n)},iJe={youtube:n=>n instanceof Array?n.every(t=>mY.test(t)):mY.test(n),soundcloud:n=>H_e.test(n)&&!nZ.test(n),vimeo:n=>G_e.test(n)&&!iZ.test(n)&&!rZ.test(n),facebook:n=>W_e.test(n)||$_e.test(n),streamable:n=>K_e.test(n),wistia:n=>q_e.test(n),twitch:n=>Y_e.test(n)||X_e.test(n),dailymotion:n=>J_e.test(n),mixcloud:n=>Q_e.test(n),vidyard:n=>Z_e.test(n),kaltura:n=>e2e.test(n),file:gY};var sZ=Object.defineProperty,rJe=Object.getOwnPropertyDescriptor,sJe=Object.getOwnPropertyNames,aJe=Object.prototype.hasOwnProperty,oJe=(n,t)=>{for(var i in t)sZ(n,i,{get:t[i],enumerable:!0})},lJe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of sJe(t))!aJe.call(n,l)&&l!==i&&sZ(n,l,{get:()=>t[l],enumerable:!(s=rJe(t,l))||s.enumerable});return n},cJe=n=>lJe(sZ({},"__esModule",{value:!0}),n),i2e={};oJe(i2e,{default:()=>uJe});var dJe=cJe(i2e),Ed=BU,jc=nJe,uJe=[{key:"youtube",name:"YouTube",canPlay:jc.canPlay.youtube,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./YouTube-DOJoJw1y.js").then(n=>n.Y),__vite__mapDeps([])))},{key:"soundcloud",name:"SoundCloud",canPlay:jc.canPlay.soundcloud,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./SoundCloud-BHo3DXFQ.js").then(n=>n.S),__vite__mapDeps([])))},{key:"vimeo",name:"Vimeo",canPlay:jc.canPlay.vimeo,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Vimeo-7wPXSkaO.js").then(n=>n.V),__vite__mapDeps([])))},{key:"facebook",name:"Facebook",canPlay:jc.canPlay.facebook,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Facebook-GdwjnNFJ.js").then(n=>n.F),__vite__mapDeps([])))},{key:"streamable",name:"Streamable",canPlay:jc.canPlay.streamable,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Streamable-CLR8-BXj.js").then(n=>n.S),__vite__mapDeps([])))},{key:"wistia",name:"Wistia",canPlay:jc.canPlay.wistia,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Wistia-C0mY-yNe.js").then(n=>n.W),__vite__mapDeps([])))},{key:"twitch",name:"Twitch",canPlay:jc.canPlay.twitch,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Twitch-D8aS7IV_.js").then(n=>n.T),__vite__mapDeps([])))},{key:"dailymotion",name:"DailyMotion",canPlay:jc.canPlay.dailymotion,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./DailyMotion-i-TJ9DOC.js").then(n=>n.D),__vite__mapDeps([])))},{key:"mixcloud",name:"Mixcloud",canPlay:jc.canPlay.mixcloud,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Mixcloud-c3jBxJWc.js").then(n=>n.M),__vite__mapDeps([])))},{key:"vidyard",name:"Vidyard",canPlay:jc.canPlay.vidyard,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Vidyard-D-tpEbuM.js").then(n=>n.V),__vite__mapDeps([])))},{key:"kaltura",name:"Kaltura",canPlay:jc.canPlay.kaltura,lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./Kaltura-DDJp8-tW.js").then(n=>n.K),__vite__mapDeps([])))},{key:"file",name:"FilePlayer",canPlay:jc.canPlay.file,canEnablePIP:n=>jc.canPlay.file(n)&&(document.pictureInPictureEnabled||(0,Ed.supportsWebKitPresentationMode)())&&!jc.AUDIO_EXTENSIONS.test(n),lazyPlayer:(0,Ed.lazy)(()=>Xi(()=>import("./FilePlayer-BgLtBIje.js").then(n=>n.F),__vite__mapDeps([])))}],ufe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function hJe(n,t){return!!(n===t||ufe(n)&&ufe(t))}function fJe(n,t){if(n.length!==t.length)return!1;for(var i=0;i<n.length;i++)if(!hJe(n[i],t[i]))return!1;return!0}function pJe(n,t){t===void 0&&(t=fJe);var i,s=[],l,d=!1;function u(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];return d&&i===this&&t(p,s)||(l=n.apply(this,p),d=!0,i=this,s=p),l}return u}const mJe=Object.freeze(Object.defineProperty({__proto__:null,default:pJe},Symbol.toStringTag,{value:"Module"})),r2e=Wpe(mJe);var gJe=typeof Element<"u",vJe=typeof Map=="function",yJe=typeof Set=="function",_Je=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function iM(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){if(n.constructor!==t.constructor)return!1;var i,s,l;if(Array.isArray(n)){if(i=n.length,i!=t.length)return!1;for(s=i;s--!==0;)if(!iM(n[s],t[s]))return!1;return!0}var d;if(vJe&&n instanceof Map&&t instanceof Map){if(n.size!==t.size)return!1;for(d=n.entries();!(s=d.next()).done;)if(!t.has(s.value[0]))return!1;for(d=n.entries();!(s=d.next()).done;)if(!iM(s.value[1],t.get(s.value[0])))return!1;return!0}if(yJe&&n instanceof Set&&t instanceof Set){if(n.size!==t.size)return!1;for(d=n.entries();!(s=d.next()).done;)if(!t.has(s.value[0]))return!1;return!0}if(_Je&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(t)){if(i=n.length,i!=t.length)return!1;for(s=i;s--!==0;)if(n[s]!==t[s])return!1;return!0}if(n.constructor===RegExp)return n.source===t.source&&n.flags===t.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof t.valueOf=="function")return n.valueOf()===t.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof t.toString=="function")return n.toString()===t.toString();if(l=Object.keys(n),i=l.length,i!==Object.keys(t).length)return!1;for(s=i;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[s]))return!1;if(gJe&&n instanceof Element)return!1;for(s=i;s--!==0;)if(!((l[s]==="_owner"||l[s]==="__v"||l[s]==="__o")&&n.$$typeof)&&!iM(n[l[s]],t[l[s]]))return!1;return!0}return n!==n&&t!==t}var VU=function(t,i){try{return iM(t,i)}catch(s){if((s.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw s}},EJe=Object.create,zU=Object.defineProperty,wJe=Object.getOwnPropertyDescriptor,SJe=Object.getOwnPropertyNames,bJe=Object.getPrototypeOf,CJe=Object.prototype.hasOwnProperty,TJe=(n,t)=>{for(var i in t)zU(n,i,{get:t[i],enumerable:!0})},s2e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of SJe(t))!CJe.call(n,l)&&l!==i&&zU(n,l,{get:()=>t[l],enumerable:!(s=wJe(t,l))||s.enumerable});return n},RJe=(n,t,i)=>(i=n!=null?EJe(bJe(n)):{},s2e(t||!n||!n.__esModule?zU(i,"default",{value:n,enumerable:!0}):i,n)),xJe=n=>s2e(zU({},"__esModule",{value:!0}),n),a2e={};TJe(a2e,{defaultProps:()=>NJe,propTypes:()=>IJe});var o2e=xJe(a2e),AJe=RJe(uQ);const{string:Vl,bool:zl,number:kb,array:eK,oneOfType:gI,shape:Lu,object:Hl,func:Ma,node:hfe}=AJe.default,IJe={url:gI([Vl,eK,Hl]),playing:zl,loop:zl,controls:zl,volume:kb,muted:zl,playbackRate:kb,width:gI([Vl,kb]),height:gI([Vl,kb]),style:Hl,progressInterval:kb,playsinline:zl,pip:zl,stopOnUnmount:zl,light:gI([zl,Vl,Hl]),playIcon:hfe,previewTabIndex:kb,fallback:hfe,oEmbedUrl:Vl,wrapper:gI([Vl,Ma,Lu({render:Ma.isRequired})]),config:Lu({soundcloud:Lu({options:Hl}),youtube:Lu({playerVars:Hl,embedOptions:Hl,onUnstarted:Ma}),facebook:Lu({appId:Vl,version:Vl,playerId:Vl,attributes:Hl}),dailymotion:Lu({params:Hl}),vimeo:Lu({playerOptions:Hl,title:Vl}),file:Lu({attributes:Hl,tracks:eK,forceVideo:zl,forceAudio:zl,forceHLS:zl,forceSafariHLS:zl,forceDisableHls:zl,forceDASH:zl,forceFLV:zl,hlsOptions:Hl,hlsVersion:Vl,dashVersion:Vl,flvVersion:Vl}),wistia:Lu({options:Hl,playerId:Vl,customControls:eK}),mixcloud:Lu({options:Hl}),twitch:Lu({options:Hl,playerId:Vl}),vidyard:Lu({options:Hl})}),onReady:Ma,onStart:Ma,onPlay:Ma,onPause:Ma,onBuffer:Ma,onBufferEnd:Ma,onEnded:Ma,onError:Ma,onDuration:Ma,onSeek:Ma,onPlaybackRateChange:Ma,onPlaybackQualityChange:Ma,onProgress:Ma,onClickPreview:Ma,onEnablePIP:Ma,onDisablePIP:Ma},Lo=()=>{},NJe={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Lo},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Lo,onStart:Lo,onPlay:Lo,onPause:Lo,onBuffer:Lo,onBufferEnd:Lo,onEnded:Lo,onError:Lo,onDuration:Lo,onSeek:Lo,onPlaybackRateChange:Lo,onPlaybackQualityChange:Lo,onProgress:Lo,onClickPreview:Lo,onEnablePIP:Lo,onDisablePIP:Lo};var OJe=Object.create,JO=Object.defineProperty,PJe=Object.getOwnPropertyDescriptor,LJe=Object.getOwnPropertyNames,DJe=Object.getPrototypeOf,kJe=Object.prototype.hasOwnProperty,MJe=(n,t,i)=>t in n?JO(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,jJe=(n,t)=>{for(var i in t)JO(n,i,{get:t[i],enumerable:!0})},l2e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of LJe(t))!kJe.call(n,l)&&l!==i&&JO(n,l,{get:()=>t[l],enumerable:!(s=PJe(t,l))||s.enumerable});return n},c2e=(n,t,i)=>(i=n!=null?OJe(DJe(n)):{},l2e(t||!n||!n.__esModule?JO(i,"default",{value:n,enumerable:!0}):i,n)),UJe=n=>l2e(JO({},"__esModule",{value:!0}),n),ca=(n,t,i)=>(MJe(n,typeof t!="symbol"?t+"":t,i),i),d2e={};jJe(d2e,{default:()=>HU});var FJe=UJe(d2e),ffe=c2e(k),BJe=c2e(VU),u2e=o2e,VJe=BU;const zJe=5e3;let HU=class extends ffe.Component{constructor(){super(...arguments),ca(this,"mounted",!1),ca(this,"isReady",!1),ca(this,"isPlaying",!1),ca(this,"isLoading",!0),ca(this,"loadOnReady",null),ca(this,"startOnPlay",!0),ca(this,"seekOnPlay",null),ca(this,"onDurationCalled",!1),ca(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),ca(this,"getInternalPlayer",t=>this.player?this.player[t]:null),ca(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,i=this.getSecondsLoaded(),s=this.getDuration();if(s){const l={playedSeconds:t,played:t/s};i!==null&&(l.loadedSeconds=i,l.loaded=i/s),(l.playedSeconds!==this.prevPlayed||l.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(l),this.prevPlayed=l.playedSeconds,this.prevLoaded=l.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),ca(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:i,volume:s,muted:l}=this.props;t(),!l&&s!==null&&this.player.setVolume(s),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):i&&this.player.play(),this.handleDurationCheck()}),ca(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:i,playbackRate:s}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&s!==1&&this.player.setPlaybackRate(s),t(),this.startOnPlay=!1),i(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),ca(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),ca(this,"handleEnded",()=>{const{activePlayer:t,loop:i,onEnded:s}=this.props;t.loopOnEnded&&i&&this.seekTo(0),i||(this.isPlaying=!1,s())}),ca(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),ca(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),ca(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:i,playing:s,volume:l,muted:d,playbackRate:u,pip:p,loop:g,activePlayer:_,disableDeferredLoading:y}=this.props;if(!(0,BJe.default)(t.url,i)){if(this.isLoading&&!_.forceLoad&&!y&&!(0,VJe.isMediaStream)(i)){console.warn(`ReactPlayer: the attempt to load ${i} is being deferred until the player has loaded`),this.loadOnReady=i;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(i,this.isReady)}!t.playing&&s&&!this.isPlaying&&this.player.play(),t.playing&&!s&&this.isPlaying&&this.player.pause(),!t.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==l&&l!==null&&this.player.setVolume(l),t.muted!==d&&(d?this.player.mute():(this.player.unmute(),l!==null&&setTimeout(()=>this.player.setVolume(l)))),t.playbackRate!==u&&this.player.setPlaybackRate&&this.player.setPlaybackRate(u),t.loop!==g&&this.player.setLoop&&this.player.setLoop(g)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,i,s){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},zJe));return}if(i?i==="fraction":t>0&&t<1){const d=this.player.getDuration();if(!d){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(d*t,s);return}this.player.seekTo(t,s)}render(){const t=this.props.activePlayer;return t?ffe.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}};ca(HU,"displayName","Player");ca(HU,"propTypes",u2e.propTypes);ca(HU,"defaultProps",u2e.defaultProps);var HJe=Object.create,QO=Object.defineProperty,GJe=Object.getOwnPropertyDescriptor,WJe=Object.getOwnPropertyNames,$Je=Object.getPrototypeOf,KJe=Object.prototype.hasOwnProperty,qJe=(n,t,i)=>t in n?QO(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,YJe=(n,t)=>{for(var i in t)QO(n,i,{get:t[i],enumerable:!0})},h2e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of WJe(t))!KJe.call(n,l)&&l!==i&&QO(n,l,{get:()=>t[l],enumerable:!(s=GJe(t,l))||s.enumerable});return n},ZO=(n,t,i)=>(i=n!=null?HJe($Je(n)):{},h2e(t||!n||!n.__esModule?QO(i,"default",{value:n,enumerable:!0}):i,n)),XJe=n=>h2e(QO({},"__esModule",{value:!0}),n),oa=(n,t,i)=>(qJe(n,typeof t!="symbol"?t+"":t,i),i),f2e={};YJe(f2e,{createReactPlayer:()=>sQe});var JJe=XJe(f2e),zb=ZO(k),QJe=ZO(UU),tK=ZO(r2e),pfe=ZO(VU),kI=o2e,p2e=BU,ZJe=ZO(FJe);const eQe=(0,p2e.lazy)(()=>Xi(()=>import("./Preview-CRUaPRKG.js").then(n=>n.P),__vite__mapDeps([]))),tQe=typeof window<"u"&&window.document,nQe=typeof Vs<"u"&&Vs.window&&Vs.window.document,iQe=Object.keys(kI.propTypes),rQe=tQe||nQe?zb.Suspense:()=>null,vI=[],sQe=(n,t)=>{var i;return i=class extends zb.Component{constructor(){super(...arguments),oa(this,"state",{showPreview:!!this.props.light}),oa(this,"references",{wrapper:s=>{this.wrapper=s},player:s=>{this.player=s}}),oa(this,"handleClickPreview",s=>{this.setState({showPreview:!1}),this.props.onClickPreview(s)}),oa(this,"showPreview",()=>{this.setState({showPreview:!0})}),oa(this,"getDuration",()=>this.player?this.player.getDuration():null),oa(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),oa(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),oa(this,"getInternalPlayer",(s="player")=>this.player?this.player.getInternalPlayer(s):null),oa(this,"seekTo",(s,l,d)=>{if(!this.player)return null;this.player.seekTo(s,l,d)}),oa(this,"handleReady",()=>{this.props.onReady(this)}),oa(this,"getActivePlayer",(0,tK.default)(s=>{for(const l of[...vI,...n])if(l.canPlay(s))return l;return t||null})),oa(this,"getConfig",(0,tK.default)((s,l)=>{const{config:d}=this.props;return QJe.default.all([kI.defaultProps.config,kI.defaultProps.config[l]||{},d,d[l]||{}])})),oa(this,"getAttributes",(0,tK.default)(s=>(0,p2e.omit)(this.props,iQe))),oa(this,"renderActivePlayer",s=>{if(!s)return null;const l=this.getActivePlayer(s);if(!l)return null;const d=this.getConfig(s,l.key);return zb.default.createElement(ZJe.default,{...this.props,key:l.key,ref:this.references.player,config:d,activePlayer:l.lazyPlayer||l,onReady:this.handleReady})})}shouldComponentUpdate(s,l){return!(0,pfe.default)(this.props,s)||!(0,pfe.default)(this.state,l)}componentDidUpdate(s){const{light:l}=this.props;!s.light&&l&&this.setState({showPreview:!0}),s.light&&!l&&this.setState({showPreview:!1})}renderPreview(s){if(!s)return null;const{light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p}=this.props;return zb.default.createElement(eQe,{url:s,light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p,onClick:this.handleClickPreview})}render(){const{url:s,style:l,width:d,height:u,fallback:p,wrapper:g}=this.props,{showPreview:_}=this.state,y=this.getAttributes(s),E=typeof g=="string"?this.references.wrapper:void 0;return zb.default.createElement(g,{ref:E,style:{...l,width:d,height:u},...y},zb.default.createElement(rQe,{fallback:p},_?this.renderPreview(s):this.renderActivePlayer(s)))}},oa(i,"displayName","ReactPlayer"),oa(i,"propTypes",kI.propTypes),oa(i,"defaultProps",kI.defaultProps),oa(i,"addCustomPlayer",s=>{vI.push(s)}),oa(i,"removeCustomPlayers",()=>{vI.length=0}),oa(i,"canPlay",s=>{for(const l of[...vI,...n])if(l.canPlay(s))return!0;return!1}),oa(i,"canEnablePIP",s=>{for(const l of[...vI,...n])if(l.canEnablePIP&&l.canEnablePIP(s))return!0;return!1}),i};var aQe=Object.create,GU=Object.defineProperty,oQe=Object.getOwnPropertyDescriptor,lQe=Object.getOwnPropertyNames,cQe=Object.getPrototypeOf,dQe=Object.prototype.hasOwnProperty,uQe=(n,t)=>{for(var i in t)GU(n,i,{get:t[i],enumerable:!0})},m2e=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of lQe(t))!dQe.call(n,l)&&l!==i&&GU(n,l,{get:()=>t[l],enumerable:!(s=oQe(t,l))||s.enumerable});return n},hQe=(n,t,i)=>(i=n!=null?aQe(cQe(n)):{},m2e(t||!n||!n.__esModule?GU(i,"default",{value:n,enumerable:!0}):i,n)),fQe=n=>m2e(GU({},"__esModule",{value:!0}),n),g2e={};uQe(g2e,{default:()=>vQe});var pQe=fQe(g2e),vY=hQe(dJe),mQe=JJe;const gQe=vY.default[vY.default.length-1];var vQe=(0,mQe.createReactPlayer)(vY.default,gQe);const XE=Mv(pQe),ec=typeof ic=="object"&&ic+""=="[object process]"&&!ic.versions.nw&&!(ic.versions.electron&&ic.type&&ic.type!=="browser"),yY=[.001,0,0,.001,0,0],nK=1.35,Fd={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},c1={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},v2e="pdfjs_internal_editor_",_i={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},cr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},yQe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},hl={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},rM={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Ta={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Hb={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},WU={ERRORS:0,WARNINGS:1,INFOS:5},I7={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Tk={moveTo:0,lineTo:1,curveTo:2,closePath:3},_Qe={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let $U=WU.WARNINGS;function EQe(n){Number.isInteger(n)&&($U=n)}function wQe(){return $U}function KU(n){$U>=WU.INFOS&&console.log(`Info: ${n}`)}function Ei(n){$U>=WU.WARNINGS&&console.log(`Warning: ${n}`)}function Zr(n){throw new Error(n)}function Aa(n,t){n||Zr(t)}function SQe(n){switch(n==null?void 0:n.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function y2e(n,t=null,i=null){if(!n)return null;if(i&&typeof n=="string"){if(i.addDefaultProtocol&&n.startsWith("www.")){const l=n.match(/\./g);(l==null?void 0:l.length)>=2&&(n=`http://${n}`)}if(i.tryConvertEncoding)try{n=xQe(n)}catch{}}const s=t?URL.parse(n,t):URL.parse(n);return SQe(s)?s:null}function _2e(n,t,i=!1){const s=URL.parse(n);return s?(s.hash=t,s.href):i&&y2e(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Ki(n,t,i,s=!1){return Object.defineProperty(n,t,{value:i,enumerable:!s,configurable:!0,writable:!1}),i}const JE=function(){function t(i,s){this.message=i,this.name=s}return t.prototype=new Error,t.constructor=t,t}();class mfe extends JE{constructor(t,i){super(t,"PasswordException"),this.code=i}}class iK extends JE{constructor(t,i){super(t,"UnknownErrorException"),this.details=i}}class _Y extends JE{constructor(t){super(t,"InvalidPDFException")}}class N7 extends JE{constructor(t,i,s){super(t,"ResponseException"),this.status=i,this.missing=s}}class bQe extends JE{constructor(t){super(t,"FormatError")}}class Dv extends JE{constructor(t){super(t,"AbortException")}}function E2e(n){(typeof n!="object"||(n==null?void 0:n.length)===void 0)&&Zr("Invalid argument for bytesToString");const t=n.length,i=8192;if(t<i)return String.fromCharCode.apply(null,n);const s=[];for(let l=0;l<t;l+=i){const d=Math.min(l+i,t),u=n.subarray(l,d);s.push(String.fromCharCode.apply(null,u))}return s.join("")}function eP(n){typeof n!="string"&&Zr("Invalid argument for stringToBytes");const t=n.length,i=new Uint8Array(t);for(let s=0;s<t;++s)i[s]=n.charCodeAt(s)&255;return i}function CQe(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function TQe(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function RQe(){try{return new Function(""),!0}catch{return!1}}class qo{static get isLittleEndian(){return Ki(this,"isLittleEndian",TQe())}static get isEvalSupported(){return Ki(this,"isEvalSupported",RQe())}static get isOffscreenCanvasSupported(){return Ki(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Ki(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:i}=navigator;return Ki(this,"platform",{isAndroid:i.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){var t,i;return Ki(this,"isCSSRoundSupported",(i=(t=globalThis.CSS)==null?void 0:t.supports)==null?void 0:i.call(t,"width: round(1.5px, 1px)"))}}const rK=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));var BC,sM,gN,EY;class zn{static makeHexColor(t,i,s){return`#${rK[t]}${rK[i]}${rK[s]}`}static scaleMinMax(t,i){let s;t[0]?(t[0]<0&&(s=i[0],i[0]=i[2],i[2]=s),i[0]*=t[0],i[2]*=t[0],t[3]<0&&(s=i[1],i[1]=i[3],i[3]=s),i[1]*=t[3],i[3]*=t[3]):(s=i[0],i[0]=i[1],i[1]=s,s=i[2],i[2]=i[3],i[3]=s,t[1]<0&&(s=i[1],i[1]=i[3],i[3]=s),i[1]*=t[1],i[3]*=t[1],t[2]<0&&(s=i[0],i[0]=i[2],i[2]=s),i[0]*=t[2],i[2]*=t[2]),i[0]+=t[4],i[1]+=t[5],i[2]+=t[4],i[3]+=t[5]}static transform(t,i){return[t[0]*i[0]+t[2]*i[1],t[1]*i[0]+t[3]*i[1],t[0]*i[2]+t[2]*i[3],t[1]*i[2]+t[3]*i[3],t[0]*i[4]+t[2]*i[5]+t[4],t[1]*i[4]+t[3]*i[5]+t[5]]}static applyTransform(t,i,s=0){const l=t[s],d=t[s+1];t[s]=l*i[0]+d*i[2]+i[4],t[s+1]=l*i[1]+d*i[3]+i[5]}static applyTransformToBezier(t,i,s=0){const l=i[0],d=i[1],u=i[2],p=i[3],g=i[4],_=i[5];for(let y=0;y<6;y+=2){const E=t[s+y],b=t[s+y+1];t[s+y]=E*l+b*u+g,t[s+y+1]=E*d+b*p+_}}static applyInverseTransform(t,i){const s=t[0],l=t[1],d=i[0]*i[3]-i[1]*i[2];t[0]=(s*i[3]-l*i[2]+i[2]*i[5]-i[4]*i[3])/d,t[1]=(-s*i[1]+l*i[0]+i[4]*i[1]-i[5]*i[0])/d}static axialAlignedBoundingBox(t,i,s){const l=i[0],d=i[1],u=i[2],p=i[3],g=i[4],_=i[5],y=t[0],E=t[1],b=t[2],A=t[3];let N=l*y+g,O=N,D=l*b+g,P=D,j=p*E+_,M=j,V=p*A+_,H=V;if(d!==0||u!==0){const $=d*y,Q=d*b,Y=u*E,le=u*A;N+=Y,P+=Y,D+=le,O+=le,j+=$,H+=$,V+=Q,M+=Q}s[0]=Math.min(s[0],N,D,O,P),s[1]=Math.min(s[1],j,V,M,H),s[2]=Math.max(s[2],N,D,O,P),s[3]=Math.max(s[3],j,V,M,H)}static inverseTransform(t){const i=t[0]*t[3]-t[1]*t[2];return[t[3]/i,-t[1]/i,-t[2]/i,t[0]/i,(t[2]*t[5]-t[4]*t[3])/i,(t[4]*t[1]-t[5]*t[0])/i]}static singularValueDecompose2dScale(t,i){const s=t[0],l=t[1],d=t[2],u=t[3],p=s**2+l**2,g=s*d+l*u,_=d**2+u**2,y=(p+_)/2,E=Math.sqrt(y**2-(p*_-g**2));i[0]=Math.sqrt(y+E||1),i[1]=Math.sqrt(y-E||1)}static normalizeRect(t){const i=t.slice(0);return t[0]>t[2]&&(i[0]=t[2],i[2]=t[0]),t[1]>t[3]&&(i[1]=t[3],i[3]=t[1]),i}static intersect(t,i){const s=Math.max(Math.min(t[0],t[2]),Math.min(i[0],i[2])),l=Math.min(Math.max(t[0],t[2]),Math.max(i[0],i[2]));if(s>l)return null;const d=Math.max(Math.min(t[1],t[3]),Math.min(i[1],i[3])),u=Math.min(Math.max(t[1],t[3]),Math.max(i[1],i[3]));return d>u?null:[s,d,l,u]}static pointBoundingBox(t,i,s){s[0]=Math.min(s[0],t),s[1]=Math.min(s[1],i),s[2]=Math.max(s[2],t),s[3]=Math.max(s[3],i)}static rectBoundingBox(t,i,s,l,d){d[0]=Math.min(d[0],t,s),d[1]=Math.min(d[1],i,l),d[2]=Math.max(d[2],t,s),d[3]=Math.max(d[3],i,l)}static bezierBoundingBox(t,i,s,l,d,u,p,g,_){_[0]=Math.min(_[0],t,p),_[1]=Math.min(_[1],i,g),_[2]=Math.max(_[2],t,p),_[3]=Math.max(_[3],i,g),pe(this,gN,EY).call(this,t,s,d,p,i,l,u,g,3*(-t+3*(s-d)+p),6*(t-2*s+d),3*(s-t),_),pe(this,gN,EY).call(this,t,s,d,p,i,l,u,g,3*(-i+3*(l-u)+g),6*(i-2*l+u),3*(l-i),_)}}BC=new WeakSet,sM=function(t,i,s,l,d,u,p,g,_,y){if(_<=0||_>=1)return;const E=1-_,b=_*_,A=b*_,N=E*(E*(E*t+3*_*i)+3*b*s)+A*l,O=E*(E*(E*d+3*_*u)+3*b*p)+A*g;y[0]=Math.min(y[0],N),y[1]=Math.min(y[1],O),y[2]=Math.max(y[2],N),y[3]=Math.max(y[3],O)},gN=new WeakSet,EY=function(t,i,s,l,d,u,p,g,_,y,E,b){if(Math.abs(_)<1e-12){Math.abs(y)>=1e-12&&pe(this,BC,sM).call(this,t,i,s,l,d,u,p,g,-E/y,b);return}const A=y**2-4*E*_;if(A<0)return;const N=Math.sqrt(A),O=2*_;pe(this,BC,sM).call(this,t,i,s,l,d,u,p,g,(-y+N)/O,b),pe(this,BC,sM).call(this,t,i,s,l,d,u,p,g,(-y-N)/O,b)},ee(zn,BC),ee(zn,gN);function xQe(n){return decodeURIComponent(escape(n))}let sK=null,gfe=null;function AQe(n){return sK||(sK=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,gfe=new Map([["ſt","ſt"]])),n.replaceAll(sK,(t,i,s)=>i?i.normalize("NFKC"):gfe.get(s))}function w2e(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),E2e(n)}const aZ="pdfjs_internal_id_";function IQe(n,t,i){if(!Array.isArray(i)||i.length<2)return!1;const[s,l,...d]=i;if(!n(s)&&!Number.isInteger(s)||!t(l))return!1;const u=d.length;let p=!0;switch(l.name){case"XYZ":if(u<2||u>3)return!1;break;case"Fit":case"FitB":return u===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(u>1)return!1;break;case"FitR":if(u!==4)return!1;p=!1;break;default:return!1}for(const g of d)if(!(typeof g=="number"||p&&g===null))return!1;return!0}function tc(n,t,i){return Math.min(Math.max(n,t),i)}function S2e(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(E2e(n))}function NQe(n){return Uint8Array.fromBase64?Uint8Array.fromBase64(n):eP(atob(n))}typeof Promise.try!="function"&&(Promise.try=function(n,...t){return new Promise(i=>{i(n(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((t,i)=>t+i,0)});const Im="http://www.w3.org/2000/svg",x_=class x_{};sn(x_,"CSS",96),sn(x_,"PDF",72),sn(x_,"PDF_TO_CSS_UNITS",x_.CSS/x_.PDF);let kv=x_;async function tP(n,t="text"){if(MI(n,document.baseURI)){const i=await fetch(n);if(!i.ok)throw new Error(i.statusText);switch(t){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,s)=>{const l=new XMLHttpRequest;l.open("GET",n,!0),l.responseType=t,l.onreadystatechange=()=>{if(l.readyState===XMLHttpRequest.DONE){if(l.status===200||l.status===0){switch(t){case"arraybuffer":case"blob":case"json":i(l.response);return}i(l.responseText);return}s(new Error(l.statusText))}},l.send(null)})}class nP{constructor({viewBox:t,userUnit:i,scale:s,rotation:l,offsetX:d=0,offsetY:u=0,dontFlip:p=!1}){this.viewBox=t,this.userUnit=i,this.scale=s,this.rotation=l,this.offsetX=d,this.offsetY=u,s*=i;const g=(t[2]+t[0])/2,_=(t[3]+t[1])/2;let y,E,b,A;switch(l%=360,l<0&&(l+=360),l){case 180:y=-1,E=0,b=0,A=1;break;case 90:y=0,E=1,b=1,A=0;break;case 270:y=0,E=-1,b=-1,A=0;break;case 0:y=1,E=0,b=0,A=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}p&&(b=-b,A=-A);let N,O,D,P;y===0?(N=Math.abs(_-t[1])*s+d,O=Math.abs(g-t[0])*s+u,D=(t[3]-t[1])*s,P=(t[2]-t[0])*s):(N=Math.abs(g-t[0])*s+d,O=Math.abs(_-t[1])*s+u,D=(t[2]-t[0])*s,P=(t[3]-t[1])*s),this.transform=[y*s,E*s,b*s,A*s,N-y*s*g-b*s*_,O-E*s*g-A*s*_],this.width=D,this.height=P}get rawDims(){const t=this.viewBox;return Ki(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:i=this.rotation,offsetX:s=this.offsetX,offsetY:l=this.offsetY,dontFlip:d=!1}={}){return new nP({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:i,offsetX:s,offsetY:l,dontFlip:d})}convertToViewportPoint(t,i){const s=[t,i];return zn.applyTransform(s,this.transform),s}convertToViewportRectangle(t){const i=[t[0],t[1]];zn.applyTransform(i,this.transform);const s=[t[2],t[3]];return zn.applyTransform(s,this.transform),[i[0],i[1],s[0],s[1]]}convertToPdfPoint(t,i){const s=[t,i];return zn.applyInverseTransform(s,this.transform),s}}class oZ extends JE{constructor(t,i=0){super(t,"RenderingCancelledException"),this.extraDelay=i}}function qU(n){const t=n.length;let i=0;for(;i<t&&n[i].trim()==="";)i++;return n.substring(i,i+5).toLowerCase()==="data:"}function lZ(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function OQe(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function PQe(n,t="document.pdf"){if(typeof n!="string")return t;if(qU(n))return Ei('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const s=(p=>{try{return new URL(p)}catch{try{return new URL(decodeURIComponent(p))}catch{try{return new URL(p,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(p),"https://foo.bar")}catch{return null}}}}})(n);if(!s)return t;const l=p=>{try{let g=decodeURIComponent(p);return g.includes("/")?(g=g.split("/").at(-1),g.test(/^\.pdf$/i)?g:p):g}catch{return p}},d=/\.pdf$/i,u=s.pathname.split("/").at(-1);if(d.test(u))return l(u);if(s.searchParams.size>0){const p=Array.from(s.searchParams.values()).reverse();for(const _ of p)if(d.test(_))return l(_);const g=Array.from(s.searchParams.keys()).reverse();for(const _ of g)if(d.test(_))return l(_)}if(s.hash){const g=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(s.hash);if(g)return l(g[0])}return t}class vfe{constructor(){sn(this,"started",Object.create(null));sn(this,"times",[])}time(t){t in this.started&&Ei(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ei(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let i=0;for(const{name:s}of this.times)i=Math.max(s.length,i);for(const{name:s,start:l,end:d}of this.times)t.push(`${s.padEnd(i)} ${d-l}ms
`);return t.join("")}}function MI(n,t){const i=t?URL.parse(n,t):URL.parse(n);return(i==null?void 0:i.protocol)==="http:"||(i==null?void 0:i.protocol)==="https:"}function rh(n){n.preventDefault()}function Ra(n){n.preventDefault(),n.stopPropagation()}function LQe(n){console.log("Deprecated API usage: "+n)}var vN;class O7{static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;T(this,vN)||re(this,vN,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=T(this,vN).exec(t);if(!i)return null;const s=parseInt(i[1],10);let l=parseInt(i[2],10);l=l>=1&&l<=12?l-1:0;let d=parseInt(i[3],10);d=d>=1&&d<=31?d:1;let u=parseInt(i[4],10);u=u>=0&&u<=23?u:0;let p=parseInt(i[5],10);p=p>=0&&p<=59?p:0;let g=parseInt(i[6],10);g=g>=0&&g<=59?g:0;const _=i[7]||"Z";let y=parseInt(i[8],10);y=y>=0&&y<=23?y:0;let E=parseInt(i[9],10)||0;return E=E>=0&&E<=59?E:0,_==="-"?(u+=y,p+=E):_==="+"&&(u-=y,p-=E),new Date(Date.UTC(s,l,d,u,p,g))}}vN=new WeakMap,ee(O7,vN,void 0);function DQe(n,{scale:t=1,rotation:i=0}){const{width:s,height:l}=n.attributes.style,d=[0,0,parseInt(s),parseInt(l)];return new nP({viewBox:d,userUnit:1,scale:t,rotation:i})}function YU(n){if(n.startsWith("#")){const t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Ei(`Not a valid color format: "${n}"`),[0,0,0])}function kQe(n){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const i of n.keys()){t.style.color=i;const s=window.getComputedStyle(t).color;n.set(i,YU(s))}t.remove()}function Fs(n){const{a:t,b:i,c:s,d:l,e:d,f:u}=n.getTransform();return[t,i,s,l,d,u]}function Jf(n){const{a:t,b:i,c:s,d:l,e:d,f:u}=n.getTransform().invertSelf();return[t,i,s,l,d,u]}function NE(n,t,i=!1,s=!0){if(t instanceof nP){const{pageWidth:l,pageHeight:d}=t.rawDims,{style:u}=n,p=qo.isCSSRoundSupported,g=`var(--total-scale-factor) * ${l}px`,_=`var(--total-scale-factor) * ${d}px`,y=p?`round(down, ${g}, var(--scale-round-x))`:`calc(${g})`,E=p?`round(down, ${_}, var(--scale-round-y))`:`calc(${_})`;!i||t.rotation%180===0?(u.width=y,u.height=E):(u.width=E,u.height=y)}s&&n.setAttribute("data-main-rotation",t.rotation)}class Up{constructor(){const{pixelRatio:t}=Up;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,i,s,l,d=-1){let u=1/0,p=1/0,g=1/0;s=Up.capPixels(s,d),s>0&&(u=Math.sqrt(s/(t*i))),l!==-1&&(p=l/t,g=l/i);const _=Math.min(u,p,g);return this.sx>_||this.sy>_?(this.sx=_,this.sy=_,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,i){if(i>=0){const s=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return t>0?Math.min(t,s):s}return t}}const wY=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];var v1,y1,Bu,Fm,yN,VC,zC,_N,W7,b2e,$7,C2e,K7,T2e,_1,Gb,W_,jI;const Dm=class Dm{constructor(t){ee(this,$7);ee(this,K7);ee(this,_1);ee(this,W_);ee(this,v1,null);ee(this,y1,null);ee(this,Bu,void 0);ee(this,Fm,null);ee(this,yN,null);ee(this,VC,null);ee(this,zC,null);re(this,Bu,t),T(Dm,_N)||re(Dm,_N,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){const t=re(this,v1,document.createElement("div"));t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const i=T(this,Bu)._uiManager._signal;t.addEventListener("contextmenu",rh,{signal:i}),t.addEventListener("pointerdown",pe(Dm,W7,b2e),{signal:i});const s=re(this,Fm,document.createElement("div"));s.className="buttons",t.append(s);const l=T(this,Bu).toolbarPosition;if(l){const{style:d}=t,u=T(this,Bu)._uiManager.direction==="ltr"?1-l[0]:l[0];d.insetInlineEnd=`${100*u}%`,d.top=`calc(${100*l[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return T(this,v1)}hide(){var t;T(this,v1).classList.add("hidden"),(t=T(this,y1))==null||t.hideDropdown()}show(){var t,i;T(this,v1).classList.remove("hidden"),(t=T(this,yN))==null||t.shown(),(i=T(this,VC))==null||i.shown()}addDeleteButton(){const{editorType:t,_uiManager:i}=T(this,Bu),s=document.createElement("button");s.className="delete",s.tabIndex=0,s.setAttribute("data-l10n-id",T(Dm,_N)[t]),pe(this,_1,Gb).call(this,s),s.addEventListener("click",l=>{i.delete()},{signal:i._signal}),T(this,Fm).append(s)}async addAltText(t){const i=await t.render();pe(this,_1,Gb).call(this,i),T(this,Fm).append(i,T(this,W_,jI)),re(this,yN,t)}addComment(t){if(T(this,VC))return;const i=t.render();i&&(pe(this,_1,Gb).call(this,i),T(this,Fm).prepend(i,T(this,W_,jI)),re(this,VC,t),t.toolbar=this)}addColorPicker(t){if(T(this,y1))return;re(this,y1,t);const i=t.renderButton();pe(this,_1,Gb).call(this,i),T(this,Fm).append(i,T(this,W_,jI))}async addEditSignatureButton(t){const i=re(this,zC,await t.renderEditButton(T(this,Bu)));pe(this,_1,Gb).call(this,i),T(this,Fm).append(i,T(this,W_,jI))}async addButton(t,i){switch(t){case"colorPicker":this.addColorPicker(i);break;case"altText":await this.addAltText(i);break;case"editSignature":await this.addEditSignatureButton(i);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(i);break}}updateEditSignatureButton(t){T(this,zC)&&(T(this,zC).title=t)}remove(){var t;T(this,v1).remove(),(t=T(this,y1))==null||t.destroy(),re(this,y1,null)}};v1=new WeakMap,y1=new WeakMap,Bu=new WeakMap,Fm=new WeakMap,yN=new WeakMap,VC=new WeakMap,zC=new WeakMap,_N=new WeakMap,W7=new WeakSet,b2e=function(t){t.stopPropagation()},$7=new WeakSet,C2e=function(t){T(this,Bu)._focusEventsAllowed=!1,Ra(t)},K7=new WeakSet,T2e=function(t){T(this,Bu)._focusEventsAllowed=!0,Ra(t)},_1=new WeakSet,Gb=function(t){const i=T(this,Bu)._uiManager._signal;t.addEventListener("focusin",pe(this,$7,C2e).bind(this),{capture:!0,signal:i}),t.addEventListener("focusout",pe(this,K7,T2e).bind(this),{capture:!0,signal:i}),t.addEventListener("contextmenu",rh,{signal:i})},W_=new WeakSet,jI=function(){const t=document.createElement("div");return t.className="divider",t},ee(Dm,W7),ee(Dm,_N,null);let SY=Dm;var EN,$_,K_,q7,R2e,Y7,x2e,X7,A2e;class MQe{constructor(t){ee(this,q7);ee(this,Y7);ee(this,X7);ee(this,EN,null);ee(this,$_,null);ee(this,K_,void 0);re(this,K_,t)}show(t,i,s){const[l,d]=pe(this,Y7,x2e).call(this,i,s),{style:u}=T(this,$_)||re(this,$_,pe(this,q7,R2e).call(this));t.append(T(this,$_)),u.insetInlineEnd=`${100*l}%`,u.top=`calc(${100*d}% + var(--editor-toolbar-vert-offset))`}hide(){T(this,$_).remove()}}EN=new WeakMap,$_=new WeakMap,K_=new WeakMap,q7=new WeakSet,R2e=function(){const t=re(this,$_,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",rh,{signal:T(this,K_)._signal});const i=re(this,EN,document.createElement("div"));return i.className="buttons",t.append(i),pe(this,X7,A2e).call(this),t},Y7=new WeakSet,x2e=function(t,i){let s=0,l=0;for(const d of t){const u=d.y+d.height;if(u<s)continue;const p=d.x+(i?d.width:0);if(u>s){l=p,s=u;continue}i?p>l&&(l=p):p<l&&(l=p)}return[i?1-l:l,s]},X7=new WeakSet,A2e=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const i=document.createElement("span");t.append(i),i.className="visuallyHidden",i.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const s=T(this,K_)._signal;t.addEventListener("contextmenu",rh,{signal:s}),t.addEventListener("click",()=>{T(this,K_).highlightSelection("floating_button")},{signal:s}),T(this,EN).append(t)};function I2e(n,t,i){for(const s of i)t.addEventListener(s,n[s].bind(n))}var J7;class jQe{constructor(){ee(this,J7,0)}get id(){return`${v2e}${ao(this,J7)._++}`}}J7=new WeakMap;var HC,wN,pl,GC,aM;const qZ=class qZ{constructor(){ee(this,GC);ee(this,HC,w2e());ee(this,wN,0);ee(this,pl,null)}static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',s=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),l=new Image;l.src=t;const d=l.decode().then(()=>(s.drawImage(l,0,0,1,1,0,0,1,3),new Uint32Array(s.getImageData(0,0,1,1).data.buffer)[0]===0));return Ki(this,"_isSVGFittingCanvas",d)}async getFromFile(t){const{lastModified:i,name:s,size:l,type:d}=t;return pe(this,GC,aM).call(this,`${i}_${s}_${l}_${d}`,t)}async getFromUrl(t){return pe(this,GC,aM).call(this,t,t)}async getFromBlob(t,i){const s=await i;return pe(this,GC,aM).call(this,t,s)}async getFromId(t){T(this,pl)||re(this,pl,new Map);const i=T(this,pl).get(t);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:s}=i;return delete i.blobPromise,this.getFromBlob(i.id,s)}return this.getFromUrl(i.url)}getFromCanvas(t,i){T(this,pl)||re(this,pl,new Map);let s=T(this,pl).get(t);if(s!=null&&s.bitmap)return s.refCounter+=1,s;const l=new OffscreenCanvas(i.width,i.height);return l.getContext("2d").drawImage(i,0,0),s={bitmap:l.transferToImageBitmap(),id:`image_${T(this,HC)}_${ao(this,wN)._++}`,refCounter:1,isSvg:!1},T(this,pl).set(t,s),T(this,pl).set(s.id,s),s}getSvgUrl(t){const i=T(this,pl).get(t);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(t){var l;T(this,pl)||re(this,pl,new Map);const i=T(this,pl).get(t);if(!i||(i.refCounter-=1,i.refCounter!==0))return;const{bitmap:s}=i;if(!i.url&&!i.file){const d=new OffscreenCanvas(s.width,s.height);d.getContext("bitmaprenderer").transferFromImageBitmap(s),i.blobPromise=d.convertToBlob()}(l=s.close)==null||l.call(s),i.bitmap=null}isValidId(t){return t.startsWith(`image_${T(this,HC)}_`)}};HC=new WeakMap,wN=new WeakMap,pl=new WeakMap,GC=new WeakSet,aM=async function(t,i){T(this,pl)||re(this,pl,new Map);let s=T(this,pl).get(t);if(s===null)return null;if(s!=null&&s.bitmap)return s.refCounter+=1,s;try{s||(s={bitmap:null,id:`image_${T(this,HC)}_${ao(this,wN)._++}`,refCounter:0,isSvg:!1});let l;if(typeof i=="string"?(s.url=i,l=await tP(i,"blob")):i instanceof File?l=s.file=i:i instanceof Blob&&(l=i),l.type==="image/svg+xml"){const d=qZ._isSVGFittingCanvas,u=new FileReader,p=new Image,g=new Promise((_,y)=>{p.onload=()=>{s.bitmap=p,s.isSvg=!0,_()},u.onload=async()=>{const E=s.svgUrl=u.result;p.src=await d?`${E}#svgView(preserveAspectRatio(none))`:E},p.onerror=u.onerror=y});u.readAsDataURL(l),await g}else s.bitmap=await createImageBitmap(l);s.refCounter=1}catch(l){Ei(l),s=null}return T(this,pl).set(t,s),s&&T(this,pl).set(s.id,s),s};let bY=qZ;var ua,E1,SN,Us;class UQe{constructor(t=128){ee(this,ua,[]);ee(this,E1,!1);ee(this,SN,void 0);ee(this,Us,-1);re(this,SN,t)}add({cmd:t,undo:i,post:s,mustExec:l,type:d=NaN,overwriteIfSameType:u=!1,keepUndo:p=!1}){if(l&&t(),T(this,E1))return;const g={cmd:t,undo:i,post:s,type:d};if(T(this,Us)===-1){T(this,ua).length>0&&(T(this,ua).length=0),re(this,Us,0),T(this,ua).push(g);return}if(u&&T(this,ua)[T(this,Us)].type===d){p&&(g.undo=T(this,ua)[T(this,Us)].undo),T(this,ua)[T(this,Us)]=g;return}const _=T(this,Us)+1;_===T(this,SN)?T(this,ua).splice(0,1):(re(this,Us,_),_<T(this,ua).length&&T(this,ua).splice(_)),T(this,ua).push(g)}undo(){if(T(this,Us)===-1)return;re(this,E1,!0);const{undo:t,post:i}=T(this,ua)[T(this,Us)];t(),i==null||i(),re(this,E1,!1),re(this,Us,T(this,Us)-1)}redo(){if(T(this,Us)<T(this,ua).length-1){re(this,Us,T(this,Us)+1),re(this,E1,!0);const{cmd:t,post:i}=T(this,ua)[T(this,Us)];t(),i==null||i(),re(this,E1,!1)}}hasSomethingToUndo(){return T(this,Us)!==-1}hasSomethingToRedo(){return T(this,Us)<T(this,ua).length-1}cleanType(t){if(T(this,Us)!==-1){for(let i=T(this,Us);i>=0;i--)if(T(this,ua)[i].type!==t){T(this,ua).splice(i+1,T(this,Us)-i),re(this,Us,i);return}T(this,ua).length=0,re(this,Us,-1)}}destroy(){re(this,ua,null)}}ua=new WeakMap,E1=new WeakMap,SN=new WeakMap,Us=new WeakMap;var Q7,N2e;class iP{constructor(t){ee(this,Q7);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=qo.platform;for(const[s,l,d={}]of t)for(const u of s){const p=u.startsWith("mac+");i&&p?(this.callbacks.set(u.slice(4),{callback:l,options:d}),this.allKeys.add(u.split("+").at(-1))):!i&&!p&&(this.callbacks.set(u,{callback:l,options:d}),this.allKeys.add(u.split("+").at(-1)))}}exec(t,i){if(!this.allKeys.has(i.key))return;const s=this.callbacks.get(pe(this,Q7,N2e).call(this,i));if(!s)return;const{callback:l,options:{bubbles:d=!1,args:u=[],checker:p=null}}=s;p&&!p(t,i)||(l.bind(t,...u,i)(),d||Ra(i))}}Q7=new WeakSet,N2e=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const i=this.buffer.join("+");return this.buffer.length=0,i};const Z7=class Z7{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return kQe(t),Ki(this,"_colors",t)}convert(t){const i=YU(t);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[s,l]of this._colors)if(l.every((d,u)=>d===i[u]))return Z7._colorsMapping.get(s);return i}getHexCode(t){const i=this._colors.get(t);return i?zn.makeHexColor(...i):t}};sn(Z7,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let CY=Z7;var WC,Cd,Fa,ko,$C,Bm,KC,Vu,q_,w1,S1,qC,Y_,cp,Hh,X_,bN,CN,YC,TN,dp,b1,XC,C1,up,e9,T1,RN,R1,J_,JC,x1,xN,co,Fr,Vm,A1,I1,AN,IN,N1,hp,zm,NN,ON,zu,QC,oM,PN,TY,t9,O2e,n9,P2e,ZC,lM,i9,L2e,r9,D2e,s9,k2e,LN,RY,a9,M2e,DN,xY,kN,AY,o9,j2e,Mo,Kl,Gh,Nm,l9,U2e,c9,F2e,MN,IY,d9,B2e,Q_,UI,jN,NY;const pC=class pC{constructor(t,i,s,l,d,u,p,g,_,y,E,b,A,N,O,D){ee(this,QC);ee(this,PN);ee(this,t9);ee(this,n9);ee(this,ZC);ee(this,i9);ee(this,r9);ee(this,s9);ee(this,LN);ee(this,a9);ee(this,DN);ee(this,kN);ee(this,o9);ee(this,Mo);ee(this,Gh);ee(this,l9);ee(this,c9);ee(this,MN);ee(this,d9);ee(this,Q_);ee(this,jN);ee(this,WC,new AbortController);ee(this,Cd,null);ee(this,Fa,new Map);ee(this,ko,new Map);ee(this,$C,null);ee(this,Bm,null);ee(this,KC,null);ee(this,Vu,new UQe);ee(this,q_,null);ee(this,w1,null);ee(this,S1,null);ee(this,qC,0);ee(this,Y_,new Set);ee(this,cp,null);ee(this,Hh,null);ee(this,X_,new Set);sn(this,"_editorUndoBar",null);ee(this,bN,!1);ee(this,CN,!1);ee(this,YC,!1);ee(this,TN,null);ee(this,dp,null);ee(this,b1,null);ee(this,XC,null);ee(this,C1,!1);ee(this,up,null);ee(this,e9,new jQe);ee(this,T1,!1);ee(this,RN,!1);ee(this,R1,null);ee(this,J_,null);ee(this,JC,null);ee(this,x1,null);ee(this,xN,null);ee(this,co,_i.NONE);ee(this,Fr,new Set);ee(this,Vm,null);ee(this,A1,null);ee(this,I1,null);ee(this,AN,null);ee(this,IN,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});ee(this,N1,[0,0]);ee(this,hp,null);ee(this,zm,null);ee(this,NN,null);ee(this,ON,null);ee(this,zu,null);const P=this._signal=T(this,WC).signal;re(this,zm,t),re(this,NN,i),re(this,ON,s),re(this,$C,l),re(this,q_,d),re(this,A1,u),this._eventBus=p,p._on("editingaction",this.onEditingAction.bind(this),{signal:P}),p._on("pagechanging",this.onPageChanging.bind(this),{signal:P}),p._on("scalechanging",this.onScaleChanging.bind(this),{signal:P}),p._on("rotationchanging",this.onRotationChanging.bind(this),{signal:P}),p._on("setpreference",this.onSetPreference.bind(this),{signal:P}),p._on("switchannotationeditorparams",j=>this.updateParams(j.type,j.value),{signal:P}),pe(this,i9,L2e).call(this),pe(this,o9,j2e).call(this),pe(this,LN,RY).call(this),re(this,Bm,g.annotationStorage),re(this,TN,g.filterFactory),re(this,I1,_),re(this,XC,y||null),re(this,bN,E),re(this,CN,b),re(this,YC,A),re(this,xN,N||null),this.viewParameters={realScale:kv.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=O||null,this._supportsPinchToZoom=D!==!1}static get _keyboardManager(){const t=pC.prototype,i=u=>T(u,zm).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&u.hasSomethingToControl(),s=(u,{target:p})=>{if(p instanceof HTMLInputElement){const{type:g}=p;return g!=="text"&&g!=="number"}return!0},l=this.TRANSLATE_SMALL,d=this.TRANSLATE_BIG;return Ki(this,"_keyboardManager",new iP([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:s}],[["ctrl+z","mac+meta+z"],t.undo,{checker:s}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:s}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:s}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(u,{target:p})=>!(p instanceof HTMLButtonElement)&&T(u,zm).contains(p)&&!u.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(u,{target:p})=>!(p instanceof HTMLButtonElement)&&T(u,zm).contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-l,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-d,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[l,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[d,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-l],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-d],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,l],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,d],checker:i}]]))}destroy(){var t,i,s,l,d,u,p,g,_;(t=T(this,zu))==null||t.resolve(),re(this,zu,null),(i=T(this,WC))==null||i.abort(),re(this,WC,null),this._signal=null;for(const y of T(this,ko).values())y.destroy();T(this,ko).clear(),T(this,Fa).clear(),T(this,X_).clear(),(s=T(this,x1))==null||s.clear(),re(this,Cd,null),T(this,Fr).clear(),T(this,Vu).destroy(),(l=T(this,$C))==null||l.destroy(),(d=T(this,q_))==null||d.destroy(),(u=T(this,A1))==null||u.destroy(),(p=T(this,up))==null||p.hide(),re(this,up,null),(g=T(this,JC))==null||g.destroy(),re(this,JC,null),T(this,dp)&&(clearTimeout(T(this,dp)),re(this,dp,null)),T(this,hp)&&(clearTimeout(T(this,hp)),re(this,hp,null)),(_=this._editorUndoBar)==null||_.destroy()}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return T(this,xN)}get useNewAltTextFlow(){return T(this,CN)}get useNewAltTextWhenAddingImage(){return T(this,YC)}get hcmFilter(){return Ki(this,"hcmFilter",T(this,I1)?T(this,TN).addHCMFilter(T(this,I1).foreground,T(this,I1).background):"none")}get direction(){return Ki(this,"direction",getComputedStyle(T(this,zm)).direction)}get _highlightColors(){return Ki(this,"_highlightColors",T(this,XC)?new Map(T(this,XC).split(",").map(t=>(t=t.split("=").map(i=>i.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Ki(this,"highlightColors",null);const i=new Map,s=!!T(this,I1);for(const[l,d]of t){const u=l.endsWith("_HCM");if(s&&u){i.set(l.replace("_HCM",""),d);continue}!s&&!u&&i.set(l,d)}return Ki(this,"highlightColors",i)}get highlightColorNames(){return Ki(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const i=this.highlightColorNames.get(t);return this._highlightColors.get(i)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),re(this,S1,t)}setMainHighlightColorPicker(t){re(this,JC,t)}editAltText(t,i=!1){var s;(s=T(this,$C))==null||s.editAltText(this,t,i)}hasCommentManager(){return!!T(this,q_)}editComment(t,i){var s;(s=T(this,q_))==null||s.open(this,t,i)}getSignature(t){var i;(i=T(this,A1))==null||i.getSignature({uiManager:this,editor:t})}get signatureManager(){return T(this,A1)}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){switch(t){case"enableNewAltTextWhenAddingImage":re(this,YC,i);break}}onPageChanging({pageNumber:t}){re(this,qC,t-1)}focusMainContainer(){T(this,zm).focus()}findParent(t,i){for(const s of T(this,ko).values()){const{x:l,y:d,width:u,height:p}=s.div.getBoundingClientRect();if(t>=l&&t<=l+u&&i>=d&&i<=d+p)return s}return null}disableUserSelect(t=!1){T(this,NN).classList.toggle("noUserSelect",t)}addShouldRescale(t){T(this,X_).add(t)}removeShouldRescale(t){T(this,X_).delete(t)}onScaleChanging({scale:t}){var i;this.commitOrRemove(),this.viewParameters.realScale=t*kv.PDF_TO_CSS_UNITS;for(const s of T(this,X_))s.onScaleChanging();(i=T(this,S1))==null||i.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(t=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:s,anchorOffset:l,focusNode:d,focusOffset:u}=i,p=i.toString(),_=pe(this,QC,oM).call(this,i).closest(".textLayer"),y=this.getSelectionBoxes(_);if(!y)return;i.empty();const E=pe(this,PN,TY).call(this,_),b=T(this,co)===_i.NONE,A=()=>{E==null||E.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:y,anchorNode:s,anchorOffset:l,focusNode:d,focusOffset:u,text:p}),b&&this.showAllEditors("highlight",!0,!0)};if(b){this.switchToMode(_i.HIGHLIGHT,A);return}A()}addToAnnotationStorage(t){!t.isEmpty()&&T(this,Bm)&&!T(this,Bm).has(t.id)&&T(this,Bm).setValue(t.id,t)}a11yAlert(t,i=null){const s=T(this,ON);s&&(s.setAttribute("data-l10n-id",t),i?s.setAttribute("data-l10n-args",JSON.stringify(i)):s.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,T(this,C1)&&(re(this,C1,!1),pe(this,ZC,lM).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const i of T(this,Fr))if(i.div.contains(t)){re(this,J_,[i,t]),i._focusEventsAllowed=!1;break}}focus(){if(!T(this,J_))return;const[t,i]=T(this,J_);re(this,J_,null),i.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){pe(this,LN,RY).call(this),pe(this,DN,xY).call(this)}removeEditListeners(){pe(this,a9,M2e).call(this),pe(this,kN,AY).call(this)}dragOver(t){for(const{type:i}of t.dataTransfer.items)for(const s of T(this,Hh))if(s.isHandlingMimeForPasting(i)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const i of t.dataTransfer.items)for(const s of T(this,Hh))if(s.isHandlingMimeForPasting(i.type)){s.paste(i,this.currentLayer),t.preventDefault();return}}copy(t){var s;if(t.preventDefault(),(s=T(this,Cd))==null||s.commitOrRemove(),!this.hasSelection)return;const i=[];for(const l of T(this,Fr)){const d=l.serialize(!0);d&&i.push(d)}i.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:i}=t;for(const d of i.items)for(const u of T(this,Hh))if(u.isHandlingMimeForPasting(d.type)){u.paste(d,this.currentLayer);return}let s=i.getData("application/pdfjs");if(!s)return;try{s=JSON.parse(s)}catch(d){Ei(`paste: "${d.message}".`);return}if(!Array.isArray(s))return;this.unselectAll();const l=this.currentLayer;try{const d=[];for(const g of s){const _=await l.deserialize(g);if(!_)return;d.push(_)}const u=()=>{for(const g of d)pe(this,MN,IY).call(this,g);pe(this,jN,NY).call(this,d)},p=()=>{for(const g of d)g.remove()};this.addCommands({cmd:u,undo:p,mustExec:!0})}catch(d){Ei(`paste: "${d.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),T(this,co)!==_i.NONE&&!this.isEditorHandlingKeyboard&&pC._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,T(this,C1)&&(re(this,C1,!1),pe(this,ZC,lM).call(this,"main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(t){t?(pe(this,r9,D2e).call(this),pe(this,DN,xY).call(this),pe(this,Mo,Kl).call(this,{isEditing:T(this,co)!==_i.NONE,isEmpty:pe(this,Q_,UI).call(this),hasSomethingToUndo:T(this,Vu).hasSomethingToUndo(),hasSomethingToRedo:T(this,Vu).hasSomethingToRedo(),hasSelectedEditor:!1})):(pe(this,s9,k2e).call(this),pe(this,kN,AY).call(this),pe(this,Mo,Kl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!T(this,Hh)){re(this,Hh,t);for(const i of T(this,Hh))pe(this,Gh,Nm).call(this,i.defaultPropertiesToUpdate)}}getId(){return T(this,e9).id}get currentLayer(){return T(this,ko).get(T(this,qC))}getLayer(t){return T(this,ko).get(t)}get currentPageIndex(){return T(this,qC)}addLayer(t){T(this,ko).set(t.pageIndex,t),T(this,T1)?t.enable():t.disable()}removeLayer(t){T(this,ko).delete(t.pageIndex)}async updateMode(t,i=null,s=!1,l=!1,d=!1){var u,p,g;if(T(this,co)!==t&&!(T(this,zu)&&(await T(this,zu).promise,!T(this,zu)))){if(re(this,zu,Promise.withResolvers()),(u=T(this,S1))==null||u.commitOrRemove(),re(this,co,t),t===_i.NONE){this.setEditingState(!1),pe(this,c9,F2e).call(this),(p=this._editorUndoBar)==null||p.hide(),T(this,zu).resolve();return}t===_i.SIGNATURE&&await((g=T(this,A1))==null?void 0:g.loadSignatures()),this.setEditingState(!0),await pe(this,l9,U2e).call(this),this.unselectAll();for(const _ of T(this,ko).values())_.updateMode(t);if(!i){s&&this.addNewEditorFromKeyboard(),T(this,zu).resolve();return}for(const _ of T(this,Fa).values())_.annotationElementId===i||_.id===i?(this.setSelected(_),d?_.editComment():l&&_.enterInEditMode()):_.unselect();T(this,zu).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==T(this,co)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,i){if(T(this,Hh)){switch(t){case cr.CREATE:this.currentLayer.addNewEditor(i);return;case cr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(T(this,AN)||re(this,AN,new Map)).set(t,i),this.showAllEditors("highlight",i);break}if(this.hasSelection)for(const s of T(this,Fr))s.updateParams(t,i);else for(const s of T(this,Hh))s.updateDefaultParams(t,i)}}showAllEditors(t,i,s=!1){var d;for(const u of T(this,Fa).values())u.editorType===t&&u.show(i);(((d=T(this,AN))==null?void 0:d.get(cr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&pe(this,Gh,Nm).call(this,[[cr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(T(this,RN)!==t){re(this,RN,t);for(const i of T(this,ko).values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}getEditors(t){const i=[];for(const s of T(this,Fa).values())s.pageIndex===t&&i.push(s);return i}getEditor(t){return T(this,Fa).get(t)}addEditor(t){T(this,Fa).set(t.id,t)}removeEditor(t){var i,s;t.div.contains(document.activeElement)&&(T(this,dp)&&clearTimeout(T(this,dp)),re(this,dp,setTimeout(()=>{this.focusMainContainer(),re(this,dp,null)},0))),T(this,Fa).delete(t.id),t.annotationElementId&&((i=T(this,x1))==null||i.delete(t.annotationElementId)),this.unselect(t),(!t.annotationElementId||!T(this,Y_).has(t.annotationElementId))&&((s=T(this,Bm))==null||s.remove(t.id))}addDeletedAnnotationElement(t){T(this,Y_).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return T(this,Y_).has(t)}removeDeletedAnnotationElement(t){T(this,Y_).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){T(this,Cd)!==t&&(re(this,Cd,t),t&&pe(this,Gh,Nm).call(this,t.propertiesToUpdate))}updateUI(t){T(this,d9,B2e)===t&&pe(this,Gh,Nm).call(this,t.propertiesToUpdate)}updateUIForDefaultProperties(t){pe(this,Gh,Nm).call(this,t.defaultPropertiesToUpdate)}toggleSelected(t){if(T(this,Fr).has(t)){T(this,Fr).delete(t),t.unselect(),pe(this,Mo,Kl).call(this,{hasSelectedEditor:this.hasSelection});return}T(this,Fr).add(t),t.select(),pe(this,Gh,Nm).call(this,t.propertiesToUpdate),pe(this,Mo,Kl).call(this,{hasSelectedEditor:!0})}setSelected(t){var i;this.updateToolbar({mode:t.mode,editId:t.id}),(i=T(this,S1))==null||i.commitOrRemove();for(const s of T(this,Fr))s!==t&&s.unselect();T(this,Fr).clear(),T(this,Fr).add(t),t.select(),pe(this,Gh,Nm).call(this,t.propertiesToUpdate),pe(this,Mo,Kl).call(this,{hasSelectedEditor:!0})}isSelected(t){return T(this,Fr).has(t)}get firstSelectedEditor(){return T(this,Fr).values().next().value}unselect(t){t.unselect(),T(this,Fr).delete(t),pe(this,Mo,Kl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return T(this,Fr).size!==0}get isEnterHandled(){return T(this,Fr).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var t;T(this,Vu).undo(),pe(this,Mo,Kl).call(this,{hasSomethingToUndo:T(this,Vu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:pe(this,Q_,UI).call(this)}),(t=this._editorUndoBar)==null||t.hide()}redo(){T(this,Vu).redo(),pe(this,Mo,Kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:T(this,Vu).hasSomethingToRedo(),isEmpty:pe(this,Q_,UI).call(this)})}addCommands(t){T(this,Vu).add(t),pe(this,Mo,Kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:pe(this,Q_,UI).call(this)})}cleanUndoStack(t){T(this,Vu).cleanType(t)}delete(){var d;this.commitOrRemove();const t=(d=this.currentLayer)==null?void 0:d.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const i=t?[t]:[...T(this,Fr)],s=()=>{var u;(u=this._editorUndoBar)==null||u.show(l,i.length===1?i[0].editorType:i.length);for(const p of i)p.remove()},l=()=>{for(const u of i)pe(this,MN,IY).call(this,u)};this.addCommands({cmd:s,undo:l,mustExec:!0})}commitOrRemove(){var t;(t=T(this,Cd))==null||t.commitOrRemove()}hasSomethingToControl(){return T(this,Cd)||this.hasSelection}selectAll(){for(const t of T(this,Fr))t.commit();pe(this,jN,NY).call(this,T(this,Fa).values())}unselectAll(){var t;if(!(T(this,Cd)&&(T(this,Cd).commitOrRemove(),T(this,co)!==_i.NONE))&&!((t=T(this,S1))!=null&&t.commitOrRemove())&&this.hasSelection){for(const i of T(this,Fr))i.unselect();T(this,Fr).clear(),pe(this,Mo,Kl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,i,s=!1){if(s||this.commitOrRemove(),!this.hasSelection)return;T(this,N1)[0]+=t,T(this,N1)[1]+=i;const[l,d]=T(this,N1),u=[...T(this,Fr)],p=1e3;T(this,hp)&&clearTimeout(T(this,hp)),re(this,hp,setTimeout(()=>{re(this,hp,null),T(this,N1)[0]=T(this,N1)[1]=0,this.addCommands({cmd:()=>{for(const g of u)T(this,Fa).has(g.id)&&(g.translateInPage(l,d),g.translationDone())},undo:()=>{for(const g of u)T(this,Fa).has(g.id)&&(g.translateInPage(-l,-d),g.translationDone())},mustExec:!1})},p));for(const g of u)g.translateInPage(t,i),g.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),re(this,cp,new Map);for(const t of T(this,Fr))T(this,cp).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!T(this,cp))return!1;this.disableUserSelect(!1);const t=T(this,cp);re(this,cp,null);let i=!1;for(const[{x:l,y:d,pageIndex:u},p]of t)p.newX=l,p.newY=d,p.newPageIndex=u,i||(i=l!==p.savedX||d!==p.savedY||u!==p.savedPageIndex);if(!i)return!1;const s=(l,d,u,p)=>{if(T(this,Fa).has(l.id)){const g=T(this,ko).get(p);g?l._setParentAndPosition(g,d,u):(l.pageIndex=p,l.x=d,l.y=u)}};return this.addCommands({cmd:()=>{for(const[l,{newX:d,newY:u,newPageIndex:p}]of t)s(l,d,u,p)},undo:()=>{for(const[l,{savedX:d,savedY:u,savedPageIndex:p}]of t)s(l,d,u,p)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(T(this,cp))for(const s of T(this,cp).keys())s.drag(t,i)}rebuild(t){if(t.parent===null){const i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return((t=this.getActive())==null?void 0:t.shouldGetKeyboardEvents())||T(this,Fr).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return T(this,Cd)===t}getActive(){return T(this,Cd)}getMode(){return T(this,co)}get imageManager(){return Ki(this,"imageManager",new bY)}getSelectionBoxes(t){if(!t)return null;const i=document.getSelection();for(let _=0,y=i.rangeCount;_<y;_++)if(!t.contains(i.getRangeAt(_).commonAncestorContainer))return null;const{x:s,y:l,width:d,height:u}=t.getBoundingClientRect();let p;switch(t.getAttribute("data-main-rotation")){case"90":p=(_,y,E,b)=>({x:(y-l)/u,y:1-(_+E-s)/d,width:b/u,height:E/d});break;case"180":p=(_,y,E,b)=>({x:1-(_+E-s)/d,y:1-(y+b-l)/u,width:E/d,height:b/u});break;case"270":p=(_,y,E,b)=>({x:1-(y+b-l)/u,y:(_-s)/d,width:b/u,height:E/d});break;default:p=(_,y,E,b)=>({x:(_-s)/d,y:(y-l)/u,width:E/d,height:b/u});break}const g=[];for(let _=0,y=i.rangeCount;_<y;_++){const E=i.getRangeAt(_);if(!E.collapsed)for(const{x:b,y:A,width:N,height:O}of E.getClientRects())N===0||O===0||g.push(p(b,A,N,O))}return g.length===0?null:g}addChangedExistingAnnotation({annotationElementId:t,id:i}){(T(this,KC)||re(this,KC,new Map)).set(t,i)}removeChangedExistingAnnotation({annotationElementId:t}){var i;(i=T(this,KC))==null||i.delete(t)}renderAnnotationElement(t){var l;const i=(l=T(this,KC))==null?void 0:l.get(t.data.id);if(!i)return;const s=T(this,Bm).getRawValue(i);s&&(T(this,co)===_i.NONE&&!s.hasBeenModified||s.renderAnnotationElement(t))}setMissingCanvas(t,i,s){var d;const l=(d=T(this,x1))==null?void 0:d.get(t);l&&(l.setCanvas(i,s),T(this,x1).delete(t))}addMissingCanvas(t,i){(T(this,x1)||re(this,x1,new Map)).set(t,i)}};WC=new WeakMap,Cd=new WeakMap,Fa=new WeakMap,ko=new WeakMap,$C=new WeakMap,Bm=new WeakMap,KC=new WeakMap,Vu=new WeakMap,q_=new WeakMap,w1=new WeakMap,S1=new WeakMap,qC=new WeakMap,Y_=new WeakMap,cp=new WeakMap,Hh=new WeakMap,X_=new WeakMap,bN=new WeakMap,CN=new WeakMap,YC=new WeakMap,TN=new WeakMap,dp=new WeakMap,b1=new WeakMap,XC=new WeakMap,C1=new WeakMap,up=new WeakMap,e9=new WeakMap,T1=new WeakMap,RN=new WeakMap,R1=new WeakMap,J_=new WeakMap,JC=new WeakMap,x1=new WeakMap,xN=new WeakMap,co=new WeakMap,Fr=new WeakMap,Vm=new WeakMap,A1=new WeakMap,I1=new WeakMap,AN=new WeakMap,IN=new WeakMap,N1=new WeakMap,hp=new WeakMap,zm=new WeakMap,NN=new WeakMap,ON=new WeakMap,zu=new WeakMap,QC=new WeakSet,oM=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},PN=new WeakSet,TY=function(t){const{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(const s of T(this,ko).values())if(s.hasTextLayer(t))return s;return null},t9=new WeakSet,O2e=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const s=pe(this,QC,oM).call(this,t).closest(".textLayer"),l=this.getSelectionBoxes(s);l&&(T(this,up)||re(this,up,new MQe(this)),T(this,up).show(s,l,this.direction==="ltr"))},n9=new WeakSet,P2e=function(){var d,u,p;const t=document.getSelection();if(!t||t.isCollapsed){T(this,Vm)&&((d=T(this,up))==null||d.hide(),re(this,Vm,null),pe(this,Mo,Kl).call(this,{hasSelectedText:!1}));return}const{anchorNode:i}=t;if(i===T(this,Vm))return;const l=pe(this,QC,oM).call(this,t).closest(".textLayer");if(!l){T(this,Vm)&&((u=T(this,up))==null||u.hide(),re(this,Vm,null),pe(this,Mo,Kl).call(this,{hasSelectedText:!1}));return}if((p=T(this,up))==null||p.hide(),re(this,Vm,i),pe(this,Mo,Kl).call(this,{hasSelectedText:!0}),!(T(this,co)!==_i.HIGHLIGHT&&T(this,co)!==_i.NONE)&&(T(this,co)===_i.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),re(this,C1,this.isShiftKeyDown),!this.isShiftKeyDown)){const g=T(this,co)===_i.HIGHLIGHT?pe(this,PN,TY).call(this,l):null;g==null||g.toggleDrawing();const _=new AbortController,y=this.combinedSignal(_),E=b=>{b.type==="pointerup"&&b.button!==0||(_.abort(),g==null||g.toggleDrawing(!0),b.type==="pointerup"&&pe(this,ZC,lM).call(this,"main_toolbar"))};window.addEventListener("pointerup",E,{signal:y}),window.addEventListener("blur",E,{signal:y})}},ZC=new WeakSet,lM=function(t=""){T(this,co)===_i.HIGHLIGHT?this.highlightSelection(t):T(this,bN)&&pe(this,t9,O2e).call(this)},i9=new WeakSet,L2e=function(){document.addEventListener("selectionchange",pe(this,n9,P2e).bind(this),{signal:this._signal})},r9=new WeakSet,D2e=function(){if(T(this,b1))return;re(this,b1,new AbortController);const t=this.combinedSignal(T(this,b1));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},s9=new WeakSet,k2e=function(){var t;(t=T(this,b1))==null||t.abort(),re(this,b1,null)},LN=new WeakSet,RY=function(){if(T(this,R1))return;re(this,R1,new AbortController);const t=this.combinedSignal(T(this,R1));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},a9=new WeakSet,M2e=function(){var t;(t=T(this,R1))==null||t.abort(),re(this,R1,null)},DN=new WeakSet,xY=function(){if(T(this,w1))return;re(this,w1,new AbortController);const t=this.combinedSignal(T(this,w1));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},kN=new WeakSet,AY=function(){var t;(t=T(this,w1))==null||t.abort(),re(this,w1,null)},o9=new WeakSet,j2e=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},Mo=new WeakSet,Kl=function(t){Object.entries(t).some(([s,l])=>T(this,IN)[s]!==l)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(T(this,IN),t)}),T(this,co)===_i.HIGHLIGHT&&t.hasSelectedEditor===!1&&pe(this,Gh,Nm).call(this,[[cr.HIGHLIGHT_FREE,!0]]))},Gh=new WeakSet,Nm=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},l9=new WeakSet,U2e=async function(){if(!T(this,T1)){re(this,T1,!0);const t=[];for(const i of T(this,ko).values())t.push(i.enable());await Promise.all(t);for(const i of T(this,Fa).values())i.enable()}},c9=new WeakSet,F2e=function(){if(this.unselectAll(),T(this,T1)){re(this,T1,!1);for(const t of T(this,ko).values())t.disable();for(const t of T(this,Fa).values())t.disable()}},MN=new WeakSet,IY=function(t){const i=T(this,ko).get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},d9=new WeakSet,B2e=function(){let t=null;for(t of T(this,Fr));return t},Q_=new WeakSet,UI=function(){if(T(this,Fa).size===0)return!0;if(T(this,Fa).size===1)for(const t of T(this,Fa).values())return t.isEmpty();return!1},jN=new WeakSet,NY=function(t){for(const i of T(this,Fr))i.unselect();T(this,Fr).clear();for(const i of t)i.isEmpty()||(T(this,Fr).add(i),i.select());pe(this,Mo,Kl).call(this,{hasSelectedEditor:this.hasSelection})},sn(pC,"TRANSLATE_SMALL",1),sn(pC,"TRANSLATE_BIG",10);let OE=pC;var uo,fp,Wh,eT,pp,Td,tT,mp,Gc,Hm,Z_,gp,O1,e2,FI,nT,cM;const ql=class ql{constructor(t){ee(this,e2);ee(this,nT);ee(this,uo,null);ee(this,fp,!1);ee(this,Wh,null);ee(this,eT,null);ee(this,pp,null);ee(this,Td,null);ee(this,tT,!1);ee(this,mp,null);ee(this,Gc,null);ee(this,Hm,null);ee(this,Z_,null);ee(this,gp,!1);re(this,Gc,t),re(this,gp,t._uiManager.useNewAltTextFlow),T(ql,O1)||re(ql,O1,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(t){ql._l10n??(ql._l10n=t)}async render(){const t=re(this,Wh,document.createElement("button"));t.className="altText",t.tabIndex="0";const i=re(this,eT,document.createElement("span"));t.append(i),T(this,gp)?(t.classList.add("new"),t.setAttribute("data-l10n-id",T(ql,O1).missing),i.setAttribute("data-l10n-id",T(ql,O1)["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const s=T(this,Gc)._uiManager._signal;t.addEventListener("contextmenu",rh,{signal:s}),t.addEventListener("pointerdown",d=>d.stopPropagation(),{signal:s});const l=d=>{d.preventDefault(),T(this,Gc)._uiManager.editAltText(T(this,Gc)),T(this,gp)&&T(this,Gc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:T(this,e2,FI)}})};return t.addEventListener("click",l,{capture:!0,signal:s}),t.addEventListener("keydown",d=>{d.target===t&&d.key==="Enter"&&(re(this,tT,!0),l(d))},{signal:s}),await pe(this,nT,cM).call(this),t}finish(){T(this,Wh)&&(T(this,Wh).focus({focusVisible:T(this,tT)}),re(this,tT,!1))}isEmpty(){return T(this,gp)?T(this,uo)===null:!T(this,uo)&&!T(this,fp)}hasData(){return T(this,gp)?T(this,uo)!==null||!!T(this,Hm):this.isEmpty()}get guessedText(){return T(this,Hm)}async setGuessedText(t){T(this,uo)===null&&(re(this,Hm,t),re(this,Z_,await ql._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t})),pe(this,nT,cM).call(this))}toggleAltTextBadge(t=!1){var i;if(!T(this,gp)||T(this,uo)){(i=T(this,mp))==null||i.remove(),re(this,mp,null);return}if(!T(this,mp)){const s=re(this,mp,document.createElement("div"));s.className="noAltTextBadge",T(this,Gc).div.append(s)}T(this,mp).classList.toggle("hidden",!t)}serialize(t){let i=T(this,uo);return!t&&T(this,Hm)===i&&(i=T(this,Z_)),{altText:i,decorative:T(this,fp),guessedText:T(this,Hm),textWithDisclaimer:T(this,Z_)}}get data(){return{altText:T(this,uo),decorative:T(this,fp)}}set data({altText:t,decorative:i,guessedText:s,textWithDisclaimer:l,cancel:d=!1}){s&&(re(this,Hm,s),re(this,Z_,l)),!(T(this,uo)===t&&T(this,fp)===i)&&(d||(re(this,uo,t),re(this,fp,i)),pe(this,nT,cM).call(this))}toggle(t=!1){T(this,Wh)&&(!t&&T(this,Td)&&(clearTimeout(T(this,Td)),re(this,Td,null)),T(this,Wh).disabled=!t)}shown(){T(this,Gc)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:T(this,e2,FI)}})}destroy(){var t,i;(t=T(this,Wh))==null||t.remove(),re(this,Wh,null),re(this,eT,null),re(this,pp,null),(i=T(this,mp))==null||i.remove(),re(this,mp,null)}};uo=new WeakMap,fp=new WeakMap,Wh=new WeakMap,eT=new WeakMap,pp=new WeakMap,Td=new WeakMap,tT=new WeakMap,mp=new WeakMap,Gc=new WeakMap,Hm=new WeakMap,Z_=new WeakMap,gp=new WeakMap,O1=new WeakMap,e2=new WeakSet,FI=function(){return T(this,uo)&&"added"||T(this,uo)===null&&this.guessedText&&"review"||"missing"},nT=new WeakSet,cM=async function(){var l,d,u;const t=T(this,Wh);if(!t)return;if(T(this,gp)){if(t.classList.toggle("done",!!T(this,uo)),t.setAttribute("data-l10n-id",T(ql,O1)[T(this,e2,FI)]),(l=T(this,eT))==null||l.setAttribute("data-l10n-id",T(ql,O1)[`${T(this,e2,FI)}-label`]),!T(this,uo)){(d=T(this,pp))==null||d.remove();return}}else{if(!T(this,uo)&&!T(this,fp)){t.classList.remove("done"),(u=T(this,pp))==null||u.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=T(this,pp);if(!i){re(this,pp,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${T(this,Gc).id}`;const p=100,g=T(this,Gc)._uiManager._signal;g.addEventListener("abort",()=>{clearTimeout(T(this,Td)),re(this,Td,null)},{once:!0}),t.addEventListener("mouseenter",()=>{re(this,Td,setTimeout(()=>{re(this,Td,null),T(this,pp).classList.add("show"),T(this,Gc)._reportTelemetry({action:"alt_text_tooltip"})},p))},{signal:g}),t.addEventListener("mouseleave",()=>{var _;T(this,Td)&&(clearTimeout(T(this,Td)),re(this,Td,null)),(_=T(this,pp))==null||_.classList.remove("show")},{signal:g})}T(this,fp)?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=T(this,uo)),i.parentNode||t.append(i);const s=T(this,Gc).getElementForAltText();s==null||s.setAttribute("aria-describedby",i.id)},ee(ql,O1,null),sn(ql,"_l10n",null);let P7=ql;var vp,t2,$h,UN,Gm,iT,P1;class Rk{constructor(t){ee(this,vp,null);ee(this,t2,!1);ee(this,$h,null);ee(this,UN,null);ee(this,Gm,null);ee(this,iT,null);ee(this,P1,!1);re(this,$h,t),this.toolbar=null}render(){if(!T(this,$h)._uiManager.hasCommentManager())return null;const t=re(this,vp,document.createElement("button"));t.className="comment",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button");const i=T(this,$h)._uiManager._signal;t.addEventListener("contextmenu",rh,{signal:i}),t.addEventListener("pointerdown",l=>l.stopPropagation(),{signal:i});const s=l=>{l.preventDefault(),this.edit()};return t.addEventListener("click",s,{capture:!0,signal:i}),t.addEventListener("keydown",l=>{l.target===t&&l.key==="Enter"&&(re(this,t2,!0),s(l))},{signal:i}),t}edit(){const{bottom:t,left:i,right:s}=T(this,$h).getClientDimensions(),l={top:t};T(this,$h)._uiManager.direction==="ltr"?l.right=s:l.left=i,T(this,$h)._uiManager.editComment(T(this,$h),l)}finish(){T(this,vp)&&(T(this,vp).focus({focusVisible:T(this,t2)}),re(this,t2,!1))}isDeleted(){return T(this,P1)||T(this,Gm)===""}hasBeenEdited(){return this.isDeleted()||T(this,Gm)!==T(this,UN)}serialize(){return this.data}get data(){return{text:T(this,Gm),date:T(this,iT),deleted:T(this,P1)}}set data(t){if(t===null){re(this,Gm,""),re(this,P1,!0);return}re(this,Gm,t),re(this,iT,new Date),re(this,P1,!1)}setInitialText(t){re(this,UN,t),this.data=t}toggle(t=!1){T(this,vp)&&(T(this,vp).disabled=!t)}shown(){}destroy(){var t;(t=T(this,vp))==null||t.remove(),re(this,vp,null),re(this,Gm,""),re(this,iT,null),re(this,$h,null),re(this,t2,!1),re(this,P1,!1)}}vp=new WeakMap,t2=new WeakMap,$h=new WeakMap,UN=new WeakMap,Gm=new WeakMap,iT=new WeakMap,P1=new WeakMap;var rT,n2,FN,BN,VN,zN,HN,Wm,i2,$m,r2,Km,u9,V2e,h9,z2e,f9,H2e;const YZ=class YZ{constructor({container:t,isPinchingDisabled:i=null,isPinchingStopped:s=null,onPinchStart:l=null,onPinching:d=null,onPinchEnd:u=null,signal:p}){ee(this,u9);ee(this,h9);ee(this,f9);ee(this,rT,void 0);ee(this,n2,!1);ee(this,FN,null);ee(this,BN,void 0);ee(this,VN,void 0);ee(this,zN,void 0);ee(this,HN,void 0);ee(this,Wm,null);ee(this,i2,void 0);ee(this,$m,null);ee(this,r2,void 0);ee(this,Km,null);re(this,rT,t),re(this,FN,s),re(this,BN,i),re(this,VN,l),re(this,zN,d),re(this,HN,u),re(this,r2,new AbortController),re(this,i2,AbortSignal.any([p,T(this,r2).signal])),t.addEventListener("touchstart",pe(this,u9,V2e).bind(this),{passive:!1,signal:T(this,i2)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Up.pixelRatio}destroy(){var t,i;(t=T(this,r2))==null||t.abort(),re(this,r2,null),(i=T(this,Wm))==null||i.abort(),re(this,Wm,null)}};rT=new WeakMap,n2=new WeakMap,FN=new WeakMap,BN=new WeakMap,VN=new WeakMap,zN=new WeakMap,HN=new WeakMap,Wm=new WeakMap,i2=new WeakMap,$m=new WeakMap,r2=new WeakMap,Km=new WeakMap,u9=new WeakSet,V2e=function(t){var l,d,u;if((l=T(this,BN))!=null&&l.call(this))return;if(t.touches.length===1){if(T(this,Wm))return;const p=re(this,Wm,new AbortController),g=AbortSignal.any([T(this,i2),p.signal]),_=T(this,rT),y={capture:!0,signal:g,passive:!1},E=b=>{var A;b.pointerType==="touch"&&((A=T(this,Wm))==null||A.abort(),re(this,Wm,null))};_.addEventListener("pointerdown",b=>{b.pointerType==="touch"&&(Ra(b),E(b))},y),_.addEventListener("pointerup",E,y),_.addEventListener("pointercancel",E,y);return}if(!T(this,Km)){re(this,Km,new AbortController);const p=AbortSignal.any([T(this,i2),T(this,Km).signal]),g=T(this,rT),_={signal:p,capture:!1,passive:!1};g.addEventListener("touchmove",pe(this,h9,z2e).bind(this),_);const y=pe(this,f9,H2e).bind(this);g.addEventListener("touchend",y,_),g.addEventListener("touchcancel",y,_),_.capture=!0,g.addEventListener("pointerdown",Ra,_),g.addEventListener("pointermove",Ra,_),g.addEventListener("pointercancel",Ra,_),g.addEventListener("pointerup",Ra,_),(d=T(this,VN))==null||d.call(this)}if(Ra(t),t.touches.length!==2||(u=T(this,FN))!=null&&u.call(this)){re(this,$m,null);return}let[i,s]=t.touches;i.identifier>s.identifier&&([i,s]=[s,i]),re(this,$m,{touch0X:i.screenX,touch0Y:i.screenY,touch1X:s.screenX,touch1Y:s.screenY})},h9=new WeakSet,z2e=function(t){var V;if(!T(this,$m)||t.touches.length!==2)return;Ra(t);let[i,s]=t.touches;i.identifier>s.identifier&&([i,s]=[s,i]);const{screenX:l,screenY:d}=i,{screenX:u,screenY:p}=s,g=T(this,$m),{touch0X:_,touch0Y:y,touch1X:E,touch1Y:b}=g,A=E-_,N=b-y,O=u-l,D=p-d,P=Math.hypot(O,D)||1,j=Math.hypot(A,N)||1;if(!T(this,n2)&&Math.abs(j-P)<=YZ.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(g.touch0X=l,g.touch0Y=d,g.touch1X=u,g.touch1Y=p,!T(this,n2)){re(this,n2,!0);return}const M=[(l+u)/2,(d+p)/2];(V=T(this,zN))==null||V.call(this,M,j,P)},f9=new WeakSet,H2e=function(t){var i;t.touches.length>=2||(T(this,Km)&&(T(this,Km).abort(),re(this,Km,null),(i=T(this,HN))==null||i.call(this)),T(this,$m)&&(Ra(t),re(this,$m,null),re(this,n2,!1)))};let L7=YZ;var s2,Kh,Os,jo,sT,L1,GN,a2,Uo,o2,qm,D1,WN,l2,Rd,$N,c2,Ym,yp,aT,oT,Hu,d2,KN,p9,qN,OY,YN,PY,lT,dM,m9,G2e,g9,W2e,XN,LY,cT,uM,JN,DY,v9,$2e,y9,K2e,_9,q2e,QN,kY,E9,Y2e,ZN,MY,w9,X2e,S9,J2e,b9,Q2e,e5,jY,u2,BI;const Vi=class Vi{constructor(t){ee(this,qN);ee(this,lT);ee(this,m9);ee(this,g9);ee(this,XN);ee(this,cT);ee(this,JN);ee(this,v9);ee(this,y9);ee(this,_9);ee(this,QN);ee(this,E9);ee(this,ZN);ee(this,w9);ee(this,S9);ee(this,b9);ee(this,e5);ee(this,u2);ee(this,s2,null);ee(this,Kh,null);ee(this,Os,null);ee(this,jo,null);ee(this,sT,!1);ee(this,L1,null);ee(this,GN,"");ee(this,a2,!1);ee(this,Uo,null);ee(this,o2,null);ee(this,qm,null);ee(this,D1,null);ee(this,WN,"");ee(this,l2,!1);ee(this,Rd,null);ee(this,$N,!1);ee(this,c2,!1);ee(this,Ym,!1);ee(this,yp,null);ee(this,aT,0);ee(this,oT,0);ee(this,Hu,null);ee(this,d2,null);sn(this,"isSelected",!1);sn(this,"_isCopy",!1);sn(this,"_editToolbar",null);sn(this,"_initialOptions",Object.create(null));sn(this,"_initialData",null);sn(this,"_isVisible",!0);sn(this,"_uiManager",null);sn(this,"_focusEventsAllowed",!0);ee(this,KN,!1);ee(this,p9,Vi._zIndex++);this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null;const{rotation:i,rawDims:{pageWidth:s,pageHeight:l,pageX:d,pageY:u}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[s,l],this.pageTranslation=[d,u];const[p,g]=this.parentDimensions;this.x=t.x/p,this.y=t.y/g,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const t=Vi.prototype._resizeWithKeyboard,i=OE.TRANSLATE_SMALL,s=OE.TRANSLATE_BIG;return Ki(this,"_resizerKeyboardManager",new iP([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-s,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[s,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-s]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,s]}],[["Escape","mac+Escape"],Vi.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Ki(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const i=new FQe({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});i.annotationElementId=t.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(t,i){if(Vi._l10n??(Vi._l10n=t),Vi._l10nResizer||(Vi._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),Vi._borderLineWidth!==-1)return;const s=getComputedStyle(document.documentElement);Vi._borderLineWidth=parseFloat(s.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,i){Zr("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return T(this,KN)}set _isDraggable(t){var i;re(this,KN,t),(i=this.div)==null||i.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(t*2),this.y+=this.width*t/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(t*2),this.y-=this.width*t/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=T(this,p9)}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):pe(this,u2,BI).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(T(this,l2)?re(this,l2,!1):this.parent.setSelected(this))}focusout(t){var s;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const i=t.relatedTarget;i!=null&&i.closest(`#${this.id}`)||(t.preventDefault(),(s=this.parent)!=null&&s.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,i,s,l){const[d,u]=this.parentDimensions;[s,l]=this.screenToPageTranslation(s,l),this.x=(t+s)/d,this.y=(i+l)/u,this.fixAndSetPosition()}_moveAfterPaste(t,i){const[s,l]=this.parentDimensions;this.setAt(t*s,i*l,this.width*s,this.height*l),this._onTranslated()}translate(t,i){pe(this,qN,OY).call(this,this.parentDimensions,t,i)}translateInPage(t,i){T(this,Rd)||re(this,Rd,[this.x,this.y,this.width,this.height]),pe(this,qN,OY).call(this,this.pageDimensions,t,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,i){T(this,Rd)||re(this,Rd,[this.x,this.y,this.width,this.height]);const{div:s,parentDimensions:[l,d]}=this;if(this.x+=t/l,this.y+=i/d,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:E,y:b}=this.div.getBoundingClientRect();this.parent.findNewParent(this,E,b)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:u,y:p}=this;const[g,_]=this.getBaseTranslation();u+=g,p+=_;const{style:y}=s;y.left=`${(100*u).toFixed(2)}%`,y.top=`${(100*p).toFixed(2)}%`,this._onTranslating(u,p),s.scrollIntoView({block:"nearest"})}_onTranslating(t,i){}_onTranslated(t,i){}get _hasBeenMoved(){return!!T(this,Rd)&&(T(this,Rd)[0]!==this.x||T(this,Rd)[1]!==this.y)}get _hasBeenResized(){return!!T(this,Rd)&&(T(this,Rd)[2]!==this.width||T(this,Rd)[3]!==this.height)}getBaseTranslation(){const[t,i]=this.parentDimensions,{_borderLineWidth:s}=Vi,l=s/t,d=s/i;switch(this.rotation){case 90:return[-l,d];case 180:return[l,d];case 270:return[l,-d];default:return[-l,-d]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:i},pageDimensions:[s,l]}=this;let{x:d,y:u,width:p,height:g}=this;if(p*=s,g*=l,d*=s,u*=l,this._mustFixPosition)switch(t){case 0:d=tc(d,0,s-p),u=tc(u,0,l-g);break;case 90:d=tc(d,0,s-g),u=tc(u,p,l);break;case 180:d=tc(d,p,s),u=tc(u,g,l);break;case 270:d=tc(d,g,s),u=tc(u,0,l-p);break}this.x=d/=s,this.y=u/=l;const[_,y]=this.getBaseTranslation();d+=_,u+=y,i.left=`${(100*d).toFixed(2)}%`,i.top=`${(100*u).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(t,i){var s;return pe(s=Vi,YN,PY).call(s,t,i,this.parentRotation)}pageTranslationToScreen(t,i){var s;return pe(s=Vi,YN,PY).call(s,t,i,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[i,s]}=this;return[i*t,s*t]}setDims(t,i){const[s,l]=this.parentDimensions,{style:d}=this.div;d.width=`${(100*t/s).toFixed(2)}%`,T(this,a2)||(d.height=`${(100*i/l).toFixed(2)}%`)}fixDims(){const{style:t}=this.div,{height:i,width:s}=t,l=s.endsWith("%"),d=!T(this,a2)&&i.endsWith("%");if(l&&d)return;const[u,p]=this.parentDimensions;l||(t.width=`${(100*parseFloat(s)/u).toFixed(2)}%`),!T(this,a2)&&!d&&(t.height=`${(100*parseFloat(i)/p).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(t){return Math.round(t*1e4)/1e4}_onResizing(){}altTextFinish(){var t;(t=T(this,Os))==null||t.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||T(this,c2))return this._editToolbar;this._editToolbar=new SY(this),this.div.append(this._editToolbar.render()),this._editToolbar.addButton("comment",this.addCommentButton());const{toolbarButtons:t}=this;if(t)for(const[i,s]of t)await this._editToolbar.addButton(i,s);return this._editToolbar.addButton("delete"),this._editToolbar}removeEditToolbar(){var t;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(t=T(this,Os))==null||t.destroy())}addContainer(t){var s;const i=(s=this._editToolbar)==null?void 0:s.div;i?i.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return T(this,Os)||(P7.initialize(Vi._l10n),re(this,Os,new P7(this)),T(this,s2)&&(T(this,Os).data=T(this,s2),re(this,s2,null))),T(this,Os)}get altTextData(){var t;return(t=T(this,Os))==null?void 0:t.data}set altTextData(t){T(this,Os)&&(T(this,Os).data=t)}get guessedAltText(){var t;return(t=T(this,Os))==null?void 0:t.guessedText}async setGuessedAltText(t){var i;await((i=T(this,Os))==null?void 0:i.setGuessedText(t))}serializeAltText(t){var i;return(i=T(this,Os))==null?void 0:i.serialize(t)}hasAltText(){return!!T(this,Os)&&!T(this,Os).isEmpty()}hasAltTextData(){var t;return((t=T(this,Os))==null?void 0:t.hasData())??!1}addCommentButton(){return T(this,jo)?T(this,jo):re(this,jo,new Rk(this))}get commentColor(){return null}get comment(){const t=T(this,jo);return{text:t.data.text,date:t.data.date,deleted:t.isDeleted(),color:this.commentColor}}set comment(t){T(this,jo)||re(this,jo,new Rk(this)),T(this,jo).data=t}setCommentData(t){T(this,jo)||re(this,jo,new Rk(this)),T(this,jo).setInitialText(t)}get hasEditedComment(){var t;return(t=T(this,jo))==null?void 0:t.hasBeenEdited()}async editComment(){T(this,jo)||re(this,jo,new Rk(this)),T(this,jo).edit()}addComment(t){this.hasEditedComment&&(t.popup={contents:this.comment.text,deleted:this.comment.deleted})}render(){var u;const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=T(this,sT)?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),pe(this,ZN,MY).call(this);const[i,s]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*s/i).toFixed(2)}%`,t.style.maxHeight=`${(100*i/s).toFixed(2)}%`);const[l,d]=this.getInitialTranslation();return this.translate(l,d),I2e(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(T(this,d2)||re(this,d2,new L7({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:pe(this,v9,$2e).bind(this),onPinching:pe(this,y9,K2e).bind(this),onPinchEnd:pe(this,_9,q2e).bind(this),signal:this._uiManager._signal}))),(u=this._uiManager._editorUndoBar)==null||u.hide(),t}pointerdown(t){const{isMac:i}=qo.platform;if(t.button!==0||t.ctrlKey&&i){t.preventDefault();return}if(re(this,l2,!0),this._isDraggable){pe(this,E9,Y2e).call(this,t);return}pe(this,QN,kY).call(this,t)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){T(this,yp)&&clearTimeout(T(this,yp)),re(this,yp,setTimeout(()=>{var t;re(this,yp,null),(t=this.parent)==null||t.moveEditorInDOM(this)},0))}_setParentAndPosition(t,i,s){t.changeParent(this),this.x=i,this.y=s,this.fixAndSetPosition(),this._onTranslated()}getRect(t,i,s=this.rotation){const l=this.parentScale,[d,u]=this.pageDimensions,[p,g]=this.pageTranslation,_=t/l,y=i/l,E=this.x*d,b=this.y*u,A=this.width*d,N=this.height*u;switch(s){case 0:return[E+_+p,u-b-y-N+g,E+_+A+p,u-b-y+g];case 90:return[E+y+p,u-b+_+g,E+y+N+p,u-b+_+A+g];case 180:return[E-_-A+p,u-b+y+g,E-_+p,u-b+y+N+g];case 270:return[E-y-N+p,u-b-_-A+g,E-y+p,u-b-_+g];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,i){const[s,l,d,u]=t,p=d-s,g=u-l;switch(this.rotation){case 0:return[s,i-u,p,g];case 90:return[s,i-l,g,p];case 180:return[d,i-l,p,g];case 270:return[d,i-u,g,p];default:throw new Error("Invalid rotation")}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),re(this,c2,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),re(this,c2,!1),!0):!1}isInEditMode(){return T(this,c2)}shouldGetKeyboardEvents(){return T(this,Ym)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:i,bottom:s,right:l}=this.getClientDimensions(),{innerHeight:d,innerWidth:u}=window;return i<u&&l>0&&t<d&&s>0}rebuild(){pe(this,ZN,MY).call(this)}rotate(t){}resize(){}serializeDeleted(){var t;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((t=this._initialData)==null?void 0:t.popupRef)||""}}serialize(t=!1,i=null){Zr("An editor must be serializable")}static async deserialize(t,i,s){const l=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:s,annotationElementId:t.annotationElementId});l.rotation=t.rotation,re(l,s2,t.accessibilityData),l._isCopy=t.isCopy||!1;const[d,u]=l.pageDimensions,[p,g,_,y]=l.getRectInCurrentCoords(t.rect,u);return l.x=p/d,l.y=g/u,l.width=_/d,l.height=y/u,l}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var t,i;if((t=T(this,D1))==null||t.abort(),re(this,D1,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),T(this,yp)&&(clearTimeout(T(this,yp)),re(this,yp,null)),pe(this,u2,BI).call(this),this.removeEditToolbar(),T(this,Hu)){for(const s of T(this,Hu).values())clearTimeout(s);re(this,Hu,null)}this.parent=null,(i=T(this,d2))==null||i.destroy(),re(this,d2,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(pe(this,m9,G2e).call(this),T(this,Uo).classList.remove("hidden"))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),re(this,qm,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=T(this,Uo).children;if(!T(this,Kh)){re(this,Kh,Array.from(i));const u=pe(this,w9,X2e).bind(this),p=pe(this,S9,J2e).bind(this),g=this._uiManager._signal;for(const _ of T(this,Kh)){const y=_.getAttribute("data-resizer-name");_.setAttribute("role","spinbutton"),_.addEventListener("keydown",u,{signal:g}),_.addEventListener("blur",p,{signal:g}),_.addEventListener("focus",pe(this,b9,Q2e).bind(this,y),{signal:g}),_.setAttribute("data-l10n-id",Vi._l10nResizer[y])}}const s=T(this,Kh)[0];let l=0;for(const u of i){if(u===s)break;l++}const d=(360-this.rotation+this.parentRotation)%360/90*(T(this,Kh).length/4);if(d!==l){if(d<l)for(let p=0;p<l-d;p++)T(this,Uo).append(T(this,Uo).firstChild);else if(d>l)for(let p=0;p<d-l;p++)T(this,Uo).firstChild.before(T(this,Uo).lastChild);let u=0;for(const p of i){const _=T(this,Kh)[u++].getAttribute("data-resizer-name");p.setAttribute("data-l10n-id",Vi._l10nResizer[_])}}pe(this,e5,jY).call(this,0),re(this,Ym,!0),T(this,Uo).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,i){T(this,Ym)&&pe(this,JN,DY).call(this,T(this,WN),{deltaX:t,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){pe(this,u2,BI).call(this),this.div.focus()}select(){var t,i,s;if(!(this.isSelected&&this._editToolbar)){if(this.isSelected=!0,this.makeResizable(),(t=this.div)==null||t.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var l,d;(l=this.div)!=null&&l.classList.contains("selectedEditor")&&((d=this._editToolbar)==null||d.show())});return}(i=this._editToolbar)==null||i.show(),(s=T(this,Os))==null||s.toggleAltTextBadge(!1)}}unselect(){var t,i,s,l,d;this.isSelected&&(this.isSelected=!1,(t=T(this,Uo))==null||t.classList.add("hidden"),(i=this.div)==null||i.classList.remove("selectedEditor"),(s=this.div)!=null&&s.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(l=this._editToolbar)==null||l.hide(),(d=T(this,Os))==null||d.toggleAltTextBadge(!0))}updateParams(t,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id})}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return T(this,$N)}set isEditing(t){re(this,$N,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,i){re(this,a2,!0);const s=t/i,{style:l}=this.div;l.aspectRatio=s,l.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,i=!1){if(i){T(this,Hu)||re(this,Hu,new Map);const{action:s}=t;let l=T(this,Hu).get(s);l&&clearTimeout(l),l=setTimeout(()=>{this._reportTelemetry(t),T(this,Hu).delete(s),T(this,Hu).size===0&&re(this,Hu,null)},Vi._telemetryTimeout),T(this,Hu).set(s,l);return}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),re(this,sT,!1)}disable(){this.div&&(this.div.tabIndex=-1),re(this,sT,!0)}renderAnnotationElement(t){let i=t.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),t.container.prepend(i);else if(i.nodeName==="CANVAS"){const s=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),s.before(i)}return i}resetAnnotationElement(t){const{firstChild:i}=t.container;(i==null?void 0:i.nodeName)==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}};s2=new WeakMap,Kh=new WeakMap,Os=new WeakMap,jo=new WeakMap,sT=new WeakMap,L1=new WeakMap,GN=new WeakMap,a2=new WeakMap,Uo=new WeakMap,o2=new WeakMap,qm=new WeakMap,D1=new WeakMap,WN=new WeakMap,l2=new WeakMap,Rd=new WeakMap,$N=new WeakMap,c2=new WeakMap,Ym=new WeakMap,yp=new WeakMap,aT=new WeakMap,oT=new WeakMap,Hu=new WeakMap,d2=new WeakMap,KN=new WeakMap,p9=new WeakMap,qN=new WeakSet,OY=function([t,i],s,l){[s,l]=this.screenToPageTranslation(s,l),this.x+=s/t,this.y+=l/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},YN=new WeakSet,PY=function(t,i,s){switch(s){case 90:return[i,-t];case 180:return[-t,-i];case 270:return[-i,t];default:return[t,i]}},lT=new WeakSet,dM=function(t){switch(t){case 90:{const[i,s]=this.pageDimensions;return[0,-i/s,s/i,0]}case 180:return[-1,0,0,-1];case 270:{const[i,s]=this.pageDimensions;return[0,i/s,-s/i,0]}default:return[1,0,0,1]}},m9=new WeakSet,G2e=function(){if(T(this,Uo))return;re(this,Uo,document.createElement("div")),T(this,Uo).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const s of t){const l=document.createElement("div");T(this,Uo).append(l),l.classList.add("resizer",s),l.setAttribute("data-resizer-name",s),l.addEventListener("pointerdown",pe(this,g9,W2e).bind(this,s),{signal:i}),l.addEventListener("contextmenu",rh,{signal:i}),l.tabIndex=-1}this.div.prepend(T(this,Uo))},g9=new WeakSet,W2e=function(t,i){var y;i.preventDefault();const{isMac:s}=qo.platform;if(i.button!==0||i.ctrlKey&&s)return;(y=T(this,Os))==null||y.toggle(!1);const l=this._isDraggable;this._isDraggable=!1,re(this,o2,[i.screenX,i.screenY]);const d=new AbortController,u=this._uiManager.combinedSignal(d);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",pe(this,JN,DY).bind(this,t),{passive:!0,capture:!0,signal:u}),window.addEventListener("touchmove",Ra,{passive:!1,signal:u}),window.addEventListener("contextmenu",rh,{signal:u}),re(this,qm,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const p=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const _=()=>{var E;d.abort(),this.parent.togglePointerEvents(!0),(E=T(this,Os))==null||E.toggle(!0),this._isDraggable=l,this.parent.div.style.cursor=p,this.div.style.cursor=g,pe(this,cT,uM).call(this)};window.addEventListener("pointerup",_,{signal:u}),window.addEventListener("blur",_,{signal:u})},XN=new WeakSet,LY=function(t,i,s,l){this.width=s,this.height=l,this.x=t,this.y=i;const[d,u]=this.parentDimensions;this.setDims(d*s,u*l),this.fixAndSetPosition(),this._onResized()},cT=new WeakSet,uM=function(){if(!T(this,qm))return;const{savedX:t,savedY:i,savedWidth:s,savedHeight:l}=T(this,qm);re(this,qm,null);const d=this.x,u=this.y,p=this.width,g=this.height;d===t&&u===i&&p===s&&g===l||this.addCommands({cmd:pe(this,XN,LY).bind(this,d,u,p,g),undo:pe(this,XN,LY).bind(this,t,i,s,l),mustExec:!0})},JN=new WeakSet,DY=function(t,i){const[s,l]=this.parentDimensions,d=this.x,u=this.y,p=this.width,g=this.height,_=Vi.MIN_SIZE/s,y=Vi.MIN_SIZE/l,E=pe(this,lT,dM).call(this,this.rotation),b=(he,Ce)=>[E[0]*he+E[2]*Ce,E[1]*he+E[3]*Ce],A=pe(this,lT,dM).call(this,360-this.rotation),N=(he,Ce)=>[A[0]*he+A[2]*Ce,A[1]*he+A[3]*Ce];let O,D,P=!1,j=!1;switch(t){case"topLeft":P=!0,O=(he,Ce)=>[0,0],D=(he,Ce)=>[he,Ce];break;case"topMiddle":O=(he,Ce)=>[he/2,0],D=(he,Ce)=>[he/2,Ce];break;case"topRight":P=!0,O=(he,Ce)=>[he,0],D=(he,Ce)=>[0,Ce];break;case"middleRight":j=!0,O=(he,Ce)=>[he,Ce/2],D=(he,Ce)=>[0,Ce/2];break;case"bottomRight":P=!0,O=(he,Ce)=>[he,Ce],D=(he,Ce)=>[0,0];break;case"bottomMiddle":O=(he,Ce)=>[he/2,Ce],D=(he,Ce)=>[he/2,0];break;case"bottomLeft":P=!0,O=(he,Ce)=>[0,Ce],D=(he,Ce)=>[he,0];break;case"middleLeft":j=!0,O=(he,Ce)=>[0,Ce/2],D=(he,Ce)=>[he,Ce/2];break}const M=O(p,g),V=D(p,g);let H=b(...V);const $=Vi._round(d+H[0]),Q=Vi._round(u+H[1]);let Y=1,le=1,ae,te;if(i.fromKeyboard)({deltaX:ae,deltaY:te}=i);else{const{screenX:he,screenY:Ce}=i,[fe,me]=T(this,o2);[ae,te]=this.screenToPageTranslation(he-fe,Ce-me),T(this,o2)[0]=he,T(this,o2)[1]=Ce}if([ae,te]=N(ae/s,te/l),P){const he=Math.hypot(p,g);Y=le=Math.max(Math.min(Math.hypot(V[0]-M[0]-ae,V[1]-M[1]-te)/he,1/p,1/g),_/p,y/g)}else j?Y=tc(Math.abs(V[0]-M[0]-ae),_,1)/p:le=tc(Math.abs(V[1]-M[1]-te),y,1)/g;const de=Vi._round(p*Y),G=Vi._round(g*le);H=b(...D(de,G));const ie=$-H[0],_e=Q-H[1];T(this,Rd)||re(this,Rd,[this.x,this.y,this.width,this.height]),this.width=de,this.height=G,this.x=ie,this.y=_e,this.setDims(s*de,l*G),this.fixAndSetPosition(),this._onResizing()},v9=new WeakSet,$2e=function(){var t;re(this,qm,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=T(this,Os))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},y9=new WeakSet,K2e=function(t,i,s){let d=.7*(s/i)+1-.7;if(d===1)return;const u=pe(this,lT,dM).call(this,this.rotation),p=($,Q)=>[u[0]*$+u[2]*Q,u[1]*$+u[3]*Q],[g,_]=this.parentDimensions,y=this.x,E=this.y,b=this.width,A=this.height,N=Vi.MIN_SIZE/g,O=Vi.MIN_SIZE/_;d=Math.max(Math.min(d,1/b,1/A),N/b,O/A);const D=Vi._round(b*d),P=Vi._round(A*d);if(D===b&&P===A)return;T(this,Rd)||re(this,Rd,[y,E,b,A]);const j=p(b/2,A/2),M=Vi._round(y+j[0]),V=Vi._round(E+j[1]),H=p(D/2,P/2);this.x=M-H[0],this.y=V-H[1],this.width=D,this.height=P,this.setDims(g*D,_*P),this.fixAndSetPosition(),this._onResizing()},_9=new WeakSet,q2e=function(){var t;(t=T(this,Os))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),pe(this,cT,uM).call(this)},QN=new WeakSet,kY=function(t){const{isMac:i}=qo.platform;t.ctrlKey&&!i||t.shiftKey||t.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)},E9=new WeakSet,Y2e=function(t){const{isSelected:i}=this;this._uiManager.setUpDragSession();let s=!1;const l=new AbortController,d=this._uiManager.combinedSignal(l),u={capture:!0,passive:!1,signal:d},p=_=>{l.abort(),re(this,L1,null),re(this,l2,!1),this._uiManager.endDragSession()||pe(this,QN,kY).call(this,_),s&&this._onStopDragging()};i&&(re(this,aT,t.clientX),re(this,oT,t.clientY),re(this,L1,t.pointerId),re(this,GN,t.pointerType),window.addEventListener("pointermove",_=>{s||(s=!0,this._onStartDragging());const{clientX:y,clientY:E,pointerId:b}=_;if(b!==T(this,L1)){Ra(_);return}const[A,N]=this.screenToPageTranslation(y-T(this,aT),E-T(this,oT));re(this,aT,y),re(this,oT,E),this._uiManager.dragSelectedEditors(A,N)},u),window.addEventListener("touchmove",Ra,u),window.addEventListener("pointerdown",_=>{_.pointerType===T(this,GN)&&(T(this,d2)||_.isPrimary)&&p(_),Ra(_)},u));const g=_=>{if(!T(this,L1)||T(this,L1)===_.pointerId){p(_);return}Ra(_)};window.addEventListener("pointerup",g,{signal:d}),window.addEventListener("blur",g,{signal:d})},ZN=new WeakSet,MY=function(){if(T(this,D1)||!this.div)return;re(this,D1,new AbortController);const t=this._uiManager.combinedSignal(T(this,D1));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},w9=new WeakSet,X2e=function(t){Vi._resizerKeyboardManager.exec(this,t)},S9=new WeakSet,J2e=function(t){var i;T(this,Ym)&&((i=t.relatedTarget)==null?void 0:i.parentNode)!==T(this,Uo)&&pe(this,u2,BI).call(this)},b9=new WeakSet,Q2e=function(t){re(this,WN,T(this,Ym)?t:"")},e5=new WeakSet,jY=function(t){if(T(this,Kh))for(const i of T(this,Kh))i.tabIndex=t},u2=new WeakSet,BI=function(){re(this,Ym,!1),pe(this,e5,jY).call(this,-1),pe(this,cT,uM).call(this)},ee(Vi,YN),sn(Vi,"_l10n",null),sn(Vi,"_l10nResizer",null),sn(Vi,"_borderLineWidth",-1),sn(Vi,"_colorManager",new CY),sn(Vi,"_zIndex",1),sn(Vi,"_telemetryTimeout",1e3);let ds=Vi;class FQe extends ds{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const yfe=3285377520,Du=4294901760,Qf=65535;class Z2e{constructor(t){this.h1=t?t&4294967295:yfe,this.h2=t?t&4294967295:yfe}update(t){let i,s;if(typeof t=="string"){i=new Uint8Array(t.length*2),s=0;for(let O=0,D=t.length;O<D;O++){const P=t.charCodeAt(O);P<=255?i[s++]=P:(i[s++]=P>>>8,i[s++]=P&255)}}else if(ArrayBuffer.isView(t))i=t.slice(),s=i.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const l=s>>2,d=s-l*4,u=new Uint32Array(i.buffer,0,l);let p=0,g=0,_=this.h1,y=this.h2;const E=3432918353,b=461845907,A=E&Qf,N=b&Qf;for(let O=0;O<l;O++)O&1?(p=u[O],p=p*E&Du|p*A&Qf,p=p<<15|p>>>17,p=p*b&Du|p*N&Qf,_^=p,_=_<<13|_>>>19,_=_*5+3864292196):(g=u[O],g=g*E&Du|g*A&Qf,g=g<<15|g>>>17,g=g*b&Du|g*N&Qf,y^=g,y=y<<13|y>>>19,y=y*5+3864292196);switch(p=0,d){case 3:p^=i[l*4+2]<<16;case 2:p^=i[l*4+1]<<8;case 1:p^=i[l*4],p=p*E&Du|p*A&Qf,p=p<<15|p>>>17,p=p*b&Du|p*N&Qf,l&1?_^=p:y^=p}this.h1=_,this.h2=y}hexdigest(){let t=this.h1,i=this.h2;return t^=i>>>1,t=t*3981806797&Du|t*36045&Qf,i=i*4283543511&Du|((i<<16|t>>>16)*2950163797&Du)>>>16,t^=i>>>1,t=t*444984403&Du|t*60499&Qf,i=i*3301882366&Du|((i<<16|t>>>16)*3120437893&Du)>>>16,t^=i>>>1,(t>>>0).toString(16).padStart(8,"0")+(i>>>0).toString(16).padStart(8,"0")}}const UY=Object.freeze({map:null,hash:"",transfer:void 0});var h2,f2,Fo,C9,eEe;class cZ{constructor(){ee(this,C9);ee(this,h2,!1);ee(this,f2,null);ee(this,Fo,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,i){const s=T(this,Fo).get(t);return s===void 0?i:Object.assign(i,s)}getRawValue(t){return T(this,Fo).get(t)}remove(t){if(T(this,Fo).delete(t),T(this,Fo).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of T(this,Fo).values())if(i instanceof ds)return;this.onAnnotationEditor(null)}}setValue(t,i){const s=T(this,Fo).get(t);let l=!1;if(s!==void 0)for(const[d,u]of Object.entries(i))s[d]!==u&&(l=!0,s[d]=u);else l=!0,T(this,Fo).set(t,i);l&&pe(this,C9,eEe).call(this),i instanceof ds&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(t){return T(this,Fo).has(t)}get size(){return T(this,Fo).size}resetModified(){T(this,h2)&&(re(this,h2,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new tEe(this)}get serializable(){if(T(this,Fo).size===0)return UY;const t=new Map,i=new Z2e,s=[],l=Object.create(null);let d=!1;for(const[u,p]of T(this,Fo)){const g=p instanceof ds?p.serialize(!1,l):p;g&&(t.set(u,g),i.update(`${u}:${JSON.stringify(g)}`),d||(d=!!g.bitmap))}if(d)for(const u of t.values())u.bitmap&&s.push(u.bitmap);return t.size>0?{map:t,hash:i.hexdigest(),transfer:s}:UY}get editorStats(){let t=null;const i=new Map;for(const s of T(this,Fo).values()){if(!(s instanceof ds))continue;const l=s.telemetryFinalData;if(!l)continue;const{type:d}=l;i.has(d)||i.set(d,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const u=t[d]||(t[d]=new Map);for(const[p,g]of Object.entries(l)){if(p==="type")continue;let _=u.get(p);_||(_=new Map,u.set(p,_));const y=_.get(g)??0;_.set(g,y+1)}}for(const[s,l]of i)t[s]=l.computeTelemetryFinalData(t[s]);return t}resetModifiedIds(){re(this,f2,null)}get modifiedIds(){if(T(this,f2))return T(this,f2);const t=[];for(const i of T(this,Fo).values())!(i instanceof ds)||!i.annotationElementId||!i.serialize()||t.push(i.annotationElementId);return re(this,f2,{ids:new Set(t),hash:t.join(",")})}[Symbol.iterator](){return T(this,Fo).entries()}}h2=new WeakMap,f2=new WeakMap,Fo=new WeakMap,C9=new WeakSet,eEe=function(){T(this,h2)||(re(this,h2,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var t5;class tEe extends cZ{constructor(i){super();ee(this,t5,void 0);const{map:s,hash:l,transfer:d}=i.serializable,u=structuredClone(s,d?{transfer:d}:null);re(this,t5,{map:u,hash:l,transfer:d})}get print(){Zr("Should not call PrintAnnotationStorage.print")}get serializable(){return T(this,t5)}get modifiedIds(){return Ki(this,"modifiedIds",{ids:new Set,hash:""})}}t5=new WeakMap;var dT;class BQe{constructor({ownerDocument:t=globalThis.document,styleElement:i=null}){ee(this,dT,new Set);this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),T(this,dT).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:i,_inspectFont:s}){if(!(!t||T(this,dT).has(t.loadedName))){if(Aa(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:l,src:d,style:u}=t,p=new FontFace(l,d,u);this.addNativeFontFace(p);try{await p.load(),T(this,dT).add(l),s==null||s(t)}catch{Ei(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(p)}return}Zr("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const s=t.createNativeFontFace();if(s){this.addNativeFontFace(s);try{await s.loaded}catch(l){throw Ei(`Failed to load font '${s.family}': '${l}'.`),t.disableFontFace=!0,l}}return}const i=t.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(s=>{const l=this._queueLoadingCallback(s);this._prepareFontLoadEvent(t,l)})}}get isFontLoadingAPISupported(){var i;const t=!!((i=this._document)!=null&&i.fonts);return Ki(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return Ki(this,"isSyncFontLoadingSupported",ec||qo.platform.isFirefox)}_queueLoadingCallback(t){function i(){for(Aa(!l.done,"completeRequest() cannot be called twice."),l.done=!0;s.length>0&&s[0].done;){const d=s.shift();setTimeout(d.callback,0)}}const{loadingRequests:s}=this,l={done:!1,complete:i,callback:t};return s.push(l),l}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Ki(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,i){function s(V,H){return V.charCodeAt(H)<<24|V.charCodeAt(H+1)<<16|V.charCodeAt(H+2)<<8|V.charCodeAt(H+3)&255}function l(V,H,$,Q){const Y=V.substring(0,H),le=V.substring(H+$);return Y+Q+le}let d,u;const p=this._document.createElement("canvas");p.width=1,p.height=1;const g=p.getContext("2d");let _=0;function y(V,H){if(++_>30){Ei("Load test font never loaded."),H();return}if(g.font="30px "+V,g.fillText(".",0,20),g.getImageData(0,0,1,1).data[3]>0){H();return}setTimeout(y.bind(null,V,H))}const E=`lt${Date.now()}${this.loadTestFontId++}`;let b=this._loadTestFont;b=l(b,976,E.length,E);const N=16,O=1482184792;let D=s(b,N);for(d=0,u=E.length-3;d<u;d+=4)D=D-O+s(E,d)|0;d<E.length&&(D=D-O+s(E+"XXX",d)|0),b=l(b,N,4,CQe(D));const P=`url(data:font/opentype;base64,${btoa(b)});`,j=`@font-face {font-family:"${E}";src:${P}}`;this.insertRule(j);const M=this._document.createElement("div");M.style.visibility="hidden",M.style.width=M.style.height="10px",M.style.position="absolute",M.style.top=M.style.left="0px";for(const V of[t.loadedName,E]){const H=this._document.createElement("span");H.textContent="Hi",H.style.fontFamily=V,M.append(H)}this._document.body.append(M),y(E,()=>{M.remove(),i.complete()})}}dT=new WeakMap;class VQe{constructor(t,i=null){this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this._inspectFont=i}createNativeFontFace(){var i;if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const s={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(s.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,s)}return(i=this._inspectFont)==null||i.call(this,this),t}createFontFaceRule(){var s;if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${S2e(this.data)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let l=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(l+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${l}src:${t}}`}return(s=this._inspectFont)==null||s.call(this,this,t),i}getPathGenerator(t,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const s=this.loadedName+"_path_"+i;let l;try{l=t.get(s)}catch(u){Ei(`getPathGenerator - ignoring character: "${u}".`)}const d=new Path2D(l||"");return this.fontExtraProperties||t.delete(s),this.compiledGlyphs[i]=d}}function zQe(n){if(n instanceof URL)return n.href;if(typeof n=="string"){if(ec)return n;const t=URL.parse(n,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function HQe(n){if(ec&&typeof o7<"u"&&n instanceof o7)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return eP(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n==null?void 0:n.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function xk(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}const FY=n=>typeof n=="object"&&Number.isInteger(n==null?void 0:n.num)&&n.num>=0&&Number.isInteger(n==null?void 0:n.gen)&&n.gen>=0,GQe=n=>typeof n=="object"&&typeof(n==null?void 0:n.name)=="string",WQe=IQe.bind(null,FY,GQe);var Xm,T9;class $Qe{constructor(){ee(this,Xm,new Map);ee(this,T9,Promise.resolve())}postMessage(t,i){const s={data:structuredClone(t,i?{transfer:i}:null)};T(this,T9).then(()=>{for(const[l]of T(this,Xm))l.call(this,s)})}addEventListener(t,i,s=null){let l=null;if((s==null?void 0:s.signal)instanceof AbortSignal){const{signal:d}=s;if(d.aborted){Ei("LoopbackPort - cannot use an `aborted` signal.");return}const u=()=>this.removeEventListener(t,i);l=()=>d.removeEventListener("abort",u),d.addEventListener("abort",u)}T(this,Xm).set(i,l)}removeEventListener(t,i){const s=T(this,Xm).get(i);s==null||s(),T(this,Xm).delete(i)}terminate(){for(const[,t]of T(this,Xm))t==null||t();T(this,Xm).clear()}}Xm=new WeakMap,T9=new WeakMap;const Ak={DATA:1,ERROR:2},Ca={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function _fe(){}function Vc(n){if(n instanceof Dv||n instanceof _Y||n instanceof mfe||n instanceof N7||n instanceof iK)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||Zr('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Dv(n.message);case"InvalidPDFException":return new _Y(n.message);case"PasswordException":return new mfe(n.message,n.code);case"ResponseException":return new N7(n.message,n.status,n.missing);case"UnknownErrorException":return new iK(n.message,n.details)}return new iK(n.message,n.toString())}var uT,R9,nEe,x9,iEe,A9,rEe,hT,hM;class VI{constructor(t,i,s){ee(this,R9);ee(this,x9);ee(this,A9);ee(this,hT);ee(this,uT,new AbortController);this.sourceName=t,this.targetName=i,this.comObj=s,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),s.addEventListener("message",pe(this,R9,nEe).bind(this),{signal:T(this,uT).signal})}on(t,i){const s=this.actionHandler;if(s[t])throw new Error(`There is already an actionName called "${t}"`);s[t]=i}send(t,i,s){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:i},s)}sendWithPromise(t,i,s){const l=this.callbackId++,d=Promise.withResolvers();this.callbackCapabilities[l]=d;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:l,data:i},s)}catch(u){d.reject(u)}return d.promise}sendWithStream(t,i,s,l){const d=this.streamId++,u=this.sourceName,p=this.targetName,g=this.comObj;return new ReadableStream({start:_=>{const y=Promise.withResolvers();return this.streamControllers[d]={controller:_,startCall:y,pullCall:null,cancelCall:null,isClosed:!1},g.postMessage({sourceName:u,targetName:p,action:t,streamId:d,data:i,desiredSize:_.desiredSize},l),y.promise},pull:_=>{const y=Promise.withResolvers();return this.streamControllers[d].pullCall=y,g.postMessage({sourceName:u,targetName:p,stream:Ca.PULL,streamId:d,desiredSize:_.desiredSize}),y.promise},cancel:_=>{Aa(_ instanceof Error,"cancel must have a valid reason");const y=Promise.withResolvers();return this.streamControllers[d].cancelCall=y,this.streamControllers[d].isClosed=!0,g.postMessage({sourceName:u,targetName:p,stream:Ca.CANCEL,streamId:d,reason:Vc(_)}),y.promise}},s)}destroy(){var t;(t=T(this,uT))==null||t.abort(),re(this,uT,null)}}uT=new WeakMap,R9=new WeakSet,nEe=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){pe(this,A9,rEe).call(this,t);return}if(t.callback){const s=t.callbackId,l=this.callbackCapabilities[s];if(!l)throw new Error(`Cannot resolve callback ${s}`);if(delete this.callbackCapabilities[s],t.callback===Ak.DATA)l.resolve(t.data);else if(t.callback===Ak.ERROR)l.reject(Vc(t.reason));else throw new Error("Unexpected callback case");return}const i=this.actionHandler[t.action];if(!i)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const s=this.sourceName,l=t.sourceName,d=this.comObj;Promise.try(i,t.data).then(function(u){d.postMessage({sourceName:s,targetName:l,callback:Ak.DATA,callbackId:t.callbackId,data:u})},function(u){d.postMessage({sourceName:s,targetName:l,callback:Ak.ERROR,callbackId:t.callbackId,reason:Vc(u)})});return}if(t.streamId){pe(this,x9,iEe).call(this,t);return}i(t.data)},x9=new WeakSet,iEe=function(t){const i=t.streamId,s=this.sourceName,l=t.sourceName,d=this.comObj,u=this,p=this.actionHandler[t.action],g={enqueue(_,y=1,E){if(this.isCancelled)return;const b=this.desiredSize;this.desiredSize-=y,b>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),d.postMessage({sourceName:s,targetName:l,stream:Ca.ENQUEUE,streamId:i,chunk:_},E)},close(){this.isCancelled||(this.isCancelled=!0,d.postMessage({sourceName:s,targetName:l,stream:Ca.CLOSE,streamId:i}),delete u.streamSinks[i])},error(_){Aa(_ instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,d.postMessage({sourceName:s,targetName:l,stream:Ca.ERROR,streamId:i,reason:Vc(_)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};g.sinkCapability.resolve(),g.ready=g.sinkCapability.promise,this.streamSinks[i]=g,Promise.try(p,t.data,g).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ca.START_COMPLETE,streamId:i,success:!0})},function(_){d.postMessage({sourceName:s,targetName:l,stream:Ca.START_COMPLETE,streamId:i,reason:Vc(_)})})},A9=new WeakSet,rEe=function(t){const i=t.streamId,s=this.sourceName,l=t.sourceName,d=this.comObj,u=this.streamControllers[i],p=this.streamSinks[i];switch(t.stream){case Ca.START_COMPLETE:t.success?u.startCall.resolve():u.startCall.reject(Vc(t.reason));break;case Ca.PULL_COMPLETE:t.success?u.pullCall.resolve():u.pullCall.reject(Vc(t.reason));break;case Ca.PULL:if(!p){d.postMessage({sourceName:s,targetName:l,stream:Ca.PULL_COMPLETE,streamId:i,success:!0});break}p.desiredSize<=0&&t.desiredSize>0&&p.sinkCapability.resolve(),p.desiredSize=t.desiredSize,Promise.try(p.onPull||_fe).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ca.PULL_COMPLETE,streamId:i,success:!0})},function(_){d.postMessage({sourceName:s,targetName:l,stream:Ca.PULL_COMPLETE,streamId:i,reason:Vc(_)})});break;case Ca.ENQUEUE:if(Aa(u,"enqueue should have stream controller"),u.isClosed)break;u.controller.enqueue(t.chunk);break;case Ca.CLOSE:if(Aa(u,"close should have stream controller"),u.isClosed)break;u.isClosed=!0,u.controller.close(),pe(this,hT,hM).call(this,u,i);break;case Ca.ERROR:Aa(u,"error should have stream controller"),u.controller.error(Vc(t.reason)),pe(this,hT,hM).call(this,u,i);break;case Ca.CANCEL_COMPLETE:t.success?u.cancelCall.resolve():u.cancelCall.reject(Vc(t.reason)),pe(this,hT,hM).call(this,u,i);break;case Ca.CANCEL:if(!p)break;const g=Vc(t.reason);Promise.try(p.onCancel||_fe,g).then(function(){d.postMessage({sourceName:s,targetName:l,stream:Ca.CANCEL_COMPLETE,streamId:i,success:!0})},function(_){d.postMessage({sourceName:s,targetName:l,stream:Ca.CANCEL_COMPLETE,streamId:i,reason:Vc(_)})}),p.sinkCapability.reject(g),p.isCancelled=!0,delete this.streamSinks[i];break;default:throw new Error("Unexpected stream case")}},hT=new WeakSet,hM=async function(t,i){var s,l,d;await Promise.allSettled([(s=t.startCall)==null?void 0:s.promise,(l=t.pullCall)==null?void 0:l.promise,(d=t.cancelCall)==null?void 0:d.promise]),delete this.streamControllers[i]};var n5;class sEe{constructor({enableHWA:t=!1}){ee(this,n5,!1);re(this,n5,t)}create(t,i){if(t<=0||i<=0)throw new Error("Invalid canvas size");const s=this._createCanvas(t,i);return{canvas:s,context:s.getContext("2d",{willReadFrequently:!T(this,n5)})}}reset(t,i,s){if(!t.canvas)throw new Error("Canvas is not specified");if(i<=0||s<=0)throw new Error("Invalid canvas size");t.canvas.width=i,t.canvas.height=s}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,i){Zr("Abstract method `_createCanvas` called.")}}n5=new WeakMap;class KQe extends sEe{constructor({ownerDocument:t=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=t}_createCanvas(t,i){const s=this._document.createElement("canvas");return s.width=t,s.height=i,s}}class aEe{constructor({baseUrl:t=null,isCompressed:i=!0}){this.baseUrl=t,this.isCompressed=i}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const i=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(i).then(s=>({cMapData:s,isCompressed:this.isCompressed})).catch(s=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(t){Zr("Abstract method `_fetch` called.")}}class Efe extends aEe{async _fetch(t){const i=await tP(t,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):eP(i)}}class oEe{addFilter(t){return"none"}addHCMFilter(t,i){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,i,s,l,d){return"none"}destroy(t=!1){}}var p2,fT,Jm,Qm,ml,m2,g2,ho,fl,v2,zI,k1,Wb,pT,fM,M1,$b,I9,lEe,i5,BY,j1,Kb,y2,HI,_2,GI,r5,VY,E2,WI;class qQe extends oEe{constructor({docId:i,ownerDocument:s=globalThis.document}){super();ee(this,ho);ee(this,v2);ee(this,k1);ee(this,pT);ee(this,M1);ee(this,I9);ee(this,i5);ee(this,j1);ee(this,y2);ee(this,_2);ee(this,r5);ee(this,E2);ee(this,p2,void 0);ee(this,fT,void 0);ee(this,Jm,void 0);ee(this,Qm,void 0);ee(this,ml,void 0);ee(this,m2,void 0);ee(this,g2,0);re(this,Qm,i),re(this,ml,s)}addFilter(i){if(!i)return"none";let s=T(this,ho,fl).get(i);if(s)return s;const[l,d,u]=pe(this,pT,fM).call(this,i),p=i.length===1?l:`${l}${d}${u}`;if(s=T(this,ho,fl).get(p),s)return T(this,ho,fl).set(i,s),s;const g=`g_${T(this,Qm)}_transfer_map_${ao(this,g2)._++}`,_=pe(this,M1,$b).call(this,g);T(this,ho,fl).set(i,_),T(this,ho,fl).set(p,_);const y=pe(this,j1,Kb).call(this,g);return pe(this,_2,GI).call(this,l,d,u,y),_}addHCMFilter(i,s){var N;const l=`${i}-${s}`,d="base";let u=T(this,v2,zI).get(d);if((u==null?void 0:u.key)===l||(u?((N=u.filter)==null||N.remove(),u.key=l,u.url="none",u.filter=null):(u={key:l,url:"none",filter:null},T(this,v2,zI).set(d,u)),!i||!s))return u.url;const p=pe(this,E2,WI).call(this,i);i=zn.makeHexColor(...p);const g=pe(this,E2,WI).call(this,s);if(s=zn.makeHexColor(...g),T(this,k1,Wb).style.color="",i==="#000000"&&s==="#ffffff"||i===s)return u.url;const _=new Array(256);for(let O=0;O<=255;O++){const D=O/255;_[O]=D<=.03928?D/12.92:((D+.055)/1.055)**2.4}const y=_.join(","),E=`g_${T(this,Qm)}_hcm_filter`,b=u.filter=pe(this,j1,Kb).call(this,E);pe(this,_2,GI).call(this,y,y,y,b),pe(this,i5,BY).call(this,b);const A=(O,D)=>{const P=p[O]/255,j=g[O]/255,M=new Array(D+1);for(let V=0;V<=D;V++)M[V]=P+V/D*(j-P);return M.join(",")};return pe(this,_2,GI).call(this,A(0,5),A(1,5),A(2,5),b),u.url=pe(this,M1,$b).call(this,E),u.url}addAlphaFilter(i){let s=T(this,ho,fl).get(i);if(s)return s;const[l]=pe(this,pT,fM).call(this,[i]),d=`alpha_${l}`;if(s=T(this,ho,fl).get(d),s)return T(this,ho,fl).set(i,s),s;const u=`g_${T(this,Qm)}_alpha_map_${ao(this,g2)._++}`,p=pe(this,M1,$b).call(this,u);T(this,ho,fl).set(i,p),T(this,ho,fl).set(d,p);const g=pe(this,j1,Kb).call(this,u);return pe(this,r5,VY).call(this,l,g),p}addLuminosityFilter(i){let s=T(this,ho,fl).get(i||"luminosity");if(s)return s;let l,d;if(i?([l]=pe(this,pT,fM).call(this,[i]),d=`luminosity_${l}`):d="luminosity",s=T(this,ho,fl).get(d),s)return T(this,ho,fl).set(i,s),s;const u=`g_${T(this,Qm)}_luminosity_map_${ao(this,g2)._++}`,p=pe(this,M1,$b).call(this,u);T(this,ho,fl).set(i,p),T(this,ho,fl).set(d,p);const g=pe(this,j1,Kb).call(this,u);return pe(this,I9,lEe).call(this,g),i&&pe(this,r5,VY).call(this,l,g),p}addHighlightHCMFilter(i,s,l,d,u){var j;const p=`${s}-${l}-${d}-${u}`;let g=T(this,v2,zI).get(i);if((g==null?void 0:g.key)===p||(g?((j=g.filter)==null||j.remove(),g.key=p,g.url="none",g.filter=null):(g={key:p,url:"none",filter:null},T(this,v2,zI).set(i,g)),!s||!l))return g.url;const[_,y]=[s,l].map(pe(this,E2,WI).bind(this));let E=Math.round(.2126*_[0]+.7152*_[1]+.0722*_[2]),b=Math.round(.2126*y[0]+.7152*y[1]+.0722*y[2]),[A,N]=[d,u].map(pe(this,E2,WI).bind(this));b<E&&([E,b,A,N]=[b,E,N,A]),T(this,k1,Wb).style.color="";const O=(M,V,H)=>{const $=new Array(256),Q=(b-E)/H,Y=M/255,le=(V-M)/(255*H);let ae=0;for(let te=0;te<=H;te++){const de=Math.round(E+te*Q),G=Y+te*le;for(let ie=ae;ie<=de;ie++)$[ie]=G;ae=de+1}for(let te=ae;te<256;te++)$[te]=$[ae-1];return $.join(",")},D=`g_${T(this,Qm)}_hcm_${i}_filter`,P=g.filter=pe(this,j1,Kb).call(this,D);return pe(this,i5,BY).call(this,P),pe(this,_2,GI).call(this,O(A[0],N[0],5),O(A[1],N[1],5),O(A[2],N[2],5),P),g.url=pe(this,M1,$b).call(this,D),g.url}destroy(i=!1){var s,l,d,u;i&&((s=T(this,m2))!=null&&s.size)||((l=T(this,Jm))==null||l.parentNode.parentNode.remove(),re(this,Jm,null),(d=T(this,fT))==null||d.clear(),re(this,fT,null),(u=T(this,m2))==null||u.clear(),re(this,m2,null),re(this,g2,0))}}p2=new WeakMap,fT=new WeakMap,Jm=new WeakMap,Qm=new WeakMap,ml=new WeakMap,m2=new WeakMap,g2=new WeakMap,ho=new WeakSet,fl=function(){return T(this,fT)||re(this,fT,new Map)},v2=new WeakSet,zI=function(){return T(this,m2)||re(this,m2,new Map)},k1=new WeakSet,Wb=function(){if(!T(this,Jm)){const i=T(this,ml).createElement("div"),{style:s}=i;s.visibility="hidden",s.contain="strict",s.width=s.height=0,s.position="absolute",s.top=s.left=0,s.zIndex=-1;const l=T(this,ml).createElementNS(Im,"svg");l.setAttribute("width",0),l.setAttribute("height",0),re(this,Jm,T(this,ml).createElementNS(Im,"defs")),i.append(l),l.append(T(this,Jm)),T(this,ml).body.append(i)}return T(this,Jm)},pT=new WeakSet,fM=function(i){if(i.length===1){const _=i[0],y=new Array(256);for(let b=0;b<256;b++)y[b]=_[b]/255;const E=y.join(",");return[E,E,E]}const[s,l,d]=i,u=new Array(256),p=new Array(256),g=new Array(256);for(let _=0;_<256;_++)u[_]=s[_]/255,p[_]=l[_]/255,g[_]=d[_]/255;return[u.join(","),p.join(","),g.join(",")]},M1=new WeakSet,$b=function(i){if(T(this,p2)===void 0){re(this,p2,"");const s=T(this,ml).URL;s!==T(this,ml).baseURI&&(qU(s)?Ei('#createUrl: ignore "data:"-URL for performance reasons.'):re(this,p2,_2e(s,"")))}return`url(${T(this,p2)}#${i})`},I9=new WeakSet,lEe=function(i){const s=T(this,ml).createElementNS(Im,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),i.append(s)},i5=new WeakSet,BY=function(i){const s=T(this,ml).createElementNS(Im,"feColorMatrix");s.setAttribute("type","matrix"),s.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),i.append(s)},j1=new WeakSet,Kb=function(i){const s=T(this,ml).createElementNS(Im,"filter");return s.setAttribute("color-interpolation-filters","sRGB"),s.setAttribute("id",i),T(this,k1,Wb).append(s),s},y2=new WeakSet,HI=function(i,s,l){const d=T(this,ml).createElementNS(Im,s);d.setAttribute("type","discrete"),d.setAttribute("tableValues",l),i.append(d)},_2=new WeakSet,GI=function(i,s,l,d){const u=T(this,ml).createElementNS(Im,"feComponentTransfer");d.append(u),pe(this,y2,HI).call(this,u,"feFuncR",i),pe(this,y2,HI).call(this,u,"feFuncG",s),pe(this,y2,HI).call(this,u,"feFuncB",l)},r5=new WeakSet,VY=function(i,s){const l=T(this,ml).createElementNS(Im,"feComponentTransfer");s.append(l),pe(this,y2,HI).call(this,l,"feFuncA",i)},E2=new WeakSet,WI=function(i){return T(this,k1,Wb).style.color=i,YU(getComputedStyle(T(this,k1,Wb)).getPropertyValue("color"))};class cEe{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(s=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(t){Zr("Abstract method `_fetch` called.")}}class wfe extends cEe{async _fetch(t){const i=await tP(t,"arraybuffer");return new Uint8Array(i)}}class dEe{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${t}`;return this._fetch(i).catch(s=>{throw new Error(`Unable to load wasm data at: ${i}`)})}async _fetch(t){Zr("Abstract method `_fetch` called.")}}class Sfe extends dEe{async _fetch(t){const i=await tP(t,"arraybuffer");return new Uint8Array(i)}}ec&&Ei("Please use the `legacy` build in Node.js environments.");async function dZ(n){const i=await ic.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(i)}class YQe extends oEe{}class XQe extends sEe{_createCanvas(t,i){return ic.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t,i)}}class JQe extends aEe{async _fetch(t){return dZ(t)}}class QQe extends cEe{async _fetch(t){return dZ(t)}}class ZQe extends dEe{async _fetch(t){return dZ(t)}}const Ho={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function zY(n,t){if(!t)return;const i=t[2]-t[0],s=t[3]-t[1],l=new Path2D;l.rect(t[0],t[1],i,s),n.clip(l)}class uZ{isModifyingCurrentTransform(){return!1}getPattern(){Zr("Abstract method `getPattern` called.")}}class eZe extends uZ{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let i;this._type==="axial"?i=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const s of this._colorStops)i.addColorStop(s[0],s[1]);return i}getPattern(t,i,s,l){let d;if(l===Ho.STROKE||l===Ho.FILL){const u=i.current.getClippedPathBoundingBox(l,Fs(t))||[0,0,0,0],p=Math.ceil(u[2]-u[0])||1,g=Math.ceil(u[3]-u[1])||1,_=i.cachedCanvases.getCanvas("pattern",p,g),y=_.context;y.clearRect(0,0,y.canvas.width,y.canvas.height),y.beginPath(),y.rect(0,0,y.canvas.width,y.canvas.height),y.translate(-u[0],-u[1]),s=zn.transform(s,[1,0,0,1,u[0],u[1]]),y.transform(...i.baseTransform),this.matrix&&y.transform(...this.matrix),zY(y,this._bbox),y.fillStyle=this._createGradient(y),y.fill(),d=t.createPattern(_.canvas,"no-repeat");const E=new DOMMatrix(s);d.setTransform(E)}else zY(t,this._bbox),d=this._createGradient(t);return d}}function aK(n,t,i,s,l,d,u,p){const g=t.coords,_=t.colors,y=n.data,E=n.width*4;let b;g[i+1]>g[s+1]&&(b=i,i=s,s=b,b=d,d=u,u=b),g[s+1]>g[l+1]&&(b=s,s=l,l=b,b=u,u=p,p=b),g[i+1]>g[s+1]&&(b=i,i=s,s=b,b=d,d=u,u=b);const A=(g[i]+t.offsetX)*t.scaleX,N=(g[i+1]+t.offsetY)*t.scaleY,O=(g[s]+t.offsetX)*t.scaleX,D=(g[s+1]+t.offsetY)*t.scaleY,P=(g[l]+t.offsetX)*t.scaleX,j=(g[l+1]+t.offsetY)*t.scaleY;if(N>=j)return;const M=_[d],V=_[d+1],H=_[d+2],$=_[u],Q=_[u+1],Y=_[u+2],le=_[p],ae=_[p+1],te=_[p+2],de=Math.round(N),G=Math.round(j);let ie,_e,he,Ce,fe,me,Ne,Fe;for(let je=de;je<=G;je++){if(je<D){const we=je<N?0:(N-je)/(N-D);ie=A-(A-O)*we,_e=M-(M-$)*we,he=V-(V-Q)*we,Ce=H-(H-Y)*we}else{let we;je>j?we=1:D===j?we=0:we=(D-je)/(D-j),ie=O-(O-P)*we,_e=$-($-le)*we,he=Q-(Q-ae)*we,Ce=Y-(Y-te)*we}let Ve;je<N?Ve=0:je>j?Ve=1:Ve=(N-je)/(N-j),fe=A-(A-P)*Ve,me=M-(M-le)*Ve,Ne=V-(V-ae)*Ve,Fe=H-(H-te)*Ve;const Re=Math.round(Math.min(ie,fe)),Be=Math.round(Math.max(ie,fe));let Xe=E*je+Re*4;for(let we=Re;we<=Be;we++)Ve=(ie-we)/(ie-fe),Ve<0?Ve=0:Ve>1&&(Ve=1),y[Xe++]=_e-(_e-me)*Ve|0,y[Xe++]=he-(he-Ne)*Ve|0,y[Xe++]=Ce-(Ce-Fe)*Ve|0,y[Xe++]=255}}function tZe(n,t,i){const s=t.coords,l=t.colors;let d,u;switch(t.type){case"lattice":const p=t.verticesPerRow,g=Math.floor(s.length/p)-1,_=p-1;for(d=0;d<g;d++){let y=d*p;for(let E=0;E<_;E++,y++)aK(n,i,s[y],s[y+1],s[y+p],l[y],l[y+1],l[y+p]),aK(n,i,s[y+p+1],s[y+1],s[y+p],l[y+p+1],l[y+1],l[y+p])}break;case"triangles":for(d=0,u=s.length;d<u;d+=3)aK(n,i,s[d],s[d+1],s[d+2],l[d],l[d+1],l[d+2]);break;default:throw new Error("illegal figure")}}class nZe extends uZ{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,i,s){const p=Math.floor(this._bounds[0]),g=Math.floor(this._bounds[1]),_=Math.ceil(this._bounds[2])-p,y=Math.ceil(this._bounds[3])-g,E=Math.min(Math.ceil(Math.abs(_*t[0]*1.1)),3e3),b=Math.min(Math.ceil(Math.abs(y*t[1]*1.1)),3e3),A=_/E,N=y/b,O={coords:this._coords,colors:this._colors,offsetX:-p,offsetY:-g,scaleX:1/A,scaleY:1/N},D=E+2*2,P=b+2*2,j=s.getCanvas("mesh",D,P),M=j.context,V=M.createImageData(E,b);if(i){const $=V.data;for(let Q=0,Y=$.length;Q<Y;Q+=4)$[Q]=i[0],$[Q+1]=i[1],$[Q+2]=i[2],$[Q+3]=255}for(const $ of this._figures)tZe(V,$,O);return M.putImageData(V,2,2),{canvas:j.canvas,offsetX:p-2*A,offsetY:g-2*N,scaleX:A,scaleY:N}}isModifyingCurrentTransform(){return!0}getPattern(t,i,s,l){zY(t,this._bbox);const d=new Float32Array(2);if(l===Ho.SHADING)zn.singularValueDecompose2dScale(Fs(t),d);else if(this.matrix){zn.singularValueDecompose2dScale(this.matrix,d);const[p,g]=d;zn.singularValueDecompose2dScale(i.baseTransform,d),d[0]*=p,d[1]*=g}else zn.singularValueDecompose2dScale(i.baseTransform,d);const u=this._createMeshCanvas(d,l===Ho.SHADING?null:this._background,i.cachedCanvases);return l!==Ho.SHADING&&(t.setTransform(...i.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(u.offsetX,u.offsetY),t.scale(u.scaleX,u.scaleY),t.createPattern(u.canvas,"no-repeat")}}class iZe extends uZ{getPattern(){return"hotpink"}}function rZe(n){switch(n[0]){case"RadialAxial":return new eZe(n);case"Mesh":return new nZe(n);case"Dummy":return new iZe}throw new Error(`Unknown IR type: ${n[0]}`)}const bfe={COLORED:1,UNCOLORED:2},N9=class N9{constructor(t,i,s,l){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=i,this.canvasGraphicsFactory=s,this.baseTransform=l}createPatternCanvas(t){const{bbox:i,operatorList:s,paintType:l,tilingType:d,color:u,canvasGraphicsFactory:p}=this;let{xstep:g,ystep:_}=this;g=Math.abs(g),_=Math.abs(_),KU("TilingType: "+d);const y=i[0],E=i[1],b=i[2],A=i[3],N=b-y,O=A-E,D=new Float32Array(2);zn.singularValueDecompose2dScale(this.matrix,D);const[P,j]=D;zn.singularValueDecompose2dScale(this.baseTransform,D);const M=P*D[0],V=j*D[1];let H=N,$=O,Q=!1,Y=!1;const le=Math.ceil(g*M),ae=Math.ceil(_*V),te=Math.ceil(N*M),de=Math.ceil(O*V);le>=te?H=g:Q=!0,ae>=de?$=_:Y=!0;const G=this.getSizeAndScale(H,this.ctx.canvas.width,M),ie=this.getSizeAndScale($,this.ctx.canvas.height,V),_e=t.cachedCanvases.getCanvas("pattern",G.size,ie.size),he=_e.context,Ce=p.createCanvasGraphics(he);if(Ce.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(Ce,l,u),he.translate(-G.scale*y,-ie.scale*E),Ce.transform(G.scale,0,0,ie.scale,0,0),he.save(),this.clipBbox(Ce,y,E,b,A),Ce.baseTransform=Fs(Ce.ctx),Ce.executeOperatorList(s),Ce.endDrawing(),he.restore(),Q||Y){const fe=_e.canvas;Q&&(H=g),Y&&($=_);const me=this.getSizeAndScale(H,this.ctx.canvas.width,M),Ne=this.getSizeAndScale($,this.ctx.canvas.height,V),Fe=me.size,je=Ne.size,Ve=t.cachedCanvases.getCanvas("pattern-workaround",Fe,je),Re=Ve.context,Be=Q?Math.floor(N/g):0,Xe=Y?Math.floor(O/_):0;for(let we=0;we<=Be;we++)for(let Ge=0;Ge<=Xe;Ge++)Re.drawImage(fe,Fe*we,je*Ge,Fe,je,0,0,Fe,je);return{canvas:Ve.canvas,scaleX:me.scale,scaleY:Ne.scale,offsetX:y,offsetY:E}}return{canvas:_e.canvas,scaleX:G.scale,scaleY:ie.scale,offsetX:y,offsetY:E}}getSizeAndScale(t,i,s){const l=Math.max(N9.MAX_PATTERN_SIZE,i);let d=Math.ceil(t*s);return d>=l?d=l:s=d/t,{scale:s,size:d}}clipBbox(t,i,s,l,d){const u=l-i,p=d-s;t.ctx.rect(i,s,u,p),zn.axialAlignedBoundingBox([i,s,l,d],Fs(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,s){const l=t.ctx,d=t.current;switch(i){case bfe.COLORED:const{fillStyle:u,strokeStyle:p}=this.ctx;l.fillStyle=d.fillColor=u,l.strokeStyle=d.strokeColor=p;break;case bfe.UNCOLORED:l.fillStyle=l.strokeStyle=s,d.fillColor=d.strokeColor=s;break;default:throw new bQe(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,i,s,l){let d=s;l!==Ho.SHADING&&(d=zn.transform(d,i.baseTransform),this.matrix&&(d=zn.transform(d,this.matrix)));const u=this.createPatternCanvas(i);let p=new DOMMatrix(d);p=p.translate(u.offsetX,u.offsetY),p=p.scale(1/u.scaleX,1/u.scaleY);const g=t.createPattern(u.canvas,"repeat");return g.setTransform(p),g}};sn(N9,"MAX_PATTERN_SIZE",3e3);let HY=N9;function sZe({src:n,srcPos:t=0,dest:i,width:s,height:l,nonBlackColor:d=4294967295,inverseDecode:u=!1}){const p=qo.isLittleEndian?4278190080:255,[g,_]=u?[d,p]:[p,d],y=s>>3,E=s&7,b=n.length;i=new Uint32Array(i.buffer);let A=0;for(let N=0;N<l;N++){for(const D=t+y;t<D;t++){const P=t<b?n[t]:255;i[A++]=P&128?_:g,i[A++]=P&64?_:g,i[A++]=P&32?_:g,i[A++]=P&16?_:g,i[A++]=P&8?_:g,i[A++]=P&4?_:g,i[A++]=P&2?_:g,i[A++]=P&1?_:g}if(E===0)continue;const O=t<b?n[t++]:255;for(let D=0;D<E;D++)i[A++]=O&1<<7-D?_:g}return{srcPos:t,destPos:A}}const Cfe=16,Tfe=100,aZe=15,Rfe=10,Kc=16,oK=new DOMMatrix,zd=new Float32Array(2),hC=new Float32Array([1/0,1/0,-1/0,-1/0]);function oZe(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(i,s){t.translate(i,s),this.__originalTranslate(i,s)},n.scale=function(i,s){t.scale(i,s),this.__originalScale(i,s)},n.transform=function(i,s,l,d,u,p){t.transform(i,s,l,d,u,p),this.__originalTransform(i,s,l,d,u,p)},n.setTransform=function(i,s,l,d,u,p){t.setTransform(i,s,l,d,u,p),this.__originalSetTransform(i,s,l,d,u,p)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(i){t.rotate(i),this.__originalRotate(i)},n.clip=function(i){t.clip(i),this.__originalClip(i)},n.moveTo=function(i,s){t.moveTo(i,s),this.__originalMoveTo(i,s)},n.lineTo=function(i,s){t.lineTo(i,s),this.__originalLineTo(i,s)},n.bezierCurveTo=function(i,s,l,d,u,p){t.bezierCurveTo(i,s,l,d,u,p),this.__originalBezierCurveTo(i,s,l,d,u,p)},n.rect=function(i,s,l,d){t.rect(i,s,l,d),this.__originalRect(i,s,l,d)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class lZe{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,i,s){let l;return this.cache[t]!==void 0?(l=this.cache[t],this.canvasFactory.reset(l,i,s)):(l=this.canvasFactory.create(i,s),this.cache[t]=l),l}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const i=this.cache[t];this.canvasFactory.destroy(i),delete this.cache[t]}}}function Ik(n,t,i,s,l,d,u,p,g,_){const[y,E,b,A,N,O]=Fs(n);if(E===0&&b===0){const j=u*y+N,M=Math.round(j),V=p*A+O,H=Math.round(V),$=(u+g)*y+N,Q=Math.abs(Math.round($)-M)||1,Y=(p+_)*A+O,le=Math.abs(Math.round(Y)-H)||1;return n.setTransform(Math.sign(y),0,0,Math.sign(A),M,H),n.drawImage(t,i,s,l,d,0,0,Q,le),n.setTransform(y,E,b,A,N,O),[Q,le]}if(y===0&&A===0){const j=p*b+N,M=Math.round(j),V=u*E+O,H=Math.round(V),$=(p+_)*b+N,Q=Math.abs(Math.round($)-M)||1,Y=(u+g)*E+O,le=Math.abs(Math.round(Y)-H)||1;return n.setTransform(0,Math.sign(E),Math.sign(b),0,M,H),n.drawImage(t,i,s,l,d,0,0,le,Q),n.setTransform(y,E,b,A,N,O),[le,Q]}n.drawImage(t,i,s,l,d,u,p,g,_);const D=Math.hypot(y,E),P=Math.hypot(b,A);return[D*g,P*_]}class xfe{constructor(t,i){sn(this,"alphaIsShape",!1);sn(this,"fontSize",0);sn(this,"fontSizeScale",1);sn(this,"textMatrix",null);sn(this,"textMatrixScale",1);sn(this,"fontMatrix",yY);sn(this,"leading",0);sn(this,"x",0);sn(this,"y",0);sn(this,"lineX",0);sn(this,"lineY",0);sn(this,"charSpacing",0);sn(this,"wordSpacing",0);sn(this,"textHScale",1);sn(this,"textRenderingMode",hl.FILL);sn(this,"textRise",0);sn(this,"fillColor","#000000");sn(this,"strokeColor","#000000");sn(this,"patternFill",!1);sn(this,"patternStroke",!1);sn(this,"fillAlpha",1);sn(this,"strokeAlpha",1);sn(this,"lineWidth",1);sn(this,"activeSMask",null);sn(this,"transferMaps","none");this.clipBox=new Float32Array([0,0,t,i]),this.minMax=hC.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Ho.FILL,i=null){const s=this.minMax.slice();if(t===Ho.STROKE){i||Zr("Stroke bounding box must include transform."),zn.singularValueDecompose2dScale(i,zd);const l=zd[0]*this.lineWidth/2,d=zd[1]*this.lineWidth/2;s[0]-=l,s[1]-=d,s[2]+=l,s[3]+=d}return s}updateClipFromPath(){const t=zn.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(hC,0)}getClippedPathBoundingBox(t=Ho.FILL,i=null){return zn.intersect(this.clipBox,this.getPathBoundingBox(t,i))}}function Afe(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}const i=t.height,s=t.width,l=i%Kc,d=(i-l)/Kc,u=l===0?d:d+1,p=n.createImageData(s,Kc);let g=0,_;const y=t.data,E=p.data;let b,A,N,O;if(t.kind===rM.GRAYSCALE_1BPP){const D=y.byteLength,P=new Uint32Array(E.buffer,0,E.byteLength>>2),j=P.length,M=s+7>>3,V=4294967295,H=qo.isLittleEndian?4278190080:255;for(b=0;b<u;b++){for(N=b<d?Kc:l,_=0,A=0;A<N;A++){const $=D-g;let Q=0;const Y=$>M?s:$*8-7,le=Y&-8;let ae=0,te=0;for(;Q<le;Q+=8)te=y[g++],P[_++]=te&128?V:H,P[_++]=te&64?V:H,P[_++]=te&32?V:H,P[_++]=te&16?V:H,P[_++]=te&8?V:H,P[_++]=te&4?V:H,P[_++]=te&2?V:H,P[_++]=te&1?V:H;for(;Q<Y;Q++)ae===0&&(te=y[g++],ae=128),P[_++]=te&ae?V:H,ae>>=1}for(;_<j;)P[_++]=0;n.putImageData(p,0,b*Kc)}}else if(t.kind===rM.RGBA_32BPP){for(A=0,O=s*Kc*4,b=0;b<d;b++)E.set(y.subarray(g,g+O)),g+=O,n.putImageData(p,0,A),A+=Kc;b<u&&(O=s*l*4,E.set(y.subarray(g,g+O)),n.putImageData(p,0,A))}else if(t.kind===rM.RGB_24BPP)for(N=Kc,O=s*N,b=0;b<u;b++){for(b>=d&&(N=l,O=s*N),_=0,A=O;A--;)E[_++]=y[g++],E[_++]=y[g++],E[_++]=y[g++],E[_++]=255;n.putImageData(p,0,b*Kc)}else throw new Error(`bad image kind: ${t.kind}`)}function Ife(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}const i=t.height,s=t.width,l=i%Kc,d=(i-l)/Kc,u=l===0?d:d+1,p=n.createImageData(s,Kc);let g=0;const _=t.data,y=p.data;for(let E=0;E<u;E++){const b=E<d?Kc:l;({srcPos:g}=sZe({src:_,srcPos:g,dest:y,width:s,height:b,nonBlackColor:0})),n.putImageData(p,0,E*Kc)}}function yI(n,t){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const s of i)n[s]!==void 0&&(t[s]=n[s]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function Nk(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);const{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function Nfe(n,t){if(t)return!0;zn.singularValueDecompose2dScale(n,zd);const i=Math.fround(Up.pixelRatio*kv.PDF_TO_CSS_UNITS);return zd[0]<=i&&zd[1]<=i}const cZe=["butt","round","square"],dZe=["miter","round","bevel"],uZe={},Ofe={};var s5,GY,a5,WY,o5,$Y;const XZ=class XZ{constructor(t,i,s,l,d,{optionalContentConfig:u,markedContentStack:p=null},g,_){ee(this,s5);ee(this,a5);ee(this,o5);this.ctx=t,this.current=new xfe(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=s,this.canvasFactory=l,this.filterFactory=d,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=p||[],this.optionalContentConfig=u,this.cachedCanvases=new lZe(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=g,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=_,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t,i=null){return typeof t=="string"?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):i}beginDrawing({transform:t,viewport:i,transparency:s=!1,background:l=null}){const d=this.ctx.canvas.width,u=this.ctx.canvas.height,p=this.ctx.fillStyle;if(this.ctx.fillStyle=l||"#ffffff",this.ctx.fillRect(0,0,d,u),this.ctx.fillStyle=p,s){const g=this.cachedCanvases.getCanvas("transparent",d,u);this.compositeCtx=this.ctx,this.transparentCanvas=g.canvas,this.ctx=g.context,this.ctx.save(),this.ctx.transform(...Fs(this.compositeCtx))}this.ctx.save(),Nk(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Fs(this.ctx)}executeOperatorList(t,i,s,l){const d=t.argsArray,u=t.fnArray;let p=i||0;const g=d.length;if(g===p)return p;const _=g-p>Rfe&&typeof s=="function",y=_?Date.now()+aZe:0;let E=0;const b=this.commonObjs,A=this.objs;let N;for(;;){if(l!==void 0&&p===l.nextBreakPoint)return l.breakIt(p,s),p;if(N=u[p],N!==I7.dependency)this[N].apply(this,d[p]);else for(const O of d[p]){const D=O.startsWith("g_")?b:A;if(!D.has(O))return D.get(O,s),p}if(p++,p===g)return p;if(_&&++E>Rfe){if(Date.now()>y)return s(),p;E=0}}}endDrawing(){pe(this,s5,GY).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const i of t.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);t.clear()}this._cachedBitmapsMap.clear(),pe(this,a5,WY).call(this)}_scaleImage(t,i){const s=t.width??t.displayWidth,l=t.height??t.displayHeight;let d=Math.max(Math.hypot(i[0],i[1]),1),u=Math.max(Math.hypot(i[2],i[3]),1),p=s,g=l,_="prescale1",y,E;for(;d>2&&p>1||u>2&&g>1;){let b=p,A=g;d>2&&p>1&&(b=p>=16384?Math.floor(p/2)-1||1:Math.ceil(p/2),d/=p/b),u>2&&g>1&&(A=g>=16384?Math.floor(g/2)-1||1:Math.ceil(g)/2,u/=g/A),y=this.cachedCanvases.getCanvas(_,b,A),E=y.context,E.clearRect(0,0,b,A),E.drawImage(t,0,0,p,g,0,0,b,A),t=y.canvas,p=b,g=A,_=_==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:p,paintHeight:g}}_createMaskCanvas(t){const i=this.ctx,{width:s,height:l}=t,d=this.current.fillColor,u=this.current.patternFill,p=Fs(i);let g,_,y,E;if((t.bitmap||t.data)&&t.count>1){const le=t.bitmap||t.data.buffer;_=JSON.stringify(u?p:[p.slice(0,4),d]),g=this._cachedBitmapsMap.get(le),g||(g=new Map,this._cachedBitmapsMap.set(le,g));const ae=g.get(_);if(ae&&!u){const te=Math.round(Math.min(p[0],p[2])+p[4]),de=Math.round(Math.min(p[1],p[3])+p[5]);return{canvas:ae,offsetX:te,offsetY:de}}y=ae}y||(E=this.cachedCanvases.getCanvas("maskCanvas",s,l),Ife(E.context,t));let b=zn.transform(p,[1/s,0,0,-1/l,0,0]);b=zn.transform(b,[1,0,0,1,0,-l]);const A=hC.slice();zn.axialAlignedBoundingBox([0,0,s,l],b,A);const[N,O,D,P]=A,j=Math.round(D-N)||1,M=Math.round(P-O)||1,V=this.cachedCanvases.getCanvas("fillCanvas",j,M),H=V.context,$=N,Q=O;H.translate(-$,-Q),H.transform(...b),y||(y=this._scaleImage(E.canvas,Jf(H)),y=y.img,g&&u&&g.set(_,y)),H.imageSmoothingEnabled=Nfe(Fs(H),t.interpolate),Ik(H,y,0,0,y.width,y.height,0,0,s,l),H.globalCompositeOperation="source-in";const Y=zn.transform(Jf(H),[1,0,0,1,-$,-Q]);return H.fillStyle=u?d.getPattern(i,this,Y,Ho.FILL):d,H.fillRect(0,0,s,l),g&&!u&&(this.cachedCanvases.delete("fillCanvas"),g.set(_,V.canvas)),{canvas:V.canvas,offsetX:Math.round($),offsetY:Math.round(Q)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=cZe[t]}setLineJoin(t){this.ctx.lineJoin=dZe[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,i){const s=this.ctx;s.setLineDash!==void 0&&(s.setLineDash(t),s.lineDashOffset=i)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[i,s]of t)switch(i){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=s;break;case"ca":this.ctx.globalAlpha=this.current.fillAlpha=s;break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(s);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,i=this.ctx.canvas.height,s="smaskGroupAt"+this.groupLevel,l=this.cachedCanvases.getCanvas(s,t,i);this.suspendedCtx=this.ctx;const d=this.ctx=l.context;d.setTransform(this.suspendedCtx.getTransform()),yI(this.suspendedCtx,d),oZe(d,this.suspendedCtx),this.setGState([["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),yI(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,s=this.suspendedCtx;this.composeSMask(s,i,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,i,s,l){const d=l[0],u=l[1],p=l[2]-d,g=l[3]-u;p===0||g===0||(this.genericComposeSMask(i.context,s,p,g,i.subtype,i.backdrop,i.transferMap,d,u,i.offsetX,i.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(s.canvas,0,0),t.restore())}genericComposeSMask(t,i,s,l,d,u,p,g,_,y,E){let b=t.canvas,A=g-y,N=_-E;if(u)if(A<0||N<0||A+s>b.width||N+l>b.height){const D=this.cachedCanvases.getCanvas("maskExtension",s,l),P=D.context;P.drawImage(b,-A,-N),P.globalCompositeOperation="destination-atop",P.fillStyle=u,P.fillRect(0,0,s,l),P.globalCompositeOperation="source-over",b=D.canvas,A=N=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const D=new Path2D;D.rect(A,N,s,l),t.clip(D),t.globalCompositeOperation="destination-atop",t.fillStyle=u,t.fillRect(A,N,s,l),t.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),d==="Alpha"&&p?i.filter=this.filterFactory.addAlphaFilter(p):d==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(p));const O=new Path2D;O.rect(g,_,s,l),i.clip(O),i.globalCompositeOperation="destination-in",i.drawImage(b,A,N,s,l,g,_,s,l),i.restore()}save(){this.inSMaskMode&&yI(this.ctx,this.suspendedCtx),this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){if(this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&yI(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,i,s,l,d,u){this.ctx.transform(t,i,s,l,d,u),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,i,s){let[l]=i;if(!s){l||(l=i[0]=new Path2D),this[t](l);return}if(!(l instanceof Path2D)){const d=i[0]=new Path2D;for(let u=0,p=l.length;u<p;)switch(l[u++]){case Tk.moveTo:d.moveTo(l[u++],l[u++]);break;case Tk.lineTo:d.lineTo(l[u++],l[u++]);break;case Tk.curveTo:d.bezierCurveTo(l[u++],l[u++],l[u++],l[u++],l[u++],l[u++]);break;case Tk.closePath:d.closePath();break;default:Ei(`Unrecognized drawing path operator: ${l[u-1]}`);break}l=d}zn.axialAlignedBoundingBox(s,Fs(this.ctx),this.current.minMax),this[t](l)}closePath(){this.ctx.closePath()}stroke(t,i=!0){const s=this.ctx,l=this.current.strokeColor;if(s.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof l=="object"&&(l!=null&&l.getPattern)){const d=l.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.strokeStyle=l.getPattern(s,this,Jf(s),Ho.STROKE),d){const u=new Path2D;u.addPath(t,s.getTransform().invertSelf().multiplySelf(d)),t=u}this.rescaleAndStroke(t,!1),s.restore()}else this.rescaleAndStroke(t,!0);i&&this.consumePath(t,this.current.getClippedPathBoundingBox(Ho.STROKE,Fs(this.ctx))),s.globalAlpha=this.current.fillAlpha}closeStroke(t){this.stroke(t)}fill(t,i=!0){const s=this.ctx,l=this.current.fillColor,d=this.current.patternFill;let u=!1;if(d){const g=l.isModifyingCurrentTransform()?s.getTransform():null;if(s.save(),s.fillStyle=l.getPattern(s,this,Jf(s),Ho.FILL),g){const _=new Path2D;_.addPath(t,s.getTransform().invertSelf().multiplySelf(g)),t=_}u=!0}const p=this.current.getClippedPathBoundingBox();this.contentVisible&&p!==null&&(this.pendingEOFill?(s.fill(t,"evenodd"),this.pendingEOFill=!1):s.fill(t)),u&&s.restore(),i&&this.consumePath(t,p)}eoFill(t){this.pendingEOFill=!0,this.fill(t)}fillStroke(t){this.fill(t,!1),this.stroke(t,!1),this.consumePath(t)}eoFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}closeFillStroke(t){this.fillStroke(t)}closeEOFillStroke(t){this.pendingEOFill=!0,this.fillStroke(t)}endPath(t){this.consumePath(t)}rawFillPath(t){this.ctx.fill(t)}clip(){this.pendingClip=uZe}eoClip(){this.pendingClip=Ofe}beginText(){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,i=this.ctx;if(t===void 0)return;const s=new Path2D,l=i.getTransform().invertSelf();for(const{transform:d,x:u,y:p,fontSize:g,path:_}of t)_&&s.addPath(_,new DOMMatrix(d).preMultiplySelf(l).translate(u,p).scale(g,-g));i.clip(s),delete this.pendingTextPaths}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,i){var y;const s=this.commonObjs.get(t),l=this.current;if(!s)throw new Error(`Can't find font for ${t}`);if(l.fontMatrix=s.fontMatrix||yY,(l.fontMatrix[0]===0||l.fontMatrix[3]===0)&&Ei("Invalid font matrix for font "+t),i<0?(i=-i,l.fontDirection=-1):l.fontDirection=1,this.current.font=s,this.current.fontSize=i,s.isType3Font)return;const d=s.loadedName||"sans-serif",u=((y=s.systemFontInfo)==null?void 0:y.css)||`"${d}", ${s.fallbackName}`;let p="normal";s.black?p="900":s.bold&&(p="bold");const g=s.italic?"italic":"normal";let _=i;i<Cfe?_=Cfe:i>Tfe&&(_=Tfe),this.current.fontSizeScale=i/_,this.ctx.font=`${g} ${p} ${_}px ${u}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,i){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=i}setLeadingMoveText(t,i){this.setLeading(-i),this.moveText(t,i)}setTextMatrix(t){const{current:i}=this;i.textMatrix=t,i.textMatrixScale=Math.hypot(t[0],t[1]),i.x=i.lineX=0,i.y=i.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,i,s,l,d){const u=this.ctx,p=this.current,g=p.font,_=p.textRenderingMode,y=p.fontSize/p.fontSizeScale,E=_&hl.FILL_STROKE_MASK,b=!!(_&hl.ADD_TO_PATH_FLAG),A=p.patternFill&&!g.missingFile,N=p.patternStroke&&!g.missingFile;let O;if((g.disableFontFace||b||A||N)&&!g.missingFile&&(O=g.getPathGenerator(this.commonObjs,t)),O&&(g.disableFontFace||A||N)){u.save(),u.translate(i,s),u.scale(y,-y);let D;if((E===hl.FILL||E===hl.FILL_STROKE)&&(l?(D=u.getTransform(),u.setTransform(...l),u.fill(pe(this,o5,$Y).call(this,O,D,l))):u.fill(O)),E===hl.STROKE||E===hl.FILL_STROKE)if(d){D||(D=u.getTransform()),u.setTransform(...d);const{a:P,b:j,c:M,d:V}=D,H=zn.inverseTransform(d),$=zn.transform([P,j,M,V,0,0],H);zn.singularValueDecompose2dScale($,zd),u.lineWidth*=Math.max(zd[0],zd[1])/y,u.stroke(pe(this,o5,$Y).call(this,O,D,d))}else u.lineWidth/=y,u.stroke(O);u.restore()}else(E===hl.FILL||E===hl.FILL_STROKE)&&u.fillText(t,i,s),(E===hl.STROKE||E===hl.FILL_STROKE)&&u.strokeText(t,i,s);b&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Fs(u),x:i,y:s,fontSize:y,path:O})}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const i=t.getImageData(0,0,10,10).data;let s=!1;for(let l=3;l<i.length;l+=4)if(i[l]>0&&i[l]<255){s=!0;break}return Ki(this,"isFontSubpixelAAEnabled",s)}showText(t){const i=this.current,s=i.font;if(s.isType3Font)return this.showType3Text(t);const l=i.fontSize;if(l===0)return;const d=this.ctx,u=i.fontSizeScale,p=i.charSpacing,g=i.wordSpacing,_=i.fontDirection,y=i.textHScale*_,E=t.length,b=s.vertical,A=b?1:-1,N=s.defaultVMetrics,O=l*i.fontMatrix[0],D=i.textRenderingMode===hl.FILL&&!s.disableFontFace&&!i.patternFill;d.save(),i.textMatrix&&d.transform(...i.textMatrix),d.translate(i.x,i.y+i.textRise),_>0?d.scale(y,-1):d.scale(y,1);let P,j;if(i.patternFill){d.save();const Q=i.fillColor.getPattern(d,this,Jf(d),Ho.FILL);P=Fs(d),d.restore(),d.fillStyle=Q}if(i.patternStroke){d.save();const Q=i.strokeColor.getPattern(d,this,Jf(d),Ho.STROKE);j=Fs(d),d.restore(),d.strokeStyle=Q}let M=i.lineWidth;const V=i.textMatrixScale;if(V===0||M===0){const Q=i.textRenderingMode&hl.FILL_STROKE_MASK;(Q===hl.STROKE||Q===hl.FILL_STROKE)&&(M=this.getSinglePixelWidth())}else M/=V;if(u!==1&&(d.scale(u,u),M/=u),d.lineWidth=M,s.isInvalidPDFjsFont){const Q=[];let Y=0;for(const le of t)Q.push(le.unicode),Y+=le.width;d.fillText(Q.join(""),0,0),i.x+=Y*O*y,d.restore(),this.compose();return}let H=0,$;for($=0;$<E;++$){const Q=t[$];if(typeof Q=="number"){H+=A*Q*l/1e3;continue}let Y=!1;const le=(Q.isSpace?g:0)+p,ae=Q.fontChar,te=Q.accent;let de,G,ie=Q.width;if(b){const he=Q.vmetric||N,Ce=-(Q.vmetric?he[1]:ie*.5)*O,fe=he[2]*O;ie=he?-he[0]:ie,de=Ce/u,G=(H+fe)/u}else de=H/u,G=0;if(s.remeasure&&ie>0){const he=d.measureText(ae).width*1e3/l*u;if(ie<he&&this.isFontSubpixelAAEnabled){const Ce=ie/he;Y=!0,d.save(),d.scale(Ce,1),de/=Ce}else ie!==he&&(de+=(ie-he)/2e3*l/u)}if(this.contentVisible&&(Q.isInFont||s.missingFile)){if(D&&!te)d.fillText(ae,de,G);else if(this.paintChar(ae,de,G,P,j),te){const he=de+l*te.offset.x/u,Ce=G-l*te.offset.y/u;this.paintChar(te.fontChar,he,Ce,P,j)}}const _e=b?ie*O-le*_:ie*O+le*_;H+=_e,Y&&d.restore()}b?i.y-=H:i.x+=H*y,d.restore(),this.compose()}showType3Text(t){const i=this.ctx,s=this.current,l=s.font,d=s.fontSize,u=s.fontDirection,p=l.vertical?1:-1,g=s.charSpacing,_=s.wordSpacing,y=s.textHScale*u,E=s.fontMatrix||yY,b=t.length,A=s.textRenderingMode===hl.INVISIBLE;let N,O,D,P;if(!(A||d===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),s.textMatrix&&i.transform(...s.textMatrix),i.translate(s.x,s.y+s.textRise),i.scale(y,u),N=0;N<b;++N){if(O=t[N],typeof O=="number"){P=p*O*d/1e3,this.ctx.translate(P,0),s.x+=P*y;continue}const j=(O.isSpace?_:0)+g,M=l.charProcOperatorList[O.operatorListId];M?this.contentVisible&&(this.save(),i.scale(d,d),i.transform(...E),this.executeOperatorList(M),this.restore()):Ei(`Type3 character "${O.operatorListId}" is not available.`);const V=[O.width,0];zn.applyTransform(V,E),D=V[0]*d+j,i.translate(D,0),s.x+=D*y}i.restore()}}setCharWidth(t,i){}setCharWidthAndBounds(t,i,s,l,d,u){const p=new Path2D;p.rect(s,l,d-s,u-l),this.ctx.clip(p),this.endPath()}getColorN_Pattern(t){let i;if(t[0]==="TilingPattern"){const s=this.baseTransform||Fs(this.ctx),l={createCanvasGraphics:d=>new XZ(d,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new HY(t,this.ctx,l,s)}else i=this._getPattern(t[1],t[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t){this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t){this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,i=null){let s;return this.cachedPatterns.has(t)?s=this.cachedPatterns.get(t):(s=rZe(this.getObject(t)),this.cachedPatterns.set(t,s)),i&&(s.matrix=i),s}shadingFill(t){if(!this.contentVisible)return;const i=this.ctx;this.save();const s=this._getPattern(t);i.fillStyle=s.getPattern(i,this,Jf(i),Ho.SHADING);const l=Jf(i);if(l){const{width:d,height:u}=i.canvas,p=hC.slice();zn.axialAlignedBoundingBox([0,0,d,u],l,p);const[g,_,y,E]=p;this.ctx.fillRect(g,_,y-g,E-_)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Zr("Should not call beginInlineImage")}beginImageData(){Zr("Should not call beginImageData")}paintFormXObjectBegin(t,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Fs(this.ctx),i)){zn.axialAlignedBoundingBox(i,this.baseTransform,this.current.minMax);const[s,l,d,u]=i,p=new Path2D;p.rect(s,l,d-s,u-l),this.ctx.clip(p),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const i=this.ctx;t.isolated||KU("TODO: Support non-isolated groups."),t.knockout&&Ei("Knockout groups not supported.");const s=Fs(i);if(t.matrix&&i.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let l=hC.slice();zn.axialAlignedBoundingBox(t.bbox,Fs(i),l);const d=[0,0,i.canvas.width,i.canvas.height];l=zn.intersect(l,d)||[0,0,0,0];const u=Math.floor(l[0]),p=Math.floor(l[1]),g=Math.max(Math.ceil(l[2])-u,1),_=Math.max(Math.ceil(l[3])-p,1);this.current.startNewPathAndClipBox([0,0,g,_]);let y="groupAt"+this.groupLevel;t.smask&&(y+="_smask_"+this.smaskCounter++%2);const E=this.cachedCanvases.getCanvas(y,g,_),b=E.context;b.translate(-u,-p),b.transform(...s);let A=new Path2D;const[N,O,D,P]=t.bbox;if(A.rect(N,O,D-N,P-O),t.matrix){const j=new Path2D;j.addPath(A,new DOMMatrix(t.matrix)),A=j}b.clip(A),t.smask?this.smaskStack.push({canvas:E.canvas,context:b,offsetX:u,offsetY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(u,p),i.save()),yI(i,b),this.ctx=b,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const i=this.ctx,s=this.groupStack.pop();if(this.ctx=s,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const l=Fs(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...l);const d=hC.slice();zn.axialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],l,d),this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(d)}}beginAnnotation(t,i,s,l,d){if(pe(this,s5,GY).call(this),Nk(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const u=i[2]-i[0],p=i[3]-i[1];if(d&&this.annotationCanvasMap){s=s.slice(),s[4]-=i[0],s[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=u,i[3]=p,zn.singularValueDecompose2dScale(Fs(this.ctx),zd);const{viewportScale:g}=this,_=Math.ceil(u*this.outputScaleX*g),y=Math.ceil(p*this.outputScaleY*g);this.annotationCanvas=this.canvasFactory.create(_,y);const{canvas:E,context:b}=this.annotationCanvas;this.annotationCanvasMap.set(t,E),this.annotationCanvas.savedCtx=this.ctx,this.ctx=b,this.ctx.save(),this.ctx.setTransform(zd[0],0,0,-zd[1],0,p*zd[1]),Nk(this.ctx)}else{Nk(this.ctx),this.endPath();const g=new Path2D;g.rect(i[0],i[1],u,p),this.ctx.clip(g)}}this.current=new xfe(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...s),this.transform(...l)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),pe(this,a5,WY).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const i=t.count;t=this.getObject(t.data,t),t.count=i;const s=this.ctx,l=this._createMaskCanvas(t),d=l.canvas;s.save(),s.setTransform(1,0,0,1,0,0),s.drawImage(d,l.offsetX,l.offsetY),s.restore(),this.compose()}paintImageMaskXObjectRepeat(t,i,s=0,l=0,d,u){if(!this.contentVisible)return;t=this.getObject(t.data,t);const p=this.ctx;p.save();const g=Fs(p);p.transform(i,s,l,d,0,0);const _=this._createMaskCanvas(t);p.setTransform(1,0,0,1,_.offsetX-g[4],_.offsetY-g[5]);for(let y=0,E=u.length;y<E;y+=2){const b=zn.transform(g,[i,s,l,d,u[y],u[y+1]]);p.drawImage(_.canvas,b[4],b[5])}p.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const i=this.ctx,s=this.current.fillColor,l=this.current.patternFill;for(const d of t){const{data:u,width:p,height:g,transform:_}=d,y=this.cachedCanvases.getCanvas("maskCanvas",p,g),E=y.context;E.save();const b=this.getObject(u,d);Ife(E,b),E.globalCompositeOperation="source-in",E.fillStyle=l?s.getPattern(E,this,Jf(i),Ho.FILL):s,E.fillRect(0,0,p,g),E.restore(),i.save(),i.transform(..._),i.scale(1,-1),Ik(i,y.canvas,0,0,p,g,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const i=this.getObject(t);if(!i){Ei("Dependent image isn't ready yet");return}this.paintInlineImageXObject(i)}paintImageXObjectRepeat(t,i,s,l){if(!this.contentVisible)return;const d=this.getObject(t);if(!d){Ei("Dependent image isn't ready yet");return}const u=d.width,p=d.height,g=[];for(let _=0,y=l.length;_<y;_+=2)g.push({transform:[i,0,0,s,l[_],l[_+1]],x:0,y:0,w:u,h:p});this.paintInlineImageXObjectGroup(d,g)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:i,width:s,height:l}=t,d=this.cachedCanvases.getCanvas("inlineImage",s,l),u=d.context;return u.filter=this.current.transferMaps,u.drawImage(i,0,0),u.filter="none",d.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const i=t.width,s=t.height,l=this.ctx;this.save();const{filter:d}=l;d!=="none"&&d!==""&&(l.filter="none"),l.scale(1/i,-1/s);let u;if(t.bitmap)u=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)u=t;else{const _=this.cachedCanvases.getCanvas("inlineImage",i,s).context;Afe(_,t),u=this.applyTransferMapsToCanvas(_)}const p=this._scaleImage(u,Jf(l));l.imageSmoothingEnabled=Nfe(Fs(l),t.interpolate),Ik(l,p.img,0,0,p.paintWidth,p.paintHeight,0,-s,i,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,i){if(!this.contentVisible)return;const s=this.ctx;let l;if(t.bitmap)l=t.bitmap;else{const d=t.width,u=t.height,g=this.cachedCanvases.getCanvas("inlineImage",d,u).context;Afe(g,t),l=this.applyTransferMapsToCanvas(g)}for(const d of i)s.save(),s.transform(...d.transform),s.scale(1,-1),Ik(s,l,d.x,d.y,d.w,d.h,0,-1,1,1),s.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,i){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,i){t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t,i){const s=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(i);const l=this.ctx;this.pendingClip&&(s||(this.pendingClip===Ofe?l.clip(t,"evenodd"):l.clip(t)),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Fs(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const i=Math.abs(t[0]*t[3]-t[2]*t[1]),s=Math.hypot(t[0],t[2]),l=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(s,l)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:i,b:s,c:l,d}=this.ctx.getTransform();let u,p;if(s===0&&l===0){const g=Math.abs(i),_=Math.abs(d);if(g===_)if(t===0)u=p=1/g;else{const y=g*t;u=p=y<1?1/y:1}else if(t===0)u=1/g,p=1/_;else{const y=g*t,E=_*t;u=y<1?1/y:1,p=E<1?1/E:1}}else{const g=Math.abs(i*d-s*l),_=Math.hypot(i,s),y=Math.hypot(l,d);if(t===0)u=y/g,p=_/g;else{const E=t*g;u=y>E?y/E:1,p=_>E?_/E:1}}this._cachedScaleForStroking[0]=u,this._cachedScaleForStroking[1]=p}return this._cachedScaleForStroking}rescaleAndStroke(t,i){const{ctx:s,current:{lineWidth:l}}=this,[d,u]=this.getScaleForStroking();if(d===u){s.lineWidth=(l||1)*d,s.stroke(t);return}const p=s.getLineDash();i&&s.save(),s.scale(d,u),oK.a=1/d,oK.d=1/u;const g=new Path2D;if(g.addPath(t,oK),p.length>0){const _=Math.max(d,u);s.setLineDash(p.map(y=>y/_)),s.lineDashOffset/=_}s.lineWidth=l||1,s.stroke(g),i&&s.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}};s5=new WeakSet,GY=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)},a5=new WeakSet,WY=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const i=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}},o5=new WeakSet,$Y=function(t,i,s){const l=new Path2D;return l.addPath(t,new DOMMatrix(s).invertSelf().multiplySelf(i)),l};let TC=XZ;for(const n in I7)TC.prototype[n]!==void 0&&(TC.prototype[I7[n]]=TC.prototype[n]);var l5,c5;class Pp{static get workerPort(){return T(this,l5)}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");re(this,l5,t)}static get workerSrc(){return T(this,c5)}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");re(this,c5,t)}}l5=new WeakMap,c5=new WeakMap,ee(Pp,l5,null),ee(Pp,c5,"");var mT,d5;class hZe{constructor({parsedData:t,rawData:i}){ee(this,mT,void 0);ee(this,d5,void 0);re(this,mT,t),re(this,d5,i)}getRaw(){return T(this,d5)}get(t){return T(this,mT).get(t)??null}[Symbol.iterator](){return T(this,mT).entries()}}mT=new WeakMap,d5=new WeakMap;const qb=Symbol("INTERNAL");var u5,h5,f5,gT;class fZe{constructor(t,{name:i,intent:s,usage:l,rbGroups:d}){ee(this,u5,!1);ee(this,h5,!1);ee(this,f5,!1);ee(this,gT,!0);re(this,u5,!!(t&Fd.DISPLAY)),re(this,h5,!!(t&Fd.PRINT)),this.name=i,this.intent=s,this.usage=l,this.rbGroups=d}get visible(){if(T(this,f5))return T(this,gT);if(!T(this,gT))return!1;const{print:t,view:i}=this.usage;return T(this,u5)?(i==null?void 0:i.viewState)!=="OFF":T(this,h5)?(t==null?void 0:t.printState)!=="OFF":!0}_setVisible(t,i,s=!1){t!==qb&&Zr("Internal method `_setVisible` called."),re(this,f5,s),re(this,gT,i)}}u5=new WeakMap,h5=new WeakMap,f5=new WeakMap,gT=new WeakMap;var U1,Jr,vT,yT,p5,KY;class pZe{constructor(t,i=Fd.DISPLAY){ee(this,p5);ee(this,U1,null);ee(this,Jr,new Map);ee(this,vT,null);ee(this,yT,null);if(this.renderingIntent=i,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,re(this,yT,t.order);for(const s of t.groups)T(this,Jr).set(s.id,new fZe(i,s));if(t.baseState==="OFF")for(const s of T(this,Jr).values())s._setVisible(qb,!1);for(const s of t.on)T(this,Jr).get(s)._setVisible(qb,!0);for(const s of t.off)T(this,Jr).get(s)._setVisible(qb,!1);re(this,vT,this.getHash())}}isVisible(t){if(T(this,Jr).size===0)return!0;if(!t)return KU("Optional content group not defined."),!0;if(t.type==="OCG")return T(this,Jr).has(t.id)?T(this,Jr).get(t.id).visible:(Ei(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return pe(this,p5,KY).call(this,t.expression);if(!t.policy||t.policy==="AnyOn"){for(const i of t.ids){if(!T(this,Jr).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(T(this,Jr).get(i).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const i of t.ids){if(!T(this,Jr).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(!T(this,Jr).get(i).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const i of t.ids){if(!T(this,Jr).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(!T(this,Jr).get(i).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const i of t.ids){if(!T(this,Jr).has(i))return Ei(`Optional content group not found: ${i}`),!0;if(T(this,Jr).get(i).visible)return!1}return!0}return Ei(`Unknown optional content policy ${t.policy}.`),!0}return Ei(`Unknown group type ${t.type}.`),!0}setVisibility(t,i=!0,s=!0){var d;const l=T(this,Jr).get(t);if(!l){Ei(`Optional content group not found: ${t}`);return}if(s&&i&&l.rbGroups.length)for(const u of l.rbGroups)for(const p of u)p!==t&&((d=T(this,Jr).get(p))==null||d._setVisible(qb,!1,!0));l._setVisible(qb,!!i,!0),re(this,U1,null)}setOCGState({state:t,preserveRB:i}){let s;for(const l of t){switch(l){case"ON":case"OFF":case"Toggle":s=l;continue}const d=T(this,Jr).get(l);if(d)switch(s){case"ON":this.setVisibility(l,!0,i);break;case"OFF":this.setVisibility(l,!1,i);break;case"Toggle":this.setVisibility(l,!d.visible,i);break}}re(this,U1,null)}get hasInitialVisibility(){return T(this,vT)===null||this.getHash()===T(this,vT)}getOrder(){return T(this,Jr).size?T(this,yT)?T(this,yT).slice():[...T(this,Jr).keys()]:null}getGroup(t){return T(this,Jr).get(t)||null}getHash(){if(T(this,U1)!==null)return T(this,U1);const t=new Z2e;for(const[i,s]of T(this,Jr))t.update(`${i}:${s.visible}`);return re(this,U1,t.hexdigest())}[Symbol.iterator](){return T(this,Jr).entries()}}U1=new WeakMap,Jr=new WeakMap,vT=new WeakMap,yT=new WeakMap,p5=new WeakSet,KY=function(t){const i=t.length;if(i<2)return!0;const s=t[0];for(let l=1;l<i;l++){const d=t[l];let u;if(Array.isArray(d))u=pe(this,p5,KY).call(this,d);else if(T(this,Jr).has(d))u=T(this,Jr).get(d).visible;else return Ei(`Optional content group not found: ${d}`),!0;switch(s){case"And":if(!u)return!1;break;case"Or":if(u)return!0;break;case"Not":return!u;default:return!0}}return s==="And"};class mZe{constructor(t,{disableRange:i=!1,disableStream:s=!1}){Aa(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:l,initialData:d,progressiveDone:u,contentDispositionFilename:p}=t;if(this._queuedChunks=[],this._progressiveDone=u,this._contentDispositionFilename=p,(d==null?void 0:d.length)>0){const g=d instanceof Uint8Array&&d.byteLength===d.buffer.byteLength?d.buffer:new Uint8Array(d).buffer;this._queuedChunks.push(g)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!s,this._isRangeSupported=!i,this._contentLength=l,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((g,_)=>{this._onReceiveData({begin:g,chunk:_})}),t.addProgressListener((g,_)=>{this._onProgress({loaded:g,total:_})}),t.addProgressiveReadListener(g=>{this._onReceiveData({chunk:g})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:i}){const s=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(s):this._queuedChunks.push(s);else{const l=this._rangeReaders.some(function(d){return d._begin!==t?!1:(d._enqueue(s),!0)});Aa(l,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}_onProgress(t){var i,s,l,d;t.total===void 0?(s=(i=this._rangeReaders[0])==null?void 0:i.onProgress)==null||s.call(i,{loaded:t.loaded}):(d=(l=this._fullRequestReader)==null?void 0:l.onProgress)==null||d.call(l,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;(t=this._fullRequestReader)==null||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const i=this._rangeReaders.indexOf(t);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){Aa(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new gZe(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new vZe(this,t,i);return this._pdfDataRangeTransport.requestDataRange(t,i),this._rangeReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeReaders.slice(0))s.cancel(t);this._pdfDataRangeTransport.abort()}}class gZe{constructor(t,i,s=!1,l=null){this._stream=t,this._done=s||!1,this._filename=lZ(l)?l:null,this._queuedChunks=i||[],this._loaded=0;for(const d of this._queuedChunks)this._loaded+=d.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class vZe{constructor(t,i,s){this._stream=t,this._begin=i,this._end=s,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function yZe(n){let t=!0,i=s("filename\\*","i").exec(n);if(i){i=i[1];let y=p(i);return y=unescape(y),y=g(y),y=_(y),d(y)}if(i=u(n),i){const y=_(i);return d(y)}if(i=s("filename","i").exec(n),i){i=i[1];let y=p(i);return y=_(y),d(y)}function s(y,E){return new RegExp("(?:^|;)\\s*"+y+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',E)}function l(y,E){if(y){if(!/^[\x00-\xFF]+$/.test(E))return E;try{const b=new TextDecoder(y,{fatal:!0}),A=eP(E);E=b.decode(A),t=!1}catch{}}return E}function d(y){return t&&/[\x80-\xff]/.test(y)&&(y=l("utf-8",y),t&&(y=l("iso-8859-1",y))),y}function u(y){const E=[];let b;const A=s("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(b=A.exec(y))!==null;){let[,O,D,P]=b;if(O=parseInt(O,10),O in E){if(O===0)break;continue}E[O]=[D,P]}const N=[];for(let O=0;O<E.length&&O in E;++O){let[D,P]=E[O];P=p(P),D&&(P=unescape(P),O===0&&(P=g(P))),N.push(P)}return N.join("")}function p(y){if(y.startsWith('"')){const E=y.slice(1).split('\\"');for(let b=0;b<E.length;++b){const A=E[b].indexOf('"');A!==-1&&(E[b]=E[b].slice(0,A),E.length=b+1),E[b]=E[b].replaceAll(/\\(.)/g,"$1")}y=E.join('"')}return y}function g(y){const E=y.indexOf("'");if(E===-1)return y;const b=y.slice(0,E),N=y.slice(E+1).replace(/^[^']*'/,"");return l(b,N)}function _(y){return!y.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(y)?y:y.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(E,b,A,N){if(A==="q"||A==="Q")return N=N.replaceAll("_"," "),N=N.replaceAll(/=([0-9a-fA-F]{2})/g,function(O,D){return String.fromCharCode(parseInt(D,16))}),l(b,N);try{N=atob(N)}catch{}return l(b,N)})}return""}function uEe(n,t){const i=new Headers;if(!n||!t||typeof t!="object")return i;for(const s in t){const l=t[s];l!==void 0&&i.append(s,l)}return i}function XU(n){var t;return((t=URL.parse(n))==null?void 0:t.origin)??null}function hEe({responseHeaders:n,isHttp:t,rangeChunkSize:i,disableRange:s}){const l={allowRangeRequests:!1,suggestedLength:void 0},d=parseInt(n.get("Content-Length"),10);return!Number.isInteger(d)||(l.suggestedLength=d,d<=2*i)||s||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(l.allowRangeRequests=!0),l}function fEe(n){const t=n.get("Content-Disposition");if(t){let i=yZe(t);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(lZ(i))return i}return null}function rP(n,t){return new N7(`Unexpected server response (${n}) while retrieving PDF "${t}".`,n,n===404||n===0&&t.startsWith("file:"))}function pEe(n){return n===200||n===206}function mEe(n,t,i){return{method:"GET",headers:n,signal:i.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function gEe(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(Ei(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}class _Ze{constructor(t){sn(this,"_responseOrigin",null);this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=uEe(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Aa(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new EZe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new wZe(this,t,i);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class EZe{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const i=t.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const s=new Headers(t.headers),l=i.url;fetch(l,mEe(s,this._withCredentials,this._abortController)).then(d=>{if(t._responseOrigin=XU(d.url),!pEe(d.status))throw rP(d.status,l);this._reader=d.body.getReader(),this._headersCapability.resolve();const u=d.headers,{allowRangeRequests:p,suggestedLength:g}=hEe({responseHeaders:u,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=p,this._contentLength=g||this._contentLength,this._filename=fEe(u),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Dv("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._headersCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:gEe(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}class wZe{constructor(t,i,s){this._stream=t,this._reader=null,this._loaded=0;const l=t.source;this._withCredentials=l.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!l.disableStream,this._abortController=new AbortController;const d=new Headers(t.headers);d.append("Range",`bytes=${i}-${s-1}`);const u=l.url;fetch(u,mEe(d,this._withCredentials,this._abortController)).then(p=>{const g=XU(p.url);if(g!==t._responseOrigin)throw new Error(`Expected range response-origin "${g}" to match "${t._responseOrigin}".`);if(!pEe(p.status))throw rP(p.status,u);this._readCapability.resolve(),this._reader=p.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;await this._readCapability.promise;const{value:t,done:i}=await this._reader.read();return i?{value:t,done:i}:(this._loaded+=t.byteLength,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:gEe(t),done:!1})}cancel(t){var i;(i=this._reader)==null||i.cancel(t),this._abortController.abort()}}const lK=200,cK=206;function SZe(n){const t=n.response;return typeof t!="string"?t:eP(t).buffer}class bZe{constructor({url:t,httpHeaders:i,withCredentials:s}){sn(this,"_responseOrigin",null);this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=uEe(this.isHttp,i),this.withCredentials=s||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const i=new XMLHttpRequest,s=this.currXhrId++,l=this.pendingRequests[s]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[d,u]of this.headers)i.setRequestHeader(d,u);return this.isHttp&&"begin"in t&&"end"in t?(i.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),l.expectedStatus=cK):l.expectedStatus=lK,i.responseType="arraybuffer",Aa(t.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{t.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,s),i.onprogress=this.onProgress.bind(this,s),l.onHeadersReceived=t.onHeadersReceived,l.onDone=t.onDone,l.onError=t.onError,l.onProgress=t.onProgress,i.send(null),s}onProgress(t,i){var l;const s=this.pendingRequests[t];s&&((l=s.onProgress)==null||l.call(s,i))}onStateChange(t,i){const s=this.pendingRequests[t];if(!s)return;const l=s.xhr;if(l.readyState>=2&&s.onHeadersReceived&&(s.onHeadersReceived(),delete s.onHeadersReceived),l.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],l.status===0&&this.isHttp){s.onError(l.status);return}const d=l.status||lK;if(!(d===lK&&s.expectedStatus===cK)&&d!==s.expectedStatus){s.onError(l.status);return}const p=SZe(l);if(d===cK){const g=l.getResponseHeader("Content-Range"),_=/bytes (\d+)-(\d+)\/(\d+)/.exec(g);_?s.onDone({begin:parseInt(_[1],10),chunk:p}):(Ei('Missing or invalid "Content-Range" header.'),s.onError(0))}else p?s.onDone({begin:0,chunk:p}):s.onError(l.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const i=this.pendingRequests[t].xhr;delete this.pendingRequests[t],i.abort()}}class CZe{constructor(t){this._source=t,this._manager=new bZe(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const i=this._rangeRequestReaders.indexOf(t);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return Aa(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new TZe(this._manager,this._source),this._fullRequestReader}getRangeReader(t,i){const s=new RZe(this._manager,t,i);return s.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class TZe{constructor(t,i){this._manager=t,this._url=i.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,i=this._manager.getRequestXhr(t);this._manager._responseOrigin=XU(i.responseURL);const s=i.getAllResponseHeaders(),l=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(p=>{const[g,..._]=p.split(": ");return[g,_.join(": ")]}):[]),{allowRangeRequests:d,suggestedLength:u}=hEe({responseHeaders:l,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});d&&(this._isRangeSupported=!0),this._contentLength=u||this._contentLength,this._filename=fEe(l),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=rP(t,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var i;(i=this.onProgress)==null||i.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class RZe{constructor(t,i,s){this._manager=t,this._url=t.url,this._requestId=t.request({begin:i,end:s,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var i;const t=XU((i=this._manager.getRequestXhr(this._requestId))==null?void 0:i.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var t;(t=this.onClosed)==null||t.call(this,this)}_onDone(t){const i=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const s of this._requests)s.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??(this._storedError=rP(t,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var i;this.isStreamingSupported||(i=this.onProgress)==null||i.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const xZe=/^[a-z][a-z0-9\-+.]+:/i;function AZe(n){if(xZe.test(n))return new URL(n);const t=ic.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}class IZe{constructor(t){this.source=t,this.url=AZe(t.url),Aa(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return((t=this._fullRequestReader)==null?void 0:t._loaded)??0}getFullReader(){return Aa(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new NZe(this),this._fullRequestReader}getRangeReader(t,i){if(i<=this._progressiveDataLength)return null;const s=new OZe(this,t,i);return this._rangeRequestReaders.push(s),s}cancelAllRequests(t){var i;(i=this._fullRequestReader)==null||i.cancel(t);for(const s of this._rangeRequestReaders.slice(0))s.cancel(t)}}class NZe{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=t.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const s=ic.getBuiltinModule("fs");s.promises.lstat(this._url).then(l=>{this._contentLength=l.size,this._setReadableStream(s.createReadStream(this._url)),this._headersCapability.resolve()},l=>{l.code==="ENOENT"&&(l=rP(0,this._url.href)),this._storedError=l,this._headersCapability.reject(l)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Dv("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class OZe{constructor(t,i,s){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const l=t.source;this._isStreamingSupported=!l.disableStream;const d=ic.getBuiltinModule("fs");this._setReadableStream(d.createReadStream(this._url,{start:i,end:s-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var s;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,(s=this.onProgress)==null||s.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const _I=Symbol("INITIAL_DATA");var xd,m5,qY;class vEe{constructor(){ee(this,m5);ee(this,xd,Object.create(null))}get(t,i=null){if(i){const l=pe(this,m5,qY).call(this,t);return l.promise.then(()=>i(l.data)),null}const s=T(this,xd)[t];if(!s||s.data===_I)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return s.data}has(t){const i=T(this,xd)[t];return!!i&&i.data!==_I}delete(t){const i=T(this,xd)[t];return!i||i.data===_I?!1:(delete T(this,xd)[t],!0)}resolve(t,i=null){const s=pe(this,m5,qY).call(this,t);s.data=i,s.resolve()}clear(){var t;for(const i in T(this,xd)){const{data:s}=T(this,xd)[i];(t=s==null?void 0:s.bitmap)==null||t.close()}re(this,xd,Object.create(null))}*[Symbol.iterator](){for(const t in T(this,xd)){const{data:i}=T(this,xd)[t];i!==_I&&(yield[t,i])}}}xd=new WeakMap,m5=new WeakSet,qY=function(t){var i;return(i=T(this,xd))[t]||(i[t]={...Promise.withResolvers(),data:_I})};const PZe=1e5,Pfe=30;var Gpe,F1,Wc,g5,v5,w2,Zm,y5,_5,S2,_T,ET,B1,wT,E5,ST,b2,w5,S5,bT,C2,b5,V1,CT,O9,yEe,P9,_Ee,C5,YY,TT,pM,T5,XY,L9,EEe,D9,wEe;const Xs=class Xs{constructor({textContentSource:t,container:i,viewport:s}){ee(this,O9);ee(this,P9);ee(this,C5);ee(this,F1,Promise.withResolvers());ee(this,Wc,null);ee(this,g5,!1);ee(this,v5,!!((Gpe=globalThis.FontInspector)!=null&&Gpe.enabled));ee(this,w2,null);ee(this,Zm,null);ee(this,y5,0);ee(this,_5,0);ee(this,S2,null);ee(this,_T,null);ee(this,ET,0);ee(this,B1,0);ee(this,wT,Object.create(null));ee(this,E5,[]);ee(this,ST,null);ee(this,b2,[]);ee(this,w5,new WeakMap);ee(this,S5,null);var g;if(t instanceof ReadableStream)re(this,ST,t);else if(typeof t=="object")re(this,ST,new ReadableStream({start(_){_.enqueue(t),_.close()}}));else throw new Error('No "textContentSource" parameter specified.');re(this,Wc,re(this,_T,i)),re(this,B1,s.scale*Up.pixelRatio),re(this,ET,s.rotation),re(this,Zm,{div:null,properties:null,ctx:null});const{pageWidth:l,pageHeight:d,pageX:u,pageY:p}=s.rawDims;re(this,S5,[1,0,0,-1,-u,p+d]),re(this,_5,l),re(this,y5,d),pe(g=Xs,L9,EEe).call(g),NE(i,s),T(this,F1).promise.finally(()=>{T(Xs,CT).delete(this),re(this,Zm,null),re(this,wT,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:i}=qo.platform;return Ki(this,"fontFamilyMap",new Map([["sans-serif",`${t&&i?"Calibri, ":""}sans-serif`],["monospace",`${t&&i?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{T(this,S2).read().then(({value:i,done:s})=>{if(s){T(this,F1).resolve();return}T(this,w2)??re(this,w2,i.lang),Object.assign(T(this,wT),i.styles),pe(this,O9,yEe).call(this,i.items),t()},T(this,F1).reject)};return re(this,S2,T(this,ST).getReader()),T(Xs,CT).add(this),t(),T(this,F1).promise}update({viewport:t,onBefore:i=null}){var d;const s=t.scale*Up.pixelRatio,l=t.rotation;if(l!==T(this,ET)&&(i==null||i(),re(this,ET,l),NE(T(this,_T),{rotation:l})),s!==T(this,B1)){i==null||i(),re(this,B1,s);const u={div:null,properties:null,ctx:pe(d=Xs,TT,pM).call(d,T(this,w2))};for(const p of T(this,b2))u.properties=T(this,w5).get(p),u.div=p,pe(this,C5,YY).call(this,u)}}cancel(){var i;const t=new Dv("TextLayer task cancelled.");(i=T(this,S2))==null||i.cancel(t).catch(()=>{}),re(this,S2,null),T(this,F1).reject(t)}get textDivs(){return T(this,b2)}get textContentItemsStr(){return T(this,E5)}static cleanup(){if(!(T(this,CT).size>0)){T(this,bT).clear();for(const{canvas:t}of T(this,C2).values())t.remove();T(this,C2).clear()}}};F1=new WeakMap,Wc=new WeakMap,g5=new WeakMap,v5=new WeakMap,w2=new WeakMap,Zm=new WeakMap,y5=new WeakMap,_5=new WeakMap,S2=new WeakMap,_T=new WeakMap,ET=new WeakMap,B1=new WeakMap,wT=new WeakMap,E5=new WeakMap,ST=new WeakMap,b2=new WeakMap,w5=new WeakMap,S5=new WeakMap,bT=new WeakMap,C2=new WeakMap,b5=new WeakMap,V1=new WeakMap,CT=new WeakMap,O9=new WeakSet,yEe=function(t){var l,d;if(T(this,g5))return;(d=T(this,Zm)).ctx??(d.ctx=pe(l=Xs,TT,pM).call(l,T(this,w2)));const i=T(this,b2),s=T(this,E5);for(const u of t){if(i.length>PZe){Ei("Ignoring additional textDivs for performance reasons."),re(this,g5,!0);return}if(u.str===void 0){if(u.type==="beginMarkedContentProps"||u.type==="beginMarkedContent"){const p=T(this,Wc);re(this,Wc,document.createElement("span")),T(this,Wc).classList.add("markedContent"),u.id&&T(this,Wc).setAttribute("id",`${u.id}`),p.append(T(this,Wc))}else u.type==="endMarkedContent"&&re(this,Wc,T(this,Wc).parentNode);continue}s.push(u.str),pe(this,P9,_Ee).call(this,u)}},P9=new WeakSet,_Ee=function(t){var O;const i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};T(this,b2).push(i);const l=zn.transform(T(this,S5),t.transform);let d=Math.atan2(l[1],l[0]);const u=T(this,wT)[t.fontName];u.vertical&&(d+=Math.PI/2);let p=T(this,v5)&&u.fontSubstitution||u.fontFamily;p=Xs.fontFamilyMap.get(p)||p;const g=Math.hypot(l[2],l[3]),_=g*pe(O=Xs,D9,wEe).call(O,p,u,T(this,w2));let y,E;d===0?(y=l[4],E=l[5]-_):(y=l[4]+_*Math.sin(d),E=l[5]-_*Math.cos(d));const b="calc(var(--total-scale-factor) *",A=i.style;T(this,Wc)===T(this,_T)?(A.left=`${(100*y/T(this,_5)).toFixed(2)}%`,A.top=`${(100*E/T(this,y5)).toFixed(2)}%`):(A.left=`${b}${y.toFixed(2)}px)`,A.top=`${b}${E.toFixed(2)}px)`),A.fontSize=`${b}${(T(Xs,V1)*g).toFixed(2)}px)`,A.fontFamily=p,s.fontSize=g,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,T(this,v5)&&(i.dataset.fontName=u.fontSubstitutionLoadedName||t.fontName),d!==0&&(s.angle=d*(180/Math.PI));let N=!1;if(t.str.length>1)N=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const D=Math.abs(t.transform[0]),P=Math.abs(t.transform[3]);D!==P&&Math.max(D,P)/Math.min(D,P)>1.5&&(N=!0)}if(N&&(s.canvasWidth=u.vertical?t.height:t.width),T(this,w5).set(i,s),T(this,Zm).div=i,T(this,Zm).properties=s,pe(this,C5,YY).call(this,T(this,Zm)),s.hasText&&T(this,Wc).append(i),s.hasEOL){const D=document.createElement("br");D.setAttribute("role","presentation"),T(this,Wc).append(D)}},C5=new WeakSet,YY=function(t){var p;const{div:i,properties:s,ctx:l}=t,{style:d}=i;let u="";if(T(Xs,V1)>1&&(u=`scale(${1/T(Xs,V1)})`),s.canvasWidth!==0&&s.hasText){const{fontFamily:g}=d,{canvasWidth:_,fontSize:y}=s;pe(p=Xs,T5,XY).call(p,l,y*T(this,B1),g);const{width:E}=l.measureText(i.textContent);E>0&&(u=`scaleX(${_*T(this,B1)/E}) ${u}`)}s.angle!==0&&(u=`rotate(${s.angle}deg) ${u}`),u.length>0&&(d.transform=u)},TT=new WeakSet,pM=function(t=null){let i=T(this,C2).get(t||(t=""));if(!i){const s=document.createElement("canvas");s.className="hiddenCanvasElement",s.lang=t,document.body.append(s),i=s.getContext("2d",{alpha:!1,willReadFrequently:!0}),T(this,C2).set(t,i),T(this,b5).set(i,{size:0,family:""})}return i},T5=new WeakSet,XY=function(t,i,s){const l=T(this,b5).get(t);i===l.size&&s===l.family||(t.font=`${i}px ${s}`,l.size=i,l.family=s)},L9=new WeakSet,EEe=function(){if(T(this,V1)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),re(this,V1,t.getBoundingClientRect().height),t.remove()},D9=new WeakSet,wEe=function(t,i,s){const l=T(this,bT).get(t);if(l)return l;const d=pe(this,TT,pM).call(this,s);d.canvas.width=d.canvas.height=Pfe,pe(this,T5,XY).call(this,d,Pfe,t);const u=d.measureText(""),p=u.fontBoundingBoxAscent,g=Math.abs(u.fontBoundingBoxDescent);d.canvas.width=d.canvas.height=0;let _=.8;return p?_=p/(p+g):(qo.platform.isFirefox&&Ei("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?_=i.ascent:i.descent&&(_=1+i.descent)),T(this,bT).set(t,_),_},ee(Xs,TT),ee(Xs,T5),ee(Xs,L9),ee(Xs,D9),ee(Xs,bT,new Map),ee(Xs,C2,new Map),ee(Xs,b5,new WeakMap),ee(Xs,V1,null),ee(Xs,CT,new Set);let tN=Xs;class nN{static textContent(t){const i=[],s={items:i,styles:Object.create(null)};function l(d){var g;if(!d)return;let u=null;const p=d.name;if(p==="#text")u=d.value;else if(nN.shouldBuildText(p))(g=d==null?void 0:d.attributes)!=null&&g.textContent?u=d.attributes.textContent:d.value&&(u=d.value);else return;if(u!==null&&i.push({str:u}),!!d.children)for(const _ of d.children)l(_)}return l(t),s}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}const LZe=100;function SEe(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const t=new JY,{docId:i}=t,s=n.url?zQe(n.url):null,l=n.data?HQe(n.data):null,d=n.httpHeaders||null,u=n.withCredentials===!0,p=n.password??null,g=n.range instanceof bEe?n.range:null,_=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16;let y=n.worker instanceof iN?n.worker:null;const E=n.verbosity,b=typeof n.docBaseUrl=="string"&&!qU(n.docBaseUrl)?n.docBaseUrl:null,A=xk(n.cMapUrl),N=n.cMapPacked!==!1,O=n.CMapReaderFactory||(ec?JQe:Efe),D=xk(n.iccUrl),P=xk(n.standardFontDataUrl),j=n.StandardFontDataFactory||(ec?QQe:wfe),M=xk(n.wasmUrl),V=n.WasmFactory||(ec?ZQe:Sfe),H=n.stopAtErrors!==!0,$=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,Q=n.isEvalSupported!==!1,Y=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!ec,le=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!ec&&(qo.platform.isFirefox||!globalThis.chrome),ae=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,te=typeof n.disableFontFace=="boolean"?n.disableFontFace:ec,de=n.fontExtraProperties===!0,G=n.enableXfa===!0,ie=n.ownerDocument||globalThis.document,_e=n.disableRange===!0,he=n.disableStream===!0,Ce=n.disableAutoFetch===!0,fe=n.pdfBug===!0,me=n.CanvasFactory||(ec?XQe:KQe),Ne=n.FilterFactory||(ec?YQe:qQe),Fe=n.enableHWA===!0,je=n.useWasm!==!1,Ve=g?g.length:n.length??NaN,Re=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!ec&&!te,Be=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(O===Efe&&j===wfe&&V===Sfe&&A&&P&&M&&MI(A,document.baseURI)&&MI(P,document.baseURI)&&MI(M,document.baseURI)),Xe=null;EQe(E);const we={canvasFactory:new me({ownerDocument:ie,enableHWA:Fe}),filterFactory:new Ne({docId:i,ownerDocument:ie}),cMapReaderFactory:Be?null:new O({baseUrl:A,isCompressed:N}),standardFontDataFactory:Be?null:new j({baseUrl:P}),wasmFactory:Be?null:new V({baseUrl:M})};y||(y=iN.create({verbosity:E,port:Pp.workerPort}),t._worker=y);const Ge={docId:i,apiVersion:"5.4.54",data:l,password:p,disableAutoFetch:Ce,rangeChunkSize:_,length:Ve,docBaseUrl:b,enableXfa:G,evaluatorOptions:{maxImageSize:$,disableFontFace:te,ignoreErrors:H,isEvalSupported:Q,isOffscreenCanvasSupported:Y,isImageDecoderSupported:le,canvasMaxAreaInBytes:ae,fontExtraProperties:de,useSystemFonts:Re,useWasm:je,useWorkerFetch:Be,cMapUrl:A,iccUrl:D,standardFontDataUrl:P,wasmUrl:M}},rt={ownerDocument:ie,pdfBug:fe,styleElement:Xe,loadingParams:{disableAutoFetch:Ce,enableXfa:G}};return y.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(y.destroyed)throw new Error("Worker was destroyed");const pt=y.messageHandler.sendWithPromise("GetDocRequest",Ge,l?[l.buffer]:null);let Ze;if(g)Ze=new mZe(g,{disableRange:_e,disableStream:he});else if(!l){if(!s)throw new Error("getDocument - no `url` parameter provided.");const Je=MI(s)?_Ze:ec?IZe:CZe;Ze=new Je({url:s,length:Ve,httpHeaders:d,withCredentials:u,rangeChunkSize:_,disableRange:_e,disableStream:he})}return pt.then(Je=>{if(t.destroyed)throw new Error("Loading aborted");if(y.destroyed)throw new Error("Worker was destroyed");const _t=new VI(i,Je,y.port),Xt=new MZe(_t,t,Ze,rt,we,Fe);t._transport=Xt,_t.send("Ready",null)})}).catch(t._capability.reject),t}var k9;const M9=class M9{constructor(){sn(this,"_capability",Promise.withResolvers());sn(this,"_transport",null);sn(this,"_worker",null);sn(this,"docId",`d${ao(M9,k9)._++}`);sn(this,"destroyed",!1);sn(this,"onPassword",null);sn(this,"onProgress",null)}get promise(){return this._capability.promise}async destroy(){var t,i,s,l;this.destroyed=!0;try{(t=this._worker)!=null&&t.port&&(this._worker._pendingDestroy=!0),await((i=this._transport)==null?void 0:i.destroy())}catch(d){throw(s=this._worker)!=null&&s.port&&delete this._worker._pendingDestroy,d}this._transport=null,(l=this._worker)==null||l.destroy(),this._worker=null}async getData(){return this._transport.getData()}};k9=new WeakMap,ee(M9,k9,0);let JY=M9;var T2,R5,x5,A5,I5;class bEe{constructor(t,i,s=!1,l=null){ee(this,T2,Promise.withResolvers());ee(this,R5,[]);ee(this,x5,[]);ee(this,A5,[]);ee(this,I5,[]);this.length=t,this.initialData=i,this.progressiveDone=s,this.contentDispositionFilename=l}addRangeListener(t){T(this,I5).push(t)}addProgressListener(t){T(this,A5).push(t)}addProgressiveReadListener(t){T(this,x5).push(t)}addProgressiveDoneListener(t){T(this,R5).push(t)}onDataRange(t,i){for(const s of T(this,I5))s(t,i)}onDataProgress(t,i){T(this,T2).promise.then(()=>{for(const s of T(this,A5))s(t,i)})}onDataProgressiveRead(t){T(this,T2).promise.then(()=>{for(const i of T(this,x5))i(t)})}onDataProgressiveDone(){T(this,T2).promise.then(()=>{for(const t of T(this,R5))t()})}transportReady(){T(this,T2).resolve()}requestDataRange(t,i){Zr("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}T2=new WeakMap,R5=new WeakMap,x5=new WeakMap,A5=new WeakMap,I5=new WeakMap;class DZe{constructor(t,i){this._pdfInfo=t,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Ki(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var eg,R2,$I;class kZe{constructor(t,i,s,l=!1){ee(this,R2);ee(this,eg,!1);this._pageIndex=t,this._pageInfo=i,this._transport=s,this._stats=l?new vfe:null,this._pdfBug=l,this.commonObjs=s.commonObjs,this.objs=new vEe,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:i=this.rotate,offsetX:s=0,offsetY:l=0,dontFlip:d=!1}={}){return new nP({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:i,offsetX:s,offsetY:l,dontFlip:d})}getAnnotations({intent:t="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Ki(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return((t=this._transport._htmlForXfa)==null?void 0:t.children[this._pageIndex])||null}render({canvasContext:t,canvas:i=t.canvas,viewport:s,intent:l="display",annotationMode:d=c1.ENABLE,transform:u=null,background:p=null,optionalContentConfigPromise:g=null,annotationCanvasMap:_=null,pageColors:y=null,printAnnotationStorage:E=null,isEditing:b=!1}){var H,$;(H=this._stats)==null||H.time("Overall");const A=this._transport.getRenderingIntent(l,d,E,b),{renderingIntent:N,cacheKey:O}=A;re(this,eg,!1),g||(g=this._transport.getOptionalContentConfig(N));let D=this._intentStates.get(O);D||(D=Object.create(null),this._intentStates.set(O,D)),D.streamReaderCancelTimeout&&(clearTimeout(D.streamReaderCancelTimeout),D.streamReaderCancelTimeout=null);const P=!!(N&Fd.PRINT);D.displayReadyCapability||(D.displayReadyCapability=Promise.withResolvers(),D.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},($=this._stats)==null||$.time("Page Request"),this._pumpOperatorList(A));const j=Q=>{var Y;D.renderTasks.delete(M),P&&re(this,eg,!0),pe(this,R2,$I).call(this),Q?(M.capability.reject(Q),this._abortOperatorList({intentState:D,reason:Q instanceof Error?Q:new Error(Q)})):M.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(Y=globalThis.Stats)!=null&&Y.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},M=new QY({callback:j,params:{canvas:i,canvasContext:t,viewport:s,transform:u,background:p},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:_,operatorList:D.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!P,pdfBug:this._pdfBug,pageColors:y,enableHWA:this._transport.enableHWA});(D.renderTasks||(D.renderTasks=new Set)).add(M);const V=M.task;return Promise.all([D.displayReadyCapability.promise,g]).then(([Q,Y])=>{var le;if(this.destroyed){j();return}if((le=this._stats)==null||le.time("Rendering"),!(Y.renderingIntent&N))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");M.initializeGraphics({transparency:Q,optionalContentConfig:Y}),M.operatorListChanged()}).catch(j),V}getOperatorList({intent:t="display",annotationMode:i=c1.ENABLE,printAnnotationStorage:s=null,isEditing:l=!1}={}){var _;function d(){p.operatorList.lastChunk&&(p.opListReadCapability.resolve(p.operatorList),p.renderTasks.delete(g))}const u=this._transport.getRenderingIntent(t,i,s,l,!0);let p=this._intentStates.get(u.cacheKey);p||(p=Object.create(null),this._intentStates.set(u.cacheKey,p));let g;return p.opListReadCapability||(g=Object.create(null),g.operatorListChanged=d,p.opListReadCapability=Promise.withResolvers(),(p.renderTasks||(p.renderTasks=new Set)).add(g),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(_=this._stats)==null||_.time("Page Request"),this._pumpOperatorList(u)),p.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:i===!0},{highWaterMark:100,size(l){return l.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(s=>nN.textContent(s));const i=this.streamTextContent(t);return new Promise(function(s,l){function d(){u.read().then(function({value:g,done:_}){if(_){s(p);return}p.lang??(p.lang=g.lang),Object.assign(p.styles,g.styles),p.items.push(...g.items),d()},l)}const u=i.getReader(),p={items:[],styles:Object.create(null),lang:null};d()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const s of i.renderTasks)t.push(s.completed),s.cancel();return this.objs.clear(),re(this,eg,!1),Promise.all(t)}cleanup(t=!1){re(this,eg,!0);const i=pe(this,R2,$I).call(this);return t&&i&&this._stats&&(this._stats=new vfe),i}_startRenderPage(t,i){var l,d;const s=this._intentStates.get(i);s&&((l=this._stats)==null||l.timeEnd("Page Request"),(d=s.displayReadyCapability)==null||d.resolve(t))}_renderPageChunk(t,i){for(let s=0,l=t.length;s<l;s++)i.operatorList.fnArray.push(t.fnArray[s]),i.operatorList.argsArray.push(t.argsArray[s]);i.operatorList.lastChunk=t.lastChunk,i.operatorList.separateAnnots=t.separateAnnots;for(const s of i.renderTasks)s.operatorListChanged();t.lastChunk&&pe(this,R2,$I).call(this)}_pumpOperatorList({renderingIntent:t,cacheKey:i,annotationStorageSerializable:s,modifiedIds:l}){const{map:d,transfer:u}=s,g=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:i,annotationStorage:d,modifiedIds:l},u).getReader(),_=this._intentStates.get(i);_.streamReader=g;const y=()=>{g.read().then(({value:E,done:b})=>{if(b){_.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(E,_),y())},E=>{if(_.streamReader=null,!this._transport.destroyed){if(_.operatorList){_.operatorList.lastChunk=!0;for(const b of _.renderTasks)b.operatorListChanged();pe(this,R2,$I).call(this)}if(_.displayReadyCapability)_.displayReadyCapability.reject(E);else if(_.opListReadCapability)_.opListReadCapability.reject(E);else throw E}})};y()}_abortOperatorList({intentState:t,reason:i,force:s=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!s){if(t.renderTasks.size>0)return;if(i instanceof oZ){let l=LZe;i.extraDelay>0&&i.extraDelay<1e3&&(l+=i.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:i,force:!0})},l);return}}if(t.streamReader.cancel(new Dv(i.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[l,d]of this._intentStates)if(d===t){this._intentStates.delete(l);break}this.cleanup()}}}get stats(){return this._stats}}eg=new WeakMap,R2=new WeakSet,$I=function(){if(!T(this,eg)||this.destroyed)return!1;for(const{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),re(this,eg,!1),!0};var z1,qh,tg,x2,j9,A2,I2,RT,mM,U9,CEe,F9,TEe,N2,KI,xT,gM;const Ns=class Ns{constructor({name:t=null,port:i=null,verbosity:s=wQe()}={}){ee(this,RT);ee(this,U9);ee(this,F9);ee(this,N2);ee(this,z1,Promise.withResolvers());ee(this,qh,null);ee(this,tg,null);ee(this,x2,null);if(this.name=t,this.destroyed=!1,this.verbosity=s,i){if(T(Ns,I2).has(i))throw new Error("Cannot use more than one PDFWorker per port.");T(Ns,I2).set(i,this),pe(this,U9,CEe).call(this,i)}else pe(this,F9,TEe).call(this)}get promise(){return T(this,z1).promise}get port(){return T(this,tg)}get messageHandler(){return T(this,qh)}destroy(){var t,i;this.destroyed=!0,(t=T(this,x2))==null||t.terminate(),re(this,x2,null),T(Ns,I2).delete(T(this,tg)),re(this,tg,null),(i=T(this,qh))==null||i.destroy(),re(this,qh,null)}static create(t){const i=T(this,I2).get(t==null?void 0:t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new Ns(t)}static get workerSrc(){if(Pp.workerSrc)return Pp.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Ki(this,"_setupFakeWorkerGlobal",(async()=>T(this,xT,gM)?T(this,xT,gM):(await Xi(()=>import(this.workerSrc),__vite__mapDeps([]))).WorkerMessageHandler)())}};z1=new WeakMap,qh=new WeakMap,tg=new WeakMap,x2=new WeakMap,j9=new WeakMap,A2=new WeakMap,I2=new WeakMap,RT=new WeakSet,mM=function(){T(this,z1).resolve(),T(this,qh).send("configure",{verbosity:this.verbosity})},U9=new WeakSet,CEe=function(t){re(this,tg,t),re(this,qh,new VI("main","worker",t)),T(this,qh).on("ready",()=>{}),pe(this,RT,mM).call(this)},F9=new WeakSet,TEe=function(){if(T(Ns,A2)||T(Ns,xT,gM)){pe(this,N2,KI).call(this);return}let{workerSrc:t}=Ns;try{Ns._isSameOrigin(window.location,t)||(t=Ns._createCDNWrapper(new URL(t,window.location).href));const i=new Worker(t,{type:"module"}),s=new VI("main","worker",i),l=()=>{d.abort(),s.destroy(),i.terminate(),this.destroyed?T(this,z1).reject(new Error("Worker was destroyed")):pe(this,N2,KI).call(this)},d=new AbortController;i.addEventListener("error",()=>{T(this,x2)||l()},{signal:d.signal}),s.on("test",p=>{if(d.abort(),this.destroyed||!p){l();return}re(this,qh,s),re(this,tg,i),re(this,x2,i),pe(this,RT,mM).call(this)}),s.on("ready",p=>{if(d.abort(),this.destroyed){l();return}try{u()}catch{pe(this,N2,KI).call(this)}});const u=()=>{const p=new Uint8Array;s.send("test",p,[p.buffer])};u();return}catch{KU("The worker has been disabled.")}pe(this,N2,KI).call(this)},N2=new WeakSet,KI=function(){T(Ns,A2)||(Ei("Setting up fake worker."),re(Ns,A2,!0)),Ns._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){T(this,z1).reject(new Error("Worker was destroyed"));return}const i=new $Qe;re(this,tg,i);const s=`fake${ao(Ns,j9)._++}`,l=new VI(s+"_worker",s,i);t.setup(l,i),re(this,qh,new VI(s,s+"_worker",i)),pe(this,RT,mM).call(this)}).catch(t=>{T(this,z1).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},xT=new WeakSet,gM=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},ee(Ns,xT),ee(Ns,j9,0),ee(Ns,A2,!1),ee(Ns,I2,new WeakMap),ec&&(re(Ns,A2,!0),Pp.workerSrc||(Pp.workerSrc="./pdf.worker.mjs")),Ns._isSameOrigin=(t,i)=>{const s=URL.parse(t);if(!(s!=null&&s.origin)||s.origin==="null")return!1;const l=new URL(i,s);return s.origin===l.origin},Ns._createCDNWrapper=t=>{const i=`await import("${t}");`;return URL.createObjectURL(new Blob([i],{type:"text/javascript"}))},Ns.fromPort=t=>{if(LQe("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!(t!=null&&t.port))throw new Error("PDFWorker.fromPort - invalid method signature.");return Ns.create(t)};let iN=Ns;var ng,_p,AT,IT,ig,O2,qI;class MZe{constructor(t,i,s,l,d,u){ee(this,O2);ee(this,ng,new Map);ee(this,_p,new Map);ee(this,AT,new Map);ee(this,IT,new Map);ee(this,ig,null);this.messageHandler=t,this.loadingTask=i,this.commonObjs=new vEe,this.fontLoader=new BQe({ownerDocument:l.ownerDocument,styleElement:l.styleElement}),this.loadingParams=l.loadingParams,this._params=l,this.canvasFactory=d.canvasFactory,this.filterFactory=d.filterFactory,this.cMapReaderFactory=d.cMapReaderFactory,this.standardFontDataFactory=d.standardFontDataFactory,this.wasmFactory=d.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=s,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=u,this.setupMessageHandler()}get annotationStorage(){return Ki(this,"annotationStorage",new cZ)}getRenderingIntent(t,i=c1.ENABLE,s=null,l=!1,d=!1){let u=Fd.DISPLAY,p=UY;switch(t){case"any":u=Fd.ANY;break;case"display":break;case"print":u=Fd.PRINT;break;default:Ei(`getRenderingIntent - invalid intent: ${t}`)}const g=u&Fd.PRINT&&s instanceof tEe?s:this.annotationStorage;switch(i){case c1.DISABLE:u+=Fd.ANNOTATIONS_DISABLE;break;case c1.ENABLE:break;case c1.ENABLE_FORMS:u+=Fd.ANNOTATIONS_FORMS;break;case c1.ENABLE_STORAGE:u+=Fd.ANNOTATIONS_STORAGE,p=g.serializable;break;default:Ei(`getRenderingIntent - invalid annotationMode: ${i}`)}l&&(u+=Fd.IS_EDITING),d&&(u+=Fd.OPLIST);const{ids:_,hash:y}=g.modifiedIds,E=[u,p.hash,y];return{renderingIntent:u,cacheKey:E.join("_"),annotationStorageSerializable:p,modifiedIds:_}}destroy(){var s;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(s=T(this,ig))==null||s.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const l of T(this,_p).values())t.push(l._destroy());T(this,_p).clear(),T(this,AT).clear(),T(this,IT).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return t.push(i),Promise.all(t).then(()=>{var l,d;this.commonObjs.clear(),this.fontLoader.clear(),T(this,ng).clear(),this.filterFactory.destroy(),tN.cleanup(),(l=this._networkStream)==null||l.cancelAllRequests(new Dv("Worker was terminated.")),(d=this.messageHandler)==null||d.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:i}=this;t.on("GetReader",(s,l)=>{Aa(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=d=>{this._lastProgress={loaded:d.loaded,total:d.total}},l.onPull=()=>{this._fullReader.read().then(function({value:d,done:u}){if(u){l.close();return}Aa(d instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(d),1,[d])}).catch(d=>{l.error(d)})},l.onCancel=d=>{this._fullReader.cancel(d),l.ready.catch(u=>{if(!this.destroyed)throw u})}}),t.on("ReaderHeadersReady",async s=>{var p;await this._fullReader.headersReady;const{isStreamingSupported:l,isRangeSupported:d,contentLength:u}=this._fullReader;return(!l||!d)&&(this._lastProgress&&((p=i.onProgress)==null||p.call(i,this._lastProgress)),this._fullReader.onProgress=g=>{var _;(_=i.onProgress)==null||_.call(i,{loaded:g.loaded,total:g.total})}),{isStreamingSupported:l,isRangeSupported:d,contentLength:u}}),t.on("GetRangeReader",(s,l)=>{Aa(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const d=this._networkStream.getRangeReader(s.begin,s.end);if(!d){l.close();return}l.onPull=()=>{d.read().then(function({value:u,done:p}){if(p){l.close();return}Aa(u instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),l.enqueue(new Uint8Array(u),1,[u])}).catch(u=>{l.error(u)})},l.onCancel=u=>{d.cancel(u),l.ready.catch(p=>{if(!this.destroyed)throw p})}}),t.on("GetDoc",({pdfInfo:s})=>{this._numPages=s.numPages,this._htmlForXfa=s.htmlForXfa,delete s.htmlForXfa,i._capability.resolve(new DZe(s,this))}),t.on("DocException",s=>{i._capability.reject(Vc(s))}),t.on("PasswordRequest",s=>{re(this,ig,Promise.withResolvers());try{if(!i.onPassword)throw Vc(s);const l=d=>{d instanceof Error?T(this,ig).reject(d):T(this,ig).resolve({password:d})};i.onPassword(l,s.code)}catch(l){T(this,ig).reject(l)}return T(this,ig).promise}),t.on("DataLoaded",s=>{var l;(l=i.onProgress)==null||l.call(i,{loaded:s.length,total:s.length}),this.downloadInfoCapability.resolve(s)}),t.on("StartRenderPage",s=>{if(this.destroyed)return;T(this,_p).get(s.pageIndex)._startRenderPage(s.transparency,s.cacheKey)}),t.on("commonobj",([s,l,d])=>{var u;if(this.destroyed||this.commonObjs.has(s))return null;switch(l){case"Font":if("error"in d){const y=d.error;Ei(`Error during font loading: ${y}`),this.commonObjs.resolve(s,y);break}const p=this._params.pdfBug&&((u=globalThis.FontInspector)!=null&&u.enabled)?(y,E)=>globalThis.FontInspector.fontAdded(y,E):null,g=new VQe(d,p);this.fontLoader.bind(g).catch(()=>t.sendWithPromise("FontFallback",{id:s})).finally(()=>{!g.fontExtraProperties&&g.data&&(g.data=null),this.commonObjs.resolve(s,g)});break;case"CopyLocalImage":const{imageRef:_}=d;Aa(_,"The imageRef must be defined.");for(const y of T(this,_p).values())for(const[,E]of y.objs)if((E==null?void 0:E.ref)===_)return E.dataLen?(this.commonObjs.resolve(s,structuredClone(E)),E.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(s,d);break;default:throw new Error(`Got unknown common object type ${l}`)}return null}),t.on("obj",([s,l,d,u])=>{var g;if(this.destroyed)return;const p=T(this,_p).get(l);if(!p.objs.has(s)){if(p._intentStates.size===0){(g=u==null?void 0:u.bitmap)==null||g.close();return}switch(d){case"Image":case"Pattern":p.objs.resolve(s,u);break;default:throw new Error(`Got unknown object type ${d}`)}}}),t.on("DocProgress",s=>{var l;this.destroyed||(l=i.onProgress)==null||l.call(i,{loaded:s.loaded,total:s.total})}),t.on("FetchBinaryData",async s=>{if(this.destroyed)throw new Error("Worker was destroyed.");const l=this[s.type];if(!l)throw new Error(`${s.type} not initialized, see the \`useWorkerFetch\` parameter.`);return l.fetch(s)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var s;this.annotationStorage.size<=0&&Ei("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:((s=this._fullReader)==null?void 0:s.filename)??null},i).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=t-1,s=T(this,AT).get(i);if(s)return s;const l=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(d=>{if(this.destroyed)throw new Error("Transport destroyed");d.refStr&&T(this,IT).set(d.refStr,t);const u=new kZe(i,d,this,this._params.pdfBug);return T(this,_p).set(i,u),u});return T(this,AT).set(i,l),l}getPageIndex(t){return FY(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:i})}getFieldObjects(){return pe(this,O2,qI).call(this,"GetFieldObjects")}hasJSActions(){return pe(this,O2,qI).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return pe(this,O2,qI).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return pe(this,O2,qI).call(this,"GetOptionalContentConfig").then(i=>new pZe(i,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",i=T(this,ng).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,null).then(l=>{var d,u;return{info:l[0],metadata:l[1]?new hZe(l[1]):null,contentDispositionFilename:((d=this._fullReader)==null?void 0:d.filename)??null,contentLength:((u=this._fullReader)==null?void 0:u.contentLength)??null}});return T(this,ng).set(t,s),s}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of T(this,_p).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),T(this,ng).clear(),this.filterFactory.destroy(!0),tN.cleanup()}}cachedPageNumber(t){if(!FY(t))return null;const i=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return T(this,IT).get(i)??null}}ng=new WeakMap,_p=new WeakMap,AT=new WeakMap,IT=new WeakMap,ig=new WeakMap,O2=new WeakSet,qI=function(t,i=null){const s=T(this,ng).get(t);if(s)return s;const l=this.messageHandler.sendWithPromise(t,i);return T(this,ng).set(t,l),l};var H1;class jZe{constructor(t){ee(this,H1,null);sn(this,"onContinue",null);sn(this,"onError",null);re(this,H1,t)}get promise(){return T(this,H1).capability.promise}cancel(t=0){T(this,H1).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=T(this,H1).operatorList;if(!t)return!1;const{annotationCanvasMap:i}=T(this,H1);return t.form||t.canvas&&(i==null?void 0:i.size)>0}}H1=new WeakMap;var G1,P2;const A_=class A_{constructor({callback:t,params:i,objs:s,commonObjs:l,annotationCanvasMap:d,operatorList:u,pageIndex:p,canvasFactory:g,filterFactory:_,useRequestAnimationFrame:y=!1,pdfBug:E=!1,pageColors:b=null,enableHWA:A=!1}){ee(this,G1,null);this.callback=t,this.params=i,this.objs=s,this.commonObjs=l,this.annotationCanvasMap=d,this.operatorListIdx=null,this.operatorList=u,this._pageIndex=p,this.canvasFactory=g,this.filterFactory=_,this._pdfBug=E,this.pageColors=b,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=y===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new jZe(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=A}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:i}){var p,g;if(this.cancelled)return;if(this._canvas){if(T(A_,P2).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");T(A_,P2).add(this._canvas)}this._pdfBug&&((p=globalThis.StepperManager)!=null&&p.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:s,transform:l,background:d}=this.params,u=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new TC(u,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:l,viewport:s,transparency:t,background:d}),this.operatorListIdx=0,this.graphicsReady=!0,(g=this.graphicsReadyCallback)==null||g.call(this)}cancel(t=null,i=0){var s,l,d;this.running=!1,this.cancelled=!0,(s=this.gfx)==null||s.endDrawing(),T(this,G1)&&(window.cancelAnimationFrame(T(this,G1)),re(this,G1,null)),T(A_,P2).delete(this._canvas),t||(t=new oZ(`Rendering cancelled, page ${this._pageIndex+1}`,i)),this.callback(t),(d=(l=this.task).onError)==null||d.call(l,t)}operatorListChanged(){var t;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(t=this.stepper)==null||t.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?re(this,G1,window.requestAnimationFrame(()=>{re(this,G1,null),this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),T(A_,P2).delete(this._canvas),this.callback())))}};G1=new WeakMap,P2=new WeakMap,ee(A_,P2,new WeakSet);let QY=A_;const UZe="5.4.54",FZe="295fb3ec4";var Ad,L2,NT,Ba,N5,OT,rg,O5,W1,Yh,P5,L5,ZY,D5,eX,k5,tX,sg,w_,B9,REe,Ep,n1;const zc=class zc{constructor({editor:t=null,uiManager:i=null}){ee(this,L5);ee(this,D5);ee(this,k5);ee(this,sg);ee(this,B9);ee(this,Ep);ee(this,Ad,null);ee(this,L2,null);ee(this,NT,void 0);ee(this,Ba,null);ee(this,N5,!1);ee(this,OT,!1);ee(this,rg,null);ee(this,O5,void 0);ee(this,W1,null);ee(this,Yh,null);var s,l;t?(re(this,OT,!1),re(this,rg,t)):re(this,OT,!0),re(this,Yh,(t==null?void 0:t._uiManager)||i),re(this,O5,T(this,Yh)._eventBus),re(this,NT,((s=t==null?void 0:t.color)==null?void 0:s.toUpperCase())||((l=T(this,Yh))==null?void 0:l.highlightColors.values().next().value)||"#FFFF98"),T(zc,P5)||re(zc,P5,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return Ki(this,"_keyboardManager",new iP([[["Escape","mac+Escape"],zc.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],zc.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],zc.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],zc.prototype._moveToPrevious],[["Home","mac+Home"],zc.prototype._moveToBeginning],[["End","mac+End"],zc.prototype._moveToEnd]]))}renderButton(){const t=re(this,Ad,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",T(this,rg)&&(t.ariaControls=`${T(this,rg).id}_colorpicker_dropdown`);const i=T(this,Yh)._signal;t.addEventListener("click",pe(this,sg,w_).bind(this),{signal:i}),t.addEventListener("keydown",pe(this,k5,tX).bind(this),{signal:i});const s=re(this,L2,document.createElement("span"));return s.className="swatch",s.ariaHidden="true",s.style.backgroundColor=T(this,NT),t.append(s),t}renderMainDropdown(){const t=re(this,Ba,pe(this,L5,ZY).call(this));return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}_colorSelectFromKeyboard(t){if(t.target===T(this,Ad)){pe(this,sg,w_).call(this,t);return}const i=t.target.getAttribute("data-color");i&&pe(this,D5,eX).call(this,i,t)}_moveToNext(t){var i,s;if(!T(this,Ep,n1)){pe(this,sg,w_).call(this,t);return}if(t.target===T(this,Ad)){(i=T(this,Ba).firstChild)==null||i.focus();return}(s=t.target.nextSibling)==null||s.focus()}_moveToPrevious(t){var i,s;if(t.target===((i=T(this,Ba))==null?void 0:i.firstChild)||t.target===T(this,Ad)){T(this,Ep,n1)&&this._hideDropdownFromKeyboard();return}T(this,Ep,n1)||pe(this,sg,w_).call(this,t),(s=t.target.previousSibling)==null||s.focus()}_moveToBeginning(t){var i;if(!T(this,Ep,n1)){pe(this,sg,w_).call(this,t);return}(i=T(this,Ba).firstChild)==null||i.focus()}_moveToEnd(t){var i;if(!T(this,Ep,n1)){pe(this,sg,w_).call(this,t);return}(i=T(this,Ba).lastChild)==null||i.focus()}hideDropdown(){var t,i;(t=T(this,Ba))==null||t.classList.add("hidden"),T(this,Ad).ariaExpanded="false",(i=T(this,W1))==null||i.abort(),re(this,W1,null)}_hideDropdownFromKeyboard(){var t;if(!T(this,OT)){if(!T(this,Ep,n1)){(t=T(this,rg))==null||t.unselect();return}this.hideDropdown(),T(this,Ad).focus({preventScroll:!0,focusVisible:T(this,N5)})}}updateColor(t){if(T(this,L2)&&(T(this,L2).style.backgroundColor=t),!T(this,Ba))return;const i=T(this,Yh).highlightColors.values();for(const s of T(this,Ba).children)s.ariaSelected=i.next().value===t.toUpperCase()}destroy(){var t,i;(t=T(this,Ad))==null||t.remove(),re(this,Ad,null),re(this,L2,null),(i=T(this,Ba))==null||i.remove(),re(this,Ba,null)}};Ad=new WeakMap,L2=new WeakMap,NT=new WeakMap,Ba=new WeakMap,N5=new WeakMap,OT=new WeakMap,rg=new WeakMap,O5=new WeakMap,W1=new WeakMap,Yh=new WeakMap,P5=new WeakMap,L5=new WeakSet,ZY=function(){const t=document.createElement("div"),i=T(this,Yh)._signal;t.addEventListener("contextmenu",rh,{signal:i}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),T(this,rg)&&(t.id=`${T(this,rg).id}_colorpicker_dropdown`);for(const[s,l]of T(this,Yh).highlightColors){const d=document.createElement("button");d.tabIndex="0",d.role="option",d.setAttribute("data-color",l),d.title=s,d.setAttribute("data-l10n-id",T(zc,P5)[s]);const u=document.createElement("span");d.append(u),u.className="swatch",u.style.backgroundColor=l,d.ariaSelected=l===T(this,NT),d.addEventListener("click",pe(this,D5,eX).bind(this,l),{signal:i}),t.append(d)}return t.addEventListener("keydown",pe(this,k5,tX).bind(this),{signal:i}),t},D5=new WeakSet,eX=function(t,i){i.stopPropagation(),T(this,O5).dispatch("switchannotationeditorparams",{source:this,type:cr.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)},k5=new WeakSet,tX=function(t){zc._keyboardManager.exec(this,t)},sg=new WeakSet,w_=function(t){if(T(this,Ep,n1)){this.hideDropdown();return}if(re(this,N5,t.detail===0),T(this,W1)||(re(this,W1,new AbortController),window.addEventListener("pointerdown",pe(this,B9,REe).bind(this),{signal:T(this,Yh).combinedSignal(T(this,W1))})),T(this,Ad).ariaExpanded="true",T(this,Ba)){T(this,Ba).classList.remove("hidden");return}const i=re(this,Ba,pe(this,L5,ZY).call(this));T(this,Ad).append(i)},B9=new WeakSet,REe=function(t){var i;(i=T(this,Ba))!=null&&i.contains(t.target)||this.hideDropdown()},Ep=new WeakSet,n1=function(){return T(this,Ba)&&!T(this,Ba).classList.contains("hidden")},ee(zc,P5,null);let D7=zc;var wp,M5,PT,j5;const I_=class I_{constructor(t){ee(this,wp,null);ee(this,M5,null);ee(this,PT,null);re(this,M5,t),re(this,PT,t._uiManager),T(I_,j5)||re(I_,j5,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(T(this,wp))return T(this,wp);const{editorType:t,colorType:i,colorValue:s}=T(this,M5),l=re(this,wp,document.createElement("input"));return l.type="color",l.value=s||"#000000",l.className="basicColorPicker",l.tabIndex=0,l.setAttribute("data-l10n-id",T(I_,j5)[t]),l.addEventListener("input",()=>{T(this,PT).updateParams(i,l.value)},{signal:T(this,PT)._signal}),l}update(t){T(this,wp)&&(T(this,wp).value=t)}destroy(){var t;(t=T(this,wp))==null||t.remove(),re(this,wp,null)}hideDropdown(){}};wp=new WeakMap,M5=new WeakMap,PT=new WeakMap,j5=new WeakMap,ee(I_,j5,null);let k7=I_;function Lfe(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function EI(n){return Math.max(0,Math.min(255,255*n))}class Dfe{static CMYK_G([t,i,s,l]){return["G",1-Math.min(1,.3*t+.59*s+.11*i+l)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=EI(t),[t,t,t]}static G_HTML([t]){const i=Lfe(t);return`#${i}${i}${i}`}static RGB_G([t,i,s]){return["G",.3*t+.59*i+.11*s]}static RGB_rgb(t){return t.map(EI)}static RGB_HTML(t){return`#${t.map(Lfe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,i,s,l]){return["RGB",1-Math.min(1,t+l),1-Math.min(1,s+l),1-Math.min(1,i+l)]}static CMYK_rgb([t,i,s,l]){return[EI(1-Math.min(1,t+l)),EI(1-Math.min(1,s+l)),EI(1-Math.min(1,i+l))]}static CMYK_HTML(t){const i=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([t,i,s]){const l=1-t,d=1-i,u=1-s,p=Math.min(l,d,u);return["CMYK",l,d,u,p]}}class BZe{create(t,i,s=!1){if(t<=0||i<=0)throw new Error("Invalid SVG dimensions");const l=this._createSVG("svg:svg");return l.setAttribute("version","1.1"),s||(l.setAttribute("width",`${t}px`),l.setAttribute("height",`${i}px`)),l.setAttribute("preserveAspectRatio","none"),l.setAttribute("viewBox",`0 0 ${t} ${i}`),l}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Zr("Abstract method `_createSVG` called.")}}class M7 extends BZe{_createSVG(t){return document.createElementNS(Im,t)}}class xEe{static setupStorage(t,i,s,l,d){const u=l.getValue(i,{value:null});switch(s.name){case"textarea":if(u.value!==null&&(t.textContent=u.value),d==="print")break;t.addEventListener("input",p=>{l.setValue(i,{value:p.target.value})});break;case"input":if(s.attributes.type==="radio"||s.attributes.type==="checkbox"){if(u.value===s.attributes.xfaOn?t.setAttribute("checked",!0):u.value===s.attributes.xfaOff&&t.removeAttribute("checked"),d==="print")break;t.addEventListener("change",p=>{l.setValue(i,{value:p.target.checked?p.target.getAttribute("xfaOn"):p.target.getAttribute("xfaOff")})})}else{if(u.value!==null&&t.setAttribute("value",u.value),d==="print")break;t.addEventListener("input",p=>{l.setValue(i,{value:p.target.value})})}break;case"select":if(u.value!==null){t.setAttribute("value",u.value);for(const p of s.children)p.attributes.value===u.value?p.attributes.selected=!0:p.attributes.hasOwnProperty("selected")&&delete p.attributes.selected}t.addEventListener("input",p=>{const g=p.target.options,_=g.selectedIndex===-1?"":g[g.selectedIndex].value;l.setValue(i,{value:_})});break}}static setAttributes({html:t,element:i,storage:s=null,intent:l,linkService:d}){const{attributes:u}=i,p=t instanceof HTMLAnchorElement;u.type==="radio"&&(u.name=`${u.name}-${l}`);for(const[g,_]of Object.entries(u))if(_!=null)switch(g){case"class":_.length&&t.setAttribute(g,_.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",_);break;case"style":Object.assign(t.style,_);break;case"textContent":t.textContent=_;break;default:(!p||g!=="href"&&g!=="newWindow")&&t.setAttribute(g,_)}p&&d.addLinkAttributes(t,u.href,u.newWindow),s&&u.dataId&&this.setupStorage(t,u.dataId,i,s)}static render(t){var E,b;const i=t.annotationStorage,s=t.linkService,l=t.xfaHtml,d=t.intent||"display",u=document.createElement(l.name);l.attributes&&this.setAttributes({html:u,element:l,intent:d,linkService:s});const p=d!=="richText",g=t.div;if(g.append(u),t.viewport){const A=`matrix(${t.viewport.transform.join(",")})`;g.style.transform=A}p&&g.setAttribute("class","xfaLayer xfaFont");const _=[];if(l.children.length===0){if(l.value){const A=document.createTextNode(l.value);u.append(A),p&&nN.shouldBuildText(l.name)&&_.push(A)}return{textDivs:_}}const y=[[l,-1,u]];for(;y.length>0;){const[A,N,O]=y.at(-1);if(N+1===A.children.length){y.pop();continue}const D=A.children[++y.at(-1)[1]];if(D===null)continue;const{name:P}=D;if(P==="#text"){const M=document.createTextNode(D.value);_.push(M),O.append(M);continue}const j=(E=D==null?void 0:D.attributes)!=null&&E.xmlns?document.createElementNS(D.attributes.xmlns,P):document.createElement(P);if(O.append(j),D.attributes&&this.setAttributes({html:j,element:D,storage:i,intent:d,linkService:s}),((b=D.children)==null?void 0:b.length)>0)y.push([D,-1,j]);else if(D.value){const M=document.createTextNode(D.value);p&&nN.shouldBuildText(P)&&_.push(M),j.append(M)}}for(const A of g.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))A.setAttribute("readOnly",!0);return{textDivs:_}}static update(t){const i=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=i,t.div.hidden=!1}}const VZe=9,PE=new WeakSet,zZe=new Date().getTimezoneOffset()*60*1e3;class kfe{static create(t){switch(t.data.annotationType){case Ta.LINK:return new hZ(t);case Ta.TEXT:return new HZe(t);case Ta.WIDGET:switch(t.data.fieldType){case"Tx":return new GZe(t);case"Btn":return t.data.radioButton?new NEe(t):t.data.checkBox?new $Ze(t):new KZe(t);case"Ch":return new qZe(t);case"Sig":return new WZe(t)}return new QE(t);case Ta.POPUP:return new iX(t);case Ta.FREETEXT:return new kEe(t);case Ta.LINE:return new XZe(t);case Ta.SQUARE:return new JZe(t);case Ta.CIRCLE:return new QZe(t);case Ta.POLYLINE:return new MEe(t);case Ta.CARET:return new eet(t);case Ta.INK:return new fZ(t);case Ta.POLYGON:return new ZZe(t);case Ta.HIGHLIGHT:return new jEe(t);case Ta.UNDERLINE:return new tet(t);case Ta.SQUIGGLY:return new net(t);case Ta.STRIKEOUT:return new iet(t);case Ta.STAMP:return new UEe(t);case Ta.FILEATTACHMENT:return new ret(t);default:return new ma(t)}}}var D2,LT,ag,U5,nX;const JZ=class JZ{constructor(t,{isRenderable:i=!1,ignoreBorder:s=!1,createQuadrilaterals:l=!1}={}){ee(this,U5);ee(this,D2,null);ee(this,LT,!1);ee(this,ag,null);this.isRenderable=i,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,i&&(this.container=this._createContainer(s)),l&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:i}){return!!(t!=null&&t.str||i!=null&&i.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return JZ._hasPopupData(this.data)}updateEdited(t){var d;if(!this.container)return;t.rect&&(T(this,D2)||re(this,D2,{rect:this.data.rect.slice(0)}));const{rect:i,popup:s}=t;i&&pe(this,U5,nX).call(this,i);let l=((d=T(this,ag))==null?void 0:d.popup)||this.popup;!l&&(s!=null&&s.text)&&(this._createPopup(s),l=T(this,ag).popup),l&&(l.updateEdited(t),s!=null&&s.deleted&&(l.remove(),re(this,ag,null),this.popup=null))}resetEdited(){var t;T(this,D2)&&(pe(this,U5,nX).call(this,T(this,D2).rect),(t=T(this,ag))==null||t.popup.resetEdited(),re(this,D2,null))}_createContainer(t){const{data:i,parent:{page:s,viewport:l}}=this,d=document.createElement("section");d.setAttribute("data-annotation-id",i.id),!(this instanceof QE)&&!(this instanceof hZ)&&(d.tabIndex=0);const{style:u}=d;if(u.zIndex=this.parent.zIndex++,i.alternativeText&&(d.title=i.alternativeText),i.noRotate&&d.classList.add("norotate"),!i.rect||this instanceof iX){const{rotation:O}=i;return!i.hasOwnCanvas&&O!==0&&this.setRotation(O,d),d}const{width:p,height:g}=this;if(!t&&i.borderStyle.width>0){u.borderWidth=`${i.borderStyle.width}px`;const O=i.borderStyle.horizontalCornerRadius,D=i.borderStyle.verticalCornerRadius;if(O>0||D>0){const j=`calc(${O}px * var(--total-scale-factor)) / calc(${D}px * var(--total-scale-factor))`;u.borderRadius=j}else if(this instanceof NEe){const j=`calc(${p}px * var(--total-scale-factor)) / calc(${g}px * var(--total-scale-factor))`;u.borderRadius=j}switch(i.borderStyle.style){case Hb.SOLID:u.borderStyle="solid";break;case Hb.DASHED:u.borderStyle="dashed";break;case Hb.BEVELED:Ei("Unimplemented border style: beveled");break;case Hb.INSET:Ei("Unimplemented border style: inset");break;case Hb.UNDERLINE:u.borderBottomStyle="solid";break}const P=i.borderColor||null;P?(re(this,LT,!0),u.borderColor=zn.makeHexColor(P[0]|0,P[1]|0,P[2]|0)):u.borderWidth=0}const _=zn.normalizeRect([i.rect[0],s.view[3]-i.rect[1]+s.view[1],i.rect[2],s.view[3]-i.rect[3]+s.view[1]]),{pageWidth:y,pageHeight:E,pageX:b,pageY:A}=l.rawDims;u.left=`${100*(_[0]-b)/y}%`,u.top=`${100*(_[1]-A)/E}%`;const{rotation:N}=i;return i.hasOwnCanvas||N===0?(u.width=`${100*p/y}%`,u.height=`${100*g/E}%`):this.setRotation(N,d),d}setRotation(t,i=this.container){if(!this.data.rect)return;const{pageWidth:s,pageHeight:l}=this.parent.viewport.rawDims;let{width:d,height:u}=this;t%180!==0&&([d,u]=[u,d]),i.style.width=`${100*d/s}%`,i.style.height=`${100*u/l}%`,i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(i,s,l)=>{const d=l.detail[i],u=d[0],p=d.slice(1);l.target.style[s]=Dfe[`${u}_HTML`](p),this.annotationStorage.setValue(this.data.id,{[s]:Dfe[`${u}_rgb`](p)})};return Ki(this,"_commonActions",{display:i=>{const{display:s}=i.detail,l=s%2===1;this.container.style.visibility=l?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:l,noPrint:s===1||s===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:s}=i.detail;this.container.style.visibility=s?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:s,noView:s})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{t("bgColor","backgroundColor",i)},fillColor:i=>{t("fillColor","backgroundColor",i)},fgColor:i=>{t("fgColor","color",i)},textColor:i=>{t("textColor","color",i)},borderColor:i=>{t("borderColor","borderColor",i)},strokeColor:i=>{t("strokeColor","borderColor",i)},rotation:i=>{const s=i.detail.rotation;this.setRotation(s),this.annotationStorage.setValue(this.data.id,{rotation:s})}})}_dispatchEventFromSandbox(t,i){const s=this._commonActions;for(const l of Object.keys(i.detail)){const d=t[l]||s[l];d==null||d(i)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const s=this._commonActions;for(const[l,d]of Object.entries(i)){const u=s[l];if(u){const p={detail:{[l]:d},target:t};u(p),delete i[l]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[i,s,l,d]=this.data.rect.map(O=>Math.fround(O));if(t.length===8){const[O,D,P,j]=t.subarray(2,6);if(l===O&&d===D&&i===P&&s===j)return}const{style:u}=this.container;let p;if(T(this,LT)){const{borderColor:O,borderWidth:D}=u;u.borderWidth=0,p=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${O}" stroke-width="${D}">`],this.container.classList.add("hasBorder")}const g=l-i,_=d-s,{svgFactory:y}=this,E=y.createElement("svg");E.classList.add("quadrilateralsContainer"),E.setAttribute("width",0),E.setAttribute("height",0),E.role="none";const b=y.createElement("defs");E.append(b);const A=y.createElement("clipPath"),N=`clippath_${this.data.id}`;A.setAttribute("id",N),A.setAttribute("clipPathUnits","objectBoundingBox"),b.append(A);for(let O=2,D=t.length;O<D;O+=8){const P=t[O],j=t[O+1],M=t[O+2],V=t[O+3],H=y.createElement("rect"),$=(M-i)/g,Q=(d-j)/_,Y=(P-M)/g,le=(j-V)/_;H.setAttribute("x",$),H.setAttribute("y",Q),H.setAttribute("width",Y),H.setAttribute("height",le),A.append(H),p==null||p.push(`<rect vector-effect="non-scaling-stroke" x="${$}" y="${Q}" width="${Y}" height="${le}"/>`)}T(this,LT)&&(p.push("</g></svg>')"),u.backgroundImage=p.join("")),this.container.append(E),this.container.style.clipPath=`url(#${N})`}_createPopup(t=null){const{data:i}=this;let s,l;t?(s={str:t.text},l=t.date):(s=i.contentsObj,l=i.modificationDate);const d=re(this,ag,new iX({data:{color:i.color,titleObj:i.titleObj,modificationDate:l,contentsObj:s,richText:i.richText,parentRect:i.rect,borderStyle:0,id:`popup_${i.id}`,rotation:i.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}));this.parent.div.append(d.render())}get hasPopupElement(){return!!(T(this,ag)||this.popup||this.data.popupRef)}render(){Zr("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,i=null){const s=[];if(this._fieldObjects){const l=this._fieldObjects[t];if(l)for(const{page:d,id:u,exportValues:p}of l){if(d===-1||u===i)continue;const g=typeof p=="string"?p:null,_=document.querySelector(`[data-element-id="${u}"]`);if(_&&!PE.has(_)){Ei(`_getElementsByName - element not allowed: ${u}`);continue}s.push({id:u,exportValue:g,domElement:_})}return s}for(const l of document.getElementsByName(t)){const{exportValue:d}=l,u=l.getAttribute("data-element-id");u!==i&&PE.has(l)&&s.push({id:u,exportValue:d,domElement:l})}return s}show(){var t;this.container&&(this.container.hidden=!1),(t=this.popup)==null||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),(t=this.popup)==null||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const i of t)i.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{var s;(s=this.linkService.eventBus)==null||s.dispatch("switchannotationeditormode",{source:this,mode:t,editId:i,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};D2=new WeakMap,LT=new WeakMap,ag=new WeakMap,U5=new WeakSet,nX=function(t){const{container:{style:i},data:{rect:s,rotation:l},parent:{viewport:{rawDims:{pageWidth:d,pageHeight:u,pageX:p,pageY:g}}}}=this;s==null||s.splice(0,4,...t),i.left=`${100*(t[0]-p)/d}%`,i.top=`${100*(u-t[3]+g)/u}%`,l===0?(i.width=`${100*(t[2]-t[0])/d}%`,i.height=`${100*(t[3]-t[1])/u}%`):this.setRotation(l)};let ma=JZ;var og,S_,V9,AEe,z9,IEe;class hZ extends ma{constructor(i,s=null){super(i,{isRenderable:!0,ignoreBorder:!!(s!=null&&s.ignoreBorder),createQuadrilaterals:!0});ee(this,og);ee(this,V9);ee(this,z9);this.isTooltipOnly=i.data.isTooltipOnly}render(){const{data:i,linkService:s}=this,l=document.createElement("a");l.setAttribute("data-element-id",i.id);let d=!1;return i.url?(s.addLinkAttributes(l,i.url,i.newWindow),d=!0):i.action?(this._bindNamedAction(l,i.action,i.overlaidText),d=!0):i.attachment?(pe(this,V9,AEe).call(this,l,i.attachment,i.overlaidText,i.attachmentDest),d=!0):i.setOCGState?(pe(this,z9,IEe).call(this,l,i.setOCGState,i.overlaidText),d=!0):i.dest?(this._bindLink(l,i.dest,i.overlaidText),d=!0):(i.actions&&(i.actions.Action||i.actions["Mouse Up"]||i.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(l,i),d=!0),i.resetForm?(this._bindResetFormAction(l,i.resetForm),d=!0):this.isTooltipOnly&&!d&&(this._bindLink(l,""),d=!0)),this.container.classList.add("linkAnnotation"),d&&this.container.append(l),this.container}_bindLink(i,s,l=""){i.href=this.linkService.getDestinationHash(s),i.onclick=()=>(s&&this.linkService.goToDestination(s),!1),(s||s==="")&&pe(this,og,S_).call(this),l&&(i.title=l)}_bindNamedAction(i,s,l=""){i.href=this.linkService.getAnchorUrl(""),i.onclick=()=>(this.linkService.executeNamedAction(s),!1),l&&(i.title=l),pe(this,og,S_).call(this)}_bindJSAction(i,s){i.href=this.linkService.getAnchorUrl("");const l=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const d of Object.keys(s.actions)){const u=l.get(d);u&&(i[u]=()=>{var p;return(p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:s.id,name:d}}),!1})}s.overlaidText&&(i.title=s.overlaidText),i.onclick||(i.onclick=()=>!1),pe(this,og,S_).call(this)}_bindResetFormAction(i,s){const l=i.onclick;if(l||(i.href=this.linkService.getAnchorUrl("")),pe(this,og,S_).call(this),!this._fieldObjects){Ei('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),l||(i.onclick=()=>!1);return}i.onclick=()=>{var E;l==null||l();const{fields:d,refs:u,include:p}=s,g=[];if(d.length!==0||u.length!==0){const b=new Set(u);for(const A of d){const N=this._fieldObjects[A]||[];for(const{id:O}of N)b.add(O)}for(const A of Object.values(this._fieldObjects))for(const N of A)b.has(N.id)===p&&g.push(N)}else for(const b of Object.values(this._fieldObjects))g.push(...b);const _=this.annotationStorage,y=[];for(const b of g){const{id:A}=b;switch(y.push(A),b.type){case"text":{const O=b.defaultValue||"";_.setValue(A,{value:O});break}case"checkbox":case"radiobutton":{const O=b.defaultValue===b.exportValues;_.setValue(A,{value:O});break}case"combobox":case"listbox":{const O=b.defaultValue||"";_.setValue(A,{value:O});break}default:continue}const N=document.querySelector(`[data-element-id="${A}"]`);if(N){if(!PE.has(N)){Ei(`_bindResetFormAction - element not allowed: ${A}`);continue}}else continue;N.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((E=this.linkService.eventBus)==null||E.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:y,name:"ResetForm"}})),!1}}}og=new WeakSet,S_=function(){this.container.setAttribute("data-internal-link","")},V9=new WeakSet,AEe=function(i,s,l="",d=null){i.href=this.linkService.getAnchorUrl(""),s.description?i.title=s.description:l&&(i.title=l),i.onclick=()=>{var u;return(u=this.downloadManager)==null||u.openOrDownloadData(s.content,s.filename,d),!1},pe(this,og,S_).call(this)},z9=new WeakSet,IEe=function(i,s,l=""){i.href=this.linkService.getAnchorUrl(""),i.onclick=()=>(this.linkService.executeSetOCGState(s),!1),l&&(i.title=l),pe(this,og,S_).call(this)};class HZe extends ma{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class QE extends ma{render(){return this.container}showElementAndHideCanvas(t){var i;this.data.hasOwnCanvas&&(((i=t.previousSibling)==null?void 0:i.nodeName)==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return qo.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,i,s,l,d){s.includes("mouse")?t.addEventListener(s,u=>{var p;(p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:l,value:d(u),shift:u.shiftKey,modifier:this._getKeyModifier(u)}})}):t.addEventListener(s,u=>{var p;if(s==="blur"){if(!i.focused||!u.relatedTarget)return;i.focused=!1}else if(s==="focus"){if(i.focused)return;i.focused=!0}d&&((p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:l,value:d(u)}}))})}_setEventListeners(t,i,s,l){var d,u,p;for(const[g,_]of s)(_==="Action"||(d=this.data.actions)!=null&&d[_])&&((_==="Focus"||_==="Blur")&&(i||(i={focused:!1})),this._setEventListener(t,i,g,_,l),_==="Focus"&&!((u=this.data.actions)!=null&&u.Blur)?this._setEventListener(t,i,"blur","Blur",null):_==="Blur"&&!((p=this.data.actions)!=null&&p.Focus)&&this._setEventListener(t,i,"focus","Focus",null))}_setBackgroundColor(t){const i=this.data.backgroundColor||null;t.style.backgroundColor=i===null?"transparent":zn.makeHexColor(i[0],i[1],i[2])}_setTextStyle(t){const i=["left","center","right"],{fontColor:s}=this.data.defaultAppearanceData,l=this.data.defaultAppearanceData.fontSize||VZe,d=t.style;let u;const p=2,g=_=>Math.round(10*_)/10;if(this.data.multiLine){const _=Math.abs(this.data.rect[3]-this.data.rect[1]-p),y=Math.round(_/(nK*l))||1,E=_/y;u=Math.min(l,g(E/nK))}else{const _=Math.abs(this.data.rect[3]-this.data.rect[1]-p);u=Math.min(l,g(_/nK))}d.fontSize=`calc(${u}px * var(--total-scale-factor))`,d.color=zn.makeHexColor(s[0],s[1],s[2]),this.data.textAlignment!==null&&(d.textAlign=i[this.data.textAlignment])}_setRequired(t,i){i?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",i)}}class GZe extends QE{constructor(t){const i=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:i})}setPropertyOnSiblings(t,i,s,l){const d=this.annotationStorage;for(const u of this._getElementsByName(t.name,t.id))u.domElement&&(u.domElement[i]=s),d.setValue(u.id,{[l]:s})}render(){var l,d;const t=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){const u=t.getValue(i,{value:this.data.fieldValue});let p=u.value||"";const g=t.getValue(i,{charLimit:this.data.maxLen}).charLimit;g&&p.length>g&&(p=p.slice(0,g));let _=u.formattedValue||((l=this.data.textContent)==null?void 0:l.join(`
`))||null;_&&this.data.comb&&(_=_.replaceAll(/\s+/g,""));const y={userValue:p,formattedValue:_,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(s=document.createElement("textarea"),s.textContent=_??p,this.data.doNotScroll&&(s.style.overflowY="hidden")):(s=document.createElement("input"),s.type=this.data.password?"password":"text",s.setAttribute("value",_??p),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),PE.add(s),s.setAttribute("data-element-id",i),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=0;const{datetimeFormat:E,datetimeType:b,timeStep:A}=this.data,N=!!b&&this.enableScripting;E&&(s.title=E),this._setRequired(s,this.data.required),g&&(s.maxLength=g),s.addEventListener("input",D=>{t.setValue(i,{value:D.target.value}),this.setPropertyOnSiblings(s,"value",D.target.value,"value"),y.formattedValue=null}),s.addEventListener("resetform",D=>{const P=this.data.defaultFieldValue??"";s.value=y.userValue=P,y.formattedValue=null});let O=D=>{const{formattedValue:P}=y;P!=null&&(D.target.value=P),D.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",P=>{var M;if(y.focused)return;const{target:j}=P;if(N&&(j.type=b,A&&(j.step=A)),y.userValue){const V=y.userValue;if(N)if(b==="time"){const H=new Date(V),$=[H.getHours(),H.getMinutes(),H.getSeconds()];j.value=$.map(Q=>Q.toString().padStart(2,"0")).join(":")}else j.value=new Date(V-zZe).toISOString().split(b==="date"?"T":".",1)[0];else j.value=V}y.lastCommittedValue=j.value,y.commitKey=1,(M=this.data.actions)!=null&&M.Focus||(y.focused=!0)}),s.addEventListener("updatefromsandbox",P=>{this.showElementAndHideCanvas(P.target);const j={value(M){y.userValue=M.detail.value??"",N||t.setValue(i,{value:y.userValue.toString()}),M.target.value=y.userValue},formattedValue(M){const{formattedValue:V}=M.detail;y.formattedValue=V,V!=null&&M.target!==document.activeElement&&(M.target.value=V);const H={formattedValue:V};N&&(H.value=V),t.setValue(i,H)},selRange(M){M.target.setSelectionRange(...M.detail.selRange)},charLimit:M=>{var Q;const{charLimit:V}=M.detail,{target:H}=M;if(V===0){H.removeAttribute("maxLength");return}H.setAttribute("maxLength",V);let $=y.userValue;!$||$.length<=V||($=$.slice(0,V),H.value=y.userValue=$,t.setValue(i,{value:$}),(Q=this.linkService.eventBus)==null||Q.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:$,willCommit:!0,commitKey:1,selStart:H.selectionStart,selEnd:H.selectionEnd}}))}};this._dispatchEventFromSandbox(j,P)}),s.addEventListener("keydown",P=>{var V;y.commitKey=1;let j=-1;if(P.key==="Escape"?j=0:P.key==="Enter"&&!this.data.multiLine?j=2:P.key==="Tab"&&(y.commitKey=3),j===-1)return;const{value:M}=P.target;y.lastCommittedValue!==M&&(y.lastCommittedValue=M,y.userValue=M,(V=this.linkService.eventBus)==null||V.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:M,willCommit:!0,commitKey:j,selStart:P.target.selectionStart,selEnd:P.target.selectionEnd}}))});const D=O;O=null,s.addEventListener("blur",P=>{var V,H;if(!y.focused||!P.relatedTarget)return;(V=this.data.actions)!=null&&V.Blur||(y.focused=!1);const{target:j}=P;let{value:M}=j;if(N){if(M&&b==="time"){const $=M.split(":").map(Q=>parseInt(Q,10));M=new Date(2e3,0,1,$[0],$[1],$[2]||0).valueOf(),j.step=""}else M=new Date(M).valueOf();j.type="text"}y.userValue=M,y.lastCommittedValue!==M&&((H=this.linkService.eventBus)==null||H.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:M,willCommit:!0,commitKey:y.commitKey,selStart:P.target.selectionStart,selEnd:P.target.selectionEnd}})),D(P)}),(d=this.data.actions)!=null&&d.Keystroke&&s.addEventListener("beforeinput",P=>{var le;y.lastCommittedValue=null;const{data:j,target:M}=P,{value:V,selectionStart:H,selectionEnd:$}=M;let Q=H,Y=$;switch(P.inputType){case"deleteWordBackward":{const ae=V.substring(0,H).match(/\w*[^\w]*$/);ae&&(Q-=ae[0].length);break}case"deleteWordForward":{const ae=V.substring(H).match(/^[^\w]*\w*/);ae&&(Y+=ae[0].length);break}case"deleteContentBackward":H===$&&(Q-=1);break;case"deleteContentForward":H===$&&(Y+=1);break}P.preventDefault(),(le=this.linkService.eventBus)==null||le.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:V,change:j||"",willCommit:!1,selStart:Q,selEnd:Y}})}),this._setEventListeners(s,y,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],P=>P.target.value)}if(O&&s.addEventListener("blur",O),this.data.comb){const P=(this.data.rect[2]-this.data.rect[0])/g;s.classList.add("comb"),s.style.letterSpacing=`calc(${P}px * var(--total-scale-factor) - 1ch)`}}else s=document.createElement("div"),s.textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell",this.data.hasOwnCanvas&&(s.hidden=!0);return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class WZe extends QE{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class $Ze extends QE{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,i=this.data,s=i.id;let l=t.getValue(s,{value:i.exportValue===i.fieldValue}).value;typeof l=="string"&&(l=l!=="Off",t.setValue(s,{value:l})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const d=document.createElement("input");return PE.add(d),d.setAttribute("data-element-id",s),d.disabled=i.readOnly,this._setRequired(d,this.data.required),d.type="checkbox",d.name=i.fieldName,l&&d.setAttribute("checked",!0),d.setAttribute("exportValue",i.exportValue),d.tabIndex=0,d.addEventListener("change",u=>{const{name:p,checked:g}=u.target;for(const _ of this._getElementsByName(p,s)){const y=g&&_.exportValue===i.exportValue;_.domElement&&(_.domElement.checked=y),t.setValue(_.id,{value:y})}t.setValue(s,{value:g})}),d.addEventListener("resetform",u=>{const p=i.defaultFieldValue||"Off";u.target.checked=p===i.exportValue}),this.enableScripting&&this.hasJSActions&&(d.addEventListener("updatefromsandbox",u=>{const p={value(g){g.target.checked=g.detail.value!=="Off",t.setValue(s,{value:g.target.checked})}};this._dispatchEventFromSandbox(p,u)}),this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],u=>u.target.checked)),this._setBackgroundColor(d),this._setDefaultPropertiesFromJS(d),this.container.append(d),this.container}}class NEe extends QE{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,i=this.data,s=i.id;let l=t.getValue(s,{value:i.fieldValue===i.buttonValue}).value;if(typeof l=="string"&&(l=l!==i.buttonValue,t.setValue(s,{value:l})),l)for(const u of this._getElementsByName(i.fieldName,s))t.setValue(u.id,{value:!1});const d=document.createElement("input");if(PE.add(d),d.setAttribute("data-element-id",s),d.disabled=i.readOnly,this._setRequired(d,this.data.required),d.type="radio",d.name=i.fieldName,l&&d.setAttribute("checked",!0),d.tabIndex=0,d.addEventListener("change",u=>{const{name:p,checked:g}=u.target;for(const _ of this._getElementsByName(p,s))t.setValue(_.id,{value:!1});t.setValue(s,{value:g})}),d.addEventListener("resetform",u=>{const p=i.defaultFieldValue;u.target.checked=p!=null&&p===i.buttonValue}),this.enableScripting&&this.hasJSActions){const u=i.buttonValue;d.addEventListener("updatefromsandbox",p=>{const g={value:_=>{const y=u===_.detail.value;for(const E of this._getElementsByName(_.target.name)){const b=y&&E.id===s;E.domElement&&(E.domElement.checked=b),t.setValue(E.id,{value:b})}}};this._dispatchEventFromSandbox(g,p)}),this._setEventListeners(d,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],p=>p.target.checked)}return this._setBackgroundColor(d),this._setDefaultPropertiesFromJS(d),this.container.append(d),this.container}}class KZe extends hZ{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const i=t.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",s=>{this._dispatchEventFromSandbox({},s)})),t}}class qZe extends QE{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,i=this.data.id,s=t.getValue(i,{value:this.data.fieldValue}),l=document.createElement("select");PE.add(l),l.setAttribute("data-element-id",i),l.disabled=this.data.readOnly,this._setRequired(l,this.data.required),l.name=this.data.fieldName,l.tabIndex=0;let d=this.data.combo&&this.data.options.length>0;this.data.combo||(l.size=this.data.options.length,this.data.multiSelect&&(l.multiple=!0)),l.addEventListener("resetform",y=>{const E=this.data.defaultFieldValue;for(const b of l.options)b.selected=b.value===E});for(const y of this.data.options){const E=document.createElement("option");E.textContent=y.displayValue,E.value=y.exportValue,s.value.includes(y.exportValue)&&(E.setAttribute("selected",!0),d=!1),l.append(E)}let u=null;if(d){const y=document.createElement("option");y.value=" ",y.setAttribute("hidden",!0),y.setAttribute("selected",!0),l.prepend(y),u=()=>{y.remove(),l.removeEventListener("input",u),u=null},l.addEventListener("input",u)}const p=y=>{const E=y?"value":"textContent",{options:b,multiple:A}=l;return A?Array.prototype.filter.call(b,N=>N.selected).map(N=>N[E]):b.selectedIndex===-1?null:b[b.selectedIndex][E]};let g=p(!1);const _=y=>{const E=y.target.options;return Array.prototype.map.call(E,b=>({displayValue:b.textContent,exportValue:b.value}))};return this.enableScripting&&this.hasJSActions?(l.addEventListener("updatefromsandbox",y=>{const E={value(b){u==null||u();const A=b.detail.value,N=new Set(Array.isArray(A)?A:[A]);for(const O of l.options)O.selected=N.has(O.value);t.setValue(i,{value:p(!0)}),g=p(!1)},multipleSelection(b){l.multiple=!0},remove(b){const A=l.options,N=b.detail.remove;A[N].selected=!1,l.remove(N),A.length>0&&Array.prototype.findIndex.call(A,D=>D.selected)===-1&&(A[0].selected=!0),t.setValue(i,{value:p(!0),items:_(b)}),g=p(!1)},clear(b){for(;l.length!==0;)l.remove(0);t.setValue(i,{value:null,items:[]}),g=p(!1)},insert(b){const{index:A,displayValue:N,exportValue:O}=b.detail.insert,D=l.children[A],P=document.createElement("option");P.textContent=N,P.value=O,D?D.before(P):l.append(P),t.setValue(i,{value:p(!0),items:_(b)}),g=p(!1)},items(b){const{items:A}=b.detail;for(;l.length!==0;)l.remove(0);for(const N of A){const{displayValue:O,exportValue:D}=N,P=document.createElement("option");P.textContent=O,P.value=D,l.append(P)}l.options.length>0&&(l.options[0].selected=!0),t.setValue(i,{value:p(!0),items:_(b)}),g=p(!1)},indices(b){const A=new Set(b.detail.indices);for(const N of b.target.options)N.selected=A.has(N.index);t.setValue(i,{value:p(!0)}),g=p(!1)},editable(b){b.target.disabled=!b.detail.editable}};this._dispatchEventFromSandbox(E,y)}),l.addEventListener("input",y=>{var A;const E=p(!0),b=p(!1);t.setValue(i,{value:E}),y.preventDefault(),(A=this.linkService.eventBus)==null||A.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:g,change:b,changeEx:E,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(l,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],y=>y.target.value)):l.addEventListener("input",function(y){t.setValue(i,{value:p(!0)})}),this.data.combo&&this._setTextStyle(l),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class iX extends ma{constructor(t){const{data:i,elements:s}=t;super(t,{isRenderable:ma._hasPopupData(i)}),this.elements=s,this.popup=null}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const i=this.popup=new YZe({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),s=[];for(const l of this.elements)l.popup=i,l.container.ariaHasPopup="dialog",s.push(l.data.id),l.addHighlightArea();return this.container.setAttribute("aria-controls",s.map(l=>`${aZ}${l}`).join(",")),this.container}}var DT,H9,G9,kT,MT,Qs,lg,$1,jT,F5,UT,Sp,Id,K1,cg,B5,dg,FT,k2,q1,BT,vM,VT,yM,V5,rX,W9,OEe,$9,PEe,K9,LEe,q9,DEe,zT,_M,HT,EM,z5,sX;class YZe{constructor({container:t,color:i,elements:s,titleObj:l,modificationDate:d,contentsObj:u,richText:p,parent:g,rect:_,parentRect:y,open:E}){ee(this,BT);ee(this,VT);ee(this,V5);ee(this,W9);ee(this,$9);ee(this,K9);ee(this,q9);ee(this,zT);ee(this,HT);ee(this,z5);ee(this,DT,pe(this,K9,LEe).bind(this));ee(this,H9,pe(this,z5,sX).bind(this));ee(this,G9,pe(this,HT,EM).bind(this));ee(this,kT,pe(this,zT,_M).bind(this));ee(this,MT,null);ee(this,Qs,null);ee(this,lg,null);ee(this,$1,null);ee(this,jT,null);ee(this,F5,null);ee(this,UT,null);ee(this,Sp,!1);ee(this,Id,null);ee(this,K1,null);ee(this,cg,null);ee(this,B5,null);ee(this,dg,null);ee(this,FT,null);ee(this,k2,null);ee(this,q1,!1);re(this,Qs,t),re(this,FT,l),re(this,lg,u),re(this,dg,p),re(this,F5,g),re(this,MT,i),re(this,B5,_),re(this,UT,y),re(this,jT,s),re(this,$1,O7.toDateObject(d)),this.trigger=s.flatMap(b=>b.getElementsToTriggerPopup()),pe(this,BT,vM).call(this),T(this,Qs).hidden=!0,E&&pe(this,zT,_M).call(this)}render(){var l;if(T(this,Id))return;const t=re(this,Id,document.createElement("div"));if(t.className="popup",T(this,MT)){const d=t.style.outlineColor=zn.makeHexColor(...T(this,MT));t.style.backgroundColor=`color-mix(in srgb, ${d} 30%, white)`}const i=document.createElement("span");if(i.className="header",(l=T(this,FT))!=null&&l.str){const d=document.createElement("span");d.className="title",i.append(d),{dir:d.dir,str:d.textContent}=T(this,FT)}if(t.append(i),T(this,$1)){const d=document.createElement("time");d.className="popupDate",d.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),d.setAttribute("data-l10n-args",JSON.stringify({dateObj:T(this,$1).valueOf()})),d.dateTime=T(this,$1).toISOString(),i.append(d)}const s=T(this,VT,yM);if(s)xEe.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const d=this._formatContents(T(this,lg));t.append(d)}T(this,Qs).append(t)}_formatContents({str:t,dir:i}){const s=document.createElement("p");s.classList.add("popupContent"),s.dir=i;const l=t.split(/(?:\r\n?|\n)/);for(let d=0,u=l.length;d<u;++d){const p=l[d];s.append(document.createTextNode(p)),d<u-1&&s.append(document.createElement("br"))}return s}updateEdited({rect:t,popup:i,deleted:s}){var l;if(s||i!=null&&i.deleted){this.remove();return}pe(this,BT,vM).call(this),T(this,k2)||re(this,k2,{contentsObj:T(this,lg),richText:T(this,dg)}),t&&re(this,cg,null),i&&(re(this,dg,pe(this,$9,PEe).call(this,i.text)),re(this,$1,O7.toDateObject(i.date)),re(this,lg,null)),(l=T(this,Id))==null||l.remove(),re(this,Id,null)}resetEdited(){var t;T(this,k2)&&({contentsObj:ao(this,lg)._,richText:ao(this,dg)._}=T(this,k2),re(this,k2,null),(t=T(this,Id))==null||t.remove(),re(this,Id,null),re(this,cg,null))}remove(){var t,i;(t=T(this,K1))==null||t.abort(),re(this,K1,null),(i=T(this,Id))==null||i.remove(),re(this,Id,null),re(this,q1,!1),re(this,Sp,!1);for(const s of this.trigger)s.classList.remove("popupTriggerArea")}forceHide(){re(this,q1,this.isVisible),T(this,q1)&&(T(this,Qs).hidden=!0)}maybeShow(){pe(this,BT,vM).call(this),T(this,q1)&&(T(this,Id)||pe(this,HT,EM).call(this),re(this,q1,!1),T(this,Qs).hidden=!1)}get isVisible(){return T(this,Qs).hidden===!1}}DT=new WeakMap,H9=new WeakMap,G9=new WeakMap,kT=new WeakMap,MT=new WeakMap,Qs=new WeakMap,lg=new WeakMap,$1=new WeakMap,jT=new WeakMap,F5=new WeakMap,UT=new WeakMap,Sp=new WeakMap,Id=new WeakMap,K1=new WeakMap,cg=new WeakMap,B5=new WeakMap,dg=new WeakMap,FT=new WeakMap,k2=new WeakMap,q1=new WeakMap,BT=new WeakSet,vM=function(){var i;if(T(this,K1))return;re(this,K1,new AbortController);const{signal:t}=T(this,K1);for(const s of this.trigger)s.addEventListener("click",T(this,kT),{signal:t}),s.addEventListener("mouseenter",T(this,G9),{signal:t}),s.addEventListener("mouseleave",T(this,H9),{signal:t}),s.classList.add("popupTriggerArea");for(const s of T(this,jT))(i=s.container)==null||i.addEventListener("keydown",T(this,DT),{signal:t})},VT=new WeakSet,yM=function(){const t=T(this,dg),i=T(this,lg);return t!=null&&t.str&&(!(i!=null&&i.str)||i.str===t.str)&&T(this,dg).html||null},V5=new WeakSet,rX=function(){var t,i,s;return((s=(i=(t=T(this,VT,yM))==null?void 0:t.attributes)==null?void 0:i.style)==null?void 0:s.fontSize)||0},W9=new WeakSet,OEe=function(){var t,i,s;return((s=(i=(t=T(this,VT,yM))==null?void 0:t.attributes)==null?void 0:i.style)==null?void 0:s.color)||null},$9=new WeakSet,PEe=function(t){const i=[],s={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},l={style:{color:T(this,W9,OEe),fontSize:T(this,V5,rX)?`calc(${T(this,V5,rX)}px * var(--total-scale-factor))`:""}};for(const d of t.split(`
`))i.push({name:"span",value:d,attributes:l});return s},K9=new WeakSet,LEe=function(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||(t.key==="Enter"||t.key==="Escape"&&T(this,Sp))&&pe(this,zT,_M).call(this)},q9=new WeakSet,DEe=function(){if(T(this,cg)!==null)return;const{page:{view:t},viewport:{rawDims:{pageWidth:i,pageHeight:s,pageX:l,pageY:d}}}=T(this,F5);let u=!!T(this,UT),p=u?T(this,UT):T(this,B5);for(const N of T(this,jT))if(!p||zn.intersect(N.data.rect,p)!==null){p=N.data.rect,u=!0;break}const g=zn.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),y=u?p[2]-p[0]+5:0,E=g[0]+y,b=g[1];re(this,cg,[100*(E-l)/i,100*(b-d)/s]);const{style:A}=T(this,Qs);A.left=`${T(this,cg)[0]}%`,A.top=`${T(this,cg)[1]}%`},zT=new WeakSet,_M=function(){re(this,Sp,!T(this,Sp)),T(this,Sp)?(pe(this,HT,EM).call(this),T(this,Qs).addEventListener("click",T(this,kT)),T(this,Qs).addEventListener("keydown",T(this,DT))):(pe(this,z5,sX).call(this),T(this,Qs).removeEventListener("click",T(this,kT)),T(this,Qs).removeEventListener("keydown",T(this,DT)))},HT=new WeakSet,EM=function(){T(this,Id)||this.render(),this.isVisible?T(this,Sp)&&T(this,Qs).classList.add("focused"):(pe(this,q9,DEe).call(this),T(this,Qs).hidden=!1,T(this,Qs).style.zIndex=parseInt(T(this,Qs).style.zIndex)+1e3)},z5=new WeakSet,sX=function(){T(this,Qs).classList.remove("focused"),!(T(this,Sp)||!this.isVisible)&&(T(this,Qs).hidden=!0,T(this,Qs).style.zIndex=parseInt(T(this,Qs).style.zIndex)-1e3)};class kEe extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=_i.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const i of this.textContent){const s=document.createElement("span");s.textContent=i,t.append(s)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var H5;class XZe extends ma{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});ee(this,H5,null)}render(){this.container.classList.add("lineAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=re(this,H5,this.svgFactory.createElement("svg:line"));return u.setAttribute("x1",i.rect[2]-i.lineCoordinates[0]),u.setAttribute("y1",i.rect[3]-i.lineCoordinates[1]),u.setAttribute("x2",i.rect[2]-i.lineCoordinates[2]),u.setAttribute("y2",i.rect[3]-i.lineCoordinates[3]),u.setAttribute("stroke-width",i.borderStyle.width||1),u.setAttribute("stroke","transparent"),u.setAttribute("fill","transparent"),d.append(u),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return T(this,H5)}addHighlightArea(){this.container.classList.add("highlightArea")}}H5=new WeakMap;var G5;class JZe extends ma{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});ee(this,G5,null)}render(){this.container.classList.add("squareAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=i.borderStyle.width,p=re(this,G5,this.svgFactory.createElement("svg:rect"));return p.setAttribute("x",u/2),p.setAttribute("y",u/2),p.setAttribute("width",s-u),p.setAttribute("height",l-u),p.setAttribute("stroke-width",u||1),p.setAttribute("stroke","transparent"),p.setAttribute("fill","transparent"),d.append(p),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return T(this,G5)}addHighlightArea(){this.container.classList.add("highlightArea")}}G5=new WeakMap;var W5;class QZe extends ma{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});ee(this,W5,null)}render(){this.container.classList.add("circleAnnotation");const{data:i,width:s,height:l}=this,d=this.svgFactory.create(s,l,!0),u=i.borderStyle.width,p=re(this,W5,this.svgFactory.createElement("svg:ellipse"));return p.setAttribute("cx",s/2),p.setAttribute("cy",l/2),p.setAttribute("rx",s/2-u/2),p.setAttribute("ry",l/2-u/2),p.setAttribute("stroke-width",u||1),p.setAttribute("stroke","transparent"),p.setAttribute("fill","transparent"),d.append(p),this.container.append(d),!i.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return T(this,W5)}addHighlightArea(){this.container.classList.add("highlightArea")}}W5=new WeakMap;var $5;class MEe extends ma{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});ee(this,$5,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:i,vertices:s,borderStyle:l,popupRef:d},width:u,height:p}=this;if(!s)return this.container;const g=this.svgFactory.create(u,p,!0);let _=[];for(let E=0,b=s.length;E<b;E+=2){const A=s[E]-i[0],N=i[3]-s[E+1];_.push(`${A},${N}`)}_=_.join(" ");const y=re(this,$5,this.svgFactory.createElement(this.svgElementName));return y.setAttribute("points",_),y.setAttribute("stroke-width",l.width||1),y.setAttribute("stroke","transparent"),y.setAttribute("fill","transparent"),g.append(y),this.container.append(g),!d&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return T(this,$5)}addHighlightArea(){this.container.classList.add("highlightArea")}}$5=new WeakMap;class ZZe extends MEe{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class eet extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var K5,M2,q5,aX;class fZ extends ma{constructor(i){super(i,{isRenderable:!0,ignoreBorder:!0});ee(this,q5);ee(this,K5,null);ee(this,M2,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?_i.HIGHLIGHT:_i.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:i,rotation:s,inkLists:l,borderStyle:d,popupRef:u}}=this,{transform:p,width:g,height:_}=pe(this,q5,aX).call(this,s,i),y=this.svgFactory.create(g,_,!0),E=re(this,K5,this.svgFactory.createElement("svg:g"));y.append(E),E.setAttribute("stroke-width",d.width||1),E.setAttribute("stroke-linecap","round"),E.setAttribute("stroke-linejoin","round"),E.setAttribute("stroke-miterlimit",10),E.setAttribute("stroke","transparent"),E.setAttribute("fill","transparent"),E.setAttribute("transform",p);for(let b=0,A=l.length;b<A;b++){const N=this.svgFactory.createElement(this.svgElementName);T(this,M2).push(N),N.setAttribute("points",l[b].join(",")),E.append(N)}return!u&&this.hasPopupData&&this._createPopup(),this.container.append(y),this._editOnDoubleClick(),this.container}updateEdited(i){super.updateEdited(i);const{thickness:s,points:l,rect:d}=i,u=T(this,K5);if(s>=0&&u.setAttribute("stroke-width",s||1),l)for(let p=0,g=T(this,M2).length;p<g;p++)T(this,M2)[p].setAttribute("points",l[p].join(","));if(d){const{transform:p,width:g,height:_}=pe(this,q5,aX).call(this,this.data.rotation,d);u.parentElement.setAttribute("viewBox",`0 0 ${g} ${_}`),u.setAttribute("transform",p)}}getElementsToTriggerPopup(){return T(this,M2)}addHighlightArea(){this.container.classList.add("highlightArea")}}K5=new WeakMap,M2=new WeakMap,q5=new WeakSet,aX=function(i,s){switch(i){case 90:return{transform:`rotate(90) translate(${-s[0]},${s[1]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};case 180:return{transform:`rotate(180) translate(${-s[2]},${s[1]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]};case 270:return{transform:`rotate(270) translate(${-s[2]},${s[3]}) scale(1,-1)`,width:s[3]-s[1],height:s[2]-s[0]};default:return{transform:`translate(${-s[0]},${s[3]}) scale(1,-1)`,width:s[2]-s[0],height:s[3]-s[1]}}};class jEe extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=_i.HIGHLIGHT}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),t){const s=document.createElement("mark");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class tet extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class net extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),t){const s=document.createElement("u");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class iet extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){const{data:{overlaidText:t,popupRef:i}}=this;if(!i&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),t){const s=document.createElement("s");s.classList.add("overlaidText"),s.textContent=t,this.container.append(s)}return this.container}}class UEe extends ma{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=_i.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}var Y5,X5,oX;class ret extends ma{constructor(i){var l;super(i,{isRenderable:!0});ee(this,X5);ee(this,Y5,null);const{file:s}=this.data;this.filename=s.filename,this.content=s.content,(l=this.linkService.eventBus)==null||l.dispatch("fileattachmentannotation",{source:this,...s})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:i,data:s}=this;let l;s.hasAppearance||s.fillAlpha===0?l=document.createElement("div"):(l=document.createElement("img"),l.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(s.name)?"paperclip":"pushpin"}.svg`,s.fillAlpha&&s.fillAlpha<1&&(l.style=`filter: opacity(${Math.round(s.fillAlpha*100)}%);`)),l.addEventListener("dblclick",pe(this,X5,oX).bind(this)),re(this,Y5,l);const{isMac:d}=qo.platform;return i.addEventListener("keydown",u=>{u.key==="Enter"&&(d?u.metaKey:u.ctrlKey)&&pe(this,X5,oX).call(this)}),!s.popupRef&&this.hasPopupData?this._createPopup():l.classList.add("popupTriggerArea"),i.append(l),i}getElementsToTriggerPopup(){return T(this,Y5)}addHighlightArea(){this.container.classList.add("highlightArea")}}Y5=new WeakMap,X5=new WeakSet,oX=function(){var i;(i=this.downloadManager)==null||i.openOrDownloadData(this.content,this.filename)};var J5,j2,Y1,Q5,Z5,cX,eO,dX;const QZ=class QZ{constructor({div:t,accessibilityManager:i,annotationCanvasMap:s,annotationEditorUIManager:l,page:d,viewport:u,structTreeLayer:p}){ee(this,Z5);ee(this,eO);ee(this,J5,null);ee(this,j2,null);ee(this,Y1,new Map);ee(this,Q5,null);this.div=t,re(this,J5,i),re(this,j2,s),re(this,Q5,p||null),this.page=d,this.viewport=u,this.zIndex=0,this._annotationEditorUIManager=l}hasEditableAnnotations(){return T(this,Y1).size>0}async render(t){var u;const{annotations:i}=t,s=this.div;NE(s,this.viewport);const l=new Map,d={data:null,layer:s,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:t.renderForms!==!1,svgFactory:new M7,annotationStorage:t.annotationStorage||new cZ,enableScripting:t.enableScripting===!0,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const p of i){if(p.noHTML)continue;const g=p.annotationType===Ta.POPUP;if(g){const E=l.get(p.id);if(!E)continue;d.elements=E}else if(p.rect[2]===p.rect[0]||p.rect[3]===p.rect[1])continue;d.data=p;const _=kfe.create(d);if(!_.isRenderable)continue;if(!g&&p.popupRef){const E=l.get(p.popupRef);E?E.push(_):l.set(p.popupRef,[_])}const y=_.render();p.hidden&&(y.style.visibility="hidden"),await pe(this,Z5,cX).call(this,y,p.id,d.elements),_._isEditable&&(T(this,Y1).set(_.data.id,_),(u=this._annotationEditorUIManager)==null||u.renderAnnotationElement(_))}pe(this,eO,dX).call(this)}async addLinkAnnotations(t,i){const s={data:null,layer:this.div,linkService:i,svgFactory:new M7,parent:this};for(const l of t){l.borderStyle||(l.borderStyle=QZ._defaultBorderStyle),s.data=l;const d=kfe.create(s);if(!d.isRenderable)continue;const u=d.render();await pe(this,Z5,cX).call(this,u,l.id,null)}}update({viewport:t}){const i=this.div;this.viewport=t,NE(i,{rotation:t.rotation}),pe(this,eO,dX).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(T(this,Y1).values())}getEditableAnnotation(t){return T(this,Y1).get(t)}static get _defaultBorderStyle(){return Ki(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Hb.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};J5=new WeakMap,j2=new WeakMap,Y1=new WeakMap,Q5=new WeakMap,Z5=new WeakSet,cX=async function(t,i,s){var p,g;const l=t.firstChild||t,d=l.id=`${aZ}${i}`,u=await((p=T(this,Q5))==null?void 0:p.getAriaAttributes(d));if(u)for(const[_,y]of u)l.setAttribute(_,y);s?s.at(-1).container.after(t):(this.div.append(t),(g=T(this,J5))==null||g.moveElementInDOM(this.div,t,l,!1))},eO=new WeakSet,dX=function(){var i;if(!T(this,j2))return;const t=this.div;for(const[s,l]of T(this,j2)){const d=t.querySelector(`[data-annotation-id="${s}"]`);if(!d)continue;l.className="annotationContent";const{firstChild:u}=d;u?u.nodeName==="CANVAS"?u.replaceWith(l):u.classList.contains("annotationContent")?u.after(l):u.before(l):d.append(l);const p=T(this,Y1).get(s);p&&(p._hasNoCanvas?((i=this._annotationEditorUIManager)==null||i.setMissingCanvas(s,d.id,l),p._hasNoCanvas=!1):p.canvas=l)}T(this,j2).clear()};let lX=QZ;const Ok=/\r\n?|\n/g;var Gu,Nd,tO,U2,Od,Y9,FEe,X9,BEe,J9,VEe,GT,wM,WT,SM,$T,bM,Q9,zEe,nO,hX,Z9,HEe;const rs=class rs extends ds{constructor(i){super({...i,name:"freeTextEditor"});ee(this,Y9);ee(this,X9);ee(this,J9);ee(this,GT);ee(this,$T);ee(this,Q9);ee(this,Z9);ee(this,Gu,void 0);ee(this,Nd,"");ee(this,tO,`${this.id}-editor`);ee(this,U2,null);ee(this,Od,void 0);sn(this,"_colorPicker",null);re(this,Gu,i.color||rs._defaultColor||ds._defaultLineColor),re(this,Od,i.fontSize||rs._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert")}static get _keyboardManager(){const i=rs.prototype,s=u=>u.isEmpty(),l=OE.TRANSLATE_SMALL,d=OE.TRANSLATE_BIG;return Ki(this,"_keyboardManager",new iP([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],i.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],i.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],i._translateEmpty,{args:[-l,0],checker:s}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],i._translateEmpty,{args:[-d,0],checker:s}],[["ArrowRight","mac+ArrowRight"],i._translateEmpty,{args:[l,0],checker:s}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],i._translateEmpty,{args:[d,0],checker:s}],[["ArrowUp","mac+ArrowUp"],i._translateEmpty,{args:[0,-l],checker:s}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],i._translateEmpty,{args:[0,-d],checker:s}],[["ArrowDown","mac+ArrowDown"],i._translateEmpty,{args:[0,l],checker:s}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],i._translateEmpty,{args:[0,d],checker:s}]]))}static initialize(i,s){ds.initialize(i,s);const l=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(l.getPropertyValue("--freetext-padding"))}static updateDefaultParams(i,s){switch(i){case cr.FREETEXT_SIZE:rs._defaultFontSize=s;break;case cr.FREETEXT_COLOR:rs._defaultColor=s;break}}updateParams(i,s){switch(i){case cr.FREETEXT_SIZE:pe(this,Y9,FEe).call(this,s);break;case cr.FREETEXT_COLOR:pe(this,X9,BEe).call(this,s);break}}static get defaultPropertiesToUpdate(){return[[cr.FREETEXT_SIZE,rs._defaultFontSize],[cr.FREETEXT_COLOR,rs._defaultColor||ds._defaultLineColor]]}get propertiesToUpdate(){return[[cr.FREETEXT_SIZE,T(this,Od)],[cr.FREETEXT_COLOR,T(this,Gu)]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new k7(this)),[["colorPicker",this._colorPicker]]}get colorType(){return cr.FREETEXT_COLOR}get colorValue(){return T(this,Gu)}_translateEmpty(i,s){this._uiManager.translateSelectedEditors(i,s,!0)}getInitialTranslation(){const i=this.parentScale;return[-rs._internalPadding*i,-(rs._internalPadding+T(this,Od))*i]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),re(this,U2,new AbortController);const i=this._uiManager.combinedSignal(T(this,U2));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:i}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:i}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:i}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:i}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:i}),!0}disableEditMode(){var i;return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",T(this,tO)),this._isDraggable=!0,(i=T(this,U2))==null||i.abort(),re(this,U2,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(i){this._focusEventsAllowed&&(super.focusin(i),i.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(i){var s;this.width||(this.enableEditMode(),i&&this.editorDiv.focus(),(s=this._initialOptions)!=null&&s.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const i=T(this,Nd),s=re(this,Nd,pe(this,J9,VEe).call(this).trimEnd());if(i===s)return;const l=d=>{if(re(this,Nd,d),!d){this.remove();return}pe(this,$T,bM).call(this),this._uiManager.rebuild(this),pe(this,GT,wM).call(this)};this.addCommands({cmd:()=>{l(s)},undo:()=>{l(i)},mustExec:!1}),pe(this,GT,wM).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(i){i.target===this.div&&i.key==="Enter"&&(this.enterInEditMode(),i.preventDefault())}editorDivKeydown(i){rs._keyboardManager.exec(this,i)}editorDivFocus(i){this.isEditing=!0}editorDivBlur(i){this.isEditing=!1}editorDivInput(i){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let i,s;(this._isCopy||this.annotationElementId)&&(i=this.x,s=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",T(this,tO)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:l}=this.editorDiv;if(l.fontSize=`calc(${T(this,Od)}px * var(--total-scale-factor))`,l.color=T(this,Gu),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){const[d,u]=this.parentDimensions;if(this.annotationElementId){const{position:p}=this._initialData;let[g,_]=this.getInitialTranslation();[g,_]=this.pageTranslationToScreen(g,_);const[y,E]=this.pageDimensions,[b,A]=this.pageTranslation;let N,O;switch(this.rotation){case 0:N=i+(p[0]-b)/y,O=s+this.height-(p[1]-A)/E;break;case 90:N=i+(p[0]-b)/y,O=s-(p[1]-A)/E,[g,_]=[_,-g];break;case 180:N=i-this.width+(p[0]-b)/y,O=s-(p[1]-A)/E,[g,_]=[-g,-_];break;case 270:N=i+(p[0]-b-this.height*E)/y,O=s+(p[1]-A-this.width*y)/E,[g,_]=[-_,g];break}this.setAt(N*d,O*u,g,_)}else this._moveAfterPaste(i,s);pe(this,$T,bM).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(i){var N,O,D;const s=i.clipboardData||window.clipboardData,{types:l}=s;if(l.length===1&&l[0]==="text/plain")return;i.preventDefault();const d=pe(N=rs,nO,hX).call(N,s.getData("text")||"").replaceAll(Ok,`
`);if(!d)return;const u=window.getSelection();if(!u.rangeCount)return;this.editorDiv.normalize(),u.deleteFromDocument();const p=u.getRangeAt(0);if(!d.includes(`
`)){p.insertNode(document.createTextNode(d)),this.editorDiv.normalize(),u.collapseToStart();return}const{startContainer:g,startOffset:_}=p,y=[],E=[];if(g.nodeType===Node.TEXT_NODE){const P=g.parentElement;if(E.push(g.nodeValue.slice(_).replaceAll(Ok,"")),P!==this.editorDiv){let j=y;for(const M of this.editorDiv.childNodes){if(M===P){j=E;continue}j.push(pe(O=rs,WT,SM).call(O,M))}}y.push(g.nodeValue.slice(0,_).replaceAll(Ok,""))}else if(g===this.editorDiv){let P=y,j=0;for(const M of this.editorDiv.childNodes)j++===_&&(P=E),P.push(pe(D=rs,WT,SM).call(D,M))}re(this,Nd,`${y.join(`
`)}${d}${E.join(`
`)}`),pe(this,$T,bM).call(this);const b=new Range;let A=Math.sumPrecise(y.map(P=>P.length));for(const{firstChild:P}of this.editorDiv.childNodes)if(P.nodeType===Node.TEXT_NODE){const j=P.nodeValue.length;if(A<=j){b.setStart(P,A),b.setEnd(P,A);break}A-=j}u.removeAllRanges(),u.addRange(b)}get contentDiv(){return this.editorDiv}static async deserialize(i,s,l){var p;let d=null;if(i instanceof kEe){const{data:{defaultAppearanceData:{fontSize:g,fontColor:_},rect:y,rotation:E,id:b,popupRef:A,contentsObj:N},textContent:O,textPosition:D,parent:{page:{pageNumber:P}}}=i;if(!O||O.length===0)return null;d=i={annotationType:_i.FREETEXT,color:Array.from(_),fontSize:g,value:O.join(`
`),position:D,pageIndex:P-1,rect:y.slice(0),rotation:E,annotationElementId:b,id:b,deleted:!1,popupRef:A,comment:(N==null?void 0:N.str)||null}}const u=await super.deserialize(i,s,l);return re(u,Od,i.fontSize),re(u,Gu,zn.makeHexColor(...i.color)),re(u,Nd,pe(p=rs,nO,hX).call(p,i.value)),u._initialData=d,i.comment&&u.setCommentData(i.comment),u}serialize(i=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const s=rs._internalPadding*this.parentScale,l=this.getRect(s,s),d=ds._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:T(this,Gu)),u={annotationType:_i.FREETEXT,color:d,fontSize:T(this,Od),value:pe(this,Q9,zEe).call(this),pageIndex:this.pageIndex,rect:l,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(u),i?(u.isCopy=!0,u):this.annotationElementId&&!pe(this,Z9,HEe).call(this,u)?null:(u.id=this.annotationElementId,u)}renderAnnotationElement(i){const s=super.renderAnnotationElement(i),{style:l}=s;l.fontSize=`calc(${T(this,Od)}px * var(--total-scale-factor))`,l.color=T(this,Gu),s.replaceChildren();for(const p of T(this,Nd).split(`
`)){const g=document.createElement("div");g.append(p?document.createTextNode(p):document.createElement("br")),s.append(g)}const d=rs._internalPadding*this.parentScale,u={rect:this.getRect(d,d)};return u.popup=this.hasEditedComment?this.comment:{text:T(this,Nd)},i.updateEdited(u),s}resetAnnotationElement(i){super.resetAnnotationElement(i),i.resetEdited()}};Gu=new WeakMap,Nd=new WeakMap,tO=new WeakMap,U2=new WeakMap,Od=new WeakMap,Y9=new WeakSet,FEe=function(i){const s=d=>{this.editorDiv.style.fontSize=`calc(${d}px * var(--total-scale-factor))`,this.translate(0,-(d-T(this,Od))*this.parentScale),re(this,Od,d),pe(this,GT,wM).call(this)},l=T(this,Od);this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},X9=new WeakSet,BEe=function(i){const s=d=>{var u;re(this,Gu,this.editorDiv.style.color=d),(u=this._colorPicker)==null||u.update(d)},l=T(this,Gu);this.addCommands({cmd:s.bind(this,i),undo:s.bind(this,l),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},J9=new WeakSet,VEe=function(){var l;const i=[];this.editorDiv.normalize();let s=null;for(const d of this.editorDiv.childNodes)(s==null?void 0:s.nodeType)===Node.TEXT_NODE&&d.nodeName==="BR"||(i.push(pe(l=rs,WT,SM).call(l,d)),s=d);return i.join(`
`)},GT=new WeakSet,wM=function(){const[i,s]=this.parentDimensions;let l;if(this.isAttachedToDOM)l=this.div.getBoundingClientRect();else{const{currentLayer:d,div:u}=this,p=u.style.display,g=u.classList.contains("hidden");u.classList.remove("hidden"),u.style.display="hidden",d.div.append(this.div),l=u.getBoundingClientRect(),u.remove(),u.style.display=p,u.classList.toggle("hidden",g)}this.rotation%180===this.parentRotation%180?(this.width=l.width/i,this.height=l.height/s):(this.width=l.height/i,this.height=l.width/s),this.fixAndSetPosition()},WT=new WeakSet,SM=function(i){return(i.nodeType===Node.TEXT_NODE?i.nodeValue:i.innerText).replaceAll(Ok,"")},$T=new WeakSet,bM=function(){if(this.editorDiv.replaceChildren(),!!T(this,Nd))for(const i of T(this,Nd).split(`
`)){const s=document.createElement("div");s.append(i?document.createTextNode(i):document.createElement("br")),this.editorDiv.append(s)}},Q9=new WeakSet,zEe=function(){return T(this,Nd).replaceAll(" "," ")},nO=new WeakSet,hX=function(i){return i.replaceAll(" "," ")},Z9=new WeakSet,HEe=function(i){const{value:s,fontSize:l,color:d,pageIndex:u}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||i.value!==s||i.fontSize!==l||i.color.some((p,g)=>p!==d[g])||i.pageIndex!==u},ee(rs,WT),ee(rs,nO),sn(rs,"_freeTextDefaultContent",""),sn(rs,"_internalPadding",0),sn(rs,"_defaultColor",null),sn(rs,"_defaultFontSize",10),sn(rs,"_type","freetext"),sn(rs,"_editorType",_i.FREETEXT);let uX=rs;class xn{toSVGPath(){Zr("Abstract method `toSVGPath` must be implemented.")}get box(){Zr("Abstract getter `box` must be implemented.")}serialize(t,i){Zr("Abstract method `serialize` must be implemented.")}static _rescale(t,i,s,l,d,u){u||(u=new Float32Array(t.length));for(let p=0,g=t.length;p<g;p+=2)u[p]=i+t[p]*l,u[p+1]=s+t[p+1]*d;return u}static _rescaleAndSwap(t,i,s,l,d,u){u||(u=new Float32Array(t.length));for(let p=0,g=t.length;p<g;p+=2)u[p]=i+t[p+1]*l,u[p+1]=s+t[p]*d;return u}static _translate(t,i,s,l){l||(l=new Float32Array(t.length));for(let d=0,u=t.length;d<u;d+=2)l[d]=i+t[d],l[d+1]=s+t[d+1];return l}static svgRound(t){return Math.round(t*1e4)}static _normalizePoint(t,i,s,l,d){switch(d){case 90:return[1-i/s,t/l];case 180:return[1-t/s,1-i/l];case 270:return[i/s,1-t/l];default:return[t/s,i/l]}}static _normalizePagePoint(t,i,s){switch(s){case 90:return[1-i,t];case 180:return[1-t,1-i];case 270:return[i,1-t];default:return[t,i]}}static createBezierPoints(t,i,s,l,d,u){return[(t+5*s)/6,(i+5*l)/6,(5*s+d)/6,(5*l+u)/6,(s+d)/2,(l+u)/2]}}sn(xn,"PRECISION",1e-4);var Pd,Xh,KT,qT,bp,$i,F2,B2,iO,rO,YT,XT,X1,sO,ej,tj,V2,YI,nj,GEe,ij,WEe,rj,$Ee,sj,KEe,aj,qEe,oj,YEe;const km=class km{constructor({x:t,y:i},s,l,d,u,p=0){ee(this,V2);ee(this,nj);ee(this,ij);ee(this,rj);ee(this,sj);ee(this,aj);ee(this,oj);ee(this,Pd,void 0);ee(this,Xh,[]);ee(this,KT,void 0);ee(this,qT,void 0);ee(this,bp,[]);ee(this,$i,new Float32Array(18));ee(this,F2,void 0);ee(this,B2,void 0);ee(this,iO,void 0);ee(this,rO,void 0);ee(this,YT,void 0);ee(this,XT,void 0);ee(this,X1,[]);re(this,Pd,s),re(this,XT,d*l),re(this,qT,u),T(this,$i).set([NaN,NaN,NaN,NaN,t,i],6),re(this,KT,p),re(this,rO,T(km,sO)*l),re(this,iO,T(km,tj)*l),re(this,YT,l),T(this,X1).push(t,i)}isEmpty(){return isNaN(T(this,$i)[8])}add({x:t,y:i}){var le;re(this,F2,t),re(this,B2,i);const[s,l,d,u]=T(this,Pd);let[p,g,_,y]=T(this,$i).subarray(8,12);const E=t-_,b=i-y,A=Math.hypot(E,b);if(A<T(this,iO))return!1;const N=A-T(this,rO),O=N/A,D=O*E,P=O*b;let j=p,M=g;p=_,g=y,_+=D,y+=P,(le=T(this,X1))==null||le.push(t,i);const V=-P/N,H=D/N,$=V*T(this,XT),Q=H*T(this,XT);return T(this,$i).set(T(this,$i).subarray(2,8),0),T(this,$i).set([_+$,y+Q],4),T(this,$i).set(T(this,$i).subarray(14,18),12),T(this,$i).set([_-$,y-Q],16),isNaN(T(this,$i)[6])?(T(this,bp).length===0&&(T(this,$i).set([p+$,g+Q],2),T(this,bp).push(NaN,NaN,NaN,NaN,(p+$-s)/d,(g+Q-l)/u),T(this,$i).set([p-$,g-Q],14),T(this,Xh).push(NaN,NaN,NaN,NaN,(p-$-s)/d,(g-Q-l)/u)),T(this,$i).set([j,M,p,g,_,y],6),!this.isEmpty()):(T(this,$i).set([j,M,p,g,_,y],6),Math.abs(Math.atan2(M-g,j-p)-Math.atan2(P,D))<Math.PI/2?([p,g,_,y]=T(this,$i).subarray(2,6),T(this,bp).push(NaN,NaN,NaN,NaN,((p+_)/2-s)/d,((g+y)/2-l)/u),[p,g,j,M]=T(this,$i).subarray(14,18),T(this,Xh).push(NaN,NaN,NaN,NaN,((j+p)/2-s)/d,((M+g)/2-l)/u),!0):([j,M,p,g,_,y]=T(this,$i).subarray(0,6),T(this,bp).push(((j+5*p)/6-s)/d,((M+5*g)/6-l)/u,((5*p+_)/6-s)/d,((5*g+y)/6-l)/u,((p+_)/2-s)/d,((g+y)/2-l)/u),[_,y,p,g,j,M]=T(this,$i).subarray(12,18),T(this,Xh).push(((j+5*p)/6-s)/d,((M+5*g)/6-l)/u,((5*p+_)/6-s)/d,((5*g+y)/6-l)/u,((p+_)/2-s)/d,((g+y)/2-l)/u),!0))}toSVGPath(){if(this.isEmpty())return"";const t=T(this,bp),i=T(this,Xh);if(isNaN(T(this,$i)[6])&&!this.isEmpty())return pe(this,nj,GEe).call(this);const s=[];s.push(`M${t[4]} ${t[5]}`);for(let l=6;l<t.length;l+=6)isNaN(t[l])?s.push(`L${t[l+4]} ${t[l+5]}`):s.push(`C${t[l]} ${t[l+1]} ${t[l+2]} ${t[l+3]} ${t[l+4]} ${t[l+5]}`);pe(this,rj,$Ee).call(this,s);for(let l=i.length-6;l>=6;l-=6)isNaN(i[l])?s.push(`L${i[l+4]} ${i[l+5]}`):s.push(`C${i[l]} ${i[l+1]} ${i[l+2]} ${i[l+3]} ${i[l+4]} ${i[l+5]}`);return pe(this,ij,WEe).call(this,s),s.join(" ")}newFreeDrawOutline(t,i,s,l,d,u){return new XEe(t,i,s,l,d,u)}getOutlines(){var E;const t=T(this,bp),i=T(this,Xh),s=T(this,$i),[l,d,u,p]=T(this,Pd),g=new Float32Array((((E=T(this,X1))==null?void 0:E.length)??0)+2);for(let b=0,A=g.length-2;b<A;b+=2)g[b]=(T(this,X1)[b]-l)/u,g[b+1]=(T(this,X1)[b+1]-d)/p;if(g[g.length-2]=(T(this,F2)-l)/u,g[g.length-1]=(T(this,B2)-d)/p,isNaN(s[6])&&!this.isEmpty())return pe(this,sj,KEe).call(this,g);const _=new Float32Array(T(this,bp).length+24+T(this,Xh).length);let y=t.length;for(let b=0;b<y;b+=2){if(isNaN(t[b])){_[b]=_[b+1]=NaN;continue}_[b]=t[b],_[b+1]=t[b+1]}y=pe(this,oj,YEe).call(this,_,y);for(let b=i.length-6;b>=6;b-=6)for(let A=0;A<6;A+=2){if(isNaN(i[b+A])){_[y]=_[y+1]=NaN,y+=2;continue}_[y]=i[b+A],_[y+1]=i[b+A+1],y+=2}return pe(this,aj,qEe).call(this,_,y),this.newFreeDrawOutline(_,g,T(this,Pd),T(this,YT),T(this,KT),T(this,qT))}};Pd=new WeakMap,Xh=new WeakMap,KT=new WeakMap,qT=new WeakMap,bp=new WeakMap,$i=new WeakMap,F2=new WeakMap,B2=new WeakMap,iO=new WeakMap,rO=new WeakMap,YT=new WeakMap,XT=new WeakMap,X1=new WeakMap,sO=new WeakMap,ej=new WeakMap,tj=new WeakMap,V2=new WeakSet,YI=function(){const t=T(this,$i).subarray(4,6),i=T(this,$i).subarray(16,18),[s,l,d,u]=T(this,Pd);return[(T(this,F2)+(t[0]-i[0])/2-s)/d,(T(this,B2)+(t[1]-i[1])/2-l)/u,(T(this,F2)+(i[0]-t[0])/2-s)/d,(T(this,B2)+(i[1]-t[1])/2-l)/u]},nj=new WeakSet,GEe=function(){const[t,i,s,l]=T(this,Pd),[d,u,p,g]=pe(this,V2,YI).call(this);return`M${(T(this,$i)[2]-t)/s} ${(T(this,$i)[3]-i)/l} L${(T(this,$i)[4]-t)/s} ${(T(this,$i)[5]-i)/l} L${d} ${u} L${p} ${g} L${(T(this,$i)[16]-t)/s} ${(T(this,$i)[17]-i)/l} L${(T(this,$i)[14]-t)/s} ${(T(this,$i)[15]-i)/l} Z`},ij=new WeakSet,WEe=function(t){const i=T(this,Xh);t.push(`L${i[4]} ${i[5]} Z`)},rj=new WeakSet,$Ee=function(t){const[i,s,l,d]=T(this,Pd),u=T(this,$i).subarray(4,6),p=T(this,$i).subarray(16,18),[g,_,y,E]=pe(this,V2,YI).call(this);t.push(`L${(u[0]-i)/l} ${(u[1]-s)/d} L${g} ${_} L${y} ${E} L${(p[0]-i)/l} ${(p[1]-s)/d}`)},sj=new WeakSet,KEe=function(t){const i=T(this,$i),[s,l,d,u]=T(this,Pd),[p,g,_,y]=pe(this,V2,YI).call(this),E=new Float32Array(36);return E.set([NaN,NaN,NaN,NaN,(i[2]-s)/d,(i[3]-l)/u,NaN,NaN,NaN,NaN,(i[4]-s)/d,(i[5]-l)/u,NaN,NaN,NaN,NaN,p,g,NaN,NaN,NaN,NaN,_,y,NaN,NaN,NaN,NaN,(i[16]-s)/d,(i[17]-l)/u,NaN,NaN,NaN,NaN,(i[14]-s)/d,(i[15]-l)/u],0),this.newFreeDrawOutline(E,t,T(this,Pd),T(this,YT),T(this,KT),T(this,qT))},aj=new WeakSet,qEe=function(t,i){const s=T(this,Xh);return t.set([NaN,NaN,NaN,NaN,s[4],s[5]],i),i+=6},oj=new WeakSet,YEe=function(t,i){const s=T(this,$i).subarray(4,6),l=T(this,$i).subarray(16,18),[d,u,p,g]=T(this,Pd),[_,y,E,b]=pe(this,V2,YI).call(this);return t.set([NaN,NaN,NaN,NaN,(s[0]-d)/p,(s[1]-u)/g,NaN,NaN,NaN,NaN,_,y,NaN,NaN,NaN,NaN,E,b,NaN,NaN,NaN,NaN,(l[0]-d)/p,(l[1]-u)/g],i),i+=24},ee(km,sO,8),ee(km,ej,2),ee(km,tj,T(km,sO)+T(km,ej));let j7=km;var JT,z2,ug,aO,Ld,oO,ha,lj,JEe;class XEe extends xn{constructor(i,s,l,d,u,p){super();ee(this,lj);ee(this,JT,void 0);ee(this,z2,new Float32Array(4));ee(this,ug,void 0);ee(this,aO,void 0);ee(this,Ld,void 0);ee(this,oO,void 0);ee(this,ha,void 0);re(this,ha,i),re(this,Ld,s),re(this,JT,l),re(this,oO,d),re(this,ug,u),re(this,aO,p),this.lastPoint=[NaN,NaN],pe(this,lj,JEe).call(this,p);const[g,_,y,E]=T(this,z2);for(let b=0,A=i.length;b<A;b+=2)i[b]=(i[b]-g)/y,i[b+1]=(i[b+1]-_)/E;for(let b=0,A=s.length;b<A;b+=2)s[b]=(s[b]-g)/y,s[b+1]=(s[b+1]-_)/E}toSVGPath(){const i=[`M${T(this,ha)[4]} ${T(this,ha)[5]}`];for(let s=6,l=T(this,ha).length;s<l;s+=6){if(isNaN(T(this,ha)[s])){i.push(`L${T(this,ha)[s+4]} ${T(this,ha)[s+5]}`);continue}i.push(`C${T(this,ha)[s]} ${T(this,ha)[s+1]} ${T(this,ha)[s+2]} ${T(this,ha)[s+3]} ${T(this,ha)[s+4]} ${T(this,ha)[s+5]}`)}return i.push("Z"),i.join(" ")}serialize([i,s,l,d],u){const p=l-i,g=d-s;let _,y;switch(u){case 0:_=xn._rescale(T(this,ha),i,d,p,-g),y=xn._rescale(T(this,Ld),i,d,p,-g);break;case 90:_=xn._rescaleAndSwap(T(this,ha),i,s,p,g),y=xn._rescaleAndSwap(T(this,Ld),i,s,p,g);break;case 180:_=xn._rescale(T(this,ha),l,s,-p,g),y=xn._rescale(T(this,Ld),l,s,-p,g);break;case 270:_=xn._rescaleAndSwap(T(this,ha),l,d,-p,-g),y=xn._rescaleAndSwap(T(this,Ld),l,d,-p,-g);break}return{outline:Array.from(_),points:[Array.from(y)]}}get box(){return T(this,z2)}newOutliner(i,s,l,d,u,p=0){return new j7(i,s,l,d,u,p)}getNewOutline(i,s){const[l,d,u,p]=T(this,z2),[g,_,y,E]=T(this,JT),b=u*y,A=p*E,N=l*y+g,O=d*E+_,D=this.newOutliner({x:T(this,Ld)[0]*b+N,y:T(this,Ld)[1]*A+O},T(this,JT),T(this,oO),i,T(this,aO),s??T(this,ug));for(let P=2;P<T(this,Ld).length;P+=2)D.add({x:T(this,Ld)[P]*b+N,y:T(this,Ld)[P+1]*A+O});return D.getOutlines()}}JT=new WeakMap,z2=new WeakMap,ug=new WeakMap,aO=new WeakMap,Ld=new WeakMap,oO=new WeakMap,ha=new WeakMap,lj=new WeakSet,JEe=function(i){const s=T(this,ha);let l=s[4],d=s[5];const u=[l,d,l,d];let p=l,g=d;const _=i?Math.max:Math.min;for(let E=6,b=s.length;E<b;E+=6){const A=s[E+4],N=s[E+5];if(isNaN(s[E]))zn.pointBoundingBox(A,N,u),g<N?(p=A,g=N):g===N&&(p=_(p,A));else{const O=[1/0,1/0,-1/0,-1/0];zn.bezierBoundingBox(l,d,...s.slice(E,E+6),O),zn.rectBoundingBox(...O,u),g<O[3]?(p=O[2],g=O[3]):g===O[3]&&(p=_(p,O[2]))}l=A,d=N}const y=T(this,z2);y[0]=u[0]-T(this,ug),y[1]=u[1]-T(this,ug),y[2]=u[2]-u[0]+2*T(this,ug),y[3]=u[3]-u[1]+2*T(this,ug),this.lastPoint=[p,g]};var lO,cO,J1,Jh,cj,QEe,QT,CM,dj,ZEe,uj,ewe,dO,pX;class fX{constructor(t,i=0,s=0,l=!0){ee(this,cj);ee(this,QT);ee(this,dj);ee(this,uj);ee(this,dO);ee(this,lO,void 0);ee(this,cO,void 0);ee(this,J1,[]);ee(this,Jh,[]);const d=[1/0,1/0,-1/0,-1/0],p=10**-4;for(const{x:N,y:O,width:D,height:P}of t){const j=Math.floor((N-i)/p)*p,M=Math.ceil((N+D+i)/p)*p,V=Math.floor((O-i)/p)*p,H=Math.ceil((O+P+i)/p)*p,$=[j,V,H,!0],Q=[M,V,H,!1];T(this,J1).push($,Q),zn.rectBoundingBox(j,V,M,H,d)}const g=d[2]-d[0]+2*s,_=d[3]-d[1]+2*s,y=d[0]-s,E=d[1]-s,b=T(this,J1).at(l?-1:-2),A=[b[0],b[2]];for(const N of T(this,J1)){const[O,D,P]=N;N[0]=(O-y)/g,N[1]=(D-E)/_,N[2]=(P-E)/_}re(this,lO,new Float32Array([y,E,g,_])),re(this,cO,A)}getOutlines(){T(this,J1).sort((i,s)=>i[0]-s[0]||i[1]-s[1]||i[2]-s[2]);const t=[];for(const i of T(this,J1))i[3]?(t.push(...pe(this,dO,pX).call(this,i)),pe(this,dj,ZEe).call(this,i)):(pe(this,uj,ewe).call(this,i),t.push(...pe(this,dO,pX).call(this,i)));return pe(this,cj,QEe).call(this,t)}}lO=new WeakMap,cO=new WeakMap,J1=new WeakMap,Jh=new WeakMap,cj=new WeakSet,QEe=function(t){const i=[],s=new Set;for(const u of t){const[p,g,_]=u;i.push([p,g,u],[p,_,u])}i.sort((u,p)=>u[1]-p[1]||u[0]-p[0]);for(let u=0,p=i.length;u<p;u+=2){const g=i[u][2],_=i[u+1][2];g.push(_),_.push(g),s.add(g),s.add(_)}const l=[];let d;for(;s.size>0;){const u=s.values().next().value;let[p,g,_,y,E]=u;s.delete(u);let b=p,A=g;for(d=[p,_],l.push(d);;){let N;if(s.has(y))N=y;else if(s.has(E))N=E;else break;s.delete(N),[p,g,_,y,E]=N,b!==p&&(d.push(b,A,p,A===g?g:_),b=p),A=A===g?_:g}d.push(b,A)}return new set(l,T(this,lO),T(this,cO))},QT=new WeakSet,CM=function(t){const i=T(this,Jh);let s=0,l=i.length-1;for(;s<=l;){const d=s+l>>1,u=i[d][0];if(u===t)return d;u<t?s=d+1:l=d-1}return l+1},dj=new WeakSet,ZEe=function([,t,i]){const s=pe(this,QT,CM).call(this,t);T(this,Jh).splice(s,0,[t,i])},uj=new WeakSet,ewe=function([,t,i]){const s=pe(this,QT,CM).call(this,t);for(let l=s;l<T(this,Jh).length;l++){const[d,u]=T(this,Jh)[l];if(d!==t)break;if(d===t&&u===i){T(this,Jh).splice(l,1);return}}for(let l=s-1;l>=0;l--){const[d,u]=T(this,Jh)[l];if(d!==t)break;if(d===t&&u===i){T(this,Jh).splice(l,1);return}}},dO=new WeakSet,pX=function(t){const[i,s,l]=t,d=[[i,s,l]],u=pe(this,QT,CM).call(this,l);for(let p=0;p<u;p++){const[g,_]=T(this,Jh)[p];for(let y=0,E=d.length;y<E;y++){const[,b,A]=d[y];if(!(_<=b||A<=g)){if(b>=g){if(A>_)d[y][1]=_;else{if(E===1)return[];d.splice(y,1),y--,E--}continue}d[y][2]=g,A>_&&d.push([i,_,A])}}}return d};var uO,ZT;class set extends xn{constructor(i,s,l){super();ee(this,uO,void 0);ee(this,ZT,void 0);re(this,ZT,i),re(this,uO,s),this.lastPoint=l}toSVGPath(){const i=[];for(const s of T(this,ZT)){let[l,d]=s;i.push(`M${l} ${d}`);for(let u=2;u<s.length;u+=2){const p=s[u],g=s[u+1];p===l?(i.push(`V${g}`),d=g):g===d&&(i.push(`H${p}`),l=p)}i.push("Z")}return i.join(" ")}serialize([i,s,l,d],u){const p=[],g=l-i,_=d-s;for(const y of T(this,ZT)){const E=new Array(y.length);for(let b=0;b<y.length;b+=2)E[b]=i+y[b]*g,E[b+1]=d-y[b+1]*_;p.push(E)}return p}get box(){return T(this,uO)}get classNamesForOutlining(){return["highlightOutline"]}}uO=new WeakMap,ZT=new WeakMap;class mX extends j7{newFreeDrawOutline(t,i,s,l,d,u){return new aet(t,i,s,l,d,u)}}class aet extends XEe{newOutliner(t,i,s,l,d,u=0){return new mX(t,i,s,l,d,u)}}var eR,hO,hg,H2,fO,$c,pO,mO,G2,Wu,Dd,Bo,tR,fg,gl,nR,$u,gO,vO,gX,iR,TM,hj,twe,fj,nwe,pj,iwe,yO,vX,pg,b_,Q1,Yb,mj,rwe,rR,RM,W2,XI,gj,swe,vj,awe,yj,owe,_j,lwe,Ej,cwe;const _r=class _r extends ds{constructor(i){super({...i,name:"highlightEditor"});ee(this,vO);ee(this,iR);ee(this,hj);ee(this,fj);ee(this,pj);ee(this,yO);ee(this,pg);ee(this,mj);ee(this,rR);ee(this,W2);ee(this,gj);ee(this,vj);ee(this,Ej);ee(this,eR,null);ee(this,hO,0);ee(this,hg,void 0);ee(this,H2,null);ee(this,fO,null);ee(this,$c,null);ee(this,pO,null);ee(this,mO,0);ee(this,G2,null);ee(this,Wu,null);ee(this,Dd,null);ee(this,Bo,!1);ee(this,tR,null);ee(this,fg,void 0);ee(this,gl,null);ee(this,nR,"");ee(this,$u,void 0);ee(this,gO,"");this.color=i.color||_r._defaultColor,re(this,$u,i.thickness||_r._defaultThickness),re(this,fg,i.opacity||_r._defaultOpacity),re(this,hg,i.boxes||null),re(this,gO,i.methodOfCreation||""),re(this,nR,i.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",i.highlightId>-1?(re(this,Bo,!0),pe(this,iR,TM).call(this,i),pe(this,pg,b_).call(this)):T(this,hg)&&(re(this,eR,i.anchorNode),re(this,hO,i.anchorOffset),re(this,pO,i.focusNode),re(this,mO,i.focusOffset),pe(this,vO,gX).call(this),pe(this,pg,b_).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){const i=_r.prototype;return Ki(this,"_keyboardManager",new iP([[["ArrowLeft","mac+ArrowLeft"],i._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],i._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],i._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],i._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:T(this,Bo)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:T(this,$u),methodOfCreation:T(this,gO)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}get commentColor(){return this.color}static computeTelemetryFinalData(i){return{numberOfColors:i.get("color").size}}static initialize(i,s){var l;ds.initialize(i,s),_r._defaultColor||(_r._defaultColor=((l=s.highlightColors)==null?void 0:l.values().next().value)||"#fff066")}static updateDefaultParams(i,s){switch(i){case cr.HIGHLIGHT_COLOR:_r._defaultColor=s;break;case cr.HIGHLIGHT_THICKNESS:_r._defaultThickness=s;break}}translateInPage(i,s){}get toolbarPosition(){return T(this,tR)}updateParams(i,s){switch(i){case cr.HIGHLIGHT_COLOR:pe(this,hj,twe).call(this,s);break;case cr.HIGHLIGHT_THICKNESS:pe(this,fj,nwe).call(this,s);break}}static get defaultPropertiesToUpdate(){return[[cr.HIGHLIGHT_COLOR,_r._defaultColor],[cr.HIGHLIGHT_THICKNESS,_r._defaultThickness]]}get propertiesToUpdate(){return[[cr.HIGHLIGHT_COLOR,this.color||_r._defaultColor],[cr.HIGHLIGHT_THICKNESS,T(this,$u)||_r._defaultThickness],[cr.HIGHLIGHT_FREE,T(this,Bo)]]}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",re(this,fO,new D7({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(pe(this,W2,XI).call(this))}getBaseTranslation(){return[0,0]}getRect(i,s){return super.getRect(i,s,pe(this,W2,XI).call(this))}onceAdded(i){this.annotationElementId||this.parent.addUndoableEditor(this),i&&this.div.focus()}remove(){pe(this,yO,vX).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(pe(this,pg,b_).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(i){var l;let s=!1;this.parent&&!i?pe(this,yO,vX).call(this):i&&(pe(this,pg,b_).call(this,i),s=!this.parent&&((l=this.div)==null?void 0:l.classList.contains("selectedEditor"))),super.setParent(i),this.show(this._isVisible),s&&this.select()}rotate(i){var d,u,p;const{drawLayer:s}=this.parent;let l;T(this,Bo)?(i=(i-this.rotation+360)%360,l=pe(d=_r,Q1,Yb).call(d,T(this,Wu).box,i)):l=pe(u=_r,Q1,Yb).call(u,[this.x,this.y,this.width,this.height],i),s.updateProperties(T(this,Dd),{bbox:l,root:{"data-main-rotation":i}}),s.updateProperties(T(this,gl),{bbox:pe(p=_r,Q1,Yb).call(p,T(this,$c).box,i),root:{"data-main-rotation":i}})}render(){if(this.div)return this.div;const i=super.render();T(this,nR)&&(i.setAttribute("aria-label",T(this,nR)),i.setAttribute("role","mark")),T(this,Bo)?i.classList.add("free"):this.div.addEventListener("keydown",pe(this,mj,rwe).bind(this),{signal:this._uiManager._signal});const s=re(this,G2,document.createElement("div"));i.append(s),s.setAttribute("aria-hidden","true"),s.className="internal",s.style.clipPath=T(this,H2);const[l,d]=this.parentDimensions;return this.setDims(this.width*l,this.height*d),I2e(this,T(this,G2),["pointerover","pointerleave"]),this.enableEditing(),i}pointerover(){var i;this.isSelected||(i=this.parent)==null||i.drawLayer.updateProperties(T(this,gl),{rootClass:{hovered:!0}})}pointerleave(){var i;this.isSelected||(i=this.parent)==null||i.drawLayer.updateProperties(T(this,gl),{rootClass:{hovered:!1}})}_moveCaret(i){switch(this.parent.unselect(this),i){case 0:case 2:pe(this,rR,RM).call(this,!0);break;case 1:case 3:pe(this,rR,RM).call(this,!1);break}}select(){var i;super.select(),T(this,gl)&&((i=this.parent)==null||i.drawLayer.updateProperties(T(this,gl),{rootClass:{hovered:!1,selected:!0}}))}unselect(){var i;super.unselect(),T(this,gl)&&((i=this.parent)==null||i.drawLayer.updateProperties(T(this,gl),{rootClass:{selected:!1}}),T(this,Bo)||pe(this,rR,RM).call(this,!1))}get _mustFixPosition(){return!T(this,Bo)}show(i=this._isVisible){super.show(i),this.parent&&(this.parent.drawLayer.updateProperties(T(this,Dd),{rootClass:{hidden:!i}}),this.parent.drawLayer.updateProperties(T(this,gl),{rootClass:{hidden:!i}}))}static startHighlighting(i,s,{target:l,x:d,y:u}){const{x:p,y:g,width:_,height:y}=l.getBoundingClientRect(),E=new AbortController,b=i.combinedSignal(E),A=N=>{E.abort(),pe(this,_j,lwe).call(this,i,N)};window.addEventListener("blur",A,{signal:b}),window.addEventListener("pointerup",A,{signal:b}),window.addEventListener("pointerdown",Ra,{capture:!0,passive:!1,signal:b}),window.addEventListener("contextmenu",rh,{signal:b}),l.addEventListener("pointermove",pe(this,yj,owe).bind(this,i),{signal:b}),this._freeHighlight=new mX({x:d,y:u},[p,g,_,y],i.scale,this._defaultThickness/2,s,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=i.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(i,s,l){var O,D,P,j;let d=null;if(i instanceof jEe){const{data:{quadPoints:M,rect:V,rotation:H,id:$,color:Q,opacity:Y,popupRef:le,contentsObj:ae},parent:{page:{pageNumber:te}}}=i;d=i={annotationType:_i.HIGHLIGHT,color:Array.from(Q),opacity:Y,quadPoints:M,boxes:null,pageIndex:te-1,rect:V.slice(0),rotation:H,annotationElementId:$,id:$,deleted:!1,popupRef:le,comment:(ae==null?void 0:ae.str)||null}}else if(i instanceof fZ){const{data:{inkLists:M,rect:V,rotation:H,id:$,color:Q,borderStyle:{rawWidth:Y},popupRef:le,contentsObj:ae},parent:{page:{pageNumber:te}}}=i;d=i={annotationType:_i.HIGHLIGHT,color:Array.from(Q),thickness:Y,inkLists:M,boxes:null,pageIndex:te-1,rect:V.slice(0),rotation:H,annotationElementId:$,id:$,deleted:!1,popupRef:le,comment:(ae==null?void 0:ae.str)||null}}const{color:u,quadPoints:p,inkLists:g,opacity:_}=i,y=await super.deserialize(i,s,l);y.color=zn.makeHexColor(...u),re(y,fg,_||1),g&&re(y,$u,i.thickness),y._initialData=d,i.comment&&y.setCommentData(i.comment);const[E,b]=y.pageDimensions,[A,N]=y.pageTranslation;if(p){const M=re(y,hg,[]);for(let V=0;V<p.length;V+=8)M.push({x:(p[V]-A)/E,y:1-(p[V+1]-N)/b,width:(p[V+2]-p[V])/E,height:(p[V+1]-p[V+5])/b});pe(O=y,vO,gX).call(O),pe(D=y,pg,b_).call(D),y.rotate(y.rotation)}else if(g){re(y,Bo,!0);const M=g[0],V={x:M[0]-A,y:b-(M[1]-N)},H=new mX(V,[0,0,E,b],1,T(y,$u)/2,!0,.001);for(let Y=0,le=M.length;Y<le;Y+=2)V.x=M[Y]-A,V.y=b-(M[Y+1]-N),H.add(V);const{id:$,clipPathId:Q}=s.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:y.color,"fill-opacity":y._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:H.toSVGPath()}},!0,!0);pe(P=y,iR,TM).call(P,{highlightOutlines:H.getOutlines(),highlightId:$,clipPathId:Q}),pe(j=y,pg,b_).call(j),y.rotate(y.parentRotation)}return y}serialize(i=!1){if(this.isEmpty()||i)return null;if(this.deleted)return this.serializeDeleted();const s=this.getRect(0,0),l=ds._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),d={annotationType:_i.HIGHLIGHT,color:l,opacity:T(this,fg),thickness:T(this,$u),quadPoints:pe(this,gj,swe).call(this),outlines:pe(this,vj,awe).call(this,s),pageIndex:this.pageIndex,rect:s,rotation:pe(this,W2,XI).call(this),structTreeParentId:this._structTreeParentId};return this.addComment(d),this.annotationElementId&&!pe(this,Ej,cwe).call(this,d)?null:(d.id=this.annotationElementId,d)}renderAnnotationElement(i){const s={rect:this.getRect(0,0)};return this.hasEditedComment&&(s.popup=this.comment),i.updateEdited(s),null}static canCreateNewEmptyEditor(){return!1}};eR=new WeakMap,hO=new WeakMap,hg=new WeakMap,H2=new WeakMap,fO=new WeakMap,$c=new WeakMap,pO=new WeakMap,mO=new WeakMap,G2=new WeakMap,Wu=new WeakMap,Dd=new WeakMap,Bo=new WeakMap,tR=new WeakMap,fg=new WeakMap,gl=new WeakMap,nR=new WeakMap,$u=new WeakMap,gO=new WeakMap,vO=new WeakSet,gX=function(){const i=new fX(T(this,hg),.001);re(this,Wu,i.getOutlines()),[this.x,this.y,this.width,this.height]=T(this,Wu).box;const s=new fX(T(this,hg),.0025,.001,this._uiManager.direction==="ltr");re(this,$c,s.getOutlines());const{lastPoint:l}=T(this,$c);re(this,tR,[(l[0]-this.x)/this.width,(l[1]-this.y)/this.height])},iR=new WeakSet,TM=function({highlightOutlines:i,highlightId:s,clipPathId:l}){var E,b;if(re(this,Wu,i),re(this,$c,i.getNewOutline(T(this,$u)/2+1.5,.0025)),s>=0)re(this,Dd,s),re(this,H2,l),this.parent.drawLayer.finalizeDraw(s,{bbox:i.box,path:{d:i.toSVGPath()}}),re(this,gl,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:T(this,$c).box,path:{d:T(this,$c).toSVGPath()}},!0));else if(this.parent){const A=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(T(this,Dd),{bbox:pe(E=_r,Q1,Yb).call(E,T(this,Wu).box,(A-this.rotation+360)%360),path:{d:i.toSVGPath()}}),this.parent.drawLayer.updateProperties(T(this,gl),{bbox:pe(b=_r,Q1,Yb).call(b,T(this,$c).box,A),path:{d:T(this,$c).toSVGPath()}})}const[u,p,g,_]=i.box;switch(this.rotation){case 0:this.x=u,this.y=p,this.width=g,this.height=_;break;case 90:{const[A,N]=this.parentDimensions;this.x=p,this.y=1-u,this.width=g*N/A,this.height=_*A/N;break}case 180:this.x=1-u,this.y=1-p,this.width=g,this.height=_;break;case 270:{const[A,N]=this.parentDimensions;this.x=1-p,this.y=u,this.width=g*N/A,this.height=_*A/N;break}}const{lastPoint:y}=T(this,$c);re(this,tR,[(y[0]-u)/g,(y[1]-p)/_])},hj=new WeakSet,twe=function(i){const s=(u,p)=>{var g,_;this.color=u,re(this,fg,p),(g=this.parent)==null||g.drawLayer.updateProperties(T(this,Dd),{root:{fill:u,"fill-opacity":p}}),(_=T(this,fO))==null||_.updateColor(u)},l=this.color,d=T(this,fg);this.addCommands({cmd:s.bind(this,i,_r._defaultOpacity),undo:s.bind(this,l,d),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(i)},!0)},fj=new WeakSet,nwe=function(i){const s=T(this,$u),l=d=>{re(this,$u,d),pe(this,pj,iwe).call(this,d)};this.addCommands({cmd:l.bind(this,i),undo:l.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:cr.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:i},!0)},pj=new WeakSet,iwe=function(i){if(!T(this,Bo))return;pe(this,iR,TM).call(this,{highlightOutlines:T(this,Wu).getNewOutline(i/2)}),this.fixAndSetPosition();const[s,l]=this.parentDimensions;this.setDims(this.width*s,this.height*l)},yO=new WeakSet,vX=function(){T(this,Dd)===null||!this.parent||(this.parent.drawLayer.remove(T(this,Dd)),re(this,Dd,null),this.parent.drawLayer.remove(T(this,gl)),re(this,gl,null))},pg=new WeakSet,b_=function(i=this.parent){T(this,Dd)===null&&({id:ao(this,Dd)._,clipPathId:ao(this,H2)._}=i.drawLayer.draw({bbox:T(this,Wu).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":T(this,fg)},rootClass:{highlight:!0,free:T(this,Bo)},path:{d:T(this,Wu).toSVGPath()}},!1,!0),re(this,gl,i.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:T(this,Bo)},bbox:T(this,$c).box,path:{d:T(this,$c).toSVGPath()}},T(this,Bo))),T(this,G2)&&(T(this,G2).style.clipPath=T(this,H2)))},Q1=new WeakSet,Yb=function([i,s,l,d],u){switch(u){case 90:return[1-s-d,i,d,l];case 180:return[1-i-l,1-s-d,l,d];case 270:return[s,1-i-l,d,l]}return[i,s,l,d]},mj=new WeakSet,rwe=function(i){_r._keyboardManager.exec(this,i)},rR=new WeakSet,RM=function(i){if(!T(this,eR))return;const s=window.getSelection();i?s.setPosition(T(this,eR),T(this,hO)):s.setPosition(T(this,pO),T(this,mO))},W2=new WeakSet,XI=function(){return T(this,Bo)?this.rotation:0},gj=new WeakSet,swe=function(){if(T(this,Bo))return null;const[i,s]=this.pageDimensions,[l,d]=this.pageTranslation,u=T(this,hg),p=new Float32Array(u.length*8);let g=0;for(const{x:_,y,width:E,height:b}of u){const A=_*i+l,N=(1-y)*s+d;p[g]=p[g+4]=A,p[g+1]=p[g+3]=N,p[g+2]=p[g+6]=A+E*i,p[g+5]=p[g+7]=N-b*s,g+=8}return p},vj=new WeakSet,awe=function(i){return T(this,Wu).serialize(i,pe(this,W2,XI).call(this))},yj=new WeakSet,owe=function(i,s){this._freeHighlight.add(s)&&i.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},_j=new WeakSet,lwe=function(i,s){this._freeHighlight.isEmpty()?i.drawLayer.remove(this._freeHighlightId):i.createAndAddNewEditor(s,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},Ej=new WeakSet,cwe=function(i){const{color:s}=this._initialData;return this.hasEditedComment||i.color.some((l,d)=>l!==s[d])},ee(_r,Q1),ee(_r,yj),ee(_r,_j),sn(_r,"_defaultColor",null),sn(_r,"_defaultOpacity",1),sn(_r,"_defaultThickness",12),sn(_r,"_type","highlight"),sn(_r,"_editorType",_i.HIGHLIGHT),sn(_r,"_freeHighlightId",-1),sn(_r,"_freeHighlight",null),sn(_r,"_freeHighlightClipId","");let U7=_r;var $2;class dwe{constructor(){ee(this,$2,Object.create(null))}updateProperty(t,i){this[t]=i,this.updateSVGProperty(t,i)}updateProperties(t){if(t)for(const[i,s]of Object.entries(t))i.startsWith("_")||this.updateProperty(i,s)}updateSVGProperty(t,i){T(this,$2)[t]=i}toSVGProperties(){const t=T(this,$2);return re(this,$2,Object.create(null)),{root:t}}reset(){re(this,$2,Object.create(null))}updateAll(t=this){this.updateProperties(t)}clone(){Zr("Not implemented")}}$2=new WeakMap;var kd,sR,fo,K2,q2,Z1,ev,tv,Y2,_O,yX,EO,_X,wO,EX,X2,JI,wj,uwe,aR,xM,J2,QI,nv,Xb;const In=class In extends ds{constructor(i){super(i);ee(this,_O);ee(this,EO);ee(this,wO);ee(this,X2);ee(this,wj);ee(this,aR);ee(this,J2);ee(this,nv);ee(this,kd,null);ee(this,sR,void 0);sn(this,"_colorPicker",null);sn(this,"_drawId",null);re(this,sR,i.mustBeCommitted||!1),this._addOutlines(i)}_addOutlines(i){i.drawOutlines&&(pe(this,_O,yX).call(this,i),pe(this,X2,JI).call(this))}static _mergeSVGProperties(i,s){const l=new Set(Object.keys(i));for(const[d,u]of Object.entries(s))l.has(d)?Object.assign(i[d],u):i[d]=u;return i}static getDefaultDrawingOptions(i){Zr("Not implemented")}static get typesMap(){Zr("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(i,s){const l=this.typesMap.get(i);l&&this._defaultDrawingOptions.updateProperty(l,s),this._currentParent&&(T(In,fo).updateProperty(l,s),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(i,s){const l=this.constructor.typesMap.get(i);l&&this._updateProperty(i,l,s)}static get defaultPropertiesToUpdate(){const i=[],s=this._defaultDrawingOptions;for(const[l,d]of this.typesMap)i.push([l,s[d]]);return i}get propertiesToUpdate(){const i=[],{_drawingOptions:s}=this;for(const[l,d]of this.constructor.typesMap)i.push([l,s[d]]);return i}_updateProperty(i,s,l){const d=this._drawingOptions,u=d[s],p=g=>{var y,E;d.updateProperty(s,g);const _=T(this,kd).updateProperty(s,g);_&&pe(this,J2,QI).call(this,_),(y=this.parent)==null||y.drawLayer.updateProperties(this._drawId,d.toSVGProperties()),i===this.colorType&&((E=this._colorPicker)==null||E.update(g))};this.addCommands({cmd:p.bind(this,l),undo:p.bind(this,u),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:i,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,In._mergeSVGProperties(T(this,kd).getPathResizingSVGProperties(pe(this,aR,xM).call(this)),{bbox:pe(this,nv,Xb).call(this)}))}_onResized(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,In._mergeSVGProperties(T(this,kd).getPathResizedSVGProperties(pe(this,aR,xM).call(this)),{bbox:pe(this,nv,Xb).call(this)}))}_onTranslating(i,s){var l;(l=this.parent)==null||l.drawLayer.updateProperties(this._drawId,{bbox:pe(this,nv,Xb).call(this)})}_onTranslated(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,In._mergeSVGProperties(T(this,kd).getPathTranslatedSVGProperties(pe(this,aR,xM).call(this),this.parentDimensions),{bbox:pe(this,nv,Xb).call(this)}))}_onStartDragging(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){var i;(i=this.parent)==null||i.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(i){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,T(this,sR)&&(re(this,sR,!1),this.commit(),this.parent.setSelected(this),i&&this.isOnScreen&&this.div.focus())}remove(){pe(this,wO,EX).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(pe(this,X2,JI).call(this),pe(this,J2,QI).call(this,T(this,kd).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(i){var l;let s=!1;this.parent&&!i?(this._uiManager.removeShouldRescale(this),pe(this,wO,EX).call(this)):i&&(this._uiManager.addShouldRescale(this),pe(this,X2,JI).call(this,i),s=!this.parent&&((l=this.div)==null?void 0:l.classList.contains("selectedEditor"))),super.setParent(i),s&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,In._mergeSVGProperties({bbox:pe(this,nv,Xb).call(this)},T(this,kd).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&pe(this,J2,QI).call(this,T(this,kd).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let i,s;this._isCopy&&(i=this.x,s=this.y);const l=super.render();l.classList.add("draw");const d=document.createElement("div");l.append(d),d.setAttribute("aria-hidden","true"),d.className="internal";const[u,p]=this.parentDimensions;return this.setDims(this.width*u,this.height*p),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(i,s),l}static createDrawerInstance(i,s,l,d,u){Zr("Not implemented")}static startDrawing(i,s,l,d){var D;const{target:u,offsetX:p,offsetY:g,pointerId:_,pointerType:y}=d;if(T(In,ev)&&T(In,ev)!==y)return;const{viewport:{rotation:E}}=i,{width:b,height:A}=u.getBoundingClientRect(),N=re(In,K2,new AbortController),O=i.combinedSignal(N);if(T(In,Z1)||re(In,Z1,_),T(In,ev)??re(In,ev,y),window.addEventListener("pointerup",P=>{var j;T(In,Z1)===P.pointerId?this._endDraw(P):(j=T(In,tv))==null||j.delete(P.pointerId)},{signal:O}),window.addEventListener("pointercancel",P=>{var j;T(In,Z1)===P.pointerId?this._currentParent.endDrawingSession():(j=T(In,tv))==null||j.delete(P.pointerId)},{signal:O}),window.addEventListener("pointerdown",P=>{T(In,ev)===P.pointerType&&((T(In,tv)||re(In,tv,new Set)).add(P.pointerId),T(In,fo).isCancellable()&&(T(In,fo).removeLastElement(),T(In,fo).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:O}),window.addEventListener("contextmenu",rh,{signal:O}),u.addEventListener("pointermove",this._drawMove.bind(this),{signal:O}),u.addEventListener("touchmove",P=>{P.timeStamp===T(In,Y2)&&Ra(P)},{signal:O}),i.toggleDrawing(),(D=s._editorUndoBar)==null||D.hide(),T(In,fo)){i.drawLayer.updateProperties(this._currentDrawId,T(In,fo).startNew(p,g,b,A,E));return}s.updateUIForDefaultProperties(this),re(In,fo,this.createDrawerInstance(p,g,b,A,E)),re(In,q2,this.getDefaultDrawingOptions()),this._currentParent=i,{id:this._currentDrawId}=i.drawLayer.draw(this._mergeSVGProperties(T(In,q2).toSVGProperties(),T(In,fo).defaultSVGProperties),!0,!1)}static _drawMove(i){var u;if(re(In,Y2,-1),!T(In,fo))return;const{offsetX:s,offsetY:l,pointerId:d}=i;if(T(In,Z1)===d){if(((u=T(In,tv))==null?void 0:u.size)>=1){this._endDraw(i);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,T(In,fo).add(s,l)),re(In,Y2,i.timeStamp),Ra(i)}}static _cleanup(i){i&&(this._currentDrawId=-1,this._currentParent=null,re(In,fo,null),re(In,q2,null),re(In,ev,null),re(In,Y2,NaN)),T(In,K2)&&(T(In,K2).abort(),re(In,K2,null),re(In,Z1,NaN),re(In,tv,null))}static _endDraw(i){const s=this._currentParent;if(s){if(s.toggleDrawing(!0),this._cleanup(!1),(i==null?void 0:i.target)===s.div&&s.drawLayer.updateProperties(this._currentDrawId,T(In,fo).end(i.offsetX,i.offsetY)),this.supportMultipleDrawings){const l=T(In,fo),d=this._currentDrawId,u=l.getLastElement();s.addCommands({cmd:()=>{s.drawLayer.updateProperties(d,l.setLastElement(u))},undo:()=>{s.drawLayer.updateProperties(d,l.removeLastElement())},mustExec:!1,type:cr.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(i){const s=this._currentParent;if(!s)return null;if(s.toggleDrawing(!0),s.cleanUndoStack(cr.DRAW_STEP),!T(In,fo).isEmpty()){const{pageDimensions:[l,d],scale:u}=s,p=s.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:T(In,fo).getOutlines(l*u,d*u,u,this._INNER_MARGIN),drawingOptions:T(In,q2),mustBeCommitted:!i});return this._cleanup(!0),p}return s.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(i){}static deserializeDraw(i,s,l,d,u,p){Zr("Not implemented")}static async deserialize(i,s,l){var E,b;const{rawDims:{pageWidth:d,pageHeight:u,pageX:p,pageY:g}}=s.viewport,_=this.deserializeDraw(p,g,d,u,this._INNER_MARGIN,i),y=await super.deserialize(i,s,l);return y.createDrawingOptions(i),pe(E=y,_O,yX).call(E,{drawOutlines:_}),pe(b=y,X2,JI).call(b),y.onScaleChanging(),y.rotate(),y}serializeDraw(i){const[s,l]=this.pageTranslation,[d,u]=this.pageDimensions;return T(this,kd).serialize([s,l,d,u],i)}renderAnnotationElement(i){return i.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}};kd=new WeakMap,sR=new WeakMap,fo=new WeakMap,K2=new WeakMap,q2=new WeakMap,Z1=new WeakMap,ev=new WeakMap,tv=new WeakMap,Y2=new WeakMap,_O=new WeakSet,yX=function({drawOutlines:i,drawId:s,drawingOptions:l}){re(this,kd,i),this._drawingOptions||(this._drawingOptions=l),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),s>=0?(this._drawId=s,this.parent.drawLayer.finalizeDraw(s,i.defaultProperties)):this._drawId=pe(this,EO,_X).call(this,i,this.parent),pe(this,J2,QI).call(this,i.box)},EO=new WeakSet,_X=function(i,s){const{id:l}=s.drawLayer.draw(In._mergeSVGProperties(this._drawingOptions.toSVGProperties(),i.defaultSVGProperties),!1,!1);return l},wO=new WeakSet,EX=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},X2=new WeakSet,JI=function(i=this.parent){if(!(this._drawId!==null&&this.parent===i)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,i.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=pe(this,EO,_X).call(this,T(this,kd),i)}},wj=new WeakSet,uwe=function([i,s,l,d]){const{parentDimensions:[u,p],rotation:g}=this;switch(g){case 90:return[s,1-i,l*(p/u),d*(u/p)];case 180:return[1-i,1-s,l,d];case 270:return[1-s,i,l*(p/u),d*(u/p)];default:return[i,s,l,d]}},aR=new WeakSet,xM=function(){const{x:i,y:s,width:l,height:d,parentDimensions:[u,p],rotation:g}=this;switch(g){case 90:return[1-s,i,l*(u/p),d*(p/u)];case 180:return[1-i,1-s,l,d];case 270:return[s,1-i,l*(u/p),d*(p/u)];default:return[i,s,l,d]}},J2=new WeakSet,QI=function(i){if([this.x,this.y,this.width,this.height]=pe(this,wj,uwe).call(this,i),this.div){this.fixAndSetPosition();const[s,l]=this.parentDimensions;this.setDims(this.width*s,this.height*l)}this._onResized()},nv=new WeakSet,Xb=function(){const{x:i,y:s,width:l,height:d,rotation:u,parentRotation:p,parentDimensions:[g,_]}=this;switch((u*4+p)/90){case 1:return[1-s-d,i,d,l];case 2:return[1-i-l,1-s-d,l,d];case 3:return[s,1-i-l,d,l];case 4:return[i,s-l*(g/_),d*(_/g),l*(g/_)];case 5:return[1-s,i,l*(g/_),d*(_/g)];case 6:return[1-i-d*(_/g),1-s,d*(_/g),l*(g/_)];case 7:return[s-l*(g/_),1-i-d*(_/g),l*(g/_),d*(_/g)];case 8:return[i-l,s-d,l,d];case 9:return[1-s,i-l,d,l];case 10:return[1-i,1-s,l,d];case 11:return[s-d,1-i,d,l];case 12:return[i-d*(_/g),s,d*(_/g),l*(g/_)];case 13:return[1-s-l*(g/_),i-d*(_/g),l*(g/_),d*(_/g)];case 14:return[1-i,1-s-l*(g/_),d*(_/g),l*(g/_)];case 15:return[s,1-i,l*(g/_),d*(_/g)];default:return[i,s,l,d]}},sn(In,"_currentDrawId",-1),sn(In,"_currentParent",null),ee(In,fo,null),ee(In,K2,null),ee(In,q2,null),ee(In,Z1,NaN),ee(In,ev,null),ee(In,tv,null),ee(In,Y2,NaN),sn(In,"_INNER_MARGIN",3);let F7=In;var Cp,po,mo,Q2,oR,Jl,Vo,Ku,Z2,eE,tE,lR,AM;class oet{constructor(t,i,s,l,d,u){ee(this,lR);ee(this,Cp,new Float64Array(6));ee(this,po,void 0);ee(this,mo,void 0);ee(this,Q2,void 0);ee(this,oR,void 0);ee(this,Jl,void 0);ee(this,Vo,"");ee(this,Ku,0);ee(this,Z2,new sP);ee(this,eE,void 0);ee(this,tE,void 0);re(this,eE,s),re(this,tE,l),re(this,Q2,d),re(this,oR,u),[t,i]=pe(this,lR,AM).call(this,t,i);const p=re(this,po,[NaN,NaN,NaN,NaN,t,i]);re(this,Jl,[t,i]),re(this,mo,[{line:p,points:T(this,Jl)}]),T(this,Cp).set(p,0)}updateProperty(t,i){t==="stroke-width"&&re(this,oR,i)}isEmpty(){return!T(this,mo)||T(this,mo).length===0}isCancellable(){return T(this,Jl).length<=10}add(t,i){[t,i]=pe(this,lR,AM).call(this,t,i);const[s,l,d,u]=T(this,Cp).subarray(2,6),p=t-d,g=i-u;return Math.hypot(T(this,eE)*p,T(this,tE)*g)<=2?null:(T(this,Jl).push(t,i),isNaN(s)?(T(this,Cp).set([d,u,t,i],2),T(this,po).push(NaN,NaN,NaN,NaN,t,i),{path:{d:this.toSVGPath()}}):(isNaN(T(this,Cp)[0])&&T(this,po).splice(6,6),T(this,Cp).set([s,l,d,u,t,i],0),T(this,po).push(...xn.createBezierPoints(s,l,d,u,t,i)),{path:{d:this.toSVGPath()}}))}end(t,i){const s=this.add(t,i);return s||(T(this,Jl).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(t,i,s,l,d){re(this,eE,s),re(this,tE,l),re(this,Q2,d),[t,i]=pe(this,lR,AM).call(this,t,i);const u=re(this,po,[NaN,NaN,NaN,NaN,t,i]);re(this,Jl,[t,i]);const p=T(this,mo).at(-1);return p&&(p.line=new Float32Array(p.line),p.points=new Float32Array(p.points)),T(this,mo).push({line:u,points:T(this,Jl)}),T(this,Cp).set(u,0),re(this,Ku,0),this.toSVGPath(),null}getLastElement(){return T(this,mo).at(-1)}setLastElement(t){return T(this,mo)?(T(this,mo).push(t),re(this,po,t.line),re(this,Jl,t.points),re(this,Ku,0),{path:{d:this.toSVGPath()}}):T(this,Z2).setLastElement(t)}removeLastElement(){if(!T(this,mo))return T(this,Z2).removeLastElement();T(this,mo).pop(),re(this,Vo,"");for(let t=0,i=T(this,mo).length;t<i;t++){const{line:s,points:l}=T(this,mo)[t];re(this,po,s),re(this,Jl,l),re(this,Ku,0),this.toSVGPath()}return{path:{d:T(this,Vo)}}}toSVGPath(){const t=xn.svgRound(T(this,po)[4]),i=xn.svgRound(T(this,po)[5]);if(T(this,Jl).length===2)return re(this,Vo,`${T(this,Vo)} M ${t} ${i} Z`),T(this,Vo);if(T(this,Jl).length<=6){const l=T(this,Vo).lastIndexOf("M");re(this,Vo,`${T(this,Vo).slice(0,l)} M ${t} ${i}`),re(this,Ku,6)}if(T(this,Jl).length===4){const l=xn.svgRound(T(this,po)[10]),d=xn.svgRound(T(this,po)[11]);return re(this,Vo,`${T(this,Vo)} L ${l} ${d}`),re(this,Ku,12),T(this,Vo)}const s=[];T(this,Ku)===0&&(s.push(`M ${t} ${i}`),re(this,Ku,6));for(let l=T(this,Ku),d=T(this,po).length;l<d;l+=6){const[u,p,g,_,y,E]=T(this,po).slice(l,l+6).map(xn.svgRound);s.push(`C${u} ${p} ${g} ${_} ${y} ${E}`)}return re(this,Vo,T(this,Vo)+s.join(" ")),re(this,Ku,T(this,po).length),T(this,Vo)}getOutlines(t,i,s,l){const d=T(this,mo).at(-1);return d.line=new Float32Array(d.line),d.points=new Float32Array(d.points),T(this,Z2).build(T(this,mo),t,i,s,T(this,Q2),T(this,oR),l),re(this,Cp,null),re(this,po,null),re(this,mo,null),re(this,Vo,null),T(this,Z2)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}Cp=new WeakMap,po=new WeakMap,mo=new WeakMap,Q2=new WeakMap,oR=new WeakMap,Jl=new WeakMap,Vo=new WeakMap,Ku=new WeakMap,Z2=new WeakMap,eE=new WeakMap,tE=new WeakMap,lR=new WeakSet,AM=function(t,i){return xn._normalizePoint(t,i,T(this,eE),T(this,tE),T(this,Q2))};var Ql,SO,bO,Md,Tp,Rp,cR,dR,nE,Qh,Om,Sj,hwe,bj,fwe,Cj,pwe;class sP extends xn{constructor(){super(...arguments);ee(this,Qh);ee(this,Sj);ee(this,bj);ee(this,Cj);ee(this,Ql,void 0);ee(this,SO,0);ee(this,bO,void 0);ee(this,Md,void 0);ee(this,Tp,void 0);ee(this,Rp,void 0);ee(this,cR,void 0);ee(this,dR,void 0);ee(this,nE,void 0)}build(i,s,l,d,u,p,g){re(this,Tp,s),re(this,Rp,l),re(this,cR,d),re(this,dR,u),re(this,nE,p),re(this,bO,g??0),re(this,Md,i),pe(this,bj,fwe).call(this)}get thickness(){return T(this,nE)}setLastElement(i){return T(this,Md).push(i),{path:{d:this.toSVGPath()}}}removeLastElement(){return T(this,Md).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const i=[];for(const{line:s}of T(this,Md)){if(i.push(`M${xn.svgRound(s[4])} ${xn.svgRound(s[5])}`),s.length===6){i.push("Z");continue}if(s.length===12&&isNaN(s[6])){i.push(`L${xn.svgRound(s[10])} ${xn.svgRound(s[11])}`);continue}for(let l=6,d=s.length;l<d;l+=6){const[u,p,g,_,y,E]=s.subarray(l,l+6).map(xn.svgRound);i.push(`C${u} ${p} ${g} ${_} ${y} ${E}`)}}return i.join("")}serialize([i,s,l,d],u){const p=[],g=[],[_,y,E,b]=pe(this,Sj,hwe).call(this);let A,N,O,D,P,j,M,V,H;switch(T(this,dR)){case 0:H=xn._rescale,A=i,N=s+d,O=l,D=-d,P=i+_*l,j=s+(1-y-b)*d,M=i+(_+E)*l,V=s+(1-y)*d;break;case 90:H=xn._rescaleAndSwap,A=i,N=s,O=l,D=d,P=i+y*l,j=s+_*d,M=i+(y+b)*l,V=s+(_+E)*d;break;case 180:H=xn._rescale,A=i+l,N=s,O=-l,D=d,P=i+(1-_-E)*l,j=s+y*d,M=i+(1-_)*l,V=s+(y+b)*d;break;case 270:H=xn._rescaleAndSwap,A=i+l,N=s+d,O=-l,D=-d,P=i+(1-y-b)*l,j=s+(1-_-E)*d,M=i+(1-y)*l,V=s+(1-_)*d;break}for(const{line:$,points:Q}of T(this,Md))p.push(H($,A,N,O,D,u?new Array($.length):null)),g.push(H(Q,A,N,O,D,u?new Array(Q.length):null));return{lines:p,points:g,rect:[P,j,M,V]}}static deserialize(i,s,l,d,u,{paths:{lines:p,points:g},rotation:_,thickness:y}){const E=[];let b,A,N,O,D;switch(_){case 0:D=xn._rescale,b=-i/l,A=s/d+1,N=1/l,O=-1/d;break;case 90:D=xn._rescaleAndSwap,b=-s/d,A=-i/l,N=1/d,O=1/l;break;case 180:D=xn._rescale,b=i/l+1,A=-s/d,N=-1/l,O=1/d;break;case 270:D=xn._rescaleAndSwap,b=s/d+1,A=i/l+1,N=-1/d,O=-1/l;break}if(!p){p=[];for(const j of g){const M=j.length;if(M===2){p.push(new Float32Array([NaN,NaN,NaN,NaN,j[0],j[1]]));continue}if(M===4){p.push(new Float32Array([NaN,NaN,NaN,NaN,j[0],j[1],NaN,NaN,NaN,NaN,j[2],j[3]]));continue}const V=new Float32Array(3*(M-2));p.push(V);let[H,$,Q,Y]=j.subarray(0,4);V.set([NaN,NaN,NaN,NaN,H,$],0);for(let le=4;le<M;le+=2){const ae=j[le],te=j[le+1];V.set(xn.createBezierPoints(H,$,Q,Y,ae,te),(le-2)*3),[H,$,Q,Y]=[Q,Y,ae,te]}}}for(let j=0,M=p.length;j<M;j++)E.push({line:D(p[j].map(V=>V??NaN),b,A,N,O),points:D(g[j].map(V=>V??NaN),b,A,N,O)});const P=new this.prototype.constructor;return P.build(E,l,d,1,_,y,u),P}get box(){return T(this,Ql)}updateProperty(i,s){return i==="stroke-width"?pe(this,Cj,pwe).call(this,s):null}updateParentDimensions([i,s],l){const[d,u]=pe(this,Qh,Om).call(this);re(this,Tp,i),re(this,Rp,s),re(this,cR,l);const[p,g]=pe(this,Qh,Om).call(this),_=p-d,y=g-u,E=T(this,Ql);return E[0]-=_,E[1]-=y,E[2]+=2*_,E[3]+=2*y,E}updateRotation(i){return re(this,SO,i),{path:{transform:this.rotationTransform}}}get viewBox(){return T(this,Ql).map(xn.svgRound).join(" ")}get defaultProperties(){const[i,s]=T(this,Ql);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`}}}get rotationTransform(){const[,,i,s]=T(this,Ql);let l=0,d=0,u=0,p=0,g=0,_=0;switch(T(this,SO)){case 90:d=s/i,u=-i/s,g=i;break;case 180:l=-1,p=-1,g=i,_=s;break;case 270:d=-s/i,u=i/s,_=s;break;default:return""}return`matrix(${l} ${d} ${u} ${p} ${xn.svgRound(g)} ${xn.svgRound(_)})`}getPathResizingSVGProperties([i,s,l,d]){const[u,p]=pe(this,Qh,Om).call(this),[g,_,y,E]=T(this,Ql);if(Math.abs(y-u)<=xn.PRECISION||Math.abs(E-p)<=xn.PRECISION){const D=i+l/2-(g+y/2),P=s+d/2-(_+E/2);return{path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:`${this.rotationTransform} translate(${D} ${P})`}}}const b=(l-2*u)/(y-2*u),A=(d-2*p)/(E-2*p),N=y/l,O=E/d;return{path:{"transform-origin":`${xn.svgRound(g)} ${xn.svgRound(_)}`,transform:`${this.rotationTransform} scale(${N} ${O}) translate(${xn.svgRound(u)} ${xn.svgRound(p)}) scale(${b} ${A}) translate(${xn.svgRound(-u)} ${xn.svgRound(-p)})`}}}getPathResizedSVGProperties([i,s,l,d]){const[u,p]=pe(this,Qh,Om).call(this),g=T(this,Ql),[_,y,E,b]=g;if(g[0]=i,g[1]=s,g[2]=l,g[3]=d,Math.abs(E-u)<=xn.PRECISION||Math.abs(b-p)<=xn.PRECISION){const P=i+l/2-(_+E/2),j=s+d/2-(y+b/2);for(const{line:M,points:V}of T(this,Md))xn._translate(M,P,j,M),xn._translate(V,P,j,V);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const A=(l-2*u)/(E-2*u),N=(d-2*p)/(b-2*p),O=-A*(_+u)+i+u,D=-N*(y+p)+s+p;if(A!==1||N!==1||O!==0||D!==0)for(const{line:P,points:j}of T(this,Md))xn._rescale(P,O,D,A,N,P),xn._rescale(j,O,D,A,N,j);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([i,s],l){const[d,u]=l,p=T(this,Ql),g=i-p[0],_=s-p[1];if(T(this,Tp)===d&&T(this,Rp)===u)for(const{line:y,points:E}of T(this,Md))xn._translate(y,g,_,y),xn._translate(E,g,_,E);else{const y=T(this,Tp)/d,E=T(this,Rp)/u;re(this,Tp,d),re(this,Rp,u);for(const{line:b,points:A}of T(this,Md))xn._rescale(b,g,_,y,E,b),xn._rescale(A,g,_,y,E,A);p[2]*=y,p[3]*=E}return p[0]=i,p[1]=s,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${xn.svgRound(i)} ${xn.svgRound(s)}`}}}get defaultSVGProperties(){const i=T(this,Ql);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${xn.svgRound(i[0])} ${xn.svgRound(i[1])}`,transform:this.rotationTransform||null},bbox:i}}}Ql=new WeakMap,SO=new WeakMap,bO=new WeakMap,Md=new WeakMap,Tp=new WeakMap,Rp=new WeakMap,cR=new WeakMap,dR=new WeakMap,nE=new WeakMap,Qh=new WeakSet,Om=function(i=T(this,nE)){const s=T(this,bO)+i/2*T(this,cR);return T(this,dR)%180===0?[s/T(this,Tp),s/T(this,Rp)]:[s/T(this,Rp),s/T(this,Tp)]},Sj=new WeakSet,hwe=function(){const[i,s,l,d]=T(this,Ql),[u,p]=pe(this,Qh,Om).call(this,0);return[i+u,s+p,l-2*u,d-2*p]},bj=new WeakSet,fwe=function(){const i=re(this,Ql,new Float32Array([1/0,1/0,-1/0,-1/0]));for(const{line:d}of T(this,Md)){if(d.length<=12){for(let g=4,_=d.length;g<_;g+=6)zn.pointBoundingBox(d[g],d[g+1],i);continue}let u=d[4],p=d[5];for(let g=6,_=d.length;g<_;g+=6){const[y,E,b,A,N,O]=d.subarray(g,g+6);zn.bezierBoundingBox(u,p,y,E,b,A,N,O,i),u=N,p=O}}const[s,l]=pe(this,Qh,Om).call(this);i[0]=tc(i[0]-s,0,1),i[1]=tc(i[1]-l,0,1),i[2]=tc(i[2]+s,0,1),i[3]=tc(i[3]+l,0,1),i[2]-=i[0],i[3]-=i[1]},Cj=new WeakSet,pwe=function(i){const[s,l]=pe(this,Qh,Om).call(this);re(this,nE,i);const[d,u]=pe(this,Qh,Om).call(this),[p,g]=[d-s,u-l],_=T(this,Ql);return _[0]-=p,_[1]-=g,_[2]+=2*p,_[3]+=2*g,_};class JU extends dwe{constructor(t){super(),this._viewParameters=t,super.updateProperties({fill:"none",stroke:ds._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(t,i){t==="stroke-width"&&(i??(i=this["stroke-width"]),i*=this._viewParameters.realScale),super.updateSVGProperty(t,i)}clone(){const t=new JU(this._viewParameters);return t.updateAll(this),t}}var Tj,mwe;const mC=class mC extends F7{constructor(i){super({...i,name:"inkEditor"});ee(this,Tj);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(i,s){ds.initialize(i,s),this._defaultDrawingOptions=new JU(s.viewParameters)}static getDefaultDrawingOptions(i){const s=this._defaultDrawingOptions.clone();return s.updateProperties(i),s}static get supportMultipleDrawings(){return!0}static get typesMap(){return Ki(this,"typesMap",new Map([[cr.INK_THICKNESS,"stroke-width"],[cr.INK_COLOR,"stroke"],[cr.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(i,s,l,d,u){return new oet(i,s,l,d,u,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(i,s,l,d,u,p){return sP.deserialize(i,s,l,d,u,p)}static async deserialize(i,s,l){let d=null;if(i instanceof fZ){const{data:{inkLists:p,rect:g,rotation:_,id:y,color:E,opacity:b,borderStyle:{rawWidth:A},popupRef:N,contentsObj:O},parent:{page:{pageNumber:D}}}=i;d=i={annotationType:_i.INK,color:Array.from(E),thickness:A,opacity:b,paths:{points:p},boxes:null,pageIndex:D-1,rect:g.slice(0),rotation:_,annotationElementId:y,id:y,deleted:!1,popupRef:N,comment:(O==null?void 0:O.str)||null}}const u=await super.deserialize(i,s,l);return u._initialData=d,i.comment&&u.setCommentData(i.comment),u}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new k7(this)),[["colorPicker",this._colorPicker]]}get colorType(){return cr.INK_COLOR}get colorValue(){return this._drawingOptions.stroke}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:i,_drawingOptions:s,parent:l}=this;s.updateSVGProperty("stroke-width"),l.drawLayer.updateProperties(i,s.toSVGProperties())}static onScaleChangingWhenDrawing(){const i=this._currentParent;i&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:i,thickness:s,opacity:l}){this._drawingOptions=mC.getDefaultDrawingOptions({stroke:zn.makeHexColor(...i),"stroke-width":s,"stroke-opacity":l})}serialize(i=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:s,points:l,rect:d}=this.serializeDraw(i),{_drawingOptions:{stroke:u,"stroke-opacity":p,"stroke-width":g}}=this,_={annotationType:_i.INK,color:ds._colorManager.convert(u),opacity:p,thickness:g,paths:{lines:s,points:l},pageIndex:this.pageIndex,rect:d,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(_),i?(_.isCopy=!0,_):this.annotationElementId&&!pe(this,Tj,mwe).call(this,_)?null:(_.id=this.annotationElementId,_)}renderAnnotationElement(i){const{points:s,rect:l}=this.serializeDraw(!1),d={rect:l,thickness:this._drawingOptions["stroke-width"],points:s};return this.hasEditedComment&&(d.popup=this.comment),i.updateEdited(d),null}};Tj=new WeakSet,mwe=function(i){const{color:s,thickness:l,opacity:d,pageIndex:u}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||i.color.some((p,g)=>p!==s[g])||i.thickness!==l||i.opacity!==d||i.pageIndex!==u},sn(mC,"_type","ink"),sn(mC,"_editorType",_i.INK),sn(mC,"_defaultDrawingOptions",null);let wX=mC;class SX extends sP{toSVGPath(){let t=super.toSVGPath();return t.endsWith("Z")||(t+="Z"),t}}const Pk=8,wI=3;var iE,CO,bX,Zh,Rj,gwe,xj,vwe,TO,CX,uR,IM,Aj,ywe,Ij,_we,Nj,Ewe,RO,TX,xO,RX,Oj,wwe;class za{static extractContoursFromText(t,{fontFamily:i,fontStyle:s,fontWeight:l},d,u,p,g){let _=new OffscreenCanvas(1,1),y=_.getContext("2d",{alpha:!1});const E=200,b=y.font=`${s} ${l} ${E}px ${i}`,{actualBoundingBoxLeft:A,actualBoundingBoxRight:N,actualBoundingBoxAscent:O,actualBoundingBoxDescent:D,fontBoundingBoxAscent:P,fontBoundingBoxDescent:j,width:M}=y.measureText(t),V=1.5,H=Math.ceil(Math.max(Math.abs(A)+Math.abs(N)||0,M)*V),$=Math.ceil(Math.max(Math.abs(O)+Math.abs(D)||E,Math.abs(P)+Math.abs(j)||E)*V);_=new OffscreenCanvas(H,$),y=_.getContext("2d",{alpha:!0,willReadFrequently:!0}),y.font=b,y.filter="grayscale(1)",y.fillStyle="white",y.fillRect(0,0,H,$),y.fillStyle="black",y.fillText(t,H*(V-1)/2,$*(3-V)/2);const Q=pe(this,RO,TX).call(this,y.getImageData(0,0,H,$).data),Y=pe(this,Nj,Ewe).call(this,Q),le=pe(this,xO,RX).call(this,Y),ae=pe(this,TO,CX).call(this,Q,H,$,le);return this.processDrawnLines({lines:{curves:ae,width:H,height:$},pageWidth:d,pageHeight:u,rotation:p,innerMargin:g,mustSmooth:!0,areContours:!0})}static process(t,i,s,l,d){const[u,p,g]=pe(this,Oj,wwe).call(this,t),[_,y]=pe(this,Ij,_we).call(this,u,p,g,Math.hypot(p,g)*T(this,iE).sigmaSFactor,T(this,iE).sigmaR,T(this,iE).kernelSize),E=pe(this,xO,RX).call(this,y),b=pe(this,TO,CX).call(this,_,p,g,E);return this.processDrawnLines({lines:{curves:b,width:p,height:g},pageWidth:i,pageHeight:s,rotation:l,innerMargin:d,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:t,pageWidth:i,pageHeight:s,rotation:l,innerMargin:d,mustSmooth:u,areContours:p}){l%180!==0&&([i,s]=[s,i]);const{curves:g,width:_,height:y}=t,E=t.thickness??0,b=[],A=Math.min(i/_,s/y),N=A/i,O=A/s,D=[];for(const{points:j}of g){const M=u?pe(this,Aj,ywe).call(this,j):j;if(!M)continue;D.push(M);const V=M.length,H=new Float32Array(V),$=new Float32Array(3*(V===2?2:V-2));if(b.push({line:$,points:H}),V===2){H[0]=M[0]*N,H[1]=M[1]*O,$.set([NaN,NaN,NaN,NaN,H[0],H[1]],0);continue}let[Q,Y,le,ae]=M;Q*=N,Y*=O,le*=N,ae*=O,H.set([Q,Y,le,ae],0),$.set([NaN,NaN,NaN,NaN,Q,Y],0);for(let te=4;te<V;te+=2){const de=H[te]=M[te]*N,G=H[te+1]=M[te+1]*O;$.set(xn.createBezierPoints(Q,Y,le,ae,de,G),(te-2)*3),[Q,Y,le,ae]=[le,ae,de,G]}}if(b.length===0)return null;const P=p?new SX:new sP;return P.build(b,i,s,1,l,p?0:E,d),{outline:P,newCurves:D,areContours:p,thickness:E,width:_,height:y}}static async compressSignature({outlines:t,areContours:i,thickness:s,width:l,height:d}){let u=1/0,p=-1/0,g=0;for(const M of t){g+=M.length;for(let V=2,H=M.length;V<H;V++){const $=M[V]-M[V-2];u=Math.min(u,$),p=Math.max(p,$)}}let _;u>=-128&&p<=127?_=Int8Array:u>=-32768&&p<=32767?_=Int16Array:_=Int32Array;const y=t.length,E=Pk+wI*y,b=new Uint32Array(E);let A=0;b[A++]=E*Uint32Array.BYTES_PER_ELEMENT+(g-2*y)*_.BYTES_PER_ELEMENT,b[A++]=0,b[A++]=l,b[A++]=d,b[A++]=i?0:1,b[A++]=Math.max(0,Math.floor(s??0)),b[A++]=y,b[A++]=_.BYTES_PER_ELEMENT;for(const M of t)b[A++]=M.length-2,b[A++]=M[0],b[A++]=M[1];const N=new CompressionStream("deflate-raw"),O=N.writable.getWriter();await O.ready,O.write(b);const D=_.prototype.constructor;for(const M of t){const V=new D(M.length-2);for(let H=2,$=M.length;H<$;H++)V[H-2]=M[H]-M[H-2];O.write(V)}O.close();const P=await new Response(N.readable).arrayBuffer(),j=new Uint8Array(P);return S2e(j)}static async decompressSignature(t){try{const i=NQe(t),{readable:s,writable:l}=new DecompressionStream("deflate-raw"),d=l.getWriter();await d.ready,d.write(i).then(async()=>{await d.ready,await d.close()}).catch(()=>{});let u=null,p=0;for await(const M of s)u||(u=new Uint8Array(new Uint32Array(M.buffer,0,4)[0])),u.set(M,p),p+=M.length;const g=new Uint32Array(u.buffer,0,u.length>>2),_=g[1];if(_!==0)throw new Error(`Invalid version: ${_}`);const y=g[2],E=g[3],b=g[4]===0,A=g[5],N=g[6],O=g[7],D=[],P=(Pk+wI*N)*Uint32Array.BYTES_PER_ELEMENT;let j;switch(O){case Int8Array.BYTES_PER_ELEMENT:j=new Int8Array(u.buffer,P);break;case Int16Array.BYTES_PER_ELEMENT:j=new Int16Array(u.buffer,P);break;case Int32Array.BYTES_PER_ELEMENT:j=new Int32Array(u.buffer,P);break}p=0;for(let M=0;M<N;M++){const V=g[wI*M+Pk],H=new Float32Array(V+2);D.push(H);for(let $=0;$<wI-1;$++)H[$]=g[wI*M+Pk+$+1];for(let $=0;$<V;$++)H[$+2]=H[$]+j[p++]}return{areContours:b,thickness:A,outlines:D,width:y,height:E}}catch(i){return Ei(`decompressSignature: ${i}`),null}}}iE=new WeakMap,CO=new WeakSet,bX=function(t,i,s,l){return s-=t,l-=i,s===0?l>0?0:4:s===1?l+6:2-l},Zh=new WeakMap,Rj=new WeakSet,gwe=function(t,i,s,l,d,u,p){const g=pe(this,CO,bX).call(this,s,l,d,u);for(let _=0;_<8;_++){const y=(-_+g-p+16)%8,E=T(this,Zh)[2*y],b=T(this,Zh)[2*y+1];if(t[(s+E)*i+(l+b)]!==0)return y}return-1},xj=new WeakSet,vwe=function(t,i,s,l,d,u,p){const g=pe(this,CO,bX).call(this,s,l,d,u);for(let _=0;_<8;_++){const y=(_+g+p+16)%8,E=T(this,Zh)[2*y],b=T(this,Zh)[2*y+1];if(t[(s+E)*i+(l+b)]!==0)return y}return-1},TO=new WeakSet,CX=function(t,i,s,l){const d=t.length,u=new Int32Array(d);for(let y=0;y<d;y++)u[y]=t[y]<=l?1:0;for(let y=1;y<s-1;y++)u[y*i]=u[y*i+i-1]=0;for(let y=0;y<i;y++)u[y]=u[i*s-1-y]=0;let p=1,g;const _=[];for(let y=1;y<s-1;y++){g=1;for(let E=1;E<i-1;E++){const b=y*i+E,A=u[b];if(A===0)continue;let N=y,O=E;if(A===1&&u[b-1]===0)p+=1,O-=1;else if(A>=1&&u[b+1]===0)p+=1,O+=1,A>1&&(g=A);else{A!==1&&(g=Math.abs(A));continue}const D=[E,y],P=O===E+1,j={isHole:P,points:D,id:p,parent:0};_.push(j);let M;for(const te of _)if(te.id===g){M=te;break}M?M.isHole?j.parent=P?M.parent:g:j.parent=P?g:M.parent:j.parent=P?g:0;const V=pe(this,Rj,gwe).call(this,u,i,y,E,N,O,0);if(V===-1){u[b]=-p,u[b]!==1&&(g=Math.abs(u[b]));continue}let H=T(this,Zh)[2*V],$=T(this,Zh)[2*V+1];const Q=y+H,Y=E+$;N=Q,O=Y;let le=y,ae=E;for(;;){const te=pe(this,xj,vwe).call(this,u,i,le,ae,N,O,1);H=T(this,Zh)[2*te],$=T(this,Zh)[2*te+1];const de=le+H,G=ae+$;D.push(G,de);const ie=le*i+ae;if(u[ie+1]===0?u[ie]=-p:u[ie]===1&&(u[ie]=p),de===y&&G===E&&le===Q&&ae===Y){u[b]!==1&&(g=Math.abs(u[b]));break}else N=le,O=ae,le=de,ae=G}}}return _},uR=new WeakSet,IM=function(t,i,s,l){if(s-i<=4){for(let Q=i;Q<s-2;Q+=2)l.push(t[Q],t[Q+1]);return}const d=t[i],u=t[i+1],p=t[s-4]-d,g=t[s-3]-u,_=Math.hypot(p,g),y=p/_,E=g/_,b=y*u-E*d,A=g/p,N=1/_,O=Math.atan(A),D=Math.cos(O),P=Math.sin(O),j=N*(Math.abs(D)+Math.abs(P)),M=N*(1-j+j**2),V=Math.max(Math.atan(Math.abs(P+D)*M),Math.atan(Math.abs(P-D)*M));let H=0,$=i;for(let Q=i+2;Q<s-2;Q+=2){const Y=Math.abs(b-y*t[Q+1]+E*t[Q]);Y>H&&($=Q,H=Y)}H>(_*V)**2?(pe(this,uR,IM).call(this,t,i,$+2,l),pe(this,uR,IM).call(this,t,$,s,l)):l.push(d,u)},Aj=new WeakSet,ywe=function(t){const i=[],s=t.length;return pe(this,uR,IM).call(this,t,0,s,i),i.push(t[s-2],t[s-1]),i.length<=4?null:i},Ij=new WeakSet,_we=function(t,i,s,l,d,u){const p=new Float32Array(u**2),g=-2*l**2,_=u>>1;for(let O=0;O<u;O++){const D=(O-_)**2;for(let P=0;P<u;P++)p[O*u+P]=Math.exp((D+(P-_)**2)/g)}const y=new Float32Array(256),E=-2*d**2;for(let O=0;O<256;O++)y[O]=Math.exp(O**2/E);const b=t.length,A=new Uint8Array(b),N=new Uint32Array(256);for(let O=0;O<s;O++)for(let D=0;D<i;D++){const P=O*i+D,j=t[P];let M=0,V=0;for(let $=0;$<u;$++){const Q=O+$-_;if(!(Q<0||Q>=s))for(let Y=0;Y<u;Y++){const le=D+Y-_;if(le<0||le>=i)continue;const ae=t[Q*i+le],te=p[$*u+Y]*y[Math.abs(ae-j)];M+=ae*te,V+=te}}const H=A[P]=Math.round(M/V);N[H]++}return[A,N]},Nj=new WeakSet,Ewe=function(t){const i=new Uint32Array(256);for(const s of t)i[s]++;return i},RO=new WeakSet,TX=function(t){const i=t.length,s=new Uint8ClampedArray(i>>2);let l=-1/0,d=1/0;for(let p=0,g=s.length;p<g;p++){const _=s[p]=t[p<<2];l=Math.max(l,_),d=Math.min(d,_)}const u=255/(l-d);for(let p=0,g=s.length;p<g;p++)s[p]=(s[p]-d)*u;return s},xO=new WeakSet,RX=function(t){let i,s=-1/0,l=-1/0;const d=t.findIndex(g=>g!==0);let u=d,p=d;for(i=d;i<256;i++){const g=t[i];g>s&&(i-u>l&&(l=i-u,p=i-1),s=g,u=i)}for(i=p-1;i>=0&&!(t[i]>t[i+1]);i--);return i},Oj=new WeakSet,wwe=function(t){const i=t,{width:s,height:l}=t,{maxDim:d}=T(this,iE);let u=s,p=l;if(s>d||l>d){let b=s,A=l,N=Math.log2(Math.max(s,l)/d);const O=Math.floor(N);N=N===O?O-1:O;for(let P=0;P<N;P++){u=Math.ceil(b/2),p=Math.ceil(A/2);const j=new OffscreenCanvas(u,p);j.getContext("2d").drawImage(t,0,0,b,A,0,0,u,p),b=u,A=p,t!==i&&t.close(),t=j.transferToImageBitmap()}const D=Math.min(d/u,d/p);u=Math.round(u*D),p=Math.round(p*D)}const _=new OffscreenCanvas(u,p).getContext("2d",{willReadFrequently:!0});_.fillStyle="white",_.fillRect(0,0,u,p),_.filter="grayscale(1)",_.drawImage(t,0,0,t.width,t.height,0,0,u,p);const y=_.getImageData(0,0,u,p).data;return[pe(this,RO,TX).call(this,y),u,p]},ee(za,CO),ee(za,Rj),ee(za,xj),ee(za,TO),ee(za,uR),ee(za,Aj),ee(za,Ij),ee(za,Nj),ee(za,RO),ee(za,xO),ee(za,Oj),ee(za,iE,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),ee(za,Zh,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));class pZ extends dwe{constructor(){super(),super.updateProperties({fill:ds._defaultLineColor,"stroke-width":0})}clone(){const t=new pZ;return t.updateAll(this),t}}class mZ extends JU{constructor(t){super(t),super.updateProperties({stroke:ds._defaultLineColor,"stroke-width":1})}clone(){const t=new mZ(this._viewParameters);return t.updateAll(this),t}}var iv,xp,rv,rE;const bd=class bd extends F7{constructor(i){super({...i,mustBeCommitted:!0,name:"signatureEditor"});ee(this,iv,!1);ee(this,xp,null);ee(this,rv,null);ee(this,rE,null);this._willKeepAspectRatio=!0,re(this,rv,i.signatureData||null),re(this,xp,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(i,s){ds.initialize(i,s),this._defaultDrawingOptions=new pZ,this._defaultDrawnSignatureOptions=new mZ(s.viewParameters)}static getDefaultDrawingOptions(i){const s=this._defaultDrawingOptions.clone();return s.updateProperties(i),s}static get supportMultipleDrawings(){return!1}static get typesMap(){return Ki(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!T(this,xp)}}static computeTelemetryFinalData(i){const s=i.get("hasDescription");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let i,s;const{_isCopy:l}=this;if(l&&(this._isCopy=!1,i=this.x,s=this.y),super.render(),this._drawId===null)if(T(this,rv)){const{lines:d,mustSmooth:u,areContours:p,description:g,uuid:_,heightInPage:y}=T(this,rv),{rawDims:{pageWidth:E,pageHeight:b},rotation:A}=this.parent.viewport,N=za.processDrawnLines({lines:d,pageWidth:E,pageHeight:b,rotation:A,innerMargin:bd._INNER_MARGIN,mustSmooth:u,areContours:p});this.addSignature(N,y,g,_)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:T(this,xp)||""}));return l&&(this._isCopy=!0,this._moveAfterPaste(i,s)),this.div}setUuid(i){re(this,rE,i),this.addEditToolbar()}getUuid(){return T(this,rE)}get description(){return T(this,xp)}set description(i){re(this,xp,i),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:i})),super.addEditToolbar().then(s=>{s==null||s.updateEditSignatureButton(i)}))}getSignaturePreview(){const{newCurves:i,areContours:s,thickness:l,width:d,height:u}=T(this,rv),p=Math.max(d,u),g=za.processDrawnLines({lines:{curves:i.map(_=>({points:_})),thickness:l,width:d,height:u},pageWidth:p,pageHeight:p,rotation:0,innerMargin:0,mustSmooth:!1,areContours:s});return{areContours:s,outline:g.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(i,s,l,d){const{x:u,y:p}=this,{outline:g}=re(this,rv,i);re(this,iv,g instanceof SX),this.description=l;let _;T(this,iv)?_=bd.getDefaultDrawingOptions():(_=bd._defaultDrawnSignatureOptions.clone(),_.updateProperties({"stroke-width":g.thickness})),this._addOutlines({drawOutlines:g,drawingOptions:_});const[y,E]=this.parentDimensions,[,b]=this.pageDimensions;let A=s/b;A=A>=1?.5:A,this.width*=A/this.height,this.width>=1&&(A*=.9/this.width,this.width=.9),this.height=A,this.setDims(y*this.width,E*this.height),this.x=u,this.y=p,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(d),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!d,hasDescription:!!l}}),this.div.hidden=!1}getFromImage(i){const{rawDims:{pageWidth:s,pageHeight:l},rotation:d}=this.parent.viewport;return za.process(i,s,l,d,bd._INNER_MARGIN)}getFromText(i,s){const{rawDims:{pageWidth:l,pageHeight:d},rotation:u}=this.parent.viewport;return za.extractContoursFromText(i,s,l,d,u,bd._INNER_MARGIN)}getDrawnSignature(i){const{rawDims:{pageWidth:s,pageHeight:l},rotation:d}=this.parent.viewport;return za.processDrawnLines({lines:i,pageWidth:s,pageHeight:l,rotation:d,innerMargin:bd._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:i,thickness:s}){i?this._drawingOptions=bd.getDefaultDrawingOptions():(this._drawingOptions=bd._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":s}))}serialize(i=!1){if(this.isEmpty())return null;const{lines:s,points:l,rect:d}=this.serializeDraw(i),{_drawingOptions:{"stroke-width":u}}=this,p={annotationType:_i.SIGNATURE,isSignature:!0,areContours:T(this,iv),color:[0,0,0],thickness:T(this,iv)?0:u,pageIndex:this.pageIndex,rect:d,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return this.addComment(p),i?(p.paths={lines:s,points:l},p.uuid=T(this,rE),p.isCopy=!0):p.lines=s,T(this,xp)&&(p.accessibilityData={type:"Figure",alt:T(this,xp)}),p}static deserializeDraw(i,s,l,d,u,p){return p.areContours?SX.deserialize(i,s,l,d,u,p):sP.deserialize(i,s,l,d,u,p)}static async deserialize(i,s,l){var u;const d=await super.deserialize(i,s,l);return re(d,iv,i.areContours),d.description=((u=i.accessibilityData)==null?void 0:u.alt)||"",re(d,rE,i.uuid),d}};iv=new WeakMap,xp=new WeakMap,rv=new WeakMap,rE=new WeakMap,sn(bd,"_type","signature"),sn(bd,"_editorType",_i.SIGNATURE),sn(bd,"_defaultDrawingOptions",null);let xX=bd;var Ps,go,sv,mg,av,hR,gg,sE,Ap,jd,fR,aE,ZI,oE,e4,pR,NM,mR,OM,gR,PM,AO,IX,vR,LM,Pj,Swe;class AX extends ds{constructor(i){super({...i,name:"stampEditor"});ee(this,aE);ee(this,oE);ee(this,pR);ee(this,mR);ee(this,gR);ee(this,AO);ee(this,vR);ee(this,Pj);ee(this,Ps,null);ee(this,go,null);ee(this,sv,null);ee(this,mg,null);ee(this,av,null);ee(this,hR,"");ee(this,gg,null);ee(this,sE,!1);ee(this,Ap,null);ee(this,jd,!1);ee(this,fR,!1);re(this,mg,i.bitmapUrl),re(this,av,i.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(i,s){ds.initialize(i,s)}static isHandlingMimeForPasting(i){return wY.includes(i)}static paste(i,s){s.pasteEditor({mode:_i.STAMP},{bitmapFile:i.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){var i;return{type:"stamp",hasAltText:!!((i=this.altTextData)!=null&&i.altText)}}static computeTelemetryFinalData(i){const s=i.get("hasAltText");return{hasAltText:s.get(!0)??0,hasNoAltText:s.get(!1)??0}}async mlGuessAltText(i=null,s=!0){if(this.hasAltTextData())return null;const{mlManager:l}=this._uiManager;if(!l)throw new Error("No ML.");if(!await l.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:d,width:u,height:p}=i||this.copyCanvas(null,null,!0).imageData,g=await l.guess({name:"altText",request:{data:d,width:u,height:p,channels:d.length/(u*p)}});if(!g)throw new Error("No response from the AI service.");if(g.error)throw new Error("Error from the AI service.");if(g.cancel)return null;if(!g.output)throw new Error("No valid response from the AI service.");const _=g.output;return await this.setGuessedAltText(_),s&&!this.hasAltTextData()&&(this.altTextData={alt:_,decorative:!1}),_}remove(){var i;T(this,go)&&(re(this,Ps,null),this._uiManager.imageManager.deleteId(T(this,go)),(i=T(this,gg))==null||i.remove(),re(this,gg,null),T(this,Ap)&&(clearTimeout(T(this,Ap)),re(this,Ap,null))),super.remove()}rebuild(){if(!this.parent){T(this,go)&&pe(this,pR,NM).call(this);return}super.rebuild(),this.div!==null&&(T(this,go)&&T(this,gg)===null&&pe(this,pR,NM).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(i){this._isDraggable=!0,i&&this.div.focus()}isEmpty(){return!(T(this,sv)||T(this,Ps)||T(this,mg)||T(this,av)||T(this,go)||T(this,sE))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let i,s;return this._isCopy&&(i=this.x,s=this.y),super.render(),this.div.hidden=!0,this.createAltText(),T(this,sE)||(T(this,Ps)?pe(this,mR,OM).call(this):pe(this,pR,NM).call(this)),this._isCopy&&this._moveAfterPaste(i,s),this._uiManager.addShouldRescale(this),this.div}setCanvas(i,s){const{id:l,bitmap:d}=this._uiManager.imageManager.getFromCanvas(i,s);s.remove(),l&&this._uiManager.imageManager.isValidId(l)&&(re(this,go,l),d&&re(this,Ps,d),re(this,sE,!1),pe(this,mR,OM).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;T(this,Ap)!==null&&clearTimeout(T(this,Ap)),re(this,Ap,setTimeout(()=>{re(this,Ap,null),pe(this,AO,IX).call(this)},200))}copyCanvas(i,s,l=!1){var A;i||(i=224);const{width:d,height:u}=T(this,Ps),p=new Up;let g=T(this,Ps),_=d,y=u,E=null;if(s){if(d>s||u>s){const Y=Math.min(s/d,s/u);_=Math.floor(d*Y),y=Math.floor(u*Y)}E=document.createElement("canvas");const N=E.width=Math.ceil(_*p.sx),O=E.height=Math.ceil(y*p.sy);T(this,jd)||(g=pe(this,gR,PM).call(this,N,O));const D=E.getContext("2d");D.filter=this._uiManager.hcmFilter;let P="white",j="#cfcfd8";this._uiManager.hcmFilter!=="none"?j="black":(A=window.matchMedia)!=null&&A.call(window,"(prefers-color-scheme: dark)").matches&&(P="#8f8f9d",j="#42414d");const M=15,V=M*p.sx,H=M*p.sy,$=new OffscreenCanvas(V*2,H*2),Q=$.getContext("2d");Q.fillStyle=P,Q.fillRect(0,0,V*2,H*2),Q.fillStyle=j,Q.fillRect(0,0,V,H),Q.fillRect(V,H,V,H),D.fillStyle=D.createPattern($,"repeat"),D.fillRect(0,0,N,O),D.drawImage(g,0,0,g.width,g.height,0,0,N,O)}let b=null;if(l){let N,O;if(p.symmetric&&g.width<i&&g.height<i)N=g.width,O=g.height;else if(g=T(this,Ps),d>i||u>i){const j=Math.min(i/d,i/u);N=Math.floor(d*j),O=Math.floor(u*j),T(this,jd)||(g=pe(this,gR,PM).call(this,N,O))}const P=new OffscreenCanvas(N,O).getContext("2d",{willReadFrequently:!0});P.drawImage(g,0,0,g.width,g.height,0,0,N,O),b={width:N,height:O,data:P.getImageData(0,0,N,O).data}}return{canvas:E,width:_,height:y,imageData:b}}static async deserialize(i,s,l){var D;let d=null,u=!1;if(i instanceof UEe){const{data:{rect:P,rotation:j,id:M,structParent:V,popupRef:H,contentsObj:$},container:Q,parent:{page:{pageNumber:Y}},canvas:le}=i;let ae,te;le?(delete i.canvas,{id:ae,bitmap:te}=l.imageManager.getFromCanvas(Q.id,le),le.remove()):(u=!0,i._hasNoCanvas=!0);const de=((D=await s._structTree.getAriaAttributes(`${aZ}${M}`))==null?void 0:D.get("aria-label"))||"";d=i={annotationType:_i.STAMP,bitmapId:ae,bitmap:te,pageIndex:Y-1,rect:P.slice(0),rotation:j,annotationElementId:M,id:M,deleted:!1,accessibilityData:{decorative:!1,altText:de},isSvg:!1,structParent:V,popupRef:H,comment:($==null?void 0:$.str)||null}}const p=await super.deserialize(i,s,l),{rect:g,bitmap:_,bitmapUrl:y,bitmapId:E,isSvg:b,accessibilityData:A}=i;u?(l.addMissingCanvas(i.id,p),re(p,sE,!0)):E&&l.imageManager.isValidId(E)?(re(p,go,E),_&&re(p,Ps,_)):re(p,mg,y),re(p,jd,b);const[N,O]=p.pageDimensions;return p.width=(g[2]-g[0])/N,p.height=(g[3]-g[1])/O,A&&(p.altTextData=A),p._initialData=d,i.comment&&p.setCommentData(i.comment),re(p,fR,!!d),p}serialize(i=!1,s=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const l={annotationType:_i.STAMP,bitmapId:T(this,go),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:T(this,jd),structTreeParentId:this._structTreeParentId};if(this.addComment(l),i)return l.bitmapUrl=pe(this,vR,LM).call(this,!0),l.accessibilityData=this.serializeAltText(!0),l.isCopy=!0,l;const{decorative:d,altText:u}=this.serializeAltText(!1);if(!d&&u&&(l.accessibilityData={type:"Figure",alt:u}),this.annotationElementId){const g=pe(this,Pj,Swe).call(this,l);if(g.isSame)return null;g.isSameAltText?delete l.accessibilityData:l.accessibilityData.structParent=this._initialData.structParent??-1}if(l.id=this.annotationElementId,s===null)return l;s.stamps||(s.stamps=new Map);const p=T(this,jd)?(l.rect[2]-l.rect[0])*(l.rect[3]-l.rect[1]):null;if(!s.stamps.has(T(this,go)))s.stamps.set(T(this,go),{area:p,serialized:l}),l.bitmap=pe(this,vR,LM).call(this,!1);else if(T(this,jd)){const g=s.stamps.get(T(this,go));p>g.area&&(g.area=p,g.serialized.bitmap.close(),g.serialized.bitmap=pe(this,vR,LM).call(this,!1))}return l}renderAnnotationElement(i){const s={rect:this.getRect(0,0)};return this.hasEditedComment&&(s.popup=this.comment),i.updateEdited(s),null}}Ps=new WeakMap,go=new WeakMap,sv=new WeakMap,mg=new WeakMap,av=new WeakMap,hR=new WeakMap,gg=new WeakMap,sE=new WeakMap,Ap=new WeakMap,jd=new WeakMap,fR=new WeakMap,aE=new WeakSet,ZI=function(i,s=!1){if(!i){this.remove();return}re(this,Ps,i.bitmap),s||(re(this,go,i.id),re(this,jd,i.isSvg)),i.file&&re(this,hR,i.file.name),pe(this,mR,OM).call(this)},oE=new WeakSet,e4=function(){if(re(this,sv,null),this._uiManager.enableWaiting(!1),!!T(this,gg)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&T(this,Ps)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&T(this,Ps)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},pR=new WeakSet,NM=function(){if(T(this,go)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(T(this,go)).then(l=>pe(this,aE,ZI).call(this,l,!0)).finally(()=>pe(this,oE,e4).call(this));return}if(T(this,mg)){const l=T(this,mg);re(this,mg,null),this._uiManager.enableWaiting(!0),re(this,sv,this._uiManager.imageManager.getFromUrl(l).then(d=>pe(this,aE,ZI).call(this,d)).finally(()=>pe(this,oE,e4).call(this)));return}if(T(this,av)){const l=T(this,av);re(this,av,null),this._uiManager.enableWaiting(!0),re(this,sv,this._uiManager.imageManager.getFromFile(l).then(d=>pe(this,aE,ZI).call(this,d)).finally(()=>pe(this,oE,e4).call(this)));return}const i=document.createElement("input");i.type="file",i.accept=wY.join(",");const s=this._uiManager._signal;re(this,sv,new Promise(l=>{i.addEventListener("change",async()=>{if(!i.files||i.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const d=await this._uiManager.imageManager.getFromFile(i.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),pe(this,aE,ZI).call(this,d)}l()},{signal:s}),i.addEventListener("cancel",()=>{this.remove(),l()},{signal:s})}).finally(()=>pe(this,oE,e4).call(this))),i.click()},mR=new WeakSet,OM=function(){var E;const{div:i}=this;let{width:s,height:l}=T(this,Ps);const[d,u]=this.pageDimensions,p=.75;if(this.width)s=this.width*d,l=this.height*u;else if(s>p*d||l>p*u){const b=Math.min(p*d/s,p*u/l);s*=b,l*=b}const[g,_]=this.parentDimensions;this.setDims(s*g/d,l*_/u),this._uiManager.enableWaiting(!1);const y=re(this,gg,document.createElement("canvas"));y.setAttribute("role","img"),this.addContainer(y),this.width=s/d,this.height=l/u,(E=this._initialOptions)!=null&&E.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(i.hidden=!1),pe(this,AO,IX).call(this),T(this,fR)||(this.parent.addUndoableEditor(this),re(this,fR,!0)),this._reportTelemetry({action:"inserted_image"}),T(this,hR)&&this.div.setAttribute("aria-description",T(this,hR)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},gR=new WeakSet,PM=function(i,s){const{width:l,height:d}=T(this,Ps);let u=l,p=d,g=T(this,Ps);for(;u>2*i||p>2*s;){const _=u,y=p;u>2*i&&(u=u>=16384?Math.floor(u/2)-1:Math.ceil(u/2)),p>2*s&&(p=p>=16384?Math.floor(p/2)-1:Math.ceil(p/2));const E=new OffscreenCanvas(u,p);E.getContext("2d").drawImage(g,0,0,_,y,0,0,u,p),g=E.transferToImageBitmap()}return g},AO=new WeakSet,IX=function(){const[i,s]=this.parentDimensions,{width:l,height:d}=this,u=new Up,p=Math.ceil(l*i*u.sx),g=Math.ceil(d*s*u.sy),_=T(this,gg);if(!_||_.width===p&&_.height===g)return;_.width=p,_.height=g;const y=T(this,jd)?T(this,Ps):pe(this,gR,PM).call(this,p,g),E=_.getContext("2d");E.filter=this._uiManager.hcmFilter,E.drawImage(y,0,0,y.width,y.height,0,0,p,g)},vR=new WeakSet,LM=function(i){if(i){if(T(this,jd)){const d=this._uiManager.imageManager.getSvgUrl(T(this,go));if(d)return d}const s=document.createElement("canvas");return{width:s.width,height:s.height}=T(this,Ps),s.getContext("2d").drawImage(T(this,Ps),0,0),s.toDataURL()}if(T(this,jd)){const[s,l]=this.pageDimensions,d=Math.round(this.width*s*kv.PDF_TO_CSS_UNITS),u=Math.round(this.height*l*kv.PDF_TO_CSS_UNITS),p=new OffscreenCanvas(d,u);return p.getContext("2d").drawImage(T(this,Ps),0,0,T(this,Ps).width,T(this,Ps).height,0,0,d,u),p.transferToImageBitmap()}return structuredClone(T(this,Ps))},Pj=new WeakSet,Swe=function(i){var p;const{pageIndex:s,accessibilityData:{altText:l}}=this._initialData,d=i.pageIndex===s,u=(((p=i.accessibilityData)==null?void 0:p.alt)||"")===l;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&d&&u,isSameAltText:u}},sn(AX,"_type","stamp"),sn(AX,"_editorType",_i.STAMP);var lE,yR,Ip,ov,vg,Ud,lv,_R,cE,ef,yg,vo,_g,cv,ER,Fn,dv,Lj,bwe,qu,ep,IO,OX,NO,PX,wR,DM;const Fh=class Fh{constructor({uiManager:t,pageIndex:i,div:s,structTreeLayer:l,accessibilityManager:d,annotationLayer:u,drawLayer:p,textLayer:g,viewport:_,l10n:y}){ee(this,Lj);ee(this,qu);ee(this,IO);ee(this,NO);ee(this,wR);ee(this,lE,void 0);ee(this,yR,!1);ee(this,Ip,null);ee(this,ov,null);ee(this,vg,null);ee(this,Ud,new Map);ee(this,lv,!1);ee(this,_R,!1);ee(this,cE,!1);ee(this,ef,null);ee(this,yg,null);ee(this,vo,null);ee(this,_g,null);ee(this,cv,null);ee(this,ER,-1);ee(this,Fn,void 0);const E=[...T(Fh,dv).values()];if(!Fh._initialized){Fh._initialized=!0;for(const b of E)b.initialize(y,t)}t.registerEditorTypes(E),re(this,Fn,t),this.pageIndex=i,this.div=s,re(this,lE,d),re(this,Ip,u),this.viewport=_,re(this,vo,g),this.drawLayer=p,this._structTree=l,T(this,Fn).addLayer(this)}get isEmpty(){return T(this,Ud).size===0}get isInvisible(){return this.isEmpty&&T(this,Fn).getMode()===_i.NONE}updateToolbar(t){T(this,Fn).updateToolbar(t)}updateMode(t=T(this,Fn).getMode()){switch(pe(this,wR,DM).call(this),t){case _i.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case _i.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case _i.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:i}=this.div;for(const s of T(Fh,dv).values())i.toggle(`${s._type}Editing`,t===s._editorType);this.div.hidden=!1}hasTextLayer(t){var i;return t===((i=T(this,vo))==null?void 0:i.div)}setEditingState(t){T(this,Fn).setEditingState(t)}addCommands(t){T(this,Fn).addCommands(t)}cleanUndoStack(t){T(this,Fn).cleanUndoStack(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){var i;(i=T(this,Ip))==null||i.div.classList.toggle("disabled",!t)}async enable(){var s;re(this,cE,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),(s=T(this,cv))==null||s.abort(),re(this,cv,null);const t=new Set;for(const l of T(this,Ud).values())l.enableEditing(),l.show(!0),l.annotationElementId&&(T(this,Fn).removeChangedExistingAnnotation(l),t.add(l.annotationElementId));if(!T(this,Ip)){re(this,cE,!1);return}const i=T(this,Ip).getEditableAnnotations();for(const l of i){if(l.hide(),T(this,Fn).isDeletedAnnotationElement(l.data.id)||t.has(l.data.id))continue;const d=await this.deserialize(l);d&&(this.addOrRebuild(d),d.enableEditing())}re(this,cE,!1)}disable(){var l;if(re(this,_R,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),T(this,vo)&&!T(this,cv)){re(this,cv,new AbortController);const d=T(this,Fn).combinedSignal(T(this,cv));T(this,vo).div.addEventListener("pointerdown",u=>{const{clientX:g,clientY:_,timeStamp:y}=u,E=T(this,ER);if(y-E>500){re(this,ER,y);return}re(this,ER,-1);const{classList:b}=this.div;b.toggle("getElements",!0);const A=document.elementsFromPoint(g,_);if(b.toggle("getElements",!1),!this.div.contains(A[0]))return;let N;const O=new RegExp(`^${v2e}[0-9]+$`);for(const P of A)if(O.test(P.id)){N=P.id;break}if(!N)return;const D=T(this,Ud).get(N);(D==null?void 0:D.annotationElementId)===null&&(u.stopPropagation(),u.preventDefault(),D.dblclick())},{signal:d,capture:!0})}const t=new Map,i=new Map;for(const d of T(this,Ud).values())if(d.disableEditing(),!!d.annotationElementId){if(d.serialize()!==null){t.set(d.annotationElementId,d);continue}else i.set(d.annotationElementId,d);(l=this.getEditableAnnotation(d.annotationElementId))==null||l.show(),d.remove()}if(T(this,Ip)){const d=T(this,Ip).getEditableAnnotations();for(const u of d){const{id:p}=u.data;if(T(this,Fn).isDeletedAnnotationElement(p)){u.updateEdited({deleted:!0});continue}let g=i.get(p);if(g){g.resetAnnotationElement(u),g.show(!1),u.show();continue}g=t.get(p),g&&(T(this,Fn).addChangedExistingAnnotation(g),g.renderAnnotationElement(u)&&g.show(!1)),u.show()}}pe(this,wR,DM).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const d of T(Fh,dv).values())s.remove(`${d._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),re(this,_R,!1)}getEditableAnnotation(t){var i;return((i=T(this,Ip))==null?void 0:i.getEditableAnnotation(t))||null}setActiveEditor(t){T(this,Fn).getActive()!==t&&T(this,Fn).setActiveEditor(t)}enableTextSelection(){var t;if(this.div.tabIndex=-1,(t=T(this,vo))!=null&&t.div&&!T(this,_g)){re(this,_g,new AbortController);const i=T(this,Fn).combinedSignal(T(this,_g));T(this,vo).div.addEventListener("pointerdown",pe(this,Lj,bwe).bind(this),{signal:i}),T(this,vo).div.classList.add("highlighting")}}disableTextSelection(){var t;this.div.tabIndex=0,(t=T(this,vo))!=null&&t.div&&T(this,_g)&&(T(this,_g).abort(),re(this,_g,null),T(this,vo).div.classList.remove("highlighting"))}enableClick(){if(T(this,ov))return;re(this,ov,new AbortController);const t=T(this,Fn).combinedSignal(T(this,ov));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t});const i=this.pointerup.bind(this);this.div.addEventListener("pointerup",i,{signal:t}),this.div.addEventListener("pointercancel",i,{signal:t})}disableClick(){var t;(t=T(this,ov))==null||t.abort(),re(this,ov,null)}attach(t){T(this,Ud).set(t.id,t);const{annotationElementId:i}=t;i&&T(this,Fn).isDeletedAnnotationElement(i)&&T(this,Fn).removeDeletedAnnotationElement(t)}detach(t){var i;T(this,Ud).delete(t.id),(i=T(this,lE))==null||i.removePointerInTextLayer(t.contentDiv),!T(this,_R)&&t.annotationElementId&&T(this,Fn).addDeletedAnnotationElement(t)}remove(t){this.detach(t),T(this,Fn).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1}changeParent(t){var i;t.parent!==this&&(t.parent&&t.annotationElementId&&(T(this,Fn).addDeletedAnnotationElement(t.annotationElementId),ds.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),(i=t.parent)==null||i.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),T(this,Fn).addEditor(t),this.attach(t),!t.isAttachedToDOM){const i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(!T(this,cE)),T(this,Fn).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var s;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!T(this,vg)&&(t._focusEventsAllowed=!1,re(this,vg,setTimeout(()=>{re(this,vg,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:T(this,Fn)._signal}),i.focus())},0))),t._structTreeParentId=(s=T(this,lE))==null?void 0:s.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){const i=()=>t._uiManager.rebuild(t),s=()=>{t.remove()};this.addCommands({cmd:i,undo:s,mustExec:!1})}getNextId(){return T(this,Fn).getId()}combinedSignal(t){return T(this,Fn).combinedSignal(t)}canCreateNewEmptyEditor(){var t;return(t=T(this,qu,ep))==null?void 0:t.canCreateNewEmptyEditor()}async pasteEditor(t,i){this.updateToolbar(t),await T(this,Fn).updateMode(t.mode);const{offsetX:s,offsetY:l}=pe(this,NO,PX).call(this),d=this.getNextId(),u=pe(this,IO,OX).call(this,{parent:this,id:d,x:s,y:l,uiManager:T(this,Fn),isCentered:!0,...i});u&&this.add(u)}async deserialize(t){var i;return await((i=T(Fh,dv).get(t.annotationType??t.annotationEditorType))==null?void 0:i.deserialize(t,this,T(this,Fn)))||null}createAndAddNewEditor(t,i,s={}){const l=this.getNextId(),d=pe(this,IO,OX).call(this,{parent:this,id:l,x:t.offsetX,y:t.offsetY,uiManager:T(this,Fn),isCentered:i,...s});return d&&this.add(d),d}addNewEditor(t={}){this.createAndAddNewEditor(pe(this,NO,PX).call(this),!0,t)}setSelected(t){T(this,Fn).setSelected(t)}toggleSelected(t){T(this,Fn).toggleSelected(t)}unselect(t){T(this,Fn).unselect(t)}pointerup(t){var l;const{isMac:i}=qo.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div||!T(this,lv)||(re(this,lv,!1),(l=T(this,qu,ep))!=null&&l.isDrawer&&T(this,qu,ep).supportMultipleDrawings))return;if(!T(this,yR)){re(this,yR,!0);return}const s=T(this,Fn).getMode();if(s===_i.STAMP||s===_i.SIGNATURE){T(this,Fn).unselectAll();return}this.createAndAddNewEditor(t,!1)}pointerdown(t){var l;if(T(this,Fn).getMode()===_i.HIGHLIGHT&&this.enableTextSelection(),T(this,lv)){re(this,lv,!1);return}const{isMac:i}=qo.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div)return;if(re(this,lv,!0),(l=T(this,qu,ep))!=null&&l.isDrawer){this.startDrawingSession(t);return}const s=T(this,Fn).getActive();re(this,yR,!s||s.isEmpty())}startDrawingSession(t){if(this.div.focus({preventScroll:!0}),T(this,ef)){T(this,qu,ep).startDrawing(this,T(this,Fn),!1,t);return}T(this,Fn).setCurrentDrawingSession(this),re(this,ef,new AbortController);const i=T(this,Fn).combinedSignal(T(this,ef));this.div.addEventListener("blur",({relatedTarget:s})=>{s&&!this.div.contains(s)&&(re(this,yg,null),this.commitOrRemove())},{signal:i}),T(this,qu,ep).startDrawing(this,T(this,Fn),!1,t)}pause(t){if(t){const{activeElement:i}=document;this.div.contains(i)&&re(this,yg,i);return}T(this,yg)&&setTimeout(()=>{var i;(i=T(this,yg))==null||i.focus(),re(this,yg,null)},0)}endDrawingSession(t=!1){return T(this,ef)?(T(this,Fn).setCurrentDrawingSession(null),T(this,ef).abort(),re(this,ef,null),re(this,yg,null),T(this,qu,ep).endDrawing(t)):null}findNewParent(t,i,s){const l=T(this,Fn).findParent(i,s);return l===null||l===this?!1:(l.changeParent(t),!0)}commitOrRemove(){return T(this,ef)?(this.endDrawingSession(),!0):!1}onScaleChanging(){T(this,ef)&&T(this,qu,ep).onScaleChangingWhenDrawing(this)}destroy(){var t,i;this.commitOrRemove(),((t=T(this,Fn).getActive())==null?void 0:t.parent)===this&&(T(this,Fn).commitOrRemove(),T(this,Fn).setActiveEditor(null)),T(this,vg)&&(clearTimeout(T(this,vg)),re(this,vg,null));for(const s of T(this,Ud).values())(i=T(this,lE))==null||i.removePointerInTextLayer(s.contentDiv),s.setParent(null),s.isAttachedToDOM=!1,s.div.remove();this.div=null,T(this,Ud).clear(),T(this,Fn).removeLayer(this)}render({viewport:t}){this.viewport=t,NE(this.div,t);for(const i of T(this,Fn).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update({viewport:t}){T(this,Fn).commitOrRemove(),pe(this,wR,DM).call(this);const i=this.viewport.rotation,s=t.rotation;if(this.viewport=t,NE(this.div,{rotation:s}),i!==s)for(const l of T(this,Ud).values())l.rotate(s)}get pageDimensions(){const{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return T(this,Fn).viewParameters.realScale}};lE=new WeakMap,yR=new WeakMap,Ip=new WeakMap,ov=new WeakMap,vg=new WeakMap,Ud=new WeakMap,lv=new WeakMap,_R=new WeakMap,cE=new WeakMap,ef=new WeakMap,yg=new WeakMap,vo=new WeakMap,_g=new WeakMap,cv=new WeakMap,ER=new WeakMap,Fn=new WeakMap,dv=new WeakMap,Lj=new WeakSet,bwe=function(t){T(this,Fn).unselectAll();const{target:i}=t;if(i===T(this,vo).div||(i.getAttribute("role")==="img"||i.classList.contains("endOfContent"))&&T(this,vo).div.contains(i)){const{isMac:s}=qo.platform;if(t.button!==0||t.ctrlKey&&s)return;T(this,Fn).showAllEditors("highlight",!0,!0),T(this,vo).div.classList.add("free"),this.toggleDrawing(),U7.startHighlighting(this,T(this,Fn).direction==="ltr",{target:T(this,vo).div,x:t.x,y:t.y}),T(this,vo).div.addEventListener("pointerup",()=>{T(this,vo).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:T(this,Fn)._signal}),t.preventDefault()}},qu=new WeakSet,ep=function(){return T(Fh,dv).get(T(this,Fn).getMode())},IO=new WeakSet,OX=function(t){const i=T(this,qu,ep);return i?new i.prototype.constructor(t):null},NO=new WeakSet,PX=function(){const{x:t,y:i,width:s,height:l}=this.div.getBoundingClientRect(),d=Math.max(0,t),u=Math.max(0,i),p=Math.min(window.innerWidth,t+s),g=Math.min(window.innerHeight,i+l),_=(d+p)/2-t,y=(u+g)/2-i,[E,b]=this.viewport.rotation%180===0?[_,y]:[y,_];return{offsetX:E,offsetY:b}},wR=new WeakSet,DM=function(){for(const t of T(this,Ud).values())t.isEmpty()&&t.remove()},sn(Fh,"_initialized",!1),ee(Fh,dv,new Map([uX,wX,AX,U7,xX].map(t=>[t._editorType,t])));let NX=Fh;var tf,Zl,dE,OO,Dj,Cwe,PO,DX,kj,Twe,LO,kX;const Ua=class Ua{constructor({pageIndex:t}){ee(this,PO);ee(this,kj);ee(this,LO);ee(this,tf,null);ee(this,Zl,new Map);ee(this,dE,new Map);this.pageIndex=t}setParent(t){if(!T(this,tf)){re(this,tf,t);return}if(T(this,tf)!==t){if(T(this,Zl).size>0)for(const i of T(this,Zl).values())i.remove(),t.append(i);re(this,tf,t)}}static get _svgFactory(){return Ki(this,"_svgFactory",new M7)}draw(t,i=!1,s=!1){const l=ao(Ua,OO)._++,d=pe(this,PO,DX).call(this),u=Ua._svgFactory.createElement("defs");d.append(u);const p=Ua._svgFactory.createElement("path");u.append(p);const g=`path_p${this.pageIndex}_${l}`;p.setAttribute("id",g),p.setAttribute("vector-effect","non-scaling-stroke"),i&&T(this,dE).set(l,p);const _=s?pe(this,kj,Twe).call(this,u,g):null,y=Ua._svgFactory.createElement("use");return d.append(y),y.setAttribute("href",`#${g}`),this.updateProperties(d,t),T(this,Zl).set(l,d),{id:l,clipPathId:`url(#${_})`}}drawOutline(t,i){const s=ao(Ua,OO)._++,l=pe(this,PO,DX).call(this),d=Ua._svgFactory.createElement("defs");l.append(d);const u=Ua._svgFactory.createElement("path");d.append(u);const p=`path_p${this.pageIndex}_${s}`;u.setAttribute("id",p),u.setAttribute("vector-effect","non-scaling-stroke");let g;if(i){const E=Ua._svgFactory.createElement("mask");d.append(E),g=`mask_p${this.pageIndex}_${s}`,E.setAttribute("id",g),E.setAttribute("maskUnits","objectBoundingBox");const b=Ua._svgFactory.createElement("rect");E.append(b),b.setAttribute("width","1"),b.setAttribute("height","1"),b.setAttribute("fill","white");const A=Ua._svgFactory.createElement("use");E.append(A),A.setAttribute("href",`#${p}`),A.setAttribute("stroke","none"),A.setAttribute("fill","black"),A.setAttribute("fill-rule","nonzero"),A.classList.add("mask")}const _=Ua._svgFactory.createElement("use");l.append(_),_.setAttribute("href",`#${p}`),g&&_.setAttribute("mask",`url(#${g})`);const y=_.cloneNode();return l.append(y),_.classList.add("mainOutline"),y.classList.add("secondaryOutline"),this.updateProperties(l,t),T(this,Zl).set(s,l),s}finalizeDraw(t,i){T(this,dE).delete(t),this.updateProperties(t,i)}updateProperties(t,i){var g;if(!i)return;const{root:s,bbox:l,rootClass:d,path:u}=i,p=typeof t=="number"?T(this,Zl).get(t):t;if(p){if(s&&pe(this,LO,kX).call(this,p,s),l&&pe(g=Ua,Dj,Cwe).call(g,p,l),d){const{classList:_}=p;for(const[y,E]of Object.entries(d))_.toggle(y,E)}if(u){const y=p.firstChild.firstChild;pe(this,LO,kX).call(this,y,u)}}}updateParent(t,i){if(i===this)return;const s=T(this,Zl).get(t);s&&(T(i,tf).append(s),T(this,Zl).delete(t),T(i,Zl).set(t,s))}remove(t){T(this,dE).delete(t),T(this,tf)!==null&&(T(this,Zl).get(t).remove(),T(this,Zl).delete(t))}destroy(){re(this,tf,null);for(const t of T(this,Zl).values())t.remove();T(this,Zl).clear(),T(this,dE).clear()}};tf=new WeakMap,Zl=new WeakMap,dE=new WeakMap,OO=new WeakMap,Dj=new WeakSet,Cwe=function(t,[i,s,l,d]){const{style:u}=t;u.top=`${100*s}%`,u.left=`${100*i}%`,u.width=`${100*l}%`,u.height=`${100*d}%`},PO=new WeakSet,DX=function(){const t=Ua._svgFactory.create(1,1,!0);return T(this,tf).append(t),t.setAttribute("aria-hidden",!0),t},kj=new WeakSet,Twe=function(t,i){const s=Ua._svgFactory.createElement("clipPath");t.append(s);const l=`clip_${i}`;s.setAttribute("id",l),s.setAttribute("clipPathUnits","objectBoundingBox");const d=Ua._svgFactory.createElement("use");return s.append(d),d.setAttribute("href",`#${i}`),d.classList.add("clip"),l},LO=new WeakSet,kX=function(t,i){for(const[s,l]of Object.entries(i))l===null?t.removeAttribute(s):t.setAttribute(s,l)},ee(Ua,Dj),ee(Ua,OO,0);let LX=Ua;globalThis._pdfjsTestingUtils={HighlightOutliner:fX};globalThis.pdfjsLib={AbortException:Dv,AnnotationEditorLayer:NX,AnnotationEditorParamsType:cr,AnnotationEditorType:_i,AnnotationEditorUIManager:OE,AnnotationLayer:lX,AnnotationMode:c1,AnnotationType:Ta,build:FZe,ColorPicker:D7,createValidAbsoluteUrl:y2e,DOMSVGFactory:M7,DrawLayer:LX,FeatureTest:qo,fetchData:tP,getDocument:SEe,getFilenameFromUrl:OQe,getPdfFilenameFromUrl:PQe,getRGB:YU,getUuid:w2e,getXfaPageViewport:DQe,GlobalWorkerOptions:Pp,ImageKind:rM,InvalidPDFException:_Y,isDataScheme:qU,isPdfFile:lZ,isValidExplicitDest:WQe,MathClamp:tc,noContextMenu:rh,normalizeUnicode:AQe,OPS:I7,OutputScale:Up,PasswordResponses:_Qe,PDFDataRangeTransport:bEe,PDFDateString:O7,PDFWorker:iN,PermissionFlag:yQe,PixelsPerInch:kv,RenderingCancelledException:oZ,ResponseException:N7,setLayerDimensions:NE,shadow:Ki,SignatureExtractor:za,stopEvent:Ra,SupportedImageMimeTypes:wY,TextLayer:tN,TouchManager:L7,updateUrlHash:_2e,Util:zn,VerbosityLevel:WU,version:UZe,XfaLayer:xEe};const cet="/assets/pdf.worker-DcN26wb1.mjs";Pp.workerSrc=cet;function gZ({fileUrl:n,isModalOpen:t,className:i=""}){const s=k.useRef(null),[l,d]=k.useState(1),[u,p]=k.useState(null),[g,_]=k.useState(0);k.useEffect(()=>{SEe(n).promise.then(b=>{p(b),_(b.numPages)})},[n]),k.useEffect(()=>{u&&y()},[u,l]);const y=async()=>{const E=s.current;E.innerHTML="";for(let b=1;b<=u.numPages;b++){const A=await u.getPage(b),N=A.getViewport({scale:l}),O=document.createElement("canvas"),D=O.getContext("2d");O.height=N.height,O.width=N.width,O.style.display="block",O.style.margin="0 auto",O.style.width="100%",E.appendChild(O),await A.render({canvasContext:D,viewport:N}).promise}g===1?(E.style.display="block",E.style.height="content-fit"):(E.style.display="block",E.style.height="auto")};return h.jsx("div",{className:`${i}`,style:{height:"100%"},children:h.jsx("div",{ref:s,style:{width:"100%",height:"auto",overflowY:g>1?"auto":"hidden",backgroundColor:"#fff",textAlign:"center",WebkitOverflowScrolling:"touch"}})})}const Rwe="carousel",xwe="controller",det="navigation",uet="no-scroll",vZ="portal",het="root",Awe="toolbar",Mfe="zoom",dK="loading",uK="error",hK="complete",fet="placeholder",pet=n=>`active-slide-${n}`,met="fullsize",yZ="flex_center",get="no_scroll",Iwe="no_scroll_padding",Nwe="slide_wrapper",vet="slide_wrapper_interactive",T_="prev",R_="next",jfe="swipe",jR="close",Owe="onPointerDown",Pwe="onPointerMove",Lwe="onPointerUp",Dwe="onPointerLeave",kwe="onPointerCancel",_Z="onKeyDown",yet="onKeyUp",EZ="onWheel",_et="Escape",Eet="ArrowLeft",wet="ArrowRight",bet="button",MX="icon",Mwe="contain",Ufe="cover",jwe="Unknown action type",Uwe="yarl__";function Mp(...n){return[...n].filter(Boolean).join(" ")}function Er(n){return`${Uwe}${n}`}function Xc(n){return`--${Uwe}${n}`}function aP(n,t){return`${n}${t?`_${t}`:""}`}function wZ(n){return t=>aP(n,t)}function Cet(n,t){var i;return(i=n==null?void 0:n[t])!==null&&i!==void 0?i:t}function SZ(...n){return()=>{n.forEach(t=>{t()})}}function Hv(n,t,i){return()=>{const s=k.useContext(i);if(!s)throw new Error(`${n} must be used within a ${t}.Provider`);return s}}function bZ(){return typeof window<"u"}function CZ(n,t=0){const i=10**t;return Math.round((n+Number.EPSILON)*i)/i}function ix(n){return n.type===void 0||n.type==="image"}function TZ(n,t){return n.imageFit===Ufe||n.imageFit!==Mwe&&t===Ufe}function QU(n){return typeof n=="string"?Number.parseInt(n,10):n}function B7(n){if(typeof n=="number")return{pixel:n};if(typeof n=="string"){const t=QU(n);return n.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Tet(n,t){const i=B7(t),s=i.percent!==void 0?n.width/100*i.percent:i.pixel;return{width:Math.max(n.width-2*s,0),height:Math.max(n.height-2*s,0)}}function Ret(){return(bZ()?window==null?void 0:window.devicePixelRatio:void 0)||1}function Fwe(n,t){return t>0?(n%t+t)%t:0}function Bwe(n){return n.length>0}function Vwe(n,t){return n[Fwe(t,n.length)]}function jX(n,t){return Bwe(n)?Vwe(n,t):void 0}function xet(n){return ix(n)?n.src:void 0}function Aet(n,t,i){if(!i)return n;const{buttons:s,...l}=n,d=s.findIndex(p=>p===t),u=k.isValidElement(i)?k.cloneElement(i,{key:t},null):i;if(d>=0){const p=[...s];return p.splice(d,1,u),{buttons:p,...l}}return{buttons:[u,...s],...l}}function Iet(n,t,i=0){return Math.min(n.preload,Math.max(n.finite?t.length-1:Math.floor(t.length/2),i))}const UX={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[jR]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:Mwe,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Gv(n,t){return{name:n,component:t}}function _o(n,t){return{module:n,children:t}}function zwe(n,t,i){return n.module.name===t?i(n):n.children?[_o(n.module,n.children.flatMap(s=>{var l;return(l=zwe(s,t,i))!==null&&l!==void 0?l:[]}))]:[n]}function Mb(n,t,i){return n.flatMap(s=>{var l;return(l=zwe(s,t,i))!==null&&l!==void 0?l:[]})}function Net(n,t=[],i=[]){let s=n;const l=A=>{const N=[...s];for(;N.length>0;){const O=N.pop();if((O==null?void 0:O.module.name)===A)return!0;O!=null&&O.children&&N.push(...O.children)}return!1},d=(A,N)=>{if(A===""){s=[_o(N,s)];return}s=Mb(s,A,O=>[_o(N,[O])])},u=(A,N)=>{s=Mb(s,A,O=>[_o(O.module,[_o(N,O.children)])])},p=(A,N,O)=>{s=Mb(s,A,D=>{var P;return[_o(D.module,[...O?[_o(N)]:[],...(P=D.children)!==null&&P!==void 0?P:[],...O?[]:[_o(N)]])]})},g=(A,N,O)=>{s=Mb(s,A,D=>[...O?[_o(N)]:[],D,...O?[]:[_o(N)]])},_=A=>{u(xwe,A)},y=(A,N)=>{s=Mb(s,A,O=>[_o(N,O.children)])},E=A=>{s=Mb(s,A,N=>N.children)},b=A=>{i.push(A)};return t.forEach(A=>{A({contains:l,addParent:d,append:u,addChild:p,addSibling:g,addModule:_,replace:y,remove:E,augment:b})}),{config:s,augmentation:A=>i.reduce((N,O)=>O(N),A)}}const Hwe=k.createContext(null),RZ=Hv("useDocument","DocumentContext",Hwe);function Oet({nodeRef:n,children:t}){const i=k.useMemo(()=>{const s=d=>{var u;return((u=d||n.current)===null||u===void 0?void 0:u.ownerDocument)||document};return{getOwnerDocument:s,getOwnerWindow:d=>{var u;return((u=s(d))===null||u===void 0?void 0:u.defaultView)||window}}},[n]);return k.createElement(Hwe.Provider,{value:i},t)}const Gwe=k.createContext(null),ZU=Hv("useEvents","EventsContext",Gwe);function Pet({children:n}){const[t]=k.useState({});k.useEffect(()=>()=>{Object.keys(t).forEach(s=>delete t[s])},[t]);const i=k.useMemo(()=>{const s=(u,p)=>{var g;(g=t[u])===null||g===void 0||g.splice(0,t[u].length,...t[u].filter(_=>_!==p))};return{publish:(...[u,p])=>{var g;(g=t[u])===null||g===void 0||g.forEach(_=>_(p))},subscribe:(u,p)=>(t[u]||(t[u]=[]),t[u].push(p),()=>s(u,p)),unsubscribe:s}},[t]);return k.createElement(Gwe.Provider,{value:i},n)}const Wwe=k.createContext(null),sh=Hv("useLightboxProps","LightboxPropsContext",Wwe);function Let({children:n,...t}){return k.createElement(Wwe.Provider,{value:t},n)}const $we=k.createContext(null),Wv=Hv("useLightboxState","LightboxStateContext",$we),Kwe=k.createContext(null),Det=Hv("useLightboxDispatch","LightboxDispatchContext",Kwe);function ket(n,t){switch(t.type){case"swipe":{const{slides:i}=n,s=(t==null?void 0:t.increment)||0,l=n.globalIndex+s,d=Fwe(l,i.length),u=jX(i,d),p=s||t.duration?{increment:s,duration:t.duration,easing:t.easing}:void 0;return{slides:i,currentIndex:d,globalIndex:l,currentSlide:u,animation:p}}case"update":return t.slides!==n.slides||t.index!==n.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:jX(t.slides,t.index)}:n;default:throw new Error(jwe)}}function Met({slides:n,index:t,children:i}){const[s,l]=k.useReducer(ket,{slides:n,currentIndex:t,globalIndex:t,currentSlide:jX(n,t)});k.useEffect(()=>{l({type:"update",slides:n,index:t})},[n,t]);const d=k.useMemo(()=>({...s,state:s,dispatch:l}),[s,l]);return k.createElement(Kwe.Provider,{value:l},k.createElement($we.Provider,{value:d},i))}const qwe=k.createContext(null),eF=Hv("useTimeouts","TimeoutsContext",qwe);function jet({children:n}){const[t]=k.useState([]);k.useEffect(()=>()=>{t.forEach(s=>window.clearTimeout(s)),t.splice(0,t.length)},[t]);const i=k.useMemo(()=>{const s=u=>{t.splice(0,t.length,...t.filter(p=>p!==u))};return{setTimeout:(u,p)=>{const g=window.setTimeout(()=>{s(g),u()},p);return t.push(g),g},clearTimeout:u=>{u!==void 0&&(s(u),window.clearTimeout(u))}}},[t]);return k.createElement(qwe.Provider,{value:i},n)}const xZ=k.forwardRef(function({label:t,className:i,icon:s,renderIcon:l,onClick:d,style:u,...p},g){const{styles:_,labels:y}=sh(),E=Cet(y,t);return k.createElement("button",{ref:g,type:"button",title:E,"aria-label":E,className:Mp(Er(bet),i),onClick:d,style:{...u,..._.button},...p},l?l():k.createElement(s,{className:Er(MX),style:_.icon}))});function Uet(n,t){const i=s=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...s},t);return i.displayName=n,i}function ZE(n,t){return Uet(n,k.createElement("g",{fill:"currentColor"},k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}const Fet=ZE("Close",k.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Bet=ZE("Previous",k.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),Vet=ZE("Next",k.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),zet=ZE("Loading",k.createElement(k.Fragment,null,Array.from({length:8}).map((n,t,i)=>k.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/i.length*(t+1),transform:`rotate(${360/i.length*t}, 12, 12)`})))),Het=ZE("Error",k.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),Fp=bZ()?k.useLayoutEffect:k.useEffect;function AZ(){const[n,t]=k.useState(!1);return k.useEffect(()=>{var i,s;const l=(i=window.matchMedia)===null||i===void 0?void 0:i.call(window,"(prefers-reduced-motion: reduce)");t(l==null?void 0:l.matches);const d=u=>t(u.matches);return(s=l==null?void 0:l.addEventListener)===null||s===void 0||s.call(l,"change",d),()=>{var u;return(u=l==null?void 0:l.removeEventListener)===null||u===void 0?void 0:u.call(l,"change",d)}},[]),n}function Get(n){let t=0,i=0,s=0;const d=window.getComputedStyle(n).transform.match(/matrix.*\((.+)\)/);if(d){const u=d[1].split(",").map(QU);u.length===6?(t=u[4],i=u[5]):u.length===16&&(t=u[12],i=u[13],s=u[14])}return{x:t,y:i,z:s}}function Ffe(n,t){const i=k.useRef(),s=k.useRef(),l=AZ();return Fp(()=>{var d,u,p;if(n.current&&i.current!==void 0&&!l){const{keyframes:g,duration:_,easing:y,onfinish:E}=t(i.current,n.current.getBoundingClientRect(),Get(n.current))||{};if(g&&_){(d=s.current)===null||d===void 0||d.cancel(),s.current=void 0;try{s.current=(p=(u=n.current).animate)===null||p===void 0?void 0:p.call(u,g,{duration:_,easing:y})}catch(b){console.error(b)}s.current&&(s.current.onfinish=()=>{s.current=void 0,E==null||E()})}}i.current=void 0}),{prepareAnimation:d=>{i.current=d},isAnimationPlaying:()=>{var d;return((d=s.current)===null||d===void 0?void 0:d.playState)==="running"}}}function Ywe(){const n=k.useRef(null),t=k.useRef(),[i,s]=k.useState();return{setContainerRef:k.useCallback(d=>{n.current=d,t.current&&(t.current.disconnect(),t.current=void 0);const u=()=>{if(d){const p=window.getComputedStyle(d),g=_=>parseFloat(_)||0;s({width:Math.round(d.clientWidth-g(p.paddingLeft)-g(p.paddingRight)),height:Math.round(d.clientHeight-g(p.paddingTop)-g(p.paddingBottom))})}else s(void 0)};u(),d&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(u),t.current.observe(d))},[]),containerRef:n,containerRect:i}}function kM(){const n=k.useRef(),{setTimeout:t,clearTimeout:i}=eF();return k.useCallback((s,l)=>{i(n.current),n.current=t(s,l>0?l:0)},[t,i])}function Br(n){const t=k.useRef(n);return Fp(()=>{t.current=n}),k.useCallback((...i)=>{var s;return(s=t.current)===null||s===void 0?void 0:s.call(t,...i)},[])}function Bfe(n,t){typeof n=="function"?n(t):n&&(n.current=t)}function FX(n,t){return k.useMemo(()=>n==null&&t==null?null:i=>{Bfe(n,i),Bfe(t,i)},[n,t])}function Wet(n,t=!1){const i=k.useRef();Fp(()=>{t&&i.current&&(i.current=!1,n())},[t,n]);const s=k.useCallback(()=>{i.current=!0},[]),l=k.useCallback(()=>{i.current=!1},[]);return{onFocus:s,onBlur:l}}function IZ(){const[n,t]=k.useState(!1);return Fp(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),n}function $et(){const[n]=k.useState({}),t=k.useCallback((l,d)=>{var u;(u=n[l])===null||u===void 0||u.forEach(p=>{d.isPropagationStopped()||p(d)})},[n]),i=k.useMemo(()=>({onPointerDown:l=>t(Owe,l),onPointerMove:l=>t(Pwe,l),onPointerUp:l=>t(Lwe,l),onPointerLeave:l=>t(Dwe,l),onPointerCancel:l=>t(kwe,l),onKeyDown:l=>t(_Z,l),onKeyUp:l=>t(yet,l),onWheel:l=>t(EZ,l)}),[t]),s=k.useCallback((l,d)=>(n[l]||(n[l]=[]),n[l].unshift(d),()=>{const u=n[l];u&&u.splice(0,u.length,...u.filter(p=>p!==d))}),[n]);return{registerSensors:i,subscribeSensors:s}}function Vfe(n,t){const i=k.useRef(0),s=kM(),l=Br((...d)=>{i.current=Date.now(),n(d)});return k.useCallback((...d)=>{s(()=>{l(d)},t-(Date.now()-i.current))},[t,l,s])}const fK=wZ("slide"),pK=wZ("slide_image");function V7({slide:n,offset:t,render:i,rect:s,imageFit:l,imageProps:d,onClick:u,onLoad:p,onError:g,style:_}){var y,E,b,A,N,O,D;const[P,j]=k.useState(dK),{publish:M}=ZU(),{setTimeout:V}=eF(),H=k.useRef(null);k.useEffect(()=>{t===0&&M(pet(P))},[t,P,M]);const $=Br(Fe=>{("decode"in Fe?Fe.decode():Promise.resolve()).catch(()=>{}).then(()=>{Fe.parentNode&&(j(hK),V(()=>{p==null||p(Fe)},0))})}),Q=k.useCallback(Fe=>{H.current=Fe,Fe!=null&&Fe.complete&&$(Fe)},[$]),Y=k.useCallback(Fe=>{$(Fe.currentTarget)},[$]),le=Br(()=>{j(uK),g==null||g()}),ae=TZ(n,l),te=(Fe,je)=>Number.isFinite(Fe)?Fe:je,de=te(Math.max(...((E=(y=n.srcSet)===null||y===void 0?void 0:y.map(Fe=>Fe.width))!==null&&E!==void 0?E:[]).concat(n.width?[n.width]:[]).filter(Boolean)),((b=H.current)===null||b===void 0?void 0:b.naturalWidth)||0),G=te(Math.max(...((N=(A=n.srcSet)===null||A===void 0?void 0:A.map(Fe=>Fe.height))!==null&&N!==void 0?N:[]).concat(n.height?[n.height]:[]).filter(Boolean)),((O=H.current)===null||O===void 0?void 0:O.naturalHeight)||0),ie=de&&G?{maxWidth:`min(${de}px, 100%)`,maxHeight:`min(${G}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},_e=(D=n.srcSet)===null||D===void 0?void 0:D.sort((Fe,je)=>Fe.width-je.width).map(Fe=>`${Fe.src} ${Fe.width}w`).join(", "),he=()=>s&&!ae&&n.width&&n.height?s.height/n.height*n.width:Number.MAX_VALUE,Ce=_e&&s&&bZ()?`${Math.round(Math.min(he(),s.width))}px`:void 0,{style:fe,className:me,...Ne}=d||{};return k.createElement(k.Fragment,null,k.createElement("img",{ref:Q,onLoad:Y,onError:le,onClick:u,draggable:!1,className:Mp(Er(pK()),ae&&Er(pK("cover")),P!==hK&&Er(pK("loading")),me),style:{...ie,..._,...fe},...Ne,alt:n.alt,sizes:Ce,srcSet:_e,src:n.src}),P!==hK&&k.createElement("div",{className:Er(fK(fet))},P===dK&&(i!=null&&i.iconLoading?i.iconLoading():k.createElement(zet,{className:Mp(Er(MX),Er(fK(dK)))})),P===uK&&(i!=null&&i.iconError?i.iconError():k.createElement(Het,{className:Mp(Er(MX),Er(fK(uK)))}))))}const Ket=k.forwardRef(function({className:t,children:i,...s},l){const d=k.useRef(null);return k.createElement(Oet,{nodeRef:d},k.createElement("div",{ref:FX(l,d),className:Mp(Er("root"),t),...s},i))});var vl;(function(n){n[n.NONE=0]="NONE",n[n.SWIPE=1]="SWIPE",n[n.PULL=2]="PULL",n[n.ANIMATION=3]="ANIMATION"})(vl||(vl={}));function Xwe(n,t,i,s,l){k.useEffect(()=>l?()=>{}:SZ(n(Owe,t),n(Pwe,i),n(Lwe,s),n(Dwe,s),n(kwe,s)),[n,t,i,s,l])}var jh;(function(n){n[n.NONE=0]="NONE",n[n.SWIPE=1]="SWIPE",n[n.PULL=2]="PULL"})(jh||(jh={}));const mK=30;function qet(n,t,i,s,l,d,u,p,g,_,y,E,b,A){const N=k.useRef(0),O=k.useRef([]),D=k.useRef(),P=k.useRef(0),j=k.useRef(jh.NONE),M=k.useCallback(le=>{D.current===le.pointerId&&(D.current=void 0,j.current=jh.NONE);const ae=O.current;ae.splice(0,ae.length,...ae.filter(te=>te.pointerId!==le.pointerId))},[]),V=k.useCallback(le=>{M(le),le.persist(),O.current.push(le)},[M]),H=Br(le=>{V(le)}),$=(le,ae)=>_&&le>ae||g&&le<-ae,Q=Br(le=>{if(O.current.find(ae=>ae.pointerId===le.pointerId)&&D.current===le.pointerId){const ae=Date.now()-P.current,te=N.current;j.current===jh.SWIPE?Math.abs(te)>.3*i||Math.abs(te)>5&&ae<s?u(te,ae):p(te):j.current===jh.PULL&&($(te,2*mK)?b(te,ae):A(te)),N.current=0,j.current=jh.NONE}M(le)}),Y=Br(le=>{const ae=O.current.find(te=>te.pointerId===le.pointerId);if(ae){const te=D.current===le.pointerId;if(le.buttons===0){te&&N.current!==0?Q(le):M(ae);return}const de=le.clientX-ae.clientX,G=le.clientY-ae.clientY;if(D.current===void 0){const ie=_e=>{V(le),D.current=le.pointerId,P.current=Date.now(),j.current=_e};Math.abs(de)>Math.abs(G)&&Math.abs(de)>mK&&t(de)?(ie(jh.SWIPE),l()):Math.abs(G)>Math.abs(de)&&$(G,mK)&&(ie(jh.PULL),y())}else te&&(j.current===jh.SWIPE?(N.current=de,d(de)):j.current===jh.PULL&&(N.current=G,E(G)))}});Xwe(n,H,Y,Q)}function Yet({preventDefaultWheelX:n,preventDefaultWheelY:t}){const i=k.useRef(null),s=Br(l=>{const d=Math.abs(l.deltaX)>Math.abs(l.deltaY);(d&&n||!d&&t||l.ctrlKey)&&l.preventDefault()});return k.useCallback(l=>{var d;l?l.addEventListener("wheel",s,{passive:!1}):(d=i.current)===null||d===void 0||d.removeEventListener("wheel",s),i.current=l},[s])}function Xet(n,t,i,s,l,d,u,p,g){const _=k.useRef(0),y=k.useRef(0),E=k.useRef(),b=k.useRef(),A=k.useRef(0),N=k.useRef(0),{setTimeout:O,clearTimeout:D}=eF(),P=k.useCallback(()=>{E.current&&(D(E.current),E.current=void 0)},[D]),j=k.useCallback(()=>{b.current&&(D(b.current),b.current=void 0)},[D]),M=Br(()=>{n!==vl.SWIPE&&(_.current=0,N.current=0,P(),j())});k.useEffect(M,[n,M]);const V=Br($=>{b.current=void 0,_.current===$&&g(_.current)}),H=Br($=>{if(!$.ctrlKey&&!(Math.abs($.deltaY)>Math.abs($.deltaX)))if(n===vl.NONE){if(Math.abs($.deltaX)<=1.2*Math.abs(A.current)){A.current=$.deltaX;return}if(!i(-$.deltaX))return;if(y.current+=$.deltaX,P(),Math.abs(y.current)>30)y.current=0,A.current=0,N.current=Date.now(),d();else{const Q=y.current;E.current=O(()=>{E.current=void 0,Q===y.current&&(y.current=0)},l)}}else if(n===vl.SWIPE){let Q=_.current-$.deltaX;if(Q=Math.min(Math.abs(Q),s)*Math.sign(Q),_.current=Q,u(Q),j(),Math.abs(Q)>.2*s){A.current=$.deltaX,p(Q,Date.now()-N.current);return}b.current=O(()=>V(Q),2*l)}else A.current=$.deltaX});k.useEffect(()=>t(EZ,H),[t,H])}const zfe=wZ("container"),Jwe=k.createContext(null),Ug=Hv("useController","ControllerContext",Jwe);function Jet({children:n,...t}){var i;const{carousel:s,animation:l,controller:d,on:u,styles:p,render:g}=t,{closeOnPullUp:_,closeOnPullDown:y,preventDefaultWheelX:E,preventDefaultWheelY:b}=d,[A,N]=k.useState(),O=Wv(),D=Det(),[P,j]=k.useState(vl.NONE),M=k.useRef(0),V=k.useRef(0),H=k.useRef(1),{registerSensors:$,subscribeSensors:Q}=$et(),{subscribe:Y,publish:le}=ZU(),ae=kM(),te=kM(),de=kM(),{containerRef:G,setContainerRef:ie,containerRect:_e}=Ywe(),he=FX(Yet({preventDefaultWheelX:E,preventDefaultWheelY:b}),ie),Ce=k.useRef(null),fe=FX(Ce,void 0),{getOwnerDocument:me}=RZ(),Ne=IZ(),Fe=it=>(Ne?-1:1)*(typeof it=="number"?it:1),je=Br(()=>{var it;return(it=G.current)===null||it===void 0?void 0:it.focus()}),Ve=Br(()=>t),Re=Br(()=>O),Be=k.useCallback(it=>le(T_,it),[le]),Xe=k.useCallback(it=>le(R_,it),[le]),we=k.useCallback(()=>le(jR),[le]),Ge=it=>!(s.finite&&(Fe(it)>0&&O.currentIndex===0||Fe(it)<0&&O.currentIndex===O.slides.length-1)),rt=it=>{var Me;M.current=it,(Me=G.current)===null||Me===void 0||Me.style.setProperty(Xc("swipe_offset"),`${Math.round(it)}px`)},pt=it=>{var Me,We;V.current=it,H.current=(()=>{const Lt=y&&it>0?it:_&&it<0?-it:0;return Math.min(Math.max(CZ(1-Lt/60*(1-.5),2),.5),1)})(),(Me=G.current)===null||Me===void 0||Me.style.setProperty(Xc("pull_offset"),`${Math.round(it)}px`),(We=G.current)===null||We===void 0||We.style.setProperty(Xc("pull_opacity"),`${H.current}`)},{prepareAnimation:Ze}=Ffe(Ce,(it,Me,We)=>{if(Ce.current&&_e)return{keyframes:[{transform:`translate(0, ${it.rect.y-Me.y+We.y}px)`,opacity:it.opacity},{transform:"translate(0, 0)",opacity:1}],duration:it.duration,easing:l.easing.fade}}),Je=(it,Me)=>{if(_||y){pt(it);let We=0;Ce.current&&(We=l.fade*(Me?2:1),Ze({rect:Ce.current.getBoundingClientRect(),opacity:H.current,duration:We})),de(()=>{pt(0),j(vl.NONE)},We),j(vl.ANIMATION),Me||we()}},{prepareAnimation:_t,isAnimationPlaying:Xt}=Ffe(Ce,(it,Me,We)=>{var bt;if(Ce.current&&_e&&(!((bt=O.animation)===null||bt===void 0)&&bt.duration)){const St=B7(s.spacing),Lt=(St.percent?St.percent*_e.width/100:St.pixel)||0;return{keyframes:[{transform:`translate(${Fe(O.globalIndex-it.index)*(_e.width+Lt)+it.rect.x-Me.x+We.x}px, 0)`},{transform:"translate(0, 0)"}],duration:O.animation.duration,easing:O.animation.easing}}}),Ht=Br(it=>{var Me,We;const bt=it.offset||0,St=bt?l.swipe:(Me=l.navigation)!==null&&Me!==void 0?Me:l.swipe,Lt=!bt&&!Xt()?l.easing.navigation:l.easing.swipe;let{direction:tn}=it;const un=(We=it.count)!==null&&We!==void 0?We:1;let an=vl.ANIMATION,ye=St*un;if(!tn){const ne=_e==null?void 0:_e.width,Se=it.duration||0,Ue=ne?St/ne*Math.abs(bt):St;un!==0?(Se<Ue?ye=ye/Ue*Math.max(Se,Ue/5):ne&&(ye=St/ne*(ne-Math.abs(bt))),tn=Fe(bt)>0?T_:R_):ye=St/2}let J=0;tn===T_?Ge(Fe(1))?J=-un:(an=vl.NONE,ye=St):tn===R_&&(Ge(Fe(-1))?J=un:(an=vl.NONE,ye=St)),ye=Math.round(ye),te(()=>{rt(0),j(vl.NONE)},ye),Ce.current&&_t({rect:Ce.current.getBoundingClientRect(),index:O.globalIndex}),j(an),le(jfe,{type:"swipe",increment:J,duration:ye,easing:Lt})});k.useEffect(()=>{var it,Me;!((it=O.animation)===null||it===void 0)&&it.increment&&(!((Me=O.animation)===null||Me===void 0)&&Me.duration)&&ae(()=>D({type:"swipe",increment:0}),O.animation.duration)},[O.animation,D,ae]);const gn=[Q,Ge,(_e==null?void 0:_e.width)||0,l.swipe,()=>j(vl.SWIPE),it=>rt(it),(it,Me)=>Ht({offset:it,duration:Me,count:1}),it=>Ht({offset:it,count:0})],It=[()=>{y&&j(vl.PULL)},it=>pt(it),it=>Je(it),it=>Je(it,!0)];qet(...gn,_,y,...It),Xet(P,...gn);const xt=Br(()=>{d.focus&&me().querySelector(`.${Er(vZ)} .${Er(zfe())}`)&&je()});k.useEffect(xt,[xt]);const mt=Br(()=>{var it;(it=u.view)===null||it===void 0||it.call(u,{index:O.currentIndex})});k.useEffect(mt,[O.globalIndex,mt]),k.useEffect(()=>SZ(Y(T_,it=>Ht({direction:T_,...it})),Y(R_,it=>Ht({direction:R_,...it})),Y(jfe,it=>D(it))),[Y,Ht,D]);const dt=k.useMemo(()=>({prev:Be,next:Xe,close:we,focus:je,slideRect:_e?Tet(_e,s.padding):{width:0,height:0},containerRect:_e||{width:0,height:0},subscribeSensors:Q,containerRef:G,setCarouselRef:fe,toolbarWidth:A,setToolbarWidth:N}),[Be,Xe,we,je,Q,_e,G,fe,A,N,s.padding]);return k.useImperativeHandle(d.ref,()=>({prev:Be,next:Xe,close:we,focus:je,getLightboxProps:Ve,getLightboxState:Re}),[Be,Xe,we,je,Ve,Re]),k.createElement("div",{ref:he,className:Mp(Er(zfe()),Er(yZ)),style:{...P===vl.SWIPE?{[Xc("swipe_offset")]:`${Math.round(M.current)}px`}:null,...P===vl.PULL?{[Xc("pull_offset")]:`${Math.round(V.current)}px`,[Xc("pull_opacity")]:`${H.current}`}:null,...d.touchAction!=="none"?{[Xc("controller_touch_action")]:d.touchAction}:null,...p.container},...d.aria?{role:"presentation","aria-live":"polite"}:null,tabIndex:-1,...$},_e&&k.createElement(Jwe.Provider,{value:dt},n,(i=g.controls)===null||i===void 0?void 0:i.call(g)))}const Qet=Gv(xwe,Jet);function m_(n){return aP(Rwe,n)}function Hfe(n){return aP("slide",n)}function Zet({slide:n,offset:t}){const i=k.useRef(null),{currentIndex:s}=Wv(),{slideRect:l,close:d}=Ug(),{render:u,carousel:{imageFit:p,imageProps:g},on:{click:_},controller:{closeOnBackdropClick:y},styles:{slide:E}}=sh(),b=()=>{var N,O,D,P;let j=(N=u.slide)===null||N===void 0?void 0:N.call(u,{slide:n,offset:t,rect:l});return!j&&ix(n)&&(j=k.createElement(V7,{slide:n,offset:t,render:u,rect:l,imageFit:p,imageProps:g,onClick:t===0?()=>_==null?void 0:_({index:s}):void 0})),j?k.createElement(k.Fragment,null,(O=u.slideHeader)===null||O===void 0?void 0:O.call(u,{slide:n}),((D=u.slideContainer)!==null&&D!==void 0?D:({children:M})=>M)({slide:n,children:j}),(P=u.slideFooter)===null||P===void 0?void 0:P.call(u,{slide:n})):null},A=N=>{const O=i.current,D=N.target instanceof HTMLElement?N.target:void 0;y&&D&&O&&(D===O||Array.from(O.children).find(P=>P===D)&&D.classList.contains(Er(Nwe)))&&d()};return k.createElement("div",{ref:i,className:Mp(Er(Hfe()),t===0&&Er(Hfe("current")),Er(yZ)),onClick:A,style:E},b())}function ett(){const n=sh().styles.slide;return k.createElement("div",{className:Er("slide"),style:n})}function ttt({carousel:n}){const{slides:t,currentIndex:i,globalIndex:s}=Wv(),{setCarouselRef:l}=Ug(),d=B7(n.spacing),u=B7(n.padding),p=Iet(n,t,1),g=[];if(Bwe(t))for(let _=i-p;_<=i+p;_+=1){const y=Vwe(t,_),E=s-i+_,b=n.finite&&(_<0||_>t.length-1);g.push(b?{key:E}:{key:[`${E}`,xet(y)].filter(Boolean).join("|"),offset:_-i,slide:y})}return k.createElement("div",{ref:l,className:Mp(Er(m_()),g.length>0&&Er(m_("with_slides"))),style:{[`${Xc(m_("slides_count"))}`]:g.length,[`${Xc(m_("spacing_px"))}`]:d.pixel||0,[`${Xc(m_("spacing_percent"))}`]:d.percent||0,[`${Xc(m_("padding_px"))}`]:u.pixel||0,[`${Xc(m_("padding_percent"))}`]:u.percent||0}},g.map(({key:_,slide:y,offset:E})=>y?k.createElement(Zet,{key:_,slide:y,offset:E}):k.createElement(ett,{key:_})))}const ntt=Gv(Rwe,ttt);function Qwe(){const{carousel:n}=sh(),{slides:t,currentIndex:i}=Wv(),s=t.length===0||n.finite&&i===0,l=t.length===0||n.finite&&i===t.length-1;return{prevDisabled:s,nextDisabled:l}}function itt(n){var t;const i=IZ(),{publish:s}=ZU(),{animation:l}=sh(),{prevDisabled:d,nextDisabled:u}=Qwe(),p=((t=l.navigation)!==null&&t!==void 0?t:l.swipe)/2,g=Vfe(()=>s(T_),p),_=Vfe(()=>s(R_),p),y=Br(E=>{switch(E.key){case _et:s(jR);break;case Eet:(i?u:d)||(i?_:g)();break;case wet:(i?d:u)||(i?g:_)();break}});k.useEffect(()=>n(_Z,y),[n,y])}function Gfe({label:n,icon:t,renderIcon:i,action:s,onClick:l,disabled:d,style:u}){return k.createElement(xZ,{label:n,icon:t,renderIcon:i,className:Er(`navigation_${s}`),disabled:d,onClick:l,style:u,...Wet(Ug().focus,d)})}function rtt({render:{buttonPrev:n,buttonNext:t,iconPrev:i,iconNext:s},styles:l}){const{prev:d,next:u,subscribeSensors:p}=Ug(),{prevDisabled:g,nextDisabled:_}=Qwe();return itt(p),k.createElement(k.Fragment,null,n?n():k.createElement(Gfe,{label:"Previous",action:T_,icon:Bet,renderIcon:i,style:l.navigationPrev,disabled:g,onClick:d}),t?t():k.createElement(Gfe,{label:"Next",action:R_,icon:Vet,renderIcon:s,style:l.navigationNext,disabled:_,onClick:u}))}const stt=Gv(det,rtt),Wfe=Er(get),att=Er(Iwe);function ott(n){return"style"in n}function $fe(n,t,i){const s=window.getComputedStyle(n),l=i?"padding-left":"padding-right",d=i?s.paddingLeft:s.paddingRight,u=n.style.getPropertyValue(l);return n.style.setProperty(l,`${(QU(d)||0)+t}px`),()=>{u?n.style.setProperty(l,u):n.style.removeProperty(l)}}function ltt({noScroll:{disabled:n},children:t}){const i=IZ(),{getOwnerDocument:s,getOwnerWindow:l}=RZ();return k.useEffect(()=>{if(n)return()=>{};const d=[],u=l(),{body:p,documentElement:g}=s(),_=Math.round(u.innerWidth-g.clientWidth);if(_>0){d.push($fe(p,_,i));const y=p.getElementsByTagName("*");for(let E=0;E<y.length;E+=1){const b=y[E];ott(b)&&u.getComputedStyle(b).getPropertyValue("position")==="fixed"&&!b.classList.contains(att)&&d.push($fe(b,_,i))}}return p.classList.add(Wfe),()=>{p.classList.remove(Wfe),d.forEach(y=>y())}},[i,n,s,l]),k.createElement(k.Fragment,null,t)}const ctt=Gv(uet,ltt);function Kfe(n){return aP(vZ,n)}function qfe(n,t,i){const s=n.getAttribute(t);return n.setAttribute(t,i),()=>{s?n.setAttribute(t,s):n.removeAttribute(t)}}function dtt({children:n,animation:t,styles:i,className:s,on:l,portal:d,close:u}){const[p,g]=k.useState(!1),[_,y]=k.useState(!1),E=k.useRef([]),b=k.useRef(null),{setTimeout:A}=eF(),{subscribe:N}=ZU(),D=AZ()?0:t.fade;k.useEffect(()=>(g(!0),()=>{g(!1),y(!1)}),[]);const P=Br(()=>{E.current.forEach(H=>H()),E.current=[]}),j=Br(()=>{var H;y(!1),P(),(H=l.exiting)===null||H===void 0||H.call(l),A(()=>{var $;($=l.exited)===null||$===void 0||$.call(l),u()},D)});k.useEffect(()=>N(jR,j),[N,j]);const M=Br(H=>{var $,Q,Y;H.scrollTop,y(!0),($=l.entering)===null||$===void 0||$.call(l);const le=(Y=(Q=H.parentNode)===null||Q===void 0?void 0:Q.children)!==null&&Y!==void 0?Y:[];for(let ae=0;ae<le.length;ae+=1){const te=le[ae];["TEMPLATE","SCRIPT","STYLE"].indexOf(te.tagName)===-1&&te!==H&&(E.current.push(qfe(te,"inert","true")),E.current.push(qfe(te,"aria-hidden","true")))}E.current.push(()=>{var ae,te;(te=(ae=b.current)===null||ae===void 0?void 0:ae.focus)===null||te===void 0||te.call(ae)}),A(()=>{var ae;(ae=l.entered)===null||ae===void 0||ae.call(l)},D)}),V=k.useCallback(H=>{H?M(H):P()},[M,P]);return p?BJ.createPortal(k.createElement(Ket,{ref:V,className:Mp(s,Er(Kfe()),Er(Iwe),_&&Er(Kfe("open"))),role:"presentation","aria-live":"polite",style:{...t.fade!==UX.animation.fade?{[Xc("fade_animation_duration")]:`${D}ms`}:null,...t.easing.fade!==UX.animation.easing.fade?{[Xc("fade_animation_timing_function")]:t.easing.fade}:null,...i.root},onFocus:H=>{b.current||(b.current=H.relatedTarget)}},n),d.root||document.body):null}const utt=Gv(vZ,dtt);function htt({children:n}){return k.createElement(k.Fragment,null,n)}const ftt=Gv(het,htt);function ptt(n){return aP(Awe,n)}function mtt({toolbar:{buttons:n},render:{buttonClose:t,iconClose:i},styles:s}){const{close:l,setToolbarWidth:d}=Ug(),{setContainerRef:u,containerRect:p}=Ywe();Fp(()=>{d(p==null?void 0:p.width)},[d,p==null?void 0:p.width]);const g=()=>t?t():k.createElement(xZ,{key:jR,label:"Close",icon:Fet,renderIcon:i,onClick:l});return k.createElement("div",{ref:u,style:s.toolbar,className:Er(ptt())},n==null?void 0:n.map(_=>_===jR?g():_))}const gtt=Gv(Awe,mtt);function Zwe(n,t){var i;return k.createElement(n.module.component,{key:n.module.name,...t},(i=n.children)===null||i===void 0?void 0:i.map(s=>Zwe(s,t)))}function vtt(n,t={}){const{easing:i,...s}=n,{easing:l,...d}=t;return{easing:{...i,...l},...s,...d}}function ytt({carousel:n,animation:t,render:i,toolbar:s,controller:l,noScroll:d,on:u,plugins:p,slides:g,index:_,...y}){const{animation:E,carousel:b,render:A,toolbar:N,controller:O,noScroll:D,on:P,slides:j,index:M,plugins:V,...H}=UX,{config:$,augmentation:Q}=Net([_o(utt,[_o(ctt,[_o(Qet,[_o(ntt),_o(gtt),_o(stt)])])])],p||V),Y=Q({animation:vtt(E,t),carousel:{...b,...n},render:{...A,...i},toolbar:{...N,...s},controller:{...O,...l},noScroll:{...D,...d},on:{...P,...u},...H,...y});return Y.open?k.createElement(Let,{...Y},k.createElement(Met,{slides:g||j,index:QU(_||M)},k.createElement(jet,null,k.createElement(Pet,null,Zwe(_o(ftt,$),Y))))):null}const _tt={maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!1},eSe=n=>({..._tt,...n});function Ett(n,t,i,s){const l=k.useRef(),d=k.useRef(),{zoom:u}=sh().animation,p=AZ(),g=Br(()=>{var _,y,E;if((_=l.current)===null||_===void 0||_.cancel(),l.current=void 0,d.current&&(s!=null&&s.current)){try{l.current=(E=(y=s.current).animate)===null||E===void 0?void 0:E.call(y,[{transform:d.current},{transform:`scale(${n}) translateX(${t}px) translateY(${i}px)`}],{duration:p?0:u??500,easing:l.current?"ease-out":"ease-in-out"})}catch(b){console.error(b)}d.current=void 0,l.current&&(l.current.onfinish=()=>{l.current=void 0})}});return Fp(g,[n,t,i,g]),k.useCallback(()=>{d.current=s!=null&&s.current?window.getComputedStyle(s.current).transform:void 0},[s])}function wtt(n,t){const{on:i}=sh(),s=Br(()=>{var l;t||(l=i.zoom)===null||l===void 0||l.call(i,{zoom:n})});k.useEffect(s,[n,s])}function tF(){const{zoom:n}=sh();return eSe(n)}function Stt(n,t){var i,s;let l={width:0,height:0},d={width:0,height:0};const{currentSlide:u}=Wv(),{imageFit:p}=sh().carousel,{maxZoomPixelRatio:g}=tF();if(n&&u){const y={...u,...t};if(ix(y)){const E=TZ(y,p),b=Math.max(...(((i=y.srcSet)===null||i===void 0?void 0:i.map(N=>N.width))||[]).concat(y.width?[y.width]:[])),A=Math.max(...(((s=y.srcSet)===null||s===void 0?void 0:s.map(N=>N.height))||[]).concat(y.height?[y.height]:[]));b>0&&A>0&&n.width>0&&n.height>0&&(d=E?{width:Math.round(Math.min(b,n.width/n.height*A)),height:Math.round(Math.min(A,n.height/n.width*b))}:{width:b,height:A},d={width:d.width*g,height:d.height*g},l=E?{width:Math.min(n.width,d.width,b),height:Math.min(n.height,d.height,A)}:{width:Math.round(Math.min(n.width,n.height/A*b,b)),height:Math.round(Math.min(n.height,n.width/b*A,A))})}}const _=l.width?Math.max(CZ(d.width/l.width,5),1):1;return{imageRect:l,maxZoom:_}}function Yfe(n,t){return((n.clientX-t.clientX)**2+(n.clientY-t.clientY)**2)**.5}function btt(n,t,i,s,l,d){const u=k.useRef([]),p=k.useRef(0),g=k.useRef(),{globalIndex:_}=Wv(),{getOwnerWindow:y}=RZ(),{containerRef:E,subscribeSensors:b}=Ug(),{keyboardMoveDistance:A,zoomInMultiplier:N,wheelZoomDistanceFactor:O,scrollToZoom:D,doubleTapDelay:P,doubleClickDelay:j,doubleClickMaxStops:M,pinchZoomDistanceFactor:V}=tF(),H=k.useCallback(ie=>{if(E.current){const{pageX:_e,pageY:he}=ie,{scrollX:Ce,scrollY:fe}=y(),{left:me,top:Ne,width:Fe,height:je}=E.current.getBoundingClientRect();return[_e-me-Ce-Fe/2,he-Ne-fe-je/2]}return[]},[E,y]),$=Br(ie=>{const _e=()=>{ie.preventDefault(),ie.stopPropagation()};if(n>1){const fe=(me,Ne)=>{_e(),l(me,Ne)};ie.key==="ArrowDown"?fe(0,A):ie.key==="ArrowUp"?fe(0,-A):ie.key==="ArrowLeft"?fe(-A,0):ie.key==="ArrowRight"&&fe(A,0)}const he=fe=>{_e(),s(fe)},Ce=()=>ie.getModifierState("Meta");ie.key==="+"||ie.key==="="&&Ce()?he(n*N):ie.key==="-"||ie.key==="_"&&Ce()?he(n/N):ie.key==="0"&&Ce()&&he(1)}),Q=Br(ie=>{if((ie.ctrlKey||D)&&Math.abs(ie.deltaY)>Math.abs(ie.deltaX)){ie.stopPropagation(),s(n*(1-ie.deltaY/O),!0,...H(ie));return}n>1&&(ie.stopPropagation(),D||l(ie.deltaX,ie.deltaY))}),Y=k.useCallback(ie=>{const _e=u.current;_e.splice(0,_e.length,..._e.filter(he=>he.pointerId!==ie.pointerId))},[]),le=k.useCallback(ie=>{Y(ie),ie.persist(),u.current.push(ie)},[Y]),ae=Br(ie=>{var _e;const he=u.current;if(!(!((_e=d==null?void 0:d.current)===null||_e===void 0)&&_e.contains(ie.target)))return;n>1&&ie.stopPropagation();const{timeStamp:Ce}=ie;he.length===0&&Ce-p.current<(ie.pointerType==="touch"?P:j)?(p.current=0,s(n!==t?n*Math.max(t**(1/M),N):1,!1,...H(ie))):p.current=Ce,le(ie),he.length===2&&(g.current=Yfe(he[0],he[1]))}),te=Br(ie=>{const _e=u.current,he=_e.find(Ce=>Ce.pointerId===ie.pointerId);if(_e.length===2&&g.current){ie.stopPropagation(),le(ie);const Ce=Yfe(_e[0],_e[1]),fe=Ce-g.current;Math.abs(fe)>0&&(s(n*(1+fe/V),!0,..._e.map(me=>H(me)).reduce((me,Ne)=>Ne.map((Fe,je)=>me[je]+Fe/2))),g.current=Ce);return}n>1&&(ie.stopPropagation(),he&&(_e.length===1&&l((he.clientX-ie.clientX)/n,(he.clientY-ie.clientY)/n),le(ie)))}),de=k.useCallback(ie=>{const _e=u.current;_e.length===2&&_e.find(he=>he.pointerId===ie.pointerId)&&(g.current=void 0),Y(ie)},[Y]),G=k.useCallback(()=>{const ie=u.current;ie.splice(0,ie.length),p.current=0,g.current=void 0},[]);Xwe(b,ae,te,de,i),k.useEffect(G,[_,G]),k.useEffect(()=>i?()=>{}:SZ(G,b(_Z,$),b(EZ,Q)),[i,b,G,$,Q])}function Ctt(n,t,i){const[s,l]=k.useState(1),[d,u]=k.useState(0),[p,g]=k.useState(0),_=Ett(s,d,p,i),{currentSlide:y,globalIndex:E}=Wv(),{containerRect:b,slideRect:A}=Ug(),{zoomInMultiplier:N}=tF(),O=y&&ix(y)?y.src:void 0,D=!O||!(i!=null&&i.current);Fp(()=>{l(1),u(0),g(0)},[E,O]);const P=k.useCallback(($,Q,Y)=>{const le=Y||s,ae=d-($||0),te=p-(Q||0),de=(n.width*le-A.width)/2/le,G=(n.height*le-A.height)/2/le;u(Math.min(Math.abs(ae),Math.max(de,0))*Math.sign(ae)),g(Math.min(Math.abs(te),Math.max(G,0))*Math.sign(te))},[s,d,p,A,n.width,n.height]),j=k.useCallback(($,Q,Y,le)=>{const ae=CZ(Math.min(Math.max($+.001<t?$:t,1),t),5);ae!==s&&(Q||_(),P(Y?Y*(1/s-1/ae):0,le?le*(1/s-1/ae):0,ae),l(ae))},[s,t,P,_]),M=Br(()=>{s>1&&(s>t&&j(t,!0),P())});Fp(M,[b.width,b.height,M]);const V=k.useCallback(()=>j(s*N),[s,N,j]),H=k.useCallback(()=>j(s/N),[s,N,j]);return{zoom:s,offsetX:d,offsetY:p,disabled:D,changeOffsets:P,changeZoom:j,zoomIn:V,zoomOut:H}}const tSe=k.createContext(null),NZ=Hv("useZoom","ZoomControllerContext",tSe);function Ttt({children:n}){const[t,i]=k.useState(),{slideRect:s}=Ug(),{imageRect:l,maxZoom:d}=Stt(s,t==null?void 0:t.imageDimensions),{zoom:u,offsetX:p,offsetY:g,disabled:_,changeZoom:y,changeOffsets:E,zoomIn:b,zoomOut:A}=Ctt(l,d,t==null?void 0:t.zoomWrapperRef);wtt(u,_),btt(u,d,_,y,E,t==null?void 0:t.zoomWrapperRef);const N=k.useMemo(()=>({zoom:u,maxZoom:d,offsetX:p,offsetY:g,disabled:_,zoomIn:b,zoomOut:A,changeZoom:y}),[u,d,p,g,_,b,A,y]);k.useImperativeHandle(tF().ref,()=>N,[N]);const O=k.useMemo(()=>({...N,setZoomWrapper:i}),[N,i]);return k.createElement(tSe.Provider,{value:O},n)}const Rtt=ZE("ZoomIn",k.createElement(k.Fragment,null,k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),k.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),xtt=ZE("ZoomOut",k.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Xfe=k.forwardRef(function({zoomIn:t,onLoseFocus:i},s){const l=k.useRef(!1),d=k.useRef(!1),{zoom:u,maxZoom:p,zoomIn:g,zoomOut:_,disabled:y}=NZ(),{render:E}=sh(),b=y||(t?u>=p:u<=1);return k.useEffect(()=>{b&&l.current&&d.current&&i(),b||(l.current=!0)},[b,i]),k.createElement(xZ,{ref:s,disabled:b,label:t?"Zoom in":"Zoom out",icon:t?Rtt:xtt,renderIcon:t?E.iconZoomIn:E.iconZoomOut,onClick:t?g:_,onFocus:()=>{d.current=!0},onBlur:()=>{d.current=!1}})});function Att(){const n=k.useRef(null),t=k.useRef(null),{focus:i}=Ug(),s=k.useCallback(u=>{var p,g;!((p=u.current)===null||p===void 0)&&p.disabled?i():(g=u.current)===null||g===void 0||g.focus()},[i]),l=k.useCallback(()=>s(n),[s]),d=k.useCallback(()=>s(t),[s]);return k.createElement(k.Fragment,null,k.createElement(Xfe,{zoomIn:!0,ref:n,onLoseFocus:d}),k.createElement(Xfe,{ref:t,onLoseFocus:l}))}function Itt(){const{render:n}=sh(),t=NZ();return n.buttonZoom?k.createElement(k.Fragment,null,n.buttonZoom(t)):k.createElement(Att,null)}function Ntt(n){var t;return(((t=n.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function Ott({current:n,preload:t},{type:i,source:s}){switch(i){case"fetch":return n?{current:n,preload:s}:{current:s};case"done":return s===t?{current:s}:{current:n,preload:t};default:throw new Error(jwe)}}function Ptt(n){var t,i;const[{current:s,preload:l},d]=k.useReducer(Ott,{}),{slide:u,rect:p,imageFit:g,render:_,interactive:y}=n,E=u.srcSet.sort((H,$)=>H.width-$.width),b=(t=u.width)!==null&&t!==void 0?t:E[E.length-1].width,A=(i=u.height)!==null&&i!==void 0?i:E[E.length-1].height,N=TZ(u,g),O=Math.max(...E.map(H=>H.width)),D=Math.min((N?Math.max:Math.min)(p.width,b*(p.height/A)),O),P=Ret(),j=Br(()=>{var H;const $=(H=E.find(Q=>Q.width>=D*P))!==null&&H!==void 0?H:E[E.length-1];(!s||E.findIndex(Q=>Q.src===s)<E.findIndex(Q=>Q===$))&&d({type:"fetch",source:$.src})});Fp(j,[p.width,p.height,P,j]);const M=Br(H=>d({type:"done",source:H})),V={WebkitTransform:y?"initial":"translateZ(0)"};return N||Object.assign(V,p.width/p.height<b/A?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),k.createElement(k.Fragment,null,l&&l!==s&&k.createElement(V7,{key:"preload",...n,slide:{...u,src:l,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...V},onLoad:()=>M(l),render:{..._,iconLoading:()=>null,iconError:()=>null}}),s&&k.createElement(V7,{key:"current",...n,slide:{...u,src:s,srcSet:void 0},style:V}))}function Ltt({render:n,slide:t,offset:i,rect:s}){var l;const[d,u]=k.useState(),p=k.useRef(null),{zoom:g,maxZoom:_,offsetX:y,offsetY:E,setZoomWrapper:b}=NZ(),A=g>1,{carousel:N,on:O}=sh(),{currentIndex:D}=Wv();Fp(()=>i===0?(b({zoomWrapperRef:p,imageDimensions:d}),()=>b(void 0)):()=>{},[i,d,b]);let P=(l=n.slide)===null||l===void 0?void 0:l.call(n,{slide:t,offset:i,rect:s,zoom:g,maxZoom:_});if(!P&&ix(t)){const j={slide:t,offset:i,rect:s,render:n,imageFit:N.imageFit,imageProps:N.imageProps,onClick:i===0?()=>{var M;return(M=O.click)===null||M===void 0?void 0:M.call(O,{index:D})}:void 0};P=Ntt(t)?k.createElement(Ptt,{...j,slide:t,interactive:A,rect:i===0?{width:s.width*g,height:s.height*g}:s}):k.createElement(V7,{onLoad:M=>u({width:M.naturalWidth,height:M.naturalHeight}),...j})}return P?k.createElement("div",{ref:p,className:Mp(Er(met),Er(yZ),Er(Nwe),A&&Er(vet)),style:i===0?{transform:`scale(${g}) translateX(${y}px) translateY(${E}px)`}:void 0},P):null}const Dtt=({augment:n,addModule:t})=>{n(({zoom:i,toolbar:s,render:l,controller:d,...u})=>{const p=eSe(i);return{zoom:p,toolbar:Aet(s,Mfe,k.createElement(Itt,null)),render:{...l,slide:g=>{var _;return ix(g.slide)?k.createElement(Ltt,{render:l,...g}):(_=l.slide)===null||_===void 0?void 0:_.call(l,g)}},controller:{...d,preventDefaultWheelY:p.scrollToZoom},...u}}),t(Gv(Mfe,Ttt))};function ktt(n){var N,O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe,me,Ne,Fe,je,Ve,Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t,Xt,Ht,gn,It;k.useState(!0);const[t,i]=k.useState("details_tab"),[s,l]=k.useState(!1),[d,u]=dn.useState(0),p=Array.isArray((N=n.data)==null?void 0:N.gallery_urls)?(O=n.data)==null?void 0:O.gallery_urls.map(xt=>({src:xt})):[],g=(D=n.data)!=null&&D.media_url?[{src:(P=n.data)==null?void 0:P.media_url}]:[],_=xt=>{console.log("Key in handleSelectedTab =",xt),xt=="details_tab"&&console.log("Entering into details_tab"),xt=="likes_tab"&&(console.log("Entering into likes"),n.likesListHandler(n.parent_id)),xt=="comments_tab"&&n.handleCommentList(n.parent_id),i(xt)},y={shouldSwiperUpdate:!0,rebuildOnUpdate:!0,autoplay:{delay:4e3,disableOnInteraction:!1},effect:"slide",pagination:{el:".swiper-pagination",clickable:!0},spaceBetween:15,grabCursor:!0};let E="16x9";switch((j=n.data)==null?void 0:j.media_type){case"video":E="16x9";break;case"audio":E="21x9";break;case"image":E="16x9";break;default:E="16x9"}const b=((M=n.data)==null?void 0:M.media_type)==="audio"&&{marginTop:"-90px"};function A(xt,mt){console.log("Image clicked = ",xt," Index = ",mt),u(mt),l(!0)}return h.jsxs(h.Fragment,{children:[h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:`heading-icon ${n.mediaIconClass} d-flex justify-content-center align-items-center rounded-circl font-24`,children:h.jsx(Zt,{tag:n.mediaIcon})})}),h.jsx("div",{className:"heading flex-grow-1 ms-2",children:(V=n.data)==null?void 0:V.name})]})}),h.jsx(vn.Body,{className:"no-scrollbar py-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((H=n.data)==null?void 0:H.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(Q=($=n==null?void 0:n.parentData)==null?void 0:$.user_info)==null?void 0:Q.name]})," ",h.jsx("div",{children:`${(le=(Y=n==null?void 0:n.parentData)==null?void 0:Y.expiry_date)==null?void 0:le.day} ${(te=(ae=n==null?void 0:n.parentData)==null?void 0:ae.expiry_date)==null?void 0:te.month} ${(G=(de=n==null?void 0:n.parentData)==null?void 0:de.expiry_date)==null?void 0:G.year}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(ie=n.data)==null?void 0:ie.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(he=(_e=n==null?void 0:n.parentData)==null?void 0:_e.user_info)==null?void 0:he.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(fe=(Ce=n==null?void 0:n.parentData)==null?void 0:Ce.expiry_date)==null?void 0:fe.day} ${(Ne=(me=n==null?void 0:n.parentData)==null?void 0:me.expiry_date)==null?void 0:Ne.month} ${(je=(Fe=n==null?void 0:n.parentData)==null?void 0:Fe.expiry_date)==null?void 0:je.year}`})})]})}),((Ve=n.data)==null?void 0:Ve.media_type)==="pdf"?h.jsx(h.Fragment,{children:h.jsx(Jd,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden border",style:{height:"calc(100% - 15vh)",borderRadius:10},children:h.jsx(gZ,{fileUrl:(Re=n.data)==null?void 0:Re.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})})}):h.jsx(h.Fragment,{children:((Be=n.data)==null?void 0:Be.media_type.toLowerCase())==="image"?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx("img",{src:n.data.media_url,alt:`${(Xe=n.data)==null?void 0:Xe.name} image`,className:"img-fluid mx-auto",onClick:()=>l(!0)})})}):h.jsx(h.Fragment,{children:((we=n.data)==null?void 0:we.media_type.toLowerCase())==="gallery"&&Array.isArray((Ge=n.data)==null?void 0:Ge.gallery_urls)?h.jsx(h.Fragment,{children:((pt=(rt=n.data)==null?void 0:rt.gallery_urls)==null?void 0:pt.length)>0?h.jsx("div",{className:"mb-4",children:h.jsx(KQ,{...y,containerClass:"swiper-container theme-swiper media-gallery-swiper mb-2 position-relative",children:(Ze=n.data)==null?void 0:Ze.gallery_urls.map((xt,mt)=>{var dt,it;return h.jsx(et,{className:"card-slide shadow-sm border-0 overflow-hidden bg-transparent shadow-none",onClick:()=>A(xt,mt),children:h.jsx(et.Body,{className:"p-0",children:h.jsx(us,{src:xt,alt:`Magazine Media ${(dt=n.data)==null?void 0:dt.name} image ${mt+1}`})})},`${(it=n.data)==null?void 0:it.name} image ${mt+1}`)})})}):h.jsx(h.Fragment,{})}):h.jsx("div",{className:"media-container mb-2",children:h.jsx(Jd,{aspectRatio:`${E}`,style:b,children:h.jsx(XE,{url:(Je=n.data)==null?void 0:Je.media_url,width:"100%",height:"100%",controls:!0,playing:!1})})})})}),h.jsxs(Zn.Container,{id:"media-tabs-example",className:"main_tabs",activeKey:t,onSelect:xt=>_(xt),children:[h.jsx("div",{className:"tab_links position-relative",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"likes_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.likeCount} ${(n==null?void 0:n.likeCount)===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"details_tab",children:[h.jsxs("div",{className:"border-to border-botto py-1 d-flex align-items-center justify-content-between",children:[h.jsx("div",{children:h.jsx("span",{className:"font-13 text-gray7 border-en pe-",children:`${(_t=n.data)==null?void 0:_t.points} Points`})}),h.jsx("div",{children:h.jsxs("span",{className:"font-13 text-gray7 border-en pe-",children:[h.jsx(Zt,{tag:"view1",className:"me-1 font-16"}),`${(Xt=n.data)!=null&&Xt.view_count?(Ht=n.data)==null?void 0:Ht.view_count:0} Views`]})})]}),h.jsx("div",{className:"border-to font-14 text-gray7 pb-2 border-botto pt-2 mb-2",children:(gn=n.data)==null?void 0:gn.description})]}),h.jsx(Zn.Pane,{className:"",eventKey:"likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.parent_id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]}),h.jsx(ytt,{open:s,close:()=>l(!1),index:d,on:{view:({index:xt})=>u(xt)},slides:((It=n.data)==null?void 0:It.media_type.toLowerCase())==="gallery"?p:g,carousel:{finite:p.length<=1},controller:{closeOnBackdropClick:!0},animation:{fade:400,swipe:400},render:{buttonPrev:p.length<=1?()=>null:void 0,buttonNext:p.length<=1?()=>null:void 0},plugins:[Dtt]})]})}function Mtt(n){var Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t,Xt,Ht,gn,It;const[t,i]=k.useState((Re=n.media)==null?void 0:Re.is_liked),[s,l]=k.useState((Be=n.media)==null?void 0:Be.likes_count),[d,u]=k.useState(((Xe=n.media)==null?void 0:Xe.viewed)||!1),[p,g]=k.useState(null),[_,y]=k.useState(!1),[E,b]=k.useState((we=n.media)==null?void 0:we.comments_count),[A,N]=k.useState(!1),[O,D]=k.useState([]),[P,j]=k.useState(!0),[M,V]=k.useState([]),[H,$]=k.useState(!0),[Q,Y]=k.useState({isVisible:!1}),[le,ae]=k.useState(!1),te=(Ge=n.media)!=null&&Ge.media_type?(rt=n.media)==null?void 0:rt.media_type.toLowerCase():"image",{mediaIcon:de,mediaIconClass:G}=J6e(te);let ie=(pt=n.media)!=null&&pt.media_url?(Ze=n.media)==null?void 0:Ze.media_url:"";const _e=()=>{Y({isVisible:!1})},he=()=>{Y({isVisible:!0})},Ce=()=>{ae(!1)},fe=()=>{ae(!0)},me=async()=>{var xt,mt;if(!n.is_allowed_to_view){fe();return}if(Ve((xt=n.media)==null?void 0:xt.id),te==="quiz"||te==="external"||te==="survey"||te==="form"){console.log("You will be redirected to a media link - ",te,`
Media type is `,(mt=n.media)==null?void 0:mt.media_url),ie!==""&&await DR.open({url:ie,toolbarColor:IE});return}he()};async function Ne(xt){N(!0),xt&&hs.getMagazineMediaLike(xt).then(mt=>{var dt,it;mt.data.status==="success"&&(i((dt=mt.data.data)==null?void 0:dt.is_liked),l((it=mt.data.data)==null?void 0:it.likes_count),Fe(xt),N(!1))}).catch(mt=>{var dt,it;N(!1),i((dt=n.media)==null?void 0:dt.is_liked),l((it=n.media)==null?void 0:it.likes_count),console.log("Error in getMagazineMediaLike = ",mt)})}async function Fe(xt){xt&&hs.getMagazineMediaLikesList(xt).then(mt=>{var dt;mt.data.status==="success"&&(D((dt=mt.data.data)==null?void 0:dt.likes),j(!1))}).catch(mt=>{j(!1),D([]),console.log("Error in getMagazineMediaLikesList = ",mt)})}async function je(xt){xt&&hs.getAllMagazineMediaCommentList(xt).then(mt=>{var dt;mt.data.status==="success"&&(V((dt=mt.data.data)==null?void 0:dt.comments),$(!1))}).catch(mt=>{$(!1),V([]),console.log("Error in getAllMagazineMediaCommentList = ",mt)})}async function Ve(xt){y(!0),xt&&hs.getMagazineMediaDetails(xt).then(mt=>{var dt,it,Me;if(console.log("getMagazineMediaDetails RES = ",mt.data),mt.data.status==="success"){const We=(dt=mt.data.data)==null?void 0:dt.media,bt=(Me=(it=mt.data.data)==null?void 0:it.media)==null?void 0:Me.viewed;g(We),u(bt),y(!1)}}).catch(mt=>{var dt;y(!1),g(null),u((dt=n.media)==null?void 0:dt.viewed),console.log("Error in getMagazineMediaDetails = ",mt)})}return h.jsxs(h.Fragment,{children:[h.jsxs(et,{className:`card-theme media-card border-0 shadow-sm ${((Je=n.media)==null?void 0:Je.viewed)&&"media-viewed"}`,children:[h.jsxs(et.Header,{className:"p-2 p-sm-3 position-relative border-bottom-0",onClick:me,children:[d&&h.jsx("div",{className:"media-viewed-icon position-absolute",children:h.jsx(Zt,{tag:"check1",className:"font-18"})}),h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:`d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden ${G}`,children:h.jsx(Zt,{tag:de,className:"font-28"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsx("span",{className:"d-block",children:(_t=n.media)==null?void 0:_t.name})})]})]}),h.jsx(et.Body,{className:"p-2 px-sm-3 font-14 text-grey",children:h.jsx("div",{className:"media-info text-truncate",children:(Xt=n.media)==null?void 0:Xt.description})}),te!=="quiz"||te!=="external"?h.jsx(et.Footer,{className:"p-2 px-sm-3 bg-transparent",children:h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-fl",children:h.jsx("span",{className:"font-13 text-gray7 border-en pe-",children:`${(Ht=n.media)==null?void 0:Ht.points} Points`})}),h.jsxs("div",{className:"btn-wrap",children:[(te==="quiz"||te==="external"||te==="form"||te==="survey")&&h.jsx(h.Fragment,{children:h.jsxs(Pt,{className:"btn-theme btn-sm btn-secondary-light px-2",onClick:me,children:[`Open ${$R(te)} ${te==="external"?"Link ":""}`,h.jsx(Zt,{tag:"arrow-right2",className:"font-14"})]})}),(te==="video"||te==="audio"||te==="image"||te==="pdf")&&h.jsxs(h.Fragment,{children:[h.jsx(Pt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${t&&"active"}`,children:A?h.jsx(Ji,{animation:"border",size:"sm"}):h.jsxs(h.Fragment,{children:[h.jsx(Zt,{tag:"favorite3",className:"font-18"})," ",s]})}),h.jsxs(Pt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(Zt,{tag:"message8",className:"font-18"})," ",E]})]})]})]})}):null]}),h.jsx(ktt,{show:Q,handleClose:_e,data:p,loadingData:_,parentData:n.magazineDetails,mediaIcon:de,mediaIconClass:G,mediaUrl:(gn=n.media)==null?void 0:gn.media_url,likesData:O,likeCount:s,isLiked:t,likeActionHandler:Ne,loadingMediaLike:A,loadingLikesList:P,likesListHandler:Fe,parent_id:(It=n.media)==null?void 0:It.id,parent_owner_id:null,comment_type:"media",loading:H,comments:M,handleCommentList:je,setCommentsCount:b,commentsCount:E}),h.jsx(hY,{show:le,handleClose:Ce,allow_action_button:!1,message_title:"Media display paused",message_text:"This magazine only allows sequential viewing, limiting simultaneous display."})]})}function jtt(n){var _;const{magazineId:t}=iU();k.useState(!1);const[i,s]=k.useState(null),[l,d]=k.useState(!0),[u,p]=k.useState([]);async function g(y){hs.getMagazineDetails(y).then(E=>{var b,A;console.log("getMagazineDetails RES = ",E.data),E.data.status==="success"&&(s(E.data.data.magazine),p((A=(b=E.data)==null?void 0:b.data)==null?void 0:A.medias),d(!1))}).catch(E=>{d(!1),s(null),console.log("Error in getMagazineDetails = ",E)})}return k.useEffect(()=>{g(t)},[]),h.jsx(h.Fragment,{children:h.jsx(qi,{className:"magazine-details-page",children:h.jsxs(Yn,{className:"mb-4",children:[l&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!l&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"p-2 ps-0 font-15 fw-sb",children:i==null?void 0:i.name}),h.jsx(us,{src:i==null?void 0:i.image,alt:`${i==null?void 0:i.name} image`,wrapperClassName:"card-img mb-3"}),h.jsxs("div",{className:"font-13 mb-3",children:[h.jsxs("span",{className:"text-theme-primary fw-sb mb-1",children:["Published By:"," "]})," ",(_=i==null?void 0:i.user_info)==null?void 0:_.name,h.jsx(YO,{text:i==null?void 0:i.description,linesToShow:2,containerClass:"font-13 contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}})]}),h.jsx("hr",{}),h.jsx("div",{className:"font-14 fw-sb mb-3",children:"All Media"}),h.jsx("div",{className:"d-grid gap-3",children:u.length>0?h.jsx(h.Fragment,{children:u.map((y,E)=>{var D;const b=i==null?void 0:i.is_sequenced;let A=0,N=!0,O=!0;return b==="yes"&&E>0?(A=E>0?E-1:0,N=A>=0&&((D=u[A])==null?void 0:D.viewed),O=!!N):O=!0,h.jsx(Mtt,{media:y,magazineDetails:i,is_allowed_to_view:O},y.id)})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more media"})})})]})]})})})}var Utt=Object.create,nF=Object.defineProperty,Ftt=Object.getOwnPropertyDescriptor,Btt=Object.getOwnPropertyNames,Vtt=Object.getPrototypeOf,ztt=Object.prototype.hasOwnProperty,Htt=(n,t)=>{for(var i in t)nF(n,i,{get:t[i],enumerable:!0})},nSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Btt(t))!ztt.call(n,l)&&l!==i&&nF(n,l,{get:()=>t[l],enumerable:!(s=Ftt(t,l))||s.enumerable});return n},OZ=(n,t,i)=>(i=n!=null?Utt(Vtt(n)):{},nSe(t||!n||!n.__esModule?nF(i,"default",{value:n,enumerable:!0}):i,n)),Gtt=n=>nSe(nF({},"__esModule",{value:!0}),n),iSe={};Htt(iSe,{callPlayer:()=>ant,getConfig:()=>rnt,getSDK:()=>int,isBlobUrl:()=>lnt,isMediaStream:()=>ont,lazy:()=>qtt,omit:()=>snt,parseEndTime:()=>ent,parseStartTime:()=>Ztt,queryString:()=>nnt,randomString:()=>tnt,supportsWebKitPresentationMode:()=>cnt});var iF=Gtt(iSe),Wtt=OZ(k),$tt=OZ(j_e),Ktt=OZ(UU);const qtt=n=>Wtt.default.lazy(async()=>{const t=await n();return typeof t.default=="function"?t:t.default}),Ytt=/[?&#](?:start|t)=([0-9hms]+)/,Xtt=/[?&#]end=([0-9hms]+)/,BX=/(\d+)(h|m|s)/g,Jtt=/^\d+$/;function rSe(n,t){if(n instanceof Array)return;const i=n.match(t);if(i){const s=i[1];if(s.match(BX))return Qtt(s);if(Jtt.test(s))return parseInt(s)}}function Qtt(n){let t=0,i=BX.exec(n);for(;i!==null;){const[,s,l]=i;l==="h"&&(t+=parseInt(s,10)*60*60),l==="m"&&(t+=parseInt(s,10)*60),l==="s"&&(t+=parseInt(s,10)),i=BX.exec(n)}return t}function Ztt(n){return rSe(n,Ytt)}function ent(n){return rSe(n,Xtt)}function tnt(){return Math.random().toString(36).substr(2,5)}function nnt(n){return Object.keys(n).map(t=>`${t}=${n[t]}`).join("&")}function gK(n){return window[n]?window[n]:window.exports&&window.exports[n]?window.exports[n]:window.module&&window.module.exports&&window.module.exports[n]?window.module.exports[n]:null}const jb={},int=function(t,i,s=null,l=()=>!0,d=$tt.default){const u=gK(i);return u&&l(u)?Promise.resolve(u):new Promise((p,g)=>{if(jb[t]){jb[t].push({resolve:p,reject:g});return}jb[t]=[{resolve:p,reject:g}];const _=y=>{jb[t].forEach(E=>E.resolve(y))};if(s){const y=window[s];window[s]=function(){y&&y(),_(gK(i))}}d(t,y=>{y?(jb[t].forEach(E=>E.reject(y)),jb[t]=null):s||_(gK(i))})})};function rnt(n,t){return(0,Ktt.default)(t.config,n.config)}function snt(n,...t){const i=[].concat(...t),s={},l=Object.keys(n);for(const d of l)i.indexOf(d)===-1&&(s[d]=n[d]);return s}function ant(n,...t){if(!this.player||!this.player[n]){let i=`ReactPlayer: ${this.constructor.displayName} player could not call %c${n}%c – `;return this.player?this.player[n]||(i+="The method was not available"):i+="The player was not available",console.warn(i,"font-weight: bold",""),null}return this.player[n](...t)}function ont(n){return typeof window<"u"&&typeof window.MediaStream<"u"&&n instanceof window.MediaStream}function lnt(n){return/^blob:/.test(n)}function cnt(n=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return n.webkitSupportsPresentationMode&&typeof n.webkitSetPresentationMode=="function"&&t}var PZ=Object.defineProperty,dnt=Object.getOwnPropertyDescriptor,unt=Object.getOwnPropertyNames,hnt=Object.prototype.hasOwnProperty,fnt=(n,t)=>{for(var i in t)PZ(n,i,{get:t[i],enumerable:!0})},pnt=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of unt(t))!hnt.call(n,l)&&l!==i&&PZ(n,l,{get:()=>t[l],enumerable:!(s=dnt(t,l))||s.enumerable});return n},mnt=n=>pnt(PZ({},"__esModule",{value:!0}),n),sSe={};fnt(sSe,{AUDIO_EXTENSIONS:()=>LZ,DASH_EXTENSIONS:()=>ySe,FLV_EXTENSIONS:()=>_Se,HLS_EXTENSIONS:()=>kZ,MATCH_URL_DAILYMOTION:()=>pSe,MATCH_URL_FACEBOOK:()=>lSe,MATCH_URL_FACEBOOK_WATCH:()=>cSe,MATCH_URL_KALTURA:()=>vSe,MATCH_URL_MIXCLOUD:()=>mSe,MATCH_URL_SOUNDCLOUD:()=>aSe,MATCH_URL_STREAMABLE:()=>dSe,MATCH_URL_TWITCH_CHANNEL:()=>fSe,MATCH_URL_TWITCH_VIDEO:()=>hSe,MATCH_URL_VIDYARD:()=>gSe,MATCH_URL_VIMEO:()=>oSe,MATCH_URL_WISTIA:()=>uSe,MATCH_URL_YOUTUBE:()=>VX,VIDEO_EXTENSIONS:()=>DZ,canPlay:()=>vnt});var gnt=mnt(sSe),Jfe=iF;const VX=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,aSe=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,oSe=/vimeo\.com\/(?!progressive_redirect).+/,lSe=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,cSe=/^https?:\/\/fb\.watch\/.+$/,dSe=/streamable\.com\/([a-z0-9]+)$/,uSe=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,hSe=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,fSe=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,pSe=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,mSe=/mixcloud\.com\/([^/]+\/[^/]+)/,gSe=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,vSe=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,LZ=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,DZ=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,kZ=/\.(m3u8)($|\?)/i,ySe=/\.(mpd)($|\?)/i,_Se=/\.(flv)($|\?)/i,zX=n=>{if(n instanceof Array){for(const t of n)if(typeof t=="string"&&zX(t)||zX(t.src))return!0;return!1}return(0,Jfe.isMediaStream)(n)||(0,Jfe.isBlobUrl)(n)?!0:LZ.test(n)||DZ.test(n)||kZ.test(n)||ySe.test(n)||_Se.test(n)},vnt={youtube:n=>n instanceof Array?n.every(t=>VX.test(t)):VX.test(n),soundcloud:n=>aSe.test(n)&&!LZ.test(n),vimeo:n=>oSe.test(n)&&!DZ.test(n)&&!kZ.test(n),facebook:n=>lSe.test(n)||cSe.test(n),streamable:n=>dSe.test(n),wistia:n=>uSe.test(n),twitch:n=>hSe.test(n)||fSe.test(n),dailymotion:n=>pSe.test(n),mixcloud:n=>mSe.test(n),vidyard:n=>gSe.test(n),kaltura:n=>vSe.test(n),file:zX};var MZ=Object.defineProperty,ynt=Object.getOwnPropertyDescriptor,_nt=Object.getOwnPropertyNames,Ent=Object.prototype.hasOwnProperty,wnt=(n,t)=>{for(var i in t)MZ(n,i,{get:t[i],enumerable:!0})},Snt=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of _nt(t))!Ent.call(n,l)&&l!==i&&MZ(n,l,{get:()=>t[l],enumerable:!(s=ynt(t,l))||s.enumerable});return n},bnt=n=>Snt(MZ({},"__esModule",{value:!0}),n),ESe={};wnt(ESe,{default:()=>Tnt});var Cnt=bnt(ESe),wd=iF,Uc=gnt,Tnt=[{key:"youtube",name:"YouTube",canPlay:Uc.canPlay.youtube,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./YouTube-Bccsz9Yl.js").then(n=>n.Y),__vite__mapDeps([])))},{key:"soundcloud",name:"SoundCloud",canPlay:Uc.canPlay.soundcloud,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./SoundCloud-BI71e4_l.js").then(n=>n.S),__vite__mapDeps([])))},{key:"vimeo",name:"Vimeo",canPlay:Uc.canPlay.vimeo,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Vimeo-Dxa-X4z9.js").then(n=>n.V),__vite__mapDeps([])))},{key:"facebook",name:"Facebook",canPlay:Uc.canPlay.facebook,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Facebook-DJ0hneLF.js").then(n=>n.F),__vite__mapDeps([])))},{key:"streamable",name:"Streamable",canPlay:Uc.canPlay.streamable,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Streamable-CnBBuBIV.js").then(n=>n.S),__vite__mapDeps([])))},{key:"wistia",name:"Wistia",canPlay:Uc.canPlay.wistia,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Wistia-CeioMyv4.js").then(n=>n.W),__vite__mapDeps([])))},{key:"twitch",name:"Twitch",canPlay:Uc.canPlay.twitch,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Twitch-CNaDXULh.js").then(n=>n.T),__vite__mapDeps([])))},{key:"dailymotion",name:"DailyMotion",canPlay:Uc.canPlay.dailymotion,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./DailyMotion-D4uW8REe.js").then(n=>n.D),__vite__mapDeps([])))},{key:"mixcloud",name:"Mixcloud",canPlay:Uc.canPlay.mixcloud,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Mixcloud-CXhqduaQ.js").then(n=>n.M),__vite__mapDeps([])))},{key:"vidyard",name:"Vidyard",canPlay:Uc.canPlay.vidyard,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Vidyard-DU1jnJxN.js").then(n=>n.V),__vite__mapDeps([])))},{key:"kaltura",name:"Kaltura",canPlay:Uc.canPlay.kaltura,lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./Kaltura-Bvtx45-y.js").then(n=>n.K),__vite__mapDeps([])))},{key:"file",name:"FilePlayer",canPlay:Uc.canPlay.file,canEnablePIP:n=>Uc.canPlay.file(n)&&(document.pictureInPictureEnabled||(0,wd.supportsWebKitPresentationMode)())&&!Uc.AUDIO_EXTENSIONS.test(n),lazyPlayer:(0,wd.lazy)(()=>Xi(()=>import("./FilePlayer-CKq2ehRf.js").then(n=>n.F),__vite__mapDeps([])))}],Rnt=Object.create,rF=Object.defineProperty,xnt=Object.getOwnPropertyDescriptor,Ant=Object.getOwnPropertyNames,Int=Object.getPrototypeOf,Nnt=Object.prototype.hasOwnProperty,Ont=(n,t)=>{for(var i in t)rF(n,i,{get:t[i],enumerable:!0})},wSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ant(t))!Nnt.call(n,l)&&l!==i&&rF(n,l,{get:()=>t[l],enumerable:!(s=xnt(t,l))||s.enumerable});return n},Pnt=(n,t,i)=>(i=n!=null?Rnt(Int(n)):{},wSe(t||!n||!n.__esModule?rF(i,"default",{value:n,enumerable:!0}):i,n)),Lnt=n=>wSe(rF({},"__esModule",{value:!0}),n),SSe={};Ont(SSe,{defaultProps:()=>Mnt,propTypes:()=>knt});var bSe=Lnt(SSe),Dnt=Pnt(uQ);const{string:Gl,bool:Wl,number:Ub,array:vK,oneOfType:SI,shape:ku,object:$l,func:ja,node:Qfe}=Dnt.default,knt={url:SI([Gl,vK,$l]),playing:Wl,loop:Wl,controls:Wl,volume:Ub,muted:Wl,playbackRate:Ub,width:SI([Gl,Ub]),height:SI([Gl,Ub]),style:$l,progressInterval:Ub,playsinline:Wl,pip:Wl,stopOnUnmount:Wl,light:SI([Wl,Gl,$l]),playIcon:Qfe,previewTabIndex:Ub,fallback:Qfe,oEmbedUrl:Gl,wrapper:SI([Gl,ja,ku({render:ja.isRequired})]),config:ku({soundcloud:ku({options:$l}),youtube:ku({playerVars:$l,embedOptions:$l,onUnstarted:ja}),facebook:ku({appId:Gl,version:Gl,playerId:Gl,attributes:$l}),dailymotion:ku({params:$l}),vimeo:ku({playerOptions:$l,title:Gl}),file:ku({attributes:$l,tracks:vK,forceVideo:Wl,forceAudio:Wl,forceHLS:Wl,forceSafariHLS:Wl,forceDisableHls:Wl,forceDASH:Wl,forceFLV:Wl,hlsOptions:$l,hlsVersion:Gl,dashVersion:Gl,flvVersion:Gl}),wistia:ku({options:$l,playerId:Gl,customControls:vK}),mixcloud:ku({options:$l}),twitch:ku({options:$l,playerId:Gl}),vidyard:ku({options:$l})}),onReady:ja,onStart:ja,onPlay:ja,onPause:ja,onBuffer:ja,onBufferEnd:ja,onEnded:ja,onError:ja,onDuration:ja,onSeek:ja,onPlaybackRateChange:ja,onPlaybackQualityChange:ja,onProgress:ja,onClickPreview:ja,onEnablePIP:ja,onDisablePIP:ja},Do=()=>{},Mnt={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Do},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Do,onStart:Do,onPlay:Do,onPause:Do,onBuffer:Do,onBufferEnd:Do,onEnded:Do,onError:Do,onDuration:Do,onSeek:Do,onPlaybackRateChange:Do,onPlaybackQualityChange:Do,onProgress:Do,onClickPreview:Do,onEnablePIP:Do,onDisablePIP:Do};var jnt=Object.create,oP=Object.defineProperty,Unt=Object.getOwnPropertyDescriptor,Fnt=Object.getOwnPropertyNames,Bnt=Object.getPrototypeOf,Vnt=Object.prototype.hasOwnProperty,znt=(n,t,i)=>t in n?oP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,Hnt=(n,t)=>{for(var i in t)oP(n,i,{get:t[i],enumerable:!0})},CSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Fnt(t))!Vnt.call(n,l)&&l!==i&&oP(n,l,{get:()=>t[l],enumerable:!(s=Unt(t,l))||s.enumerable});return n},TSe=(n,t,i)=>(i=n!=null?jnt(Bnt(n)):{},CSe(t||!n||!n.__esModule?oP(i,"default",{value:n,enumerable:!0}):i,n)),Gnt=n=>CSe(oP({},"__esModule",{value:!0}),n),da=(n,t,i)=>(znt(n,typeof t!="symbol"?t+"":t,i),i),RSe={};Hnt(RSe,{default:()=>sF});var Wnt=Gnt(RSe),Zfe=TSe(k),$nt=TSe(VU),xSe=bSe,Knt=iF;const qnt=5e3;class sF extends Zfe.Component{constructor(){super(...arguments),da(this,"mounted",!1),da(this,"isReady",!1),da(this,"isPlaying",!1),da(this,"isLoading",!0),da(this,"loadOnReady",null),da(this,"startOnPlay",!0),da(this,"seekOnPlay",null),da(this,"onDurationCalled",!1),da(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),da(this,"getInternalPlayer",t=>this.player?this.player[t]:null),da(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,i=this.getSecondsLoaded(),s=this.getDuration();if(s){const l={playedSeconds:t,played:t/s};i!==null&&(l.loadedSeconds=i,l.loaded=i/s),(l.playedSeconds!==this.prevPlayed||l.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(l),this.prevPlayed=l.playedSeconds,this.prevLoaded=l.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),da(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:i,volume:s,muted:l}=this.props;t(),!l&&s!==null&&this.player.setVolume(s),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):i&&this.player.play(),this.handleDurationCheck()}),da(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:i,playbackRate:s}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&s!==1&&this.player.setPlaybackRate(s),t(),this.startOnPlay=!1),i(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),da(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),da(this,"handleEnded",()=>{const{activePlayer:t,loop:i,onEnded:s}=this.props;t.loopOnEnded&&i&&this.seekTo(0),i||(this.isPlaying=!1,s())}),da(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),da(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),da(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:i,playing:s,volume:l,muted:d,playbackRate:u,pip:p,loop:g,activePlayer:_,disableDeferredLoading:y}=this.props;if(!(0,$nt.default)(t.url,i)){if(this.isLoading&&!_.forceLoad&&!y&&!(0,Knt.isMediaStream)(i)){console.warn(`ReactPlayer: the attempt to load ${i} is being deferred until the player has loaded`),this.loadOnReady=i;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(i,this.isReady)}!t.playing&&s&&!this.isPlaying&&this.player.play(),t.playing&&!s&&this.isPlaying&&this.player.pause(),!t.pip&&p&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!p&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==l&&l!==null&&this.player.setVolume(l),t.muted!==d&&(d?this.player.mute():(this.player.unmute(),l!==null&&setTimeout(()=>this.player.setVolume(l)))),t.playbackRate!==u&&this.player.setPlaybackRate&&this.player.setPlaybackRate(u),t.loop!==g&&this.player.setLoop&&this.player.setLoop(g)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,i,s){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},qnt));return}if(i?i==="fraction":t>0&&t<1){const d=this.player.getDuration();if(!d){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(d*t,s);return}this.player.seekTo(t,s)}render(){const t=this.props.activePlayer;return t?Zfe.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}da(sF,"displayName","Player");da(sF,"propTypes",xSe.propTypes);da(sF,"defaultProps",xSe.defaultProps);var Ynt=Object.create,lP=Object.defineProperty,Xnt=Object.getOwnPropertyDescriptor,Jnt=Object.getOwnPropertyNames,Qnt=Object.getPrototypeOf,Znt=Object.prototype.hasOwnProperty,eit=(n,t,i)=>t in n?lP(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,tit=(n,t)=>{for(var i in t)lP(n,i,{get:t[i],enumerable:!0})},ASe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Jnt(t))!Znt.call(n,l)&&l!==i&&lP(n,l,{get:()=>t[l],enumerable:!(s=Xnt(t,l))||s.enumerable});return n},cP=(n,t,i)=>(i=n!=null?Ynt(Qnt(n)):{},ASe(t||!n||!n.__esModule?lP(i,"default",{value:n,enumerable:!0}):i,n)),nit=n=>ASe(lP({},"__esModule",{value:!0}),n),la=(n,t,i)=>(eit(n,typeof t!="symbol"?t+"":t,i),i),ISe={};tit(ISe,{createReactPlayer:()=>uit});var iit=nit(ISe),Jb=cP(k),rit=cP(UU),yK=cP(r2e),epe=cP(VU),t4=bSe,NSe=iF,sit=cP(Wnt);const ait=(0,NSe.lazy)(()=>Xi(()=>import("./Preview-DE052SrE.js").then(n=>n.P),__vite__mapDeps([]))),oit=typeof window<"u"&&window.document,lit=typeof Vs<"u"&&Vs.window&&Vs.window.document,cit=Object.keys(t4.propTypes),dit=oit||lit?Jb.Suspense:()=>null,bI=[],uit=(n,t)=>{var i;return i=class extends Jb.Component{constructor(){super(...arguments),la(this,"state",{showPreview:!!this.props.light}),la(this,"references",{wrapper:s=>{this.wrapper=s},player:s=>{this.player=s}}),la(this,"handleClickPreview",s=>{this.setState({showPreview:!1}),this.props.onClickPreview(s)}),la(this,"showPreview",()=>{this.setState({showPreview:!0})}),la(this,"getDuration",()=>this.player?this.player.getDuration():null),la(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),la(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),la(this,"getInternalPlayer",(s="player")=>this.player?this.player.getInternalPlayer(s):null),la(this,"seekTo",(s,l,d)=>{if(!this.player)return null;this.player.seekTo(s,l,d)}),la(this,"handleReady",()=>{this.props.onReady(this)}),la(this,"getActivePlayer",(0,yK.default)(s=>{for(const l of[...bI,...n])if(l.canPlay(s))return l;return t||null})),la(this,"getConfig",(0,yK.default)((s,l)=>{const{config:d}=this.props;return rit.default.all([t4.defaultProps.config,t4.defaultProps.config[l]||{},d,d[l]||{}])})),la(this,"getAttributes",(0,yK.default)(s=>(0,NSe.omit)(this.props,cit))),la(this,"renderActivePlayer",s=>{if(!s)return null;const l=this.getActivePlayer(s);if(!l)return null;const d=this.getConfig(s,l.key);return Jb.default.createElement(sit.default,{...this.props,key:l.key,ref:this.references.player,config:d,activePlayer:l.lazyPlayer||l,onReady:this.handleReady})})}shouldComponentUpdate(s,l){return!(0,epe.default)(this.props,s)||!(0,epe.default)(this.state,l)}componentDidUpdate(s){const{light:l}=this.props;!s.light&&l&&this.setState({showPreview:!0}),s.light&&!l&&this.setState({showPreview:!1})}renderPreview(s){if(!s)return null;const{light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p}=this.props;return Jb.default.createElement(ait,{url:s,light:l,playIcon:d,previewTabIndex:u,oEmbedUrl:p,onClick:this.handleClickPreview})}render(){const{url:s,style:l,width:d,height:u,fallback:p,wrapper:g}=this.props,{showPreview:_}=this.state,y=this.getAttributes(s),E=typeof g=="string"?this.references.wrapper:void 0;return Jb.default.createElement(g,{ref:E,style:{...l,width:d,height:u},...y},Jb.default.createElement(dit,{fallback:p},_?this.renderPreview(s):this.renderActivePlayer(s)))}},la(i,"displayName","ReactPlayer"),la(i,"propTypes",t4.propTypes),la(i,"defaultProps",t4.defaultProps),la(i,"addCustomPlayer",s=>{bI.push(s)}),la(i,"removeCustomPlayers",()=>{bI.length=0}),la(i,"canPlay",s=>{for(const l of[...bI,...n])if(l.canPlay(s))return!0;return!1}),la(i,"canEnablePIP",s=>{for(const l of[...bI,...n])if(l.canEnablePIP&&l.canEnablePIP(s))return!0;return!1}),i};var hit=Object.create,aF=Object.defineProperty,fit=Object.getOwnPropertyDescriptor,pit=Object.getOwnPropertyNames,mit=Object.getPrototypeOf,git=Object.prototype.hasOwnProperty,vit=(n,t)=>{for(var i in t)aF(n,i,{get:t[i],enumerable:!0})},OSe=(n,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of pit(t))!git.call(n,l)&&l!==i&&aF(n,l,{get:()=>t[l],enumerable:!(s=fit(t,l))||s.enumerable});return n},yit=(n,t,i)=>(i=n!=null?hit(mit(n)):{},OSe(t||!n||!n.__esModule?aF(i,"default",{value:n,enumerable:!0}):i,n)),_it=n=>OSe(aF({},"__esModule",{value:!0}),n),PSe={};vit(PSe,{default:()=>bit});var Eit=_it(PSe),HX=yit(Cnt),wit=iit;const Sit=HX.default[HX.default.length-1];var bit=(0,wit.createReactPlayer)(HX.default,Sit);const LSe=Mv(Eit);function jZ({url:n,allowControls:t,allowLightMode:i,allowPlaying:s,previewImage:l,className:d,style:u,title:p}){const[g,_]=k.useState(!0),[y,E]=k.useState(""),[b,A]=k.useState(s),[N,O]=k.useState(i),[D,P]=k.useState(t);k.useEffect(()=>{console.log("Inside useeffect"),console.log("CustomMediaViewer loads =",y),n&&(console.log("inside if --- ",n),E(n),_(!1))},[n]);const j=d||"",M=u||null,V=l&&N?l:"/img/default-bg-low-quality.jpg",H=N&&h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},onClick:Y=>$(),children:h.jsx(Zt,{tag:"play3",className:"font-30"})});function $(Y){A(!0)}const Q=g&&h.jsx(Ji,{animation:"border",variant:"dark"});return h.jsx(h.Fragment,{children:y?h.jsx("div",{className:`custom-video-viewer-card ratio ratio-16x9 overflow-hidden rounded-2 ${j}`,style:M,children:h.jsx(LSe,{url:y,width:"100%",height:"100%",playing:b,controls:D,light:N?V:!1,playIcon:H,fallback:Q})}):h.jsx("div",{className:"fw-sb font-16",children:"Video not found"})})}function UZ({url:n,allowControls:t,allowLightMode:i,allowPlaying:s,previewImage:l,className:d,style:u,title:p}){const[g,_]=k.useState(!0),[y,E]=k.useState(""),[b,A]=k.useState(s),[N,O]=k.useState(i),[D,P]=k.useState(t);k.useEffect(()=>{console.log("Inside useeffect"),console.log("CustomMediaViewer loads =",y),n&&(console.log("inside if --- ",n),E(n),_(!1))},[n]);const j=d||"",M=u||null,V=l&&N?l:"/img/default-bg-low-quality.jpg",H=N&&h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},onClick:Y=>$(),children:h.jsx(Zt,{tag:"play3",className:"font-30"})});function $(Y){A(!0)}const Q=g&&h.jsx(Ji,{animation:"border",variant:"dark"});return h.jsx(h.Fragment,{children:y?h.jsx("div",{className:`custom-audio-viewer-card ratio ratio-21x9 overflow-hidden rounded-2 ${j}`,style:M,children:h.jsx(LSe,{url:y,width:"100%",height:"100%",playing:b,controls:D,light:N?V:!1,playIcon:H,fallback:Q})}):h.jsx("div",{className:"fw-sb font-16",children:"Video not found"})})}function Cit({show:n,handleClose:t,classNames:i,likesData:s,likeCount:l,isLiked:d,loading:u,isHandleLoading:p,parentId:g,handleLike:_}){return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom likes-list-modal",show:n,onHide:t,children:[h.jsx(vn.Header,{className:"",closeButton:!0,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[h.jsx(Pt,{className:`btn-theme btn-s btn-likes-light me-2 px- ${d&&"active"}`,onClick:()=>_(g),children:p?h.jsx(Ji,{size:"sm",className:"me-1"}):h.jsx(Zt,{tag:"favorite3",className:"font-20 me-"})}),l," Likes"]})}),h.jsxs(vn.Body,{className:"no-scrollbar",children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center p-2 bg-gray-lighter3 rounded-3 mb-2",children:[h.jsx("span",{className:"font-13 fw-sb",children:d?"You liked it":"You did not like it yet!"}),h.jsxs(Pt,{className:`btn-theme btn-sm btn-likes-light ms-2 px-2 ${d&&"active"}`,onClick:()=>_(g),children:[p?h.jsx(Ji,{size:"sm",className:"me-1"}):h.jsx(Zt,{tag:"favorite3",className:"font-18 me-1"}),h.jsx("span",{className:"",children:d?"Dislike now":"Like now"})]})]}),u&&h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:[0,1,2].map((y,E)=>h.jsx(ci,{type:"likes-list"},E))})}),!u&&(s==null?void 0:s.length)>0&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-2",children:h.jsx(h.Fragment,{children:s.map(y=>h.jsx(k_e,{item:y,className:"",bodyClassName:"px-0"},y.name+y.date))})})}),!(s!=null&&s.length)>0&&!u&&h.jsx("div",{className:"p-2 font-14 fw-sb",children:"No more likes!"})]})]})})}function Tit(n){var d,u,p,g,_,y,E,b,A,N,O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe;const[t,i]=k.useState("msg_details_tab");console.log("WallMessageDetailsCard props = ",n);const s=(u=(d=n.data)==null?void 0:d.user_info)!=null&&u.avatar?(g=(p=n.data)==null?void 0:p.user_info)==null?void 0:g.avatar:"/img/profile-pic.png";switch((_=n.data)==null?void 0:_.media_type.toLowerCase()){}const l=me=>{var Ne;console.log("Key in handleSelectedTab =",me),me=="msg_details_tab"&&console.log("Entering into msg_details_tab"),me=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab"),n.likesListHandler((Ne=n.data)==null?void 0:Ne.id)),me=="msg_comments_tab"&&(console.log("Entering into msg_comments_tab parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),i(me)};return h.jsxs("div",{className:"wall-message-details-card",children:[h.jsx("div",{className:"p-2 px-0 font-15 fw-sb mb-0",children:(y=n.data)==null?void 0:y.title}),h.jsx("div",{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((E=n.data)==null?void 0:E.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(A=(b=n==null?void 0:n.data)==null?void 0:b.user_info)==null?void 0:A.name]})," ",h.jsx("div",{children:`${(N=n==null?void 0:n.data)==null?void 0:N.date}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(O=n.data)==null?void 0:O.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(P=(D=n==null?void 0:n.data)==null?void 0:D.user_info)==null?void 0:P.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(j=n==null?void 0:n.data)==null?void 0:j.date}`})})]})}),((M=n.data)==null?void 0:M.media_type.toLowerCase())==="pdf"&&h.jsx(h.Fragment,{children:h.jsx(Jd,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden mt-3 border rounded-3",style:{height:"calc(100% - 15vh)"},children:h.jsx(gZ,{fileUrl:(V=n.data)==null?void 0:V.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})})}),((H=n.data)==null?void 0:H.media_type.toLowerCase())==="video"&&h.jsx(jZ,{url:($=n.data)==null?void 0:$.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((Q=n.data)==null?void 0:Q.media_type.toLowerCase())==="audio"&&h.jsx(UZ,{url:(Y=n.data)==null?void 0:Y.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((le=n.data)==null?void 0:le.media_type.toLowerCase())==="image"&&h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(us,{src:(ae=n.data)==null?void 0:ae.media_url,alt:`${(te=n.data)==null?void 0:te.title} image`,wrapperClassName:"img-fluid mx-auto"})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:me=>l(me),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount?n.likeCount:0} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${n!=null&&n.commentsCount?n==null?void 0:n.commentsCount:0} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsxs("div",{className:"py-2",children:[h.jsx(et,{className:"border-0 evaluation-status-card bg-transparent",children:h.jsx(et.Header,{className:"font-13 p-2 px-0 border-0 pb-3",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:s,className:"rounded-circle media_img",alt:`${(G=(de=n==null?void 0:n.data)==null?void 0:de.user_info)==null?void 0:G.name} profile`})}),h.jsx("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-12 text-gray6 fw-",children:["Messaged on"," ",h.jsx("span",{className:"font-12 text-gray6",children:(ie=n==null?void 0:n.data)==null?void 0:ie.date}),h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(he=(_e=n==null?void 0:n.data)==null?void 0:_e.user_info)==null?void 0:he.name})]})]})})]})})}),h.jsx("div",{className:"font-14 text-gray7",children:(Ce=n.data)==null?void 0:Ce.body})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(fe=n.data)==null?void 0:fe.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})}function Rit(){const{msgId:n}=iU(),[t,i]=k.useState(null),[s,l]=k.useState(!0),[d,u]=k.useState(t==null?void 0:t.is_liked),[p,g]=k.useState(t==null?void 0:t.likes_count),[_,y]=k.useState(t==null?void 0:t.comments_count),[E,b]=k.useState(!1),[A,N]=k.useState([]),[O,D]=k.useState(!0),[P,j]=k.useState([]),[M,V]=k.useState(!0);k.useState([]),k.useState({isVisible:!1});async function H(le){console.log("msgId =",le),So.getWallMessageDetails(le).then(ae=>{var te,de,G,ie,_e,he;console.log("getWallMessageDetails RES = ",ae.data),ae.data.status==="success"&&(console.log("Success in getWallMessageDetails =",(te=ae.data.data)==null?void 0:te.message),i((de=ae.data.data)==null?void 0:de.message),y((ie=(G=ae.data.data)==null?void 0:G.message)==null?void 0:ie.comments_count),g((he=(_e=ae.data.data)==null?void 0:_e.message)==null?void 0:he.likes_count),l(!1))}).catch(ae=>{l(!1),i(null),console.log("Error in getWallMessageDetails = ",ae)})}async function $(le){console.log("function getWallMessageLike... called for MediaCard =",le),b(!0),le&&So.getWallMessageLike(le).then(ae=>{var te,de;console.log("getWallMessageLike RES = ",ae.data),ae.data.status==="success"&&(console.log("Success in getWallMessageLike =",ae.data.data),u((te=ae.data.data)==null?void 0:te.is_liked),console.log("Success in Wall Message Card =",ae.data.data),g((de=ae.data.data)==null?void 0:de.likes_count),b(!1),Q(le))}).catch(ae=>{var te,de;b(!1),u((te=props.media)==null?void 0:te.is_liked),g((de=props.media)==null?void 0:de.likes_count),console.log("Error in getWallMessageLike = ",ae)})}async function Q(le){console.log("function getWallMessageLikesList... called for MediaCard =",le),le&&So.getWallMessageLikesList(le).then(ae=>{var te;console.log("getWallMessageLikesList RES = ",ae.data),ae.data.status==="success"&&(console.log("Success in getWallMessageLikesList =",ae.data.data.likes),N((te=ae.data.data)==null?void 0:te.likes),console.log("Success in WallMessage Card Likes lIst =",ae.data.data),D(!1))}).catch(ae=>{D(!1),N([]),console.log("Error in getWallMessageLikesList = ",ae)})}async function Y(le){console.log("function getAllWallMessageCommentList... called for MediaCard =",le),le&&So.getAllWallMessageCommentList(le).then(ae=>{var te;console.log("getAllWallMessageCommentList RES = ",ae.data),ae.data.status==="success"&&(console.log("Success in getAllWallMessageCommentList =",ae.data.data.comments),j((te=ae.data.data)==null?void 0:te.comments),console.log("Success in WallMessage Card Comments lIst =",ae.data.data),V(!1))}).catch(ae=>{V(!1),j([]),console.log("Error in getAllWallMessageCommentList = ",ae)})}return k.useEffect(()=>{H(n)},[]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[s&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!s&&h.jsx(Tit,{itemDetails:t,data:t,loadingData:s,likesData:A,likeCount:p,isLiked:d,likeActionHandler:$,loadingMediaLike:E,likesListHandler:Q,loadingLikesList:O,comment_type:"message",loadingCommentsList:M,parent_id:t==null?void 0:t.id,parent_owner_id:null,comments:P,handleCommentList:Y,setCommentsCount:y,commentsCount:_})]})})}function xit(n){var d,u,p,g,_,y,E,b,A,N,O,D,P,j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe,me;const[t,i]=k.useState("msg_details_tab"),s=(u=(d=n.data)==null?void 0:d.user_info)!=null&&u.avatar?(g=(p=n.data)==null?void 0:p.user_info)==null?void 0:g.avatar:"/img/profile-pic.png";switch((_=n.data)==null?void 0:_.media_type.toLowerCase()){}(y=n.data)==null||y.media_type;const l=Ne=>{var Fe;console.log("Key in handleSelectedTab =",Ne),Ne=="msg_details_tab"&&console.log("Entering into msg_details_tab"),Ne=="msg_likes_tab"&&(console.log("Entering into msg_likes_tab"),n.likesListHandler((Fe=n.data)==null?void 0:Fe.id)),Ne=="msg_comments_tab"&&(console.log("Entering into msg_comments_tab parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),i(Ne)};return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:(E=n.data)==null?void 0:E.title})}),h.jsx(vn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"details"})}):h.jsxs(h.Fragment,{children:[((b=n.data)==null?void 0:b.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(N=(A=n==null?void 0:n.data)==null?void 0:A.user_info)==null?void 0:N.name]})," ",h.jsx("div",{children:`${(O=n==null?void 0:n.data)==null?void 0:O.date}`})]}),h.jsx("div",{className:"",children:h.jsx("a",{href:`${(D=n.data)==null?void 0:D.media_url}`,target:"_system",className:"btn btn-theme btn-sm btn-secondary py-2",children:"View in Browser"})})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsxs("div",{className:"flex-grow-1",children:[h.jsxs("div",{className:"fw-sb",children:[h.jsx("span",{className:"text-theme-primary pe-1",children:"By:"}),(j=(P=n==null?void 0:n.data)==null?void 0:P.user_info)==null?void 0:j.name]})," "]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx("div",{children:`${(M=n==null?void 0:n.data)==null?void 0:M.date}`})})]})}),((V=n.data)==null?void 0:V.media_type.toLowerCase())==="pdf"&&h.jsx(Jd,{aspectRatio:"9x16",className:"pdf-container mb-2 overflow-hidden",style:{height:"calc(100% - 15vh)"},children:h.jsx(gZ,{fileUrl:(H=n.data)==null?void 0:H.media_url,isModalOpen:!0,className:"overflow-scroll mb-2"})}),(($=n.data)==null?void 0:$.media_type.toLowerCase())==="video"&&h.jsx(jZ,{url:(Q=n.data)==null?void 0:Q.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((Y=n.data)==null?void 0:Y.media_type.toLowerCase())==="audio"&&h.jsx(UZ,{url:(le=n.data)==null?void 0:le.media_url,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null,className:"mb-2",style:null}),((ae=n.data)==null?void 0:ae.media_type.toLowerCase())==="image"&&h.jsx("div",{className:"media-container text-center mb-2",children:h.jsx(us,{src:(te=n.data)==null?void 0:te.media_url,alt:`${(de=n.data)==null?void 0:de.title} image`,wrapperClassName:"img-fluid mx-auto"})}),h.jsxs(Zn.Container,{id:"msg-tabs",className:"main_tabs",activeKey:t,onSelect:Ne=>l(Ne),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_details_tab",children:h.jsx("div",{className:"",children:"Details"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2",children:[h.jsx(Zn.Pane,{className:"",eventKey:"msg_details_tab",children:h.jsxs("div",{className:"py-2",children:[h.jsx(et,{className:"border-0 evaluation-status-card",children:h.jsx(et.Header,{className:"font-13 p-2 px-0 bg-transparent border-0 pb-3",children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:s,className:"rounded-circle media_img",alt:`${(ie=(G=n==null?void 0:n.data)==null?void 0:G.user_info)==null?void 0:ie.name} profile`})}),h.jsx("div",{className:"media_body ms-1 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-12 text-gray6 fw-",children:["Messaged on"," ",h.jsx("span",{className:"font-12 text-gray6",children:(_e=n==null?void 0:n.data)==null?void 0:_e.date}),h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(Ce=(he=n==null?void 0:n.data)==null?void 0:he.user_info)==null?void 0:Ce.name})]})]})})]})})}),h.jsx("div",{className:"font-14 text-gray7",children:(fe=n.data)==null?void 0:fe.body})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:(me=n.data)==null?void 0:me.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"msg_comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loadingCommentsList,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})})]})})}function Ait({handleWallMessageCardClick:n,message:t,index:i,className:s}){var we,Ge,rt,pt;const[l,d]=k.useState(t==null?void 0:t.is_liked),[u,p]=k.useState(t==null?void 0:t.likes_count),[g,_]=k.useState(t==null?void 0:t.comments_count),[y,E]=k.useState(null),[b,A]=k.useState(!0),[N,O]=k.useState(!1),[D,P]=k.useState([]),[j,M]=k.useState(!0),[V,H]=k.useState([]),[$,Q]=k.useState(!0),[Y,le]=k.useState(!1),ae=s||"",te=t!=null&&t.title?t==null?void 0:t.title:"Default title",de=t!=null&&t.type?t==null?void 0:t.type:"",G=t!=null&&t.body?t==null?void 0:t.body:"",ie=t!=null&&t.media_type?t==null?void 0:t.media_type:"",_e=t!=null&&t.media_url?t==null?void 0:t.media_url:"/img/default-bg.jpg",he=(we=t==null?void 0:t.user_info)!=null&&we.name?(Ge=t==null?void 0:t.user_info)==null?void 0:Ge.name:"",Ce=(rt=t==null?void 0:t.user_info)!=null&&rt.avatar?(pt=t==null?void 0:t.user_info)==null?void 0:pt.avatar:"/img/profile-pic.png";t!=null&&t.view_count&&(t==null||t.view_count),t!=null&&t.comments_count&&(t==null||t.comments_count),t!=null&&t.likes_count&&(t==null||t.likes_count);const fe=t!=null&&t.date?t==null?void 0:t.date:"";switch(ie.toLowerCase()){}t==null||t.media_type;const me=()=>{le(!1)},Ne=()=>{le(!0),Ve(t==null?void 0:t.id)};function Fe(Ze){Ze.stopPropagation(),console.log("handleMediaAction called...")}function je(Ze){Ze.stopPropagation(),console.log("Detials But clicked.."),Ne()}async function Ve(Ze){console.log("msgId =",Ze),So.getWallMessageDetails(Ze).then(Je=>{console.log("getWallMessageDetails RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageDetails =",Je.data.data.message),E(Je.data.data.message),A(!1))}).catch(Je=>{A(!1),E(null),console.log("Error in getWallMessageDetails = ",Je)})}async function Re(Ze){console.log("function getWallMessageLike... called for MediaCard =",Ze),O(!0),Ze&&So.getWallMessageLike(Ze).then(Je=>{var _t,Xt;console.log("getWallMessageLike RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageLike =",Je.data.data),d((_t=Je.data.data)==null?void 0:_t.is_liked),console.log("Success in Wall Message Card =",Je.data.data),p((Xt=Je.data.data)==null?void 0:Xt.likes_count),O(!1),Be(Ze))}).catch(Je=>{var _t,Xt;O(!1),d((_t=props.media)==null?void 0:_t.is_liked),p((Xt=props.media)==null?void 0:Xt.likes_count),console.log("Error in getWallMessageLike = ",Je)})}async function Be(Ze){console.log("function getWallMessageLikesList... called for MediaCard =",Ze),Ze&&So.getWallMessageLikesList(Ze).then(Je=>{var _t;console.log("getWallMessageLikesList RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getWallMessageLikesList =",Je.data.data.likes),P((_t=Je.data.data)==null?void 0:_t.likes),console.log("Success in WallMessage Card Likes lIst =",Je.data.data),M(!1))}).catch(Je=>{M(!1),P([]),console.log("Error in getWallMessageLikesList = ",Je)})}async function Xe(Ze){console.log("function getAllWallMessageCommentList... called for MediaCard =",Ze),Ze&&So.getAllWallMessageCommentList(Ze).then(Je=>{var _t;console.log("getAllWallMessageCommentList RES = ",Je.data),Je.data.status==="success"&&(console.log("Success in getAllWallMessageCommentList =",Je.data.data.comments),H((_t=Je.data.data)==null?void 0:_t.comments),console.log("Success in WallMessage Card Comments lIst =",Je.data.data),Q(!1))}).catch(Je=>{Q(!1),H([]),console.log("Error in getAllWallMessageCommentList = ",Je)})}return h.jsxs(h.Fragment,{children:[de==="message"?h.jsxs(et,{className:`border-0 card-theme wall-message-card overflow-hidden ${ae}`,onClick:Ze=>{je(Ze)},children:[h.jsxs("div",{className:"font-13 mb-1 py-2 px-2 pb-0 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-prim fw-sb user-img overflow-hidden rounded-cicle d-flex",children:h.jsx(us,{src:Ce,alt:he,wrapperClassName:"overflow-hidden rounded-cicle"})})," ",h.jsx("div",{className:"ps-2",children:he})]}),h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3 pt-0 pb-0 line-clamp",children:te}),h.jsx(et.Body,{className:"p-2 p-sm-3 pt-1",children:h.jsx("div",{className:"line-clamp-3 font-13 text-gray6",children:G})}),_e&&(ie.toLowerCase()==="video"||ie.toLowerCase()==="audio")?h.jsxs("div",{className:"px-2 px-sm-3",onClick:Ze=>{Fe(Ze)},children:[ie.toLowerCase()==="video"&&h.jsx(jZ,{url:_e,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null}),ie.toLowerCase()==="audio"&&h.jsx(UZ,{url:_e,allowControls:!0,allowLightMode:!0,allowPlaying:!0,previewImage:null})]}):h.jsx(h.Fragment,{children:ie.toLowerCase()==="pdf"?h.jsx("div",{className:"px-2 mb-2",children:h.jsxs("div",{className:"p-2 py-4 text-center overflow-hidden rounded-2",style:{backgroundColor:"var(--color-likes-lighter)"},children:[h.jsx(Zt,{tag:"pdf1",className:"text-danger",style:{fontSize:52}}),h.jsx(Ga,{className:"d-block text-danger",size:"lg",children:"PDF Document"})]})}):h.jsx("div",{className:"px-2 mb-2",children:h.jsx(us,{src:_e,alt:`${te} image`,wrapperClassName:"card-img"})})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-1 pt-2 border-top- d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"140px"},children:h.jsxs("div",{className:"font-13 text-gray6 d-flex align-items-center",children:[h.jsx(Zt,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"ms-1",children:fe})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Pt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${l&&"active"}`,children:[h.jsx(Zt,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Pt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(Zt,{tag:"message8",className:"font-18"})," ",g]})]})]})]}):h.jsxs(et,{className:`border-0 card-theme wall-message-card wall-message-card-horizontal overflow-hidden ${ae}`,onClick:Ze=>{je(Ze)},children:[h.jsx(et.Body,{className:"p-2 p-sm-3 ps-0 pt-0",children:h.jsxs("div",{className:"d-flex",children:[h.jsx("div",{className:"img-container flex-shrink-0",style:{width:100,height:100},children:h.jsx(us,{src:_e,alt:`${te} image`,wrapperClassName:"card-img overflow-hidden rounded-3"})}),h.jsxs("div",{className:"flex-grow-1 ps-2 pt-0 ps-sm-3 pt-sm-2",children:[h.jsxs("div",{className:"font-13 mb-1 py-2 px-0 pb-0 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-prim fw-sb user-img overflow-hidden rounded-cicle d-flex",children:h.jsx(us,{src:Ce,alt:he,wrapperClassName:"overflow-hidden rounded-cicle"})})," ",h.jsx("div",{className:"ps-2",children:he})]}),h.jsx(et.Header,{className:"border-bottom-0 p-0 line-clamp mb-1",children:te}),h.jsx("div",{className:"line-clamp-3 font-13 text-gray6",children:G})]})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-1 border-top- d-flex justify-content-between",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1",style:{maxWidth:"140px"},children:h.jsxs("div",{className:"font-13 text-gray6 d-flex align-items-center",children:[h.jsx(Zt,{tag:"events1",className:"font-20"})," ",h.jsx("span",{className:"ms-1",children:fe})]})}),h.jsxs("div",{className:"btn-wrap ms-2",children:[h.jsxs(Pt,{className:`btn-theme btn-sm btn-likes-light px-2 pe-none ${l&&"active"}`,children:[h.jsx(Zt,{tag:"favorite3",className:"font-18"})," ",u]}),h.jsxs(Pt,{className:"btn-theme btn-sm btn-gray px-2 pe-none",children:[h.jsx(Zt,{tag:"message8",className:"font-18"})," ",g]})]})]})]}),h.jsx(xit,{show:Y,handleClose:me,data:y,loadingData:b,likesData:D,likeCount:u,isLiked:l,likeActionHandler:Re,loadingMediaLike:N,likesListHandler:Be,loadingLikesList:j,comment_type:"message",loadingCommentsList:$,parent_id:t==null?void 0:t.id,parent_owner_id:null,comments:V,handleCommentList:Xe,setCommentsCount:_,commentsCount:g})]})}function Iit(){var le,ae;const n=Ii(),[t,i]=k.useState([]),[s,l]=k.useState(),[d,u]=k.useState(0),[p,g]=k.useState(null),[_,y]=k.useState(!0),[E,b]=k.useState(!1),[A,N]=k.useState("all");k.useState("");const[O,D]=k.useState(!0),P=k.useRef();async function j(){let te;p&&(console.log("lastKey = ",p),te=p),So.getAllWallMessages(te).then(de=>{var G,ie,_e,he,Ce,fe,me,Ne;if(console.log("getAllWallMessages RES = ",de.data),de.data.status==="success"){console.log("Success in getAllWallMessages =",de.data.data.messages);const Fe=(ie=(G=de.data)==null?void 0:G.data)==null?void 0:ie.messages,je=(he=(_e=de.data)==null?void 0:_e.data)==null?void 0:he.cansend,Ve=(fe=(Ce=de.data)==null?void 0:Ce.data)==null?void 0:fe.count,Re=(Ne=(me=de.data)==null?void 0:me.data)==null?void 0:Ne.lastkey;i(Be=>[...Be,...Fe]),D(je),u(Ve),g(Re),y(!1)}}).catch(de=>{y(!1),i([]),u(0),g(null),console.log("Error in getAllWallMessages = ",de)})}function M(te){te&&n(`/messages/${te}`)}k.useEffect(()=>{j()},[]),k.useEffect(()=>{t&&!_&&l(t);const te=V(A,t);console.log("filteredData === ",te),l(te)},[t]);function V(te,de){switch(console.log("selectedSegment =",te,`
data = `,de),te){case"all":return console.log("case : ",te),de;default:return $(A,de)}}const H=()=>{P.current.value="",N("all");const te=V("all",t);l(te)};function $(te,de){console.log("searchMessages - filteredData =",de);const G=de.filter((ie,_e)=>{var he;return(ie==null?void 0:ie.title.toLowerCase().includes(te.toLowerCase()))||(ie==null?void 0:ie.body.toLowerCase().includes(te.toLowerCase()))||((he=ie==null?void 0:ie.user_info)==null?void 0:he.name.toLowerCase().includes(te.toLowerCase()))});return console.log("Result =",G),G}const Q=tx.debounce(te=>{console.log("This is function from lodash..."),console.log("Search text =",te),N(te.trim());const de=V(A,t);te.trim().length>0?(console.log(te.trim()),l($(te.trim(),de))):l(de)},500),Y=()=>{n("/messages/send-message",{state:{pageTitle:"Send a Message",hideFooterNav:!0}})};return h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[_?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((te,de)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},de))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsxs(h.Fragment,{children:[h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-3 position-relative",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:te=>{console.log("Search input = ",te),Q(te.target.value)},ref:P,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((le=P==null?void 0:P.current)==null?void 0:le.value.length)>0&&h.jsx(Pt,{onClick:H,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6},type:"button",children:h.jsx(VE,{})}),((ae=P==null?void 0:P.current)==null?void 0:ae.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${s==null?void 0:s.length}`})]}),t.length>0&&!_?h.jsx(h.Fragment,{children:(s==null?void 0:s.length)>0?h.jsx(h.Fragment,{children:h.jsx(L_e,{dataLength:s.length,next:j,scrollThreshold:1,hasMore:!!p,loader:h.jsx(D_e,{}),children:h.jsx("div",{className:"d-grid gap-3",children:s.map((te,de)=>h.jsx(Ait,{message:te,index:de,className:"shadow-sm ",handleWallMessageCardClick:M},te.id))})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more messages found."})})})})}):h.jsx(h.Fragment,{})]}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more messages"})})}),O&&h.jsx(ZQ,{btnTitle:"Send",className:"",isWide:!1,icon:"send2",loading:E,primaryActionHandler:Y})]})})}function tpe({type:n,text:t,subText:i,actionHandler:s,className:l}){const d=Ii(),u=l||"";function p(){console.log("btnClickHandler"),s(),d("/notifications")}return h.jsxs("div",{className:`${u}`,children:[h.jsx("div",{className:`icon-wrapper ${n==="reject"?"wrapper-fail":""} d-flex justify-content-center align-items-center rounded-circle mx-auto`,children:h.jsx(Zt,{tag:`${n==="reject"?"delete7":"check1"}`,className:"font-40"})}),h.jsxs("div",{className:"py-4 px-5 text-center font-15 text-gray-6",children:[h.jsx("div",{className:"fw-sb font-16 mb-1",children:t}),i]}),h.jsx("div",{className:"d-grid gap-2",children:h.jsx(Pt,{className:"btn-theme btn-primary btn-lg",onClick:p,children:"Go Back"})})]})}function Nit(n){const[t,i]=k.useState(!1),s={reason:""},l=uc({reason:hf().required("Required")}),d=async(u,{resetForm:p})=>{i(!0),console.log("Form Values :",u);let g={...u,approval_id:n.approvalId,action:n.action};console.log("Calling rejectReasonForm...",g),lQ.rejectForm(g).then(_=>{console.log("rejectForm RES = ",_.data),_.data.status==="success"&&(console.log("Success in rejectForm =",_.data),i(!1),n.setIsRejected(!0))}).catch(_=>{i(!1),n.setIsRejected(!1),console.log("Error in rejectForm = ",_)})};return h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex flex-column",children:h.jsx(id,{initialValues:s,validationSchema:l,onSubmit:d,children:u=>h.jsxs(kt,{className:"form_style",onSubmit:u.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-4",children:[h.jsx(kt.Label,{className:"d-block font-14 text-start",children:"Reason to Reject"}),h.jsx("div",{className:"pt-0 pb-3 text-gray6 font-12 text-start",children:"Your reason to reject will help the submitter to improve and submit again."}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"Reason",name:"reason",...u.getFieldProps("reason"),autoComplete:"off"}),u.touched.reason&&u.errors.reason?h.jsx("p",{className:"error-state-text text-start font-12 text-danger mb-0",children:u.errors.reason}):null]}),h.jsx("div",{className:"btn-wrap d-grid",children:h.jsx(Pt,{type:"submit",className:"btn btn-theme btn-lg btn-red",children:t?h.jsx(h.Fragment,{children:h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})}):"Submit"})})]})})})})}function Oit(n){Ii();const[t,i]=k.useState(!1),[s,l]=k.useState(!1),[d,u]=k.useState(!0),p={backdrop:"static",keyboard:!1},g={closeButton:n.action==="reject"&&!t};console.log(n.loading),console.log(n.action),k.useEffect(()=>{if(console.log(n.action),n.action==="approve"&&!s){let y={approval_id:n==null?void 0:n.approvalId,action:n==null?void 0:n.action};console.log("approveData =",y),_(y)}if(n.action==="reject"&&!t){let y={approval_id:n==null?void 0:n.approvalId,action:n==null?void 0:n.action,reason:""};console.log("rejectData =",y)}},[n.action]);async function _(y){console.log("Inside Modal: approveForm()..."),u(!0),lQ.approveForm(y).then(E=>{console.log("approveForm RES = ",E.data),E.data.status==="success"&&(console.log("Success in approveForm =",E.data),l(!0),u(!1))}).catch(E=>{u(!1),l(!1),console.log("Error in approveForm = ",E)})}return h.jsxs(vn,{centered:!0,size:"md",className:"theme-modal approve-reject-form-modal",...p,show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-0 border-0 pt-2",...g,children:" "}),h.jsxs(vn.Body,{className:"no-scrollbar text-center pt-0",children:[n.action==="approve"&&!s&&h.jsx("div",{className:"p-5 d-flex justify-content-center align-items-center mx-auto",children:h.jsx(Ji,{animation:"border"})}),n.action==="approve"&&s&&h.jsx(h.Fragment,{children:h.jsx(tpe,{type:"approve",text:"Thanks!",subText:"You have successfully approved the submission.",actionHandler:n.handleClose,className:"pt-3"})}),n.action==="reject"&&!t&&h.jsx(Nit,{action:n.action,isRejected:t,setIsRejected:i,approvalId:n==null?void 0:n.approvalId}),n.action==="reject"&&t&&h.jsx(h.Fragment,{children:h.jsx(tpe,{type:"reject",text:"",subText:"You have rejected the submission. We Have notified the submitter about the rejection.",actionHandler:n.handleClose,className:"pt-3"})})]})]})}function npe(){const{entityId:n}=iU(),[t,i]=k.useState(null),[s,l]=k.useState(""),[d,u]=k.useState(""),[p,g]=k.useState(!0),[_,y]=k.useState(!0);k.useState(!0);const[E,b]=k.useState({isVisible:!1});k.useEffect(()=>{console.log("id = ",n),n?(console.log("id found = ",n),O({entity_id:n})):(console.log("id = ",n),console.log("Id not found"))},[]);const A=()=>{console.log("Closing Form Submission modal"),b({isVisible:!1})},N=j=>{b({isVisible:!0}),u(j)};Xo();async function O(j){console.log("Inside ApproveRejectFormSubmission: getFormApprovalInfo()..."),lQ.getFormApprovalInfo(j).then(M=>{var V,H,$,Q,Y;console.log("getFormApprovalInfo RES = ",M.data),M.data.status==="success"&&(console.log("Success in getFormApprovalInfo =",(H=(V=M.data)==null?void 0:V.data)==null?void 0:H.preview),i((Q=($=M.data)==null?void 0:$.data)==null?void 0:Q.preview),g(!1),l("")),M.data.status==="failed"&&(g(!1),console.log("Inside es.data.status === 'failed'"),((Y=M==null?void 0:M.data)==null?void 0:Y.statusCode)===401?l("You dont have permissions!"):l("Something went wrong!"))}).catch(M=>{handleAlert("something went wrong!","error"),l("Something went wrong!"),i(null),g(!1),console.log("Error in getFormApprovalInfo = ",M)})}function D(j){console.log("handleApproveBtnClick called...",j),N("approve")}function P(j){console.log("handleRejectBtnClick called...",j),N("reject")}return h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"",children:[p?h.jsx(h.Fragment,{children:h.jsx(ci,{type:"iframe-loader"})}):h.jsx(h.Fragment,{children:s===""?h.jsx(Jd,{aspectRatio:"1x1",className:"",style:{height:"calc(100vh - 30vh)"},children:h.jsx("iframe",{src:`${t==null?void 0:t.preview_url}`,title:"Approve or Reject Submission",onLoad:()=>y(!1)})}):h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:h.jsxs(et.Body,{className:"text-center",children:[h.jsx(Zt,{tag:"warning2",className:"font-40 text-theme-warning mb-3"}),h.jsx(Ga,{size:"",className:"text-gray6",children:s})]})})}),s===""&&h.jsxs("div",{className:"footer-btn-overlay d-flex flex-column",children:[h.jsxs("div",{className:"d-flex justify-content-center pt-2 pb-3",children:[h.jsx("div",{className:"font-14 text-theme-primary",children:"Submitted By: "}),h.jsx("div",{className:"font-14 fw-sb ps-2",children:t==null?void 0:t.submitted_by})]}),h.jsxs("div",{className:"btn-wrap d-flex justify-content-center align-items-center",children:[h.jsx(Pt,{type:"button",className:"btn-theme btn-md btn-green flex-grow-1",onClick:()=>{let j={approval_id:t==null?void 0:t.approval_id,action:"approve"};D(j)},children:"Approve"}),h.jsx(Pt,{type:"button",className:"btn-theme btn-md btn-red flex-grow-1",onClick:()=>{let j={approval_id:t==null?void 0:t.approval_id,action:"reject",reason:"Testing reason"};P(j)},children:"Reject"})]})]}),h.jsx(Oit,{show:E,handleClose:A,action:d,approvalId:t==null?void 0:t.approval_id})]})})})}function Pit(n){var j,M,V,H,$,Q,Y,le,ae,te,de,G,ie,_e,he,Ce,fe,me,Ne,Fe,je,Ve,Re,Be,Xe,we,Ge,rt,pt,Ze,Je,_t,Xt,Ht,gn,It,xt;const t=Ii();k.useState(!1),k.useState(!1);let i=n!=null&&n.className?n==null?void 0:n.className:"";const s=(j=n==null?void 0:n.item)!=null&&j.title?(M=n==null?void 0:n.item)==null?void 0:M.title:"Default title",l=(V=n.item)!=null&&V.cover_image?(H=n.item)==null?void 0:H.cover_image:"/img/default-bg.jpg",d=($=n==null?void 0:n.item)!=null&&$.media?(Q=n==null?void 0:n.item)==null?void 0:Q.media:"",u=(Y=n==null?void 0:n.item)!=null&&Y.media_type?(le=n==null?void 0:n.item)==null?void 0:le.media_type:"",p=(ae=n.item)!=null&&ae.description?(te=n.item)==null?void 0:te.description:"",g=(G=(de=n.item)==null?void 0:de.user_info)!=null&&G.name?(_e=(ie=n.item)==null?void 0:ie.user_info)==null?void 0:_e.name:"";(Ce=(he=n.item)==null?void 0:he.user_info)!=null&&Ce.avatar&&((me=(fe=n.item)==null?void 0:fe.user_info)==null||me.avatar);const _=(Fe=(Ne=n.item)==null?void 0:Ne.expiry_date)!=null&&Fe.day?(Ve=(je=n.item)==null?void 0:je.expiry_date)==null?void 0:Ve.day:"",y=(Be=(Re=n.item)==null?void 0:Re.expiry_date)!=null&&Be.month?(we=(Xe=n.item)==null?void 0:Xe.expiry_date)==null?void 0:we.month:"";(rt=(Ge=n.item)==null?void 0:Ge.expiry_date)!=null&&rt.year&&((Ze=(pt=n.item)==null?void 0:pt.expiry_date)==null||Ze.year);const E=(Je=n.item)==null?void 0:Je.button;(_t=n.item)!=null&&_t.response_sources&&((Xt=n.item)==null||Xt.response_sources),(Ht=n.item)!=null&&Ht.response_types&&((gn=n.item)==null||gn.response_types);let b="16x9";switch((It=n.item)==null?void 0:It.media_type.toLowerCase()){case"video":b="16x9";break;case"audio":b="21x9";break;case"image":b="16x9";break;default:b="16x9"}const A=((xt=n.item)==null?void 0:xt.media_type)==="audio"&&{marginTop:"-90px"};function N(mt){mt.stopPropagation(),console.log("handleMediaAction called...")}function O(mt){n.handleContestCardClick(mt.id)}function D(mt){mt.stopPropagation(),console.log("handleContestSecondaryAction called",mt),P(n.item)}function P(mt){var dt;console.log("handleRecordResponse called...",mt,event),((dt=mt==null?void 0:mt.button)==null?void 0:dt.action)!=="upload"?n.handleContestCardClick(mt.id):t(`/contests/${mt.id}/upload-response`,{state:{item:mt}})}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme contest-card overflow-hidden ${i}`,onClick:()=>O(n.item),children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 p-sm-3",children:s}),d&&(u.toLowerCase()==="video"||u.toLowerCase()==="audio")?h.jsx("div",{className:"px-2 px-sm-3",onClick:mt=>{N(mt)},children:h.jsx(Jd,{aspectRatio:`${b}`,style:A,children:h.jsx(XE,{url:d,width:"100%",height:"100%",controls:!0,light:`${l}`,playing:!0,playIcon:h.jsx("div",{className:"d-flex justify-content-center align-items-center btn-theme btn-lg btn-icon rounded-circle shadow-lg",style:{background:"rgba(255,255,255,0.75)",color:"var(--color-gray2)"},children:h.jsx(Zt,{tag:"play3",className:"font-30"})})})})}):h.jsx("div",{className:"px-2",children:h.jsx(us,{src:l,alt:`${s} image`,wrapperClassName:"card-im"})}),h.jsx(et.Body,{className:"p-2 p-sm-3",children:h.jsxs("div",{className:"font-13 mb-0",children:[h.jsxs("div",{className:"mb-1",children:[h.jsx("span",{className:"text-theme-primary mb-2",children:"Published By: "})," ",g]}),h.jsx(YO,{text:p,linesToShow:2,containerClass:"contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}})]})}),h.jsxs(et.Footer,{className:"px-2 px-sm-3 py-3 border-top- d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-flex align-items-center flex-grow-1 pe-3",children:h.jsx(Pt,{className:"btn-theme btn-primary btn-md py-2 py-sm-3 position-relative font-14 w-100",style:{zIndex:1},onClick:mt=>D(mt),children:E.title})}),h.jsx("div",{className:"btn-wrap ms-2",children:h.jsxs(Pt,{className:"btn-theme btn-sm btn-date btn-transparent px-0 pe-none",children:[h.jsx(Zt,{tag:"events1",className:"font-18"})," ",h.jsx("span",{className:"",children:`${_} ${y}`})]})})]})]})})}function Lit(){const n=Ii(),[t,i]=k.useState([]),[s,l]=k.useState(!0);async function d(){console.log("Inside Dashboard: getAllContests()..."),Wa.getAllContests().then(p=>{console.log("getAllContests RES = ",p.data),p.data.status==="success"&&(console.log("Success in getAllContests =",p.data.data.contests),i(p.data.data.contests),l(!1))}).catch(p=>{l(!1),i([]),console.log("Error in getAllContests = ",p)})}function u(p){p&&n(`/contests/${p}`,{state:{pageTitle:"Detailing Contest Details"}})}return k.useEffect(()=>{d()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:s?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((p,g)=>h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"},g))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:t.map((p,g)=>h.jsx(Pit,{item:p,className:"shadow-sm ",handleContestCardClick:u},p.id))})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more contests"})})})})})}var DSe={},kSe;Object.defineProperty(DSe,"__esModule",{value:!0});var Uh=h,Mu=k,Eo=function(){return Eo=Object.assign||function(n){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(n[l]=t[l]);return n},Eo.apply(this,arguments)};function ipe(n,t,i){if(i||arguments.length===2)for(var s,l=0,d=t.length;l<d;l++)!s&&l in t||(s||(s=Array.prototype.slice.call(t,0,l)),s[l]=t[l]);return n.concat(s||Array.prototype.slice.call(t))}function rpe(n){var t=n.size,i=t===void 0?25:t,s=n.SVGstrokeColor,l=s===void 0?"currentColor":s,d=n.SVGstorkeWidth,u=d===void 0?0:d,p=n.SVGclassName,g=p===void 0?"star-svg":p,_=n.SVGstyle;return Uh.jsx("svg",Eo({className:g,style:_,stroke:l,fill:"currentColor",strokeWidth:u,viewBox:"0 0 24 24",width:i,height:i,xmlns:"http://www.w3.org/2000/svg"},{children:Uh.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})}))}function Dit(n,t){switch(t.type){case"PointerMove":return Eo(Eo({},n),{hoverValue:t.payload,hoverIndex:t.index});case"PointerLeave":return Eo(Eo({},n),{ratingValue:n.ratingValue,hoverIndex:0,hoverValue:null});case"MouseClick":return Eo(Eo({},n),{valueIndex:n.hoverIndex,ratingValue:t.payload});default:return n}}var kit="style-module_starRatingWrap__q-lJC",Mit="style-module_simpleStarRating__nWUxf",jit="style-module_fillIcons__6---A",Uit="style-module_emptyIcons__Bg-FZ",Fit="style-module_tooltip__tKc3i";function spe(){return typeof window<"u"&&window.matchMedia("(pointer: coarse)").matches||"ontouchstart"in window||typeof navigator<"u"&&navigator.maxTouchPoints>0}(function(n,t){t===void 0&&(t={});var i=t.insertAt;if(n&&typeof document<"u"){var s=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",i==="top"&&s.firstChild?s.insertBefore(l,s.firstChild):s.appendChild(l),l.styleSheet?l.styleSheet.cssText=n:l.appendChild(document.createTextNode(n))}})(".style-module_starRatingWrap__q-lJC{display:inline-block;touch-action:none}.style-module_simpleStarRating__nWUxf{display:inline-block;overflow:hidden;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.style-module_fillIcons__6---A{display:inline-block;overflow:hidden;position:absolute;top:0;white-space:nowrap}.style-module_emptyIcons__Bg-FZ{display:inline-block}.style-module_tooltip__tKc3i{background-color:#333;border-radius:5px;color:#fff;display:inline-block;padding:5px 15px;vertical-align:middle}"),kSe=DSe.Rating=function(n){var t,i,s=n.onClick,l=n.onPointerMove,d=n.onPointerEnter,u=n.onPointerLeave,p=n.initialValue,g=p===void 0?0:p,_=n.iconsCount,y=_===void 0?5:_,E=n.size,b=E===void 0?40:E,A=n.readonly,N=A!==void 0&&A,O=n.rtl,D=O!==void 0&&O,P=n.customIcons,j=P===void 0?[]:P,M=n.allowFraction,V=M!==void 0&&M,H=n.style,$=n.className,Q=$===void 0?"react-simple-star-rating":$,Y=n.transition,le=Y!==void 0&&Y,ae=n.allowHover,te=ae===void 0||ae,de=n.disableFillHover,G=de!==void 0&&de,ie=n.fillIcon,_e=ie===void 0?null:ie,he=n.fillColor,Ce=he===void 0?"#ffbc0b":he,fe=n.fillColorArray,me=fe===void 0?[]:fe,Ne=n.fillStyle,Fe=n.fillClassName,je=Fe===void 0?"filled-icons":Fe,Ve=n.emptyIcon,Re=Ve===void 0?null:Ve,Be=n.emptyColor,Xe=Be===void 0?"#cccccc":Be,we=n.emptyStyle,Ge=n.emptyClassName,rt=Ge===void 0?"empty-icons":Ge,pt=n.allowTitleTag,Ze=pt===void 0||pt,Je=n.showTooltip,_t=Je!==void 0&&Je,Xt=n.tooltipDefaultText,Ht=Xt===void 0?"Your Rate":Xt,gn=n.tooltipArray,It=gn===void 0?[]:gn,xt=n.tooltipStyle,mt=n.tooltipClassName,dt=mt===void 0?"react-simple-star-rating-tooltip":mt,it=n.SVGclassName,Me=it===void 0?"star-svg":it,We=n.titleSeparator,bt=We===void 0?"out of":We,St=n.SVGstyle,Lt=n.SVGstorkeWidth,tn=Lt===void 0?0:Lt,un=n.SVGstrokeColor,an=un===void 0?"currentColor":un,ye=Mu.useReducer(Dit,{hoverIndex:0,valueIndex:0,ratingValue:g,hoverValue:null}),J=ye[0],ne=J.ratingValue,Se=J.hoverValue,Ue=J.hoverIndex,tt=J.valueIndex,Te=ye[1];Mu.useEffect(function(){g&&Te({type:"MouseClick",payload:0})},[g]);var Pe=Mu.useMemo(function(){return V?2*y:y},[V,y]),Qe=Mu.useMemo(function(){return g>Pe?0:V||Math.floor(g)===g?Math.round(g/y*100):2*Math.ceil(g)*10},[V,g,y,Pe]),nt=Mu.useMemo(function(){return(V?2*g-1:g-1)||0},[V,g]),$e=Mu.useCallback(function(qt){return y%2!=0?qt/2/10:qt*y/100},[y]),st=function(qt){for(var Jt=qt.clientX,mn=qt.currentTarget.children[0].getBoundingClientRect(),Kn=mn.left,Nn=mn.right,Tn=mn.width,Ui=D?Nn-Jt:Jt-Kn,xr=Pe,bi=Math.round(Tn/Pe),Ia=0;Ia<=Pe;Ia+=1)if(Ui<=bi*Ia){xr=Ia===0&&Ui<bi?0:Ia;break}var Sl=xr-1;xr>0&&(Te({type:"PointerMove",payload:100*xr/Pe,index:Sl}),l&&Se&&l($e(Se),Sl,qt))},_n=function(qt){Se&&(Te({type:"MouseClick",payload:Se}),s&&s($e(Se),Ue,qt))},Dt=Mu.useMemo(function(){if(te){if(G){var qt=ne&&ne||Qe;return Se&&Se>qt?Se:qt}return Se&&Se||ne&&ne||Qe}return ne&&ne||Qe},[te,G,Se,ne,Qe]);Mu.useEffect(function(){It.length>Pe&&console.error("tooltipArray Array length is bigger then Icons Count length.")},[It.length,Pe]);var nn=Mu.useCallback(function(qt){return Se&&qt[Ue]||ne&&qt[tt]||g&&qt[nt]},[Se,Ue,ne,tt,g,nt]),en=Mu.useMemo(function(){return Se&&$e(Se)||ne&&$e(ne)||g&&$e(Qe)},[Se,$e,ne,g,Qe]);return Uh.jsxs("span",Eo({className:kit,style:{direction:"".concat(D?"rtl":"ltr")}},{children:[Uh.jsxs("span",Eo({className:"".concat(Mit," ").concat(Q),style:Eo({cursor:N?"":"pointer"},H),onPointerMove:N?void 0:st,onPointerEnter:N?void 0:function(qt){d&&d(qt),spe()&&st(qt)},onPointerLeave:N?void 0:function(qt){spe()&&_n(),Te({type:"PointerLeave"}),u&&u(qt)},onClick:N?void 0:_n,"aria-hidden":"true"},{children:[Uh.jsx("span",Eo({className:"".concat(Uit," ").concat(rt),style:Eo({color:Xe},we)},{children:ipe([],Array(y),!0).map(function(qt,Jt){var mn;return Uh.jsx(Mu.Fragment,{children:((mn=j[Jt])===null||mn===void 0?void 0:mn.icon)||Re||Uh.jsx(rpe,{SVGclassName:Me,SVGstyle:St,SVGstorkeWidth:tn,SVGstrokeColor:an,size:b})},Jt)})})),Uh.jsx("span",Eo({className:"".concat(jit," ").concat(je),style:Eo((t={},t[D?"right":"left"]=0,t.color=nn(me)||Ce,t.transition=le?"width .2s ease, color .2s ease":"",t.width="".concat(Dt,"%"),t),Ne),title:Ze?"".concat(en," ").concat(bt," ").concat(y):void 0},{children:ipe([],Array(y),!0).map(function(qt,Jt){var mn;return Uh.jsx(Mu.Fragment,{children:((mn=j[Jt])===null||mn===void 0?void 0:mn.icon)||_e||Uh.jsx(rpe,{SVGclassName:Me,SVGstyle:St,SVGstorkeWidth:tn,SVGstrokeColor:an,size:b})},Jt)})}))]})),_t&&Uh.jsx("span",Eo({className:"".concat(Fit," ").concat(dt),style:Eo((i={},i[D?"marginRight":"marginLeft"]=20,i),xt)},{children:(It.length>0?nn(It):en)||Ht}))]}))};function Bit(n){k.useState(0);const[t,i]=k.useState(0),s=`custom-rating-tooltip ${n.tooltipSize?n.tooltipSize==="small"?"tooltip-small":"tooltip-large":""} ${n.showTooltipOnHover?"show-hover":""}`,l=n.tooltipStyles?n.tooltipStyles:null,d=n.tooltipArray?n.tooltipArray:[],u={size:n.size?n.size:30,fillColor:"#FFCC80",emptyColor:n.emptyColor?n.emptyColor:"#ccc",readonly:n.readonly?n.readonly:!1,transition:n.transition?n.transition:!1,showTooltip:n.showTooltip?n.showTooltip:!1,allowHover:n.allowHover?n.allowHover:!1,initialValue:n.initialValue?n.initialValue:0,iconsCount:n.iconsCount?n.iconsCount:5,className:`custom-rating ${n.className!==""?n.className:""}`,tooltipClassName:s,tooltipDefaultText:n.tooltipDefaultText?n.tooltipDefaultText:"",tooltipArray:d},p=g=>{console.log("rate =",g),i(g),n.onUserRateChange&&n.onUserRateChange(g,n.parameterId)};return h.jsxs(h.Fragment,{children:[h.jsx(kSe,{onClick:p,emptyIcon:n.emptyIcon,fillIcon:n.fillIcon,tooltipStyles:l,...u}),t!==0&&h.jsxs("span",{className:"mt-1 fw-sb d-inline-flex justify-content-ce align-items-center rounded-3 font-13",style:{maxWidth:160,color:"var(--color-gray6)"},children:[h.jsx("span",{className:"font-12 fw-b me-2 badge rounded-pill",style:{background:"#9E9E9E",color:"#fff"},children:t}),(d==null?void 0:d.length)>0&&h.jsx("span",{className:"font-",children:`${d[t-1]}`})]})]})}function Vit({evaluationInfo:n,submissionUserId:t}){var s,l,d,u,p;const i=(s=n==null?void 0:n.user_info)!=null&&s.avatar?(l=n==null?void 0:n.user_info)==null?void 0:l.avatar:"/img/profile-pic.png";return JSON.parse(Ai.getAuthUser()),h.jsxs(et,{className:`border-0 evaluation-status-card ${n!=null&&n.is_self_evaluation?"self-evaluation":""}`,children:[h.jsx(et.Header,{className:`font-13 p-2 ${n!=null&&n.is_self_evaluation?"px-1":"px-0"}`,children:h.jsxs("div",{className:"media",children:[h.jsx("div",{className:"media_icon_wrap d-flex justify-content-center align-items-center align-self-start",children:h.jsx("img",{src:i,className:"rounded-circle media_img",alt:`${(d=n==null?void 0:n.user_info)==null?void 0:d.name} profile`})}),h.jsx("div",{className:"media_body ms-1 ms-sm-3 d-flex justify-content-betwee align-items-center",children:h.jsxs("div",{className:"mb-0 font-13 text-gray6 fw-",children:[`${n!=null&&n.is_self_evaluation?"Self Evaluated on":"Evaluated on"} `,h.jsx("span",{className:`text-gray6 ${n!=null&&n.is_self_evaluation?"d-block":""}`,children:n==null?void 0:n.createdAt}),!(n!=null&&n.is_self_evaluation)&&h.jsxs("div",{className:"d-block",children:["by"," ",h.jsx("span",{className:"fw-sb text-theme-primary",children:(u=n==null?void 0:n.user_info)==null?void 0:u.name})]})]})}),h.jsx("span",{className:"font-11 fw-b rounded-5",style:{padding:"3px 7px",backgroundColor:"var(--color-green-lighter)",color:"var(--color-gray6)"},children:`${n.marks}/${n.total}`})]})}),h.jsx(et.Body,{className:"p-2 px-0",children:((p=n==null?void 0:n.scores)==null?void 0:p.length)>0&&n.scores.map((g,_)=>{const E=100/g.max*g.scale,b=g.score/g.scale*100;return h.jsxs("div",{className:"d-flex flex-column text-gray7 mb-3",children:[h.jsxs("div",{className:"d-flex justify-content-between align-items-center text-gray6 mb-2",children:[h.jsx("div",{className:"font-13 fw-sb flex-grow-1",children:g.name}),h.jsxs("div",{className:"font-13 fw-sb text-end",style:{width:130},children:[h.jsx("span",{className:"p-1 font-12 fw-sb",children:g.regard}),h.jsxs("span",{children:[h.jsx("span",{className:"fw-b text-danger",children:`${g.score}`}),h.jsx("span",{className:"font-11",children:`/${g.scale}`})]})]})]}),h.jsx("div",{className:"d-flex justify-content-between align-items-center text-gray7",children:h.jsx("div",{className:"d-block w-100",children:h.jsx("div",{className:"",style:{width:`${E}%`},children:h.jsx(bQ,{now:b,className:"flex-grow-1"})})})})]},g.id)})})]})}function zit(n){var _,y,E,b,A,N,O,D,P,j,M,V;const t=Ii(),[i,s]=k.useState(!1),[l,d]=k.useState("evaluations_tab"),u=H=>{var $;console.log("Key in handleSelectedTab =",H),H=="evaluations_tab"&&console.log("Entering into evaluations"),H=="likes_tab"&&(console.log("Entering into likes"),n.likesListHandler(($=n.data)==null?void 0:$.id)),H=="comments_tab"&&(console.log("Entering into comments parent id =",n.parent_id),n.handleCommentList(n.parent_id),console.log(n.loading)),d(H)};let p="16x9";switch((_=n.data)==null?void 0:_.media_type.toLowerCase()){case"video":p="16x9";break;case"audio":p="21x9";break;case"image":p="16x9";break;default:p="16x9"}(y=n.data)==null||y.media_type;function g(){const H={contest_id:n.contestId,contest_title:n.contestTitle,response_id:n.data.id,response_user:n.data.user_name};t(`/contests/${n.contestId}/evaluate`,{state:{data:H,pageTitle:"Evaluate"}})}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom media-viewer-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:`heading-icon ${n.mediaIconClass} d-flex justify-content-center align-items-center rounded-circl font-24`,children:h.jsx(Zt,{tag:n.mediaIcon})})}),h.jsx("div",{className:"heading flex-grow-1 ms-2",children:(E=n.data)==null?void 0:E.title})]})}),h.jsx(vn.Body,{className:"no-scrollbar pt-2",children:n.loadingData?h.jsxs(h.Fragment,{children:[h.jsx(ci,{type:"details"})," "]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"font-13 text-gray6 pb-2 d-flex justify-content-between",children:[h.jsx("span",{className:"fw-sb",children:(b=n==null?void 0:n.data)==null?void 0:b.user_name})," ",h.jsx("span",{children:(A=n==null?void 0:n.data)==null?void 0:A.created_date})]}),((N=n.data)==null?void 0:N.media_type.toLowerCase())==="pdf"?h.jsx(h.Fragment,{children:h.jsxs("div",{className:"position-relative border-1",children:[i?h.jsx("div",{className:"card position-absolute start-0 end-0 top-0 bottom-0",style:{minHeight:120},children:h.jsx("div",{className:"card-body d-flex justify-content-center align-items-center",children:h.jsx(Ji,{animation:"border"})})}):null,h.jsx(Jd,{aspectRatio:"9x16",className:"pdf-container",children:h.jsx("iframe",{width:"100%",src:`http://docs.google.com/gview?url=${n.data.media_url}&embedded=true`,title:(O=n.data)==null?void 0:O.name,onLoad:()=>s(!1)})})]})}):h.jsx(h.Fragment,{children:((D=n.data)==null?void 0:D.media_type.toLowerCase())==="image"?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx("img",{src:n.data.media_url,alt:`${(P=n.data)==null?void 0:P.title} image`,className:"img-fluid mx-auto"})})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(Jd,{aspectRatio:`${p}`,children:h.jsx(XE,{url:n.data.media_url,width:"100%",height:"100%",controls:!0,light:!1,playing:!1})})})})}),h.jsxs(Zn.Container,{id:"contest-tabs-example",className:"main_tabs",activeKey:l,onSelect:H=>u(H),children:[h.jsx("div",{className:"tab_links",children:h.jsxs(jn,{variant:"pills",className:"nav-justified",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"evaluations_tab",children:h.jsx("div",{className:"",children:"Evaluations"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"likes_tab",children:h.jsx("div",{className:"",children:`${n.likeCount} ${n.likeCount===1?"Like":"Likes"}`})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"comments_tab",children:h.jsx("div",{className:"",children:`${n==null?void 0:n.commentsCount} ${(n==null?void 0:n.commentsCount)===1?"Comment":"Comments"}`})})})]})}),h.jsxs(Zn.Content,{className:"p-2 py-sm-3",children:[h.jsx(Zn.Pane,{className:"",eventKey:"evaluations_tab",children:((M=(j=n.data)==null?void 0:j.evaluations)==null?void 0:M.length)>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"mb-2 d-flex flex-column",children:n.data.evaluations.map((H,$)=>h.jsxs(dn.Fragment,{children:[h.jsx(Vit,{evaluationInfo:H,submissionUserId:n.data.user_id},H.id),$+1!==n.data.evaluations.length&&h.jsx("div",{className:"pt-2 pb-3",style:{marginLeft:"-15px",marginRight:"-15px"},children:h.jsx("div",{className:"border-top"})})]},H.id))})}):h.jsxs("div",{className:"d-flex align-items-center justify-content-between rounded-3 p-2 mt-3",style:{backgroundColor:"var(--color-red-lighter)",color:"var(--color-gray5)"},children:[h.jsx("div",{className:"font-14 fw-sb",children:"Not Yet Evaluated!"}),h.jsx("div",{children:(V=n.data)==null?void 0:V.score})]})}),h.jsx(Zn.Pane,{className:"",eventKey:"likes_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(nx,{isLiked:n.isLiked,loadingMediaLike:n.loadingMediaLike,loadingLikesList:n.loadingLikesList,likesData:n.likesData,likeActionHandler:n.likeActionHandler,parentId:n.data.id})})}),h.jsx(Zn.Pane,{className:"",eventKey:"comments_tab",children:h.jsx("div",{className:"py-2",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount,addPlacement:"fixed-bottom"})})})]})]})]})}),n.data.can_evaluate&&l==="evaluations_tab"&&h.jsx(vn.Footer,{className:"justify-content-center pb-0",children:h.jsx(Pt,{className:"btn-theme btn-primary btn-lg w-100",onClick:g,children:`${n.isParticipant?"Self Evaluate":"Evaluate"}`})})]})})}function Hit(n){return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom comments-list-modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsxs(vn.Title,{className:"d-flex align-items-center",children:[`${n.commentsCount}`," Comments"]})}),h.jsx(vn.Body,{className:"no-scrollbar pb-0",children:h.jsx(YE,{comment_type:n.comment_type,loading:n.loading,parent_id:n.parent_id,parent_owner_id:n.parent_owner_id,comments:n.comments,handleCommentList:n.handleCommentList,setCommentsCount:n.setCommentsCount})})]})})}function Git({submission:n,getContestDetails:t,loadingData:i,contestId:s,contestTitle:l,contestMarks:d,contest:u}){var it;const g=JSON.parse(Ai.getAuthUser()).id===(n==null?void 0:n.user_id),_=u.show_pass_fail_icon.toLowerCase()==="yes"&&u.pass_icon?u.pass_icon:"",y=u.show_pass_fail_icon.toLowerCase()==="yes"&&u.fail_icon?u.fail_icon:"",[E,b]=k.useState(n==null?void 0:n.is_liked),[A,N]=k.useState(n==null?void 0:n.likes_count),[O,D]=k.useState(n==null?void 0:n.comments_count),[P,j]=k.useState(!1),[M,V]=k.useState(!1),[H,$]=k.useState(!0),[Q,Y]=k.useState([]),[le,ae]=k.useState([]),[te,de]=k.useState(!0),[G,ie]=k.useState(!1),[_e,he]=k.useState({isVisible:!1}),[Ce,fe]=k.useState({isVisible:!1}),[me,Ne]=k.useState(!1),[Fe,je]=k.useState(!1),Ve=()=>{ie(!1)},Re=()=>{he({isVisible:!1})},Be=()=>{he({isVisible:!0})},Xe=()=>{fe({isVisible:!1})},we=()=>{Ne(!1)},Ge=()=>{Ne(!0)},rt=()=>{je(!1)},pt=()=>{je(!0)},Ze=()=>{console.log("handleShowMediaBtnClick called..."),t(s),Be()},Je=Me=>{Me.stopPropagation(),console.log("handleDeleteBtnClick called..."),Ge()},_t=Me=>{Me.stopPropagation(),console.log("handleDeleteForReattemptBtnClick called..."),pt()};let Xt="play1",Ht="media-video";switch(n==null?void 0:n.media_type.toLowerCase()){case"video":Xt="play1",Ht="media-video";break;case"audio":Xt="consult1",Ht="media-audio";break;case"pdf":Xt="pdf2",Ht="media-doc";break;case"image":Xt="image2",Ht="media-image";break;default:Xt="consult1"}async function gn(Me){console.log("function getContestSubmissionLike... called for MediaCard =",Me),V(!0),Me&&Wa.getContestSubmissionLike(Me).then(We=>{var bt,St;console.log("getContestSubmissionLike RES = ",We.data),We.data.status==="success"&&(console.log("Success in getContestSubmissionLike =",We.data.data),b((bt=We.data.data)==null?void 0:bt.is_liked),console.log("Success in Media Card =",We.data.data),N((St=We.data.data)==null?void 0:St.likes_count),It(Me),V(!1))}).catch(We=>{V(!1),b(n==null?void 0:n.is_liked),N(n==null?void 0:n.likes_count),console.log("Error in getContestSubmissionLike = ",We)})}async function It(Me){console.log("function getContestSubmissionLikesList... called for SubmissionCard =",Me),Me&&Wa.getContestSubmissionLikesList(Me).then(We=>{var bt;console.log("getContestSubmissionLikesList RES = ",We.data),We.data.status==="success"&&(console.log("Success in getContestSubmissionLikesList =",We.data.data.likes),Y((bt=We.data.data)==null?void 0:bt.likes),console.log("Success in Submission Card Likes lIst =",We.data.data),$(!1))}).catch(We=>{$(!1),Y([]),console.log("Error in getContestSubmissionLikesList = ",We)})}async function xt(Me){console.log("function getAllContestSubmissionCommentList... called for Contest Card =",Me),Me&&Wa.getAllContestSubmissionCommentList(Me).then(We=>{var bt;console.log("getAllContestSubmissionCommentList RES = ",We.data),We.data.status==="success"&&(console.log("Success in getAllContestSubmissionCommentList =",We.data.data.comments),ae((bt=We.data.data)==null?void 0:bt.comments),de(!1),console.log("Success in Submission Card Comments lIst =",We.data.data))}).catch(We=>{de(!1),ae([]),console.log("Error in getAllContestSubmissionCommentList = ",We)})}async function mt(Me){console.log("function deleteContestResponseRecord... called for SubmissionCard =",Me),j(!0),Me&&Wa.deleteContestResponseRecord(Me).then(We=>{console.log("deleteContestResponseRecord RES = ",We.data),We.data.status==="success"&&(console.log("Success in deleteContestResponseRecord =",We.data.data),j(!1),we(),t(s))}).catch(We=>{j(!1),console.log("Error in deleteContestResponseRecord = ",We)})}async function dt(Me){console.log("function deleteContestResponseRecordForReattempt... called for SubmissionCard =",Me),j(!0),Me&&Wa.deleteContestResponseRecordForReattempt(Me).then(We=>{console.log("deleteContestResponseRecordForReattempt RES = ",We.data),We.data.status==="success"&&(console.log("Success in deleteContestResponseRecordForReattempt =",We.data.data),j(!1),we(),t(s))}).catch(We=>{j(!1),console.log("Error in deleteContestResponseRecordForReattempt = ",We)})}return h.jsxs(h.Fragment,{children:[h.jsxs(et,{className:"card-theme submission-card border-0 shadow-sm position-relative overflow-hidden",children:[((it=n==null?void 0:n.evaluations)==null?void 0:it.length)>0&&h.jsx("div",{className:"media-viewed-icon position-absolute",children:h.jsx(Zt,{tag:"check1",className:"font-18"})}),h.jsx("div",{className:"position-absolute",style:{top:20,right:15},children:(u==null?void 0:u.show_pass_fail_icon.toLowerCase())==="yes"&&n.score>0?n.score>=d?h.jsx(h.Fragment,{children:h.jsx("img",{src:_,className:"position-absolue",width:42,alt:"Pass Icon"})}):h.jsx(h.Fragment,{children:h.jsx("img",{src:y,className:"position-absolue",width:42,alt:"Fail Icon"})}):h.jsx(h.Fragment,{})}),h.jsxs(et.Header,{className:"p-2 px-sm-3 py-3 position-relative border-bottom-0",onClick:Ze,children:[h.jsxs("div",{className:"d-flex justify-content-betwee align-items-center font-13 text-gray6 pb-2 pb-sm-3",children:[h.jsx("div",{className:"mb-0 font-1 text-gra fw-sb",children:n==null?void 0:n.user_name}),h.jsx("span",{className:"dot-seperator"}),h.jsx("div",{className:"font-1 text-gra",children:n==null?void 0:n.created_date})]}),h.jsxs("div",{className:"d-flex media-header-container align-items-center py-2",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:`d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden ${Ht}`,children:h.jsx(Zt,{tag:Xt,className:"font-28"})})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:[h.jsx("span",{className:"d-block mb-1 pe-3 pe-sm-5 fw-sb",children:n==null?void 0:n.title}),h.jsxs("div",{className:"d-flex justify-content-betwee align-items-center font-12 text-gray8",children:[h.jsxs("span",{className:"",children:[h.jsx("span",{className:"fw-sb text-gray6",children:n==null?void 0:n.score}),`/${n==null?void 0:n.total} score`]}),h.jsx("span",{className:"dot-seperator"}),h.jsx("span",{className:"",children:`${A} ${A===1?"like":"likes"}`}),h.jsx("span",{className:"dot-seperator"}),h.jsx("span",{className:"border-nd ",children:`${O} ${O===1?"comment":"comments"}`})]}),n.can_delete&&h.jsx(Pt,{size:"sm",className:"btn-theme btn-red btn-sm font-12 px-2 position-absolute top-50",style:{right:8,zIndex:1},onClick:Me=>Je(Me),children:h.jsx(Zt,{tag:"delete5",className:"font-16"})})]})]})]}),h.jsxs(et.Footer,{className:"p-0 bg-transparent border-0",children:[(n==null?void 0:n.can_evaluate)&&h.jsx(Pt,{className:"btn-theme btn-md btn-primary-light w-100 rounded-0 text-uppercase fw-sb",style:{letterSpacing:"0.06rem"},onClick:Ze,children:`${g?"Self Evalute":"Evalute"}`}),(n==null?void 0:n.can_reattempt)&&h.jsx(Pt,{className:"btn-theme btn-md btn-red-light w-100 rounded-0 text-uppercase fw-sb",style:{letterSpacing:"0.06rem"},onClick:Me=>_t(Me),children:"Re-attempt"}),h.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[h.jsx("div",{className:"d-fl"}),h.jsx("div",{className:"btn-wrap"})]})]})]}),h.jsx(Cit,{classNames:"",show:G,handleClose:Ve,likesData:Q,isLiked:E,likeCount:A,loading:H,isHandleLoading:M,handleLike:gn,parentId:n==null?void 0:n.id}),h.jsx(zit,{show:_e,handleClose:Re,mediaUrl:n==null?void 0:n.media_url,data:n,loadingData:i,mediaIcon:Xt,mediaIconClass:Ht,likesData:Q,likeCount:A,isLiked:E,likeActionHandler:gn,loadingMediaLike:M,loadingLikesList:H,likesListHandler:It,contestId:s,contestTitle:l,contest:u,isParticipant:g,comment_type:"contest",loading:te,parent_id:n==null?void 0:n.id,parent_owner_id:null,comments:le,handleCommentList:xt,setCommentsCount:D,commentsCount:O}),h.jsx(Hit,{show:Ce,handleClose:Xe,comment_type:"contest",loading:te,parent_id:n==null?void 0:n.id,parent_owner_id:null,comments:le,handleCommentList:xt,setCommentsCount:D,commentsCount:O}),h.jsx(NR,{show:me,loading:P,handleClose:we,primaryActionData:n==null?void 0:n.id,content_type:"submission-delete-modal",handlePrimaryAction:mt}),h.jsx(NR,{show:Fe,loading:P,handleClose:rt,primaryActionData:n==null?void 0:n.id,content_type:"reattempt-submission-delete-modal",handlePrimaryAction:dt})]})}function Wit({itemDetails:n,submissions:t,getContestDetails:i,loading:s}){var j,M,V;const l=Ii();JSON.parse(Ai.getAuthUser()),k.useState(!1);const[d,u]=k.useState(t);k.useState(!1);const[p,g]=k.useState("all");k.useEffect(()=>{const H=N(p,t);u(H)},[n,s]);const _=[{key:"All",value:"all"},{key:"Pending",value:"pending"},{key:"Evaluated",value:"evaluated"}],y=k.useRef();let E="16x9";switch(n==null?void 0:n.media_type.toLowerCase()){case"video":E="16x9";break;case"audio":E="21x9";break;case"image":E="1x1";break;default:E="16x9"}const b=(n==null?void 0:n.media_type)==="audio"&&{marginTop:"-90px"};function A(H){const $=H.target.value.toLowerCase();console.log($),g($);const Q=N($,t);u(Q)}function N(H,$){switch(console.log("selectedSegment =",H,`
data = `,$),H){case"all":return console.log("case : ",H),$;case"pending":console.log("case : ",H);const Q=$.filter((le,ae)=>!le.evaluations.length>0||le.score===0);return console.log("Result =",Q),Q;case"evaluated":console.log("case : ",H);const Y=$.filter((le,ae)=>le.evaluations.length>0);return console.log("Result =",Y),Y}}const O=()=>{y.current.value="";const H=N(p,t);u(H)};function D(H,$){console.log("searchContestResponse - filteredData =",$);const Q=$.filter((Y,le)=>Y.user_name.toLowerCase().includes(H.toLowerCase())||Y.title.toLowerCase().includes(H.toLowerCase()));return console.log("Result =",Q),Q}const P=tx.debounce(H=>{console.log("This is function from lodash..."),console.log("Search text =",H);const $=N(p,t);H.trim().length>0?(console.log(H.trim()),u(D(H.trim(),$))):u($)},500);return h.jsxs("div",{className:"contest-details-card",children:[h.jsx("div",{className:"p-2 px-0 font-15 fw-sb mb-0",children:n==null?void 0:n.title}),h.jsxs("div",{className:"font-13 mb-3 d-flex align-items-center",children:[h.jsx("span",{className:"text-theme-primary",children:"Published By: "})," ",h.jsx("span",{className:"ps-2",children:(j=n==null?void 0:n.user_info)==null?void 0:j.name})]}),((n==null?void 0:n.media_type.toLowerCase())==="video"||(n==null?void 0:n.media_type.toLowerCase())==="video")&&(n==null?void 0:n.media)!==""?h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(Jd,{aspectRatio:`${E}`,style:b,children:h.jsx(XE,{url:n.media,width:"100%",height:"100%",controls:!0,playing:!1})})})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"media-container mb-2",children:h.jsx(us,{src:n==null?void 0:n.cover_image,alt:`${n==null?void 0:n.title} image`,wrapperClassName:"card-img mb-3"})})}),h.jsx(YO,{text:n==null?void 0:n.description,linesToShow:2,containerClass:"font-13 contest-info text-gray7",buttonClass:"btn btn-theme btn-link btn-sm btn-gray position-relative ps-0",buttonStyles:{zIndex:1}}),h.jsx("hr",{}),(n==null?void 0:n.is_result_published)!=="yes"?h.jsx("div",{className:"font-15 fw-sb mb-2 mb-sm-3",children:"Responses"}):h.jsx("div",{className:"font-15 fw-sb mb-2 mb-sm-3",children:"Top Results"}),(t==null?void 0:t.length)>0&&!(n!=null&&n.is_participant)&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"py- pt-1 pb-3",children:h.jsx("div",{className:"custom-segment-btn-group",children:_.map(H=>h.jsxs("div",{className:"segment-btn",children:[h.jsx("input",{type:"radio",name:"segments",id:H.value,value:H.value,onChange:A,checked:p===H.value}),h.jsxs("label",{htmlFor:H.value,children:[h.jsx(Zt,{tag:"check1",className:`font-20 text-gray5 ${p===H.value?"d-inline-flex opacity-100 visible":"d-inline-flex opacity-0 invisible"}`}),H.key]})]},H.value))})}),h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-3 position-relative",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:H=>{console.log("Search input = ",H),P(H.target.value)},ref:y,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((M=y==null?void 0:y.current)==null?void 0:M.value.length)>0&&h.jsx(Pt,{onClick:O,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6},type:"button",children:h.jsx(VE,{})}),((V=y==null?void 0:y.current)==null?void 0:V.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${d==null?void 0:d.length}`})]})]}),h.jsx("div",{className:"d-grid gap-3",children:!s&&(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:(d==null?void 0:d.length)>0?h.jsx(h.Fragment,{children:d.map(H=>h.jsx(Git,{submission:H,getContestDetails:i,loadingData:s,contestId:n==null?void 0:n.id,contestTitle:n==null?void 0:n.title,contestMarks:n==null?void 0:n.marks,contest:n},H.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more responses found."})})})})}):h.jsx(et,{className:"border-0 shadow-sm",children:h.jsxs(et.Body,{className:"text-center",children:[h.jsx("div",{className:"p-2 p-sm-3 font-14 fw-sb",children:"Have not submitted any response yet!"}),(n==null?void 0:n.upload_btn)&&h.jsx(fn,{className:"row-cols-1 justify-content-center pt-2",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Pt,{className:"btn-theme btn-primary btn-md px- position-relative font-14 w-100",onClick:()=>l(`/contests/${n==null?void 0:n.id}/upload-response`,{state:{item:n,pageTitle:"Upload Response"}}),children:"Upload"})})})]})})})]})}function $it(){const{contestId:n}=iU();Xo();const[t,i]=k.useState(null),[s,l]=k.useState(!0);k.useState(!1);const[d,u]=k.useState([]);async function p(g){console.log("contestId =",g),Wa.getContestDetails(g).then(_=>{var y,E;console.log("getContestDetails RES = ",_.data),_.data.status==="success"&&(console.log("Success in getContestDetails =",_.data.data.contest),i(_.data.data.contest),u((E=(y=_.data)==null?void 0:y.data)==null?void 0:E.submissions),l(!1))}).catch(_=>{l(!1),i(null),u([]),console.log("Error in getContestDetails = ",_)})}return k.useEffect(()=>{p(n)},[n]),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"mb-4",children:[s&&h.jsx(ci,{type:"magazine",className:"card-theme overflow-hidden"}),!s&&h.jsx(Wit,{itemDetails:t,submissions:d,getContestDetails:p,loading:s})]})})}function Kit({className:n}){const t=n||"";return h.jsx(h.Fragment,{children:h.jsxs("div",{className:`waves-container ${t}`,children:[h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"}),h.jsx("div",{className:"line"})]})})}function MSe(n){k.useState(!1);const[t,i]=k.useState(!1);k.useEffect(()=>{console.log("counter - ",n.counter)},[n.counter]);let s={backdrop:"static",keyboard:!1};function l(){console.log("Inside handleStartRecordingAction btn click handler"),t||(i(!0),n.handleStart(),n.onRecordingStart())}function d(){console.log("Inside handleStopRecordingAction btn click handler"),t&&(n.handlePause(),n.onRecordingStop(),n.handleClose(),i(!1))}function u(){i(!1),n.handleClose()}return h.jsx(h.Fragment,{children:h.jsx(vn,{centered:!0,size:"md",className:"theme-modal confirmation-modal audio-recording-modal",...s,show:n.show,onHide:n.handleClose,children:h.jsxs(vn.Body,{children:[h.jsx(Pt,{type:"button",className:`btn-theme btn-icon btn-sm btn-transparent position-absolute ${t?"d-none":""}`,style:{right:5,top:8},onClick:u,children:h.jsx(Zt,{tag:"delete7",className:"font-32 text-gray9"})}),h.jsx("div",{className:"font-18 fw-sb mb-3 text-center",style:{color:"#684609"},children:"Start recording audio"}),h.jsxs("div",{className:"font-16 fw-sb mb-3 text-center",children:["Time:"," ",n.counter<=60?n.counter+"s":eQ(n.counter,":")+"m"]}),h.jsx(Kit,{className:`my-3 ${t?"":"d-none"}`}),h.jsxs("div",{className:"btn-wrap d-flex align-items-center pt-3 pb-1 text-en",children:[!t&&h.jsx(h.Fragment,{children:h.jsx(Pt,{type:"submit",className:`btn-theme
btn-yellow btn-md flex-grow-1`,onClick:l,children:"Start Recording"})}),t&&h.jsx(h.Fragment,{children:h.jsx(Pt,{type:"submit",className:`btn-theme
btn-yellow btn-md flex-grow-1`,onClick:d,children:"Stop Recording"})})]})]})})})}const FZ=(n,t)=>{const[i,s]=k.useState(n),[l,d]=k.useState(t),[u,p]=k.useState(!1);let g=k.useRef();return k.useEffect(()=>{g.current=!l&&setTimeout(()=>{s(i+1)},1e3),console.log("counter = ",i)},[i,l,u]),{counter:i,handleStart:()=>{d(!1)},handlePause:()=>{d(!0)},handleIncrement:()=>s(i+1),handleDecrement:()=>s(i-1),handleReset:()=>{s(0),clearTimeout(g.current)},handleStop:()=>{d(!0),s(0),clearTimeout(g.current)},handleChange:D=>{const{value:P}=D.target;s(parseInt(P,0))}}},Lp=hc("VoiceRecorder",{web:()=>Xi(()=>import("./web-AScraMDr.js").then(n=>n.w),__vite__mapDeps([])).then(n=>new n.VoiceRecorderWeb)});function qit({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,data:d,fileSizelimit:u,videoDurationLimit:p,audioDurationLimit:g,minCompressionLimit:_}){const y=Ii(),[E,b]=k.useState(),[A,N]=k.useState(null),[O,D]=k.useState(""),[P,j]=k.useState(null),[M,V]=k.useState(""),[H,$]=k.useState(0),[Q,Y]=k.useState(!1);k.useState();const[le,ae]=k.useState(0),[te,de]=k.useState(!1),[G,ie]=k.useState(!1);k.useState(!1);const[_e,he]=k.useState(!1),[Ce,fe]=k.useState(null),[me,Ne]=k.useState(!1);k.useState(!1);const[Fe,je]=k.useState(!1),[Ve,Re]=k.useState(!1),{counter:Be,handleStart:Xe,handlePause:we,handleReset:Ge}=FZ(0,!0),rt=k.useRef(!1);k.useRef(null);const pt=k.useRef(null),Ze=k.useRef(null);k.useRef(null);const Je=k.useRef(null),_t=k.useRef(null);k.useRef(null);const Xt=k.useRef(null),Ht={title:""},gn=uc({title:hf().required("Required")}),It=n?n==="pdf"?".pdf":`${n}/*`:"image/*",xt=n!==""?"user":"",mt=n?`${n}-gallery-file`:"media-gallery-file",dt=n?`${n}-camera-file`:"media-camera-file",it=()=>{Ne(!1)},Me=Dt=>{console.log("handleShowRecordAudioModal () - MEDIA TYPE = ",Dt),Ne(!0)},We=()=>{je(!1)},bt=()=>{je(!0)};async function St(){console.log("onRecordingStart called...");const Dt=await Lp.startRecording();console.log("recordStartResult = ",Dt)}async function Lt(){console.log("onRecordingStop called...");const Dt=await Lp.stopRecording();if(console.log("onRecordingStop counter =",Be),console.log("recordStopResult = ",Dt),Dt.value){const qt=Dt.value;$(Math.round(qt.msDuration/1e3)),Y(!0),he(!0);const Jt=qt.msDuration,mn=Math.round(Jt/1e3);console.log("fileDurationInMS = ",Jt," fileDurationInSec =",mn);const Kn=qt.recordDataBase64,Nn=qt.mimeType;let Tn=Nn.substring(0,Nn.indexOf(";"));const Ui=`data:${Tn};base64,${Kn}`;var nn=tn(Ui);console.log("Binary file =",nn);var en=new Blob([nn],{type:`${Tn}`});console.log("blob = ",en),b({...Dt.value,size:en.size}),fe(Tn);const xr=kR(en.size,{standard:"jedec"});console.log("Recorded Audio fileSize = ",xr),j(xr);const bi=URL.createObjectURL(en);console.log("blobUrl = ",bi),N(bi),console.log("File Obj =",E)}else console.log("Unable to record/play audio")}function tn(Dt){var nn=";base64,",en=Dt.indexOf(nn)+nn.length,qt=Dt.substring(en),Jt=window.atob(qt),mn=Jt.length,Kn=new Uint8Array(new ArrayBuffer(mn));for(let Nn=0;Nn<mn;Nn++)Kn[Nn]=Jt.charCodeAt(Nn);return Kn}async function un(){if(console.log("onRecordBtnClick called..."),(await Lp.canDeviceVoiceRecord()).value){const nn=await Lp.hasAudioRecordingPermission();if(nn.value)console.log("hasAudioPermission set",nn),Me();else{console.log("hasAudioPermission not set...request permissions...",nn);const en=await Lp.requestAudioRecordingPermission();console.log("requestedPermissionResult = ",en)}}}function an(Dt){if(console.log("Inside handleChange =",Dt.target.files[0]),Dt.target.files[0]){b(Dt.target.files[0]),Y(!0);const nn=kR(Dt.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",nn),j(nn),n){case"image":let en=URL.createObjectURL(Dt.target.files[0]);pt.current.src=en,pt.current.className="d-block";break;case"video":let qt=URL.createObjectURL(Dt.target.files[0]);console.log("blobVideoURL =",qt),N(qt),Xt.current.onloadedmetadata=mn=>{console.log("tempVideoRef.current.onloadedmetadata evt = ",mn),URL.revokeObjectURL(qt)};break;case"audio":let Jt=URL.createObjectURL(Dt.target.files[0]);console.log("Case audio: ",Jt),N(Jt);break;case"pdf":console.log("PDF Preview =",Ze.current),Ze.current.className="d-block";break;default:console.log("No case matched...")}}}function ye(){if(E)switch(b(null),Y(!1),V(""),j(null),Ge(),Je.current&&(Je.current.value=""),_t.current&&(_t.current.value=""),n){case"image":console.log("Image Preview =",pt.current),pt.current.src="",pt.current.className="d-none";break;case"video":N(null);break;case"audio":N(null),he(!1);break;case"pdf":console.log("PDF Preview =",Ze.current),Ze.current.className="d-none";break;default:console.log("No case matched...")}}const J=Dt=>new Promise((nn,en)=>{const qt=new FileReader;qt.onload=()=>{const Jt=qt.result;nn(Jt)},qt.onerror=()=>{en(new Error("Unable to read the file as binary data"))},qt.readAsArrayBuffer(Dt)}),ne=new AbortController,Ue=zr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),rt.current&&(console.log("Called cancellation inside if(bool.current)...",rt==null?void 0:rt.current),Ue.cancel("Upload cancelled by user"),ne.abort())},[]);function tt(){rt.current=!0,l(),Ue.cancel("Upload cancelled by user"),ne.abort(),ne.signal.aborted&&Qt("Uploading cancelled!","error")}async function Te(Dt){return await hs.getSignedUploadUrl(Dt)}async function Pe(Dt,nn,en,qt){const Jt=nn.map((Nn,Tn)=>{const Ui=new URL(Nn);console.log("parser = ",Ui);const xr=Ui.pathname;return{url:Nn,pathName:xr.replace("/","")}});console.log("urls = ",Jt);let mn=null,Kn=[];try{const Nn=100/qt;let Tn=0,Ui=0,xr=0;for(ie(!0);xr<=E.size;){console.log("Value of start = ",Ui),console.log("Value of end = ",xr),Ui=Tn*en,xr=Ui+en;const Ia=await E.slice(Ui,xr).arrayBuffer(),Sl=d0e.from(Ia),mc={headers:{ExposeHeader:"ETag","Access-Control-Expose-Headers":"ETag"},cancelToken:Ue.token,signal:ne.signal,onUploadProgress:function(nu){const To=Math.round(Tn*Nn);ae(To)}};mn=await zr.put(Jt[Tn].url,Sl,mc),Kn.push({PartNumber:Tn+1,Part:Jt[Tn].pathName}),Tn++}}catch(Nn){console.log("error in uploading = ",Nn),Qt("Failed to upload!");return}return console.log("parts_info = ",Kn),mn={...mn,parts_info:Kn},mn}async function Qe(Dt,nn){let en=null;if(_e){const mn=E==null?void 0:E.recordDataBase64,Kn=E==null?void 0:E.mimeType,Tn=`data:${Kn.substring(0,Kn.indexOf(";"))};base64,${mn}`;en=tn(Tn),console.log("Binary file =",en)}else en=await J(E),console.log("Normal - else condition binaryData = ",en);const qt={headers:{},cancelToken:Ue.token,signal:ne.signal,onUploadProgress:function(mn){const Kn=Math.round(mn.loaded*100/mn.total);ae(Kn)}};return console.log(qt),await zr.put(nn,en,qt)}const nt=async(Dt,{resetForm:nn})=>{var Kn,Nn,Tn,Ui,xr;if(O===""){console.log("Inside mediaUrl === '' "),Qt("Upload Valid File","error");return}console.log("File for uploading = ",E),de(!0);let en="";_e?en=Ce.split("/")[1]:en=E.name.substring(E.name.lastIndexOf(".")+1),console.log("fileExtension = ",en);let qt={fileextention:en,modulename:"detailing"};const Jt=25*1024*1024,mn=Math.ceil((E==null?void 0:E.size)/Jt);n==="video"&&(qt={...qt,parts:mn}),console.log("data for getSignedUrl = ",qt);try{const bi=await Te(qt);if(console.log("getSignedUrl response =",bi),((Kn=bi==null?void 0:bi.data)==null?void 0:Kn.status)==="success"&&(bi==null?void 0:bi.status)===200){const Ia=(Tn=(Nn=bi==null?void 0:bi.data)==null?void 0:Nn.data)==null?void 0:Tn.resourceUrl,Sl=(xr=(Ui=bi==null?void 0:bi.data)==null?void 0:Ui.data)==null?void 0:xr.uploadURL;console.log("--- uploadUrls = ",Sl);let mc=null;if(n==="video"){const nu=await Pe(bi,Sl,Jt,mn);if(nu.status===200){const To=new URL(Ia);console.log("parser = ",To);const Fg=To.pathname,Bg={parts:nu.parts_info,filename:Fg.replace("/","")};console.log("completeUploadData = ",Bg);try{mc=await hs.completeChunkUpload(Bg),Qt("Saving contest response...","success"),console.log("completeUploadRes = ",mc)}catch(Ka){console.log("Error while calliing wallmessage/completechunkupload = ",Ka),Qt("Problem in uploading file! Please try after sometime","error"),ie(!1),ae(0),de(!1),b(null),Y(!1),l();return}}else console.log("THERE IS AN ERROR IN uploadConfig...",result1)}else mc=await Qe(bi,Sl);if(console.log("uploadResult =",mc),mc.status===200){console.log("uploadProgress in uploadResult.status === 200 =",le);const nu={contest_id:s,title:Dt.title,media_type:n,media_url:Ia};if(console.log("contestResponseData = ",nu),console.log("bool after upload = ",rt==null?void 0:rt.current),rt.current)return;ie(!1),ae(0),de(!1),b(null),Y(!1),Wa.addContestResponseRecord(nu).then(To=>{console.log("addContestResponseRecord RES =",To.data),To.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",To.data),Qt("Contest Response Saved","success"),ae(0),de(!1),b(null),Y(!1),l(),y(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(To=>{console.log(To),Qt("Failed to save Contest Response","error"),de(!1)})}else{console.log("THERE IS AN ERROR IN uploadConfig...",result1),Qt("UploadResult Else: Problem in uploading file! Please try after sometime","error"),ie(!1),ae(0),de(!1),b(null),Y(!1),l();return}}else{console.log("Error in signedUrlResponse =",bi),Qt("Problem in uploading file! Please try after sometime","error"),ie(!1),ae(0),de(!1),b(null),Y(!1),l();return}}catch(bi){Qt("Problem in uploading file! Please try after sometime","error"),ie(!1),ae(0),de(!1),b(null),Y(!1),l(),console.log("ERROR in uploading (get signed urls) = ",bi)}};function $e(Dt){console.log("getDuration called...",Dt),_e||$(Math.round(Dt))}function st(Dt){console.log("Video player ready --- t = ",Dt),console.log("active layer ---- ",Dt.getActivePlayer()),console.log("getInternalPlayer layer ---- ",Dt.getInternalPlayer())}const _n=({played:Dt,playedSeconds:nn,loaded:en,loadedSeconds:qt})=>{var Jt,mn,Kn;console.log("File Obj =",E),console.log("handleProgress called...",en),n==="video"&&H>((Jt=d==null?void 0:d.limits)==null?void 0:Jt.video)||n==="audio"&&H>((mn=d==null?void 0:d.limits)==null?void 0:mn.audio)||(E==null?void 0:E.size)>((Kn=d==null?void 0:d.limits)==null?void 0:Kn.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",H," mediaType = ",n," Size =",E==null?void 0:E.size),D("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",H," mediaType = ",n," Size =",E==null?void 0:E.size," compression Limit =",_),D(E.name),V(""))};return h.jsxs(h.Fragment,{children:[h.jsx(id,{initialValues:Ht,validationSchema:gn,onSubmit:nt,enableReinitialize:!0,children:Dt=>{var nn,en,qt,Jt,mn;return h.jsx(h.Fragment,{children:h.jsxs(kt,{className:"form_style",onSubmit:Dt.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-13",children:"Response title"}),h.jsx(kt.Control,{type:"text",placeholder:"title",name:"title",...Dt.getFieldProps("title"),autoComplete:"off"}),Dt.touched.title&&Dt.errors.title?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Dt.errors.title}):null]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsxs(h.Fragment,{children:[(n==="video"||n==="image")&&h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Je,name:dt,id:dt,className:"uploadMediafile",capture:xt,accept:It,onChange:an,disabled:Q}),h.jsx("label",{htmlFor:dt,className:"justify-content-center px-2 capture-btn",children:"Camera"})]}),n==="audio"&&h.jsx("div",{className:"flex-grow-1",children:h.jsx(Pt,{onClick:un,className:"btn-theme btn-primary w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Record"})}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:_t,name:mt,id:mt,className:"uploadMediafile",accept:It,onChange:an,disabled:Q}),h.jsx("label",{htmlFor:mt,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]})]})})]}),(le>0||G)&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-3",children:[h.jsx("span",{className:"font-13 fw-sb pe-2",children:"Uploading: "}),h.jsx("progress",{value:le,max:"100"}),h.jsx("span",{className:"font-13 fw-sb ps-2",children:`${le}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!E&&H<=0?"No file selected":n==="video"&&H>((nn=d==null?void 0:d.limits)==null?void 0:nn.video)||n==="audio"&&H>((en=d==null?void 0:d.limits)==null?void 0:en.audio)||(E==null?void 0:E.size)>((qt=d==null?void 0:d.limits)==null?void 0:qt.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${E?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",pE(H)]}),h.jsx("span",{className:"fw-sb font-13",children:P?` and ${P}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${E?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:['"Uploaded file: "'," ",pE(H)]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:P?`and ${P}`:""})]})})}),E&&n==="video"&&H<((Jt=d==null?void 0:d.limits)==null?void 0:Jt.video)&&(E==null?void 0:E.size)<((mn=d==null?void 0:d.limits)==null?void 0:mn.size)*1024*1024?h.jsx("div",{}):h.jsx(h.Fragment,{}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Pt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${Q?"d-block":"d-none"} ${te?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:ye,children:h.jsx(Zt,{tag:"delete7",className:"font-26"})}),h.jsx(Jd,{aspectRatio:`${n==="audio"?"21x9":n==="image"?"1x1":"16x9"}`,className:"preview-container",children:h.jsxs(h.Fragment,{children:[n==="image"&&h.jsx("img",{ref:pt,src:"",alt:"preview image",className:"img-fluid mx-auto d-none"}),(n==="video"||n==="audio")&&h.jsx(XE,{url:A,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:Kn=>$e(Kn),onReady:st,onProgress:({played:Kn,playedSeconds:Nn,loaded:Tn,loadedSeconds:Ui})=>_n({played:Kn,playedSeconds:Nn,loaded:Tn,loadedSeconds:Ui})}),n==="pdf"&&h.jsxs("div",{ref:Ze,className:"d-none",children:[h.jsx(Zt,{tag:"pdf1",className:"me-2 font-30 text-danger"}),h.jsx("span",{className:"font-16 fw-sb",children:E==null?void 0:E.name})]})]})})]}),h.jsx("video",{ref:Xt,autoPlay:!1,className:"d-none opacity-0 visibility-hidden",style:{height:"0.1px",width:"0.1px"}}),M&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex w-100 p-1 rounded-2 mt-2",style:{background:"var(--color-red-lighter)"},children:h.jsx("span",{className:"d-block text-danger font-13 fw-sb",children:M})})}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Pt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:bt,children:"Back"}),h.jsx(Pt,{type:"submit",disabled:!Dt.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:te?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Dt.isValid,"Submit")})]})]})})}}),h.jsx(MSe,{show:me,handleClose:it,onRecordingStart:St,onRecordingStop:Lt,counter:Be,handlePause:we,handleStart:Xe,className:""}),h.jsx(NR,{show:Fe,loading:Ve,handleClose:We,primaryActionData:null,content_type:"force-upload-submission-cancel-modal",handlePrimaryAction:tt})]})}var ape;(function(n){n[n.voice_call=0]="voice_call",n[n.system=1]="system",n[n.ring=2]="ring",n[n.default=3]="default",n[n.music=3]="music",n[n.alarm=4]="alarm",n[n.notification=5]="notification",n[n.dtmf=8]="dtmf"})(ape||(ape={}));const oo=hc("Volumes",{web:()=>Xi(()=>import("./web-aBKShXG8.js"),__vite__mapDeps([])).then(n=>new n.VolumesWeb)}),LE=hc("Device",{web:()=>Xi(()=>import("./web-CYAAqD_l.js"),__vite__mapDeps([])).then(n=>new n.DeviceWeb)}),ope=30;function Yit({show:n,handleClose:t,contestId:i,videoDurationLimit:s,counter:l,handlePause:d,handleStart:u,handleReset:p,handleStop:g,handleSaveAgoraRecording:_}){let y={backdrop:"static",keyboard:!1};const[E,b]=k.useState(!1),A=Bp(),[N,O]=k.useState(null),[D,P]=k.useState(!0),[j,M]=k.useState(!1),[V,H]=k.useState(!0),[$,Q]=k.useState(!1),[Y,le]=k.useState(!1),[ae,te]=k.useState(!1),[de,G]=k.useState(1);async function ie(){console.log("getDeviceVolume called...");const Ge=await oo.getVolumeLevel({type:0}),rt=await oo.getVolumeLevel({type:1}),pt=await oo.getVolumeLevel({type:2}),Ze=await oo.getVolumeLevel({type:3}),Je=await oo.getVolumeLevel({type:4}),_t=await oo.getVolumeLevel({type:5}),Xt=await oo.getVolumeLevel({type:6}),Ht=await oo.getVolumeLevel({type:7}),gn=await oo.getVolumeLevel({type:8});Ge&&G(Ge.value),console.log("--vol1 = ",JSON.stringify(Ge)),console.log("--vol2 = ",JSON.stringify(rt)),console.log("--vol3 = ",JSON.stringify(pt)),console.log("--vol4 = ",JSON.stringify(Ze)),console.log("--vol5 = ",JSON.stringify(Je)),console.log("--vol6 = ",JSON.stringify(_t)),console.log("--vol7 = ",JSON.stringify(Xt)),console.log("--vol8 = ",JSON.stringify(Ht)),console.log("--vol9 = ",JSON.stringify(gn))}async function _e(Ge){console.log("setDeviceVolume called..."),console.log("setDeviceVolume called...for android");const rt=await oo.setVolumeLevel({value:Ge,type:0});await oo.setVolumeLevel({value:Ge,type:1}),await oo.setVolumeLevel({value:Ge,type:2}),await oo.setVolumeLevel({value:Ge,type:3}),await oo.setVolumeLevel({value:Ge,type:4}),await oo.setVolumeLevel({value:Ge,type:5}),await oo.setVolumeLevel({value:Ge,type:6}),await oo.setVolumeLevel({value:Ge,type:7}),await oo.setVolumeLevel({value:Ge,type:8}),console.log("Set --vol = ",JSON.stringify(rt))}k.useEffect(()=>{n&&(console.log("Inside useEffect = ",n),console.log("videoCallData = ",N),he(i),ie())},[n]);async function he(Ge){var rt,pt,Ze,Je;if(console.log("Called initializeCallAndGetDetails() from AgoraVideoModal..."),!Ge){Qt("Unable to initialize...");return}try{const _t=await Wa.initializeCallAndGetDetails(Ge);if(((rt=_t.data)==null?void 0:rt.status)==="success"){console.log("initializeCallAndGetDetails res = ",_t.data);const Xt=(Ze=(pt=_t.data)==null?void 0:pt.data)==null?void 0:Ze.call_details;O(Xt),P(!1),Ce(),_e(1)}((Je=_t.data)==null?void 0:Je.status)==="failed"&&(console.log("initializeCallAndGetDetails res = ",_t.data),O(null),P(!1),Qt("Failed to connect to camera!","error"),H(!1),M(!1),we())}catch(_t){console.log("Error in initializeCallAndGetDetails Error = ",_t),H(!1),M(!1),we()}}function Ce(){b(!0),H(!0),M(!0),Ve.current=setTimeout(me,ope*1e3),console.log("idleTimeLimitRef.current = ",Ve.current)}function fe(){b(!1),M(!1),H(!1)}function me(){if($){clearTimeout(Ve.current);return}Qt(`Your are idle for more than ${ope}s! Closing Camera option`,"error"),setTimeout(()=>{we()},400)}function Ne(){Qt("Recording stopped","info"),Xe()}_0e({appid:N==null?void 0:N.app_id,channel:N==null?void 0:N.channel,token:N!=null&&N.token?N==null?void 0:N.token:null},E);const{localMicrophoneTrack:Fe}=w0e(j,{encoderConfig:"high_quality_stereo"}),{localCameraTrack:je}=S0e(V);E0e([Fe,je]);const Ve=k.useRef(null),Re=k.useRef(null);async function Be(){if(console.log("idleTimeLimitRef.current = ",Ve.current),clearTimeout(Ve.current),M(!0),le(!0),g(),!$&&E&&A)try{const Ge=await Wa.startVideoRecording(N==null?void 0:N.id);console.log("Called startVideoRecording Res = ",Ge.data),Ge.data.status==="success"&&(le(!1),Q(!0),u(),_e(1),Re.current=setTimeout(Ne,(s-5)*1e3)),Ge.data.status==="failed"&&(Qt("Unable to start recording!","error"),le(!1),g(),we())}catch(Ge){console.log("Error in startVideoRecording = ",Ge),Qt("Unable to start recording!","error"),le(!1),g(),we()}}async function Xe(){var Ge,rt;console.log("handleStopRecordingAction called...",$),te(!0),d();try{Qt("Processing a video","info");const pt=await Wa.stopVideoRecording(N==null?void 0:N.id);if(console.log("Called stopVideoRecording Res = ",pt.data),pt.data.status==="success"){const Ze=(rt=(Ge=pt.data)==null?void 0:Ge.data)==null?void 0:rt.video_url;Qt("Video saved successfully!","success"),te(!1),Q(!1),d(),_({url:Ze}),fe(),we()}pt.data.status==="failed"&&(Qt("Failed to record a video!","error"),te(!1),Q(!1),g(),we())}catch(pt){console.log("Error in stopVideoRecording = ",pt),Qt("Failed to record a video!","error"),te(!1),Q(!1),g(),we()}}function we(){Ve!=null&&Ve.current&&clearTimeout(Ve.current),Re!=null&&Re.current&&clearTimeout(Re.current),_e(10),g(),fe(),O(null),P(!0),H(!1),M(!1),t()}return h.jsx(h.Fragment,{children:h.jsx(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom agora-video-modal",show:n,onHide:t,...y,children:h.jsx(vn.Body,{className:"no-scrollbar p-2 pb-3",children:D&&!N?h.jsx(et,{className:"shadow-sm rounded-4 bg-gray-md border-0 mt-2",children:h.jsxs(et.Body,{children:[h.jsx("div",{className:"my-2 text-center",children:h.jsx(Ji,{animation:"border",variant:"light"})}),h.jsx("div",{className:"p-2 text-center fw-sb font-16 text-light",children:"Initializing...Please wait!!"})]})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"room",children:A?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"user-list",children:h.jsx("div",{className:"user",children:h.jsx(A0e,{audioTrack:Fe,cameraOn:V,micOn:j,videoTrack:je,cover:"https://www.agora.io/en/wp-content/uploads/2022/10/3d-spatial-audio-icon.svg",children:h.jsx("samp",{className:"user-name",children:"You"})})})}),h.jsxs("div",{className:"control",children:[h.jsx("div",{className:"timer-container",children:h.jsx("span",{className:"btn btn-theme btn- btn-red rounded-5 d-flex align-items-center justify-content-center text-white px-2 fw-b",style:{minWidth:60},children:$?h.jsx(h.Fragment,{children:l<=60?l+"s":eQ(l,":")+"m"}):h.jsx(h.Fragment,{children:"0s"})})}),h.jsx("div",{className:"left-control",children:$?h.jsxs("button",{className:"btn btn-theme btn-start-recording btn-white btn- d-flex align-items-center rounded-5 active",onClick:Xe,children:[h.jsx("div",{className:"icon",children:ae?h.jsx(Ji,{animation:"border",variant:"light",size:"sm"}):h.jsx("span",{})}),h.jsx("span",{className:"ms-1",children:"Stop"})]}):h.jsxs("button",{className:"btn btn-theme btn-start-recording btn-white btn- d-flex align-items-center rounded-5 ",onClick:Be,children:[h.jsx("div",{className:"icon",children:Y?h.jsx(Ji,{animation:"border",variant:"light",size:"sm"}):h.jsx("span",{})}),h.jsx("span",{className:"ms-1",children:"Start"})]})}),h.jsx("div",{className:"right-control",children:!$&&h.jsx("button",{className:`btn btn-theme btn-white btn- d-flex align-items-center justify-content-center rounded-5 ${$?"opacity-0 pe-none":""}`,style:{minWidth:60},onClick:we,children:h.jsx(Zt,{tag:"delete7",className:"font-24"})})})]})]}):h.jsx(h.Fragment,{})})})})})})}function Xit({mediaType:n,mediaSource:t,className:i,contestId:s,handleClose:l,data:d,fileSizelimit:u,videoDurationLimit:p,audioDurationLimit:g,minCompressionLimit:_,deviceOS:y}){const E=Ii(),[b,A]=k.useState(),[N,O]=k.useState(null),[D,P]=k.useState(""),[j,M]=k.useState(null),[V,H]=k.useState(""),[$,Q]=k.useState(0),[Y,le]=k.useState(!1),[ae,te]=k.useState(0),[de,G]=k.useState(!1),[ie,_e]=k.useState(!1);k.useState(!1);const[he,Ce]=k.useState(!1),[fe,me]=k.useState(null),[Ne,Fe]=k.useState(!1),[je,Ve]=k.useState(!1),{counter:Re,handleStart:Be,handlePause:Xe,handleReset:we,handleStop:Ge}=FZ(0,!0),rt=k.useRef(!1);k.useRef(null);const pt=k.useRef(null),Ze=k.useRef(null);k.useRef(null);const Je={title:""},_t=uc({title:hf().required("Required")}),Xt=n?n==="pdf"?".pdf":`${n}/*`:"image/*",Ht=n!==""?"user":"",gn=n?`${n}-gallery-file`:"media-gallery-file",It=n?`${n}-camera-file`:"media-camera-file";function xt(Te){Te&&(me(Te),O(Te.url),le(!0))}const mt=()=>{Ce(!1)},dt=()=>{console.log("handleShowAgoraVideoModal () - MEDIA TYPE = "),Ce(!0)},it=()=>{Fe(!1)},Me=()=>{Fe(!0)};async function We(){console.log("onCameraBtnClick called..."),dt()}function bt(Te){if(console.log("Inside handleChange =",Te.target.files[0]),Te.target.files[0]){A(Te.target.files[0]),le(!0);const Pe=kR(Te.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",Pe),M(Pe),n){case"video":let Qe=URL.createObjectURL(Te.target.files[0]);console.log("Preview Video blobVideoURL =",Qe),O(Qe);break;default:console.log("No case matched...")}}}function St(){if(b)switch(A(null),le(!1),H(""),M(null),we(),pt.current&&(pt.current.value=""),Ze.current&&(Ze.current.value=""),n){case"video":O(null);break;default:console.log("No case matched...")}fe&&(O(null),me(null),le(!1))}const Lt=new AbortController,un=zr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),rt.current&&(console.log("Called cancellation inside if(bool.current)...",rt==null?void 0:rt.current),un.cancel("Upload cancelled by user"),Lt.abort())},[]);function an(){rt.current=!0,l(),un.cancel("Upload cancelled by user"),Lt.abort(),Lt.signal.aborted&&Qt("Uploading cancelled!","error")}async function ye(Te){return await hs.getSignedUploadUrl(Te)}async function J(Te,Pe,Qe,nt){const $e=Pe.map((Dt,nn)=>{const en=new URL(Dt);console.log("parser = ",en);const qt=en.pathname;return{url:Dt,pathName:qt.replace("/","")}});console.log("urls = ",$e);let st=null,_n=[];try{const Dt=100/nt;let nn=0,en=0,qt=0;for(_e(!0);qt<=b.size;){console.log("Value of start = ",en),console.log("Value of end = ",qt),en=nn*Qe,qt=en+Qe;const mn=await b.slice(en,qt).arrayBuffer(),Kn=d0e.from(mn),Nn={headers:{ExposeHeader:"ETag","Access-Control-Expose-Headers":"ETag"},cancelToken:un.token,signal:Lt.signal,onUploadProgress:function(Tn){console.log("progressEvent = ",Tn);const Ui=Math.round(100/nt*nn+Tn.loaded*100/Tn.total/(100/nt));console.log("percentCompleted = ",Ui),te(Ui>100?100:Ui)}};st=await zr.put($e[nn].url,Kn,Nn),_n.push({PartNumber:nn+1,Part:$e[nn].pathName}),nn++}}catch(Dt){console.log("error in uploading = ",Dt),Qt("Failed to upload!");return}return console.log("parts_info = ",_n),st={...st,parts_info:_n},st}const ne=async(Te,{resetForm:Pe})=>{var _n,Dt,nn,en,qt;if(y==="android"&&!fe&&!b){Qt("Upload Valid File","error");return}if(y==="android"&&fe&&!b){const Jt={contest_id:s,title:Te.title,media_type:n,media_url:fe.url};console.log("deviceOS === android in contestResponseData = ",Jt),Wa.addContestResponseRecord(Jt).then(mn=>{console.log("addContestResponseRecord RES =",mn.data),mn.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",mn.data),Qt("Contest Response Saved","success"),te(0),G(!1),A(null),le(!1),l(),E(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(mn=>{console.log(mn),Qt("Failed to save Contest Response","error"),G(!1)});return}if(D===""){console.log("Inside mediaUrl === '' "),Qt("Upload Valid File","error");return}console.log("File for uploading = ",b),G(!0);let Qe=b.name.substring(b.name.lastIndexOf(".")+1);console.log("fileExtension = ",Qe);const nt=25*1024*1024,$e=Math.ceil((b==null?void 0:b.size)/nt);let st={fileextention:Qe,modulename:"detailing",parts:$e};console.log("data for getSignedUrl = ",st);try{const Jt=await ye(st);if(console.log("getSignedUrl response =",Jt),((_n=Jt==null?void 0:Jt.data)==null?void 0:_n.status)==="success"&&(Jt==null?void 0:Jt.status)===200){const mn=(nn=(Dt=Jt==null?void 0:Jt.data)==null?void 0:Dt.data)==null?void 0:nn.resourceUrl,Kn=(qt=(en=Jt==null?void 0:Jt.data)==null?void 0:en.data)==null?void 0:qt.uploadURL;console.log("--- uploadUrls = ",Kn);let Nn=null;if(n==="video"){const Tn=await J(Jt,Kn,nt,$e);if(Tn.status===200){const Ui=new URL(mn);console.log("parser = ",Ui);const xr=Ui.pathname,bi={parts:Tn.parts_info,filename:xr.replace("/","")};console.log("completeUploadData = ",bi);try{Nn=await hs.completeChunkUpload(bi),Qt("Saving contest response...","success"),console.log("completeUploadRes = ",Nn)}catch(Ia){console.log("Error while calliing wallmessage/completechunkupload = ",Ia),Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),te(0),G(!1),A(null),le(!1),l();return}}else console.log("THERE IS AN ERROR IN uploadConfig...",result1)}if(console.log("uploadResult =",Nn),Nn.status===200){console.log("uploadProgress in uploadResult.status === 200 =",ae);const Tn={contest_id:s,title:Te.title,media_type:n,media_url:mn};if(console.log("contestResponseData = ",Tn),console.log("bool after upload = ",rt==null?void 0:rt.current),rt.current)return;_e(!1),te(0),G(!1),A(null),le(!1),Wa.addContestResponseRecord(Tn).then(Ui=>{console.log("addContestResponseRecord RES =",Ui.data),Ui.data.status==="success"&&(console.log("addContestResponseRecord SUCCESS RES =",Ui.data),Qt("Contest Response Saved","success"),te(0),G(!1),A(null),le(!1),l(),E(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}}))}).catch(Ui=>{console.log(Ui),Qt("Failed to save Contest Response","error"),G(!1)})}else{console.log("THERE IS AN ERROR IN uploadConfig...",result1),Qt("UploadResult Else: Problem in uploading file! Please try after sometime","error"),_e(!1),te(0),G(!1),A(null),le(!1),l();return}}else{console.log("Error in signedUrlResponse =",Jt),Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),te(0),G(!1),A(null),le(!1),l();return}}catch(Jt){Qt("Problem in uploading file! Please try after sometime","error"),_e(!1),te(0),G(!1),A(null),le(!1),l(),console.log("ERROR in uploading (get signed urls) = ",Jt)}};function Se(Te){console.log("getDuration called...",Te),Q(Math.round(Te))}function Ue(Te){}const tt=({played:Te,playedSeconds:Pe,loaded:Qe,loadedSeconds:nt})=>{var $e,st;console.log("File Obj =",b),console.log("handleProgress called...",Qe),n==="video"&&$>(($e=d==null?void 0:d.limits)==null?void 0:$e.video)||(b==null?void 0:b.size)>((st=d==null?void 0:d.limits)==null?void 0:st.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",$," mediaType = ",n," Size =",b==null?void 0:b.size),P("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",$," mediaType = ",n," Size =",b==null?void 0:b.size," compression Limit =",_),P(b.name),H(""))};return h.jsxs(h.Fragment,{children:[h.jsx(id,{initialValues:Je,validationSchema:_t,onSubmit:ne,enableReinitialize:!0,children:Te=>{var Pe,Qe,nt,$e;return h.jsx(h.Fragment,{children:h.jsxs(kt,{className:"form_style",onSubmit:Te.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx(kt.Label,{className:"font-13",children:"Response title"}),h.jsx(kt.Control,{type:"text",placeholder:"title",name:"title",...Te.getFieldProps("title"),autoComplete:"off"}),Te.touched.title&&Te.errors.title?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Te.errors.title}):null]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload type"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsxs(h.Fragment,{children:[n==="video"&&y==="android"?h.jsx("div",{className:"flex-grow-1",children:h.jsx(Pt,{onClick:()=>{console.log("On agora btn clicked..."),We()},className:"btn-theme btn-secondary w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Camera"})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:pt,name:It,id:It,className:"uploadMediafile",capture:Ht,accept:Xt,onChange:bt,disabled:Y}),h.jsx("label",{htmlFor:It,className:"justify-content-center px-2 capture-btn",children:"Camera"})]})}),h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Ze,name:gn,id:gn,className:"uploadMediafile",accept:Xt,onChange:bt,disabled:Y}),h.jsx("label",{htmlFor:gn,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]})]})})]}),(ae>0||ie)&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-3",children:[h.jsx("span",{className:"font-13 fw-sb pe-2",children:"Uploading: "}),h.jsx("progress",{value:ae,max:"100"}),h.jsx("span",{className:"font-13 fw-sb ps-2",children:`${ae}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!b&&$<=0?"No file selected":n==="video"&&$>((Pe=d==null?void 0:d.limits)==null?void 0:Pe.video)||(b==null?void 0:b.size)>((Qe=d==null?void 0:d.limits)==null?void 0:Qe.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${b?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",pE($)]}),h.jsx("span",{className:"fw-sb font-13",children:j?` and ${j}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${b?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:['"Uploaded file: "',pE($)]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:j?`and ${j}`:""})]})})}),b&&n==="video"&&$<((nt=d==null?void 0:d.limits)==null?void 0:nt.video)&&(b==null?void 0:b.size)<(($e=d==null?void 0:d.limits)==null?void 0:$e.size)*1024*1024?h.jsx("div",{}):h.jsx(h.Fragment,{}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Pt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${Y?"d-block":"d-none"} ${de?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:St,children:h.jsx(Zt,{tag:"delete7",className:"font-26"})}),h.jsx(Jd,{aspectRatio:"16x9",className:"preview-container",children:h.jsx(h.Fragment,{children:n==="video"&&h.jsx(XE,{url:N,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:st=>Se(st),onReady:Ue,onProgress:({played:st,playedSeconds:_n,loaded:Dt,loadedSeconds:nn})=>tt({played:st,playedSeconds:_n,loaded:Dt,loadedSeconds:nn})})})})]}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Pt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:Me,children:"Back"}),h.jsx(Pt,{type:"submit",disabled:!Te.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:de?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(Te.isValid,"Submit")})]})]})})}}),h.jsx(Yit,{show:he,handleClose:mt,contestId:s,videoDurationLimit:p,counter:Re,handlePause:Xe,handleStart:Be,handleReset:we,handleStop:Ge,handleSaveAgoraRecording:xt}),h.jsx(NR,{show:Ne,loading:je,handleClose:it,primaryActionData:null,content_type:"force-upload-submission-cancel-modal",handlePrimaryAction:an})]})}function Jit(n){var u,p,g,_,y,E,b,A,N,O,D,P,j,M,V,H;k.useState(!1);const t=(p=(u=n.data)==null?void 0:u.limits)!=null&&p.size?(_=(g=n.data)==null?void 0:g.limits)==null?void 0:_.size:"NA",i=(E=(y=n.data)==null?void 0:y.limits)!=null&&E.video?(A=(b=n.data)==null?void 0:b.limits)==null?void 0:A.video:"NA",s=(O=(N=n.data)==null?void 0:N.limits)!=null&&O.audio?(P=(D=n.data)==null?void 0:D.limits)==null?void 0:P.audio:"NA",l=(M=(j=n.data)==null?void 0:j.limits)!=null&&M.min_compression_size?(H=(V=n.data)==null?void 0:V.limits)==null?void 0:H.min_compression_size:0,d=(n==null?void 0:n.deviceOS)||"android";return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:`Upload ${n.uploadMediaType}`})}),h.jsxs(vn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx(et,{className:"mb-1 mb-sm-2",children:h.jsxs(et.Body,{className:"p-1 p-sm-2 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:t!=="NA"&&`${t} mb`})," ","and video/audio duration not more than"," ",h.jsx("span",{className:"fw-b text-danger",children:i!=="NA"&&`${i}s`}),"."]})}),n.uploadMediaType.toLowerCase()==="video"?h.jsx(Xit,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,contestId:n.contestId,handleClose:n.handleClose,data:n.data,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s,minCompressionLimit:l,deviceOS:d}):h.jsx(qit,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,contestId:n.contestId,handleClose:n.handleClose,data:n.data,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s,minCompressionLimit:l})]})]})})}function Qit(){var O,D,P,j,M,V,H,$,Q,Y,le,ae;const[n,t]=k.useState({isVisible:!1}),[i,s]=k.useState(""),[l,d]=k.useState(""),{state:u}=Xo(),p=(O=u==null?void 0:u.item)==null?void 0:O.response_types,g=(D=u==null?void 0:u.item)==null?void 0:D.response_sources,_=(P=u==null?void 0:u.item)==null?void 0:P.title,y=(j=u==null?void 0:u.item)==null?void 0:j.id,E=(V=(M=u==null?void 0:u.item)==null?void 0:M.limits)==null?void 0:V.size;($=(H=u==null?void 0:u.item)==null?void 0:H.limits)==null||$.video,(Y=(Q=u==null?void 0:u.item)==null?void 0:Q.limits)==null||Y.audio,(ae=(le=u==null?void 0:u.item)==null?void 0:le.limits)==null||ae.min_compression_size;const b=async()=>{const te=await LE.getInfo();d(te.platform)};k.useEffect(()=>{b()},[]);const A=()=>{t({isVisible:!1})},N=te=>{s(te),t({isVisible:!0})};return h.jsx(qi,{className:"upload-response-page",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsx("div",{className:"d-flex align-items-center justify-content-between pt-2 mb-3",children:h.jsxs("p",{className:"font-14",children:["Select source for uploading your response for contest."," ",h.jsxs("span",{className:"fw-sb",children:['"',_,'"']})]})}),(p==null?void 0:p.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:p==null?void 0:p.map((te,de)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>N(te),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[te==="video"&&h.jsx(Zt,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),te==="audio"&&h.jsx(Zt,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),te==="pdf"&&h.jsx(Zt,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),te==="image"&&h.jsx(Zt,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${te}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:E&&h.jsxs(h.Fragment,{children:["max ",E,"mb"]})})]})]})})},`${de}-type`))}),h.jsx(Jit,{show:n,handleClose:A,resSources:g,uploadMediaType:i,contestId:y,className:"",data:u==null?void 0:u.item,deviceOS:l})]})})}function Zit(n){var fe,me,Ne,Fe;const t=Ii(),{state:i}=Xo(),s=(fe=i.data)==null?void 0:fe.contest_id,l=(me=i.data)==null?void 0:me.response_id,d=(Ne=i.data)==null?void 0:Ne.contest_title,u=(Fe=i.data)==null?void 0:Fe.response_user,[p,g]=k.useState([]),[_,y]=k.useState(!0),[E,b]=k.useState(!0),[A,N]=k.useState({}),[O,D]=k.useState({}),[P,j]=k.useState(null),[M,V]=k.useState(!0),[H,$]=k.useState(!1),[Q,Y]=k.useState(!1),le=k.useRef(null);k.useEffect(()=>{console.log("useEffect parameters =",p),N(p.reduce((je,Ve)=>({...je,[Ve.id]:0}),{}))},[p]),k.useEffect(()=>{s&&ae(s)},[]);async function ae(je){Wa.getDetailingContestParameters(je).then(Ve=>{Ve.data.status==="success"&&(g(Ve.data.data.items),y(!1))}).catch(Ve=>{y(!1),g([]),console.log("Error in getDetailingContestParameters = ",Ve)})}const te=()=>{Y(!1)},de=()=>{Y(!0)},G={feedback:"",evaluations:"",response_id:l,contest_id:s},ie=uc({});async function _e(je){console.log("*****************************"),console.log("******** Inside seperate async func evaluateDetailingContestResponse *************"),console.log("evaluateDetailingContestResponse newValues = ",je),console.log("*****************************"),$(!0),Wa.evaluateDetailingContestResponse(je).then(Ve=>{var Re,Be;if(console.log("evaluateDetailingContestResponse RES = ",Ve.data),Ve.data.status==="success")console.log("Inside Evaluate case : ",Ve.data),Qt("Successfully evaluated!","success"),$(!1),t(`/contests/${s}`,{state:{pageTitle:"Detailing Contest Details"}});else if(Ve.data.status==="failed")if(console.log("ERROR:",Ve.data.error),Qt("Evaluation failed!","error"),$(!1),je.hasOwnProperty("force"))console.log("newValues contains force property...",je);else{const Xe={btnOptions:(Be=(Re=Ve.data)==null?void 0:Re.data)==null?void 0:Be.options,message:Ve.data.message};j(Xe),de()}}).catch(Ve=>{console.log(Ve),$(!1),Qt("Evaluation failed!","error")})}const he=async(je,{resetForm:Ve})=>{if(console.log("Form Values :",je),console.log("Evaluation = ",A),le.current.value===""){je.feedback===""&&b(!1),Qt("Feedback Required","error");return}je.feedback!==""&&b(!0);const Re={...je,response_id:l,contest_id:s,evaluations:A};console.log("New values in Compose =",Re),D(Re);for(const[Xe,we]of Object.entries(A))if(we===0){V(!1),Qt("Required Parameters to be selected","error");return}$(!0),console.log("MOved ahead");const Be=await _e(Re);console.log("evalResponse in onSubmit = ",Be)},Ce=(je,Ve)=>{console.log(je,Ve),N(Re=>({...Re,[Ve]:je}))};return h.jsxs(h.Fragment,{children:[h.jsx(qi,{className:"evaluate-page",children:h.jsxs(Yn,{className:"mb-4",children:[h.jsxs("div",{className:"font-14 pt-2 pb-0",children:["Submit your evaluation to contest"," ",h.jsx("span",{className:"fw-sb",children:`"${d}"`})]}),h.jsxs("div",{className:"py-2 font-14",children:[h.jsx("span",{className:"fw-sb me-1",children:"Evaluating:"}),h.jsx("span",{className:"text-theme-primary fw-sb",children:u})]}),h.jsx("div",{className:"py-1",style:{border:"0px solid #999"},children:h.jsx(id,{initialValues:G,validationSchema:ie,onSubmit:he,children:je=>h.jsxs(kt,{className:"form_style",onSubmit:je.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-0",children:[h.jsx(kt.Label,{className:"font-14",children:"Feedback"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto"},placeholder:"Feedback",name:"feedback",...je.getFieldProps("feedback"),autoComplete:"off",ref:le}),E?null:h.jsx(h.Fragment,{children:h.jsx("p",{className:"error-state-text font-13 text-danger",children:"Required"})})]}),h.jsx("hr",{}),h.jsxs("div",{className:"eval-options-wrap d-grid gap-3",children:[_&&h.jsx(ci,{type:""}),!_&&p.length>0&&h.jsx(h.Fragment,{children:p.map(Ve=>h.jsxs("div",{className:"d-flex flex-column",children:[h.jsx("div",{className:"font-14 mb-1",children:Ve.title}),h.jsx(Bit,{initialValue:0,onUserRateChange:Ce,allowHover:!1,transition:!0,showTooltip:!1,tooltipSize:"small",tooltipDefaultText:"",tooltipArray:Ve.regards,iconsCount:Ve.scale,parameterId:Ve.id,size:50,emptyIcon:h.jsx(VFe,{className:"font-28"}),fillIcon:h.jsx(BFe,{className:"font-28"})}),!M&&h.jsx("div",{className:"font-12 text-danger",children:A.hasOwnProperty(Ve.id)&&A[Ve.id]===0&&"Required"})]},Ve.id))})]}),h.jsx(fn,{className:"row-cols-1 justify-content-center pt-5 pb-3",children:h.jsx(Gt,{className:"col-12",children:h.jsx(Pt,{type:"submit",disabled:H,className:"btn-theme btn-primary btn-md w-100",children:H?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(je.isValid,"Submit")})})}),h.jsx("div",{className:"btn-wrap pt-3 d-flex justify-content-center"})]})})})]})}),h.jsx(NR,{show:Q,loading:H,handleClose:te,primaryActionData:O,content_type:"force-evaluation-submission-modal",handlePrimaryAction:_e,data:P})]})}function RC({item:n,className:t,type:i,title:s,subTitle:l,iconImg:d,handleItemSelect:u}){const p=t||"",g=d||((n==null?void 0:n.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),_=s||"Guest User",y=l||"";return h.jsx(et,{onClick:()=>u(n),className:`card-theme border-0 rounded-1 custom-select-list-btn-card card-md ${p}`,children:h.jsxs(et.Body,{className:"d-flex align-items-center info-container p-2",children:[h.jsx("div",{className:"d-flex flex-shrink-0 img-wra media-icon-wrapper",children:h.jsx(us,{src:g,alt:`${_} image`,className:"img-fluid"})}),h.jsxs("div",{className:"flex-grow-1 ps-2 ps-sm-3",children:[h.jsx("div",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${_} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:$R(y)})]}),h.jsx(Zt,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(Zt,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})}function BZ({className:n,items:t,type:i,handleRemoveItems:s,...l}){const d=n||"",u=t&&(t==null?void 0:t.length)>0?t==null?void 0:t.length:0;function p(g){const _=g.target.getAttribute("data-id"),y=t.filter((E,b)=>E.id===_)[0];s(y)}return h.jsxs("div",{className:`d-flex align-items-center selected-items-list position-relative border-bottom ${d}`,children:[h.jsx("div",{className:"d-flex justify-content-center align-items-center total flex-shrink-0",style:{width:30,height:30,background:"var(--color-gray-light5)",borderRadius:6},children:u}),h.jsx("div",{className:"flex-grow-1 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto border-botto bg-gray-lighte position-relative ps-2",style:{minHeight:40},children:t&&t.length>0?h.jsx(h.Fragment,{children:t.map((g,_)=>{const y=g!=null&&g.avatar&&(g==null?void 0:g.type)==="user"?g==null?void 0:g.avatar:"/img/groups-icon.png";return h.jsxs("div",{className:`d-flex align-items-center p-1 rounded-3 text-wrap position-relative border-0 me-2 ${i==="single"?"pe-none":""}`,children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0 pe-none",style:{width:26,height:26},children:h.jsx("img",{src:y,className:"img-fluid mx-auto",alt:Pv(g==null?void 0:g.firstname,g==null?void 0:g.lastname),style:{objectFit:"cover"}})}),h.jsxs("div",{className:"ms-1 font-13 text-truncate flex-grow-1",children:[Pv(g==null?void 0:g.firstname,g==null?void 0:g.lastname),i!=="single"&&h.jsx(Pt,{type:"button",className:"btn btn-theme btn-white bg-transparent btn-icon btn-sm","data-item":`${JSON.stringify(g)}`,"data-id":g.id,onClick:p,children:h.jsx(Zt,{tag:"delete8",className:"text-gray6 font-18 mx-1 pe-none"})})]})]},g.id)})}):h.jsx(h.Fragment,{children:h.jsx("div",{className:"font-14 fw-sb text-gray6 ps-2",children:"Please select user"})})})]})}function ert({item:n,className:t,type:i,title:s,subTitle:l,iconImg:d,handleImageSelect:u}){const p=t||"";return h.jsx(et,{onClick:()=>{u(n)},className:`card-theme border-0 rounded-2 custom-select-image-btn-card card-md ${p} h-100 position-relative`,children:h.jsxs(et.Body,{className:"p-0 rounded-1 h-100 d-flex align-items-center",children:[h.jsx("div",{className:"card-overlay bg-gray-normal-overlay",children:h.jsx(Zt,{tag:"check2",className:"font-24"})}),h.jsx(us,{src:d,alt:`${n==null?void 0:n.id} image`,className:"img-fluid"})]})})}function va(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function DE(n){"@babel/helpers - typeof";return DE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DE(n)}function trt(n,t){if(DE(n)!="object"||!n)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,t||"default");if(DE(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function jSe(n){var t=trt(n,"string");return DE(t)=="symbol"?t:t+""}function lpe(n,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,jSe(s.key),s)}}function ya(n,t,i){return t&&lpe(n.prototype,t),i&&lpe(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n}function nrt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function fc(n,t){if(t&&(DE(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nrt(n)}function Cr(n){return Cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cr(n)}function pc(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&p7(n,t)}function wt(n,t,i){return(t=jSe(t))in n?Object.defineProperty(n,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[t]=i,n}function cpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function dpe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?cpe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):cpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function irt(n,t,i){return t=Cr(t),fc(n,USe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function USe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(USe=function(){return!!n})()}var FSe=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=irt(this,t,[].concat(l)),wt(i,"state",{scrollToColumn:0,scrollToRow:0,instanceProps:{prevScrollToColumn:0,prevScrollToRow:0}}),wt(i,"_columnStartIndex",0),wt(i,"_columnStopIndex",0),wt(i,"_rowStartIndex",0),wt(i,"_rowStopIndex",0),wt(i,"_onKeyDown",function(u){var p=i.props,g=p.columnCount,_=p.disabled,y=p.mode,E=p.rowCount;if(!_){var b=i._getScrollState(),A=b.scrollToColumn,N=b.scrollToRow,O=i._getScrollState(),D=O.scrollToColumn,P=O.scrollToRow;switch(u.key){case"ArrowDown":P=Math.min(y==="cells"?P+1:i._rowStopIndex+1,E-1);break;case"ArrowLeft":D=Math.max(y==="cells"?D-1:i._columnStartIndex-1,0);break;case"ArrowRight":D=Math.min(y==="cells"?D+1:i._columnStopIndex+1,g-1);break;case"ArrowUp":P=Math.max(y==="cells"?P-1:i._rowStartIndex-1,0);break}(D!==A||P!==N)&&(u.preventDefault(),i._updateScrollState({scrollToColumn:D,scrollToRow:P}))}}),wt(i,"_onSectionRendered",function(u){var p=u.columnStartIndex,g=u.columnStopIndex,_=u.rowStartIndex,y=u.rowStopIndex;i._columnStartIndex=p,i._columnStopIndex=g,i._rowStartIndex=_,i._rowStopIndex=y}),i}return pc(t,n),ya(t,[{key:"setScrollIndexes",value:function(s){var l=s.scrollToColumn,d=s.scrollToRow;this.setState({scrollToRow:d,scrollToColumn:l})}},{key:"render",value:function(){var s=this.props,l=s.className,d=s.children,u=this._getScrollState(),p=u.scrollToColumn,g=u.scrollToRow;return k.createElement("div",{className:l,onKeyDown:this._onKeyDown},d({onSectionRendered:this._onSectionRendered,scrollToColumn:p,scrollToRow:g}))}},{key:"_getScrollState",value:function(){return this.props.isControlled?this.props:this.state}},{key:"_updateScrollState",value:function(s){var l=s.scrollToColumn,d=s.scrollToRow,u=this.props,p=u.isControlled,g=u.onScrollToChange;typeof g=="function"&&g({scrollToColumn:l,scrollToRow:d}),p||this.setState({scrollToColumn:l,scrollToRow:d})}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.isControlled?{}:s.scrollToColumn!==l.instanceProps.prevScrollToColumn||s.scrollToRow!==l.instanceProps.prevScrollToRow?dpe(dpe({},l),{},{scrollToColumn:s.scrollToColumn,scrollToRow:s.scrollToRow,instanceProps:{prevScrollToColumn:s.scrollToColumn,prevScrollToRow:s.scrollToRow}}):{}}}])}(k.PureComponent);wt(FSe,"defaultProps",{disabled:!1,isControlled:!1,mode:"edges",scrollToColumn:0,scrollToRow:0});VO(FSe);function BSe(n,t){var i;typeof t<"u"?i=t:typeof window<"u"?i=window:typeof self<"u"?i=self:i=Wo;var s=typeof i.document<"u"&&i.document.attachEvent;if(!s){var l=function(){var Q=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||function(Y){return i.setTimeout(Y,20)};return function(Y){return Q(Y)}}(),d=function(){var Q=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame||i.clearTimeout;return function(Y){return Q(Y)}}(),u=function(Y){var le=Y.__resizeTriggers__,ae=le.firstElementChild,te=le.lastElementChild,de=ae.firstElementChild;te.scrollLeft=te.scrollWidth,te.scrollTop=te.scrollHeight,de.style.width=ae.offsetWidth+1+"px",de.style.height=ae.offsetHeight+1+"px",ae.scrollLeft=ae.scrollWidth,ae.scrollTop=ae.scrollHeight},p=function(Y){return Y.offsetWidth!=Y.__resizeLast__.width||Y.offsetHeight!=Y.__resizeLast__.height},g=function(Y){if(!(Y.target.className&&typeof Y.target.className.indexOf=="function"&&Y.target.className.indexOf("contract-trigger")<0&&Y.target.className.indexOf("expand-trigger")<0)){var le=this;u(this),this.__resizeRAF__&&d(this.__resizeRAF__),this.__resizeRAF__=l(function(){p(le)&&(le.__resizeLast__.width=le.offsetWidth,le.__resizeLast__.height=le.offsetHeight,le.__resizeListeners__.forEach(function(ae){ae.call(le,Y)}))})}},_=!1,y="",E="animationstart",b="Webkit Moz O ms".split(" "),A="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),N="";{var O=i.document.createElement("fakeelement");if(O.style.animationName!==void 0&&(_=!0),_===!1){for(var D=0;D<b.length;D++)if(O.style[b[D]+"AnimationName"]!==void 0){N=b[D],y="-"+N.toLowerCase()+"-",E=A[D],_=!0;break}}}var P="resizeanim",j="@"+y+"keyframes "+P+" { from { opacity: 0; } to { opacity: 0; } } ",M=y+"animation: 1ms "+P+"; "}var V=function(Y){if(!Y.getElementById("detectElementResize")){var le=(j||"")+".resize-triggers { "+(M||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',ae=Y.head||Y.getElementsByTagName("head")[0],te=Y.createElement("style");te.id="detectElementResize",te.type="text/css",n!=null&&te.setAttribute("nonce",n),te.styleSheet?te.styleSheet.cssText=le:te.appendChild(Y.createTextNode(le)),ae.appendChild(te)}},H=function(Y,le){if(s)Y.attachEvent("onresize",le);else{if(!Y.__resizeTriggers__){var ae=Y.ownerDocument,te=i.getComputedStyle(Y);te&&te.position=="static"&&(Y.style.position="relative"),V(ae),Y.__resizeLast__={},Y.__resizeListeners__=[],(Y.__resizeTriggers__=ae.createElement("div")).className="resize-triggers";var de=ae.createElement("div");de.className="expand-trigger",de.appendChild(ae.createElement("div"));var G=ae.createElement("div");G.className="contract-trigger",Y.__resizeTriggers__.appendChild(de),Y.__resizeTriggers__.appendChild(G),Y.appendChild(Y.__resizeTriggers__),u(Y),Y.addEventListener("scroll",g,!0),E&&(Y.__resizeTriggers__.__animationListener__=function(_e){_e.animationName==P&&u(Y)},Y.__resizeTriggers__.addEventListener(E,Y.__resizeTriggers__.__animationListener__))}Y.__resizeListeners__.push(le)}},$=function(Y,le){if(s)Y.detachEvent("onresize",le);else if(Y.__resizeListeners__.splice(Y.__resizeListeners__.indexOf(le),1),!Y.__resizeListeners__.length){Y.removeEventListener("scroll",g,!0),Y.__resizeTriggers__.__animationListener__&&(Y.__resizeTriggers__.removeEventListener(E,Y.__resizeTriggers__.__animationListener__),Y.__resizeTriggers__.__animationListener__=null);try{Y.__resizeTriggers__=!Y.removeChild(Y.__resizeTriggers__)}catch{}}};return{addResizeListener:H,removeResizeListener:$}}function upe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function hpe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?upe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):upe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function rrt(n,t,i){return t=Cr(t),fc(n,VSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function VSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VSe=function(){return!!n})()}var oF=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=rrt(this,t,[].concat(l)),wt(i,"state",{height:i.props.defaultHeight||0,width:i.props.defaultWidth||0}),wt(i,"_parentNode",void 0),wt(i,"_autoSizer",void 0),wt(i,"_window",void 0),wt(i,"_detectElementResize",void 0),wt(i,"_onResize",function(){var u=i.props,p=u.disableHeight,g=u.disableWidth,_=u.onResize;if(i._parentNode){var y=i._parentNode.offsetHeight||0,E=i._parentNode.offsetWidth||0,b=i._window||window,A=b.getComputedStyle(i._parentNode)||{},N=parseInt(A.paddingLeft,10)||0,O=parseInt(A.paddingRight,10)||0,D=parseInt(A.paddingTop,10)||0,P=parseInt(A.paddingBottom,10)||0,j=y-D-P,M=E-N-O;(!p&&i.state.height!==j||!g&&i.state.width!==M)&&(i.setState({height:y-D-P,width:E-N-O}),_({height:y,width:E}))}}),wt(i,"_setRef",function(u){i._autoSizer=u}),i}return pc(t,n),ya(t,[{key:"componentDidMount",value:function(){var s=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._window=this._autoSizer.parentNode.ownerDocument.defaultView,this._detectElementResize=BSe(s,this._window),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var s=this.props,l=s.children,d=s.className,u=s.disableHeight,p=s.disableWidth,g=s.style,_=this.state,y=_.height,E=_.width,b={overflow:"visible"},A={};return u||(b.height=0,A.height=y),p||(b.width=0,A.width=E),k.createElement("div",{className:d,ref:this._setRef,style:hpe(hpe({},b),g)},l(A))}}])}(k.Component);wt(oF,"defaultProps",{onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}});function srt(n,t,i){return t=Cr(t),fc(n,zSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function zSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zSe=function(){return!!n})()}var art=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=srt(this,t,[].concat(l)),wt(i,"_child",k.createRef()),wt(i,"_measure",function(){var u=i.props,p=u.cache,g=u.columnIndex,_=g===void 0?0:g,y=u.parent,E=u.rowIndex,b=E===void 0?i.props.index||0:E,A=i._getCellMeasurements(),N=A.height,O=A.width;(N!==p.getHeight(b,_)||O!==p.getWidth(b,_))&&(p.set(b,_,O,N),y&&typeof y.recomputeGridSize=="function"&&y.recomputeGridSize({columnIndex:_,rowIndex:b}))}),wt(i,"_registerChild",function(u){u&&!(u instanceof Element)&&console.warn("CellMeasurer registerChild expects to be passed Element or null"),i._child.current=u,u&&i._maybeMeasureCell()}),i}return pc(t,n),ya(t,[{key:"componentDidMount",value:function(){this._maybeMeasureCell()}},{key:"componentDidUpdate",value:function(){this._maybeMeasureCell()}},{key:"render",value:function(){var s=this,l=this.props.children,d=typeof l=="function"?l({measure:this._measure,registerChild:this._registerChild}):l;return d===null?d:k.cloneElement(d,{ref:function(p){typeof d.ref=="function"?d.ref(p):d.ref&&(d.ref.current=p),s._child.current=p}})}},{key:"_getCellMeasurements",value:function(){var s=this.props.cache,l=this._child.current;if(l&&l.ownerDocument&&l.ownerDocument.defaultView&&l instanceof l.ownerDocument.defaultView.HTMLElement){var d=l.style.width,u=l.style.height;s.hasFixedWidth()||(l.style.width="auto"),s.hasFixedHeight()||(l.style.height="auto");var p=Math.ceil(l.offsetHeight),g=Math.ceil(l.offsetWidth);return d&&(l.style.width=d),u&&(l.style.height=u),{height:p,width:g}}else return{height:0,width:0}}},{key:"_maybeMeasureCell",value:function(){var s=this.props,l=s.cache,d=s.columnIndex,u=d===void 0?0:d,p=s.parent,g=s.rowIndex,_=g===void 0?this.props.index||0:g;if(!l.has(_,u)){var y=this._getCellMeasurements(),E=y.height,b=y.width;l.set(_,u,b,E),p&&typeof p.invalidateCellSizeAfterRender=="function"&&p.invalidateCellSizeAfterRender({columnIndex:u,rowIndex:_})}}}])}(k.PureComponent);wt(art,"__internalCellMeasurerFlag",!1);function ort(n){if(n==null)throw new TypeError("Cannot destructure "+n)}function HSe(n){var t,i,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n))for(t=0;t<n.length;t++)n[t]&&(i=HSe(n[t]))&&(s&&(s+=" "),s+=i);else for(t in n)n[t]&&(s&&(s+=" "),s+=t);return s}function af(){for(var n,t,i=0,s="";i<arguments.length;)(n=arguments[i++])&&(t=HSe(n))&&(s&&(s+=" "),s+=t);return s}function UR(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t={};return function(i){var s=i.callback,l=i.indices,d=Object.keys(l),u=!n||d.every(function(g){var _=l[g];return Array.isArray(_)?_.length>0:_>=0}),p=d.length!==Object.keys(t).length||d.some(function(g){var _=t[g],y=l[g];return Array.isArray(y)?_.join(",")!==y.join(","):_!==y});t=l,u&&p&&s(l)}}function fpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function ppe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?fpe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):fpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function lrt(n,t,i){return t=Cr(t),fc(n,GSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function GSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GSe=function(){return!!n})()}var crt=150,Fb={OBSERVED:"observed",REQUESTED:"requested"},lF=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=lrt(this,t,[].concat(l)),wt(i,"state",{isScrolling:!1,scrollLeft:0,scrollTop:0}),wt(i,"_calculateSizeAndPositionDataOnNextUpdate",!1),wt(i,"_onSectionRenderedMemoizer",UR()),wt(i,"_onScrollMemoizer",UR(!1)),wt(i,"_invokeOnSectionRenderedHelper",function(){var u=i.props,p=u.cellLayoutManager,g=u.onSectionRendered;i._onSectionRenderedMemoizer({callback:g,indices:{indices:p.getLastRenderedIndices()}})}),wt(i,"_setScrollingContainerRef",function(u){i._scrollingContainer=u}),wt(i,"_updateScrollPositionForScrollToCell",function(){var u=i.props,p=u.cellLayoutManager,g=u.height,_=u.scrollToAlignment,y=u.scrollToCell,E=u.width,b=i.state,A=b.scrollLeft,N=b.scrollTop;if(y>=0){var O=p.getScrollPositionForCell({align:_,cellIndex:y,height:g,scrollLeft:A,scrollTop:N,width:E});(O.scrollLeft!==A||O.scrollTop!==N)&&i._setScrollPosition(O)}}),wt(i,"_onScroll",function(u){if(u.target===i._scrollingContainer){i._enablePointerEventsAfterDelay();var p=i.props,g=p.cellLayoutManager,_=p.height,y=p.isScrollingChange,E=p.width,b=i._scrollbarSize,A=g.getTotalSize(),N=A.height,O=A.width,D=Math.max(0,Math.min(O-E+b,u.target.scrollLeft)),P=Math.max(0,Math.min(N-_+b,u.target.scrollTop));if(i.state.scrollLeft!==D||i.state.scrollTop!==P){var j=u.cancelable?Fb.OBSERVED:Fb.REQUESTED;i.state.isScrolling||y(!0),i.setState({isScrolling:!0,scrollLeft:D,scrollPositionChangeReason:j,scrollTop:P})}i._invokeOnScrollMemoizer({scrollLeft:D,scrollTop:P,totalWidth:O,totalHeight:N})}}),i._scrollbarSize=G4(),i._scrollbarSize===void 0?(i._scrollbarSizeMeasured=!1,i._scrollbarSize=0):i._scrollbarSizeMeasured=!0,i}return pc(t,n),ya(t,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var s=this.props,l=s.cellLayoutManager,d=s.scrollLeft,u=s.scrollToCell,p=s.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=G4(),this._scrollbarSizeMeasured=!0,this.setState({})),u>=0?this._updateScrollPositionForScrollToCell():(d>=0||p>=0)&&this._setScrollPosition({scrollLeft:d,scrollTop:p}),this._invokeOnSectionRenderedHelper();var g=l.getTotalSize(),_=g.height,y=g.width;this._invokeOnScrollMemoizer({scrollLeft:d||0,scrollTop:p||0,totalHeight:_,totalWidth:y})}},{key:"componentDidUpdate",value:function(s,l){var d=this.props,u=d.height,p=d.scrollToAlignment,g=d.scrollToCell,_=d.width,y=this.state,E=y.scrollLeft,b=y.scrollPositionChangeReason,A=y.scrollTop;b===Fb.REQUESTED&&(E>=0&&E!==l.scrollLeft&&E!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=E),A>=0&&A!==l.scrollTop&&A!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=A)),(u!==s.height||p!==s.scrollToAlignment||g!==s.scrollToCell||_!==s.width)&&this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var s=this.props,l=s.autoHeight,d=s.cellCount,u=s.cellLayoutManager,p=s.className,g=s.height,_=s.horizontalOverscanSize,y=s.id,E=s.noContentRenderer,b=s.style,A=s.verticalOverscanSize,N=s.width,O=this.state,D=O.isScrolling,P=O.scrollLeft,j=O.scrollTop;(this._lastRenderedCellCount!==d||this._lastRenderedCellLayoutManager!==u||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=d,this._lastRenderedCellLayoutManager=u,this._calculateSizeAndPositionDataOnNextUpdate=!1,u.calculateSizeAndPositionData());var M=u.getTotalSize(),V=M.height,H=M.width,$=Math.max(0,P-_),Q=Math.max(0,j-A),Y=Math.min(H,P+N+_),le=Math.min(V,j+g+A),ae=g>0&&N>0?u.cellRenderers({height:le-Q,isScrolling:D,width:Y-$,x:$,y:Q}):[],te={boxSizing:"border-box",direction:"ltr",height:l?"auto":g,position:"relative",WebkitOverflowScrolling:"touch",width:N,willChange:"transform"},de=V>g?this._scrollbarSize:0,G=H>N?this._scrollbarSize:0;return te.overflowX=H+de<=N?"hidden":"auto",te.overflowY=V+G<=g?"hidden":"auto",k.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:af("ReactVirtualized__Collection",p),id:y,onScroll:this._onScroll,role:"grid",style:ppe(ppe({},te),b),tabIndex:0},d>0&&k.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:V,maxHeight:V,maxWidth:H,overflow:"hidden",pointerEvents:D?"none":"",width:H}},ae),d===0&&E())}},{key:"_enablePointerEventsAfterDelay",value:function(){var s=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout(function(){var l=s.props.isScrollingChange;l(!1),s._disablePointerEventsTimeoutId=null,s.setState({isScrolling:!1})},crt)}},{key:"_invokeOnScrollMemoizer",value:function(s){var l=this,d=s.scrollLeft,u=s.scrollTop,p=s.totalHeight,g=s.totalWidth;this._onScrollMemoizer({callback:function(y){var E=y.scrollLeft,b=y.scrollTop,A=l.props,N=A.height,O=A.onScroll,D=A.width;O({clientHeight:N,clientWidth:D,scrollHeight:p,scrollLeft:E,scrollTop:b,scrollWidth:g})},indices:{scrollLeft:d,scrollTop:u}})}},{key:"_setScrollPosition",value:function(s){var l=s.scrollLeft,d=s.scrollTop,u={scrollPositionChangeReason:Fb.REQUESTED};l>=0&&(u.scrollLeft=l),d>=0&&(u.scrollTop=d),(l>=0&&l!==this.state.scrollLeft||d>=0&&d!==this.state.scrollTop)&&this.setState(u)}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.cellCount===0&&(l.scrollLeft!==0||l.scrollTop!==0)?{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:Fb.REQUESTED}:s.scrollLeft!==l.scrollLeft||s.scrollTop!==l.scrollTop?{scrollLeft:s.scrollLeft!=null?s.scrollLeft:l.scrollLeft,scrollTop:s.scrollTop!=null?s.scrollTop:l.scrollTop,scrollPositionChangeReason:Fb.REQUESTED}:null}}])}(k.PureComponent);wt(lF,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0});lF.propTypes={};VO(lF);var drt=function(){function n(t){var i=t.height,s=t.width,l=t.x,d=t.y;va(this,n),this.height=i,this.width=s,this.x=l,this.y=d,this._indexMap={},this._indices=[]}return ya(n,[{key:"addCellIndex",value:function(i){var s=i.index;this._indexMap[s]||(this._indexMap[s]=!0,this._indices.push(s))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}])}(),urt=100,hrt=function(){function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:urt;va(this,n),this._sectionSize=t,this._cellMetadata=[],this._sections={}}return ya(n,[{key:"getCellIndices",value:function(i){var s=i.height,l=i.width,d=i.x,u=i.y,p={};return this.getSections({height:s,width:l,x:d,y:u}).forEach(function(g){return g.getCellIndices().forEach(function(_){p[_]=_})}),Object.keys(p).map(function(g){return p[g]})}},{key:"getCellMetadata",value:function(i){var s=i.index;return this._cellMetadata[s]}},{key:"getSections",value:function(i){for(var s=i.height,l=i.width,d=i.x,u=i.y,p=Math.floor(d/this._sectionSize),g=Math.floor((d+l-1)/this._sectionSize),_=Math.floor(u/this._sectionSize),y=Math.floor((u+s-1)/this._sectionSize),E=[],b=p;b<=g;b++)for(var A=_;A<=y;A++){var N="".concat(b,".").concat(A);this._sections[N]||(this._sections[N]=new drt({height:this._sectionSize,width:this._sectionSize,x:b*this._sectionSize,y:A*this._sectionSize})),E.push(this._sections[N])}return E}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var i=this;return Object.keys(this._sections).map(function(s){return i._sections[s].toString()})}},{key:"registerCell",value:function(i){var s=i.cellMetadatum,l=i.index;this._cellMetadata[l]=s,this.getSections(s).forEach(function(d){return d.addCellIndex({index:l})})}}])}();function frt(n){for(var t=n.cellCount,i=n.cellSizeAndPositionGetter,s=n.sectionSize,l=[],d=new hrt(s),u=0,p=0,g=0;g<t;g++){var _=i({index:g});if(_.height==null||isNaN(_.height)||_.width==null||isNaN(_.width)||_.x==null||isNaN(_.x)||_.y==null||isNaN(_.y))throw Error("Invalid metadata returned for cell ".concat(g,`:
x:`).concat(_.x,", y:").concat(_.y,", width:").concat(_.width,", height:").concat(_.height));u=Math.max(u,_.y+_.height),p=Math.max(p,_.x+_.width),l[g]=_,d.registerCell({cellMetadatum:_,index:g})}return{cellMetadata:l,height:u,sectionManager:d,width:p}}function mpe(n){var t=n.align,i=t===void 0?"auto":t,s=n.cellOffset,l=n.cellSize,d=n.containerSize,u=n.currentOffset,p=s,g=p-d+l;switch(i){case"start":return p;case"end":return g;case"center":return p-(d-l)/2;default:return Math.max(g,Math.min(p,u))}}function prt(n,t,i){return t=Cr(t),fc(n,WSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function WSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WSe=function(){return!!n})()}var $Se=function(n){function t(i,s){var l;return va(this,t),l=prt(this,t,[i,s]),l._cellMetadata=[],l._lastRenderedCellIndices=[],l._cellCache=[],l._isScrollingChange=l._isScrollingChange.bind(l),l._setCollectionViewRef=l._setCollectionViewRef.bind(l),l}return pc(t,n),ya(t,[{key:"forceUpdate",value:function(){this._collectionView!==void 0&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var s=$d({},(ort(this.props),this.props));return k.createElement(lF,$d({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},s))}},{key:"calculateSizeAndPositionData",value:function(){var s=this.props,l=s.cellCount,d=s.cellSizeAndPositionGetter,u=s.sectionSize,p=frt({cellCount:l,cellSizeAndPositionGetter:d,sectionSize:u});this._cellMetadata=p.cellMetadata,this._sectionManager=p.sectionManager,this._height=p.height,this._width=p.width}},{key:"getLastRenderedIndices",value:function(){return this._lastRenderedCellIndices}},{key:"getScrollPositionForCell",value:function(s){var l=s.align,d=s.cellIndex,u=s.height,p=s.scrollLeft,g=s.scrollTop,_=s.width,y=this.props.cellCount;if(d>=0&&d<y){var E=this._cellMetadata[d];p=mpe({align:l,cellOffset:E.x,cellSize:E.width,containerSize:_,currentOffset:p,targetIndex:d}),g=mpe({align:l,cellOffset:E.y,cellSize:E.height,containerSize:u,currentOffset:g,targetIndex:d})}return{scrollLeft:p,scrollTop:g}}},{key:"getTotalSize",value:function(){return{height:this._height,width:this._width}}},{key:"cellRenderers",value:function(s){var l=this,d=s.height,u=s.isScrolling,p=s.width,g=s.x,_=s.y,y=this.props,E=y.cellGroupRenderer,b=y.cellRenderer;return this._lastRenderedCellIndices=this._sectionManager.getCellIndices({height:d,width:p,x:g,y:_}),E({cellCache:this._cellCache,cellRenderer:b,cellSizeAndPositionGetter:function(N){var O=N.index;return l._sectionManager.getCellMetadata({index:O})},indices:this._lastRenderedCellIndices,isScrolling:u})}},{key:"_isScrollingChange",value:function(s){s||(this._cellCache=[])}},{key:"_setCollectionViewRef",value:function(s){this._collectionView=s}}])}(k.PureComponent);wt($Se,"defaultProps",{"aria-label":"grid",cellGroupRenderer:mrt});$Se.propTypes={};function mrt(n){var t=n.cellCache,i=n.cellRenderer,s=n.cellSizeAndPositionGetter,l=n.indices,d=n.isScrolling;return l.map(function(u){var p=s({index:u}),g={index:u,isScrolling:d,key:u,style:{height:p.height,left:p.x,position:"absolute",top:p.y,width:p.width}};return d?(u in t||(t[u]=i(g)),t[u]):i(g)}).filter(function(u){return!!u})}function grt(n,t,i){return t=Cr(t),fc(n,KSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function KSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KSe=function(){return!!n})()}var vrt=function(n){function t(i,s){var l;return va(this,t),l=grt(this,t,[i,s]),l._registerChild=l._registerChild.bind(l),l}return pc(t,n),ya(t,[{key:"componentDidUpdate",value:function(s){var l=this.props,d=l.columnMaxWidth,u=l.columnMinWidth,p=l.columnCount,g=l.width;(d!==s.columnMaxWidth||u!==s.columnMinWidth||p!==s.columnCount||g!==s.width)&&this._registeredChild&&this._registeredChild.recomputeGridSize()}},{key:"render",value:function(){var s=this.props,l=s.children,d=s.columnMaxWidth,u=s.columnMinWidth,p=s.columnCount,g=s.width,_=u||1,y=d?Math.min(d,g):g,E=g/p;E=Math.max(_,E),E=Math.min(y,E),E=Math.floor(E);var b=Math.min(g,E*p);return l({adjustedWidth:b,columnWidth:E,getColumnWidth:function(){return E},registerChild:this._registerChild})}},{key:"_registerChild",value:function(s){if(s&&typeof s.recomputeGridSize!="function")throw Error("Unexpected child type registered; only Grid/MultiGrid children are supported.");this._registeredChild=s,this._registeredChild&&this._registeredChild.recomputeGridSize()}}])}(k.PureComponent);vrt.propTypes={};function gpe(n){var t=n.cellCount,i=n.cellSize,s=n.computeMetadataCallback,l=n.computeMetadataCallbackProps,d=n.nextCellsCount,u=n.nextCellSize,p=n.nextScrollToIndex,g=n.scrollToIndex,_=n.updateScrollOffsetForScrollToIndex;(t!==d||(typeof i=="number"||typeof u=="number")&&i!==u)&&(s(l),g>=0&&g===p&&_())}function n4(n,t){if(n==null)return{};var i,s,l=cQ(n,t);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(n);for(s=0;s<d.length;s++)i=d[s],t.indexOf(i)===-1&&{}.propertyIsEnumerable.call(n,i)&&(l[i]=n[i])}return l}var yrt=function(){function n(t){var i=t.cellCount,s=t.cellSizeGetter,l=t.estimatedCellSize;va(this,n),wt(this,"_cellSizeAndPositionData",{}),wt(this,"_lastMeasuredIndex",-1),wt(this,"_lastBatchedIndex",-1),wt(this,"_cellCount",void 0),wt(this,"_cellSizeGetter",void 0),wt(this,"_estimatedCellSize",void 0),this._cellSizeGetter=s,this._cellCount=i,this._estimatedCellSize=l}return ya(n,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(i){var s=i.cellCount,l=i.estimatedCellSize,d=i.cellSizeGetter;this._cellCount=s,this._estimatedCellSize=l,this._cellSizeGetter=d}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(i){if(i<0||i>=this._cellCount)throw Error("Requested index ".concat(i," is outside of range 0..").concat(this._cellCount));if(i>this._lastMeasuredIndex)for(var s=this.getSizeAndPositionOfLastMeasuredCell(),l=s.offset+s.size,d=this._lastMeasuredIndex+1;d<=i;d++){var u=this._cellSizeGetter({index:d});if(u===void 0||isNaN(u))throw Error("Invalid size returned for cell ".concat(d," of value ").concat(u));u===null?(this._cellSizeAndPositionData[d]={offset:l,size:0},this._lastBatchedIndex=i):(this._cellSizeAndPositionData[d]={offset:l,size:u},l+=u,this._lastMeasuredIndex=i)}return this._cellSizeAndPositionData[i]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var i=this.getSizeAndPositionOfLastMeasuredCell(),s=i.offset+i.size,l=this._cellCount-this._lastMeasuredIndex-1,d=l*this._estimatedCellSize;return s+d}},{key:"getUpdatedOffsetForIndex",value:function(i){var s=i.align,l=s===void 0?"auto":s,d=i.containerSize,u=i.currentOffset,p=i.targetIndex;if(d<=0)return 0;var g=this.getSizeAndPositionOfCell(p),_=g.offset,y=_-d+g.size,E;switch(l){case"start":E=_;break;case"end":E=y;break;case"center":E=_-(d-g.size)/2;break;default:E=Math.max(y,Math.min(_,u));break}var b=this.getTotalSize();return Math.max(0,Math.min(b-d,E))}},{key:"getVisibleCellRange",value:function(i){var s=i.containerSize,l=i.offset,d=this.getTotalSize();if(d===0)return{};var u=l+s,p=this._findNearestCell(l),g=this.getSizeAndPositionOfCell(p);l=g.offset+g.size;for(var _=p;l<u&&_<this._cellCount-1;)_++,l+=this.getSizeAndPositionOfCell(_).size;return{start:p,stop:_}}},{key:"resetCell",value:function(i){this._lastMeasuredIndex=Math.min(this._lastMeasuredIndex,i-1)}},{key:"_binarySearch",value:function(i,s,l){for(;s<=i;){var d=s+Math.floor((i-s)/2),u=this.getSizeAndPositionOfCell(d).offset;if(u===l)return d;u<l?s=d+1:u>l&&(i=d-1)}return s>0?s-1:0}},{key:"_exponentialSearch",value:function(i,s){for(var l=1;i<this._cellCount&&this.getSizeAndPositionOfCell(i).offset<s;)i+=l,l*=2;return this._binarySearch(Math.min(i,this._cellCount-1),Math.floor(i/2),s)}},{key:"_findNearestCell",value:function(i){if(isNaN(i))throw Error("Invalid offset ".concat(i," specified"));i=Math.max(0,i);var s=this.getSizeAndPositionOfLastMeasuredCell(),l=Math.max(0,this._lastMeasuredIndex);return s.offset>=i?this._binarySearch(l,0,i):this._exponentialSearch(l,i)}}])}(),_rt=15e5,Ert=16777100,wrt=function(){return typeof window<"u"},Srt=function(){return!!window.chrome},brt=function(){return wrt()&&Srt()?Ert:_rt},Crt=["maxScrollSize"],vpe=function(){function n(t){var i=t.maxScrollSize,s=i===void 0?brt():i,l=n4(t,Crt);va(this,n),wt(this,"_cellSizeAndPositionManager",void 0),wt(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new yrt(l),this._maxScrollSize=s}return ya(n,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(i){this._cellSizeAndPositionManager.configure(i)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize(),p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:u});return Math.round(p*(u-d))}},{key:"getSizeAndPositionOfCell",value:function(i){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(i)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(i){var s=i.align,l=s===void 0?"auto":s,d=i.containerSize,u=i.currentOffset,p=i.targetIndex;u=this._safeOffsetToOffset({containerSize:d,offset:u});var g=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:l,containerSize:d,currentOffset:u,targetIndex:p});return this._offsetToSafeOffset({containerSize:d,offset:g})}},{key:"getVisibleCellRange",value:function(i){var s=i.containerSize,l=i.offset;return l=this._safeOffsetToOffset({containerSize:s,offset:l}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:s,offset:l})}},{key:"resetCell",value:function(i){this._cellSizeAndPositionManager.resetCell(i)}},{key:"_getOffsetPercentage",value:function(i){var s=i.containerSize,l=i.offset,d=i.totalSize;return d<=s?0:l/(d-s)}},{key:"_offsetToSafeOffset",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize();if(d===u)return l;var p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:d});return Math.round(p*(u-s))}},{key:"_safeOffsetToOffset",value:function(i){var s=i.containerSize,l=i.offset,d=this._cellSizeAndPositionManager.getTotalSize(),u=this.getTotalSize();if(d===u)return l;var p=this._getOffsetPercentage({containerSize:s,offset:l,totalSize:u});return Math.round(p*(d-s))}}])}(),Lk=-1,Pm=1;function Trt(n){var t=n.cellCount,i=n.overscanCellsCount,s=n.scrollDirection,l=n.startIndex,d=n.stopIndex;return s===Pm?{overscanStartIndex:Math.max(0,l),overscanStopIndex:Math.min(t-1,d+i)}:{overscanStartIndex:Math.max(0,l-i),overscanStopIndex:Math.min(t-1,d)}}function ype(n){var t=n.cellSize,i=n.cellSizeAndPositionManager,s=n.previousCellsCount,l=n.previousCellSize,d=n.previousScrollToAlignment,u=n.previousScrollToIndex,p=n.previousSize,g=n.scrollOffset,_=n.scrollToAlignment,y=n.scrollToIndex,E=n.size,b=n.sizeJustIncreasedFromZero,A=n.updateScrollIndexCallback,N=i.getCellCount(),O=y>=0&&y<N,D=E!==p||b||!l||typeof t=="number"&&t!==l;O&&(D||_!==d||y!==u)?A(y):!O&&N>0&&(E<p||N<s)&&g>i.getTotalSize()-E&&A(N-1)}function Rrt(n){for(var t=n.cellCache,i=n.cellRenderer,s=n.columnSizeAndPositionManager,l=n.columnStartIndex,d=n.columnStopIndex,u=n.deferredMeasurementCache,p=n.horizontalOffsetAdjustment,g=n.isScrolling,_=n.isScrollingOptOut,y=n.parent,E=n.rowSizeAndPositionManager,b=n.rowStartIndex,A=n.rowStopIndex,N=n.styleCache,O=n.verticalOffsetAdjustment,D=n.visibleColumnIndices,P=n.visibleRowIndices,j=[],M=s.areOffsetsAdjusted()||E.areOffsetsAdjusted(),V=!g&&!M,H=b;H<=A;H++)for(var $=E.getSizeAndPositionOfCell(H),Q=l;Q<=d;Q++){var Y=s.getSizeAndPositionOfCell(Q),le=Q>=D.start&&Q<=D.stop&&H>=P.start&&H<=P.stop,ae="".concat(H,"-").concat(Q),te=void 0;V&&N[ae]?te=N[ae]:u&&!u.has(H,Q)?te={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(te={height:$.size,left:Y.offset+p,position:"absolute",top:$.offset+O,width:Y.size},N[ae]=te);var de={columnIndex:Q,isScrolling:g,isVisible:le,key:ae,parent:y,rowIndex:H,style:te},G=void 0;(_||g)&&!p&&!O?(t[ae]||(t[ae]=i(de)),G=t[ae]):G=i(de),!(G==null||G===!1)&&(G.props.role||(G=dn.cloneElement(G,{role:"gridcell"})),j.push(G))}return j}var rc;typeof window<"u"?rc=window:typeof self<"u"?rc=self:rc={};var xrt=rc.requestAnimationFrame||rc.webkitRequestAnimationFrame||rc.mozRequestAnimationFrame||rc.oRequestAnimationFrame||rc.msRequestAnimationFrame||function(n){return rc.setTimeout(n,1e3/60)},Art=rc.cancelAnimationFrame||rc.webkitCancelAnimationFrame||rc.mozCancelAnimationFrame||rc.oCancelAnimationFrame||rc.msCancelAnimationFrame||function(n){rc.clearTimeout(n)},_pe=xrt,Irt=Art,FR=function(t){return Irt(t.id)},VZ=function(t,i){var s;Promise.resolve().then(function(){s=Date.now()});var l=function(){Date.now()-s>=i?t.call():d.id=_pe(l)},d={id:_pe(l)};return d};function Epe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Fc(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Epe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Epe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Nrt(n,t,i){return t=Cr(t),fc(n,qSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function qSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qSe=function(){return!!n})()}var Ort=150,_K={OBSERVED:"observed",REQUESTED:"requested"},Prt=function(){return null},gv=function(n){function t(i){var s;va(this,t),s=Nrt(this,t,[i]),wt(s,"_onGridRenderedMemoizer",UR()),wt(s,"_onScrollMemoizer",UR(!1)),wt(s,"_deferredInvalidateColumnIndex",null),wt(s,"_deferredInvalidateRowIndex",null),wt(s,"_recomputeScrollLeftFlag",!1),wt(s,"_recomputeScrollTopFlag",!1),wt(s,"_horizontalScrollBarSize",0),wt(s,"_verticalScrollBarSize",0),wt(s,"_scrollbarPresenceChanged",!1),wt(s,"_scrollingContainer",void 0),wt(s,"_childrenToDisplay",void 0),wt(s,"_columnStartIndex",void 0),wt(s,"_columnStopIndex",void 0),wt(s,"_rowStartIndex",void 0),wt(s,"_rowStopIndex",void 0),wt(s,"_renderedColumnStartIndex",0),wt(s,"_renderedColumnStopIndex",0),wt(s,"_renderedRowStartIndex",0),wt(s,"_renderedRowStopIndex",0),wt(s,"_initialScrollTop",void 0),wt(s,"_initialScrollLeft",void 0),wt(s,"_disablePointerEventsTimeoutId",void 0),wt(s,"_styleCache",{}),wt(s,"_cellCache",{}),wt(s,"_debounceScrollEndedCallback",function(){s._disablePointerEventsTimeoutId=null,s.setState({isScrolling:!1,needToResetStyleCache:!1})}),wt(s,"_invokeOnGridRenderedHelper",function(){var u=s.props.onSectionRendered;s._onGridRenderedMemoizer({callback:u,indices:{columnOverscanStartIndex:s._columnStartIndex,columnOverscanStopIndex:s._columnStopIndex,columnStartIndex:s._renderedColumnStartIndex,columnStopIndex:s._renderedColumnStopIndex,rowOverscanStartIndex:s._rowStartIndex,rowOverscanStopIndex:s._rowStopIndex,rowStartIndex:s._renderedRowStartIndex,rowStopIndex:s._renderedRowStopIndex}})}),wt(s,"_setScrollingContainerRef",function(u){s._scrollingContainer=u,typeof s.props.elementRef=="function"?s.props.elementRef(u):DE(s.props.elementRef)==="object"&&(s.props.elementRef.current=u)}),wt(s,"_onScroll",function(u){u.target===s._scrollingContainer&&s.handleScrollEvent(u.target)});var l=new vpe({cellCount:i.columnCount,cellSizeGetter:function(p){return t._wrapSizeGetter(i.columnWidth)(p)},estimatedCellSize:t._getEstimatedColumnSize(i)}),d=new vpe({cellCount:i.rowCount,cellSizeGetter:function(p){return t._wrapSizeGetter(i.rowHeight)(p)},estimatedCellSize:t._getEstimatedRowSize(i)});return s.state={instanceProps:{columnSizeAndPositionManager:l,rowSizeAndPositionManager:d,prevColumnWidth:i.columnWidth,prevRowHeight:i.rowHeight,prevColumnCount:i.columnCount,prevRowCount:i.rowCount,prevIsScrolling:i.isScrolling===!0,prevScrollToColumn:i.scrollToColumn,prevScrollToRow:i.scrollToRow,scrollbarSize:0,scrollbarSizeMeasured:!1},isScrolling:!1,scrollDirectionHorizontal:Pm,scrollDirectionVertical:Pm,scrollLeft:0,scrollTop:0,scrollPositionChangeReason:null,needToResetStyleCache:!1},i.scrollToRow>0&&(s._initialScrollTop=s._getCalculatedScrollTop(i,s.state)),i.scrollToColumn>0&&(s._initialScrollLeft=s._getCalculatedScrollLeft(i,s.state)),s}return pc(t,n),ya(t,[{key:"getOffsetForCell",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.alignment,d=l===void 0?this.props.scrollToAlignment:l,u=s.columnIndex,p=u===void 0?this.props.scrollToColumn:u,g=s.rowIndex,_=g===void 0?this.props.scrollToRow:g,y=Fc(Fc({},this.props),{},{scrollToAlignment:d,scrollToColumn:p,scrollToRow:_});return{scrollLeft:this._getCalculatedScrollLeft(y),scrollTop:this._getCalculatedScrollTop(y)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(s){var l=s.scrollLeft,d=l===void 0?0:l,u=s.scrollTop,p=u===void 0?0:u;if(!(p<0)){this._debounceScrollEnded();var g=this.props,_=g.autoHeight,y=g.autoWidth,E=g.height,b=g.width,A=this.state.instanceProps,N=A.scrollbarSize,O=A.rowSizeAndPositionManager.getTotalSize(),D=A.columnSizeAndPositionManager.getTotalSize(),P=Math.min(Math.max(0,D-b+N),d),j=Math.min(Math.max(0,O-E+N),p);if(this.state.scrollLeft!==P||this.state.scrollTop!==j){var M=P!==this.state.scrollLeft?P>this.state.scrollLeft?Pm:Lk:this.state.scrollDirectionHorizontal,V=j!==this.state.scrollTop?j>this.state.scrollTop?Pm:Lk:this.state.scrollDirectionVertical,H={isScrolling:!0,scrollDirectionHorizontal:M,scrollDirectionVertical:V,scrollPositionChangeReason:_K.OBSERVED};_||(H.scrollTop=j),y||(H.scrollLeft=P),H.needToResetStyleCache=!1,this.setState(H)}this._invokeOnScrollMemoizer({scrollLeft:P,scrollTop:j,totalColumnsWidth:D,totalRowsHeight:O})}}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,l):l,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,d):d}},{key:"measureAllCells",value:function(){var s=this.props,l=s.columnCount,d=s.rowCount,u=this.state.instanceProps;u.columnSizeAndPositionManager.getSizeAndPositionOfCell(l-1),u.rowSizeAndPositionManager.getSizeAndPositionOfCell(d-1)}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u,g=this.props,_=g.scrollToColumn,y=g.scrollToRow,E=this.state.instanceProps;E.columnSizeAndPositionManager.resetCell(d),E.rowSizeAndPositionManager.resetCell(p),this._recomputeScrollLeftFlag=_>=0&&(this.state.scrollDirectionHorizontal===Pm?d<=_:d>=_),this._recomputeScrollTopFlag=y>=0&&(this.state.scrollDirectionVertical===Pm?p<=y:p>=y),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(s){var l=s.columnIndex,d=s.rowIndex,u=this.props.columnCount,p=this.props;u>1&&l!==void 0&&this._updateScrollLeftForScrollToColumn(Fc(Fc({},p),{},{scrollToColumn:l})),d!==void 0&&this._updateScrollTopForScrollToRow(Fc(Fc({},p),{},{scrollToRow:d}))}},{key:"componentDidMount",value:function(){var s=this.props,l=s.getScrollbarSize,d=s.height,u=s.scrollLeft,p=s.scrollToColumn,g=s.scrollTop,_=s.scrollToRow,y=s.width,E=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),E.scrollbarSizeMeasured||this.setState(function(N){var O=Fc(Fc({},N),{},{needToResetStyleCache:!1});return O.instanceProps.scrollbarSize=l(),O.instanceProps.scrollbarSizeMeasured=!0,O}),typeof u=="number"&&u>=0||typeof g=="number"&&g>=0){var b=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:u,scrollTop:g});b&&(b.needToResetStyleCache=!1,this.setState(b))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var A=d>0&&y>0;p>=0&&A&&this._updateScrollLeftForScrollToColumn(),_>=0&&A&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:u||0,scrollTop:g||0,totalColumnsWidth:E.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:E.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(s,l){var d=this,u=this.props,p=u.autoHeight,g=u.autoWidth,_=u.columnCount,y=u.height,E=u.rowCount,b=u.scrollToAlignment,A=u.scrollToColumn,N=u.scrollToRow,O=u.width,D=this.state,P=D.scrollLeft,j=D.scrollPositionChangeReason,M=D.scrollTop,V=D.instanceProps;this._handleInvalidatedGridSize();var H=_>0&&s.columnCount===0||E>0&&s.rowCount===0;j===_K.REQUESTED&&(!g&&P>=0&&(P!==this._scrollingContainer.scrollLeft||H)&&(this._scrollingContainer.scrollLeft=P),!p&&M>=0&&(M!==this._scrollingContainer.scrollTop||H)&&(this._scrollingContainer.scrollTop=M));var $=(s.width===0||s.height===0)&&y>0&&O>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):ype({cellSizeAndPositionManager:V.columnSizeAndPositionManager,previousCellsCount:s.columnCount,previousCellSize:s.columnWidth,previousScrollToAlignment:s.scrollToAlignment,previousScrollToIndex:s.scrollToColumn,previousSize:s.width,scrollOffset:P,scrollToAlignment:b,scrollToIndex:A,size:O,sizeJustIncreasedFromZero:$,updateScrollIndexCallback:function(){return d._updateScrollLeftForScrollToColumn(d.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):ype({cellSizeAndPositionManager:V.rowSizeAndPositionManager,previousCellsCount:s.rowCount,previousCellSize:s.rowHeight,previousScrollToAlignment:s.scrollToAlignment,previousScrollToIndex:s.scrollToRow,previousSize:s.height,scrollOffset:M,scrollToAlignment:b,scrollToIndex:N,size:y,sizeJustIncreasedFromZero:$,updateScrollIndexCallback:function(){return d._updateScrollTopForScrollToRow(d.props)}}),this._invokeOnGridRenderedHelper(),P!==l.scrollLeft||M!==l.scrollTop){var Q=V.rowSizeAndPositionManager.getTotalSize(),Y=V.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:P,scrollTop:M,totalColumnsWidth:Y,totalRowsHeight:Q})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&FR(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var s=this.props,l=s.autoContainerWidth,d=s.autoHeight,u=s.autoWidth,p=s.className,g=s.containerProps,_=s.containerRole,y=s.containerStyle,E=s.height,b=s.id,A=s.noContentRenderer,N=s.role,O=s.style,D=s.tabIndex,P=s.width,j=this.state,M=j.instanceProps,V=j.needToResetStyleCache,H=this._isScrolling(),$={boxSizing:"border-box",direction:"ltr",height:d?"auto":E,position:"relative",width:u?"auto":P,WebkitOverflowScrolling:"touch",willChange:"transform"};V&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var Q=M.columnSizeAndPositionManager.getTotalSize(),Y=M.rowSizeAndPositionManager.getTotalSize(),le=Y>E?M.scrollbarSize:0,ae=Q>P?M.scrollbarSize:0;(ae!==this._horizontalScrollBarSize||le!==this._verticalScrollBarSize)&&(this._horizontalScrollBarSize=ae,this._verticalScrollBarSize=le,this._scrollbarPresenceChanged=!0),$.overflowX=Q+le<=P?"hidden":"auto",$.overflowY=Y+ae<=E?"hidden":"auto";var te=this._childrenToDisplay,de=te.length===0&&E>0&&P>0;return k.createElement("div",$d({ref:this._setScrollingContainerRef},g,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:af("ReactVirtualized__Grid",p),id:b,onScroll:this._onScroll,role:N,style:Fc(Fc({},$),O),tabIndex:D}),te.length>0&&k.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:_,style:Fc({width:l?"auto":Q,height:Y,maxWidth:Q,maxHeight:Y,overflow:"hidden",pointerEvents:H?"none":"",position:"relative"},y)},te),de&&A())}},{key:"_calculateChildrenToRender",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=s.cellRenderer,u=s.cellRangeRenderer,p=s.columnCount,g=s.deferredMeasurementCache,_=s.height,y=s.overscanColumnCount,E=s.overscanIndicesGetter,b=s.overscanRowCount,A=s.rowCount,N=s.width,O=s.isScrollingOptOut,D=l.scrollDirectionHorizontal,P=l.scrollDirectionVertical,j=l.instanceProps,M=this._initialScrollTop>0?this._initialScrollTop:l.scrollTop,V=this._initialScrollLeft>0?this._initialScrollLeft:l.scrollLeft,H=this._isScrolling(s,l);if(this._childrenToDisplay=[],_>0&&N>0){var $=j.columnSizeAndPositionManager.getVisibleCellRange({containerSize:N,offset:V}),Q=j.rowSizeAndPositionManager.getVisibleCellRange({containerSize:_,offset:M}),Y=j.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:N,offset:V}),le=j.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:_,offset:M});this._renderedColumnStartIndex=$.start,this._renderedColumnStopIndex=$.stop,this._renderedRowStartIndex=Q.start,this._renderedRowStopIndex=Q.stop;var ae=E({direction:"horizontal",cellCount:p,overscanCellsCount:y,scrollDirection:D,startIndex:typeof $.start=="number"?$.start:0,stopIndex:typeof $.stop=="number"?$.stop:-1}),te=E({direction:"vertical",cellCount:A,overscanCellsCount:b,scrollDirection:P,startIndex:typeof Q.start=="number"?Q.start:0,stopIndex:typeof Q.stop=="number"?Q.stop:-1}),de=ae.overscanStartIndex,G=ae.overscanStopIndex,ie=te.overscanStartIndex,_e=te.overscanStopIndex;if(g){if(!g.hasFixedHeight()){for(var he=ie;he<=_e;he++)if(!g.has(he,0)){de=0,G=p-1;break}}if(!g.hasFixedWidth()){for(var Ce=de;Ce<=G;Ce++)if(!g.has(0,Ce)){ie=0,_e=A-1;break}}}this._childrenToDisplay=u({cellCache:this._cellCache,cellRenderer:d,columnSizeAndPositionManager:j.columnSizeAndPositionManager,columnStartIndex:de,columnStopIndex:G,deferredMeasurementCache:g,horizontalOffsetAdjustment:Y,isScrolling:H,isScrollingOptOut:O,parent:this,rowSizeAndPositionManager:j.rowSizeAndPositionManager,rowStartIndex:ie,rowStopIndex:_e,scrollLeft:V,scrollTop:M,styleCache:this._styleCache,verticalOffsetAdjustment:le,visibleColumnIndices:$,visibleRowIndices:Q}),this._columnStartIndex=de,this._columnStopIndex=G,this._rowStartIndex=ie,this._rowStopIndex=_e}}},{key:"_debounceScrollEnded",value:function(){var s=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&FR(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=VZ(this._debounceScrollEndedCallback,s)}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"&&typeof this._deferredInvalidateRowIndex=="number"){var s=this._deferredInvalidateColumnIndex,l=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:s,rowIndex:l})}}},{key:"_invokeOnScrollMemoizer",value:function(s){var l=this,d=s.scrollLeft,u=s.scrollTop,p=s.totalColumnsWidth,g=s.totalRowsHeight;this._onScrollMemoizer({callback:function(y){var E=y.scrollLeft,b=y.scrollTop,A=l.props,N=A.height,O=A.onScroll,D=A.width;O({clientHeight:N,clientWidth:D,scrollHeight:g,scrollLeft:E,scrollTop:b,scrollWidth:p})},indices:{scrollLeft:d,scrollTop:u}})}},{key:"_isScrolling",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return Object.hasOwnProperty.call(s,"isScrolling")?!!s.isScrolling:!!l.isScrolling}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var s=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,s({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(s){var l=s.scrollLeft,d=s.scrollTop,u=t._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:l,scrollTop:d});u&&(u.needToResetStyleCache=!1,this.setState(u))}},{key:"_getCalculatedScrollLeft",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return t._getCalculatedScrollLeft(s,l)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=t._getScrollLeftForScrollToColumnStateUpdate(s,l);d&&(d.needToResetStyleCache=!1,this.setState(d))}},{key:"_getCalculatedScrollTop",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state;return t._getCalculatedScrollTop(s,l)}},{key:"_resetStyleCache",value:function(){var s=this._styleCache,l=this._cellCache,d=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var u=this._rowStartIndex;u<=this._rowStopIndex;u++)for(var p=this._columnStartIndex;p<=this._columnStopIndex;p++){var g="".concat(u,"-").concat(p);this._styleCache[g]=s[g],d&&(this._cellCache[g]=l[g])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.state,d=t._getScrollTopForScrollToRowStateUpdate(s,l);d&&(d.needToResetStyleCache=!1,this.setState(d))}}],[{key:"getDerivedStateFromProps",value:function(s,l){var d={};s.columnCount===0&&l.scrollLeft!==0||s.rowCount===0&&l.scrollTop!==0?(d.scrollLeft=0,d.scrollTop=0):(s.scrollLeft!==l.scrollLeft&&s.scrollToColumn<0||s.scrollTop!==l.scrollTop&&s.scrollToRow<0)&&Object.assign(d,t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}));var u=l.instanceProps;d.needToResetStyleCache=!1,(s.columnWidth!==u.prevColumnWidth||s.rowHeight!==u.prevRowHeight)&&(d.needToResetStyleCache=!0),u.columnSizeAndPositionManager.configure({cellCount:s.columnCount,estimatedCellSize:t._getEstimatedColumnSize(s),cellSizeGetter:t._wrapSizeGetter(s.columnWidth)}),u.rowSizeAndPositionManager.configure({cellCount:s.rowCount,estimatedCellSize:t._getEstimatedRowSize(s),cellSizeGetter:t._wrapSizeGetter(s.rowHeight)}),(u.prevColumnCount===0||u.prevRowCount===0)&&(u.prevColumnCount=0,u.prevRowCount=0),s.autoHeight&&s.isScrolling===!1&&u.prevIsScrolling===!0&&Object.assign(d,{isScrolling:!1});var p,g;return gpe({cellCount:u.prevColumnCount,cellSize:typeof u.prevColumnWidth=="number"?u.prevColumnWidth:null,computeMetadataCallback:function(){return u.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:s,nextCellsCount:s.columnCount,nextCellSize:typeof s.columnWidth=="number"?s.columnWidth:null,nextScrollToIndex:s.scrollToColumn,scrollToIndex:u.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){p=t._getScrollLeftForScrollToColumnStateUpdate(s,l)}}),gpe({cellCount:u.prevRowCount,cellSize:typeof u.prevRowHeight=="number"?u.prevRowHeight:null,computeMetadataCallback:function(){return u.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:s,nextCellsCount:s.rowCount,nextCellSize:typeof s.rowHeight=="number"?s.rowHeight:null,nextScrollToIndex:s.scrollToRow,scrollToIndex:u.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){g=t._getScrollTopForScrollToRowStateUpdate(s,l)}}),u.prevColumnCount=s.columnCount,u.prevColumnWidth=s.columnWidth,u.prevIsScrolling=s.isScrolling===!0,u.prevRowCount=s.rowCount,u.prevRowHeight=s.rowHeight,u.prevScrollToColumn=s.scrollToColumn,u.prevScrollToRow=s.scrollToRow,u.scrollbarSize=s.getScrollbarSize(),u.scrollbarSize===void 0?(u.scrollbarSizeMeasured=!1,u.scrollbarSize=0):u.scrollbarSizeMeasured=!0,d.instanceProps=u,Fc(Fc(Fc({},d),p),g)}},{key:"_getEstimatedColumnSize",value:function(s){return typeof s.columnWidth=="number"?s.columnWidth:s.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(s){return typeof s.rowHeight=="number"?s.rowHeight:s.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(s){var l=s.prevState,d=s.scrollLeft,u=s.scrollTop,p={scrollPositionChangeReason:_K.REQUESTED};return typeof d=="number"&&d>=0&&(p.scrollDirectionHorizontal=d>l.scrollLeft?Pm:Lk,p.scrollLeft=d),typeof u=="number"&&u>=0&&(p.scrollDirectionVertical=u>l.scrollTop?Pm:Lk,p.scrollTop=u),typeof d=="number"&&d>=0&&d!==l.scrollLeft||typeof u=="number"&&u>=0&&u!==l.scrollTop?p:{}}},{key:"_wrapSizeGetter",value:function(s){return typeof s=="function"?s:function(){return s}}},{key:"_getCalculatedScrollLeft",value:function(s,l){var d=s.columnCount,u=s.height,p=s.scrollToAlignment,g=s.scrollToColumn,_=s.width,y=l.scrollLeft,E=l.instanceProps;if(d>0){var b=d-1,A=g<0?b:Math.min(b,g),N=E.rowSizeAndPositionManager.getTotalSize(),O=E.scrollbarSizeMeasured&&N>u?E.scrollbarSize:0;return E.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:p,containerSize:_-O,currentOffset:y,targetIndex:A})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(s,l){var d=l.scrollLeft,u=t._getCalculatedScrollLeft(s,l);return typeof u=="number"&&u>=0&&d!==u?t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:u,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(s,l){var d=s.height,u=s.rowCount,p=s.scrollToAlignment,g=s.scrollToRow,_=s.width,y=l.scrollTop,E=l.instanceProps;if(u>0){var b=u-1,A=g<0?b:Math.min(b,g),N=E.columnSizeAndPositionManager.getTotalSize(),O=E.scrollbarSizeMeasured&&N>_?E.scrollbarSize:0;return E.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:p,containerSize:d-O,currentOffset:y,targetIndex:A})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(s,l){var d=l.scrollTop,u=t._getCalculatedScrollTop(s,l);return typeof u=="number"&&u>=0&&d!==u?t._getScrollToPositionStateUpdate({prevState:l,scrollLeft:-1,scrollTop:u}):{}}}])}(k.PureComponent);wt(gv,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:Rrt,containerRole:"row",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:G4,noContentRenderer:Prt,onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:Trt,overscanRowCount:10,role:"grid",scrollingResetTimeInterval:Ort,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1});VO(gv);var Lrt=1;function YSe(n){var t=n.cellCount,i=n.overscanCellsCount,s=n.scrollDirection,l=n.startIndex,d=n.stopIndex;return i=Math.max(1,i),s===Lrt?{overscanStartIndex:Math.max(0,l-1),overscanStopIndex:Math.min(t-1,d+i)}:{overscanStartIndex:Math.max(0,l-i),overscanStopIndex:Math.min(t-1,d+1)}}function GX(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,s=Array(t);i<t;i++)s[i]=n[i];return s}function Drt(n){if(Array.isArray(n))return GX(n)}function krt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function XSe(n,t){if(n){if(typeof n=="string")return GX(n,t);var i={}.toString.call(n).slice(8,-1);return i==="Object"&&n.constructor&&(i=n.constructor.name),i==="Map"||i==="Set"?Array.from(n):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?GX(n,t):void 0}}function Mrt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jrt(n){return Drt(n)||krt(n)||XSe(n)||Mrt()}function Urt(n,t,i){return t=Cr(t),fc(n,JSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function JSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JSe=function(){return!!n})()}var QSe=function(n){function t(i,s){var l;return va(this,t),l=Urt(this,t,[i,s]),l._loadMoreRowsMemoizer=UR(),l._onRowsRendered=l._onRowsRendered.bind(l),l._registerChild=l._registerChild.bind(l),l}return pc(t,n),ya(t,[{key:"resetLoadMoreRowsCache",value:function(s){this._loadMoreRowsMemoizer=UR(),s&&this._doStuff(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"render",value:function(){var s=this.props.children;return s({onRowsRendered:this._onRowsRendered,registerChild:this._registerChild})}},{key:"_loadUnloadedRanges",value:function(s){var l=this,d=this.props.loadMoreRows;s.forEach(function(u){var p=d(u);p&&p.then(function(){Frt({lastRenderedStartIndex:l._lastRenderedStartIndex,lastRenderedStopIndex:l._lastRenderedStopIndex,startIndex:u.startIndex,stopIndex:u.stopIndex})&&l._registeredChild&&Vrt(l._registeredChild,l._lastRenderedStartIndex)})})}},{key:"_onRowsRendered",value:function(s){var l=s.startIndex,d=s.stopIndex;this._lastRenderedStartIndex=l,this._lastRenderedStopIndex=d,this._doStuff(l,d)}},{key:"_doStuff",value:function(s,l){var d,u=this,p=this.props,g=p.isRowLoaded,_=p.minimumBatchSize,y=p.rowCount,E=p.threshold,b=Brt({isRowLoaded:g,minimumBatchSize:_,rowCount:y,startIndex:Math.max(0,s-E),stopIndex:Math.min(y-1,l+E)}),A=(d=[]).concat.apply(d,jrt(b.map(function(N){var O=N.startIndex,D=N.stopIndex;return[O,D]})));this._loadMoreRowsMemoizer({callback:function(){u._loadUnloadedRanges(b)},indices:{squashedUnloadedRanges:A}})}},{key:"_registerChild",value:function(s){this._registeredChild=s}}])}(k.PureComponent);wt(QSe,"defaultProps",{minimumBatchSize:10,rowCount:0,threshold:15});QSe.propTypes={};function Frt(n){var t=n.lastRenderedStartIndex,i=n.lastRenderedStopIndex,s=n.startIndex,l=n.stopIndex;return!(s>i||l<t)}function Brt(n){for(var t=n.isRowLoaded,i=n.minimumBatchSize,s=n.rowCount,l=n.startIndex,d=n.stopIndex,u=[],p=null,g=null,_=l;_<=d;_++){var y=t({index:_});y?g!==null&&(u.push({startIndex:p,stopIndex:g}),p=g=null):(g=_,p===null&&(p=_))}if(g!==null){for(var E=Math.min(Math.max(g,p+i-1),s-1),b=g+1;b<=E&&!t({index:b});b++)g=b;u.push({startIndex:p,stopIndex:g})}if(u.length)for(var A=u[0];A.stopIndex-A.startIndex+1<i&&A.startIndex>0;){var N=A.startIndex-1;if(!t({index:N}))A.startIndex=N;else break}return u}function Vrt(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=typeof n.recomputeGridSize=="function"?n.recomputeGridSize:n.recomputeRowHeights;i?i.call(n,t):n.forceUpdate()}function zrt(n,t,i){return t=Cr(t),fc(n,ZSe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function ZSe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZSe=function(){return!!n})()}var cF=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=zrt(this,t,[].concat(l)),wt(i,"Grid",void 0),wt(i,"_cellRenderer",function(u){var p=u.parent,g=u.rowIndex,_=u.style,y=u.isScrolling,E=u.isVisible,b=u.key,A=i.props.rowRenderer,N=Object.getOwnPropertyDescriptor(_,"width");return N&&N.writable&&(_.width="100%"),A({index:g,style:_,isScrolling:y,isVisible:E,key:b,parent:p})}),wt(i,"_setRef",function(u){i.Grid=u}),wt(i,"_onScroll",function(u){var p=u.clientHeight,g=u.scrollHeight,_=u.scrollTop,y=i.props.onScroll;y({clientHeight:p,scrollHeight:g,scrollTop:_})}),wt(i,"_onSectionRendered",function(u){var p=u.rowOverscanStartIndex,g=u.rowOverscanStopIndex,_=u.rowStartIndex,y=u.rowStopIndex,E=i.props.onRowsRendered;E({overscanStartIndex:p,overscanStopIndex:g,startIndex:_,stopIndex:y})}),i}return pc(t,n),ya(t,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(s){var l=s.alignment,d=s.index;if(this.Grid){var u=this.Grid.getOffsetForCell({alignment:l,rowIndex:d,columnIndex:0}),p=u.scrollTop;return p}return 0}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:d,columnIndex:l})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this.Grid&&this.Grid.recomputeGridSize({rowIndex:p,columnIndex:d})}},{key:"recomputeRowHeights",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:s,columnIndex:0})}},{key:"scrollToPosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:s})}},{key:"scrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:s})}},{key:"render",value:function(){var s=this.props,l=s.className,d=s.noRowsRenderer,u=s.scrollToIndex,p=s.width,g=af("ReactVirtualized__List",l);return k.createElement(gv,$d({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:g,columnWidth:p,columnCount:1,noContentRenderer:d,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:u}))}}])}(k.PureComponent);wt(cF,"defaultProps",{autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:YSe,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}});function Hrt(n){if(Array.isArray(n))return n}function Grt(n,t){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,l,d,u,p=[],g=!0,_=!1;try{if(d=(i=i.call(n)).next,t===0){if(Object(i)!==i)return;g=!1}else for(;!(g=(s=d.call(i)).done)&&(p.push(s.value),p.length!==t);g=!0);}catch(y){_=!0,l=y}finally{try{if(!g&&i.return!=null&&(u=i.return(),Object(u)!==u))return}finally{if(_)throw l}}return p}}function Wrt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $rt(n,t){return Hrt(n)||Grt(n,t)||XSe(n,t)||Wrt()}function Krt(n,t,i,s){for(var l=i+1;t<=i;){var d=t+i>>>1,u=n[d];u>=s?(l=d,i=d-1):t=d+1}return l}function qrt(n,t,i,s,l){for(var d=i+1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)>=0?(d=u,i=u-1):t=u+1}return d}function Yrt(n,t,i,s,l){return typeof i=="function"?qrt(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):Krt(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function Xrt(n,t,i,s){for(var l=i+1;t<=i;){var d=t+i>>>1,u=n[d];u>s?(l=d,i=d-1):t=d+1}return l}function Jrt(n,t,i,s,l){for(var d=i+1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)>0?(d=u,i=u-1):t=u+1}return d}function Qrt(n,t,i,s,l){return typeof i=="function"?Jrt(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):Xrt(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function Zrt(n,t,i,s){for(var l=t-1;t<=i;){var d=t+i>>>1,u=n[d];u<s?(l=d,t=d+1):i=d-1}return l}function est(n,t,i,s,l){for(var d=t-1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)<0?(d=u,t=u+1):i=u-1}return d}function tst(n,t,i,s,l){return typeof i=="function"?est(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):Zrt(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function nst(n,t,i,s){for(var l=t-1;t<=i;){var d=t+i>>>1,u=n[d];u<=s?(l=d,t=d+1):i=d-1}return l}function ist(n,t,i,s,l){for(var d=t-1;t<=i;){var u=t+i>>>1,p=n[u];l(p,s)<=0?(d=u,t=u+1):i=u-1}return d}function rst(n,t,i,s,l){return typeof i=="function"?ist(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):nst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}function sst(n,t,i,s){for(;t<=i;){var l=t+i>>>1,d=n[l];if(d===s)return l;d<=s?t=l+1:i=l-1}return-1}function ast(n,t,i,s,l){for(;t<=i;){var d=t+i>>>1,u=n[d],p=l(u,s);if(p===0)return d;p<=0?t=d+1:i=d-1}return-1}function ost(n,t,i,s,l){return typeof i=="function"?ast(n,s===void 0?0:s|0,l===void 0?n.length-1:l|0,t,i):sst(n,i===void 0?0:i|0,s===void 0?n.length-1:s|0,t)}const z7={ge:Yrt,gt:Qrt,lt:tst,le:rst,eq:ost};var fC=0,C_=1,MM=2;function zZ(n,t,i,s,l){this.mid=n,this.left=t,this.right=i,this.leftPoints=s,this.rightPoints=l,this.count=(t?t.count:0)+(i?i.count:0)+s.length}var dP=zZ.prototype;function EK(n,t){n.mid=t.mid,n.left=t.left,n.right=t.right,n.leftPoints=t.leftPoints,n.rightPoints=t.rightPoints,n.count=t.count}function ebe(n,t){var i=BR(t);n.mid=i.mid,n.left=i.left,n.right=i.right,n.leftPoints=i.leftPoints,n.rightPoints=i.rightPoints,n.count=i.count}function wpe(n,t){var i=n.intervals([]);i.push(t),ebe(n,i)}function Spe(n,t){var i=n.intervals([]),s=i.indexOf(t);return s<0?fC:(i.splice(s,1),ebe(n,i),C_)}dP.intervals=function(n){return n.push.apply(n,this.leftPoints),this.left&&this.left.intervals(n),this.right&&this.right.intervals(n),n};dP.insert=function(n){var t=this.count-this.leftPoints.length;if(this.count+=1,n[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?wpe(this,n):this.left.insert(n):this.left=BR([n]);else if(n[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?wpe(this,n):this.right.insert(n):this.right=BR([n]);else{var i=z7.ge(this.leftPoints,n,HZ),s=z7.ge(this.rightPoints,n,GZ);this.leftPoints.splice(i,0,n),this.rightPoints.splice(s,0,n)}};dP.remove=function(n){var t=this.count-this.leftPoints;if(n[1]<this.mid){if(!this.left)return fC;var i=this.right?this.right.count:0;if(4*i>3*(t-1))return Spe(this,n);var s=this.left.remove(n);return s===MM?(this.left=null,this.count-=1,C_):(s===C_&&(this.count-=1),s)}else if(n[0]>this.mid){if(!this.right)return fC;var l=this.left?this.left.count:0;if(4*l>3*(t-1))return Spe(this,n);var s=this.right.remove(n);return s===MM?(this.right=null,this.count-=1,C_):(s===C_&&(this.count-=1),s)}else{if(this.count===1)return this.leftPoints[0]===n?MM:fC;if(this.leftPoints.length===1&&this.leftPoints[0]===n){if(this.left&&this.right){for(var d=this,u=this.left;u.right;)d=u,u=u.right;if(d===this)u.right=this.right;else{var p=this.left,s=this.right;d.count-=u.count,d.right=u.left,u.left=p,u.right=s}EK(this,u),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?EK(this,this.left):EK(this,this.right);return C_}for(var p=z7.ge(this.leftPoints,n,HZ);p<this.leftPoints.length&&this.leftPoints[p][0]===n[0];++p)if(this.leftPoints[p]===n){this.count-=1,this.leftPoints.splice(p,1);for(var s=z7.ge(this.rightPoints,n,GZ);s<this.rightPoints.length&&this.rightPoints[s][1]===n[1];++s)if(this.rightPoints[s]===n)return this.rightPoints.splice(s,1),C_}return fC}};function tbe(n,t,i){for(var s=0;s<n.length&&n[s][0]<=t;++s){var l=i(n[s]);if(l)return l}}function nbe(n,t,i){for(var s=n.length-1;s>=0&&n[s][1]>=t;--s){var l=i(n[s]);if(l)return l}}function ibe(n,t){for(var i=0;i<n.length;++i){var s=t(n[i]);if(s)return s}}dP.queryPoint=function(n,t){if(n<this.mid){if(this.left){var i=this.left.queryPoint(n,t);if(i)return i}return tbe(this.leftPoints,n,t)}else if(n>this.mid){if(this.right){var i=this.right.queryPoint(n,t);if(i)return i}return nbe(this.rightPoints,n,t)}else return ibe(this.leftPoints,t)};dP.queryInterval=function(n,t,i){if(n<this.mid&&this.left){var s=this.left.queryInterval(n,t,i);if(s)return s}if(t>this.mid&&this.right){var s=this.right.queryInterval(n,t,i);if(s)return s}return t<this.mid?tbe(this.leftPoints,t,i):n>this.mid?nbe(this.rightPoints,n,i):ibe(this.leftPoints,i)};function lst(n,t){return n-t}function HZ(n,t){var i=n[0]-t[0];return i||n[1]-t[1]}function GZ(n,t){var i=n[1]-t[1];return i||n[0]-t[0]}function BR(n){if(n.length===0)return null;for(var t=[],i=0;i<n.length;++i)t.push(n[i][0],n[i][1]);t.sort(lst);for(var s=t[t.length>>1],l=[],d=[],u=[],i=0;i<n.length;++i){var p=n[i];p[1]<s?l.push(p):s<p[0]?d.push(p):u.push(p)}var g=u,_=u.slice();return g.sort(HZ),_.sort(GZ),new zZ(s,BR(l),BR(d),g,_)}function WX(n){this.root=n}var rx=WX.prototype;rx.insert=function(n){this.root?this.root.insert(n):this.root=new zZ(n[0],null,null,[n],[n])};rx.remove=function(n){if(this.root){var t=this.root.remove(n);return t===MM&&(this.root=null),t!==fC}return!1};rx.queryPoint=function(n,t){if(this.root)return this.root.queryPoint(n,t)};rx.queryInterval=function(n,t,i){if(n<=t&&this.root)return this.root.queryInterval(n,t,i)};Object.defineProperty(rx,"count",{get:function(){return this.root?this.root.count:0}});Object.defineProperty(rx,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});function cst(n){return!n||n.length===0?new WX(null):new WX(BR(n))}var wK=function(){function n(){va(this,n),wt(this,"_columnSizeMap",{}),wt(this,"_intervalTree",cst()),wt(this,"_leftMap",{})}return ya(n,[{key:"estimateTotalHeight",value:function(i,s,l){var d=i-this.count;return this.tallestColumnSize+Math.ceil(d/s)*l}},{key:"range",value:function(i,s,l){var d=this;this._intervalTree.queryInterval(i,i+s,function(u){var p=$rt(u,3),g=p[0];p[1];var _=p[2];return l(_,d._leftMap[_],g)})}},{key:"setPosition",value:function(i,s,l,d){this._intervalTree.insert([l,l+d,i]),this._leftMap[i]=s;var u=this._columnSizeMap,p=u[s];p===void 0?u[s]=l+d:u[s]=Math.max(p,l+d)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var i=this._columnSizeMap,s=0;for(var l in i){var d=i[l];s=s===0?d:Math.min(s,d)}return s}},{key:"tallestColumnSize",get:function(){var i=this._columnSizeMap,s=0;for(var l in i){var d=i[l];s=Math.max(s,d)}return s}}])}();function bpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function dst(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?bpe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):bpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function ust(n,t,i){return t=Cr(t),fc(n,rbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function rbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rbe=function(){return!!n})()}var hst={},fst=150,sbe=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=ust(this,t,[].concat(l)),wt(i,"state",{isScrolling:!1,scrollTop:0}),wt(i,"_debounceResetIsScrollingId",void 0),wt(i,"_invalidateOnUpdateStartIndex",null),wt(i,"_invalidateOnUpdateStopIndex",null),wt(i,"_positionCache",new wK),wt(i,"_startIndex",null),wt(i,"_startIndexMemoized",null),wt(i,"_stopIndex",null),wt(i,"_stopIndexMemoized",null),wt(i,"_debounceResetIsScrollingCallback",function(){i.setState({isScrolling:!1})}),wt(i,"_setScrollingContainerRef",function(u){i._scrollingContainer=u}),wt(i,"_onScroll",function(u){var p=i.props.height,g=u.currentTarget.scrollTop,_=Math.min(Math.max(0,i._getEstimatedTotalHeight()-p),g);g===_&&(i._debounceResetIsScrolling(),i.state.scrollTop!==_&&i.setState({isScrolling:!0,scrollTop:_}))}),i}return pc(t,n),ya(t,[{key:"clearCellPositions",value:function(){this._positionCache=new wK,this.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.rowIndex;this._invalidateOnUpdateStartIndex===null?(this._invalidateOnUpdateStartIndex=l,this._invalidateOnUpdateStopIndex=l):(this._invalidateOnUpdateStartIndex=Math.min(this._invalidateOnUpdateStartIndex,l),this._invalidateOnUpdateStopIndex=Math.max(this._invalidateOnUpdateStopIndex,l))}},{key:"recomputeCellPositions",value:function(){var s=this._positionCache.count-1;this._positionCache=new wK,this._populatePositionCache(0,s),this.forceUpdate()}},{key:"componentDidMount",value:function(){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback()}},{key:"componentDidUpdate",value:function(s,l){this._checkInvalidateOnUpdate(),this._invokeOnScrollCallback(),this._invokeOnCellsRenderedCallback(),this.props.scrollTop!==s.scrollTop&&this._debounceResetIsScrolling()}},{key:"componentWillUnmount",value:function(){this._debounceResetIsScrollingId&&FR(this._debounceResetIsScrollingId)}},{key:"render",value:function(){var s=this,l=this.props,d=l.autoHeight,u=l.cellCount,p=l.cellMeasurerCache,g=l.cellRenderer,_=l.className,y=l.height,E=l.id,b=l.keyMapper,A=l.overscanByPixels,N=l.role,O=l.style,D=l.tabIndex,P=l.width,j=l.rowDirection,M=this.state,V=M.isScrolling,H=M.scrollTop,$=[],Q=this._getEstimatedTotalHeight(),Y=this._positionCache.shortestColumnSize,le=this._positionCache.count,ae=0,te;if(this._positionCache.range(Math.max(0,H-A),y+A*2,function(ie,_e,he){typeof te>"u"?(ae=ie,te=ie):(ae=Math.min(ae,ie),te=Math.max(te,ie)),$.push(g({index:ie,isScrolling:V,key:b(ie),parent:s,style:wt(wt(wt(wt({height:p.getHeight(ie)},j==="ltr"?"left":"right",_e),"position","absolute"),"top",he),"width",p.getWidth(ie))}))}),Y<H+y+A&&le<u)for(var de=Math.min(u-le,Math.ceil((H+y+A-Y)/p.defaultHeight*P/p.defaultWidth)),G=le;G<le+de;G++)te=G,$.push(g({index:G,isScrolling:V,key:b(G),parent:this,style:{width:p.getWidth(G)}}));return this._startIndex=ae,this._stopIndex=te,k.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:af("ReactVirtualized__Masonry",_),id:E,onScroll:this._onScroll,role:N,style:dst({boxSizing:"border-box",direction:"ltr",height:d?"auto":y,overflowX:"hidden",overflowY:Q<y?"hidden":"auto",position:"relative",width:P,WebkitOverflowScrolling:"touch",willChange:"transform"},O),tabIndex:D},k.createElement("div",{className:"ReactVirtualized__Masonry__innerScrollContainer",style:{width:"100%",height:Q,maxWidth:"100%",maxHeight:Q,overflow:"hidden",pointerEvents:V?"none":"",position:"relative"}},$))}},{key:"_checkInvalidateOnUpdate",value:function(){if(typeof this._invalidateOnUpdateStartIndex=="number"){var s=this._invalidateOnUpdateStartIndex,l=this._invalidateOnUpdateStopIndex;this._invalidateOnUpdateStartIndex=null,this._invalidateOnUpdateStopIndex=null,this._populatePositionCache(s,l),this.forceUpdate()}}},{key:"_debounceResetIsScrolling",value:function(){var s=this.props.scrollingResetTimeInterval;this._debounceResetIsScrollingId&&FR(this._debounceResetIsScrollingId),this._debounceResetIsScrollingId=VZ(this._debounceResetIsScrollingCallback,s)}},{key:"_getEstimatedTotalHeight",value:function(){var s=this.props,l=s.cellCount,d=s.cellMeasurerCache,u=s.width,p=Math.max(1,Math.floor(u/d.defaultWidth));return this._positionCache.estimateTotalHeight(l,p,d.defaultHeight)}},{key:"_invokeOnScrollCallback",value:function(){var s=this.props,l=s.height,d=s.onScroll,u=this.state.scrollTop;this._onScrollMemoized!==u&&(d({clientHeight:l,scrollHeight:this._getEstimatedTotalHeight(),scrollTop:u}),this._onScrollMemoized=u)}},{key:"_invokeOnCellsRenderedCallback",value:function(){if(this._startIndexMemoized!==this._startIndex||this._stopIndexMemoized!==this._stopIndex){var s=this.props.onCellsRendered;s({startIndex:this._startIndex,stopIndex:this._stopIndex}),this._startIndexMemoized=this._startIndex,this._stopIndexMemoized=this._stopIndex}}},{key:"_populatePositionCache",value:function(s,l){for(var d=this.props,u=d.cellMeasurerCache,p=d.cellPositioner,g=s;g<=l;g++){var _=p(g),y=_.left,E=_.top;this._positionCache.setPosition(g,y,E,u.getHeight(g))}}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.scrollTop!==void 0&&l.scrollTop!==s.scrollTop?{isScrolling:!0,scrollTop:s.scrollTop}:null}}])}(k.PureComponent);wt(sbe,"defaultProps",{autoHeight:!1,keyMapper:pst,onCellsRendered:Cpe,onScroll:Cpe,overscanByPixels:20,role:"grid",scrollingResetTimeInterval:fst,style:hst,tabIndex:0,rowDirection:"ltr"});function pst(n){return n}function Cpe(){}VO(sbe);var SK=function(){function n(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(this,n),wt(this,"_cellMeasurerCache",void 0),wt(this,"_columnIndexOffset",void 0),wt(this,"_rowIndexOffset",void 0),wt(this,"columnWidth",function(g){var _=g.index;t._cellMeasurerCache.columnWidth({index:_+t._columnIndexOffset})}),wt(this,"rowHeight",function(g){var _=g.index;t._cellMeasurerCache.rowHeight({index:_+t._rowIndexOffset})});var s=i.cellMeasurerCache,l=i.columnIndexOffset,d=l===void 0?0:l,u=i.rowIndexOffset,p=u===void 0?0:u;this._cellMeasurerCache=s,this._columnIndexOffset=d,this._rowIndexOffset=p}return ya(n,[{key:"clear",value:function(i,s){this._cellMeasurerCache.clear(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getHeight(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"getWidth",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.getWidth(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"has",value:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this._cellMeasurerCache.has(i+this._rowIndexOffset,s+this._columnIndexOffset)}},{key:"set",value:function(i,s,l,d){this._cellMeasurerCache.set(i+this._rowIndexOffset,s+this._columnIndexOffset,l,d)}}])}(),mst=["rowIndex"],gst=["columnIndex","rowIndex"],vst=["columnIndex"],yst=["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"];function Tpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function is(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Tpe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Tpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function _st(n,t,i){return t=Cr(t),fc(n,abe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function abe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(abe=function(){return!!n})()}var Rpe=20,WZ=function(n){function t(i,s){var l;va(this,t),l=_st(this,t,[i,s]),wt(l,"state",{scrollLeft:0,scrollTop:0,scrollbarSize:0,showHorizontalScrollbar:!1,showVerticalScrollbar:!1}),wt(l,"_deferredInvalidateColumnIndex",null),wt(l,"_deferredInvalidateRowIndex",null),wt(l,"_bottomLeftGridRef",function(g){l._bottomLeftGrid=g}),wt(l,"_bottomRightGridRef",function(g){l._bottomRightGrid=g}),wt(l,"_cellRendererBottomLeftGrid",function(g){var _=g.rowIndex,y=n4(g,mst),E=l.props,b=E.cellRenderer,A=E.fixedRowCount,N=E.rowCount;return _===N-A?k.createElement("div",{key:y.key,style:is(is({},y.style),{},{height:Rpe})}):b(is(is({},y),{},{parent:l,rowIndex:_+A}))}),wt(l,"_cellRendererBottomRightGrid",function(g){var _=g.columnIndex,y=g.rowIndex,E=n4(g,gst),b=l.props,A=b.cellRenderer,N=b.fixedColumnCount,O=b.fixedRowCount;return A(is(is({},E),{},{columnIndex:_+N,parent:l,rowIndex:y+O}))}),wt(l,"_cellRendererTopRightGrid",function(g){var _=g.columnIndex,y=n4(g,vst),E=l.props,b=E.cellRenderer,A=E.columnCount,N=E.fixedColumnCount;return _===A-N?k.createElement("div",{key:y.key,style:is(is({},y.style),{},{width:Rpe})}):b(is(is({},y),{},{columnIndex:_+N,parent:l}))}),wt(l,"_columnWidthRightGrid",function(g){var _=g.index,y=l.props,E=y.columnCount,b=y.fixedColumnCount,A=y.columnWidth,N=l.state,O=N.scrollbarSize,D=N.showHorizontalScrollbar;return D&&_===E-b?O:typeof A=="function"?A({index:_+b}):A}),wt(l,"_onScroll",function(g){var _=g.scrollLeft,y=g.scrollTop;l.setState({scrollLeft:_,scrollTop:y});var E=l.props.onScroll;E&&E(g)}),wt(l,"_onScrollbarPresenceChange",function(g){var _=g.horizontal,y=g.size,E=g.vertical,b=l.state,A=b.showHorizontalScrollbar,N=b.showVerticalScrollbar;if(_!==A||E!==N){l.setState({scrollbarSize:y,showHorizontalScrollbar:_,showVerticalScrollbar:E});var O=l.props.onScrollbarPresenceChange;typeof O=="function"&&O({horizontal:_,size:y,vertical:E})}}),wt(l,"_onScrollLeft",function(g){var _=g.scrollLeft;l._onScroll({scrollLeft:_,scrollTop:l.state.scrollTop})}),wt(l,"_onScrollTop",function(g){var _=g.scrollTop;l._onScroll({scrollTop:_,scrollLeft:l.state.scrollLeft})}),wt(l,"_rowHeightBottomGrid",function(g){var _=g.index,y=l.props,E=y.fixedRowCount,b=y.rowCount,A=y.rowHeight,N=l.state,O=N.scrollbarSize,D=N.showVerticalScrollbar;return D&&_===b-E?O:typeof A=="function"?A({index:_+E}):A}),wt(l,"_topLeftGridRef",function(g){l._topLeftGrid=g}),wt(l,"_topRightGridRef",function(g){l._topRightGrid=g});var d=i.deferredMeasurementCache,u=i.fixedColumnCount,p=i.fixedRowCount;return l._maybeCalculateCachedStyles(!0),d&&(l._deferredMeasurementCacheBottomLeftGrid=p>0?new SK({cellMeasurerCache:d,columnIndexOffset:0,rowIndexOffset:p}):d,l._deferredMeasurementCacheBottomRightGrid=u>0||p>0?new SK({cellMeasurerCache:d,columnIndexOffset:u,rowIndexOffset:p}):d,l._deferredMeasurementCacheTopRightGrid=u>0?new SK({cellMeasurerCache:d,columnIndexOffset:u,rowIndexOffset:0}):d),l}return pc(t,n),ya(t,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this._deferredInvalidateColumnIndex=typeof this._deferredInvalidateColumnIndex=="number"?Math.min(this._deferredInvalidateColumnIndex,d):d,this._deferredInvalidateRowIndex=typeof this._deferredInvalidateRowIndex=="number"?Math.min(this._deferredInvalidateRowIndex,p):p}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u,g=this.props,_=g.fixedColumnCount,y=g.fixedRowCount,E=Math.max(0,d-_),b=Math.max(0,p-y);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:d,rowIndex:b}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:E,rowIndex:b}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:d,rowIndex:p}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:E,rowIndex:p}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var s=this.props,l=s.scrollLeft,d=s.scrollTop;if(l>0||d>0){var u={};l>0&&(u.scrollLeft=l),d>0&&(u.scrollTop=d),this.setState(u)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var s=this.props,l=s.onScroll,d=s.onSectionRendered;s.onScrollbarPresenceChange,s.scrollLeft;var u=s.scrollToColumn;s.scrollTop;var p=s.scrollToRow,g=n4(s,yst);if(this._prepareForRender(),this.props.width===0||this.props.height===0)return null;var _=this.state,y=_.scrollLeft,E=_.scrollTop;return k.createElement("div",{style:this._containerOuterStyle},k.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(g),this._renderTopRightGrid(is(is({},g),{},{onScroll:l,scrollLeft:y}))),k.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(is(is({},g),{},{onScroll:l,scrollTop:E})),this._renderBottomRightGrid(is(is({},g),{},{onScroll:l,onSectionRendered:d,scrollLeft:y,scrollToColumn:u,scrollToRow:p,scrollTop:E}))))}},{key:"_getBottomGridHeight",value:function(s){var l=s.height,d=this._getTopGridHeight(s);return l-d}},{key:"_getLeftGridWidth",value:function(s){var l=s.fixedColumnCount,d=s.columnWidth;if(this._leftGridWidth==null)if(typeof d=="function"){for(var u=0,p=0;p<l;p++)u+=d({index:p});this._leftGridWidth=u}else this._leftGridWidth=d*l;return this._leftGridWidth}},{key:"_getRightGridWidth",value:function(s){var l=s.width,d=this._getLeftGridWidth(s);return l-d}},{key:"_getTopGridHeight",value:function(s){var l=s.fixedRowCount,d=s.rowHeight;if(this._topGridHeight==null)if(typeof d=="function"){for(var u=0,p=0;p<l;p++)u+=d({index:p});this._topGridHeight=u}else this._topGridHeight=d*l;return this._topGridHeight}},{key:"_handleInvalidatedGridSize",value:function(){if(typeof this._deferredInvalidateColumnIndex=="number"){var s=this._deferredInvalidateColumnIndex,l=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:s,rowIndex:l}),this.forceUpdate()}}},{key:"_maybeCalculateCachedStyles",value:function(s){var l=this.props,d=l.columnWidth,u=l.enableFixedColumnScroll,p=l.enableFixedRowScroll,g=l.height,_=l.fixedColumnCount,y=l.fixedRowCount,E=l.rowHeight,b=l.style,A=l.styleBottomLeftGrid,N=l.styleBottomRightGrid,O=l.styleTopLeftGrid,D=l.styleTopRightGrid,P=l.width,j=s||g!==this._lastRenderedHeight||P!==this._lastRenderedWidth,M=s||d!==this._lastRenderedColumnWidth||_!==this._lastRenderedFixedColumnCount,V=s||y!==this._lastRenderedFixedRowCount||E!==this._lastRenderedRowHeight;(s||j||b!==this._lastRenderedStyle)&&(this._containerOuterStyle=is({height:g,overflow:"visible",width:P},b)),(s||j||V)&&(this._containerTopStyle={height:this._getTopGridHeight(this.props),position:"relative",width:P},this._containerBottomStyle={height:g-this._getTopGridHeight(this.props),overflow:"visible",position:"relative",width:P}),(s||A!==this._lastRenderedStyleBottomLeftGrid)&&(this._bottomLeftGridStyle=is({left:0,overflowX:"hidden",overflowY:u?"auto":"hidden",position:"absolute"},A)),(s||M||N!==this._lastRenderedStyleBottomRightGrid)&&(this._bottomRightGridStyle=is({left:this._getLeftGridWidth(this.props),position:"absolute"},N)),(s||O!==this._lastRenderedStyleTopLeftGrid)&&(this._topLeftGridStyle=is({left:0,overflowX:"hidden",overflowY:"hidden",position:"absolute",top:0},O)),(s||M||D!==this._lastRenderedStyleTopRightGrid)&&(this._topRightGridStyle=is({left:this._getLeftGridWidth(this.props),overflowX:p?"auto":"hidden",overflowY:"hidden",position:"absolute",top:0},D)),this._lastRenderedColumnWidth=d,this._lastRenderedFixedColumnCount=_,this._lastRenderedFixedRowCount=y,this._lastRenderedHeight=g,this._lastRenderedRowHeight=E,this._lastRenderedStyle=b,this._lastRenderedStyleBottomLeftGrid=A,this._lastRenderedStyleBottomRightGrid=N,this._lastRenderedStyleTopLeftGrid=O,this._lastRenderedStyleTopRightGrid=D,this._lastRenderedWidth=P}},{key:"_prepareForRender",value:function(){(this._lastRenderedColumnWidth!==this.props.columnWidth||this._lastRenderedFixedColumnCount!==this.props.fixedColumnCount)&&(this._leftGridWidth=null),(this._lastRenderedFixedRowCount!==this.props.fixedRowCount||this._lastRenderedRowHeight!==this.props.rowHeight)&&(this._topGridHeight=null),this._maybeCalculateCachedStyles(),this._lastRenderedColumnWidth=this.props.columnWidth,this._lastRenderedFixedColumnCount=this.props.fixedColumnCount,this._lastRenderedFixedRowCount=this.props.fixedRowCount,this._lastRenderedRowHeight=this.props.rowHeight}},{key:"_renderBottomLeftGrid",value:function(s){var l=s.enableFixedColumnScroll,d=s.fixedColumnCount,u=s.fixedRowCount,p=s.rowCount,g=s.hideBottomLeftGridScrollbar,_=this.state.showVerticalScrollbar;if(!d)return null;var y=_?1:0,E=this._getBottomGridHeight(s),b=this._getLeftGridWidth(s),A=this.state.showVerticalScrollbar?this.state.scrollbarSize:0,N=g?b+A:b,O=k.createElement(gv,$d({},s,{cellRenderer:this._cellRendererBottomLeftGrid,className:this.props.classNameBottomLeftGrid,columnCount:d,deferredMeasurementCache:this._deferredMeasurementCacheBottomLeftGrid,height:E,onScroll:l?this._onScrollTop:void 0,ref:this._bottomLeftGridRef,rowCount:Math.max(0,p-u)+y,rowHeight:this._rowHeightBottomGrid,style:this._bottomLeftGridStyle,tabIndex:null,width:N}));return g?k.createElement("div",{className:"BottomLeftGrid_ScrollWrapper",style:is(is({},this._bottomLeftGridStyle),{},{height:E,width:b,overflowY:"hidden"})},O):O}},{key:"_renderBottomRightGrid",value:function(s){var l=s.columnCount,d=s.fixedColumnCount,u=s.fixedRowCount,p=s.rowCount,g=s.scrollToColumn,_=s.scrollToRow;return k.createElement(gv,$d({},s,{cellRenderer:this._cellRendererBottomRightGrid,className:this.props.classNameBottomRightGrid,columnCount:Math.max(0,l-d),columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheBottomRightGrid,height:this._getBottomGridHeight(s),onScroll:this._onScroll,onScrollbarPresenceChange:this._onScrollbarPresenceChange,ref:this._bottomRightGridRef,rowCount:Math.max(0,p-u),rowHeight:this._rowHeightBottomGrid,scrollToColumn:g-d,scrollToRow:_-u,style:this._bottomRightGridStyle,width:this._getRightGridWidth(s)}))}},{key:"_renderTopLeftGrid",value:function(s){var l=s.fixedColumnCount,d=s.fixedRowCount;return!l||!d?null:k.createElement(gv,$d({},s,{className:this.props.classNameTopLeftGrid,columnCount:l,height:this._getTopGridHeight(s),ref:this._topLeftGridRef,rowCount:d,style:this._topLeftGridStyle,tabIndex:null,width:this._getLeftGridWidth(s)}))}},{key:"_renderTopRightGrid",value:function(s){var l=s.columnCount,d=s.enableFixedRowScroll,u=s.fixedColumnCount,p=s.fixedRowCount,g=s.scrollLeft,_=s.hideTopRightGridScrollbar,y=this.state,E=y.showHorizontalScrollbar,b=y.scrollbarSize;if(!p)return null;var A=E?1:0,N=this._getTopGridHeight(s),O=this._getRightGridWidth(s),D=E?b:0,P=N,j=this._topRightGridStyle;_&&(P=N+D,j=is(is({},this._topRightGridStyle),{},{left:0}));var M=k.createElement(gv,$d({},s,{cellRenderer:this._cellRendererTopRightGrid,className:this.props.classNameTopRightGrid,columnCount:Math.max(0,l-u)+A,columnWidth:this._columnWidthRightGrid,deferredMeasurementCache:this._deferredMeasurementCacheTopRightGrid,height:P,onScroll:d?this._onScrollLeft:void 0,ref:this._topRightGridRef,rowCount:p,scrollLeft:g,style:j,tabIndex:null,width:O}));return _?k.createElement("div",{className:"TopRightGrid_ScrollWrapper",style:is(is({},this._topRightGridStyle),{},{height:N,width:O,overflowX:"hidden"})},M):M}}],[{key:"getDerivedStateFromProps",value:function(s,l){return s.scrollLeft!==l.scrollLeft||s.scrollTop!==l.scrollTop?{scrollLeft:s.scrollLeft!=null&&s.scrollLeft>=0?s.scrollLeft:l.scrollLeft,scrollTop:s.scrollTop!=null&&s.scrollTop>=0?s.scrollTop:l.scrollTop}:null}}])}(k.PureComponent);wt(WZ,"defaultProps",{classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1});WZ.propTypes={};VO(WZ);function Est(n,t,i){return t=Cr(t),fc(n,obe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function obe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(obe=function(){return!!n})()}var wst=function(n){function t(i,s){var l;return va(this,t),l=Est(this,t,[i,s]),l.state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},l._onScroll=l._onScroll.bind(l),l}return pc(t,n),ya(t,[{key:"render",value:function(){var s=this.props.children,l=this.state,d=l.clientHeight,u=l.clientWidth,p=l.scrollHeight,g=l.scrollLeft,_=l.scrollTop,y=l.scrollWidth;return s({clientHeight:d,clientWidth:u,onScroll:this._onScroll,scrollHeight:p,scrollLeft:g,scrollTop:_,scrollWidth:y})}},{key:"_onScroll",value:function(s){var l=s.clientHeight,d=s.clientWidth,u=s.scrollHeight,p=s.scrollLeft,g=s.scrollTop,_=s.scrollWidth;this.setState({clientHeight:l,clientWidth:d,scrollHeight:u,scrollLeft:p,scrollTop:g,scrollWidth:_})}}])}(k.PureComponent);wst.propTypes={};function Sst(n){var t=n.dataKey,i=n.rowData;return typeof i.get=="function"?i.get(t):i[t]}function bst(n){var t=n.cellData;return t==null?"":String(t)}function Cst(n){var t=n.className,i=n.columns,s=n.style;return k.createElement("div",{className:t,role:"row",style:s},i)}var vv={ASC:"ASC",DESC:"DESC"};function lbe(n){var t=n.sortDirection,i=af("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":t===vv.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":t===vv.DESC});return k.createElement("svg",{className:i,width:18,height:18,viewBox:"0 0 24 24"},t===vv.ASC?k.createElement("path",{d:"M7 14l5-5 5 5z"}):k.createElement("path",{d:"M7 10l5 5 5-5z"}),k.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}lbe.propTypes={};function Tst(n){var t=n.dataKey,i=n.label,s=n.sortBy,l=n.sortDirection,d=s===t,u=[k.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:typeof i=="string"?i:null},i)];return d&&u.push(k.createElement(lbe,{key:"SortIndicator",sortDirection:l})),u}function Rst(n){var t=n.className,i=n.columns,s=n.index,l=n.key,d=n.onRowClick,u=n.onRowDoubleClick,p=n.onRowMouseOut,g=n.onRowMouseOver,_=n.onRowRightClick,y=n.rowData,E=n.style,b={"aria-rowindex":s+1};return(d||u||p||g||_)&&(b["aria-label"]="row",b.tabIndex=0,d&&(b.onClick=function(A){return d({event:A,index:s,rowData:y})}),u&&(b.onDoubleClick=function(A){return u({event:A,index:s,rowData:y})}),p&&(b.onMouseOut=function(A){return p({event:A,index:s,rowData:y})}),g&&(b.onMouseOver=function(A){return g({event:A,index:s,rowData:y})}),_&&(b.onContextMenu=function(A){return _({event:A,index:s,rowData:y})})),k.createElement("div",$d({},b,{className:t,key:l,role:"row",style:E}),i)}function xst(n,t,i){return t=Cr(t),fc(n,cbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function cbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cbe=function(){return!!n})()}var $Z=function(n){function t(){return va(this,t),xst(this,t,arguments)}return pc(t,n),ya(t)}(k.Component);wt($Z,"defaultProps",{cellDataGetter:Sst,cellRenderer:bst,defaultSortDirection:vv.ASC,flexGrow:0,flexShrink:1,headerRenderer:Tst,style:{}});$Z.propTypes={};function xpe(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Zf(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?xpe(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):xpe(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Ast(n,t,i){return t=Cr(t),fc(n,dbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function dbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dbe=function(){return!!n})()}var ube=function(n){function t(i){var s;return va(this,t),s=Ast(this,t,[i]),s.state={scrollbarWidth:0},s._createColumn=s._createColumn.bind(s),s._createRow=s._createRow.bind(s),s._onScroll=s._onScroll.bind(s),s._onSectionRendered=s._onSectionRendered.bind(s),s._setRef=s._setRef.bind(s),s._setGridElementRef=s._setGridElementRef.bind(s),s}return pc(t,n),ya(t,[{key:"forceUpdateGrid",value:function(){this.Grid&&this.Grid.forceUpdate()}},{key:"getOffsetForRow",value:function(s){var l=s.alignment,d=s.index;if(this.Grid){var u=this.Grid.getOffsetForCell({alignment:l,rowIndex:d}),p=u.scrollTop;return p}return 0}},{key:"invalidateCellSizeAfterRender",value:function(s){var l=s.columnIndex,d=s.rowIndex;this.Grid&&this.Grid.invalidateCellSizeAfterRender({rowIndex:d,columnIndex:l})}},{key:"measureAllRows",value:function(){this.Grid&&this.Grid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},l=s.columnIndex,d=l===void 0?0:l,u=s.rowIndex,p=u===void 0?0:u;this.Grid&&this.Grid.recomputeGridSize({rowIndex:p,columnIndex:d})}},{key:"recomputeRowHeights",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:s})}},{key:"scrollToPosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:s})}},{key:"scrollToRow",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:s})}},{key:"getScrollbarWidth",value:function(){if(this.GridElement){var s=this.GridElement,l=s.clientWidth||0,d=s.offsetWidth||0;return d-l}return 0}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var s=this,l=this.props,d=l.children,u=l.className,p=l.disableHeader,g=l.gridClassName,_=l.gridStyle,y=l.headerHeight,E=l.headerRowRenderer,b=l.height,A=l.id,N=l.noRowsRenderer,O=l.rowClassName,D=l.rowStyle,P=l.scrollToIndex,j=l.style,M=l.width,V=this.state.scrollbarWidth,H=p?b:b-y,$=typeof O=="function"?O({index:-1}):O,Q=typeof D=="function"?D({index:-1}):D;return this._cachedColumnStyles=[],k.Children.toArray(d).forEach(function(Y,le){var ae=s._getFlexStyleForColumn(Y,Y.props.style||$Z.defaultProps.style);s._cachedColumnStyles[le]=Zf({overflow:"hidden"},ae)}),k.createElement("div",{"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-colcount":k.Children.toArray(d).length,"aria-rowcount":this.props.rowCount,className:af("ReactVirtualized__Table",u),id:A,role:"grid",style:j},!p&&E({className:af("ReactVirtualized__Table__headerRow",$),columns:this._getHeaderColumns(),style:Zf({height:y,overflow:"hidden",paddingRight:V,width:M},Q)}),k.createElement(gv,$d({},this.props,{elementRef:this._setGridElementRef,"aria-readonly":null,autoContainerWidth:!0,className:af("ReactVirtualized__Table__Grid",g),cellRenderer:this._createRow,columnWidth:M,columnCount:1,height:H,id:void 0,noContentRenderer:N,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:V,scrollToRow:P,style:Zf(Zf({},_),{},{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(s){var l=s.column,d=s.columnIndex,u=s.isScrolling,p=s.parent,g=s.rowData,_=s.rowIndex,y=this.props.onColumnClick,E=l.props,b=E.cellDataGetter,A=E.cellRenderer,N=E.className,O=E.columnData,D=E.dataKey,P=E.id,j=b({columnData:O,dataKey:D,rowData:g}),M=A({cellData:j,columnData:O,columnIndex:d,dataKey:D,isScrolling:u,parent:p,rowData:g,rowIndex:_}),V=function(Y){y&&y({columnData:O,dataKey:D,event:Y})},H=this._cachedColumnStyles[d],$=typeof M=="string"?M:null;return k.createElement("div",{"aria-colindex":d+1,"aria-describedby":P,className:af("ReactVirtualized__Table__rowColumn",N),key:"Row"+_+"-Col"+d,onClick:V,role:"gridcell",style:H,title:$},M)}},{key:"_createHeader",value:function(s){var l=s.column,d=s.index,u=this.props,p=u.headerClassName,g=u.headerStyle,_=u.onHeaderClick,y=u.sort,E=u.sortBy,b=u.sortDirection,A=l.props,N=A.columnData,O=A.dataKey,D=A.defaultSortDirection,P=A.disableSort,j=A.headerRenderer,M=A.id,V=A.label,H=!P&&y,$=af("ReactVirtualized__Table__headerColumn",p,l.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:H}),Q=this._getFlexStyleForColumn(l,Zf(Zf({},g),l.props.headerStyle)),Y=j({columnData:N,dataKey:O,disableSort:P,label:V,sortBy:E,sortDirection:b}),le,ae,te,de,G;if(H||_){var ie=E!==O,_e=ie?D:b===vv.DESC?vv.ASC:vv.DESC,he=function(me){H&&y({defaultSortDirection:D,event:me,sortBy:O,sortDirection:_e}),_&&_({columnData:N,dataKey:O,event:me})},Ce=function(me){(me.key==="Enter"||me.key===" ")&&he(me)};G=l.props["aria-label"]||V||O,de="none",te=0,le=he,ae=Ce}return E===O&&(de=b===vv.ASC?"ascending":"descending"),k.createElement("div",{"aria-label":G,"aria-sort":de,className:$,id:M,key:"Header-Col"+d,onClick:le,onKeyDown:ae,role:"columnheader",style:Q,tabIndex:te},Y)}},{key:"_createRow",value:function(s){var l=this,d=s.rowIndex,u=s.isScrolling,p=s.key,g=s.parent,_=s.style,y=this.props,E=y.children,b=y.onRowClick,A=y.onRowDoubleClick,N=y.onRowRightClick,O=y.onRowMouseOver,D=y.onRowMouseOut,P=y.rowClassName,j=y.rowGetter,M=y.rowRenderer,V=y.rowStyle,H=this.state.scrollbarWidth,$=typeof P=="function"?P({index:d}):P,Q=typeof V=="function"?V({index:d}):V,Y=j({index:d}),le=k.Children.toArray(E).map(function(de,G){return l._createColumn({column:de,columnIndex:G,isScrolling:u,parent:g,rowData:Y,rowIndex:d,scrollbarWidth:H})}),ae=af("ReactVirtualized__Table__row",$),te=Zf(Zf({},_),{},{height:this._getRowHeight(d),overflow:"hidden",paddingRight:H},Q);return M({className:ae,columns:le,index:d,isScrolling:u,key:p,onRowClick:b,onRowDoubleClick:A,onRowRightClick:N,onRowMouseOver:O,onRowMouseOut:D,rowData:Y,style:te})}},{key:"_getFlexStyleForColumn",value:function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d="".concat(s.props.flexGrow," ").concat(s.props.flexShrink," ").concat(s.props.width,"px"),u=Zf(Zf({},l),{},{flex:d,msFlex:d,WebkitFlex:d});return s.props.maxWidth&&(u.maxWidth=s.props.maxWidth),s.props.minWidth&&(u.minWidth=s.props.minWidth),u}},{key:"_getHeaderColumns",value:function(){var s=this,l=this.props,d=l.children,u=l.disableHeader,p=u?[]:k.Children.toArray(d);return p.map(function(g,_){return s._createHeader({column:g,index:_})})}},{key:"_getRowHeight",value:function(s){var l=this.props.rowHeight;return typeof l=="function"?l({index:s}):l}},{key:"_onScroll",value:function(s){var l=s.clientHeight,d=s.scrollHeight,u=s.scrollTop,p=this.props.onScroll;p({clientHeight:l,scrollHeight:d,scrollTop:u})}},{key:"_onSectionRendered",value:function(s){var l=s.rowOverscanStartIndex,d=s.rowOverscanStopIndex,u=s.rowStartIndex,p=s.rowStopIndex,g=this.props.onRowsRendered;g({overscanStartIndex:l,overscanStopIndex:d,startIndex:u,stopIndex:p})}},{key:"_setRef",value:function(s){this.Grid=s}},{key:"_setGridElementRef",value:function(s){this.GridElement=s}},{key:"_setScrollbarWidth",value:function(){var s=this.getScrollbarWidth();this.setState({scrollbarWidth:s})}}])}(k.PureComponent);wt(ube,"defaultProps",{disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:YSe,overscanRowCount:10,rowRenderer:Rst,headerRowRenderer:Cst,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}});ube.propTypes={};var Iv=[],v4=null,yE=null;function hbe(){yE&&(yE=null,document.body&&v4!=null&&(document.body.style.pointerEvents=v4),v4=null)}function Ist(){hbe(),Iv.forEach(function(n){return n.__resetIsScrolling()})}function Nst(){yE&&FR(yE);var n=0;Iv.forEach(function(t){n=Math.max(n,t.props.scrollingResetTimeInterval)}),yE=VZ(Ist,n)}function fbe(n){n.currentTarget===window&&v4==null&&document.body&&(v4=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),Nst(),Iv.forEach(function(t){t.props.scrollElement===n.currentTarget&&t.__handleWindowScrollEvent()})}function Ape(n,t){Iv.some(function(i){return i.props.scrollElement===t})||t.addEventListener("scroll",fbe),Iv.push(n)}function Ipe(n,t){Iv=Iv.filter(function(i){return i!==n}),Iv.length||(t.removeEventListener("scroll",fbe),yE&&(FR(yE),hbe()))}var KZ=function(t){return t===window},i4=function(t){return t.getBoundingClientRect()};function Npe(n,t){if(n)if(KZ(n)){var i=window,s=i.innerHeight,l=i.innerWidth;return{height:typeof s=="number"?s:0,width:typeof l=="number"?l:0}}else return i4(n);else return{height:t.serverHeight,width:t.serverWidth}}function Ost(n,t){if(KZ(t)&&document.documentElement){var i=document.documentElement,s=i4(n),l=i4(i);return{top:s.top-l.top,left:s.left-l.left}}else{var d=pbe(t),u=i4(n),p=i4(t);return{top:u.top+d.top-p.top,left:u.left+d.left-p.left}}}function pbe(n){return KZ(n)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:n.scrollTop,left:n.scrollLeft}}function Ope(n,t){var i=Object.keys(n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);t&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),i.push.apply(i,s)}return i}function Ppe(n){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Ope(Object(i),!0).forEach(function(s){wt(n,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):Ope(Object(i)).forEach(function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(i,s))})}return n}function Pst(n,t,i){return t=Cr(t),fc(n,mbe()?Reflect.construct(t,i||[],Cr(n).constructor):t.apply(n,i))}function mbe(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mbe=function(){return!!n})()}var Lst=150,gbe=function(){return typeof window<"u"?window:void 0},Dst=function(n){function t(){var i;va(this,t);for(var s=arguments.length,l=new Array(s),d=0;d<s;d++)l[d]=arguments[d];return i=Pst(this,t,[].concat(l)),wt(i,"_window",gbe()),wt(i,"_isMounted",!1),wt(i,"_positionFromTop",0),wt(i,"_positionFromLeft",0),wt(i,"_detectElementResize",void 0),wt(i,"_child",void 0),wt(i,"_windowScrollerRef",k.createRef()),wt(i,"state",Ppe(Ppe({},Npe(i.props.scrollElement,i.props)),{},{isScrolling:!1,scrollLeft:0,scrollTop:0})),wt(i,"_registerChild",function(u){u&&!(u instanceof Element)&&console.warn("WindowScroller registerChild expects to be passed Element or null"),i._child=u,i.updatePosition()}),wt(i,"_onChildScroll",function(u){var p=u.scrollTop;if(i.state.scrollTop!==p){var g=i.props.scrollElement;g&&(typeof g.scrollTo=="function"?g.scrollTo(0,p+i._positionFromTop):g.scrollTop=p+i._positionFromTop)}}),wt(i,"_registerResizeListener",function(u){u===window?window.addEventListener("resize",i._onResize,!1):i._detectElementResize.addResizeListener(u,i._onResize)}),wt(i,"_unregisterResizeListener",function(u){u===window?window.removeEventListener("resize",i._onResize,!1):u&&i._detectElementResize.removeResizeListener(u,i._onResize)}),wt(i,"_onResize",function(){i.updatePosition()}),wt(i,"__handleWindowScrollEvent",function(){if(i._isMounted){var u=i.props.onScroll,p=i.props.scrollElement;if(p){var g=pbe(p),_=Math.max(0,g.left-i._positionFromLeft),y=Math.max(0,g.top-i._positionFromTop);i.setState({isScrolling:!0,scrollLeft:_,scrollTop:y}),u({scrollLeft:_,scrollTop:y})}}}),wt(i,"__resetIsScrolling",function(){i.setState({isScrolling:!1})}),i}return pc(t,n),ya(t,[{key:"updatePosition",value:function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props.scrollElement,l=this.props.onResize,d=this.state,u=d.height,p=d.width,g=this._child||this._windowScrollerRef.current;if(g instanceof Element&&s){var _=Ost(g,s);this._positionFromTop=_.top,this._positionFromLeft=_.left}var y=Npe(s,this.props);(u!==y.height||p!==y.width)&&(this.setState({height:y.height,width:y.width}),l({height:y.height,width:y.width})),this.props.updateScrollTopOnUpdatePosition===!0&&(this.__handleWindowScrollEvent(),this.__resetIsScrolling())}},{key:"componentDidMount",value:function(){var s=this.props.scrollElement;this._detectElementResize=BSe(),this.updatePosition(s),s&&(Ape(this,s),this._registerResizeListener(s)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(s,l){var d=this.props.scrollElement,u=s.scrollElement;u!==d&&u!=null&&d!=null&&(this.updatePosition(d),Ipe(this,u),Ape(this,d),this._unregisterResizeListener(u),this._registerResizeListener(d))}},{key:"componentWillUnmount",value:function(){var s=this.props.scrollElement;s&&(Ipe(this,s),this._unregisterResizeListener(s)),this._isMounted=!1}},{key:"render",value:function(){var s=this.props.children,l=this.state,d=l.isScrolling,u=l.scrollTop,p=l.scrollLeft,g=l.height,_=l.width;return k.createElement("div",{ref:this._windowScrollerRef},s({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:g,isScrolling:d,scrollLeft:p,scrollTop:u,width:_}))}}])}(k.PureComponent);wt(Dst,"defaultProps",{onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:Lst,scrollElement:gbe(),serverHeight:0,serverWidth:0});function kst(){var je,Ve;const n=Ii(),t=JSON.parse(Ai.getAuthUser()),i=["name","designation"],s="appreciation",[l,d]=k.useState(0),[u,p]=k.useState([]),[g,_]=k.useState([]),[y,E]=k.useState([]),[b,A]=k.useState(""),[N,O]=k.useState(""),[D,P]=k.useState(""),[j,M]=k.useState(!1),V=async({queryKey:Re})=>{var we,Ge;const[Be,Xe]=Re;try{const rt=await hs.getAllRecipients(Xe);if(rt.data.status==="success"){const pt=((Ge=(we=rt.data)==null?void 0:we.data)==null?void 0:Ge.recipients)||[],Ze=new Set;return pt.filter(_t=>Ze.has(_t.id)?!1:(Ze.add(_t.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}};async function H(){var Re,Be;try{const Xe=await Z4.getAppreciationCreationHelpers();return Xe.data.status==="success"?{images:(Re=Xe.data)==null?void 0:Re.data.images,reasons:(Be=Xe.data)==null?void 0:Be.data.reasons}:null}catch{throw new Error("Error fetching appreciation creation helpers")}}const{isPending:$,isError:Q,data:Y,error:le}=Qd({queryKey:["appreciationRecipients",s],queryFn:V}),{data:ae}=Qd({queryKey:["appreciationCreationHelpers"],queryFn:H}),te=k.useMemo(()=>FO(Y,b,i),[Y,b]),de=(Re,Be="single")=>{p(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},G=(Re,Be="single")=>{_(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},ie=(Re,Be="single")=>{E(Be==="single"?[Re]:Xe=>Xe.some(we=>we.id===Re.id)?Xe.filter(we=>we.id!==Re.id):[...Xe,Re])},_e=({index:Re,key:Be,style:Xe})=>{const we=te[Re];return h.jsx("div",{style:Xe,children:h.jsx(RC,{item:we,className:`user-card ${u.some(Ge=>Ge.id===we.id)?"selected":""} ${te.length!==Re+1?"border-bottom":""}`,type:"single",title:we!=null&&we.firstname?Pv(we==null?void 0:we.firstname,we==null?void 0:we.lastname):we==null?void 0:we.name,subTitle:we==null?void 0:we.designation,iconImg:we==null?void 0:we.avatar,isRoundedIcon:!0,handleItemSelect:de})},Be)},he=()=>u.length===0?(Qt("Users not selected!","error"),!1):!0,Ce=()=>(g==null?void 0:g.length)===0?(Qt("Reason not selected!","error"),!1):g.some(Re=>Re.id==="other")&&N===""?(Qt("Own Reason is empty!","error"),!1):!0,fe=()=>!y&&(y==null?void 0:y.length)===0?(Qt("Graphics not selected!","error"),!1):!0;function me(Re){d(Number(Re))}const Ne=()=>{l===0&&he()?d(1):l===1&&Ce()?d(2):l===2&&fe()&&Fe()};async function Fe(){var pt;console.log("## Inside handleSubmit ##"),M(!0);const Re=u[0],Be=g[0];console.log("selectedReason = ",Be);const Xe={};if(Be!=null&&Be.id&&((Be==null?void 0:Be.id)==="other"?(Xe.reason=N,Xe.points=0,Xe.icon="/img/default-profile.jpg"):(Xe.reason=Be==null?void 0:Be.reason,Xe.points=Be==null?void 0:Be.points,Xe.icon=Be==null?void 0:Be.icon)),!y&&!y.length>0){Qt("Graphics not selected!","error");return}const we=(pt=y[0])==null?void 0:pt.image,Ge=`${t.name} appreciated ${Re==null?void 0:Re.firstname} ${Re==null?void 0:Re.lastname}`,rt={receiver_id:Re==null?void 0:Re.id,receiver_info:Re,title:Ge,reason:Xe==null?void 0:Xe.reason,icon:Xe==null?void 0:Xe.icon,image:we,points:Xe==null?void 0:Xe.points,message:D};Z4.sendAppreciation(rt).then(Ze=>{console.log("sendAppreciation response result = ",Ze.data),Ze.data.status==="success"&&(M(!1),Qt("Appreciation sent successfully!","success"),n("/appreciations",{state:{data:"sent"}}))}).catch(Ze=>{console.log(Ze),Qt("Failed to Send Appreciation!","error")}).finally(()=>{M(!1)})}return $?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):Q?h.jsx(Ga,{className:"mt-5",children:le.message}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"send-appreciation-page",children:h.jsxs(vU,{activeKey:l,onSelect:me,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(XO,{filters:i,onSearch:Re=>A(Re),className:"mb-"}),(te==null?void 0:te.length)>0&&(b==null?void 0:b.length)>0&&h.jsx(Ga,{size:"sm",className:"px-1 text-gray9",children:`Results found ${te==null?void 0:te.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(BZ,{items:u,className:"",type:"single",handleRemoveItems:de})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(oF,{children:({height:Re,width:Be})=>h.jsx(cF,{width:Be,height:Re,rowHeight:60,rowCount:te.length,rowRenderer:_e})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Ne,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select appreciation reason"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:h.jsxs(h.Fragment,{children:[((je=ae==null?void 0:ae.reasons)==null?void 0:je.length)>0&&(ae==null?void 0:ae.reasons.map(Re=>h.jsx(h.Fragment,{children:h.jsx(RC,{item:Re,className:`user-card ${g.some(Be=>Be.id===(Re==null?void 0:Re.id))?"selected":""}`,type:"single",title:Re==null?void 0:Re.reason,subTitle:"",iconImg:Re==null?void 0:Re.icon,isRoundedIcon:!1,handleItemSelect:G},Re==null?void 0:Re.id)}))),h.jsx(RC,{item:{id:"other"},className:`user-card ${g.some(Re=>Re.id==="other")?"selected":""}`,type:"single",title:"Write your own",subTitle:"",iconImg:"/img/default-profile.jpg",isRoundedIcon:!1,handleItemSelect:G},"other")]})}),g.some(Re=>Re.id==="other")&&h.jsx(h.Fragment,{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-3",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Write your own reason"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},value:N,onChange:Re=>O(Re.target.value),placeholder:"",name:"own_reason",autoComplete:"off"})]})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>d(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Ne,children:"Next"},"step3_handler")})]})})]})}),h.jsx(Zn,{eventKey:2,title:"Step 3",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsx(Ga,{size:"",className:"mb-1",children:"Choose a graphic and write a personalised message"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Personal Note (optional)"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},value:D,onChange:Re=>P(Re.target.value),placeholder:"",name:"message",autoComplete:"off"})]}),h.jsxs("div",{className:"pt-2",children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Choose a graphic"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto"},children:h.jsx(fn,{className:"row-cols-3 g-2",children:(Ve=ae==null?void 0:ae.images)==null?void 0:Ve.map(Re=>h.jsx(Gt,{children:h.jsx(ert,{item:Re,className:`${y.some(Be=>Be.id===Re.id)?"selected":""}`,type:"single",title:Re==null?void 0:Re.id,subTitle:"",iconImg:Re==null?void 0:Re.image,handleImageSelect:ie})},Re.id))})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>d(1),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Ne,children:j?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"})})})]})})]})})]})})})})})}function y4({className:n,type:t,item:i,name:s,title:l,subTitle:d,id:u,iconImg:p,isDisabled:g,isChecked:_,handleChange:y,selectedUserList:E,setSelectedUserList:b}){const A=n||"",N=t||"radio",O=p||((i==null?void 0:i.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),D=l||"Guest User",P=d||"",j={};g?j.disabled=!0:j.disabled=!1;function M(V){console.log(V.target),console.log(JSON.stringify(V.target.value)),y(V),b&&b(H=>[{id:V.target.value,name:D,image:O}])}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-1 custom-radio-list-btn-card card-md ${A}`,children:[h.jsx("input",{type:N,id:u,name:s,value:i.id,onChange:M,...j,checked:_||!1}),h.jsx("label",{htmlFor:u,children:h.jsxs(et.Body,{className:"position-relative rounded-1",children:[h.jsx("div",{className:"d-flex profile-info-container align-items-center",children:h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[h.jsx("div",{className:"media-icon-wrapper flex-shrink-0",children:h.jsx(us,{src:O,alt:`${D} image`,className:"img-fluid"})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container d-flex flex-wrap",children:[h.jsx("span",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${D} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:$R(P)})]})]})}),h.jsx(Zt,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(Zt,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})]})})}function Mst({className:n,item:t,name:i,title:s,id:l,iconImg:d,isDisabled:u,isChecked:p,handleChange:g}){const _=n||"",y={};u?y.disabled=!0:y.disabled=!1;function E(b){console.log(b.target),console.log(JSON.stringify(b.target.value)),g(b)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-2 overflow-hidden custom-radio-img-gallery-btn-card card-md ${_} h-100`,children:[h.jsx("input",{type:"radio",id:l,name:i,value:t.id,onChange:E,...y}),h.jsx("label",{htmlFor:l,className:"h-100",children:h.jsxs(et.Body,{className:"position-relative rounded-1 h-100 d-flex align-items-center",children:[h.jsx("div",{className:"card-overlay bg-gray-normal-overlay",children:h.jsx(Zt,{tag:"check2",className:"font-24"})}),h.jsx(us,{src:d,alt:`${l} image`,className:"img-fluid"})]})})]})})}const H7=hc("Preferences",{web:()=>Xi(()=>import("./web-Dzl3-xxO.js"),__vite__mapDeps([])).then(n=>new n.PreferencesWeb)});function jst(){Ii();const[n,t]=k.useState([]),[i,s]=k.useState([]),[l,d]=k.useState([]),[u,p]=k.useState(!1),[g,_]=k.useState([]),[y,E]=k.useState([]),[b,A]=k.useState("step1"),[N,O]=k.useState(!1),D=JSON.parse(Ai.getAuthUser()),P=k.useRef(),j=()=>{P.current.value="",s(n)};function M(de,G){console.log("searchItems - filteredData =",G);const ie=G.filter((_e,he)=>_e.name.toLowerCase().includes(de.toLowerCase())||_e.designation.toLowerCase().includes(de.toLowerCase()));return console.log("Result =",ie),ie}const V=tx.debounce(de=>{console.log("This is function from lodash..."),console.log("Search text =",de);const G=n;de.trim().length>0?(console.log(de.trim()),s(M(de.trim(),G))):s(G)},500),H=(de,G)=>{var ie,_e,he;if(console.log("Key in handleSelectedTab =",de),console.log("formik in handleSelected Tag = ",G),b==="step1"&&(G!=null&&G.values)&&!((ie=G.values)!=null&&ie.receiver_id)){Qt("User not selected!","error");return}if(b==="step2"&&(G!=null&&G.values)&&!((_e=G.values)!=null&&_e.reason)){Qt("Reason not selected!","error");return}if(b==="step2"&&(G!=null&&G.values)&&((he=G.values)==null?void 0:he.reason.toLowerCase())==="other"&&!G.values.own_reason){Qt("Own Reason is empty!","error");return}A(de)},$={receiver_id:"",reason:"",own_reason:"",icon:"",image:"",points:"",message:""},Q=uc({}),Y=async(de,{resetForm:G})=>{var Ne;if(console.log("Form Values :",de),b==="step3"&&de&&!(de!=null&&de.image)){Qt("Graphics not selected!","error");return}const ie=n.filter(Fe=>Fe.id===de.receiver_id)[0];console.log("receiver_info = ",ie);const _e=g.filter(Fe=>Fe.id===de.reason)[0];console.log("selectedReason = ",_e);const he={};!_e&&de.own_reason?(he.reason=de.own_reason,he.points=0,he.icon="/img/default-profile.jpg"):(he.reason=_e.reason,he.points=_e.points,he.icon=_e.icon),console.log("reasonInfo = ",he);const Ce=(Ne=y.filter(Fe=>Fe.id===de.image)[0])==null?void 0:Ne.image,fe=`${D.name} appreciated ${ie.firstname} ${ie.lastname}`,me={receiver_id:de.receiver_id,receiver_info:ie,title:fe,reason:he.reason,icon:he.icon,image:Ce,points:he.points,message:de.message};console.log("Final formData = ",me)};async function le(de){p(!0),hs.getAllRecipients(de).then(G=>{var ie,_e;if(console.log("getAllRecipients called == ",G.data),G.data.status==="success"){const he=(_e=(ie=G.data)==null?void 0:ie.data)==null?void 0:_e.recipients;t(he),s(he),p(!1)}}).catch(G=>{console.log("ERROR in getAllRecipients ",G),t([]),s([]),p(!1)})}async function ae(){Z4.getAppreciationCreationHelpers().then(de=>{var G,ie;if(console.log("getAppreciationCreationHelpers called == ",de.data),de.data.status==="success"){const _e=(G=de.data)==null?void 0:G.data.images,he=(ie=de.data)==null?void 0:ie.data.reasons;E(_e),_(he)}}).catch(de=>{console.log("ERROR in getAppreciationCreationHelpers ",e),E([]),_([])})}const te=async()=>{p(!0);const{value:de}=await H7.get({key:"appreciationUsers"});if(console.log("Appreciation Users:",JSON.parse(de)),de){let G=JSON.parse(de);t(G),s(G),p(!1)}else le("appreciation")};return k.useEffect(()=>{te(),ae()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(id,{initialValues:$,validationSchema:Q,onSubmit:Y,children:de=>{var G,ie,_e;return h.jsxs(kt,{className:"form_style",onSubmit:de.handleSubmit,children:[h.jsxs(Zn.Container,{id:"appreciation-step-form",className:"main_tabs",activeKey:b,onSelect:he=>H(he),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(jn,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step3",children:h.jsx("div",{children:"3"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),!u&&(n==null?void 0:n.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:he=>{console.log("Search input = ",he),V(he.target.value)},ref:P,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((G=P==null?void 0:P.current)==null?void 0:G.value.length)>0&&h.jsx(Pt,{onClick:j,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(VE,{})},"search-clear-btn"),((ie=P==null?void 0:P.current)==null?void 0:ie.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${i==null?void 0:i.length}`})]})}):h.jsx(h.Fragment,{}),l&&l.length>0?h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-14 me-2",children:"Selected: "}),l.map((he,Ce)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:he.image,className:"img-fluid mx-auto",alt:he.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-2 font-12 text-truncate flex-grow-1",children:he.name})]},he.id))]})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto"},children:u?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!u&&(n==null?void 0:n.length)>0?h.jsx(h.Fragment,{children:(i==null?void 0:i.length)>0?h.jsx(h.Fragment,{children:i.map((he,Ce)=>h.jsx(y4,{className:`${i.length!==Ce+1?"border-bottom":""}`,name:"receiver_id",item:he,inputName:"users",title:Pv(he==null?void 0:he.firstname,he==null?void 0:he.lastname),subTitle:he==null?void 0:he.designation,id:he==null?void 0:he.id,iconImg:he==null?void 0:he.avatar,handleChange:de.handleChange,isDisabled:!1,isChecked:de.values.receiver_id.indexOf(he==null?void 0:he.id)>-1,initialValues:$==null?void 0:$.receiver_id,selectedUserList:l,setSelectedUserList:d},he.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>H("step2",de),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-2",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select appreciation reason"]}),h.jsxs("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:[(g==null?void 0:g.length)>0&&g.map(he=>{var Ce;return h.jsx(y4,{className:"card-normal-radius",name:"reason",item:he,inputName:"reasons",title:he.reason,subTitle:"",id:he==null?void 0:he.id,iconImg:he==null?void 0:he.icon,handleChange:de.handleChange,isDisabled:!1,isChecked:((Ce=de.values)==null?void 0:Ce.reason.indexOf(he.id))>-1,initialValues:$==null?void 0:$.reason},he.id)}),h.jsx(y4,{className:"card-normal-radius",name:"reason",item:{id:"other"},inputName:"reasons",title:"Write your own",subTitle:"",id:"other",iconImg:"/img/default-profile.jpg",handleChange:de.handleChange,isDisabled:!1,isChecked:((_e=de.values)==null?void 0:_e.reason.indexOf("other"))>-1,initialValues:null})]})]}),h.jsx("div",{children:de.values.reason==="other"&&h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Write your own reason"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"own_reason",...de.getFieldProps("own_reason"),autoComplete:"off"})]})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>H("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>H("step3",de),children:"Next"},"step3_handler")})]})})]}),h.jsx(Zn.Pane,{className:"",eventKey:"step3",children:h.jsxs("div",{className:"form-step-container",children:[h.jsx("div",{className:"font-14 fw-sb py-2",children:"Choose a graphic and write a personalised message"}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsx(kt.Label,{className:"font-14 fw-sb",children:"Personal Note"}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"message",...de.getFieldProps("message"),autoComplete:"off"}),de.touched.message&&de.errors.message?h.jsx("p",{className:"error-state-text font-12 text-danger",children:de.errors.message}):null]})}),h.jsxs("div",{className:"pt-2",children:[h.jsxs("div",{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Choose a graphic"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto"},children:h.jsx(fn,{className:"row-cols-3 g-2",children:(y==null?void 0:y.length)>0&&y.map(he=>h.jsx(Gt,{children:h.jsx(Mst,{className:"",name:"image",item:he,inputName:"images",title:he.id,subTitle:"",id:he==null?void 0:he.id,iconImg:he==null?void 0:he.image,handleChange:de.handleChange,isDisabled:!1,initialValues:$==null?void 0:$.image})},he.id))})})]})]})})]})]}),b==="step3"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>H("step2"),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Pt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:N?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):de.isValid?"Submit":"Please fill out all info"})})})]})})]})}})})})}function Ust({contest:n,className:t,handleCompetitionContestBtnClick:i}){const s=t||"",l=n!=null&&n.role?n==null?void 0:n.role:"",d=n!=null&&n.contest_name?n==null?void 0:n.contest_name:"";n!=null&&n.cover_image&&(n==null||n.cover_image);const u=n!=null&&n.points_unit?n==null?void 0:n.points_unit:"Points",p=n!=null&&n.points?n==null?void 0:n.points:0,g=n!=null&&n.team_points?n==null?void 0:n.team_points:0,_=n!=null&&n.team_rank?n==null?void 0:n.team_rank:0,y=n!=null&&n.team_rank_out_of?n==null?void 0:n.team_rank_out_of:0,E=n!=null&&n.rank_in_team?n==null?void 0:n.rank_in_team:0,b=n!=null&&n.rank_in_team_out_of?n==null?void 0:n.rank_in_team_out_of:0,A=n!=null&&n.team_dashboard?n==null?void 0:n.team_dashboard:null,N=n!=null&&n.contest_dashboard?n==null?void 0:n.contest_dashboard:null,O=n!=null&&n.top3?n==null?void 0:n.top3:[];function D(P,j){console.log("----- Inside handleBtnClick ----"),i(P,j)}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`border-0 card-theme shadow-sm campaigns-card overflow-hidden ${s}`,children:[h.jsx(et.Header,{className:"border-bottom-0 p-2 pb-1 p-sm-3 line-clamp",children:h.jsx("div",{className:"d-flex align-items-center",children:h.jsx("div",{className:"ms-",children:d})})}),h.jsxs(et.Body,{className:"p-2 p-sm-3",children:[l.toLowerCase()==="player"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-0 py-3 bg-primary-lighter rounded-3 mb-1",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-primary-lighter bg-transparent border-botto border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`Team ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"insights1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-secondary",children:[g," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-botto rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Team Rank"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"crown1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-secondary",children:[_," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",y,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-md btn-secondary w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]}),h.jsxs("div",{className:"px-0 py-3 bg-warning-lighter rounded-3",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`My ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"insights1",className:"font-20 text-theme-secondary"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[p," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-star rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Rank in Team"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"crown1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[E," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",b,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-md btn-badges w-100",onClick:()=>{D(n,A)},children:"Team Dashboard"})})})]})]}),l.toLowerCase()==="observer"&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"px-0 py-3 bg-primary-lighter rounded-3",children:[h.jsxs("div",{className:"font-13 fw-sb text-uppercase flex-grow-1 px-1 d-flex align-items-center justify-content-center mb-2",children:[h.jsx(Pt,{type:"button",className:"btn btn-theme btn-secondary btn-sm rounded-circle btn-icon pe-none",children:h.jsx(Zt,{tag:"crown1",className:"font-18"})}),h.jsx("span",{className:"lh-1 ms-1",children:"Toppers"})]}),(O==null?void 0:O.length)>0?h.jsxs(h.Fragment,{children:[h.jsx(fn,{className:"row-cols-3 g-0",children:O==null?void 0:O.map((P,j)=>{const M=P!=null&&P.team_image?P==null?void 0:P.team_image:"/img/default-bg.jpg",V=P!=null&&P.team_name?P==null?void 0:P.team_name:"",H=P!=null&&P.rank?P==null?void 0:P.rank:"";return h.jsx(Gt,{className:"",children:h.jsxs(et,{className:`border-0 campaigns-counter-card bg-primary-lighter bg-transparent rounded-0 h-100 ${j+1!==(O==null?void 0:O.length)?"border-end":""}`,children:[h.jsx(et.Header,{className:"border-0 text-center pt-3 pb-0 px-2",children:h.jsx("div",{className:"ms-2 font-13 fw-sb text-center lh-sm text-gray6",children:V})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center justify-content-center p-2 pt- position-relative",children:h.jsx("div",{className:"d-flex align-items-center mb-2",children:h.jsx("div",{className:"flex-shrink-0",style:{width:60},children:h.jsx(us,{src:M,alt:V,wrapperClassName:"img-fluid"})})})}),h.jsx(et.Footer,{className:"border-theme-top border-0 p-2 pt-0 bg-transparent text-center",children:h.jsx("div",{className:"btn btn-theme btn-icon btn-sm bg-primary-light-overlay rounded-circle fw-sb shadow-sm",children:H})})]})},P==null?void 0:P.team_name)})}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-md btn-secondary w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]}):h.jsx("div",{children:"No toppers found"})]})}),l.toLowerCase()==="non_player"&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"px-0 py-3 bg-warning-lighter rounded-3",children:[h.jsxs(fn,{className:"row-cols-2 g-0",children:[h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-end rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:`Team ${u}`}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"insights1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[g," ",h.jsx("span",{className:"font-13 text-gray8"})]})})]})}),h.jsx(Gt,{className:"",children:h.jsxs(et,{className:"border-0 campaigns-counter-card bg-gray-lighter bg-transparent border-star rounded-0 h-100",children:[h.jsx(et.Header,{className:"bg-transparent border-0 p-2 position-relative py-0",children:h.jsxs("div",{className:"d-flex align-items-center",children:[h.jsx("div",{className:"font-13 fw-sb text-uppercase text-gray7 flex-grow-1 px-1",children:"Team Rank"}),h.jsx("span",{className:"position-absolute flex-shrink-0",style:{right:10,top:"-2px"},children:h.jsx(Zt,{tag:"crown1",className:"font-20 text-theme-warning"})})]})}),h.jsx(et.Body,{className:"d-flex flex-column align-items-center p-2 pt- position-relative",children:h.jsxs("div",{className:"font-26 text-theme-warning",children:[_," ",h.jsxs("span",{className:"font-13 text-gray8",children:["(",y,")"]})]})})]})})]}),h.jsx(fn,{className:"row-cols-1 mt-2 d-flex justify-content-center",children:h.jsx(Gt,{className:"col-8",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-badges w-100",onClick:()=>{D(n,N)},children:"Contest Dashboard"})})})]})})]})]})})}function Fst(){const n=Ii(),[t,i]=k.useState([1,2]),[s,l]=k.useState(!0);async function d(){console.log("Inside Dashboard: getAllCompetitionContests()..."),Wa.getAllCompetitionContests().then(p=>{console.log("getAllCompetitionContests RES = ",p.data),p.data.status==="success"&&(i(p.data.data.items),l(!1))}).catch(p=>{l(!1),i([]),console.log("Error in getAllCompetitionContests = ",p)})}k.useEffect(()=>{d()},[]);function u(p,g){p&&n("/competition-contests/competition-contest-details",{state:{item:p,url:g,pageTitle:p==null?void 0:p.contest_name}})}return h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:s?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-3",children:[0,1].map((p,g)=>h.jsx(ci,{type:"competition-contest",className:"card-theme overflow-hidden"},g))})}):h.jsx(h.Fragment,{children:t.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-grid gap-4",children:t.map((p,g)=>h.jsx(Ust,{className:"",contest:p,handleCompetitionContestBtnClick:u},g))})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"card-theme border-0 shadow-sm p-3 rounded-3 font-14",children:"No more contests"})})})})})}function Bst(){const[n,t]=k.useState(!0),{state:i}=Xo();return console.log("Data passed via navigate = ",i),h.jsx(qi,{className:"",children:h.jsxs(Yn,{className:"rati0 ratio-1x1 position-relativ px-0",style:{height:"calc(100vh - 160px)",zIndex:1},children:[n?h.jsx(ci,{type:"iframe-loader"}):null,h.jsx("iframe",{src:`${i.url}`,title:"Competition Contest Details",onLoad:()=>t(!1),className:`no-scrollbar ${n?"opacity-0":""}`,sandbox:"allow-scripts",height:"100%",width:"100%"})]})})}function Vst(){const n=Ii(),t=["name","firstname","lastname","designation"],i="badges",[s,l]=k.useState(0),[d,u]=k.useState([]),[p,g]=k.useState([]),[_,y]=k.useState(""),[E,b]=k.useState(!1),A=async({queryKey:G})=>{var he,Ce;const[ie,_e]=G;try{const fe=await hs.getAllRecipients(_e);if(fe.data.status==="success"){const me=((Ce=(he=fe.data)==null?void 0:he.data)==null?void 0:Ce.recipients)||[],Ne=new Set;return me.filter(je=>Ne.has(je.id)?!1:(Ne.add(je.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}};async function N(){var G,ie,_e;try{const he=await Q4.getBadgeCreationHelpers();return((G=he==null?void 0:he.data)==null?void 0:G.status)==="success"?(_e=(ie=he==null?void 0:he.data)==null?void 0:ie.data)==null?void 0:_e.badges:null}catch{throw new Error("Error fetching appreciation creation helpers")}}const{isPending:O,isError:D,data:P,error:j}=Qd({queryKey:["badgeRecipients",i],queryFn:A}),{data:M}=Qd({queryKey:["badgeCreationHelpers"],queryFn:N}),V=k.useMemo(()=>FO(P,_,t),[P,_]),H=(G,ie="single")=>{u(ie==="single"?[G]:_e=>_e.some(he=>he.id===G.id)?_e.filter(he=>he.id!==G.id):[..._e,G])},$=(G,ie="single")=>{g(ie==="single"?[G]:_e=>_e.some(he=>he.id===G.id)?_e.filter(he=>he.id!==G.id):[..._e,G])},Q=({index:G,key:ie,style:_e})=>{const he=V[G];return h.jsx("div",{style:_e,children:h.jsx(RC,{item:he,className:`user-card ${d.some(Ce=>Ce.id===he.id)?"selected":""} ${V.length!==G+1?"border-bottom":""}`,type:"single",title:he!=null&&he.firstname?Pv(he==null?void 0:he.firstname,he==null?void 0:he.lastname):he==null?void 0:he.name,subTitle:he==null?void 0:he.designation,iconImg:he==null?void 0:he.avatar,isRoundedIcon:!0,handleItemSelect:H})},ie)},Y=()=>d.length===0?(Qt("Users not selected!","error"),!1):!0,le=()=>(p==null?void 0:p.length)===0?(Qt("Badge not selected!","error"),!1):!0;function ae(G){l(Number(G))}const te=()=>{s===0&&Y()?l(1):s===1&&le()&&de()};async function de(){b(!0);const G=d[0],ie=p[0],_e={receiver_id:G==null?void 0:G.id,receiver_info:G,badge_id:ie.id,status:"active"};Q4.sendBadge(_e).then(he=>{console.log("sendBadge response result = ",he.data),he.data.status==="success"&&(b(!1),Qt("Badge sent successfully!","success"),n("/badges",{state:{data:"sent"}}))}).catch(he=>{console.log(he),Qt("Failed to Send Badge!","error")}).finally(()=>{b(!1)})}return O?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):D?h.jsx(Ga,{className:"mt-5",children:j.message}):h.jsx(h.Fragment,{children:h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx("div",{className:"send-badges-page",children:h.jsxs(vU,{activeKey:s,onSelect:ae,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to give a badge?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(XO,{filters:t,onSearch:G=>y(G),className:"mb-"}),(V==null?void 0:V.length)>0&&(_==null?void 0:_.length)>0&&h.jsx(Ga,{size:"sm",className:"px-1 text-gray9",children:`Results found ${V==null?void 0:V.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(BZ,{items:d,className:"",type:"single",handleRemoveItems:H})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(oF,{children:({height:G,width:ie})=>h.jsx(cF,{width:ie,height:G,rowHeight:60,rowCount:V.length,rowRenderer:Q})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:te,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select a badge"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:h.jsx(h.Fragment,{children:(M==null?void 0:M.length)>0&&M.map(G=>h.jsx(h.Fragment,{children:h.jsx(RC,{item:G,className:`user-card ${p.some(ie=>ie.id===(G==null?void 0:G.id))?"selected":""}`,type:"single",title:G==null?void 0:G.title,subTitle:"",iconImg:G==null?void 0:G.image,isRoundedIcon:!1,handleItemSelect:$},G==null?void 0:G.id)}))})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>l(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:te,children:E?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"},"submit_handler")})]})})]})})]})})})})})}function zst(){const n=Ii(),[t,i]=k.useState([]),[s,l]=k.useState([]),[d,u]=k.useState([]),[p,g]=k.useState(!1),[_,y]=k.useState([]),[E,b]=k.useState("step1"),[A,N]=k.useState(!1);JSON.parse(Ai.getAuthUser());const O=k.useRef(),D=()=>{O.current.value="",l(t)};function P(te,de){console.log("searchItems - filteredData =",de);const G=de.filter((ie,_e)=>ie.firstname.toLowerCase().includes(te.toLowerCase())||ie.lastname.toLowerCase().includes(te.toLowerCase())||ie.designation.toLowerCase().includes(te.toLowerCase()));return console.log("Result =",G),G}const j=tx.debounce(te=>{console.log("This is function from lodash..."),console.log("Search text =",te);const de=t;te.trim().length>0?(console.log(te.trim()),l(P(te.trim(),de))):l(de)},500),M=(te,de)=>{var G;if(console.log("Key in handleSelectedTab =",te),console.log("formik in handleSelected Tag = ",de),E==="step1"&&(de!=null&&de.values)&&!((G=de.values)!=null&&G.receiver_id)){Qt("User not selected!","error");return}b(te)},V={receiver_id:"",badge_id:"",points:""},H=uc({}),$=async(te,{resetForm:de})=>{if(console.log("Form Values :",te),E==="step2"&&te&&!(te!=null&&te.badge)){Qt("badge not selected!","error");return}const G=t.filter(Ce=>Ce.id===te.receiver_id)[0];console.log("receiver_info = ",G);const ie=_.filter(Ce=>Ce.id===te.badge)[0];console.log("selectedBadge = ",ie);const _e={receiver_id:te.receiver_id,receiver_info:G,badge_id:ie.id,status:"active"};console.log("Final formData = ",_e);const he=await le(_e);console.log("sendBadgeResponse in onSubmit = ",he)};async function Q(te){g(!0),hs.getAllRecipients(te).then(de=>{var G,ie;if(console.log("getAllRecipients called == ",de.data),de.data.status==="success"){const _e=(ie=(G=de.data)==null?void 0:G.data)==null?void 0:ie.recipients;i(_e),l(_e),g(!1)}}).catch(de=>{console.log("ERROR in getAllRecipients ",de),i([]),l([]),g(!1)})}async function Y(){Q4.getBadgeCreationHelpers().then(te=>{var de;if(console.log("getBadgeCreationHelpers called == ",te.data),te.data.status==="success"){const G=(de=te.data)==null?void 0:de.data.badges;y(G)}}).catch(te=>{console.log("ERROR in getBadgeCreationHelpers ",e),y([])})}async function le(te){console.log("called sendBadge in sendBadge comp...",te),N(!0),Q4.sendBadge(te).then(de=>{console.log("sendBadge response result = ",de.data),de.data.status==="success"&&(N(!1),Qt("Badge sent successfully!","success"),n("/badges",{state:{data:"sent"}}))}).catch(de=>{console.log(de),N(!1),Qt("Failed to Send Badge!","error")})}const ae=async()=>{g(!0);const{value:te}=await H7.get({key:"badgeUsers"});if(console.log("Badge Users:",JSON.parse(te)),te){let de=JSON.parse(te);i(de),l(de),g(!1)}else Q("badges")};return k.useEffect(()=>{ae(),Y()},[]),h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(id,{initialValues:V,validationSchema:H,onSubmit:$,children:te=>{var de,G;return h.jsxs(kt,{className:"form_style",onSubmit:te.handleSubmit,children:[h.jsxs(Zn.Container,{id:"badge-step-form",className:"main_tabs",activeKey:E,onSelect:ie=>M(ie),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(jn,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to give a badge?"]}),!p&&(t==null?void 0:t.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:ie=>{console.log("Search input = ",ie),j(ie.target.value)},ref:O,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((de=O==null?void 0:O.current)==null?void 0:de.value.length)>0&&h.jsx(Pt,{onClick:D,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(VE,{})},"search-clear-btn"),((G=O==null?void 0:O.current)==null?void 0:G.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${s==null?void 0:s.length}`})]})}):h.jsx(h.Fragment,{}),d&&d.length>0?h.jsx(h.Fragment,{children:h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-14 me-2",children:"Selected: "}),d.map((ie,_e)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:ie.image,className:"img-fluid mx-auto",alt:ie.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-2 font-12 text-truncate flex-grow-1",children:ie.name})]},ie.id))]})})}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto"},children:p?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!p&&(t==null?void 0:t.length)>0?h.jsx(h.Fragment,{children:(s==null?void 0:s.length)>0?h.jsx(h.Fragment,{children:s.map((ie,_e)=>h.jsx(y4,{className:`${s.length!==_e+1?"border-bottom":""}`,name:"receiver_id",item:ie,inputName:"users",title:Pv(ie==null?void 0:ie.firstname,ie==null?void 0:ie.lastname),subTitle:ie==null?void 0:ie.designation,id:ie==null?void 0:ie.id,iconImg:ie==null?void 0:ie.avatar,handleChange:te.handleChange,isDisabled:!1,isChecked:te.values.receiver_id.indexOf(ie==null?void 0:ie.id)>-1,initialValues:V==null?void 0:V.receiver_id,selectedUserList:d,setSelectedUserList:u},ie.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>M("step2",te),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-2",children:[h.jsx("span",{className:"text-danger",children:"*"})," Select badge"]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3",style:{overflowY:"auto",borderBottom:"1px solid var(--color-gray-light5)"},children:(_==null?void 0:_.length)>0&&_.map(ie=>{var _e,he;return h.jsx(y4,{className:"card-normal-radius",name:"badge",item:ie,inputName:"badges",title:ie.title,subTitle:`${ie.points} Points`,id:ie==null?void 0:ie.id,iconImg:ie==null?void 0:ie.image,handleChange:te.handleChange,isDisabled:!1,isChecked:((he=(_e=te.values)==null?void 0:_e.badge)==null?void 0:he.indexOf(ie.id))>-1,initialValues:V==null?void 0:V.badge_id},ie.id)})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>M("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>M("step3",te),children:"Next"},"step3_handler")})]})})]})]})]}),E==="step2"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>M("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Pt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:A?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):te.isValid?"Submit":"Please fill out all info"})})})]})})]})}})})})}function Hst({mediaType:n,mediaSource:t,setUploadMediaUrl:i,className:s,contestId:l,handleClose:d,data:u,fileSizelimit:p,videoDurationLimit:g,audioDurationLimit:_}){console.log("mediaSource = ",t),Ii();const[y,E]=k.useState(),[b,A]=k.useState(null),[N,O]=k.useState(""),[D,P]=k.useState(null),[j,M]=k.useState(""),[V,H]=k.useState(0),[$,Q]=k.useState(!1),[Y,le]=k.useState(0),[ae,te]=k.useState(!1);k.useState(!1);const[de,G]=k.useState(!1),[ie,_e]=k.useState(null),[he,Ce]=k.useState(!1),{counter:fe,handleStart:me,handlePause:Ne,handleReset:Fe}=FZ(0,!0),je=k.useRef(!1);k.useRef(null);const Ve=k.useRef(null),Re=k.useRef(null);k.useRef(null);const Be=k.useRef(null),Xe=k.useRef(null);k.useRef(null);const we={title:""},Ge=uc({}),rt=n?n==="pdf"?".pdf":`${n}/*`:"image/*",pt=n!==""?"user":"",Ze=n?`${n}-gallery-file`:"media-gallery-file",Je=n?`${n}-camera-file`:"media-camera-file",_t=()=>{Ce(!1)},Xt=an=>{console.log("handleShowRecordAudioModal () - MEDIA TYPE = ",an),Ce(!0)};async function Ht(){console.log("onRecordingStart called...");const an=await Lp.startRecording();console.log("recordStartResult = ",an)}async function gn(){console.log("onRecordingStop called...");const an=await Lp.stopRecording();if(console.log("onRecordingStop counter =",fe),console.log("recordStopResult = ",an),an.value){const ne=an.value;H(Math.round(ne.msDuration/1e3)),Q(!0),G(!0);const Se=ne.msDuration,Ue=Math.round(Se/1e3);console.log("fileDurationInMS = ",Se," fileDurationInSec =",Ue);const tt=ne.recordDataBase64,Te=ne.mimeType;let Pe=Te.substring(0,Te.indexOf(";"));const Qe=`data:${Pe};base64,${tt}`;var ye=It(Qe);console.log("Binary file =",ye);var J=new Blob([ye],{type:`${Pe}`});console.log("blob = ",J),E({...an.value,size:J.size}),_e(Pe);const nt=kR(J.size,{standard:"jedec"});console.log("Recorded Audio fileSize = ",nt),P(nt);const $e=URL.createObjectURL(J);console.log("blobUrl = ",$e),A($e),console.log("File Obj =",y)}else console.log("Unable to record/play audio")}function It(an){var ye=";base64,",J=an.indexOf(ye)+ye.length,ne=an.substring(J),Se=window.atob(ne),Ue=Se.length,tt=new Uint8Array(new ArrayBuffer(Ue));for(let Te=0;Te<Ue;Te++)tt[Te]=Se.charCodeAt(Te);return tt}async function xt(){if(console.log("onRecordBtnClick called..."),(await Lp.canDeviceVoiceRecord()).value){const ye=await Lp.hasAudioRecordingPermission();if(ye.value)console.log("hasAudioPermission set",ye),Xt();else{console.log("hasAudioPermission not set...request permissions...",ye);const J=await Lp.requestAudioRecordingPermission();console.log("requestedPermissionResult = ",J)}}}function mt(an){if(console.log("Inside handleChange =",an.target.files[0]),an.target.files[0]){E(an.target.files[0]),Q(!0);const ye=kR(an.target.files[0].size,{standard:"jedec"});switch(console.log("fileSize = ",ye),P(ye),n){case"image":let J=URL.createObjectURL(an.target.files[0]);Ve.current.src=J,Ve.current.className="d-block",O(an.target.files[0].name);break;case"video":let ne=URL.createObjectURL(an.target.files[0]);console.log("blobVideoURL =",ne),A(ne);break;case"audio":let Se=URL.createObjectURL(an.target.files[0]);console.log("Case audio: ",Se),A(Se);break;case"pdf":console.log("PDF Preview =",Re.current),Re.current.className="d-block",O(an.target.files[0].name);break;default:console.log("No case matched...")}}}function dt(){if(y)switch(E(null),Q(!1),O(""),M(""),P(null),Fe(),Be.current&&(Be.current.value=""),Xe.current&&(Xe.current.value=""),n){case"image":console.log("Image Preview =",Ve.current),Ve.current.src="",Ve.current.className="d-none";break;case"video":A(null);break;case"audio":A(null),G(!1);break;case"pdf":console.log("PDF Preview =",Re.current),Re.current.className="d-none";break;default:console.log("No case matched...")}}const it=an=>new Promise((ye,J)=>{const ne=new FileReader;ne.onload=()=>{const Se=ne.result;ye(Se)},ne.onerror=()=>{J(new Error("Unable to read the file as binary data"))},ne.readAsArrayBuffer(an)}),Me=new AbortController,bt=zr.CancelToken.source();k.useEffect(()=>()=>{console.log("Called cancellation from UploadResponseMediaFile..."),je.current&&(console.log("Called cancellation inside if(bool.current)...",je==null?void 0:je.current),bt.cancel("Upload cancelled by user"),Me.abort())},[je.current]);function St(){je.current=!0,d(),bt.cancel("Upload cancelled by user"),Me.abort(),Me.signal.aborted&&Qt("Uploading cancelled!","error")}const Lt=async(an,{resetForm:ye})=>{if(console.log("Form Values :",an),console.log("bool at start of onSubmit = ",je==null?void 0:je.current),N===""){console.log('Inside if (mediaUrl === "")'),Qt("Upload Valid File","error");return}te(!0);let J="";de?J=ie.split("/")[1]:J=y.name.substring(y.name.lastIndexOf(".")+1);const ne={fileextention:J,modulename:"wallmessage"};console.log("data for getSignedUrl = ",ne);const Se=await hs.getSignedUploadUrl(ne);let Ue=null;if(de){const Pe=y==null?void 0:y.recordDataBase64,Qe=y==null?void 0:y.mimeType,$e=`data:${Qe.substring(0,Qe.indexOf(";"))};base64,${Pe}`;Ue=It($e),console.log("Binary file =",Ue)}else Ue=await it(y);const tt={headers:{},cancelToken:bt.token,signal:Me.signal,onUploadProgress:function(Pe){const Qe=Math.round(Pe.loaded*100/Pe.total);le(Qe)}};console.log(tt);const Te=await zr.put(Se.data.data.uploadURL,Ue,tt);if(console.log("result =",Te),console.log("result status =",Te.status),Te.status===200){if(console.log("uploadProgress =",Y),console.log("bool after upload = ",je==null?void 0:je.current),je.current){i("");return}i(Se.data.data.resourceUrl),setTimeout(()=>{d()},500)}else console.log("THERE IS AN ERROR IN uploadConfig...");console.log("Outside if uploadProgress =",Y)};function tn(an){console.log("getDuration called...",an),de||H(Math.round(an))}const un=({played:an,playedSeconds:ye,loaded:J,loadedSeconds:ne})=>{var Se,Ue,tt;console.log("File Obj =",y),console.log("handleProgress called...",J),n==="video"&&V>((Se=u==null?void 0:u.limits)==null?void 0:Se.video)||n==="audio"&&V>((Ue=u==null?void 0:u.limits)==null?void 0:Ue.audio)||(y==null?void 0:y.size)>((tt=u==null?void 0:u.limits)==null?void 0:tt.size)*1024*1024?(console.log("getDuration condition If part"),console.log("fileDuration = ",V," mediaType = ",n," Size =",y==null?void 0:y.size),O("")):(console.log("getDuration condition else part"),console.log("fileDuration = ",V," mediaType = ",n," Size =",y==null?void 0:y.size),O(y.name),M(""))};return console.log("Duaration in minutes = ",pE(V)),console.log("D in minutes using secondsToTime = ",eQ(V,":")),h.jsxs(h.Fragment,{children:[h.jsx(id,{initialValues:we,validationSchema:Ge,onSubmit:Lt,enableReinitialize:!0,children:an=>{var ye,J,ne;return h.jsxs(kt,{className:"form_style",onSubmit:an.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2",children:[h.jsx("div",{className:"font-13",children:"Choose upload from"}),h.jsx("div",{className:"btn-wrap d-flex py-2",children:t.length>0&&h.jsx(h.Fragment,{children:t.map((Se,Ue)=>Se.toLowerCase()!=="camera"?h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Xe,name:Ze,id:Ze,className:"uploadMediafile",accept:rt,onChange:mt,disabled:$}),h.jsx("label",{htmlFor:Ze,className:"justify-content-center px-2 gallery-btn",children:"Gallery"})]},`${Se}-${Ue}`):h.jsxs(dn.Fragment,{children:[(n==="video"||n==="image")&&h.jsxs("div",{className:"flex-grow-1",children:[h.jsx("input",{type:"file",ref:Be,name:Je,id:Je,className:"uploadMediafile",capture:pt,accept:rt,onChange:mt,disabled:$}),h.jsx("label",{htmlFor:Je,className:"justify-content-center px-2 capture-btn",children:"Camera"})]}),n==="audio"&&h.jsx("div",{className:"flex-grow-1",children:h.jsx(Pt,{onClick:xt,className:"btn-theme btn-primary btn-md w-100 font-14 fw-sb",style:{padding:"10px 12px"},children:"Record"})})]},`${Se}-${Ue}`))})})]}),Y>0&&h.jsxs("div",{className:"d-flex justify-content-center align-items-center p-2 pb-0",children:[h.jsx("progress",{value:Y,max:"100"}),h.jsx("span",{className:"font-12 fw-sb ps-2",children:`${Y}%`})]}),h.jsx("div",{className:"d-flex justify-content-between font-14",children:!y&&V<=0?"No file selected":n==="video"&&V>((ye=u==null?void 0:u.limits)==null?void 0:ye.video)||n==="audio"&&V>((J=u==null?void 0:u.limits)==null?void 0:J.audio)||(y==null?void 0:y.size)>((ne=u==null?void 0:u.limits)==null?void 0:ne.size)*1024*1024?h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${y?"d-flex":"d-none"}`,style:{background:"var(--color-red-lighter)"},children:[h.jsxs("span",{className:" fw-sb font-13 flex-grow- me-1",children:[h.jsx("span",{className:"text-dange",children:"Upload limit exceeds"})," ",pE(V)]}),h.jsx("span",{className:"fw-sb font-13",children:D?` and ${D}`:""})]})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:`p-2 rounded-1 w-100 ${y?"d-flex":"d-none"}`,style:{background:"var(--color-green-lighter)"},children:[n==="video"||n==="audio"&&h.jsxs("span",{className:"font-13 fw-sb flex-grow- text-break",children:["Uploaded file: ",pE(V)," ","+ ' and '"]}),h.jsx("span",{className:"ms-1 fw-sb font-13",children:D?`${D}`:""})]})})}),h.jsxs("div",{className:"preview-container-wrapper position-relative",children:[h.jsx(Pt,{type:"button",className:`btn-theme btn-red btn-sm btn-icon position-absolute rounded-circle ${$?"d-block":"d-none"} ${ae?"pe-none":""}`,style:{right:"-10px",top:"-10px",zIndex:1},onClick:dt,children:h.jsx(Zt,{tag:"delete7",className:"font-26"})}),h.jsx(Jd,{aspectRatio:`${n==="audio"?"21x9":n==="image"?"1x1":"16x9"}`,className:"preview-container",children:h.jsxs(h.Fragment,{children:[n==="image"&&h.jsx("img",{ref:Ve,src:"",alt:"preview image",className:"img-fluid mx-auto d-none"}),(n==="video"||n==="audio")&&h.jsx(XE,{url:b,width:"100%",height:"100%",controls:!0,playing:!1,onDuration:Se=>tn(Se),onProgress:({played:Se,playedSeconds:Ue,loaded:tt,loadedSeconds:Te})=>un({played:Se,playedSeconds:Ue,loaded:tt,loadedSeconds:Te})}),n==="pdf"&&h.jsxs("div",{ref:Re,className:"d-none",children:[h.jsx(Zt,{tag:"pdf1",className:"me-2 font-30 text-danger"}),h.jsx("span",{className:"font-16 fw-sb",children:y==null?void 0:y.name})]})]})})]}),j&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"d-flex w-100 p-1 rounded-2 mt-2",style:{background:"var(--color-red-lighter)"},children:h.jsx("span",{className:"d-block text-danger font-13 fw-sb",children:j})})}),h.jsxs("div",{className:"btn-wrap pt-3 pb-4 d-flex justify-content-center position-fixed px-3 bg-white border-top",style:{bottom:0,right:0,left:0},children:[h.jsx(Pt,{type:"button",className:"btn-theme btn-gray btn-md flex-grow-1",onClick:St,children:"Back"}),h.jsx(Pt,{type:"submit",disabled:!an.isValid,className:"btn-theme btn-primary btn-md flex-grow-1",children:ae?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):(an.isValid,"Confirm Upload")})]})]})}}),h.jsx(MSe,{show:he,handleClose:_t,onRecordingStart:Ht,onRecordingStop:gn,counter:fe,handlePause:Ne,handleStart:me,className:""})]})}function vbe(n){var l,d,u,p,g,_,y,E,b,A,N,O;console.log("UploadMessageMediaTypeModal props - ",n),k.useState(!1);const t=(d=(l=n.data)==null?void 0:l.limits)!=null&&d.size?(p=(u=n.data)==null?void 0:u.limits)==null?void 0:p.size:"NA",i=(_=(g=n.data)==null?void 0:g.limits)!=null&&_.video?(E=(y=n.data)==null?void 0:y.limits)==null?void 0:E.video:"NA",s=(A=(b=n.data)==null?void 0:b.limits)!=null&&A.audio?(O=(N=n.data)==null?void 0:N.limits)==null?void 0:O.audio:"NA";return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,size:"md",scrollable:!0,className:"theme-modal modal-bottom -modal",show:n.show.isVisible,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb",closeButton:!0,children:h.jsx(vn.Title,{className:"d-flex align-items-center",children:`Upload ${n.uploadMediaType}`})}),h.jsxs(vn.Body,{className:"no-scrollbar",style:{paddingBottom:100},children:[h.jsx(et,{className:"mb-2 mb-sm-2",children:h.jsxs(et.Body,{className:"p-1 p-sm-2 font-13 text-gray4",style:{background:"var(--color-yellow-lighter)"},children:[h.jsx("span",{className:"fw-b font-13",children:"Note: "}),"Upload file size should not exceeds"," ",h.jsx("span",{className:"fw-b text-danger",children:t!=="NA"&&`${t} mb`})," ",n.uploadMediaType.toLowerCase()==="audio"||n.uploadMediaType.toLowerCase()==="video"&&h.jsxs(h.Fragment,{children:["and video/audio duration not more than"," ",h.jsx("span",{className:"fw-b text-danger",children:i!=="NA"&&`${i}s`})]}),"."]})}),h.jsx(Hst,{mediaType:n.uploadMediaType.toLowerCase(),mediaSource:n==null?void 0:n.resSources,setUploadMediaUrl:n.setUploadMediaUrl,handleClose:n.handleClose,fileSizelimit:t,videoDurationLimit:i,audioDurationLimit:s})]})]})})}function Gst({className:n,type:t,item:i,name:s,title:l,subTitle:d,id:u,iconImg:p,isDisabled:g,isChecked:_,handleChange:y,selectedUserList:E,setSelectedUserList:b}){const A=n||"",N=t||"radio",O=p||((i==null?void 0:i.type)==="group"?"/img/groups-icon.png":"/img/user-profile.jpg"),D=l||"Guest User",P=d||"",j={};g?j.disabled=!0:j.disabled=!1;function M(V){console.log(V.target),console.log(JSON.stringify(V.target.value)),y(V),b&&(!E.includes(V.target.value)&&!_?b(H=>{let $={id:V.target.value,name:D,image:O};return console.log("tempUserObj = ",$),[...H,$]}):(console.log("isCHecked = ",_),_&&b(H=>{let $=H.filter(Q=>Q.id!==V.target.value);return console.log("tempUserObj = ",$),$})))}return h.jsx(h.Fragment,{children:h.jsxs(et,{className:`card-theme border-0 rounded-1 custom-radio-list-btn-card card-md ${A}`,children:[h.jsx("input",{type:N,id:u,name:s,value:i.id,onChange:M,...j,checked:_||!1}),h.jsx("label",{htmlFor:u,children:h.jsxs(et.Body,{className:"position-relative rounded-1",children:[h.jsx("div",{className:"d-flex profile-info-container align-items-center",children:h.jsxs("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex align-items-center",children:[h.jsx("div",{className:"media-icon-wrapper",children:h.jsx(us,{src:O,alt:`${D} image`,className:"img-fluid"})}),h.jsxs("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container d-flex flex-wrap",children:[h.jsx("span",{className:"welcome-user fw-n",style:{maxWidth:"90%"},children:`${D} `}),h.jsx("div",{className:"d-block w-100 font-13 text-gray6",children:$R(P)})]})]})}),h.jsx(Zt,{tag:"circle1",className:"font-20 position-absolute radio-status-icon unchecked-icon"}),h.jsx(Zt,{tag:"check2",className:"font-20 position-absolute radio-status-icon checked-icon"})]})})]})})}function Wst(){const n=Ii();JSON.parse(Ai.getAuthUser());const t=["name","designation"],i="message",s=["audio","video","image","pdf"],l=["gallery"],d=500,[u,p]=k.useState(0),[g,_]=k.useState(""),[y,E]=k.useState([]),[b,A]=k.useState(""),[N,O]=k.useState(""),[D,P]=k.useState(""),[j,M]=k.useState(""),[V,H]=k.useState(""),[$,Q]=k.useState(!1),[Y,le]=k.useState({isVisible:!1});k.useRef(),k.useRef();const ae=async()=>{const rt=await LE.getInfo();_(rt.platform)};k.useEffect(()=>{ae()},[]);const te=()=>{le({isVisible:!1})},de=rt=>{O(rt),le({isVisible:!0})},G=async({queryKey:rt})=>{var Je,_t;const[pt,Ze]=rt;try{const Xt=await hs.getAllRecipients(Ze);if(Xt.data.status==="success"){const Ht=((_t=(Je=Xt.data)==null?void 0:Je.data)==null?void 0:_t.recipients)||[],gn=new Set;return Ht.filter(xt=>gn.has(xt.id)?!1:(gn.add(xt.id),!0))}return[]}catch{throw new Error("Error fetching all recipients")}},{isLoading:ie,isPending:_e,isFetching:he,isError:Ce,data:fe,error:me}=Qd({queryKey:["messageRecipients",i],queryFn:G}),Ne=k.useMemo(()=>FO(fe,b,t),[fe,b]),Fe=(rt,pt="multi")=>{E(pt==="single"?[rt]:Ze=>Ze.some(Je=>Je.id===rt.id)?Ze.filter(Je=>Je.id!==rt.id):[...Ze,rt])},je=({index:rt,key:pt,style:Ze})=>{const Je=Ne[rt];return h.jsx("div",{style:Ze,children:h.jsx(RC,{item:Je,className:`user-card ${y.some(_t=>_t.id===Je.id)?"selected":""} ${Ne.length!==rt+1?"border-bottom":""}`,type:"multi",title:Je!=null&&Je.firstname?Pv(Je==null?void 0:Je.firstname,Je==null?void 0:Je.lastname):Je==null?void 0:Je.name,subTitle:Je==null?void 0:Je.designation,iconImg:Je==null?void 0:Je.avatar,isRoundedIcon:!0,handleItemSelect:Fe})},pt)},Ve=()=>y.length===0?(Qt("Users not selected!","error"),!1):!0,Re=()=>!j||j===""?(Qt("Title required!","error"),!1):!V||V===""?(Qt("Message required!","error"),!1):!0;function Be(rt){p(Number(rt))}const Xe=()=>{u===0&&Ve()?p(1):u===1&&Re()?p(2):u===2&&we()};async function we(){Q(!0);const rt=y.filter(Je=>Je.type==="user").map(Je=>Je.id),pt=y.filter(Je=>Je.type==="group").map(Je=>Je.id),Ze={title:j,body:V,media_type:N,media_url:D,groups:pt,users:rt};So.sendWallMessage(Ze).then(Je=>{console.log("sendWallMessage response result = ",Je.data),Je.data.status==="success"&&(Q(!1),Qt("Message sent successfully!","success"),n("/messages",{state:{data:"sent"}}))}).catch(Je=>{console.log(Je),Q(!1),Qt("Failed to Send Message!","error")})}function Ge(rt){rt&&P(rt)}return _e?h.jsx(qi,{className:"position-relative",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(ci,{type:"details"})})}):Ce?h.jsx(Ga,{className:"mt-5",children:me.message}):h.jsx(qi,{className:"",children:h.jsx(Yn,{className:"mb-4",children:h.jsxs("div",{className:"send-messages-page",children:[h.jsxs(vU,{activeKey:u,onSelect:Be,id:"stepper-tabs",children:[h.jsxs(Zn,{eventKey:0,title:"Step 1",unmountOnExit:!0,children:[h.jsxs("div",{className:"py-0 pt-2 sticky-top",style:{top:"var(--navbar-height)",padding:"0 0rem",background:"var(--color-body-bg-light)"},children:[h.jsxs(Ga,{size:"",className:"mb-1",children:[h.jsx("span",{className:"text-danger",children:"*"})," Whom do you want to appreciate?"]}),h.jsxs("div",{className:"py-1 pb-0",children:[h.jsx(XO,{filters:t,onSearch:rt=>A(rt),className:"mb-"}),(Ne==null?void 0:Ne.length)>0&&(b==null?void 0:b.length)>0&&h.jsx(Ga,{size:"sm",className:"px-1 text-gray9",children:`Results found ${Ne==null?void 0:Ne.length}`})]}),h.jsx("div",{className:"px-1 d-block mb-1",children:h.jsx(BZ,{items:y,className:"",type:"multi",handleRemoveItems:Fe})})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{height:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:h.jsx(oF,{children:({height:rt,width:pt})=>h.jsx(cF,{width:pt,height:rt,rowHeight:60,rowCount:Ne.length,rowRenderer:je})})}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:"Next"},"step2_handler")})]})})]}),h.jsx(Zn,{eventKey:1,title:"Step 2",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container pt-2",children:[h.jsx(Ga,{size:"",className:"mb-1",children:"Write a Message"}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Message Title"]}),h.jsx(kt.Control,{type:"text",placeholder:"",name:"title",value:j,onChange:rt=>M(rt.target.value),autoComplete:"off"})]}),h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Brief Message"]}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"body",value:V,onChange:rt=>H(rt.target.value),autoComplete:"off"})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>p(0),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:"Next"},"step3_handler")})]})})]})}),h.jsx(Zn,{eventKey:2,title:"Step 3",unmountOnExit:!0,children:h.jsxs("div",{className:"form-step-container",children:[h.jsxs(Ga,{size:"",className:"mb-1",children:["Choose a media type to upload"," ",h.jsx("span",{className:"d-block font-13 text-gray6",children:"(Optional)"})]}),h.jsxs("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto",overflowX:"hidden"},children:[(s==null?void 0:s.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:s==null?void 0:s.map((rt,pt)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>de(rt),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[rt==="video"&&h.jsx(Zt,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),rt==="audio"&&h.jsx(Zt,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),rt==="pdf"&&h.jsx(Zt,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),rt==="image"&&h.jsx(Zt,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${rt}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:h.jsxs(h.Fragment,{children:["max ",d,"mb"]})})]})]})})},`${pt}-${rt}`))}),h.jsx("div",{children:D&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"card card-theme shadow-sm rounded-3 border-0 mb-3 p-2",style:{backgroundColor:"var(--color-green-lighter)"},children:h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:"d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden rounded-circle",style:{backgroundColor:"var(--color-green-light)"},children:h.jsx(Zt,{tag:"check1",className:"font-28 text-success"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsxs("span",{className:"d-block font-14",children:["Successfully uploaded selected ",N,". Click submit button to send a message."]})})]})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>p(1),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:Xe,children:$?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):"Submit"},"submit_handler")})]})})]})})]}),h.jsx(vbe,{show:Y,handleClose:te,resSources:l,uploadMediaType:N,className:"",setUploadMediaUrl:P,saveUploadFile:Ge,deviceOS:g})]})})})}function $st(){Ii();const[n,t]=k.useState(""),[i,s]=k.useState([]),[l,d]=k.useState([]),[u,p]=k.useState([]),[g,_]=k.useState(!1);k.useState([]),k.useState([]);const[y,E]=k.useState("step1"),[b,A]=k.useState(!1),[N,O]=k.useState({isVisible:!1}),[D,P]=k.useState(""),[j,M]=k.useState(""),[V,H]=k.useState(!1),$=k.useRef();JSON.parse(Ai.getAuthUser());const Q=["audio","video","image","pdf"],Y=["gallery"],le=500,ae=async()=>{const Re=await LE.getInfo();t(Re.platform)};k.useEffect(()=>{ae()},[]);const te=()=>{O({isVisible:!1})},de=Re=>{P(Re),O({isVisible:!0})},G=()=>{$.current.value="",d(i)};function ie(Re,Be){console.log("searchItems - filteredData =",Be);const Xe=Be.filter((we,Ge)=>we.name.toLowerCase().includes(Re.toLowerCase()));return console.log("Result =",Xe),Xe}const _e=tx.debounce(Re=>{console.log("This is function from lodash..."),console.log("Search text =",Re);const Be=i;Re.trim().length>0?(console.log(Re.trim()),d(ie(Re.trim(),Be))):d(Be)},500),he=(Re,Be)=>{var Xe,we,Ge;if(console.log("Key in handleSelectedTab =",Re),console.log("formik in handleSelected Tag = ",Be),y==="step1"&&(Be!=null&&Be.values)&&!((Xe=Be.values)!=null&&Xe.receiver_ids)){Qt("User not selected!","error");return}if(y==="step2"&&(Be!=null&&Be.values)&&!((we=Be.values)!=null&&we.title)){Qt("Title required!","error");return}if(y==="step2"&&(Be!=null&&Be.values)&&!((Ge=Be.values)!=null&&Ge.body)){Qt("Message required!","error");return}E(Re)},Ce={receiver_ids:[],title:"",body:"",media_type:"",media_url:""},fe=uc({}),me=async(Re,{resetForm:Be})=>{console.log("Form Values :",Re);const Xe=i.filter((pt,Ze)=>Re.receiver_ids.includes(pt.id));console.log("receivers_info = ",Xe);const we=Xe.filter(pt=>pt.type==="user"),Ge=Xe.filter(pt=>pt.type=="group"),rt={title:Re.title,body:Re.body,media_type:D,media_url:j,groups:Ge,users:we};console.log("Final formData = ",rt),console.log("sendWallMessageResponse in onSubmit = ",sendWallMessageResponse)};async function Ne(Re){var Be,Xe;_(!0);try{const we=await hs.getAllRecipients(Re);if(we.data.status==="success"){console.log("getAllRecipients called == ",we.data);const Ge=(Xe=(Be=we.data)==null?void 0:Be.data)==null?void 0:Xe.recipients;console.log("userList == ",Ge);const rt=[],pt=Ge.filter(Je=>rt.includes(Je.id)?!1:(rt.push(Je.id),!0));console.log("uniqueUserList == ",pt);const Ze=Date.now();console.log(Ze),localStorage.setItem(zqe,Ze),s(pt),d(pt),await Fe(pt),_(!1)}}catch(we){console.log("ERROR in getAllRecipients in send messages ",we),s([]),d([]),_(!1)}}const Fe=async Re=>{await H7.set({key:Jhe,value:JSON.stringify(Re)}),console.log("Message user list stored")},je=async()=>{console.log("getUsers called..."),_(!0);const{value:Re}=await H7.get({key:Jhe});if(console.log("messageUsers Users:",JSON.parse(Re)),Re){let Be=JSON.parse(Re);s(Be),d(Be),_(!1)}};k.useEffect(()=>{je()},[]);function Ve(Re){Re&&M(Re)}return h.jsx(qi,{className:"position-relative",children:h.jsxs(Yn,{className:"mb-4",children:[y==="step1"&&h.jsx(Pt,{type:"button",className:"btn-theme btn-sm btn-gray position-absolute px-1 py-1",style:{top:12,right:10,zIndex:1040},onClick:()=>Ne("message"),disabled:g,children:g?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ",h.jsx("span",{className:"ms-1",children:"Loading"})]}):h.jsxs(h.Fragment,{children:[h.jsx(Zt,{tag:"reload4",className:"font-16 me-1"}),h.jsx("span",{className:"fw-sb font-13 btn-title",children:"Force Reload"})]})}),h.jsx(id,{initialValues:Ce,validationSchema:fe,onSubmit:me,children:Re=>{var Be,Xe;return console.log("initialValues - Receivers = ",Ce),console.log("formik.values - Receivers = ",Re.values),h.jsxs(kt,{className:"form_style",onSubmit:Re.handleSubmit,children:[h.jsxs(Zn.Container,{id:"appreciation-step-form",className:"main_tabs",activeKey:y,onSelect:we=>he(we),children:[h.jsx("div",{className:"tab_links d-none",children:h.jsxs(jn,{variant:"pills",className:"nav-stepper justify-content-center",children:[h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step1",children:h.jsx("div",{className:"",children:"1"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step2",children:h.jsx("div",{className:"",children:"2"})})}),h.jsx(jn.Item,{children:h.jsx(jn.Link,{className:"normal_link",eventKey:"step3",children:h.jsx("div",{children:"3"})})})]})}),h.jsxs(Zn.Content,{className:"p-2 pt-0",children:[h.jsxs(Zn.Pane,{className:"",eventKey:"step1",unmountOnExit:!0,children:[h.jsxs("div",{className:"form-step-container",children:[h.jsxs("div",{className:"font-14 fw-sb py-1 pt-0 d-flex justify-content-between",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-danger",children:"*"})," Select Recipients"]}),h.jsxs("span",{className:"self-align-end font-13 text-gray6",children:["Selected: ",u==null?void 0:u.length]})]}),!g&&(i==null?void 0:i.length)>0?h.jsx("div",{className:"py-1",children:h.jsxs(kt.Group,{className:"form-group rounded_corners search_field autocomplete_field mb-1 position-relative px-1",children:[h.jsx(kt.Control,{type:"text",name:"searchInput",onChange:we=>{console.log("Search input = ",we),_e(we.target.value)},ref:$,placeholder:"Search",style:{backgroundImage:"url(/img/search-icon.png)",backgroundRepeat:"no-repeat",backgroundPosition:"center right 12px"},autoComplete:"off"}),((Be=$==null?void 0:$.current)==null?void 0:Be.value.length)>0&&h.jsx(Pt,{onClick:G,className:"btn-theme btn-icon btn-sm btn-gray position-absolute",style:{top:4,right:6,fontSize:18},type:"button",children:h.jsx(VE,{})},"search-clear-btn"),((Xe=$==null?void 0:$.current)==null?void 0:Xe.value.length)>0&&h.jsx("span",{className:"font-13 fw-sb px-1 text-gray9",children:`Results found ${l==null?void 0:l.length}`})]})}):h.jsx(h.Fragment,{}),u&&u.length>0?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"d-flex justify-content-en",children:h.jsxs(Pt,{type:"button",className:"btn-theme btn-link btn-gray py-0 px-2 font-13 fw-sb text-gray6",onClick:()=>H(!V),"aria-controls":"selected-userlist-collapse","aria-expanded":open,children:[u==null?void 0:u.length," Selected",h.jsx(Zt,{tag:"arrow-down2",className:"ms-1"})]},"show-select-user-toggle-btn")}),h.jsx(pQ,{in:V,children:h.jsx("div",{id:"selected-userlist-collapse",children:h.jsx("div",{className:"p-2 d-flex flex-nowrap no-scrollbar align-items-center overflow-auto mb-1 border-bottom bg-gray-lighter2",children:h.jsx(h.Fragment,{children:u.map((we,Ge)=>h.jsxs("div",{className:"d-flex align-items-center p-1 rounded-3 text-wrap border me-2 bg-white",style:{maxWidth:100},children:[h.jsx("div",{className:"overflow-hidden rounded-circle flex-shrink-0",style:{width:24,height:24},children:h.jsx("img",{src:we.image,className:"img-fluid mx-auto",alt:we.name,style:{objectFit:"cover"}})}),h.jsx("div",{className:"ms-1 font-11 text-truncate pt-1 flex-grow-1",children:we.name})]},we.id))})})})})]}):h.jsx(h.Fragment,{}),h.jsx("div",{className:"content-container no-scrollbar border-botto py-3 pt-0",style:{maxHeight:"calc(100vh - 35vh)",overflowY:"auto",overflowX:"hidden"},children:g?h.jsx(ci,{type:"details"}):h.jsx(h.Fragment,{children:!g&&(i==null?void 0:i.length)>0?h.jsx(h.Fragment,{children:(l==null?void 0:l.length)>0?h.jsx(h.Fragment,{children:l.map((we,Ge)=>h.jsx(Gst,{className:`${l.length!==Ge+1?"border-bottom":""}`,type:"checkbox",name:"receiver_ids",item:we,title:we==null?void 0:we.name,subTitle:we==null?void 0:we.type,id:we==null?void 0:we.id,iconImg:we==null?void 0:we.avatar,handleChange:Re.handleChange,isDisabled:!1,isChecked:Re.values.receiver_ids.indexOf(we==null?void 0:we.id)>-1,selectedUserList:u,setSelectedUserList:p},we.id))}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No user found."})})})})}):h.jsx(h.Fragment,{children:h.jsx(et,{className:"border-0 shadow-sm text-center my-2",children:h.jsx(et.Body,{children:h.jsx("span",{className:"fw-sb font-14",children:"No more records"})})})})})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>he("step2",Re),children:"Next"},"step2_handler")})]})})]}),h.jsxs(Zn.Pane,{className:"",eventKey:"step2",unmountOnExit:!0,children:[h.jsxs("div",{className:"form-step-container",children:[h.jsx("div",{className:"font-14 fw-sb py-2",children:"Write a Message"}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-2 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Message Title"]}),h.jsx(kt.Control,{type:"text",placeholder:"",name:"title",...Re.getFieldProps("title"),autoComplete:"off"})]})}),h.jsx("div",{children:h.jsxs(kt.Group,{className:"form-group rounded_corners mb-3 pt-2",children:[h.jsxs(kt.Label,{className:"font-14 fw-sb",children:[h.jsx("span",{className:"text-danger",children:"*"})," Brief Message"]}),h.jsx(kt.Control,{as:"textarea",rows:3,style:{height:"auto",resize:"auto",maxHeight:"100px"},placeholder:"",name:"body",...Re.getFieldProps("body"),autoComplete:"off"}),Re.touched.body&&Re.errors.body?h.jsx("p",{className:"error-state-text font-12 text-danger",children:Re.errors.body}):null]})})]}),h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 gx-3 justify-content-center mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>he("step1"),children:"Prev"},"prev_step1_handler")}),h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-primary btn-md w-100",onClick:()=>he("step3",Re),children:"Next"},"step3_handler")})]})})]}),h.jsx(Zn.Pane,{className:"",eventKey:"step3",unmountOnExit:!0,children:h.jsx("div",{className:"form-step-container",children:h.jsxs("div",{className:"pt-2",children:[h.jsxs("div",{className:"font-14 fw-sb",children:["Choose a media type to upload"," ",h.jsx("span",{className:"d-block font-13 text-gray6",children:"(Optional)"})]}),h.jsx("div",{className:"content-container no-scrollbar border-botto px-1 py-3",style:{overflowY:"auto",overflowX:"hidden"},children:(Q==null?void 0:Q.length)>0&&h.jsx(fn,{className:"row-cols-2 mb-3 g-3",children:Q==null?void 0:Q.map((we,Ge)=>h.jsx(Gt,{children:h.jsx(et,{className:"card-theme",onClick:()=>de(we),children:h.jsxs(et.Body,{className:"p-2 p-sm-3 justify-content-center d-flex flex-column",children:[h.jsxs("div",{className:"icon-wra",children:[we==="video"&&h.jsx(Zt,{tag:"play1",className:"mb-2 font-36 text-theme-primary"}),we==="audio"&&h.jsx(Zt,{tag:"consult1",className:"mb-2 font-36 text-theme-primary"}),we==="pdf"&&h.jsx(Zt,{tag:"pdf1",className:"mb-2 font-36 text-theme-primary"}),we==="image"&&h.jsx(Zt,{tag:"image2",className:"mb-2 font-36 text-theme-primary"})]}),h.jsxs("div",{className:"font-14 fw-sb pt-sm-2",children:[`Upload ${we}`,h.jsx("small",{className:"d-block fw-sb text-danger font-11",children:h.jsxs(h.Fragment,{children:["max ",le,"mb"]})})]})]})})},`${Ge}-type`))})}),j&&h.jsx(h.Fragment,{children:h.jsx("div",{className:"card card-theme shadow-sm rounded-3 border-0 mb-3 p-2",style:{backgroundColor:"var(--color-green-lighter)"},children:h.jsxs("div",{className:"d-flex media-header-container align-items-center",children:[h.jsx("div",{className:"flex-shrink-0 media-icon-container position-relative d-flex",children:h.jsx("div",{className:"d-flex justify-content-center align-items-center media-icon-wrapper overflow-hidden rounded-circle",style:{backgroundColor:"var(--color-green-light)"},children:h.jsx(Zt,{tag:"check1",className:"font-28 text-success"})})}),h.jsx("div",{className:"text-start flex-grow-1 ms-2 ms-sm-3 media-info-container",children:h.jsxs("span",{className:"d-block font-14",children:["Successfully uploaded selected"," ",D,". Click submit button to send a message."]})})]})})})]})})})]})]}),h.jsx(vbe,{show:N,handleClose:te,resSources:Y,uploadMediaType:D,className:"",setUploadMediaUrl:M,saveUploadFile:Ve,deviceOS:n}),y==="step3"&&h.jsx("div",{className:"fixed-bottom bg-white px-3 border-theme-top",children:h.jsxs(fn,{className:"row-cols-2 justify-content-center gx-3 mt-3 mb-4",children:[h.jsx(Gt,{children:h.jsx(Pt,{id:"",type:"button",className:"btn-theme btn-gray btn-md w-100",onClick:()=>he("step2"),children:"Prev"},"prev_step2_handler")}),h.jsx(Gt,{children:h.jsx("div",{className:"btn-wrap text-center",children:h.jsx(Pt,{type:"submit",className:"btn-theme btn-primary btn-md w-100",children:b?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Processing"]}):Re.isValid?"Submit":"Please fill out all info"})})})]})})]})}})]})})}function Kst(){const n=Ii(),[t,i]=k.useState(!1),s={password:""},l=uc().shape({password:hf().required("Please enter a valid password")});async function d(u,{resetForm:p}){console.log("Executing change password on submit = ",u),i(!0),Ai.changePassword(u).then(g=>{console.log("changePassword Response: ",g),g.data.status==="success"&&(console.log("Success response =",g.data),Qt("Password changed successfully!","success"),i(!1),n("/dashboard")),g.data.status==="failed"&&(console.log("Failed ERROR response : ",g.data),Qt("Failed to change password!","error"),i(!1))}).catch(g=>{var _,y,E;i(!1),((_=g.response)==null?void 0:_.data.status)==="failed"&&Qt((y=g.response)==null?void 0:y.data.message,"error"),console.log("Change Password Error = ",g),console.log("Change Password Error response = ",(E=g.response)==null?void 0:E.data)})}return h.jsx(h.Fragment,{children:h.jsx(qi,{className:"change-password-page",children:h.jsx(Yn,{className:"mb-4",children:h.jsx(et,{className:"login-content-card w-100 border-0 shadow-none",children:h.jsx(et.Body,{children:h.jsx("div",{className:"form-container",children:h.jsx(id,{initialValues:s,validationSchema:l,onSubmit:d,children:u=>h.jsxs(kt,{onSubmit:u.handleSubmit,children:[h.jsxs(kt.Group,{className:"form-group mb-3",children:[h.jsx(kt.Label,{className:"pe-none",children:"New Password"}),h.jsx(kt.Control,{type:"password",placeholder:"New Password",name:"password",value:u.values.password,onBlur:u.handleBlur,onChange:u.handleChange,required:!0,autoComplete:"off"}),u.touched.password&&u.errors.password?h.jsx("p",{className:"form-error",children:u.errors.password}):null]}),h.jsx("div",{className:"btn-wrapper pt-3",children:h.jsx(Pt,{type:"submit",size:"lg",disabled:!u.isValid,className:"btn-theme btn-shadow btn-primary btn-block w-100",children:t?h.jsxs(h.Fragment,{children:[h.jsx(Ji,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"})," ","Loading"]}):u.isValid?"Submit":"Please fill out all info"})})]})})})})})})})})}var rN;(function(n){n.Dark="DARK",n.Light="LIGHT",n.Default="DEFAULT"})(rN||(rN={}));var Lpe;(function(n){n.None="NONE",n.Slide="SLIDE",n.Fade="FADE"})(Lpe||(Lpe={}));const _4=hc("StatusBar"),ybe=hc("EdgeToEdge",{});var Dpe;(function(n){n.WHITE="#FFFFFF",n.BLACK="#000000",n.TRANSPARENT="transparent"})(Dpe||(Dpe={}));const _be=hc("NavigationBar",{web:()=>Xi(()=>import("./web-BCDAlWew.js"),__vite__mapDeps([])).then(n=>new n.NavigationBarWeb)}),qst=({component:n,...t})=>{const i=async()=>{const g=await LE.getInfo();g.platform!=="web"&&l(),g.platform==="android"&&s()},s=async()=>{u(O_e)},l=async()=>{d()},d=async()=>{await _4.setStyle({style:rN.Light})},u=async g=>{await _4.setBackgroundColor({color:g}),await ybe.setBackgroundColor({color:g}),await _be.setNavigationBarColor({color:"#000000"})};k.useEffect(()=>{i()},[]);let p=Ai.getToken();return h.jsx(h.Fragment,{children:p?h.jsx(B0e,{to:"/dashboard"}):h.jsx(n,{...t})})},Bc=({component:n,auth:t,...i})=>{const{backLink:s}=k.useContext(QR);let l=localStorage.getItem("auth_token");const{page:d}={...i},u=async()=>{const b=await LE.getInfo();b.platform!=="web"&&E(),b.platform==="android"&&y()},p=async()=>{console.log("setStatusBarStyleDark called"),await _4.setStyle({style:rN.Dark})},g=async()=>{console.log("setStatusBarStyleLight called"),await _4.setStyle({style:rN.Light})},_=async b=>{console.log("setBackgroundColor called"),await _4.setBackgroundColor({color:b}),await ybe.setBackgroundColor({color:b}),await _be.setNavigationBarColor({color:"#000000"})},y=async()=>{d!=="login"?(console.log("Inside if (page !== 'login')"),_(IE)):(console.log("Inside Else (page === 'login')"),_(O_e))},E=async()=>{d!=="login"?(console.log("Inside if (page !== 'login')"),p()):(console.log("Inside Else (page === 'login')"),g())};return k.useEffect(()=>{u()},[]),k.useEffect(()=>{bC.addListener("backButton",({canGoBack:b})=>{console.log("Got the canGoBack in backButton listener...",b),b?(console.log("Got the canGoBack in backButton listener Else ...",b),window.location.href=s):(console.log("Got the canGoBack in backButton listener if ...",b),bC.exitApp())})},[s]),h.jsx(h.Fragment,{children:l?h.jsx(n,{...i}):h.jsx(B0e,{to:"/"})})},Yst=k.createContext(),Xst={name:"Bhavee Khune",imgUrl:"",desig:"Area Business Manager",email:"bhaveshkhune@gmail.com",mobile:"9823432230",address:{HQ:"Pune East",terrytory:"Pune East",area:"Pune",region:"Maharashtra",zone:"Central India",city:"Pune",state:"Maharashtra",pincode:411041,address:"Flat no 1706, Manhattan, Pride World City"}},Jst=hc("SplashScreen",{web:()=>Xi(()=>import("./web-DJ_H0FsA.js"),__vite__mapDeps([])).then(n=>new n.SplashScreenWeb)}),Qst=hc("DeviceSecurityDetect",{web:()=>Xi(()=>import("./web-Cpi5fhcy.js"),__vite__mapDeps([])).then(n=>new n.DeviceSecurityDetectWeb)}),Bb=hc("PushNotifications",{});function Zst(n){function t(){console.log("handleCloseApp called "),n.handleClose(),n.closeAppHandler()}return h.jsx(h.Fragment,{children:h.jsxs(vn,{centered:!0,fullscreen:!1,backdrop:"static",keyboard:!1,className:"theme-modal app-access-forbidden-modal",show:n.show,onHide:n.handleClose,children:[h.jsx(vn.Header,{className:"pb-2 border-0 d-flex justify-content-center align-items-center",children:h.jsx("div",{className:"heading-icon-wrap flex-shrink-0",children:h.jsx("span",{className:"heading-icon d-flex justify-content-center align-items-center rounded-circle font-24",children:h.jsx(GO,{})})})}),h.jsx(vn.Body,{className:"no-scrollbar text-center d-flex flex-wrap justify-content-center align-items-center",children:n.loading?h.jsx(h.Fragment,{children:h.jsx(Ji,{animation:"border",variant:"dark"})}):h.jsx(h.Fragment,{children:h.jsxs("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[h.jsxs("div",{className:"w-100 d-block",children:[h.jsx("p",{className:"font-18 mb-2 warning-heading",style:{lineHeight:1.6},children:"Rooted device detected!"}),h.jsx("p",{className:"font-16 mb-3",style:{lineHeight:1.6},children:"For security reasons, access to this app is restricted on rooted devices."})]}),h.jsx("div",{className:"btn-wrap d-grid gap-3 pt-1",children:h.jsx(Pt,{type:"button",className:"btn-theme btn-black btn-lg w-100 text-white text-decoration-none rounded-3",onClick:t,children:"Exit App"})})]})})})]})})}function eat(){Jst.hide();const[n,t]=k.useState(!1),[i,s]=k.useState("light"),[l,d]=k.useState(Xst),[u,p]=k.useState("/"),[g,_]=k.useState(null),[y,E]=k.useState(!1),b=()=>{E(!1)},A=()=>{E(!0)};async function N(){console.log("closeAppHandler called"),await bC.exitApp()}const O=async()=>{const j=await LE.getInfo(),M=await LE.getId(),V=await bC.getInfo();if(localStorage.setItem("deviceInfo",JSON.stringify(j)),localStorage.setItem("appCurrentVersion",V.version),localStorage.setItem("appID",V.id),localStorage.setItem("deviceID",M.identifier),j.platform==="android"){async function H(){console.log("**** checkDeviceSecurity called ***");try{const $=await Qst.isJailBreakOrRooted();$.value?(A(),console.log(`*** Device is ROOTED: ${$.value?"Yes":"No"}`)):console.log(`*** Device is NOT ROOTED: ${$.value?"Yes":"No"}`)}catch($){console.error("*** Error checking device security:",$)}}H()}};k.useEffect(()=>{O()},[Ai.getToken()]),k.useEffect(()=>{const j=localStorage.getItem("theme");Y6e(j||i,s),Ai.getToken()&&t(!0)},[]),k.useEffect(()=>{console.log("refreshToken() and appStateChange listener useEffect"),bC.addListener("appStateChange",({isActive:j})=>{j&&console.log("App foregrounded and about to call refreshToken()")})},[]);async function D(){J4.getNotificationStats().then(j=>{var M;j.data.status==="success"&&(console.log("Response from getNotificationsStats on SUCCESS =",j),_((M=j.data)==null?void 0:M.data))}).catch(j=>{_(null),console.log("Error in catch in getNotificationsStats =",j)})}k.useEffect(()=>{Ai.getToken()&&(console.log("...Calling registerDeviceForPushNotification() from App useEffect..."),Ai.registerDeviceForPushNotification(),D())},[]),k.useEffect(()=>{console.log("--**********************--"),console.log("Push notification code useEffect runs..."),console.log("--**********************--"),Bb.checkPermissions().then(j=>{j.receive!=="granted"?Bb.requestPermissions().then(M=>{M.receive==="denied"?console.log("Push Notification permission denied"):(console.log("Push Notification permission granted"),P())}):(console.log("if (res.receive !== 'granted') Else Part calling registerNotifications() ",j==null?void 0:j.receive),P())})},[]);async function P(){console.log("--**********************--"),console.log("Initializing HomePage - registerNotifications () called"),console.log("--**********************--"),await Bb.register(),await Bb.addListener("registration",j=>{console.log("PushNotifications.addListener - registration runs Token = ",j),localStorage.setItem("notificationToken",j.value)}),await Bb.addListener("registrationError",j=>{console.log("PushNotifications.addListener - registrationError runs"),console.log("Error on PushNotifications registration: "+JSON.stringify(j))}),Bb.addListener("pushNotificationActionPerformed",j=>{var V;if(console.log("PushNotifications.addListener - pushNotificationActionPerformed"),console.log("Tapped on notification: ",j),Ai.getToken()){let H=v1e((V=j==null?void 0:j.notification)==null?void 0:V.data);window.location.href=H}else window.location.href="/"})}return h.jsx(h.Fragment,{children:h.jsxs("div",{className:"app-wrapper",children:[h.jsx(q6e,{position:"bottom-center",hideProgressBar:!0,transition:$6e,theme:"dark",className:"custom-toast",autoClose:3e3}),h.jsx(QR.Provider,{value:{userProfile:l,notificationStats:g,getNotificationStats:D,backLink:u,setBackLink:p},children:h.jsx(Yst.Provider,{value:{theme:i,setTheme:s},children:h.jsx(P6e,{children:h.jsxs(T6e,{children:[h.jsx(mi,{path:"/",element:h.jsx(qst,{component:zWe})}),h.jsx(mi,{path:"/app-icons",element:h.jsx(bBe,{})}),h.jsx(mi,{path:"/dashboard",element:h.jsx(Bc,{auth:n,component:Mc,page:"dashboard"}),children:h.jsx(mi,{index:!0,element:h.jsx(Zqe,{})})}),h.jsxs(mi,{path:"/profile",element:h.jsx(Bc,{auth:n,component:Mc,page:"profile"}),children:[h.jsx(mi,{path:"change-password",element:h.jsx(Kst,{})}),h.jsx(mi,{index:!0,element:h.jsx(rXe,{})})]}),h.jsx(mi,{path:"/quick-actions",element:h.jsx(Bc,{auth:n,component:Mc,page:"quick-actions"}),children:h.jsx(mi,{index:!0,element:h.jsx(lYe,{})})}),h.jsx(mi,{path:"/quick-actions-content",element:h.jsx(Bc,{auth:n,component:Mc,page:"quick-actions-content"}),children:h.jsx(mi,{index:!0,element:h.jsx(aXe,{})})}),h.jsx(mi,{path:"/notifications",element:h.jsx(Bc,{auth:n,component:Mc,page:"notifications"}),children:h.jsx(mi,{index:!0,element:h.jsx(iYe,{})})}),h.jsxs(mi,{path:"/appreciations",element:h.jsx(Bc,{auth:n,component:Mc,page:"appreciations"}),children:[h.jsx(mi,{path:"send-appreciations2",element:h.jsx(jst,{})}),h.jsx(mi,{path:"send-appreciations",element:h.jsx(kst,{})}),h.jsx(mi,{index:!0,element:h.jsx(SYe,{})})]}),h.jsxs(mi,{path:"/badges",element:h.jsx(Bc,{auth:n,component:Mc,page:"badges"}),children:[h.jsx(mi,{path:"send-badges2",element:h.jsx(zst,{})}),h.jsx(mi,{path:"send-badges",element:h.jsx(Vst,{})}),h.jsx(mi,{index:!0,element:h.jsx(gYe,{})})]}),h.jsx(mi,{path:"/rewards",element:h.jsx(Bc,{auth:n,component:Mc,page:"rewards"}),children:h.jsx(mi,{index:!0,element:h.jsx(yYe,{})})}),h.jsx(mi,{path:"/metric-reports",element:h.jsx(Bc,{auth:n,component:Mc,page:"metric-reports"}),children:h.jsx(mi,{index:!0,element:h.jsx(sXe,{})})}),h.jsxs(mi,{path:"/approve-reject-form-submission",element:h.jsx(Bc,{auth:n,component:Mc,page:"approve-reject-form-submission"}),children:[h.jsx(mi,{path:":entityId",element:h.jsx(npe,{})}),h.jsx(mi,{index:!0,element:h.jsx(npe,{})})]}),h.jsxs(mi,{path:"/magazines",element:h.jsx(Bc,{auth:n,component:Mc,page:"magazines"}),children:[h.jsx(mi,{path:":magazineId",element:h.jsx(jtt,{})}),h.jsx(mi,{index:!0,element:h.jsx(lXe,{})})]}),h.jsxs(mi,{path:"/messages",element:h.jsx(Bc,{auth:n,component:Mc,page:"messages"}),children:[h.jsx(mi,{path:"send-message2",element:h.jsx($st,{})}),h.jsx(mi,{path:"send-message",element:h.jsx(Wst,{})}),h.jsx(mi,{path:":msgId",element:h.jsx(Rit,{})}),h.jsx(mi,{index:!0,element:h.jsx(Iit,{})})]}),h.jsxs(mi,{path:"/contests",element:h.jsx(Bc,{auth:n,component:Mc,page:"contests"}),children:[h.jsx(mi,{path:":contestId",element:h.jsx($it,{})}),h.jsx(mi,{path:":contestId/upload-response",element:h.jsx(Qit,{})}),h.jsx(mi,{path:":contestId/evaluate",element:h.jsx(Zit,{})}),h.jsx(mi,{index:!0,element:h.jsx(Lit,{})})]}),h.jsxs(mi,{path:"/competition-contests",element:h.jsx(Bc,{auth:n,component:Mc,page:"competition-contests"}),children:[h.jsx(mi,{path:"competition-contest-details",element:h.jsx(Bst,{})}),h.jsx(mi,{index:!0,element:h.jsx(Fst,{})})]})]})})})}),h.jsx(Zst,{show:y,handleClose:b,closeAppHandler:N})]})})}const tat=new pqe,nat=O0e.createClient({mode:"rtc",codec:"h264"});bK.createRoot(document.getElementById("root")).render(h.jsx(_qe,{client:tat,children:h.jsx(v0e,{client:nat,children:h.jsx(eat,{})})}));export{Y$ as C,LR as E,N_e as W,Xi as _,hc as a,dY as b,iF as c,gnt as d,Bqe as e,aYe as f,Mv as g,nJe as p,k as r,BU as u};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}