coinley-pay 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -46,7 +46,7 @@ const ES=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff
|
|
|
46
46
|
*
|
|
47
47
|
* This source code is licensed under the MIT license found in the
|
|
48
48
|
* LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/var gA="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},yA=mA.useSyncExternalStore,bA=pA.useRef,vA=pA.useEffect,wA=pA.useMemo,_A=pA.useDebugValue;nA.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=bA(null);if(null===o.current){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=wA(function(){function e(e){if(!c){if(c=!0,o=e,e=r(e),void 0!==i&&s.hasValue){var t=s.value;if(i(t,e))return a=t}return a=e}if(t=a,gA(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,a=n)}var o,a,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,i]);var a=yA(e,o[0],o[1]);return vA(function(){s.hasValue=!0,s.value=a},[a]),_A(a),a},tA.exports=nA;var EA=tA.exports;const xA=e=>"object"==typeof e&&!Array.isArray(e);function kA(e={}){const t=eA(e);return function(e,t,n=t,r=fI){const i=Yt.useRef([]),o=EA.useSyncExternalStoreWithSelector(e,t,n,e=>e,(e,t)=>{if(xA(e)&&xA(t)&&i.current.length){for(const n of i.current)if(!r(e[n],t[n]))return!1;return!0}return r(e,t)});return Yt.useMemo(()=>{if(xA(o)){const e={...o};let t={};for(const[n,r]of Object.entries(e))t={...t,[n]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(n)||i.current.push(n),r)}};return Object.defineProperties(e,t),e}return o},[o])}(e=>function(e,t){const{onChange:n}=t;return e.subscribe(()=>uI(e),n,{equalityFn(e,t){const{connector:n,...r}=e,{connector:i,...o}=t;return fI(r,o)&&(null==n?void 0:n.id)===(null==i?void 0:i.id)&&(null==n?void 0:n.uid)===(null==i?void 0:i.uid)}})}(t,{onChange:e}),()=>uI(t))}var SA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},CA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},IA=new(n=class{constructor(){Oe(this,e,CA),Oe(this,t,!1)}setTimeoutProvider(t){Me(this,e,t)}setTimeout(t,n){return Pe(this,e).setTimeout(t,n)}clearTimeout(t){Pe(this,e).clearTimeout(t)}setInterval(t,n){return Pe(this,e).setInterval(t,n)}clearInterval(t){Pe(this,e).clearInterval(t)}},e=new WeakMap,t=new WeakMap,n);var AA="undefined"==typeof window||"Deno"in globalThis;function PA(){}function OA(e){return"number"==typeof e&&e>=0&&e!==1/0}function MA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function TA(e,t){return"function"==typeof e?e(t):e}function RA(e,t){return"function"==typeof e?e(t):e}function NA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==BA(s,t.options))return!1}else if(!DA(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&((!i||i===t.state.fetchStatus)&&!(o&&!o(t)))}function LA(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(jA(t.options.mutationKey)!==jA(o))return!1}else if(!DA(t.options.mutationKey,o))return!1}return(!r||t.state.status===r)&&!(i&&!i(t))}function BA(e,t){return((null==t?void 0:t.queryKeyHashFn)||jA)(e)}function jA(e){return JSON.stringify(e,(e,t)=>qA(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function DA(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>DA(e[n],t[n])))}var UA=Object.prototype.hasOwnProperty;function $A(e,t){if(e===t)return e;const n=zA(e)&&zA(t);if(!(n||qA(e)&&qA(t)))return t;const r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),o=i.length,s=n?new Array(o):{};let a=0;for(let c=0;c<o;c++){const o=n?c:i[c],l=e[o],u=t[o];if(l===u){s[o]=l,(n?c<r:UA.call(e,o))&&a++;continue}if(null===l||null===u||"object"!=typeof l||"object"!=typeof u){s[o]=u;continue}const d=$A(l,u);s[o]=d,d===l&&a++}return r===o&&a===r?e:s}function FA(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function zA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qA(e){if(!HA(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!HA(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function HA(e){return"[object Object]"===Object.prototype.toString.call(e)}function WA(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?$A(e,t):t}function KA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function VA(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var GA=Symbol();function ZA(e,t){return!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==GA?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function YA(e,t){return"function"==typeof e?e(...t):!!e}var JA=new(s=class extends SA{constructor(){super(),Oe(this,r),Oe(this,i),Oe(this,o),Me(this,o,e=>{if(!AA&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){Pe(this,i)||this.setEventListener(Pe(this,o))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=Pe(this,i))||e.call(this),Me(this,i,void 0))}setEventListener(e){var t;Me(this,o,e),null==(t=Pe(this,i))||t.call(this),Me(this,i,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){Pe(this,r)!==e&&(Me(this,r,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return"boolean"==typeof Pe(this,r)?Pe(this,r):"hidden"!==(null==(e=globalThis.document)?void 0:e.visibilityState)}},r=new WeakMap,i=new WeakMap,o=new WeakMap,s);function QA(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}var XA=function(e){setTimeout(e,0)};var eP=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=XA;const o=r=>{t?e.push(r):i(()=>{n(r)})};return{batch:o=>{let s;t++;try{s=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return s},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}(),tP=new(u=class extends SA{constructor(){super(),Oe(this,a,!0),Oe(this,c),Oe(this,l),Me(this,l,e=>{if(!AA&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){Pe(this,c)||this.setEventListener(Pe(this,l))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=Pe(this,c))||e.call(this),Me(this,c,void 0))}setEventListener(e){var t;Me(this,l,e),null==(t=Pe(this,c))||t.call(this),Me(this,c,e(this.setOnline.bind(this)))}setOnline(e){Pe(this,a)!==e&&(Me(this,a,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return Pe(this,a)}},a=new WeakMap,c=new WeakMap,l=new WeakMap,u);function nP(e){return Math.min(1e3*2**e,3e4)}function rP(e){return"online"!==(e??"online")||tP.isOnline()}var iP=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function oP(e){let t,n=!1,r=0;const i=QA(),o=()=>"pending"!==i.status,s=()=>JA.isFocused()&&("always"===e.networkMode||tP.isOnline())&&e.canRun(),a=()=>rP(e.networkMode)&&e.canRun(),c=e=>{o()||(null==t||t(),i.resolve(e))},l=e=>{o()||(null==t||t(),i.reject(e))},u=()=>new Promise(n=>{var r;t=e=>{(o()||s())&&n(e)},null==(r=e.onPause)||r.call(e)}).then(()=>{var n;t=void 0,o()||null==(n=e.onContinue)||n.call(e)}),d=()=>{if(o())return;let t;const i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(cF){t=Promise.reject(cF)}Promise.resolve(t).then(c).catch(t=>{var i;if(o())return;const a=e.retry??(AA?0:3),c=e.retryDelay??nP,h="function"==typeof c?c(r,t):c,f=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,t);var p;!n&&f?(r++,null==(i=e.onFail)||i.call(e,r,t),(p=h,new Promise(e=>{IA.setTimeout(e,p)})).then(()=>s()?void 0:u()).then(()=>{n?l(t):d()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{var n;if(!o()){const r=new iP(t);l(r),null==(n=e.onCancel)||n.call(e,r)}},continue:()=>(null==t||t(),i),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?d():u().then(d),i)}}var sP=(h=class{constructor(){Oe(this,d)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),OA(this.gcTime)&&Me(this,d,IA.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(AA?1/0:3e5))}clearGcTimeout(){Pe(this,d)&&(IA.clearTimeout(Pe(this,d)),Me(this,d,void 0))}},d=new WeakMap,h),aP=(E=class extends sP{constructor(e){super(),Oe(this,w),Oe(this,f),Oe(this,p),Oe(this,m),Oe(this,g),Oe(this,y),Oe(this,b),Oe(this,v),Me(this,v,!1),Me(this,b,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,g,e.client),Me(this,m,Pe(this,g).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,f,uP(this.options)),this.state=e.state??Pe(this,f),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return null==(e=Pe(this,y))?void 0:e.promise}setOptions(e){if(this.options={...Pe(this,b),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=uP(this.options);void 0!==e.data&&(this.setState(lP(e.data,e.dataUpdatedAt)),Me(this,f,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||Pe(this,m).remove(this)}setData(e,t){const n=WA(this.state.data,e,this.options);return Te(this,w,_).call(this,{data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){Te(this,w,_).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,n;const r=null==(t=Pe(this,y))?void 0:t.promise;return null==(n=Pe(this,y))||n.cancel(e),r?r.then(PA).catch(PA):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Pe(this,f))}isActive(){return this.observers.some(e=>!1!==RA(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===GA||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===TA(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!MA(this.state.dataUpdatedAt,e))}onFocus(){var e;const t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null==(e=Pe(this,y))||e.continue()}onOnline(){var e;const t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null==(e=Pe(this,y))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Pe(this,m).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(Pe(this,y)&&(Pe(this,v)?Pe(this,y).cancel({revert:!0}):Pe(this,y).cancelRetry()),this.scheduleGc()),Pe(this,m).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,w,_).call(this,{type:"invalidate"})}async fetch(e,t){var n,r,i,o,s,a,c,l,u,d,h,f;if("idle"!==this.state.fetchStatus&&"rejected"!==(null==(n=Pe(this,y))?void 0:n.status()))if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(Pe(this,y))return Pe(this,y).continueRetry(),Pe(this,y).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const b=new AbortController,E=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Me(this,v,!0),b.signal)})},x=()=>{const e=ZA(this.options,t),n=(()=>{const e={client:Pe(this,g),queryKey:this.queryKey,meta:this.meta};return E(e),e})();return Me(this,v,!1),this.options.persister?this.options.persister(e,n,this):e(n)},k=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:Pe(this,g),state:this.state,fetchFn:x};return E(e),e})();null==(r=this.options.behavior)||r.onFetch(k,this),Me(this,p,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===(null==(i=k.fetchOptions)?void 0:i.meta)||Te(this,w,_).call(this,{type:"fetch",meta:null==(o=k.fetchOptions)?void 0:o.meta}),Me(this,y,oP({initialPromise:null==t?void 0:t.initialPromise,fn:k.fetchFn,onCancel:e=>{e instanceof iP&&e.revert&&this.setState({...Pe(this,p),fetchStatus:"idle"}),b.abort()},onFail:(e,t)=>{Te(this,w,_).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Te(this,w,_).call(this,{type:"pause"})},onContinue:()=>{Te(this,w,_).call(this,{type:"continue"})},retry:k.options.retry,retryDelay:k.options.retryDelay,networkMode:k.options.networkMode,canRun:()=>!0}));try{const e=await Pe(this,y).start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),null==(a=(s=Pe(this,m).config).onSuccess)||a.call(s,e,this),null==(l=(c=Pe(this,m).config).onSettled)||l.call(c,e,this.state.error,this),e}catch(cF){if(cF instanceof iP){if(cF.silent)return Pe(this,y).promise;if(cF.revert){if(void 0===this.state.data)throw cF;return this.state.data}}throw Te(this,w,_).call(this,{type:"error",error:cF}),null==(d=(u=Pe(this,m).config).onError)||d.call(u,cF,this),null==(f=(h=Pe(this,m).config).onSettled)||f.call(h,this.state.data,cF,this),cF}finally{this.scheduleGc()}}},f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,b=new WeakMap,v=new WeakMap,w=new WeakSet,_=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...cP(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...lP(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,p,e.manual?n:void 0),n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),eP.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),Pe(this,m).notify({query:this,type:"updated",action:e})})},E);function cP(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rP(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function lP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function uP(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dP=(G=class extends SA{constructor(e,t){super(),Oe(this,D),Oe(this,x),Oe(this,k),Oe(this,S),Oe(this,C),Oe(this,I),Oe(this,A),Oe(this,P),Oe(this,O),Oe(this,M),Oe(this,T),Oe(this,R),Oe(this,N),Oe(this,L),Oe(this,B),Oe(this,j,new Set),this.options=t,Me(this,x,e),Me(this,O,null),Me(this,P,QA()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(Pe(this,k).addObserver(this),hP(Pe(this,k),this.options)?Te(this,D,U).call(this):this.updateResult(),Te(this,D,q).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fP(Pe(this,k),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fP(Pe(this,k),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,D,H).call(this),Te(this,D,W).call(this),Pe(this,k).removeObserver(this)}setOptions(e){const t=this.options,n=Pe(this,k);if(this.options=Pe(this,x).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof RA(this.options.enabled,Pe(this,k)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,D,K).call(this),Pe(this,k).setOptions(this.options),t._defaulted&&!FA(this.options,t)&&Pe(this,x).getQueryCache().notify({type:"observerOptionsUpdated",query:Pe(this,k),observer:this});const r=this.hasListeners();r&&pP(Pe(this,k),n,this.options,t)&&Te(this,D,U).call(this),this.updateResult(),!r||Pe(this,k)===n&&RA(this.options.enabled,Pe(this,k))===RA(t.enabled,Pe(this,k))&&TA(this.options.staleTime,Pe(this,k))===TA(t.staleTime,Pe(this,k))||Te(this,D,$).call(this);const i=Te(this,D,F).call(this);!r||Pe(this,k)===n&&RA(this.options.enabled,Pe(this,k))===RA(t.enabled,Pe(this,k))&&i===Pe(this,B)||Te(this,D,z).call(this,i)}getOptimisticResult(e){const t=Pe(this,x).getQueryCache().build(Pe(this,x),e),n=this.createResult(t,e);return function(e,t){if(!FA(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(Me(this,C,n),Me(this,A,this.options),Me(this,I,Pe(this,k).state)),n}getCurrentResult(){return Pe(this,C)}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),null==t||t(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==Pe(this,P).status||Pe(this,P).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){Pe(this,j).add(e)}getCurrentQuery(){return Pe(this,k)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=Pe(this,x).defaultQueryOptions(e),n=Pe(this,x).getQueryCache().build(Pe(this,x),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return Te(this,D,U).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Pe(this,C)))}createResult(e,t){var n;const r=Pe(this,k),i=this.options,o=Pe(this,C),s=Pe(this,I),a=Pe(this,A),c=e!==r?e.state:Pe(this,S),{state:l}=e;let u,d={...l},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&hP(e,t),s=n&&pP(e,r,t,i);(o||s)&&(d={...d,...cP(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:m}=d;u=d.data;let g=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;(null==o?void 0:o.isPlaceholderData)&&t.placeholderData===(null==a?void 0:a.placeholderData)?(e=o.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(null==(n=Pe(this,R))?void 0:n.state.data,Pe(this,R)):t.placeholderData,void 0!==e&&(m="success",u=WA(null==o?void 0:o.data,e,t),h=!0)}if(t.select&&void 0!==u&&!g)if(o&&u===(null==s?void 0:s.data)&&t.select===Pe(this,M))u=Pe(this,T);else try{Me(this,M,t.select),u=t.select(u),u=WA(null==o?void 0:o.data,u,t),Me(this,T,u),Me(this,O,null)}catch(x){Me(this,O,x)}Pe(this,O)&&(f=Pe(this,O),u=Pe(this,T),p=Date.now(),m="error");const y="fetching"===d.fetchStatus,b="pending"===m,v="error"===m,w=b&&y,_=void 0!==u,E={status:m,fetchStatus:d.fetchStatus,isPending:b,isSuccess:"success"===m,isError:v,isInitialLoading:w,isLoading:w,data:u,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:v&&!_,isPaused:"paused"===d.fetchStatus,isPlaceholderData:h,isRefetchError:v&&_,isStale:mP(e,t),refetch:this.refetch,promise:Pe(this,P),isEnabled:!1!==RA(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===E.status?e.reject(E.error):void 0!==E.data&&e.resolve(E.data)},n=()=>{const e=Me(this,P,E.promise=QA());t(e)},i=Pe(this,P);switch(i.status){case"pending":e.queryHash===r.queryHash&&t(i);break;case"fulfilled":"error"!==E.status&&E.data===i.value||n();break;case"rejected":"error"===E.status&&E.error===i.reason||n()}}return E}updateResult(){const e=Pe(this,C),t=this.createResult(Pe(this,k),this.options);if(Me(this,I,Pe(this,k).state),Me(this,A,this.options),void 0!==Pe(this,I).data&&Me(this,R,Pe(this,k)),FA(t,e))return;Me(this,C,t);Te(this,D,V).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!Pe(this,j).size)return!0;const r=new Set(n??Pe(this,j));return this.options.throwOnError&&r.add("error"),Object.keys(Pe(this,C)).some(t=>{const n=t;return Pe(this,C)[n]!==e[n]&&r.has(n)})})()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,D,q).call(this)}},x=new WeakMap,k=new WeakMap,S=new WeakMap,C=new WeakMap,I=new WeakMap,A=new WeakMap,P=new WeakMap,O=new WeakMap,M=new WeakMap,T=new WeakMap,R=new WeakMap,N=new WeakMap,L=new WeakMap,B=new WeakMap,j=new WeakMap,D=new WeakSet,U=function(e){Te(this,D,K).call(this);let t=Pe(this,k).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(PA)),t},$=function(){Te(this,D,H).call(this);const e=TA(this.options.staleTime,Pe(this,k));if(AA||Pe(this,C).isStale||!OA(e))return;const t=MA(Pe(this,C).dataUpdatedAt,e)+1;Me(this,N,IA.setTimeout(()=>{Pe(this,C).isStale||this.updateResult()},t))},F=function(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(Pe(this,k)):this.options.refetchInterval)??!1},z=function(e){Te(this,D,W).call(this),Me(this,B,e),!AA&&!1!==RA(this.options.enabled,Pe(this,k))&&OA(Pe(this,B))&&0!==Pe(this,B)&&Me(this,L,IA.setInterval(()=>{(this.options.refetchIntervalInBackground||JA.isFocused())&&Te(this,D,U).call(this)},Pe(this,B)))},q=function(){Te(this,D,$).call(this),Te(this,D,z).call(this,Te(this,D,F).call(this))},H=function(){Pe(this,N)&&(IA.clearTimeout(Pe(this,N)),Me(this,N,void 0))},W=function(){Pe(this,L)&&(IA.clearInterval(Pe(this,L)),Me(this,L,void 0))},K=function(){const e=Pe(this,x).getQueryCache().build(Pe(this,x),this.options);if(e===Pe(this,k))return;const t=Pe(this,k);Me(this,k,e),Me(this,S,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))},V=function(e){eP.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(Pe(this,C))}),Pe(this,x).getQueryCache().notify({query:Pe(this,k),type:"observerResultsUpdated"})})},G);function hP(e,t){return function(e,t){return!1!==RA(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&fP(e,t,t.refetchOnMount)}function fP(e,t,n){if(!1!==RA(t.enabled,e)&&"static"!==TA(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&mP(e,t)}return!1}function pP(e,t,n,r){return(e!==t||!1===RA(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&mP(e,n)}function mP(e,t){return!1!==RA(t.enabled,e)&&e.isStaleByTime(TA(t.staleTime,e))}function gP(e){return{onFetch:(t,n)=>{var r,i,o,s,a;const c=t.options,l=null==(o=null==(i=null==(r=t.fetchOptions)?void 0:r.meta)?void 0:i.fetchMore)?void 0:o.direction,u=(null==(s=t.state.data)?void 0:s.pages)||[],d=(null==(a=t.state.data)?void 0:a.pageParams)||[];let h={pages:[],pageParams:[]},f=0;const p=async()=>{let n=!1;const r=e=>{!function(e,t,n){let r,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??(r=t()),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)})}(e,()=>t.signal,()=>n=!0)},i=ZA(t.options,t.fetchOptions),o=async(e,o,s)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);const a=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:o,direction:s?"backward":"forward",meta:t.options.meta};return r(e),e})(),c=await i(a),{maxPages:l}=t.options,u=s?VA:KA;return{pages:u(e.pages,c,l),pageParams:u(e.pageParams,o,l)}};if(l&&u.length){const e="backward"===l,t={pages:u,pageParams:d},n=(e?bP:yP)(c,t);h=await o(t,n,e)}else{const t=e??u.length;do{const e=0===f?d[0]??c.initialPageParam:yP(c,h);if(f>0&&null==e)break;h=await o(h,e),f++}while(f<t)}return h};t.options.persister?t.fetchFn=()=>{var e,r;return null==(r=(e=t.options).persister)?void 0:r.call(e,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function yP(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bP(e,{pages:t,pageParams:n}){var r;return t.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,t[0],t,n[0],n):void 0}var vP=(te=class extends sP{constructor(e){super(),Oe(this,X),Oe(this,Z),Oe(this,Y),Oe(this,J),Oe(this,Q),Me(this,Z,e.client),this.mutationId=e.mutationId,Me(this,J,e.mutationCache),Me(this,Y,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Pe(this,Y).includes(e)||(Pe(this,Y).push(e),this.clearGcTimeout(),Pe(this,J).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,Y,Pe(this,Y).filter(t=>t!==e)),this.scheduleGc(),Pe(this,J).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Pe(this,Y).length||("pending"===this.state.status?this.scheduleGc():Pe(this,J).remove(this))}continue(){var e;return(null==(e=Pe(this,Q))?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var t,n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,y,b,v,w;const _=()=>{Te(this,X,ee).call(this,{type:"continue"})},E={client:Pe(this,Z),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Q,oP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,E):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{Te(this,X,ee).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Te(this,X,ee).call(this,{type:"pause"})},onContinue:_,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Pe(this,J).canRun(this)}));const x="pending"===this.state.status,k=!Pe(this,Q).canStart();try{if(x)_();else{Te(this,X,ee).call(this,{type:"pending",variables:e,isPaused:k}),await(null==(n=(t=Pe(this,J).config).onMutate)?void 0:n.call(t,e,this,E));const o=await(null==(i=(r=this.options).onMutate)?void 0:i.call(r,e,E));o!==this.state.context&&Te(this,X,ee).call(this,{type:"pending",context:o,variables:e,isPaused:k})}const f=await Pe(this,Q).start();return await(null==(s=(o=Pe(this,J).config).onSuccess)?void 0:s.call(o,f,e,this.state.context,this,E)),await(null==(c=(a=this.options).onSuccess)?void 0:c.call(a,f,e,this.state.context,E)),await(null==(u=(l=Pe(this,J).config).onSettled)?void 0:u.call(l,f,null,this.state.variables,this.state.context,this,E)),await(null==(h=(d=this.options).onSettled)?void 0:h.call(d,f,null,e,this.state.context,E)),Te(this,X,ee).call(this,{type:"success",data:f}),f}catch(cF){try{await(null==(p=(f=Pe(this,J).config).onError)?void 0:p.call(f,cF,e,this.state.context,this,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(g=(m=this.options).onError)?void 0:g.call(m,cF,e,this.state.context,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(b=(y=Pe(this,J).config).onSettled)?void 0:b.call(y,void 0,cF,this.state.variables,this.state.context,this,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(w=(v=this.options).onSettled)?void 0:w.call(v,void 0,cF,e,this.state.context,E))}catch(qAe){Promise.reject(qAe)}throw Te(this,X,ee).call(this,{type:"error",error:cF}),cF}finally{Pe(this,J).runNext(this)}}},Z=new WeakMap,Y=new WeakMap,J=new WeakMap,Q=new WeakMap,X=new WeakSet,ee=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),eP.batch(()=>{Pe(this,Y).forEach(t=>{t.onMutationUpdate(e)}),Pe(this,J).notify({mutation:this,type:"updated",action:e})})},te);var wP=(oe=class extends SA{constructor(e={}){super(),Oe(this,ne),Oe(this,re),Oe(this,ie),this.config=e,Me(this,ne,new Set),Me(this,re,new Map),Me(this,ie,0)}build(e,t,n){const r=new vP({client:e,mutationCache:this,mutationId:++Re(this,ie)._,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){Pe(this,ne).add(e);const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t);n?n.push(e):Pe(this,re).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Pe(this,ne).delete(e)){const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&Pe(this,re).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t),r=null==n?void 0:n.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){var t;const n=_P(e);if("string"==typeof n){const r=null==(t=Pe(this,re).get(n))?void 0:t.find(t=>t!==e&&t.state.isPaused);return(null==r?void 0:r.continue())??Promise.resolve()}return Promise.resolve()}clear(){eP.batch(()=>{Pe(this,ne).forEach(e=>{this.notify({type:"removed",mutation:e})}),Pe(this,ne).clear(),Pe(this,re).clear()})}getAll(){return Array.from(Pe(this,ne))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>LA(t,e))}findAll(e={}){return this.getAll().filter(t=>LA(e,t))}notify(e){eP.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return eP.batch(()=>Promise.all(e.map(e=>e.continue().catch(PA))))}},ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe);function _P(e){var t;return null==(t=e.options.scope)?void 0:t.id}var EP=(fe=class extends SA{constructor(e,t){super(),Oe(this,ue),Oe(this,se),Oe(this,ae),Oe(this,ce),Oe(this,le),Me(this,se,e),this.setOptions(t),this.bindMethods(),Te(this,ue,de).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const n=this.options;this.options=Pe(this,se).defaultMutationOptions(e),FA(this.options,n)||Pe(this,se).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Pe(this,ce),observer:this}),(null==n?void 0:n.mutationKey)&&this.options.mutationKey&&jA(n.mutationKey)!==jA(this.options.mutationKey)?this.reset():"pending"===(null==(t=Pe(this,ce))?void 0:t.state.status)&&Pe(this,ce).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||null==(e=Pe(this,ce))||e.removeObserver(this)}onMutationUpdate(e){Te(this,ue,de).call(this),Te(this,ue,he).call(this,e)}getCurrentResult(){return Pe(this,ae)}reset(){var e;null==(e=Pe(this,ce))||e.removeObserver(this),Me(this,ce,void 0),Te(this,ue,de).call(this),Te(this,ue,he).call(this)}mutate(e,t){var n;return Me(this,le,t),null==(n=Pe(this,ce))||n.removeObserver(this),Me(this,ce,Pe(this,se).getMutationCache().build(Pe(this,se),this.options)),Pe(this,ce).addObserver(this),Pe(this,ce).execute(e)}},se=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,ue=new WeakSet,de=function(){var e;const t=(null==(e=Pe(this,ce))?void 0:e.state)??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};Me(this,ae,{...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset})},he=function(e){eP.batch(()=>{var t,n,r,i,o,s,a,c;if(Pe(this,le)&&this.hasListeners()){const l=Pe(this,ae).variables,u=Pe(this,ae).context,d={client:Pe(this,se),meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===(null==e?void 0:e.type)){try{null==(n=(t=Pe(this,le)).onSuccess)||n.call(t,e.data,l,u,d)}catch(qAe){Promise.reject(qAe)}try{null==(i=(r=Pe(this,le)).onSettled)||i.call(r,e.data,null,l,u,d)}catch(qAe){Promise.reject(qAe)}}else if("error"===(null==e?void 0:e.type)){try{null==(s=(o=Pe(this,le)).onError)||s.call(o,e.error,l,u,d)}catch(qAe){Promise.reject(qAe)}try{null==(c=(a=Pe(this,le)).onSettled)||c.call(a,void 0,e.error,l,u,d)}catch(qAe){Promise.reject(qAe)}}}this.listeners.forEach(e=>{e(Pe(this,ae))})})},fe),xP=(me=class extends SA{constructor(e={}){super(),Oe(this,pe),this.config=e,Me(this,pe,new Map)}build(e,t,n){const r=t.queryKey,i=t.queryHash??BA(r,t);let o=this.get(i);return o||(o=new aP({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){Pe(this,pe).has(e.queryHash)||(Pe(this,pe).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=Pe(this,pe).get(e.queryHash);t&&(e.destroy(),t===e&&Pe(this,pe).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){eP.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Pe(this,pe).get(e)}getAll(){return[...Pe(this,pe).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>NA(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>NA(e,t)):t}notify(e){eP.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eP.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eP.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pe=new WeakMap,me),kP=(ke=class{constructor(e={}){Oe(this,ge),Oe(this,ye),Oe(this,be),Oe(this,ve),Oe(this,we),Oe(this,_e),Oe(this,Ee),Oe(this,xe),Me(this,ge,e.queryCache||new xP),Me(this,ye,e.mutationCache||new wP),Me(this,be,e.defaultOptions||{}),Me(this,ve,new Map),Me(this,we,new Map),Me(this,_e,0)}mount(){Re(this,_e)._++,1===Pe(this,_e)&&(Me(this,Ee,JA.subscribe(async e=>{e&&(await this.resumePausedMutations(),Pe(this,ge).onFocus())})),Me(this,xe,tP.subscribe(async e=>{e&&(await this.resumePausedMutations(),Pe(this,ge).onOnline())})))}unmount(){var e,t;Re(this,_e)._--,0===Pe(this,_e)&&(null==(e=Pe(this,Ee))||e.call(this),Me(this,Ee,void 0),null==(t=Pe(this,xe))||t.call(this),Me(this,xe,void 0))}isFetching(e){return Pe(this,ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Pe(this,ye).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=Pe(this,ge).get(n.queryHash))?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Pe(this,ge).build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(TA(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Pe(this,ge).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Pe(this,ge).get(r.queryHash),o=function(e,t){return"function"==typeof e?e(t):e}(t,null==i?void 0:i.state.data);if(void 0!==o)return Pe(this,ge).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return eP.batch(()=>Pe(this,ge).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=Pe(this,ge).get(n.queryHash))?void 0:t.state}removeQueries(e){const t=Pe(this,ge);eP.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=Pe(this,ge);return eP.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=eP.batch(()=>Pe(this,ge).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(PA).catch(PA)}invalidateQueries(e,t={}){return eP.batch(()=>(Pe(this,ge).findAll(e).forEach(e=>{e.invalidate()}),"none"===(null==e?void 0:e.refetchType)?Promise.resolve():this.refetchQueries({...e,type:(null==e?void 0:e.refetchType)??(null==e?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=eP.batch(()=>Pe(this,ge).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(PA)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(PA)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=Pe(this,ge).build(this,t);return n.isStaleByTime(TA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(PA).catch(PA)}fetchInfiniteQuery(e){return e.behavior=gP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(PA).catch(PA)}ensureInfiniteQueryData(e){return e.behavior=gP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tP.isOnline()?Pe(this,ye).resumePausedMutations():Promise.resolve()}getQueryCache(){return Pe(this,ge)}getMutationCache(){return Pe(this,ye)}getDefaultOptions(){return Pe(this,be)}setDefaultOptions(e){Me(this,be,e)}setQueryDefaults(e,t){Pe(this,ve).set(jA(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Pe(this,ve).values()],n={};return t.forEach(t=>{DA(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){Pe(this,we).set(jA(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Pe(this,we).values()],n={};return t.forEach(t=>{DA(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Pe(this,be).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=BA(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===GA&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...Pe(this,be).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Pe(this,ge).clear(),Pe(this,ye).clear()}},ge=new WeakMap,ye=new WeakMap,be=new WeakMap,ve=new WeakMap,we=new WeakMap,_e=new WeakMap,Ee=new WeakMap,xe=new WeakMap,ke);function SP(e){return JSON.stringify(e,(e,t)=>function(e){if(!CP(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!CP(n)&&!!n.hasOwnProperty("isPrototypeOf")}(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):"bigint"==typeof t?t.toString():t)}function CP(e){return"[object Object]"===Object.prototype.toString.call(e)}function IP(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:i,initialDataUpdatedAt:o,maxPages:s,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:d,queryKeyHashFn:h,retry:f,retryDelay:p,structuralSharing:m,getPreviousPageParam:g,getNextPageParam:y,initialPageParam:b,_optimisticResults:v,enabled:w,notifyOnChangeProps:_,placeholderData:E,refetchInterval:x,refetchIntervalInBackground:k,refetchOnMount:S,refetchOnReconnect:C,refetchOnWindowFocus:I,retryOnMount:A,select:P,staleTime:O,suspense:M,throwOnError:T,config:R,connector:N,query:L,...B}=e;return B}function AP(e){return{mutationFn:t=>async function(e,t){var n;let r;if(r="function"==typeof t.connector?e._internal.connectors.setup(t.connector):t.connector,r.uid===e.state.current)throw new qC;try{e.setState(e=>({...e,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const{connector:i,...o}=t,s=await r.connect(o);return r.emitter.off("connect",e._internal.events.connect),r.emitter.on("change",e._internal.events.change),r.emitter.on("disconnect",e._internal.events.disconnect),await(null==(n=e.storage)?void 0:n.setItem("recentConnectorId",r.id)),e.setState(e=>({...e,connections:new Map(e.connections).set(r.uid,{accounts:o.withCapabilities?s.accounts.map(e=>"object"==typeof e?e.address:e):s.accounts,chainId:s.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:o.withCapabilities?s.accounts.map(e=>"object"==typeof e?e:{address:e,capabilities:{}}):s.accounts,chainId:s.chainId}}catch(cF){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),cF}}(e,t),mutationKey:["connect"]}}function PP(e){return{mutationFn:t=>async function(e,t){const{account:n,chainId:r,connector:i,...o}=t;let s;s="object"==typeof n&&"local"===(null==n?void 0:n.type)?e.getClient({chainId:r}):await cI(e,{account:n??void 0,assertChainId:!1,chainId:r,connector:i});const a=BC(s,PC,"sendTransaction");return await a({...o,...n?{account:n}:{},chain:r?{id:r}:null,gas:o.gas??void 0})}(e,t),mutationKey:["sendTransaction"]}}function OP(e){return{mutationFn:t=>async function(e,t){var n;const{addEthereumChainParameter:r,chainId:i}=t,o=e.state.connections.get((null==(n=t.connector)?void 0:n.uid)??e.state.current);if(o){const e=o.connector;if(!e.switchChain)throw new wI({connector:e});return await e.switchChain({addEthereumChainParameter:r,chainId:i})}const s=e.chains.find(e=>e.id===i);if(!s)throw new zC;return e.setState(e=>({...e,chainId:i})),s}(e,t),mutationKey:["switchChain"]}}function MP(e={}){const{onReplaced:t,...n}=e;return["waitForTransactionReceipt",IP(n)]}var TP=Yt.createContext(void 0),RP=e=>{const t=Yt.useContext(TP);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NP=({client:e,children:t})=>(Yt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),bf.jsx(TP.Provider,{value:e,children:t})),LP=Yt.createContext(!1);LP.Provider;var BP=Yt.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),jP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DP(e,t,n){var r,i,o,s,a;const c=Yt.useContext(LP),l=Yt.useContext(BP),u=RP(),d=u.defaultQueryOptions(e);null==(i=null==(r=u.getDefaultOptions().queries)?void 0:r._experimental_beforeQuery)||i.call(r,d),d._optimisticResults=c?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(d),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(d,l),(e=>{Yt.useEffect(()=>{e.clearReset()},[e])})(l);const h=!u.getQueryCache().get(d.queryHash),[f]=Yt.useState(()=>new t(u,d)),p=f.getOptimisticResult(d),m=!c&&!1!==e.subscribed;if(Yt.useSyncExternalStore(Yt.useCallback(e=>{const t=m?f.subscribe(eP.batchCalls(e)):PA;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),Yt.useEffect(()=>{f.setOptions(d)},[d,f]),((e,t)=>(null==e?void 0:e.suspense)&&t.isPending)(d,p))throw jP(d,f,l);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||YA(n,[e.error,r])))({result:p,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw p.error;if(null==(s=null==(o=u.getDefaultOptions().queries)?void 0:o._experimental_afterQuery)||s.call(o,d,p),d.experimental_prefetchInRender&&!AA&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,c)){const e=h?jP(d,f,l):null==(a=u.getQueryCache().get(d.queryHash))?void 0:a.promise;null==e||e.catch(PA).finally(()=>{f.updateResult()})}return d.notifyOnChangeProps?p:f.trackResult(p)}function UP(e,t){const n=RP(),[r]=Yt.useState(()=>new EP(n,e));Yt.useEffect(()=>{r.setOptions(e)},[r,e]);const i=Yt.useSyncExternalStore(Yt.useCallback(e=>r.subscribe(eP.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=Yt.useCallback((e,t)=>{r.mutate(e,t).catch(PA)},[r]);if(i.error&&YA(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function $P(e){const t=DP({...e,queryKeyHashFn:SP},dP);return t.queryKey=e.queryKey,t}function FP(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((e,t)=>{n(e,t)})}(t,{onChange:e}),()=>mI(t),()=>mI(t))}function zP(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((e,t)=>{n(Object.values(e),t)})}(t,{onChange:e}),()=>yI(t),()=>yI(t))}function qP(e={}){const{mutation:t}=e,n=eA(e),r=AP(n),{mutate:i,mutateAsync:o,...s}=UP({...t,...r});return Yt.useEffect(()=>n.subscribe(({status:e})=>e,(e,t)=>{"connected"===t&&"disconnected"===e&&s.reset()}),[n,s.reset]),{...s,connect:i,connectAsync:o,connectors:zP({config:n})}}function HP(e={}){const{hash:t,query:n={}}=e,r=eA(e),i=function(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e.subscribe(e=>e.chainId,n)}(t,{onChange:e}),()=>hI(t),()=>hI(t))}({config:r}),o=function(e,t={}){return{async queryFn({queryKey:n}){const{hash:r,...i}=n[1];if(!r)throw new Error("hash is required");return _I(e,{...i,onReplaced:t.onReplaced,hash:r})},queryKey:MP(t)}}(r,{...e,chainId:e.chainId??i}),s=Boolean(t&&(n.enabled??!0));return $P({...n,...o,enabled:s})}function WP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var KP,VP,GP={exports:{}},ZP=GP.exports={};function YP(){throw new Error("setTimeout has not been defined")}function JP(){throw new Error("clearTimeout has not been defined")}function QP(e){if(KP===setTimeout)return setTimeout(e,0);if((KP===YP||!KP)&&setTimeout)return KP=setTimeout,setTimeout(e,0);try{return KP(e,0)}catch(qAe){try{return KP.call(null,e,0)}catch(t){return KP.call(this,e,0)}}}!function(){try{KP="function"==typeof setTimeout?setTimeout:YP}catch(qAe){KP=YP}try{VP="function"==typeof clearTimeout?clearTimeout:JP}catch(qAe){VP=JP}}();var XP,eO=[],tO=!1,nO=-1;function rO(){tO&&XP&&(tO=!1,XP.length?eO=XP.concat(eO):nO=-1,eO.length&&iO())}function iO(){if(!tO){var e=QP(rO);tO=!0;for(var t=eO.length;t;){for(XP=eO,eO=[];++nO<t;)XP&&XP[nO].run();nO=-1,t=eO.length}XP=null,tO=!1,function(e){if(VP===clearTimeout)return clearTimeout(e);if((VP===JP||!VP)&&clearTimeout)return VP=clearTimeout,clearTimeout(e);try{return VP(e)}catch(qAe){try{return VP.call(null,e)}catch(t){return VP.call(this,e)}}}(e)}}function oO(e,t){this.fun=e,this.array=t}function sO(){}ZP.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];eO.push(new oO(e,t)),1!==eO.length||tO||QP(iO)},oO.prototype.run=function(){this.fun.apply(null,this.array)},ZP.title="browser",ZP.browser=!0,ZP.env={},ZP.argv=[],ZP.version="",ZP.versions={},ZP.on=sO,ZP.addListener=sO,ZP.once=sO,ZP.off=sO,ZP.removeListener=sO,ZP.removeAllListeners=sO,ZP.emit=sO,ZP.prependListener=sO,ZP.prependOnceListener=sO,ZP.listeners=function(e){return[]},ZP.binding=function(e){throw new Error("process.binding is not supported")},ZP.cwd=function(){return"/"},ZP.chdir=function(e){throw new Error("process.chdir is not supported")},ZP.umask=function(){return 0};const aO=WP(GP.exports);var cO;if("undefined"==typeof window){var lO={hostname:""};cO={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:lO,referrer:""},screen:{width:0,height:0},location:lO,addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){},CustomEvent:function(){}}}else cO=window;function uO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dO(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(cF){return void n(cF)}a.done?t(c):Promise.resolve(c).then(r,i)}function hO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){dO(o,r,i,s,a,"next",e)}function a(e){dO(o,r,i,s,a,"throw",e)}s(void 0)})}}function fO(e,t,n){return fO=xO()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&wO(i,n.prototype),i},fO.apply(null,arguments)}function pO(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function mO(){return mO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mO.apply(this,arguments)}function gO(e){return(gO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wO(e,t)}function bO(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function vO(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function wO(e,t){return(wO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _O(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function EO(e){var t="function"==typeof Map?new Map:void 0;return EO=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return fO(e,arguments,gO(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),wO(r,e)},EO(e)}function xO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xO=function(){return!!e})()}function kO(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return uO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uO(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function SO(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(qAe){o=[6,qAe],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function CO(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var IO,AO=Object.defineProperty,PO=function(e,t,n){return function(e,t,n){return t in e?AO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)},OO=Object.defineProperty,MO=function(e,t,n){return function(e,t,n){return t in e?OO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)},TO=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(TO||{}),RO={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},NO={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},LO={};function BO(e){if(LO[e])return LO[e];var t=globalThis[e],n=t.prototype,r=e in RO?RO[e]:void 0,i=Boolean(r&&r.every(function(e){var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in NO?NO[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return LO[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?LO[e]=l:n}catch(qAe){return n}}var jO={};function DO(e,t,n){var r,i=e+"."+String(n);if(jO[i])return jO[i].call(t);var o=BO(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(jO[i]=s,s.call(t)):t[n]}var UO={};function $O(e,t,n){var r=e+"."+String(n);if(UO[r])return UO[r].bind(t);var i=BO(e)[n];return"function"!=typeof i?t[n]:(UO[r]=i,i.bind(t))}var FO={childNodes:function(e){return DO("Node",e,"childNodes")},parentNode:function(e){return DO("Node",e,"parentNode")},parentElement:function(e){return DO("Node",e,"parentElement")},textContent:function(e){return DO("Node",e,"textContent")},contains:function(e,t){return $O("Node",e,"contains")(t)},getRootNode:function(e){return $O("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?DO("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?DO("Element",e,"shadowRoot"):null},querySelector:function(e,t){return DO("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return DO("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return BO("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}};function zO(e){return e.nodeType===e.ELEMENT_NODE}function qO(e){var t=e&&"host"in e&&"mode"in e&&FO.host(e)||null;return Boolean(t&&"shadowRoot"in t&&FO.shadowRoot(t)===e)}function HO(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function WO(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var r=Array.from(t,function(e){return KO(e,n)}).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(cF){return null}var i}function KO(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=WO(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(cF){n=e.cssText}return e.styleSheet.href?rM(n,e.styleSheet.href):n}var r,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(r,"$1\\$2")),t?rM(i,t):i}var VO=function(){function e(){MO(this,"idNodeMap",new Map),MO(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1},t.getNode=function(e){return this.idNodeMap.get(e)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},t.has=function(e){return this.idNodeMap.has(e)},t.hasNode=function(e){return this.nodeMetaMap.has(e)},t.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},t.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function GO(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=i&&ZO(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function ZO(e){return e.toLowerCase()}var YO="__rrweb_original__";function JO(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ZO(t):null}function QO(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(o){return null}var r,i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(r=null==i?void 0:i[1])?r:null}var XO=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,eM=/^(?:[a-z+]+:)?\/\//i,tM=/^www\..*/i,nM=/^(data:)([^,]*),(.*)/i;function rM(e,t){return(e||"").replace(XO,function(e,n,r,i,o,s){var a,c=r||o||s,l=n||i||"";if(!c)return e;if(eM.test(c)||tM.test(c))return"url("+l+c+l+")";if(nM.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),d=c.split("/");u.pop();for(var h,f=kO(d);!(h=f()).done;){var p=h.value;"."!==p&&(".."===p?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function iM(e,t){return void 0===t&&(t=!1),t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function oM(e,t){return function(e,t,n){void 0===n&&(n=!1);var r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&"string"==typeof e)for(var s=iM(e,n),a=s.length/e.length,c=1;c<r.length;c++)if(r[c].textContent&&"string"==typeof r[c].textContent){for(var l=iM(r[c].textContent,n),u=3;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){var d=l.substring(0,u),h=s.split(d),f=-1;if(2===h.length)f=h[0].length;else if(h.length>2&&""===h[0]&&""!==r[c-1].textContent)f=s.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),(h=s.split(d)).length<=1)return i.push(e),i;u=101}else u===l.length-1&&(f=s.indexOf(d));if(h.length>=2&&u>100){var p=r[c-1].textContent;if(p&&"string"==typeof p){var m=iM(p).length;f=s.indexOf(d,m)}-1===f&&(f=h[0].length)}if(-1!==f){for(var g=Math.floor(f/a);g>0&&g<e.length;){if((o+=1)>50*r.length)return i.push(e),i;var y=iM(e.substring(0,g),n);if(y.length===f){i.push(e.substring(0,g)),e=e.substring(g),s=s.substring(f);break}y.length<f?g+=Math.max(1,Math.floor((f-y.length)/a)):g-=Math.max(1,Math.floor((y.length-f)*a))}break}}}return i.push(e),i}(e,t).join("/* rr_split */")}var sM,aM,cM=1,lM=new RegExp("[^a-z0-9-_:]");function uM(){return cM++}var dM=/^[^ \t\n\r\u000c]+/,hM=/^[, \t\n\r\u000c]+/;var fM=new WeakMap;function pM(e,t){return t&&""!==t.trim()?gM(e,t):t}function mM(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function gM(e,t){var n=fM.get(e);if(n||(n=e.createElement("a"),fM.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function yM(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?pM(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(hM),!(n>=t.length);){var o=r(dM);if(","===o.slice(-1))o=pM(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=pM(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return i.join(", ")}(e,r):"style"===n?rM(r,gM(e)):"object"===t&&"data"===n?pM(e,r):r:pM(e,r):r}function bM(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function vM(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&vM(FO.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&vM(FO.parentNode(e),t,n)}function wM(e,t,n,r){var i;if(zO(e)){if(i=e,!FO.childNodes(i).length)return!1}else{if(null===FO.parentElement(e))return!1;i=FO.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(vM(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(qAe){}return!1}function _M(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.needsMask,a=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,u=t.maskTextFn,d=t.maskInputFn,h=t.dataURLOptions,f=void 0===h?{}:h,p=t.inlineImages,m=t.recordCanvas,g=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,v=t.cssCaptured,w=void 0!==v&&v,_=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:TO.Document,childNodes:[],compatMode:e.compatMode}:{type:TO.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:TO.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,i=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,c=void 0===a?{}:a,l=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,h=t.inlineImages,f=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,g=void 0!==m&&m,y=t.rootId,b=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(qAe){}return!1}(e,i,o),v=function(e){if(bO(e,HTMLFormElement))return"form";var t=ZO(e.tagName);return lM.test(t)?"div":t}(e),w={},_=e.attributes.length,E=0;E<_;E++){var x=e.attributes[E];bM(v,x.name,x.value)||(w[x.name]=yM(r,v,ZO(x.name),x.value))}if("link"===v&&s){var k=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),S=null;k&&(S=WO(k)),S&&(delete w.rel,delete w.href,w._cssText=S)}if("style"===v&&e.sheet){var C=WO(e.sheet);C&&(e.childNodes.length>1&&(C=oM(C,e)),w._cssText=C)}if("input"===v||"textarea"===v||"select"===v){var I=e.value,A=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&I?w.value=GO({element:e,type:JO(e),tagName:v,value:I,maskInputOptions:c,maskInputFn:l}):A&&(w.checked=A)}"option"===v&&(e.selected&&!c.select?w.selected=!0:delete w.selected);"dialog"===v&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===v&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=YO in i?i[YO]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var P=e.toDataURL(d.type,d.quality),O=r.createElement("canvas");O.width=e.width,O.height=e.height,P!==O.toDataURL(d.type,d.quality)&&(w.rr_dataURL=P)}if("img"===v&&h){sM||(sM=r.createElement("canvas"),aM=sM.getContext("2d"));var M=e,T=M.currentSrc||M.getAttribute("src")||"<unknown-src>",R=M.crossOrigin,N=function(){M.removeEventListener("load",N);try{sM.width=M.naturalWidth,sM.height=M.naturalHeight,aM.drawImage(M,0,0),w.rr_dataURL=sM.toDataURL(d.type,d.quality)}catch(e){if("anonymous"!==M.crossOrigin)return M.crossOrigin="anonymous",void(M.complete&&0!==M.naturalWidth?N():M.addEventListener("load",N));console.warn("Cannot inline img src="+T+"! Error: "+e)}"anonymous"===M.crossOrigin&&(R?w.crossOrigin=R:M.removeAttribute("crossorigin"))};M.complete&&0!==M.naturalWidth?N():M.addEventListener("load",N)}if("audio"===v||"video"===v){var L=w;L.rr_mediaState=e.paused?"paused":"played",L.rr_mediaCurrentTime=e.currentTime,L.rr_mediaPlaybackRate=e.playbackRate,L.rr_mediaMuted=e.muted,L.rr_mediaLoop=e.loop,L.rr_mediaVolume=e.volume}g||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(b){var B=e.getBoundingClientRect(),j=B.width,D=B.height;w={class:w.class,rr_width:j+"px",rr_height:D+"px"}}"iframe"!==v||p(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(v)&&(n=!0)}catch(qAe){}return{type:TO.Element,tagName:v,attributes:w,childNodes:[],isSVG:mM(e)||void 0,needBlock:b,rootId:y,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:b,rootId:_});case e.TEXT_NODE:return function(e,t){var n=t.needsMask,r=t.maskTextFn,i=t.rootId,o=t.cssCaptured,s=FO.parentNode(e),a=s&&s.tagName,c="",l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=FO.textContent(e),l&&c&&(c=rM(c,gM(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,FO.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:TO.Text,textContent:c||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:_,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:TO.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:TO.Comment,textContent:FO.textContent(e)||"",rootId:_};default:return!1}}function EM(e){return null==e?"":e.toLowerCase()}function xM(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,f=void 0===h?{}:h,p=t.maskTextFn,m=t.maskInputFn,g=t.slimDOMOptions,y=t.dataURLOptions,b=void 0===y?{}:y,v=t.inlineImages,w=void 0!==v&&v,_=t.recordCanvas,E=void 0!==_&&_,x=t.onSerialize,k=t.onIframeLoad,S=t.iframeLoadTimeout,C=void 0===S?5e3:S,I=t.onStylesheetLoad,A=t.stylesheetLoadTimeout,P=void 0===A?5e3:A,O=t.keepIframeSrcFn,M=void 0===O?function(){return!1}:O,T=t.newlyAddedElement,R=void 0!==T&&T,N=t.cssCaptured,L=void 0!==N&&N,B=t.needsMask,j=t.preserveWhiteSpace,D=void 0===j||j;B||(B=wM(e,s,a,void 0===B));var U,$=_M(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,dataURLOptions:b,inlineImages:w,recordCanvas:E,keepIframeSrcFn:M,newlyAddedElement:R,cssCaptured:L});if(!$)return console.warn(e,"not serialized"),null;U=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===TO.Comment)return!0;if(e.type===TO.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===QO(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(EM(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===EM(e.attributes.name)||"icon"===EM(e.attributes.rel)||"apple-touch-icon"===EM(e.attributes.rel)||"shortcut icon"===EM(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&EM(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(EM(e.attributes.property).match(/^(og|twitter|fb):/)||EM(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===EM(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===EM(e.attributes.name)||"googlebot"===EM(e.attributes.name)||"bingbot"===EM(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===EM(e.attributes.name)||"generator"===EM(e.attributes.name)||"framework"===EM(e.attributes.name)||"publisher"===EM(e.attributes.name)||"progid"===EM(e.attributes.name)||EM(e.attributes.property).match(/^article:/)||EM(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===EM(e.attributes.name)||"yandex-verification"===EM(e.attributes.name)||"csrf-token"===EM(e.attributes.name)||"p:domain_verify"===EM(e.attributes.name)||"verify-v1"===EM(e.attributes.name)||"verification"===EM(e.attributes.name)||"shopify-checkout-api-token"===EM(e.attributes.name)))return!0}}return!1}($,g)||!D&&$.type===TO.Text&&!$.textContent.replace(/^\s+|\s+$/gm,"").length?-2:uM();var F=Object.assign($,{id:U});if(r.add(e,F),-2===U)return null;x&&x(e);var z=!l;if(F.type===TO.Element){z=z&&!F.needBlock,delete F.needBlock;var q=FO.shadowRoot(e);q&&HO(q)&&(F.isShadowHost=!0)}if((F.type===TO.Document||F.type===TO.Element)&&z){g.headWhitespace&&F.type===TO.Element&&"head"===F.tagName&&(D=!1);var H={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M,cssCaptured:!1};if(F.type===TO.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else{F.type===TO.Element&&void 0!==F.attributes._cssText&&"string"==typeof F.attributes._cssText&&(H.cssCaptured=!0);for(var W,K=kO(Array.from(FO.childNodes(e)));!(W=K()).done;){var V=xM(W.value,H);V&&F.childNodes.push(V)}}var G=null;if(zO(e)&&(G=FO.shadowRoot(e)))for(var Z,Y=kO(Array.from(FO.childNodes(G)));!(Z=Y()).done;){var J=xM(Z.value,H);J&&(HO(G)&&(J.isShadow=!0),F.childNodes.push(J))}}var Q=FO.parentNode(e);return Q&&qO(Q)&&HO(Q)&&(F.isShadow=!0),F.type===TO.Element&&"iframe"===F.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(cF){return}if("complete"===i){var s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&k){var n=xM(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M});n&&k(e,n)}},C),F.type===TO.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===QO(F.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(cF){return}if(!r){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(o),i=!0,t()})}}(e,function(){if(I){var t=xM(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M});t&&I(e,t)}},P),F}function kM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SM(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return bO(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var CM={exports:{}},IM=String,AM=function(){return{isColorSupported:!1,reset:IM,bold:IM,dim:IM,italic:IM,underline:IM,inverse:IM,hidden:IM,strikethrough:IM,black:IM,red:IM,green:IM,yellow:IM,blue:IM,magenta:IM,cyan:IM,white:IM,gray:IM,bgBlack:IM,bgRed:IM,bgGreen:IM,bgYellow:IM,bgBlue:IM,bgMagenta:IM,bgCyan:IM,bgWhite:IM}};CM.exports=AM(),CM.exports.createColors=AM;var PM=CM.exports,OM=SM(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),MM=PM,TM=OM,RM=function(e){function t(n,r,i,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==r&&void 0!==i&&("number"==typeof r?(c.line=r,c.column=i):(c.line=r.line,c.column=r.column,c.endLine=i.line,c.endColumn=i.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}yO(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=MM.isColorSupported),TM&&e&&(n=TM(n));var r,i,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=MM.createColors(!0),u=l.bold,d=l.gray,h=l.red;r=function(e){return u(h(e))},i=function(e){return d(e)}}else r=i=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=i(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+i(a)+e+"\n "+l+r("^")}return" "+i(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(EO(Error)),NM=RM;RM.default=RM;var LM={};LM.isClean=Symbol("isClean"),LM.my=Symbol("my");var BM={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var jM=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n},t.block=function(e,t){var n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var r;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return BM[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?r=this[a](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=BM[n]),o.rawCache[n]=r,r},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=(t=i[i.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),DM=jM;jM.default=jM;var UM=DM;function $M(e,t){new UM(t).stringify(e)}var FM=$M;$M.default=$M;var zM=LM.isClean,qM=LM.my,HM=NM,WM=DM,KM=FM;function VM(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var i=e[r],o=void 0===i?"undefined":_O(i);"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(function(e){return VM(e,n)}):("object"===o&&null!==i&&(i=VM(i)),n[r]=i)}return n}var GM=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[zM]=!1,this[qM]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=kO(e[t]);!(n=r()).done;){var i=n.value;"function"==typeof i.clone?this.append(i.clone()):this.append(i)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=VM(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),r=n.end,i=n.start;return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new HM(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[zM]){this[zM]=!1;for(var e=this;e=e.parent;)e[zM]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new WM).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var r,i=this,o=!1,s=kO(t);!(r=s()).done;){var a=r.value;a===this?o=!0:o?(this.parent.insertAfter(i,a),i=a):this.parent.insertBefore(i,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},r=null==t;t=t||new Map;var i=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":_O(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=i,t.set(s.input,i),i++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return r&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=KM),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},pO(e,[{key:"proxyOf",get:function(){return this}}]),e}(),ZM=GM;GM.default=GM;var YM=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=mO({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return yO(t,e),pO(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(ZM),JM=YM;YM.default=YM;var QM=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},XM=OM.SourceMapConsumer,eT=OM.SourceMapGenerator,tT=OM.existsSync,nT=OM.readFileSync,rT=OM.dirname,iT=OM.join;var oT=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=rT(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new XM(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Ke?Ke.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":_O(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}},t.loadFile=function(e){if(this.root=rT(e),tT(e))return this.mapFile=e,nT(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(bO(t,XM))return eT.fromSourceMap(t).toString();if(bO(t,eT))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var r=this.loadFile(n);if(!r)throw new Error("Unable to load previous source map: "+n.toString());return r}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var i=this.annotation;return e&&(i=iT(rT(e),i)),this.loadFile(i)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),sT=oT;oT.default=oT;var aT=OM.SourceMapConsumer,cT=OM.SourceMapGenerator,lT=OM.fileURLToPath,uT=OM.pathToFileURL,dT=OM.isAbsolute,hT=OM.resolve,fT=QM,pT=OM,mT=NM,gT=sT,yT=Symbol("fromOffsetCache"),bT=Boolean(aT&&cT),vT=Boolean(hT&&dT),wT=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":_O(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!vT||/^\w+:\/\//.test(t.from)||dT(t.from)?this.file=t.from:this.file=hT(t.from)),vT&&bT){var n=new gT(this.css,t);if(n.text){this.map=n;var r=n.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+fT(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var i,o,s;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":_O(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(i=h?new mT(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new mT(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(uT&&(i.input.url=uT(this.file).toString()),i.input.file=this.file),i},t.fromOffset=function(e){var t;if(this[yT])t=this[yT];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,i=0,o=n.length;i<o;i++)t[i]=r,r+=n[i].length+1;this[yT]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:hT(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=dT(a.source)?uT(a.source):new URL(a.source,this.map.consumer().sourceRoot||uT(this.map.mapFile));var c={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!lT)throw new Error("file: protocol is not available in this PostCSS build");c.file=lT(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=mO({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},pO(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),_T=wT;wT.default=wT,pT&&pT.registerInput&&pT.registerInput(wT);var ET=OM.SourceMapConsumer,xT=OM.SourceMapGenerator,kT=OM.dirname,ST=OM.relative,CT=OM.resolve,IT=OM.sep,AT=OM.pathToFileURL,PT=_T,OT=Boolean(ET&&xT),MT=Boolean(kT&&CT&&ST&&IT),TT=function(){function e(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=kO(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||kT(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new ET(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),MT&&OT&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=xT.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new xT({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new xT({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=r,s.generated.column=i-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(r+=t.length,n=a.lastIndexOf("\n"),i=a.length-n):i+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=r,s.generated.column=i-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?kT(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=kT(CT(n,this.mapOpts.annotation)));var r=ST(n,e);return this.memoizedPaths.set(e,r),r},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new PT(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Ke?Ke.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(AT){var n=AT(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===IT&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),RT=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return yO(t,e),t}(ZM),NT=RT;RT.default=RT;var LT,BT,jT,DT,UT=LM.isClean,$T=LM.my,FT=JM,zT=NT;function qT(e){return e.map(function(e){return e.nodes&&(e.nodes=qT(e.nodes)),delete e.source,e})}function HT(e){if(e[UT]=!1,e.proxyOf.nodes)for(var t,n=kO(e.proxyOf.nodes);!(t=n()).done;){HT(t.value)}}var WT=function(e){function t(){return e.apply(this,arguments)||this}yO(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t);!(r=i()).done;)for(var o,s=r.value,a=kO(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=kO(this.nodes);!(n=r()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o;return(o=e)[t].apply(o,[].concat(r.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return n.apply(void 0,[].concat([e.toProxy()],r))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var o,s=kO(i);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(r+1,0,a)}for(var c in this.indexes)r<(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(var s,a=kO(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(r,0,c)}for(var l in this.indexes)r<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=qT(LT(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var i,o=kO(e=e.slice(0));!(i=o()).done;){var s=i.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=kO(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new FT(e)]}else if(e.selector)e=[new BT(e)];else if(e.name)e=[new jT(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new zT(e)]}return e.map(function(e){return e[$T]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[UT]&&HT(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=r.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t=t.reverse());!(r=i()).done;){for(var o,s=r.value,a=this.normalize(s,this.first,"prepend").reverse(),c=kO(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=kO(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var r;try{r=e(t,n)}catch(qAe){throw t.addToError(qAe)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},pO(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(ZM);WT.registerParse=function(e){LT=e},WT.registerRule=function(e){BT=e},WT.registerAtRule=function(e){jT=e},WT.registerRoot=function(e){DT=e};var KT=WT;WT.default=WT,WT.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,jT.prototype):"rule"===e.type?Object.setPrototypeOf(e,BT.prototype):"decl"===e.type?Object.setPrototypeOf(e,FT.prototype):"comment"===e.type?Object.setPrototypeOf(e,zT.prototype):"root"===e.type&&Object.setPrototypeOf(e,DT.prototype),e[$T]=!0,e.nodes&&e.nodes.forEach(function(e){WT.rebuild(e)})};var VT,GT,ZT=function(e){function t(t){var n;return(n=e.call(this,mO({type:"document"},t))||this).nodes||(n.nodes=[]),n}return yO(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new VT(new GT,this,e).stringify()},t}(KT);ZT.registerLazyResult=function(e){VT=e},ZT.registerProcessor=function(e){GT=e};var YT=ZT;ZT.default=ZT;var JT=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var r in t)this[r]=t[r]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),QT=JT;JT.default=JT;var XT=QT,eR=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new XT(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},pO(e,[{key:"content",get:function(){return this.css}}]),e}(),tR=eR;eR.default=eR;var nR="'".charCodeAt(0),rR='"'.charCodeAt(0),iR="\\".charCodeAt(0),oR="/".charCodeAt(0),sR="\n".charCodeAt(0),aR=" ".charCodeAt(0),cR="\f".charCodeAt(0),lR="\t".charCodeAt(0),uR="\r".charCodeAt(0),dR="[".charCodeAt(0),hR="]".charCodeAt(0),fR="(".charCodeAt(0),pR=")".charCodeAt(0),mR="{".charCodeAt(0),gR="}".charCodeAt(0),yR=";".charCodeAt(0),bR="*".charCodeAt(0),vR=":".charCodeAt(0),wR="@".charCodeAt(0),_R=/[\t\n\f\r "#'()/;[\\\]{}]/g,ER=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xR=/.[\r\n"'(/\\]/,kR=/[\da-f]/i,SR=KT,CR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}yO(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.append).call.apply(i,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.prepend).call.apply(i,[].concat([this],n))},t}(SR),IR=CR;CR.default=CR,SR.registerAtRule(CR);var AR,PR,OR=KT,MR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}yO(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=kO(i);!(o=s()).done;){o.value.raws.before=n.raws.before}return i},n.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new AR(new PR,this,e).stringify()},t}(OR);MR.registerLazyResult=function(e){AR=e},MR.registerProcessor=function(e){PR=e};var TR=MR;MR.default=MR,OR.registerRoot(MR);var RR={comma:function(e){return RR.split(e,[","],!0)},space:function(e){return RR.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,i=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=kO(e);!(r=d()).done;){var h=r.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&i.push(o.trim()),i}},NR=RR;RR.default=RR;var LR=KT,BR=NR,jR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return yO(t,e),pO(t,[{key:"selectors",get:function(){return BR.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(LR),DR=jR;jR.default=jR,LR.registerRule(jR);var UR=JM,$R=function(e,t){void 0===t&&(t={});var n,r,i,o,s,a,c,l,u,d,h=e.css.valueOf(),f=t.ignoreErrors,p=h.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=p},nextToken:function(e){if(y.length)return y.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case sR:case aR:case lR:case uR:case cR:r=m;do{r+=1,n=h.charCodeAt(r)}while(n===aR||n===sR||n===lR||n===uR||n===cR);d=["space",h.slice(m,r)],m=r-1;break;case dR:case hR:case mR:case gR:case vR:case yR:case pR:var v=String.fromCharCode(n);d=[v,v,m];break;case fR:if(l=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==nR&&u!==rR&&u!==aR&&u!==sR&&u!==lR&&u!==cR&&u!==uR){r=m;do{if(a=!1,-1===(r=h.indexOf(")",r+1))){if(f||t){r=m;break}b("bracket")}for(c=r;h.charCodeAt(c-1)===iR;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,r+1),m,r],m=r}else r=h.indexOf(")",m+1),o=h.slice(m,r+1),-1===r||xR.test(o)?d=["(","(",m]:(d=["brackets",o,m,r],m=r);break;case nR:case rR:i=n===nR?"'":'"',r=m;do{if(a=!1,-1===(r=h.indexOf(i,r+1))){if(f||t){r=m+1;break}b("string")}for(c=r;h.charCodeAt(c-1)===iR;)c-=1,a=!a}while(a);d=["string",h.slice(m,r+1),m,r],m=r;break;case wR:_R.lastIndex=m+1,_R.test(h),r=0===_R.lastIndex?h.length-1:_R.lastIndex-2,d=["at-word",h.slice(m,r+1),m,r],m=r;break;case iR:for(r=m,s=!0;h.charCodeAt(r+1)===iR;)r+=1,s=!s;if(n=h.charCodeAt(r+1),s&&n!==oR&&n!==aR&&n!==sR&&n!==lR&&n!==uR&&n!==cR&&(r+=1,kR.test(h.charAt(r)))){for(;kR.test(h.charAt(r+1));)r+=1;h.charCodeAt(r+1)===aR&&(r+=1)}d=["word",h.slice(m,r+1),m,r],m=r;break;default:n===oR&&h.charCodeAt(m+1)===bR?(0===(r=h.indexOf("*/",m+2)+1)&&(f||t?r=h.length:b("comment")),d=["comment",h.slice(m,r+1),m,r],m=r):(ER.lastIndex=m+1,ER.test(h),r=0===ER.lastIndex?h.length-1:ER.lastIndex-2,d=["word",h.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},FR=NT,zR=IR,qR=TR,HR=DR,WR={empty:!0,space:!0};var KR=function(){function e(e){this.input=e,this.root=new qR,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,r,i=new zR;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;i>=0&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,i,o=0,s=kO(e.entries());!(i=s()).done;){var a=i.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return c}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new FR;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},t.createTokenizer=function(){this.tokenizer=$R(this.input)},t.decl=function(e,t){var n=new UR;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(r=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var f=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new HR;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)i||(i=c),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,r){for(var i,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(i=n[d])[0])||d!==c-1||r?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",WR[a]||WR[s]||","===l.slice(-1)?u=!1:l+=i[1]):l+=i[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new HR;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),VR=KT,GR=KR,ZR=_T;function YR(e,t){var n=new ZR(e,t),r=new GR(n);try{r.parse()}catch(qAe){throw qAe}return r.root}var JR=YR;YR.default=YR,VR.registerParse(YR);var QR=LM.isClean,XR=LM.my,eN=TT,tN=FM,nN=KT,rN=YT,iN=tR,oN=JR,sN=TR,aN={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},cN={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},lN={Once:!0,postcssPlugin:!0,prepare:!0};function uN(e){return"object"===(void 0===e?"undefined":_O(e))&&"function"==typeof e.then}function dN(e){var t=!1,n=aN[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function hN(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:dN(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function fN(e){return e[QR]=!1,e.nodes&&e.nodes.forEach(function(e){return fN(e)}),e}var pN={},mN=function(){function e(t,n,r){var i,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":_O(n))||null===n||"root"!==n.type&&"document"!==n.type)if(bO(n,e)||bO(n,iN))i=fN(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=oN;r.syntax&&(s=r.syntax.parse),r.parser&&(s=r.parser),s.parse&&(s=s.parse);try{i=s(n,r)}catch(cF){this.processed=!0,this.error=cF}i&&!i[XR]&&nN.rebuild(i)}else i=fN(n);this.result=new iN(t,i,r),this.helpers=mO({},pN,{postcss:pN,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.prepare?mO({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,r){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,r])},r=kO(this.plugins);!(t=r()).done;){var i=t.value;if("object"===(void 0===i?"undefined":_O(i)))for(var o in i){if(!cN[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+i.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!lN[o])if("object"===_O(i[o]))for(var s in i[o])n(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&n(i,o,i[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return hO(function(){var t,n,r,i,o,s,a,c,l,u,d,h;return SO(this,function(f){switch(f.label){case 0:e.plugin=0,t=0,f.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!uN(r=e.runOnRoot(n)))return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,r];case 3:return f.sent(),[3,5];case 4:throw i=f.sent(),e.handleError(i);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,f.label=7;case 7:if(o[QR])return[3,14];o[QR]=!0,s=[hN(o)],f.label=8;case 8:if(!(s.length>0))return[3,13];if(!uN(a=e.visitTick(s)))return[3,12];f.label=9;case 9:return f.trys.push([9,11,,12]),[4,a];case 10:return f.sent(),[3,12];case 11:throw c=f.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,r,i,s;return SO(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],r=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(i=o.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(i)]);case 2:return a.sent(),[3,5];case 3:return[4,r(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=kO(e.listeners.OnceExit),f.label=15;case 15:return(h=d()).done?[3,18]:[5,CO(u())];case 16:f.sent(),f.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":_O(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return uN(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(cF){throw this.handleError(cF)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=tN;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new eN(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=kO(this.plugins);!(e=t()).done;){var n=e.value;if(uN(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[QR];)r[QR]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var i,o=kO(r.nodes);!(i=o()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,r)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,r=kO(e);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(qAe){throw this.handleError(qAe,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(uN(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(r.length>0&&t.visitorIndex<r.length){var i=r[t.visitorIndex],o=i[0],s=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(qAe){throw this.handleError(qAe,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[QR])return a[QR]=!0,void e.push(hN(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[QR]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[QR]=!0;for(var n,r=kO(dN(e));!(n=r()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[QR]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},pO(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();mN.registerPostcss=function(e){pN=e};var gN=mN;mN.default=mN,sN.registerLazyResult(mN),rN.registerLazyResult(mN);var yN=TT,bN=FM,vN=JR,wN=tR,_N=function(){function e(e,t,n){var r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var i=bN;this.result=new wN(this._processor,r,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new yN(i,r,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},pO(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=vN;try{e=t(this._css,this._opts)}catch(cF){this.error=cF}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),EN=_N;_N.default=_N;var xN=EN,kN=gN,SN=YT,CN=TR,IN=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],r=kO(e);!(t=r()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===(void 0===i?"undefined":_O(i))&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===(void 0===i?"undefined":_O(i))&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else if("object"!==(void 0===i?"undefined":_O(i))||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new kN(this,e,t):new xN(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),AN=IN;IN.default=IN,CN.registerProcessor(IN),SN.registerProcessor(IN);var PN=JM,ON=sT,MN=NT,TN=IR,RN=_T,NN=TR,LN=DR;function BN(e,t){if(Array.isArray(e))return e.map(function(e){return BN(e)});var n=e.inputs,r=vO(e,["inputs"]);if(n){t=[];for(var i,o=kO(n);!(i=o()).done;){var s=mO({},i.value,{__proto__:RN.prototype});s.map&&(s.map=mO({},s.map,{__proto__:ON.prototype})),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return BN(e,t)})),r.source){var a=r.source,c=a.inputId,l=vO(a,["inputId"]);r.source=l,null!=c&&(r.source.input=t[c])}if("root"===r.type)return new NN(r);if("decl"===r.type)return new PN(r);if("rule"===r.type)return new LN(r);if("comment"===r.type)return new MN(r);if("atrule"===r.type)return new TN(r);throw new Error("Unknown node type: "+e.type)}var jN=BN;BN.default=BN;var DN=NM,UN=JM,$N=gN,FN=KT,zN=AN,qN=FM,HN=jN,WN=YT,KN=QT,VN=NT,GN=IR,ZN=tR,YN=_T,JN=JR,QN=NR,XN=DR,eL=TR,tL=ZM;function nL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new zN(t)}nL.plugin=function(e,t){var n,r=!1;function i(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),aO.env.LANG&&aO.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(i));return s.postcssPlugin=e,s.postcssVersion=(new zN).version,s}return Object.defineProperty(i,"postcss",{get:function(){return n||(n=i()),n}}),i.process=function(e,t,n){return nL([i(n)]).process(e,t)},i},nL.stringify=qN,nL.parse=JN,nL.fromJSON=HN,nL.list=QN,nL.comment=function(e){return new VN(e)},nL.atRule=function(e){return new GN(e)},nL.decl=function(e){return new UN(e)},nL.rule=function(e){return new XN(e)},nL.root=function(e){return new eL(e)},nL.document=function(e){return new WN(e)},nL.CssSyntaxError=DN,nL.Declaration=UN,nL.Container=FN,nL.Processor=zN,nL.Document=WN,nL.Comment=VN,nL.Warning=KN,nL.AtRule=GN,nL.Result=ZN,nL.Input=YN,nL.Rule=XN,nL.Root=eL,nL.Node=tL,$N.registerPostcss(nL);var rL=nL;nL.default=nL;var iL=kM(rL);iL.stringify,iL.fromJSON,iL.plugin,iL.parse,iL.list,iL.document,iL.comment,iL.atRule,iL.rule,iL.decl,iL.root,iL.CssSyntaxError,iL.Declaration,iL.Container,iL.Processor,iL.Document,iL.Comment,iL.Warning,iL.AtRule,iL.Result,iL.Input,iL.Rule,iL.Root,iL.Node;var oL=Object.defineProperty,sL=function(e,t,n){return function(e,t,n){return t in e?oL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)};function aL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cL(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return bO(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var lL={exports:{}},uL=String,dL=function(){return{isColorSupported:!1,reset:uL,bold:uL,dim:uL,italic:uL,underline:uL,inverse:uL,hidden:uL,strikethrough:uL,black:uL,red:uL,green:uL,yellow:uL,blue:uL,magenta:uL,cyan:uL,white:uL,gray:uL,bgBlack:uL,bgRed:uL,bgGreen:uL,bgYellow:uL,bgBlue:uL,bgMagenta:uL,bgCyan:uL,bgWhite:uL}};lL.exports=dL(),lL.exports.createColors=dL;var hL=lL.exports,fL=cL(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),pL=hL,mL=fL,gL=function(e){function t(n,r,i,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==r&&void 0!==i&&("number"==typeof r?(c.line=r,c.column=i):(c.line=r.line,c.column=r.column,c.endLine=i.line,c.endColumn=i.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}yO(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=pL.isColorSupported),mL&&e&&(n=mL(n));var r,i,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=pL.createColors(!0),u=l.bold,d=l.gray,h=l.red;r=function(e){return u(h(e))},i=function(e){return d(e)}}else r=i=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=i(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+i(a)+e+"\n "+l+r("^")}return" "+i(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(EO(Error)),yL=gL;gL.default=gL;var bL={};bL.isClean=Symbol("isClean"),bL.my=Symbol("my");var vL={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var wL=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n},t.block=function(e,t){var n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var r;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return vL[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?r=this[a](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=vL[n]),o.rawCache[n]=r,r},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=(t=i[i.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),_L=wL;wL.default=wL;var EL=_L;function xL(e,t){new EL(t).stringify(e)}var kL=xL;xL.default=xL;var SL=bL.isClean,CL=bL.my,IL=yL,AL=_L,PL=kL;function OL(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var i=e[r],o=void 0===i?"undefined":_O(i);"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(function(e){return OL(e,n)}):("object"===o&&null!==i&&(i=OL(i)),n[r]=i)}return n}var ML=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[SL]=!1,this[CL]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=kO(e[t]);!(n=r()).done;){var i=n.value;"function"==typeof i.clone?this.append(i.clone()):this.append(i)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=OL(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),r=n.end,i=n.start;return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new IL(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[SL]){this[SL]=!1;for(var e=this;e=e.parent;)e[SL]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new AL).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var r,i=this,o=!1,s=kO(t);!(r=s()).done;){var a=r.value;a===this?o=!0:o?(this.parent.insertAfter(i,a),i=a):this.parent.insertBefore(i,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},r=null==t;t=t||new Map;var i=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":_O(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=i,t.set(s.input,i),i++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return r&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=PL),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},pO(e,[{key:"proxyOf",get:function(){return this}}]),e}(),TL=ML;ML.default=ML;var RL=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=mO({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return yO(t,e),pO(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(TL),NL=RL;RL.default=RL;var LL=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},BL=fL.SourceMapConsumer,jL=fL.SourceMapGenerator,DL=fL.existsSync,UL=fL.readFileSync,$L=fL.dirname,FL=fL.join;var zL=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=$L(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new BL(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Ke?Ke.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":_O(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}},t.loadFile=function(e){if(this.root=$L(e),DL(e))return this.mapFile=e,UL(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(bO(t,BL))return jL.fromSourceMap(t).toString();if(bO(t,jL))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var r=this.loadFile(n);if(!r)throw new Error("Unable to load previous source map: "+n.toString());return r}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var i=this.annotation;return e&&(i=FL($L(e),i)),this.loadFile(i)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),qL=zL;zL.default=zL;var HL=fL.SourceMapConsumer,WL=fL.SourceMapGenerator,KL=fL.fileURLToPath,VL=fL.pathToFileURL,GL=fL.isAbsolute,ZL=fL.resolve,YL=LL,JL=fL,QL=yL,XL=qL,eB=Symbol("fromOffsetCache"),tB=Boolean(HL&&WL),nB=Boolean(ZL&&GL),rB=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":_O(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!nB||/^\w+:\/\//.test(t.from)||GL(t.from)?this.file=t.from:this.file=ZL(t.from)),nB&&tB){var n=new XL(this.css,t);if(n.text){this.map=n;var r=n.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+YL(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var i,o,s;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":_O(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(i=h?new QL(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new QL(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(VL&&(i.input.url=VL(this.file).toString()),i.input.file=this.file),i},t.fromOffset=function(e){var t;if(this[eB])t=this[eB];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,i=0,o=n.length;i<o;i++)t[i]=r,r+=n[i].length+1;this[eB]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:ZL(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=GL(a.source)?VL(a.source):new URL(a.source,this.map.consumer().sourceRoot||VL(this.map.mapFile));var c={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!KL)throw new Error("file: protocol is not available in this PostCSS build");c.file=KL(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=mO({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},pO(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),iB=rB;rB.default=rB,JL&&JL.registerInput&&JL.registerInput(rB);var oB=fL.SourceMapConsumer,sB=fL.SourceMapGenerator,aB=fL.dirname,cB=fL.relative,lB=fL.resolve,uB=fL.sep,dB=fL.pathToFileURL,hB=iB,fB=Boolean(oB&&sB),pB=Boolean(aB&&lB&&cB&&uB),mB=function(){function e(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=kO(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||aB(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new oB(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),pB&&fB&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=sB.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new sB({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new sB({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=r,s.generated.column=i-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(r+=t.length,n=a.lastIndexOf("\n"),i=a.length-n):i+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=r,s.generated.column=i-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?aB(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=aB(lB(n,this.mapOpts.annotation)));var r=cB(n,e);return this.memoizedPaths.set(e,r),r},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new hB(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Ke?Ke.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(dB){var n=dB(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===uB&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),gB=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return yO(t,e),t}(TL),yB=gB;gB.default=gB;var bB,vB,wB,_B,EB=bL.isClean,xB=bL.my,kB=NL,SB=yB;function CB(e){return e.map(function(e){return e.nodes&&(e.nodes=CB(e.nodes)),delete e.source,e})}function IB(e){if(e[EB]=!1,e.proxyOf.nodes)for(var t,n=kO(e.proxyOf.nodes);!(t=n()).done;){IB(t.value)}}var AB=function(e){function t(){return e.apply(this,arguments)||this}yO(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t);!(r=i()).done;)for(var o,s=r.value,a=kO(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=kO(this.nodes);!(n=r()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o;return(o=e)[t].apply(o,[].concat(r.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return n.apply(void 0,[].concat([e.toProxy()],r))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var o,s=kO(i);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(r+1,0,a)}for(var c in this.indexes)r<(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(var s,a=kO(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(r,0,c)}for(var l in this.indexes)r<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=CB(bB(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var i,o=kO(e=e.slice(0));!(i=o()).done;){var s=i.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=kO(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new kB(e)]}else if(e.selector)e=[new vB(e)];else if(e.name)e=[new wB(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new SB(e)]}return e.map(function(e){return e[xB]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[EB]&&IB(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=r.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t=t.reverse());!(r=i()).done;){for(var o,s=r.value,a=this.normalize(s,this.first,"prepend").reverse(),c=kO(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=kO(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var r;try{r=e(t,n)}catch(qAe){throw t.addToError(qAe)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},pO(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(TL);AB.registerParse=function(e){bB=e},AB.registerRule=function(e){vB=e},AB.registerAtRule=function(e){wB=e},AB.registerRoot=function(e){_B=e};var PB=AB;AB.default=AB,AB.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,wB.prototype):"rule"===e.type?Object.setPrototypeOf(e,vB.prototype):"decl"===e.type?Object.setPrototypeOf(e,kB.prototype):"comment"===e.type?Object.setPrototypeOf(e,SB.prototype):"root"===e.type&&Object.setPrototypeOf(e,_B.prototype),e[xB]=!0,e.nodes&&e.nodes.forEach(function(e){AB.rebuild(e)})};var OB,MB,TB=function(e){function t(t){var n;return(n=e.call(this,mO({type:"document"},t))||this).nodes||(n.nodes=[]),n}return yO(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new OB(new MB,this,e).stringify()},t}(PB);TB.registerLazyResult=function(e){OB=e},TB.registerProcessor=function(e){MB=e};var RB=TB;TB.default=TB;var NB=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var r in t)this[r]=t[r]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),LB=NB;NB.default=NB;var BB=LB,jB=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new BB(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},pO(e,[{key:"content",get:function(){return this.css}}]),e}(),DB=jB;jB.default=jB;var UB="'".charCodeAt(0),$B='"'.charCodeAt(0),FB="\\".charCodeAt(0),zB="/".charCodeAt(0),qB="\n".charCodeAt(0),HB=" ".charCodeAt(0),WB="\f".charCodeAt(0),KB="\t".charCodeAt(0),VB="\r".charCodeAt(0),GB="[".charCodeAt(0),ZB="]".charCodeAt(0),YB="(".charCodeAt(0),JB=")".charCodeAt(0),QB="{".charCodeAt(0),XB="}".charCodeAt(0),ej=";".charCodeAt(0),tj="*".charCodeAt(0),nj=":".charCodeAt(0),rj="@".charCodeAt(0),ij=/[\t\n\f\r "#'()/;[\\\]{}]/g,oj=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,sj=/.[\r\n"'(/\\]/,aj=/[\da-f]/i,cj=PB,lj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}yO(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.append).call.apply(i,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.prepend).call.apply(i,[].concat([this],n))},t}(cj),uj=lj;lj.default=lj,cj.registerAtRule(lj);var dj,hj,fj=PB,pj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}yO(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=kO(i);!(o=s()).done;){o.value.raws.before=n.raws.before}return i},n.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new dj(new hj,this,e).stringify()},t}(fj);pj.registerLazyResult=function(e){dj=e},pj.registerProcessor=function(e){hj=e};var mj=pj;pj.default=pj,fj.registerRoot(pj);var gj={comma:function(e){return gj.split(e,[","],!0)},space:function(e){return gj.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,i=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=kO(e);!(r=d()).done;){var h=r.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&i.push(o.trim()),i}},yj=gj;gj.default=gj;var bj=PB,vj=yj,wj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return yO(t,e),pO(t,[{key:"selectors",get:function(){return vj.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(bj),_j=wj;wj.default=wj,bj.registerRule(wj);var Ej=NL,xj=function(e,t){void 0===t&&(t={});var n,r,i,o,s,a,c,l,u,d,h=e.css.valueOf(),f=t.ignoreErrors,p=h.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=p},nextToken:function(e){if(y.length)return y.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case qB:case HB:case KB:case VB:case WB:r=m;do{r+=1,n=h.charCodeAt(r)}while(n===HB||n===qB||n===KB||n===VB||n===WB);d=["space",h.slice(m,r)],m=r-1;break;case GB:case ZB:case QB:case XB:case nj:case ej:case JB:var v=String.fromCharCode(n);d=[v,v,m];break;case YB:if(l=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==UB&&u!==$B&&u!==HB&&u!==qB&&u!==KB&&u!==WB&&u!==VB){r=m;do{if(a=!1,-1===(r=h.indexOf(")",r+1))){if(f||t){r=m;break}b("bracket")}for(c=r;h.charCodeAt(c-1)===FB;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,r+1),m,r],m=r}else r=h.indexOf(")",m+1),o=h.slice(m,r+1),-1===r||sj.test(o)?d=["(","(",m]:(d=["brackets",o,m,r],m=r);break;case UB:case $B:i=n===UB?"'":'"',r=m;do{if(a=!1,-1===(r=h.indexOf(i,r+1))){if(f||t){r=m+1;break}b("string")}for(c=r;h.charCodeAt(c-1)===FB;)c-=1,a=!a}while(a);d=["string",h.slice(m,r+1),m,r],m=r;break;case rj:ij.lastIndex=m+1,ij.test(h),r=0===ij.lastIndex?h.length-1:ij.lastIndex-2,d=["at-word",h.slice(m,r+1),m,r],m=r;break;case FB:for(r=m,s=!0;h.charCodeAt(r+1)===FB;)r+=1,s=!s;if(n=h.charCodeAt(r+1),s&&n!==zB&&n!==HB&&n!==qB&&n!==KB&&n!==VB&&n!==WB&&(r+=1,aj.test(h.charAt(r)))){for(;aj.test(h.charAt(r+1));)r+=1;h.charCodeAt(r+1)===HB&&(r+=1)}d=["word",h.slice(m,r+1),m,r],m=r;break;default:n===zB&&h.charCodeAt(m+1)===tj?(0===(r=h.indexOf("*/",m+2)+1)&&(f||t?r=h.length:b("comment")),d=["comment",h.slice(m,r+1),m,r],m=r):(oj.lastIndex=m+1,oj.test(h),r=0===oj.lastIndex?h.length-1:oj.lastIndex-2,d=["word",h.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},kj=yB,Sj=uj,Cj=mj,Ij=_j,Aj={empty:!0,space:!0};var Pj=function(){function e(e){this.input=e,this.root=new Cj,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,r,i=new Sj;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;i>=0&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,i,o=0,s=kO(e.entries());!(i=s()).done;){var a=i.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return c}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new kj;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},t.createTokenizer=function(){this.tokenizer=xj(this.input)},t.decl=function(e,t){var n=new Ej;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(r=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var f=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new Ij;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)i||(i=c),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,r){for(var i,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(i=n[d])[0])||d!==c-1||r?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",Aj[a]||Aj[s]||","===l.slice(-1)?u=!1:l+=i[1]):l+=i[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new Ij;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),Oj=PB,Mj=Pj,Tj=iB;function Rj(e,t){var n=new Tj(e,t),r=new Mj(n);try{r.parse()}catch(qAe){throw qAe}return r.root}var Nj=Rj;Rj.default=Rj,Oj.registerParse(Rj);var Lj=bL.isClean,Bj=bL.my,jj=mB,Dj=kL,Uj=PB,$j=RB,Fj=DB,zj=Nj,qj=mj,Hj={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Wj={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Kj={Once:!0,postcssPlugin:!0,prepare:!0};function Vj(e){return"object"===(void 0===e?"undefined":_O(e))&&"function"==typeof e.then}function Gj(e){var t=!1,n=Hj[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Zj(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Gj(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function Yj(e){return e[Lj]=!1,e.nodes&&e.nodes.forEach(function(e){return Yj(e)}),e}var Jj={},Qj=function(){function e(t,n,r){var i,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":_O(n))||null===n||"root"!==n.type&&"document"!==n.type)if(bO(n,e)||bO(n,Fj))i=Yj(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=zj;r.syntax&&(s=r.syntax.parse),r.parser&&(s=r.parser),s.parse&&(s=s.parse);try{i=s(n,r)}catch(cF){this.processed=!0,this.error=cF}i&&!i[Bj]&&Uj.rebuild(i)}else i=Yj(n);this.result=new Fj(t,i,r),this.helpers=mO({},Jj,{postcss:Jj,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.prepare?mO({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,r){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,r])},r=kO(this.plugins);!(t=r()).done;){var i=t.value;if("object"===(void 0===i?"undefined":_O(i)))for(var o in i){if(!Wj[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+i.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!Kj[o])if("object"===_O(i[o]))for(var s in i[o])n(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&n(i,o,i[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return hO(function(){var t,n,r,i,o,s,a,c,l,u,d,h;return SO(this,function(f){switch(f.label){case 0:e.plugin=0,t=0,f.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!Vj(r=e.runOnRoot(n)))return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,r];case 3:return f.sent(),[3,5];case 4:throw i=f.sent(),e.handleError(i);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,f.label=7;case 7:if(o[Lj])return[3,14];o[Lj]=!0,s=[Zj(o)],f.label=8;case 8:if(!(s.length>0))return[3,13];if(!Vj(a=e.visitTick(s)))return[3,12];f.label=9;case 9:return f.trys.push([9,11,,12]),[4,a];case 10:return f.sent(),[3,12];case 11:throw c=f.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,r,i,s;return SO(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],r=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(i=o.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(i)]);case 2:return a.sent(),[3,5];case 3:return[4,r(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=kO(e.listeners.OnceExit),f.label=15;case 15:return(h=d()).done?[3,18]:[5,CO(u())];case 16:f.sent(),f.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":_O(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return Vj(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(cF){throw this.handleError(cF)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=Dj;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new jj(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=kO(this.plugins);!(e=t()).done;){var n=e.value;if(Vj(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[Lj];)r[Lj]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var i,o=kO(r.nodes);!(i=o()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,r)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,r=kO(e);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(qAe){throw this.handleError(qAe,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Vj(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(r.length>0&&t.visitorIndex<r.length){var i=r[t.visitorIndex],o=i[0],s=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(qAe){throw this.handleError(qAe,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[Lj])return a[Lj]=!0,void e.push(Zj(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[Lj]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[Lj]=!0;for(var n,r=kO(Gj(e));!(n=r()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[Lj]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},pO(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();Qj.registerPostcss=function(e){Jj=e};var Xj=Qj;Qj.default=Qj,qj.registerLazyResult(Qj),$j.registerLazyResult(Qj);var eD=mB,tD=kL,nD=Nj,rD=DB,iD=function(){function e(e,t,n){var r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var i=tD;this.result=new rD(this._processor,r,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new eD(i,r,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},pO(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=nD;try{e=t(this._css,this._opts)}catch(cF){this.error=cF}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),oD=iD;iD.default=iD;var sD=oD,aD=Xj,cD=RB,lD=mj,uD=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],r=kO(e);!(t=r()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===(void 0===i?"undefined":_O(i))&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===(void 0===i?"undefined":_O(i))&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else if("object"!==(void 0===i?"undefined":_O(i))||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new aD(this,e,t):new sD(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),dD=uD;uD.default=uD,lD.registerProcessor(uD),cD.registerProcessor(uD);var hD=NL,fD=qL,pD=yB,mD=uj,gD=iB,yD=mj,bD=_j;function vD(e,t){if(Array.isArray(e))return e.map(function(e){return vD(e)});var n=e.inputs,r=vO(e,["inputs"]);if(n){t=[];for(var i,o=kO(n);!(i=o()).done;){var s=mO({},i.value,{__proto__:gD.prototype});s.map&&(s.map=mO({},s.map,{__proto__:fD.prototype})),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return vD(e,t)})),r.source){var a=r.source,c=a.inputId,l=vO(a,["inputId"]);r.source=l,null!=c&&(r.source.input=t[c])}if("root"===r.type)return new yD(r);if("decl"===r.type)return new hD(r);if("rule"===r.type)return new bD(r);if("comment"===r.type)return new pD(r);if("atrule"===r.type)return new mD(r);throw new Error("Unknown node type: "+e.type)}var wD=vD;vD.default=vD;var _D=yL,ED=NL,xD=Xj,kD=PB,SD=dD,CD=kL,ID=wD,AD=RB,PD=LB,OD=yB,MD=uj,TD=DB,RD=iB,ND=Nj,LD=yj,BD=_j,jD=mj,DD=TL;function UD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new SD(t)}UD.plugin=function(e,t){var n,r=!1;function i(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),aO.env.LANG&&aO.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(i));return s.postcssPlugin=e,s.postcssVersion=(new SD).version,s}return Object.defineProperty(i,"postcss",{get:function(){return n||(n=i()),n}}),i.process=function(e,t,n){return UD([i(n)]).process(e,t)},i},UD.stringify=CD,UD.parse=ND,UD.fromJSON=ID,UD.list=LD,UD.comment=function(e){return new OD(e)},UD.atRule=function(e){return new MD(e)},UD.decl=function(e){return new ED(e)},UD.rule=function(e){return new BD(e)},UD.root=function(e){return new jD(e)},UD.document=function(e){return new AD(e)},UD.CssSyntaxError=_D,UD.Declaration=ED,UD.Container=kD,UD.Processor=SD,UD.Document=AD,UD.Comment=OD,UD.Warning=PD,UD.AtRule=MD,UD.Result=TD,UD.Input=RD,UD.Rule=BD,UD.Root=jD,UD.Node=DD,xD.registerPostcss(UD);var $D=UD;UD.default=UD;var FD=aL($D);FD.stringify,FD.fromJSON,FD.plugin,FD.parse,FD.list,FD.document,FD.comment,FD.atRule,FD.rule,FD.decl,FD.root,FD.CssSyntaxError,FD.Declaration,FD.Container,FD.Processor,FD.Document,FD.Comment,FD.Warning,FD.AtRule,FD.Result,FD.Input,FD.Rule,FD.Root,FD.Node;var zD=function(){function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sL(this,"parentElement",null),sL(this,"parentNode",null),sL(this,"ownerDocument"),sL(this,"firstChild",null),sL(this,"lastChild",null),sL(this,"previousSibling",null),sL(this,"nextSibling",null),sL(this,"ELEMENT_NODE",1),sL(this,"TEXT_NODE",3),sL(this,"nodeType"),sL(this,"nodeName"),sL(this,"RRNodeType")}var t=e.prototype;return t.contains=function(t){if(!bO(t,e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},t.appendChild=function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},t.insertBefore=function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},t.removeChild=function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},t.toString=function(){return"RRNode"},pO(e,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}}]),e}(),qD={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},HD={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},WD={};function KD(e){if(WD[e])return WD[e];var t=globalThis[e],n=t.prototype,r=e in qD?qD[e]:void 0,i=Boolean(r&&r.every(function(e){var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in HD?HD[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return WD[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?WD[e]=l:n}catch(qAe){return n}}var VD={};function GD(e,t,n){var r,i=e+"."+String(n);if(VD[i])return VD[i].call(t);var o=KD(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(VD[i]=s,s.call(t)):t[n]}var ZD={};function YD(e,t,n){var r=e+"."+String(n);if(ZD[r])return ZD[r].bind(t);var i=KD(e)[n];return"function"!=typeof i?t[n]:(ZD[r]=i,i.bind(t))}function JD(){return KD("MutationObserver").constructor}function QD(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}var XD={childNodes:function(e){return GD("Node",e,"childNodes")},parentNode:function(e){return GD("Node",e,"parentNode")},parentElement:function(e){return GD("Node",e,"parentElement")},textContent:function(e){return GD("Node",e,"textContent")},contains:function(e,t){return YD("Node",e,"contains")(t)},getRootNode:function(e){return YD("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?GD("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?GD("Element",e,"shadowRoot"):null},querySelector:function(e,t){return GD("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return GD("Element",e,"querySelectorAll")(t)},mutationObserver:JD,patch:QD};function eU(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var tU="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",nU={map:{},getId:function(){return console.error(tU),-1},getNode:function(){return console.error(tU),null},removeNodeFromMap:function(){console.error(tU)},has:function(){return console.error(tU),!1},reset:function(){console.error(tU)}};function rU(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var c=Date.now();i||!1!==n.leading||(i=c);var l=t-(c-i),u=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),i=c,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout(function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)},l))}}function iU(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return iU(e,t,o||{},!0)}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(nU=new Proxy(nU,{get:function(e,t,n){return"map"===t&&console.error(tU),Reflect.get(e,t,n)}}));var oU=Date.now;function sU(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=XD.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=XD.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function aU(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function cU(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function lU(e){return e?e.nodeType===e.ELEMENT_NODE?e:XD.parentElement(e):null}function uU(e,t,n,r){if(!e)return!1;var i=lU(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(vM(i,t,r))return!0}catch(qAe){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function dU(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function hU(e,t){if(qO(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=XD.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||hU(r,t))}function fU(e){return Boolean(e.changedTouches)}function pU(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function mU(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function gU(e){return!!e&&(bO(e,zD)&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(XD.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(oU=function(){return(new Date).getTime()});var yU=function(){function e(){PO(this,"id",1),PO(this,"styleIDMap",new WeakMap),PO(this,"idStyleMap",new Map)}var t=e.prototype;return t.getId=function(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1},t.has=function(e){return this.styleIDMap.has(e)},t.add=function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n},t.getStyle=function(e){return this.idStyleMap.get(e)||null},t.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},t.generateId=function(){return this.id++},e}();function bU(e){var t,n=null;return"getRootNode"in e&&(null==(t=XD.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&XD.host(XD.getRootNode(e))&&(n=XD.host(XD.getRootNode(e))),n}function vU(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=bU(n);)n=t;return n}(e);return XD.contains(t,n)}function wU(e){var t=e.ownerDocument;return!!t&&(XD.contains(t,e)||vU(e))}var _U=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(_U||{}),EU=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(EU||{}),xU=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(xU||{}),kU=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(kU||{}),SU=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(SU||{}),CU=function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e}(CU||{}),IU=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(IU||{});function AU(e){return"__ln"in e}var PU,OU=function(){function e(){PO(this,"length",0),PO(this,"head",null),PO(this,"tail",null)}var t=e.prototype;return t.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},t.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&AU(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&AU(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++},t.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)},e}(),MU=function(e,t){return e+"@"+t},TU=function(){function e(){var e=this;PO(this,"frozen",!1),PO(this,"locked",!1),PO(this,"texts",[]),PO(this,"attributes",[]),PO(this,"attributeMap",new WeakMap),PO(this,"removes",[]),PO(this,"mapRemoves",[]),PO(this,"movedMap",{}),PO(this,"addedSet",new Set),PO(this,"movedSet",new Set),PO(this,"droppedSet",new Set),PO(this,"removesSubTreeCache",new Set),PO(this,"mutationCb"),PO(this,"blockClass"),PO(this,"blockSelector"),PO(this,"maskTextClass"),PO(this,"maskTextSelector"),PO(this,"inlineStylesheet"),PO(this,"maskInputOptions"),PO(this,"maskTextFn"),PO(this,"maskInputFn"),PO(this,"keepIframeSrcFn"),PO(this,"recordCanvas"),PO(this,"inlineImages"),PO(this,"slimDOMOptions"),PO(this,"dataURLOptions"),PO(this,"doc"),PO(this,"mirror"),PO(this,"iframeManager"),PO(this,"stylesheetManager"),PO(this,"shadowDomManager"),PO(this,"canvasManager"),PO(this,"processedNodeManager"),PO(this,"unattachedDoc"),PO(this,"processMutations",function(t){t.forEach(e.processMutation),e.emit()}),PO(this,"emit",function(){if(!e.frozen&&!e.locked){for(var t=[],n=new Set,r=new OU,i=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},o=function(o){var s=XD.parentNode(o);if(s&&wU(o)){var a=!1;if(o.nodeType===Node.TEXT_NODE){var c=s.tagName;if("TEXTAREA"===c)return;"STYLE"===c&&e.addedSet.has(s)&&(a=!0)}var l=qO(s)?e.mirror.getId(bU(o)):e.mirror.getId(s),u=i(o);if(-1===l||-1===u)return r.addNode(o);var d=xM(o,{doc:e.doc,mirror:e.mirror,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,dataURLOptions:e.dataURLOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(t){pU(t,e.mirror)&&e.iframeManager.addIframe(t),mU(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),gU(o)&&e.shadowDomManager.addShadowRoot(XD.shadowRoot(o),e.doc)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:function(t,n){e.stylesheetManager.attachLinkElement(t,n)},cssCaptured:a});d&&(t.push({parentId:l,nextId:u,node:d}),n.add(d.id))}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var s,a=kO(e.movedSet);!(s=a()).done;){var c=s.value;NU(e.removesSubTreeCache,c,e.mirror)&&!e.movedSet.has(XD.parentNode(c))||o(c)}for(var l,u=kO(e.addedSet);!(l=u()).done;){var d=l.value;LU(e.droppedSet,d)||NU(e.removesSubTreeCache,d,e.mirror)?LU(e.movedSet,d)?o(d):e.droppedSet.add(d):o(d)}for(var h=null;r.length;){var f=null;if(h){var p=e.mirror.getId(XD.parentNode(h.value)),m=i(h.value);-1!==p&&-1!==m&&(f=h)}if(!f)for(var g=r.tail;g;){var y=g;if(g=g.previous,y){var b=e.mirror.getId(XD.parentNode(y.value));if(-1===i(y.value))continue;if(-1!==b){f=y;break}var v=y.value,w=XD.parentNode(v);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=XD.host(w);if(-1!==e.mirror.getId(_)){f=y;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}h=f.previous,r.removeNode(f.value),o(f.value)}var E={texts:e.texts.map(function(t){var n=t.node,r=XD.parentNode(n);return r&&"TEXTAREA"===r.tagName&&e.genTextAreaValueMutation(r),{id:e.mirror.getId(n),value:t.value}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){var n=t.attributes;if("string"==typeof n.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<n.style.length&&(r+i).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff)}return{id:e.mirror.getId(t.node),attributes:n}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:t};(E.texts.length||E.attributes.length||E.removes.length||E.adds.length)&&(e.texts=[],e.attributes=[],e.attributeMap=new WeakMap,e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.removesSubTreeCache=new Set,e.movedMap={},e.mutationCb(E))}}),PO(this,"genTextAreaValueMutation",function(t){var n=e.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(n),e.attributeMap.set(t,n));var r=Array.from(XD.childNodes(t),function(e){return XD.textContent(e)||""}).join("");n.attributes.value=GO({element:t,maskInputOptions:e.maskInputOptions,tagName:t.tagName,type:JO(t),value:r,maskInputFn:e.maskInputFn})}),PO(this,"processMutation",function(t){if(!dU(t.target,e.mirror,e.slimDOMOptions))switch(t.type){case"characterData":var n=XD.textContent(t.target);uU(t.target,e.blockClass,e.blockSelector,!1)||n===t.oldValue||e.texts.push({value:wM(t.target,e.maskTextClass,e.maskTextSelector,!0)&&n?e.maskTextFn?e.maskTextFn(n,lU(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,o=t.target.getAttribute(i);if("value"===i){var s=JO(r);o=GO({element:r,maskInputOptions:e.maskInputOptions,tagName:r.tagName,type:s,value:o,maskInputFn:e.maskInputFn})}if(uU(t.target,e.blockClass,e.blockSelector,!1)||o===t.oldValue)return;var a=e.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!e.keepIframeSrcFn(o)){if(r.contentDocument)return;i="rr_src"}if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(a),e.attributeMap.set(t.target,a)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!bM(r.tagName,i))if(a.attributes[i]=yM(e.doc,ZO(r.tagName),ZO(i),o),"style"===i){if(!e.unattachedDoc)try{e.unattachedDoc=document.implementation.createHTMLDocument()}catch(qAe){e.unattachedDoc=e.doc}var c=e.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(var l,u=kO(Array.from(r.style));!(l=u()).done;){var d=l.value,h=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);h!==c.style.getPropertyValue(d)||f!==c.style.getPropertyPriority(d)?a.styleDiff[d]=""===f?h:[h,f]:a._unchangedStyles[d]=[h,f]}for(var p,m=kO(Array.from(c.style));!(p=m()).done;){var g=p.value;""===r.style.getPropertyValue(g)&&(a.styleDiff[g]=!1)}}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(uU(t.target,e.blockClass,e.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void e.genTextAreaValueMutation(t.target);t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=qO(t.target)?e.mirror.getId(XD.host(t.target)):e.mirror.getId(t.target);uU(t.target,e.blockClass,e.blockSelector,!1)||dU(n,e.mirror,e.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(n,e.mirror)||(e.addedSet.has(n)?(RU(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||hU(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[MU(r,i)]?RU(e.movedSet,n):(e.removes.push({parentId:i,id:r,isShadow:!(!qO(t.target)||!HO(t.target))||void 0}),function(e,t){var n=[e];for(;n.length;){var r=n.pop();t.has(r)||(t.add(r),XD.childNodes(r).forEach(function(e){return n.push(e)}))}}(n,e.removesSubTreeCache))),e.mapRemoves.push(n))})}}),PO(this,"genAdds",function(t,n){if(!e.processedNodeManager.inOtherBuffer(t,e)&&!e.addedSet.has(t)&&!e.movedSet.has(t)){if(e.mirror.hasNode(t)){if(dU(t,e.mirror,e.slimDOMOptions))return;e.movedSet.add(t);var r=null;n&&e.mirror.hasNode(n)&&(r=e.mirror.getId(n)),r&&-1!==r&&(e.movedMap[MU(e.mirror.getId(t),r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);uU(t,e.blockClass,e.blockSelector,!1)||(XD.childNodes(t).forEach(function(t){return e.genAdds(t)}),gU(t)&&XD.childNodes(XD.shadowRoot(t)).forEach(function(n){e.processedNodeManager.add(n,e),e.genAdds(n,t)}))}})}var t=e.prototype;return t.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(n){t[n]=e[n]})},t.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},t.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},t.isFrozen=function(){return this.frozen},t.lock=function(){this.locked=!0,this.canvasManager.lock()},t.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},t.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function RU(e,t){e.delete(t),XD.childNodes(t).forEach(function(t){return RU(e,t)})}function NU(e,t,n){return 0!==e.size&&function(e,t){var n=XD.parentNode(t);return!!n&&e.has(n)}(e,t)}function LU(e,t){return 0!==e.size&&BU(e,t)}function BU(e,t){var n=XD.parentNode(t);return!!n&&(!!e.has(n)||BU(e,n))}var jU=function(e){if(!PU)return e;return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,[].concat(n))}catch(cF){if(PU&&!0===PU(cF))return;throw cF}}},DU=[];function UU(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(qAe){}return e&&e.target}function $U(e,t){var n=new TU;DU.push(n),n.init(e);var r=new(JD())(jU(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function FU(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return function(){};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[],l=null;return Object.keys(xU).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]}).forEach(function(e){var s=ZO(e),a=function(e){return function(n){var s=UU(n);if(!uU(s,i,o,!0)){var a=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=kU.Mouse;break;case"touch":a=kU.Touch;break;case"pen":a=kU.Pen}a===kU.Touch?xU[e]===xU.MouseDown?c="TouchStart":xU[e]===xU.MouseUp&&(c="TouchEnd"):kU.Pen}else fU(n)&&(a=kU.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===kU.Touch||c.startsWith("Mouse")&&a===kU.Mouse)&&(a=null)):xU[e]===xU.Click&&(a=l,l=null);var u=fU(n)?n.changedTouches[0]:n;if(u){var d=r.getId(s),h=u.clientX,f=u.clientY;jU(t)(mO({type:xU[c],id:d,x:h,y:f},null!==a&&{pointerType:a}))}}}}(e);if(window.PointerEvent)switch(xU[e]){case xU.MouseDown:case xU.MouseUp:s=s.replace("mouse","pointer");break;case xU.TouchStart:case xU.TouchEnd:return}c.push(eU(s,a,n))}),jU(function(){c.forEach(function(e){return e()})})}function zU(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.sampling;return eU("scroll",jU(rU(jU(function(e){var s=UU(e);if(s&&!uU(s,i,o,!0)){var a=r.getId(s);if(s===n&&n.defaultView){var c=sU(n.defaultView);t({id:a,x:c.left,y:c.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}}),s.scroll||100)),n)}var qU=["INPUT","TEXTAREA","SELECT"],HU=new WeakMap;function WU(e){return function(e,t){if(ZU("CSSGroupingRule")&&bO(e.parentRule,CSSGroupingRule)||ZU("CSSMediaRule")&&bO(e.parentRule,CSSMediaRule)||ZU("CSSSupportsRule")&&bO(e.parentRule,CSSSupportsRule)||ZU("CSSConditionRule")&&bO(e.parentRule,CSSConditionRule)){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function KU(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function VU(e,t){var n,r,i,o=e.mirror,s=e.stylesheetManager,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(XD.host(t));var c="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,l=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&c&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null==(e=l.get)?void 0:e.call(this)},set:function(e){var t,n=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(qAe){}return n}}),jU(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):function(){}}function GU(e,t){void 0===t&&(t={});var n,r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,s=e.viewportResizeCb,a=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,h=e.fontCb,f=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var o;t.mutation&&(o=t).mutation.apply(o,[].concat(r)),n.apply(void 0,[].concat(r))},e.mousemoveCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o;t.mousemove&&(o=t).mousemove.apply(o,[].concat(n)),r.apply(void 0,[].concat(n))},e.mouseInteractionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o;t.mouseInteraction&&(o=t).mouseInteraction.apply(o,[].concat(n)),i.apply(void 0,[].concat(n))},e.scrollCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.scroll&&(i=t).scroll.apply(i,[].concat(n)),o.apply(void 0,[].concat(n))},e.viewportResizeCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.viewportResize&&(i=t).viewportResize.apply(i,[].concat(n)),s.apply(void 0,[].concat(n))},e.inputCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.input&&(i=t).input.apply(i,[].concat(n)),a.apply(void 0,[].concat(n))},e.mediaInteractionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.mediaInteaction&&(i=t).mediaInteaction.apply(i,[].concat(n)),c.apply(void 0,[].concat(n))},e.styleSheetRuleCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.styleSheetRule&&(i=t).styleSheetRule.apply(i,[].concat(n)),l.apply(void 0,[].concat(n))},e.styleDeclarationCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.styleDeclaration&&(i=t).styleDeclaration.apply(i,[].concat(n)),u.apply(void 0,[].concat(n))},e.canvasMutationCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.canvasMutation&&(i=t).canvasMutation.apply(i,[].concat(n)),d.apply(void 0,[].concat(n))},e.fontCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.font&&(i=t).font.apply(i,[].concat(n)),h.apply(void 0,[].concat(n))},e.selectionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.selection&&(i=t).selection.apply(i,[].concat(n)),f.apply(void 0,[].concat(n))},e.customElementCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.customElement&&(i=t).customElement.apply(i,[].concat(n)),p.apply(void 0,[].concat(n))}}(e,t),e.recordDOM&&(n=$U(e,e.doc));var i,o,s,a,c,l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],l=rU(jU(function(e){var n=Date.now()-o;t(c.map(function(e){return e.timeOffset-=n,e}),e),c=[],o=null}),a),u=jU(rU(jU(function(e){var t=UU(e),n=fU(e)?e.changedTouches[0]:e,r=n.clientX,s=n.clientY;o||(o=oU()),c.push({x:r,y:s,id:i.getId(t),timeOffset:oU()-o}),l("undefined"!=typeof DragEvent&&bO(e,DragEvent)?EU.Drag:bO(e,MouseEvent)?EU.MouseMove:EU.TouchMove)}),s,{trailing:!1})),d=[eU("mousemove",u,r),eU("touchmove",u,r),eU("drag",u,r)];return jU(function(){d.forEach(function(e){return e()})})}(e),u=FU(e),d=zU(e),h=(i={win:r},o=e.viewportResizeCb,s=i.win,a=-1,c=-1,eU("resize",jU(rU(jU(function(){var e=aU(),t=cU();a===e&&c===t||(o({width:Number(t),height:Number(e)}),a=e,c=t)}),200)),s)),f=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.ignoreClass,a=e.ignoreSelector,c=e.maskInputOptions,l=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=UU(e),r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=XD.parentElement(t)),t&&u&&!(qU.indexOf(u)<0)&&!uU(t,i,o,!0)&&!(t.classList.contains(s)||a&&t.matches(a))){var h=t.value,p=!1,m=JO(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(c[u.toLowerCase()]||c[m])&&(h=GO({element:t,maskInputOptions:c,tagName:u,type:m,value:h,maskInputFn:l})),f(t,d?{text:h,isChecked:p,userTriggered:r}:{text:h,isChecked:p});var g=t.name;"radio"===m&&g&&p&&n.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach(function(e){if(e!==t){var n=e.value;f(e,d?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}})}}function f(e,n){var i=HU.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){HU.set(e,n);var o=r.getId(e);jU(t)(mO({},n,{id:o}))}}var p=("last"===u.input?["change"]:["input","change"]).map(function(e){return eU(e,jU(h),n)}),m=n.defaultView;if(!m)return function(){p.forEach(function(e){return e()})};var g,y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),b=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&(g=p).push.apply(g,[].concat(b.map(function(e){return iU(e[0],e[1],{set:function(){jU(h)({target:this,isTrusted:!1})}},!1,m)}))),jU(function(){p.forEach(function(e){return e()})})}(e),p=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,i=e.mirror,o=e.sampling,s=e.doc,a=jU(function(e){return rU(jU(function(o){var s=UU(o);if(s&&!uU(s,n,r,!0)){var a=s.currentTime,c=s.volume,l=s.muted,u=s.playbackRate,d=s.loop;t({type:e,id:i.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u,loop:d})}}),o.media||500)}),c=[eU("play",a(CU.Play),s),eU("pause",a(CU.Pause),s),eU("seeked",a(CU.Seeked),s),eU("volumechange",a(CU.VolumeChange),s),eU("ratechange",a(CU.RateChange),s)];return jU(function(){c.forEach(function(e){return e()})})}(e),m=function(){},g=function(){},y=function(){},b=function(){};e.recordDOM&&(m=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:jU(function(e,t,o){var s=o[0],a=o[1],c=KU(t,r,i.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.addRule=function(e,t,n){void 0===n&&(n=this.cssRules.length);var r=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var a,c,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:s}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replace:s}),e.apply(t,o)})})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replaceSync:s}),e.apply(t,o)})}));var u={};YU("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(YU("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),YU("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),YU("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach(function(e){var t=e[0],o=e[1];d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:jU(function(e,t,o){var s=o[0],a=o[1],c=KU(t.parentStyleSheet,r,i.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:[].concat(WU(t),[a||0])}]}),e.apply(t,o)})}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:jU(function(e,t,o){var s=o[0],a=KU(t.parentStyleSheet,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:[].concat(WU(t),[s])}]}),e.apply(t,o)})})}),jU(function(){o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(e){var t=e[0],n=e[1];n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule})})}(e,{win:r}),g=VU(e,e.doc),y=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=e.ignoreCSSAttributes,o=e.stylesheetManager,s=t.win,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:jU(function(e,t,s){var c,l=s[0],u=s[1],d=s[2];if(i.has(l))return a.apply(t,[l,u,d]);var h=KU(null==(c=t.parentRule)?void 0:c.parentStyleSheet,r,o.styleMirror),f=h.id,p=h.styleId;return(f&&-1!==f||p&&-1!==p)&&n({id:f,styleId:p,set:{property:l,value:u,priority:d},index:WU(t.parentRule)}),e.apply(t,s)})});var c=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:jU(function(e,t,s){var a,l=s[0];if(i.has(l))return c.apply(t,[l]);var u=KU(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,o.styleMirror),d=u.id,h=u.styleId;return(d&&-1!==d||h&&-1!==h)&&n({id:d,styleId:h,remove:{property:l},index:WU(t.parentRule)}),e.apply(t,s)})}),jU(function(){s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=c})}(e,{win:r}),e.collectFonts&&(b=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){var r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var a=QD(n.fonts,"add",function(e){return function(n){return setTimeout(jU(function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}});return i.push(function(){r.FontFace=s}),i.push(a),jU(function(){i.forEach(function(e){return e()})})}(e)));for(var v,w=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,i=e.blockSelector,o=e.selectionCb,s=!0,a=jU(function(){var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],c=e.rangeCount||0,l=0;l<c;l++){var u=e.getRangeAt(l),d=u.startContainer,h=u.startOffset,f=u.endContainer,p=u.endOffset;uU(d,r,i,!0)||uU(f,r,i,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(f),endOffset:p})}o({ranges:a})}});return a(),eU("selectionchange",a)}(e),_=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?QD(r.customElements,"define",function(e){return function(t,r,i){try{n({define:{name:t}})}catch(qAe){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,r,i])}}):function(){}}(e),E=[],x=kO(e.plugins);!(v=x()).done;){var k=v.value;E.push(k.observer(k.callback,r,k.options))}return jU(function(){DU.forEach(function(e){return e.reset()}),null==n||n.disconnect(),l(),u(),d(),h(),f(),p(),m(),g(),y(),b(),w(),_(),E.forEach(function(e){return e()})})}function ZU(e){return void 0!==window[e]}function YU(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var JU=function(){function e(e){PO(this,"iframeIdToRemoteIdMap",new WeakMap),PO(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}var t=e.prototype;return t.getId=function(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s},t.getIds=function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getId(e,t,r,i)})},t.getRemoteId=function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1},t.getRemoteIds=function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getRemoteId(e,t,r)})},t.reset=function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)},t.getIdToRemoteIdMap=function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t},t.getRemoteIdToIdMap=function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t},e}(),QU=function(){function e(e){PO(this,"iframes",new WeakMap),PO(this,"crossOriginIframeMap",new WeakMap),PO(this,"crossOriginIframeMirror",new JU(uM)),PO(this,"crossOriginIframeStyleMirror"),PO(this,"crossOriginIframeRootIdMap",new WeakMap),PO(this,"mirror"),PO(this,"mutationCb"),PO(this,"wrappedEmit"),PO(this,"loadListener"),PO(this,"stylesheetManager"),PO(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new JU(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var t=e.prototype;return t.addIframe=function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)},t.addLoadListener=function(e){this.loadListener=e},t.attachIframe=function(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))},t.handleMessage=function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}},t.transformCrossOriginEvent=function(e,t){var n,r=this;switch(t.type){case _U.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:_U.IncrementalSnapshot,data:{source:EU.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _U.Meta:case _U.Load:case _U.DomContentLoaded:return!1;case _U.Plugin:return t;case _U.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _U.IncrementalSnapshot:switch(t.data.source){case EU.Mutation:return t.data.adds.forEach(function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(function(t){r.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(function(t){r.replaceIds(t,e,["id"])}),t.data.texts.forEach(function(t){r.replaceIds(t,e,["id"])}),t;case EU.Drag:case EU.TouchMove:case EU.MouseMove:return t.data.positions.forEach(function(t){r.replaceIds(t,e,["id"])}),t;case EU.ViewportResize:return!1;case EU.MediaInteraction:case EU.MouseInteraction:case EU.Scroll:case EU.CanvasMutation:case EU.Input:return this.replaceIds(t.data,e,["id"]),t;case EU.StyleSheetRule:case EU.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case EU.Font:return t;case EU.Selection:return t.data.ranges.forEach(function(t){r.replaceIds(t,e,["start","end"])}),t;case EU.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(function(t){r.replaceStyleIds(t,e,["styleId"])}),t}}return!1},t.replace=function(e,t,n,r){for(var i,o=kO(r);!(i=o()).done;){var s=i.value;(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}return t},t.replaceIds=function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)},t.replaceStyleIds=function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)},t.replaceIdOnNode=function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})},t.patchRootIdOnNode=function(e,t){var n=this;e.type===IU.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})},e}(),XU=function(){function e(e){PO(this,"shadowDoms",new WeakSet),PO(this,"mutationCb"),PO(this,"scrollCb"),PO(this,"bypassOptions"),PO(this,"mirror"),PO(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}var t=e.prototype;return t.init=function(){this.reset(),this.patchAttachShadow(Element,document)},t.addShadowRoot=function(e,t){var n=this;if(HO(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=$U(mO({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return r.disconnect()}),this.restoreHandlers.push(zU(mO({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(XD.host(e))),n.restoreHandlers.push(VU({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))},0)}},t.observeAttachShadow=function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)},t.patchAttachShadow=function(e,t){var n=this;this.restoreHandlers.push(QD(e.prototype,"attachShadow",function(e){return function(r){var i=e.call(this,r),o=XD.shadowRoot(this);return o&&wU(this)&&n.addShadowRoot(o,t),i}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch(qAe){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},e}(),e$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t$="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n$=0;n$<64;n$++)t$[e$.charCodeAt(n$)]=n$;var r$=new Map;var i$=function(e,t,n){if(e&&(a$(e,t)||"object"===(void 0===e?"undefined":_O(e)))){var r=function(e,t){var n=r$.get(e);return n||(n=new Map,r$.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function o$(e,t,n){if(bO(e,Array))return e.map(function(e){return o$(e,t,n)});if(null===e)return e;if(bO(e,Float32Array)||bO(e,Float64Array)||bO(e,Int32Array)||bO(e,Uint32Array)||bO(e,Uint8Array)||bO(e,Uint16Array)||bO(e,Int16Array)||bO(e,Int8Array)||bO(e,Uint8ClampedArray))return{rr_type:e.constructor.name,args:[Object.values(e)]};if(bO(e,ArrayBuffer))return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=e$[n[t]>>2],i+=e$[(3&n[t])<<4|n[t+1]>>4],i+=e$[(15&n[t+1])<<2|n[t+2]>>6],i+=e$[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(bO(e,DataView))return{rr_type:e.constructor.name,args:[o$(e.buffer,t,n),e.byteOffset,e.byteLength]};if(bO(e,HTMLImageElement))return{rr_type:e.constructor.name,src:e.src};if(bO(e,HTMLCanvasElement)){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return bO(e,ImageData)?{rr_type:e.constructor.name,args:[o$(e.data,t,n),e.width,e.height]}:a$(e,t)||"object"===(void 0===e?"undefined":_O(e))?{rr_type:e.constructor.name,index:i$(e,t,n)}:e}var s$=function(e,t,n){return e.map(function(e){return o$(e,t,n)})},a$=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof t[e]});return Boolean(n.find(function(n){return bO(e,t[n])}))};function c$(e,t,n,r){var i=[];try{var o=QD(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!uU(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===_O(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[].concat([i],s))}});i.push(o)}catch(qAe){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(e){return e()})}}function l$(e,t,n,r,i,o){for(var s,a=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=QD(e,a,function(e){return function(){for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];var u=e.apply(this,c);if(i$(u,o,this),"tagName"in this.canvas&&!uU(this.canvas,r,i,!0)){var d=s$(c,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}});c.push(l)}catch(qAe){var u=iU(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(u)}},c=[],l=kO(Object.getOwnPropertyNames(e));!(s=l()).done;)a();return c}var u$,d$="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",h$="undefined"!=typeof window&&window.Blob&&new Blob([(u$=d$,Uint8Array.from(atob(u$),function(e){return e.charCodeAt(0)}))],{type:"text/javascript;charset=utf-8"});function f$(e){var t;try{if(!(t=h$&&(window.URL||window.webkitURL).createObjectURL(h$)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(qAe){return new Worker("data:text/javascript;base64,"+d$,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var p$,m$,g$,y$=function(){function e(e){var t=this;PO(this,"pendingCanvasMutations",new Map),PO(this,"rafStamps",{latestId:0,invokeId:null}),PO(this,"mirror"),PO(this,"mutationCb"),PO(this,"resetObservers"),PO(this,"frozen",!1),PO(this,"locked",!1),PO(this,"processMutation",function(e,n){!(t.rafStamps.invokeId&&t.rafStamps.latestId!==t.rafStamps.invokeId)&&t.rafStamps.invokeId||(t.rafStamps.invokeId=t.rafStamps.latestId),t.pendingCanvasMutations.has(e)||t.pendingCanvasMutations.set(e,[]),t.pendingCanvasMutations.get(e).push(n)});var n=e.sampling,r=void 0===n?"all":n,i=e.win,o=e.blockClass,s=e.blockSelector,a=e.recordCanvas,c=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,s,{dataURLOptions:c})}var t=e.prototype;return t.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},t.freeze=function(){this.frozen=!0},t.unfreeze=function(){this.frozen=!1},t.lock=function(){this.locked=!0},t.unlock=function(){this.locked=!1},t.initCanvasFPSObserver=function(e,t,n,r,i){var o=this,s=c$(t,n,r,!0),a=new Map,c=new f$;c.onmessage=function(e){var t=e.data.id;if(a.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,i=n.type,s=n.width,c=n.height;o.mutationCb({id:t,type:SU["2D"],commands:[{property:"clearRect",args:[0,0,s,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var l,u=1e3/e,d=0,h=function(e){if(d&&e-d<u)l=requestAnimationFrame(h);else{d=e;var s,f=o;(s=[],t.document.querySelectorAll("canvas").forEach(function(e){uU(e,n,r,!0)||s.push(e)}),s).forEach(hO(function(e){var t,n,r,o;return SO(this,function(s){switch(s.label){case 0:return n=f.mirror.getId(e),a.get(n)?[2]:0===e.width||0===e.height?[2]:(a.set(n,!0),["webgl","webgl2"].includes(e.__context)&&(r=e.getContext(e.__context),!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)),[4,createImageBitmap(e)]);case 1:return o=s.sent(),c.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[o]),[2]}})})),l=requestAnimationFrame(h)}};l=requestAnimationFrame(h),this.resetObservers=function(){s(),cancelAnimationFrame(l)}},t.initCanvasMutationObserver=function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=c$(e,t,n,!1),i=function(e,t,n,r){for(var i,o=function(){var o=i.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=QD(t.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var s=this,a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return uU(this.canvas,n,r,!0)||setTimeout(function(){var n=s$(c,t,s);e(s.canvas,{type:SU["2D"],property:o,args:n})},0),i.apply(this,c)}});s.push(a)}catch(qAe){var c=iU(t.CanvasRenderingContext2D.prototype,o,{set:function(t){e(this.canvas,{type:SU["2D"],property:o,args:[t],setter:!0})}});s.push(c)}},s=[],a=kO(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));!(i=a()).done;)o();return function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){var i,o,s=[];return(i=s).push.apply(i,[].concat(l$(t.WebGLRenderingContext.prototype,SU.WebGL,e,n,r,t))),void 0!==t.WebGL2RenderingContext&&(o=s).push.apply(o,[].concat(l$(t.WebGL2RenderingContext.prototype,SU.WebGL2,e,n,r,t))),function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n);this.resetObservers=function(){r(),i(),o()}},t.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},t.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map(function(e){return e.type,vO(e,["type"])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}(),b$=function(){function e(e){PO(this,"trackedLinkElements",new WeakSet),PO(this,"mutationCb"),PO(this,"adoptedStyleSheetCb"),PO(this,"styleMirror",new yU),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}var t=e.prototype;return t.attachLinkElement=function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)},t.trackLinkElement=function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))},t.adoptStyleSheets=function(e,t){var n,r=function(){var e=i.value,t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,function(t,n){return{rule:KO(t,e.href),index:n}})})),o.styleIds.push(t)};if(0!==e.length){for(var i,o={id:t,styleIds:[]},s=[],a=kO(e);!(i=a()).done;)n=this,r();s.length>0&&(o.styles=s),this.adoptedStyleSheetCb(o)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},e}(),v$=function(){function e(){PO(this,"nodeMap",new WeakMap),PO(this,"active",!1)}var t=e.prototype;return t.inOtherBuffer=function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some(function(e){return e!==t})},t.add=function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))},t.destroy=function(){},e}(),w$=!1;try{if(2!==Array.from([1],function(e){return 2*e})[0]){var _$=document.createElement("iframe");document.body.appendChild(_$),Array.from=(null==(IO=_$.contentWindow)?void 0:IO.Array.from)||Array.from,document.body.removeChild(_$)}}catch(jHe){}var E$,x$,k$=new VO;function S$(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,s=e.blockSelector,a=void 0===s?null:s,c=e.ignoreClass,l=void 0===c?"rr-ignore":c,u=e.ignoreSelector,d=void 0===u?null:u,h=e.maskTextClass,f=void 0===h?"rr-mask":h,p=e.maskTextSelector,m=void 0===p?null:p,g=e.inlineStylesheet,y=void 0===g||g,b=e.maskAllInputs,v=e.maskInputOptions,w=e.slimDOMOptions,_=e.maskInputFn,E=e.maskTextFn,x=e.hooks,k=e.packFn,S=e.sampling,C=void 0===S?{}:S,I=e.dataURLOptions,A=void 0===I?{}:I,P=e.mousemoveWait,O=e.recordDOM,M=void 0===O||O,T=e.recordCanvas,R=void 0!==T&&T,N=e.recordCrossOriginIframes,L=void 0!==N&&N,B=e.recordAfter,j=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,D=e.userTriggeredOnInput,U=void 0!==D&&D,$=e.collectFonts,F=void 0!==$&&$,z=e.inlineImages,q=void 0!==z&&z,H=e.plugins,W=e.keepIframeSrcFn,K=void 0===W?function(){return!1}:W,V=e.ignoreCSSAttributes,G=void 0===V?new Set([]):V,Z=e.errorHandler;PU=Z;var Y=!L||window.parent===window,J=!1;if(!Y)try{window.parent.document&&(J=!1)}catch(qAe){J=!0}if(Y&&!t)throw new Error("emit function is required");if(!Y&&!J)return function(){};void 0!==P&&void 0===C.mousemove&&(C.mousemove=P),k$.reset();var Q,X,ee=!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==v?v:{password:!0},te=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w,headTitleMutations:"all"===w}:w||{};void 0===Q&&(Q=window),"NodeList"in Q&&!Q.NodeList.prototype.forEach&&(Q.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in Q&&!Q.DOMTokenList.prototype.forEach&&(Q.DOMTokenList.prototype.forEach=Array.prototype.forEach);var ne=0,re=function(e){for(var t,n=kO(H||[]);!(t=n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}return k&&!J&&(e=k(e)),e};p$=function(e,i){var o,s=e;if(s.timestamp=oU(),!(null==(o=DU[0])?void 0:o.isFrozen())||s.type===_U.FullSnapshot||s.type===_U.IncrementalSnapshot&&s.data.source===EU.Mutation||DU.forEach(function(e){return e.unfreeze()}),Y)null==t||t(re(s),i);else if(J){var a={type:"rrweb",event:re(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===_U.FullSnapshot)X=s,ne=0;else if(s.type===_U.IncrementalSnapshot){if(s.data.source===EU.Mutation&&s.data.isAttachIframe)return;ne++;var c=r&&ne>=r,l=n&&s.timestamp-X.timestamp>n;(c||l)&&m$(!0)}};for(var ie,oe=function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Mutation},e)})},se=function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Scroll},e)})},ae=function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.CanvasMutation},e)})},ce=new b$({mutationCb:oe,adoptedStyleSheetCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.AdoptedStyleSheet},e)})}}),le=new QU({mirror:k$,mutationCb:oe,stylesheetManager:ce,recordCrossOriginIframes:L,wrappedEmit:p$}),ue=kO(H||[]);!(ie=ue()).done;){var de=ie.value;de.getMirror&&de.getMirror({nodeMirror:k$,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror})}var he=new v$;g$=new y$({recordCanvas:R,mutationCb:ae,win:window,blockClass:o,blockSelector:a,mirror:k$,sampling:C.canvas,dataURLOptions:A});var fe=new XU({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:A,maskTextFn:E,maskInputFn:_,recordCanvas:R,inlineImages:q,sampling:C,slimDOMOptions:te,iframeManager:le,stylesheetManager:ce,canvasManager:g$,keepIframeSrcFn:K,processedNodeManager:he},mirror:k$});m$=function(e){if(void 0===e&&(e=!1),M){p$({type:_U.Meta,data:{href:window.location.href,width:cU(),height:aU()}},e),ce.reset(),fe.init(),DU.forEach(function(e){return e.lock()});var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new VO:r,o=n.blockClass,s=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,d=n.maskTextSelector,h=void 0===d?null:d,f=n.inlineStylesheet,p=void 0===f||f,m=n.inlineImages,g=void 0!==m&&m,y=n.recordCanvas,b=void 0!==y&&y,v=n.maskAllInputs,w=void 0!==v&&v,_=n.maskTextFn,E=n.maskInputFn,x=n.slimDOM,k=void 0!==x&&x,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,A=n.onIframeLoad,P=n.iframeLoadTimeout,O=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,T=n.keepIframeSrcFn;return xM(e,{doc:e,mirror:i,blockClass:s,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===w?{password:!0}:w,maskTextFn:_,maskInputFn:E,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:g,recordCanvas:b,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:P,onStylesheetLoad:O,stylesheetLoadTimeout:M,keepIframeSrcFn:void 0===T?function(){return!1}:T,newlyAddedElement:!1})}(document,{mirror:k$,blockClass:o,blockSelector:a,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:E,maskInputFn:_,slimDOM:te,dataURLOptions:A,recordCanvas:R,inlineImages:q,onSerialize:function(e){pU(e,k$)&&le.addIframe(e),mU(e,k$)&&ce.trackLinkElement(e),gU(e)&&fe.addShadowRoot(XD.shadowRoot(e),document)},onIframeLoad:function(e,t){le.attachIframe(e,t),fe.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ce.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!t)return console.warn("Failed to snapshot the document");p$({type:_U.FullSnapshot,data:{node:t,initialOffset:sU(window)}},e),DU.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,k$.getId(document))}};try{var pe=[],me=function(e){var t;return jU(GU)({mutationCb:oe,mousemoveCb:function(e,t){return p$({type:_U.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.MouseInteraction},e)})},scrollCb:se,viewportResizeCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.ViewportResize},e)})},inputCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Input},e)})},mediaInteractionCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.MediaInteraction},e)})},styleSheetRuleCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.StyleSheetRule},e)})},styleDeclarationCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.StyleDeclaration},e)})},canvasMutationCb:ae,fontCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Font},e)})},selectionCb:function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Selection},e)})},customElementCb:function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.CustomElement},e)})},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:f,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:y,sampling:C,recordDOM:M,recordCanvas:R,inlineImages:q,userTriggeredOnInput:U,collectFonts:F,doc:e,maskInputFn:_,maskTextFn:E,keepIframeSrcFn:K,blockSelector:a,slimDOMOptions:te,dataURLOptions:A,mirror:k$,iframeManager:le,stylesheetManager:ce,shadowDomManager:fe,processedNodeManager:he,canvasManager:g$,ignoreCSSAttributes:G,plugins:(null==(t=null==H?void 0:H.filter(function(e){return e.observer}))?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return p$({type:_U.Plugin,data:{plugin:e.name,payload:t}})}}}))||[]},x)};le.addLoadListener(function(e){try{pe.push(me(e.contentDocument))}catch(cF){console.warn(cF)}});var ge=function(){m$(),pe.push(me(document)),w$=!0};return"interactive"===document.readyState||"complete"===document.readyState?ge():(pe.push(eU("DOMContentLoaded",function(){p$({type:_U.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&ge()})),pe.push(eU("load",function(){p$({type:_U.Load,data:{}}),"load"===j&&ge()},window))),function(){pe.forEach(function(e){try{e()}catch(cF){String(cF).toLowerCase().includes("cross-origin")||console.warn(cF)}}),he.destroy(),w$=!1,PU=void 0}}catch(cF){console.warn(cF)}}S$.addCustomEvent=function(e,t){if(!w$)throw new Error("please add custom event after start recording");p$({type:_U.Custom,data:{tag:e,payload:t}})},S$.freezePage=function(){DU.forEach(function(e){return e.freeze()})},S$.takeFullSnapshot=function(e){if(!w$)throw new Error("please take full snapshot after start recording");m$(e)},S$.mirror=k$,(x$=E$||(E$={}))[x$.NotStarted=0]="NotStarted",x$[x$.Running=1]="Running",x$[x$.Stopped=2]="Stopped",S$.addCustomEvent,S$.freezePage,S$.takeFullSnapshot;var C$=Object.defineProperty,I$=function(e,t,n){return function(e,t,n){return t in e?C$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)};var A$=function(){function e(e){I$(this,"fileName"),I$(this,"functionName"),I$(this,"lineNumber"),I$(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),P$=/(^|@)\S+:\d+/,O$=/^\s*at .*(\S+:\d+|\(native\))/m,M$=/^(eval@)?(\[native code])?$/,T$={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(O$)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(O$)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new A$({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(M$)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new A$({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new A$({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new A$({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new A$({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(P$)&&!e.match(/^Error created at/)},this).map(function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new A$({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function R$(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var s=r.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&i.push(s)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function N$(e){return"[object Object]"===Object.prototype.toString.call(e)}function L$(e,t){if(0===t)return!0;for(var n,r=kO(Object.keys(e));!(n=r()).done;){var i=n.value;if(N$(e[i])&&L$(e[i],t-1))return!0}return!1}function B$(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(N$(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(N$(e)&&L$(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if("bigint"===(void 0===t?"undefined":_O(t)))return t.toString()+"n";if(bO(t,Event)){var s={};for(var a in t){var c=t[a];Array.isArray(c)?s[a]=R$(c.length?c[0]:null):s[a]=c}return s}return bO(t,Node)?bO(t,HTMLElement)?t?t.outerHTML:"":t.nodeName:bO(t,Error)?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var j$={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function D$(e,t,n){var r,i=n?Object.assign({},j$,n):j$,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var s=0,a=!1,c=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=T$.parse(r).map(function(e){return e.toString()}),s=[B$(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",l),c.push(function(){t.removeEventListener("error",l)});var u=function(t){var n,r;bO(t.reason,Error)?r=[B$("Uncaught (in promise) "+(n=t.reason).name+": "+n.message,i.stringifyOptions)]:(n=new Error,r=[B$("Uncaught (in promise)",i.stringifyOptions),B$(t.reason,i.stringifyOptions)]);var o=T$.parse(n).map(function(e){return e.toString()});e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",u),c.push(function(){t.removeEventListener("unhandledrejection",u)})}for(var d,h=kO(i.level);!(d=h()).done;){var f=d.value;c.push(p(r,f))}return function(){c.forEach(function(e){return e()})};function p(t,n){var r=this;return t[n]?function(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}(t,n,function(t){var o=r;return function(){for(var r=arguments.length,c=new Array(r),l=0;l<r;l++)c[l]=arguments[l];if(t.apply(o,c),!("assert"===n&&c[0]||a)){a=!0;try{var u=T$.parse(new Error).map(function(e){return e.toString()}).splice(1),d=("assert"===n?c.slice(1):c).map(function(e){return B$(e,i.stringifyOptions)});++s<i.lengthThreshold?e({level:n,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[B$("The number of log records reached the threshold.")]})}catch(cF){t.apply(void 0,[].concat(["rrweb logger error:",cF],c))}finally{a=!1}}}}):function(){}}}var U$,$$,F$,z$=cO.setImmediate,q$=Object.prototype.toString,H$=void 0!==z$?function(e){return z$(e)}:setTimeout;try{Object.defineProperty({},"x",{}),U$=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(jHe){U$=function(e,t,n){return e[t]=n,e}}function W$(e,t){F$.add(e,t),$$||($$=H$(F$.drain))}function K$(e){var t,n=typeof e;return null===e||"object"!==n&&"function"!==n||(t=e.then),"function"==typeof t&&t}function V$(){for(var e=0;e<this.chain.length;e++)G$(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function G$(e,t,n){var r,i;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(i=K$(r))?i.call(r,n.resolve,n.reject):n.resolve(r)}catch(jHe){n.reject(jHe)}}function Z$(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=K$(e))?W$(function(){var r=new Q$(n);try{t.call(e,function(){Z$.apply(r,arguments)},function(){Y$.apply(r,arguments)})}catch(jHe){Y$.call(r,jHe)}}):(n.msg=e,n.state=1,n.chain.length>0&&W$(V$,n))}catch(jHe){Y$.call(new Q$(n),jHe)}}}function Y$(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&W$(V$,t))}function J$(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function Q$(e){this.def=e,this.triggered=!1}function X$(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function eF(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new X$(this);this.then=function(e,n){var r={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return r.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t}),t.chain.push(r),0!==t.state&&W$(V$,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){Z$.call(t,e)},function(e){Y$.call(t,e)})}catch(jHe){Y$.call(t,jHe)}}F$=function(){var e,t,n;function r(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(i,o){n=new r(i,o),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=$$=void 0;n;)n.fn.call(n.self),n=n.next}}}();var tF,nF=U$({},"constructor",eF,!1);eF.prototype=nF,U$(nF,"__NPO__",0,!1),U$(eF,"resolve",function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)})}),U$(eF,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),U$(eF,"all",function(e){var t=this;return"[object Array]"!==q$.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t(function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var i=e.length,o=Array(i),s=0;J$(t,e,function(e,t){o[e]=t,++s===i&&n(o)},r)})}),U$(eF,"race",function(e){var t=this;return"[object Array]"!==q$.call(e)?t.reject(TypeError("Not an array")):new t(function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");J$(t,e,function(e,t){n(t)},r)})}),tF="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:eF;var rF,iF,oF,sF,aF,cF,lF,uF,dF,hF,fF={DEBUG:!1,LIB_VERSION:"2.73.0"},pF=864e5,mF=8e3,gF=Array.prototype,yF=Function.prototype,bF=Object.prototype,vF=gF.slice,wF=bF.toString,_F=bF.hasOwnProperty,EF=cO.console,xF=cO.navigator,kF=cO.document,SF=cO.opera,CF=cO.screen,IF=xF.userAgent,AF=yF.bind,PF=gF.forEach,OF=gF.indexOf,MF=gF.map,TF=Array.isArray,RF={},NF={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},LF={log:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF)try{EF.log.apply(EF,arguments)}catch(jHe){NF.each(arguments,function(e){EF.log(e)})}},warn:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF){var e=["Mixpanel warning:"].concat(NF.toArray(arguments));try{EF.warn.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.warn(e)})}}},error:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF){var e=["Mixpanel error:"].concat(NF.toArray(arguments));try{EF.error.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.error(e)})}}},critical:function(){if(!NF.isUndefined(EF)&&EF){var e=["Mixpanel error:"].concat(NF.toArray(arguments));try{EF.error.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.error(e)})}}}},BF=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(LF,arguments)}},jF=function(e){return{log:BF(LF.log,e),error:BF(LF.error,e),critical:BF(LF.critical,e)}},DF=function(e){return function(){try{return e.apply(this,arguments)}catch(qAe){LF.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),fF.DEBUG&&LF.critical(qAe)}}},UF=function(e){var t=e.prototype;for(var n in t)"function"==typeof t[n]&&(t[n]=DF(t[n]))};NF.bind=function(e,t){var n,r;if(AF&&e.bind===AF)return AF.apply(e,vF.call(arguments,1));if(!NF.isFunction(e))throw new TypeError;return n=vF.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(vF.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(vF.call(arguments)));return Object(s)===s?s:o},r},NF.each=function(e,t,n){if(null!=e)if(PF&&e.forEach===PF)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e)===RF)return}else for(var o in e)if(_F.call(e,o)&&t.call(n,e[o],o,e)===RF)return},NF.extend=function(e){return NF.each(vF.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},NF.isArray=TF||function(e){return"[object Array]"===wF.call(e)},NF.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},NF.isArguments=function(e){return!(!e||!_F.call(e,"callee"))},NF.toArray=function(e){return e?e.toArray?e.toArray():NF.isArray(e)||NF.isArguments(e)?vF.call(e):NF.values(e):[]},NF.map=function(e,t,n){if(MF&&e.map===MF)return e.map(t,n);var r=[];return NF.each(e,function(e){r.push(t.call(n,e))}),r},NF.keys=function(e){var t=[];return null===e||NF.each(e,function(e,n){t[t.length]=n}),t},NF.values=function(e){var t=[];return null===e||NF.each(e,function(e){t[t.length]=e}),t},NF.include=function(e,t){var n=!1;return null===e?n:OF&&e.indexOf===OF?-1!=e.indexOf(t):(NF.each(e,function(e){if(n||(n=e===t))return RF}),n)},NF.includes=function(e,t){return-1!==e.indexOf(t)},NF.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},NF.isObject=function(e){return e===Object(e)&&!NF.isArray(e)},NF.isEmptyObject=function(e){if(NF.isObject(e)){for(var t in e)if(_F.call(e,t))return!1;return!0}return!1},NF.isUndefined=function(e){return void 0===e},NF.isString=function(e){return"[object String]"==wF.call(e)},NF.isDate=function(e){return"[object Date]"==wF.call(e)},NF.isNumber=function(e){return"[object Number]"==wF.call(e)},NF.isElement=function(e){return!(!e||1!==e.nodeType)},NF.encodeDates=function(e){return NF.each(e,function(t,n){NF.isDate(t)?e[n]=NF.formatDate(t):NF.isObject(t)&&(e[n]=NF.encodeDates(t))}),e},NF.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},NF.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},NF.strip_empty_properties=function(e){var t={};return NF.each(e,function(e,n){NF.isString(e)&&e.length>0&&(t[n]=e)}),t},NF.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):NF.isArray(e)?(n=[],NF.each(e,function(e){n.push(NF.truncate(e,t))})):NF.isObject(e)?(n={},NF.each(e,function(e,r){n[r]=NF.truncate(e,t)})):n=e,n},NF.JSONEncode=function(){return function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},n=function(e,r){var i="",o=0,s="",a="",c=0,l=i,u=[],d=r[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(i+=" ",u=[],"[object Array]"===wF.apply(d)){for(c=d.length,o=0;o<c;o+=1)u[o]=n(o,d)||"null";return a=0===u.length?"[]":i?"[\n"+i+u.join(",\n"+i)+"\n"+l+"]":"["+u.join(",")+"]",i=l,a}for(s in d)_F.call(d,s)&&(a=n(s,d))&&u.push(t(s)+(i?": ":":")+a);return a=0===u.length?"{}":i?"{"+u.join(",")+l+"}":"{"+u.join(",")+"}",i=l,a}};return n("",{"":e})}}(),NF.JSONDecode=(aF={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},cF=function(e){var t=new SyntaxError(e);throw t.at=rF,t.text=oF,t},lF=function(e){return e&&e!==iF&&cF("Expected '"+e+"' instead of '"+iF+"'"),iF=oF.charAt(rF),rF+=1,iF},uF=function(){var e,t="";for("-"===iF&&(t="-",lF("-"));iF>="0"&&iF<="9";)t+=iF,lF();if("."===iF)for(t+=".";lF()&&iF>="0"&&iF<="9";)t+=iF;if("e"===iF||"E"===iF)for(t+=iF,lF(),"-"!==iF&&"+"!==iF||(t+=iF,lF());iF>="0"&&iF<="9";)t+=iF,lF();if(e=+t,isFinite(e))return e;cF("Bad number")},dF=function(){var e,t,n,r="";if('"'===iF)for(;lF();){if('"'===iF)return lF(),r;if("\\"===iF)if(lF(),"u"===iF){for(n=0,t=0;t<4&&(e=parseInt(lF(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof aF[iF])break;r+=aF[iF]}else r+=iF}cF("Bad string")},hF=function(){for(;iF&&iF<=" ";)lF()},sF=function(){switch(hF(),iF){case"{":return function(){var e,t={};if("{"===iF){if(lF("{"),hF(),"}"===iF)return lF("}"),t;for(;iF;){if(e=dF(),hF(),lF(":"),Object.hasOwnProperty.call(t,e)&&cF('Duplicate key "'+e+'"'),t[e]=sF(),hF(),"}"===iF)return lF("}"),t;lF(","),hF()}}cF("Bad object")}();case"[":return function(){var e=[];if("["===iF){if(lF("["),hF(),"]"===iF)return lF("]"),e;for(;iF;){if(e.push(sF()),hF(),"]"===iF)return lF("]"),e;lF(","),hF()}}cF("Bad array")}();case'"':return dF();case"-":return uF();default:return iF>="0"&&iF<="9"?uF():function(){switch(iF){case"t":return lF("t"),lF("r"),lF("u"),lF("e"),!0;case"f":return lF("f"),lF("a"),lF("l"),lF("s"),lF("e"),!1;case"n":return lF("n"),lF("u"),lF("l"),lF("l"),null}cF('Unexpected "'+iF+'"')}()}},function(e){var t;return oF=e,rF=0,iF=" ",t=sF(),hF(),iF&&cF("Syntax error"),t}),NF.base64Encode=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,l="",u=[];if(!e)return e;e=NF.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(l=u.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},NF.utf8Encode=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},NF.UUID=function(){try{return cO.crypto.randomUUID()}catch(jHe){for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(16*Math.random());return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",NF.map(e,function(e){return e.toString(16)}).join("")}};var $F=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];NF.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<$F.length;t++)if(-1!==e.indexOf($F[t]))return!0;return!1},NF.HTTPBuildQuery=function(e,t){var n,r,i=[];return NF.isUndefined(t)&&(t="&"),NF.each(e,function(e,t){n=encodeURIComponent(e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n}),i.join(t)},NF.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var r=n[1];try{r=decodeURIComponent(r)}catch(jHe){LF.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")},NF.cookie={get:function(e){for(var t=e+"=",n=kF.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=NF.JSONDecode(NF.cookie.get(e))||{}}catch(jHe){}return t},set_seconds:function(e,t,n,r,i,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(r){var u=QF(kF.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),c="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure"),kF.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l},set:function(e,t,n,r,i,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(r){var u=QF(kF.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),c="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure");var h=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l;return kF.cookie=h,h},remove:function(e,t,n){NF.cookie.set(e,"",-1,t,!1,!1,n)}};var FF=function(e){var t=!0;try{var n="__mplss_"+ZF(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(t=!1),e.removeItem(n)}catch(jHe){t=!1}return t},zF=null,qF=function(e,t){return null===zF||t?zF=FF(e||cO.localStorage):zF},HF=null;function WF(e,t,n){var r=function(e){LF.error(t+" error: "+e)};return{is_supported:function(r){var i=n(e,r);return i||LF.error(t+" unsupported"),i},error:r,get:function(t){try{return e.getItem(t)}catch(jHe){r(jHe)}return null},parse:function(t){try{return NF.JSONDecode(e.getItem(t))||{}}catch(jHe){}return null},set:function(t,n){try{e.setItem(t,n)}catch(jHe){r(jHe)}},remove:function(t){try{e.removeItem(t)}catch(jHe){r(jHe)}}}}NF.localStorage=WF(cO.localStorage,"localStorage",qF),NF.sessionStorage=WF(cO.sessionStorage,"sessionStorage",function(e,t){return null===HF||t?HF=FF(e||cO.sessionStorage):HF}),NF.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){var i=function(i){if(i=i||e(cO.event)){var o,s,a=!0;return NF.isFunction(r)&&(o=r(i)),s=n.call(t,i),!1!==o&&!1!==s||(a=!1),a}};return i}(t,r,a)}else LF.error("No valid element provided to register_event")}}();var KF=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');NF.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(e,n){var r=" "+n+" ";return(" "+e.className+" ").replace(t," ").indexOf(r)>=0}function r(t){if(!kF.getElementsByTagName)return[];var r,i,o,s,a,c,l,u,d,h,f=t.split(" "),p=[kF];for(c=0;c<f.length;c++)if((r=f[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){o=(i=r.split("#"))[0];var m=i[1],g=kF.getElementById(m);if(!g||o&&g.nodeName.toLowerCase()!=o)return[];p=[g]}else if(r.indexOf(".")>-1){o=(i=r.split("."))[0];var y=i[1];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];for(p=[],h=0,l=0;l<s.length;l++)s[l].className&&NF.isString(s[l].className)&&n(s[l],y)&&(p[h++]=s[l])}else{var b=r.match(KF);if(b){o=b[1];var v,w=b[2],_=b[3],E=b[4];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];switch(p=[],h=0,_){case"=":v=function(e){return e.getAttribute(w)==E};break;case"~":v=function(e){return e.getAttribute(w).match(new RegExp("\\b"+E+"\\b"))};break;case"|":v=function(e){return e.getAttribute(w).match(new RegExp("^"+E+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(w).indexOf(E)};break;case"$":v=function(e){return e.getAttribute(w).lastIndexOf(E)==e.getAttribute(w).length-E.length};break;case"*":v=function(e){return e.getAttribute(w).indexOf(E)>-1};break;default:v=function(e){return e.getAttribute(w)}}for(p=[],h=0,l=0;l<s.length;l++)v(s[l])&&(p[h++]=s[l])}else{for(o=r,s=[],a=0,l=0;l<p.length;l++)for(d=p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];p=s}}return p}return function(e){return NF.isElement(e)?[e]:NF.isObject(e)&&!NF.isUndefined(e.length)?e:r.call(this,e)}}();var VF=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],GF=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];NF.info={campaignParams:function(e){var t="",n={};return NF.each(VF,function(r){(t=NF.getQueryParam(kF.URL,r)).length?n[r]=t:void 0!==e&&(n[r]=e)}),n},clickParams:function(){var e="",t={};return NF.each(GF,function(n){(e=NF.getQueryParam(kF.URL,n)).length&&(t[n]=e)}),t},marketingParams:function(){return NF.extend(NF.info.campaignParams(),NF.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=NF.info.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=NF.getQueryParam(e,n);i.length&&(r.mp_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||NF.includes(e," OPR/")?NF.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":NF.includes(e,"IEMobile")||NF.includes(e,"WPDesktop")?"Internet Explorer Mobile":NF.includes(e,"SamsungBrowser/")?"Samsung Internet":NF.includes(e,"Edge")||NF.includes(e,"Edg/")?"Microsoft Edge":NF.includes(e,"FBIOS")?"Facebook Mobile":NF.includes(e,"Whale/")?"Whale Browser":NF.includes(e,"Chrome")?"Chrome":NF.includes(e,"CriOS")?"Chrome iOS":NF.includes(e,"UCWEB")||NF.includes(e,"UCBrowser")?"UC Browser":NF.includes(e,"FxiOS")?"Firefox iOS":NF.includes(t,"Apple")?NF.includes(e,"Mobile")?"Mobile Safari":"Safari":NF.includes(e,"Android")?"Android Mobile":NF.includes(e,"Konqueror")?"Konqueror":NF.includes(e,"Firefox")?"Firefox":NF.includes(e,"MSIE")||NF.includes(e,"Trident/")?"Internet Explorer":NF.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[NF.info.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},os:function(){var e=IF;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return cO.location.href},properties:function(e){return"object"!=typeof e&&(e={}),NF.extend(NF.strip_empty_properties({$os:NF.info.os(),$browser:NF.info.browser(IF,xF.vendor,SF),$referrer:kF.referrer,$referring_domain:NF.info.referringDomain(kF.referrer),$device:NF.info.device(IF)}),{$current_url:NF.info.currentUrl(),$browser_version:NF.info.browserVersion(IF,xF.vendor,SF),$screen_height:CF.height,$screen_width:CF.width,mp_lib:"web",$lib_version:fF.LIB_VERSION,$insert_id:ZF(),time:NF.timestamp()/1e3},NF.strip_empty_properties(e))},people_properties:function(){return NF.extend(NF.strip_empty_properties({$os:NF.info.os(),$browser:NF.info.browser(IF,xF.vendor,SF)}),{$browser_version:NF.info.browserVersion(IF,xF.vendor,SF)})},mpPageViewProperties:function(){return NF.strip_empty_properties({current_page_title:kF.title,current_domain:cO.location.hostname,current_url_path:cO.location.pathname,current_url_protocol:cO.location.protocol,current_url_search:cO.location.search})}};var ZF=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},YF=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,JF=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,QF=function(e){var t=JF,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=YF);var i=e.match(t);return i?i[0]:""},XF=function(){},ez=null,tz=null;"undefined"!=typeof JSON&&(ez=JSON.stringify,tz=JSON.parse),ez=ez||NF.JSONEncode,tz=tz||NF.JSONDecode;NF.info=NF.info,NF.info.browser=NF.info.browser,NF.info.browserVersion=NF.info.browserVersion,NF.info.device=NF.info.device,NF.info.properties=NF.info.properties,NF.isBlockedUA=NF.isBlockedUA,NF.isEmptyObject=NF.isEmptyObject,NF.isObject=NF.isObject,NF.JSONDecode=NF.JSONDecode,NF.JSONEncode=NF.JSONEncode,NF.toArray=NF.toArray,NF.NPO=eF;var nz="mixpanelRecordingEvents",rz="mixpanelRecordingRegistry",iz=[nz,rz],oz=function(e){this.dbPromise=null,this.storeName=e};oz.prototype._openDb=function(){return new tF(function(e,t){var n=cO.indexedDB.open("mixpanelBrowserDb",1);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(e){var t=e.target.result;iz.forEach(function(e){t.createObjectStore(e)})}})},oz.prototype.init=function(){return cO.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof cO.IDBDatabase?tF.resolve():tF.reject(e)})):tF.reject("indexedDB is not supported in this browser")},oz.prototype.isInitialized=function(){return!!this.dbPromise},oz.prototype.makeTransaction=function(e,t){var n=this.storeName,r=function(r){return new tF(function(i,o){var s=r.transaction(n,e);s.oncomplete=function(){i(s)},s.onabort=s.onerror=function(){o(s.error)},t(s.objectStore(n))})};return this.dbPromise.then(r).catch(function(e){return e&&"InvalidStateError"===e.name?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):tF.reject(e)}.bind(this))},oz.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},oz.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},oz.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},oz.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};function sz(e,t){yz(!0,e,t)}function az(e,t){yz(!1,e,t)}function cz(e,t){return"1"===gz(e,t)}function lz(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||cO,n=t.navigator||{},r=!1;return NF.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){NF.includes([!0,1,"1","yes"],e)&&(r=!0)}),r}(t))return LF.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n="0"===gz(e,t);return n&&LF.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function uz(e){return bz(e,function(e){return this.get_config(e)})}function dz(e){return bz(e,function(e){return this._get_config(e)})}function hz(e){return bz(e,function(e){return this._get_config(e)})}function fz(e,t){pz(t=t||{}).remove(mz(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function pz(e){return"localStorage"===(e=e||{}).persistenceType?NF.localStorage:NF.cookie}function mz(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function gz(e,t){return pz(t).get(mz(e,t))}function yz(e,t,n){NF.isString(t)&&t.length?(pz(n=n||{}).set(mz(t,n),e?1:0,NF.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):LF.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function bz(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");r&&(n=lz(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(jHe){LF.error("Unexpected error when checking tracking opt-out status: "+jHe)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var vz=jF("lock"),wz=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||cO.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||tF};wz.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(NF.bind(function(n,r){var i=t||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,u=s+":X",d=s+":Y",h=s+":Z",f=function(e){if((new Date).getTime()-o>c)return vz.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+i+"]"),l.removeItem(h),l.removeItem(d),void g();setTimeout(function(){try{e()}catch(jHe){r(jHe)}},a*(Math.random()+.1))},p=function(e,t){e()?t():f(function(){p(e,t)})},m=function(){var e=l.getItem(d);return(!e||e===i)&&(l.setItem(d,i),l.getItem(d)===i||(qF(l,!0)||r(new Error("localStorage support dropped while acquiring lock")),!1))},g=function(){l.setItem(u,i),p(m,function(){l.getItem(u)!==i?f(function(){l.getItem(d)===i?p(function(){return!l.getItem(h)},y):g()}):y()})},y=function(){l.setItem(h,"1");var t=function(){l.removeItem(h),l.getItem(d)===i&&l.removeItem(d),l.getItem(u)===i&&l.removeItem(u)};e().then(function(e){t(),n(e)}).catch(function(e){t(),r(e)})};try{if(!qF(l,!0))throw new Error("localStorage support check failed");g()}catch(jHe){r(jHe)}},this))};var _z=function(e){this.storage=e||cO.localStorage};_z.prototype.init=function(){return tF.resolve()},_z.prototype.isInitialized=function(){return!0},_z.prototype.setItem=function(e,t){return new tF(NF.bind(function(n,r){try{this.storage.setItem(e,ez(t))}catch(qAe){r(qAe)}n()},this))},_z.prototype.getItem=function(e){return new tF(NF.bind(function(t,n){var r;try{r=tz(this.storage.getItem(e))}catch(qAe){n(qAe)}t(r)},this))},_z.prototype.removeItem=function(e){return new tF(NF.bind(function(t,n){try{this.storage.removeItem(e)}catch(qAe){n(qAe)}t()},this))};var Ez=jF("batch"),xz=function(e,t){var n,r,i,o;t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new _z,this.lock=new wz(e,{storage:t.sharedLockStorage||cO.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||NF.bind(Ez.error,Ez),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=(n=NF.bind(this._enqueuePersisted,this),r=t.enqueueThrottleMs,i=null,o=[],function(e){var t=this;return o.push(e),i||(i=new tF(function(e){setTimeout(function(){var r=n.apply(t,[o]);i=null,o=[],e(r)},r)})),i}):this.enqueuePersisted=NF.bind(function(e){return this._enqueuePersisted([e])},this)};xz.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?tF.resolve():this.queueStorage.init().then(NF.bind(function(){this.initialized=!0},this)).catch(NF.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},xz.prototype.enqueue=function(e,t){var n={id:ZF(),flushAfter:(new Date).getTime()+2*t,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),tF.resolve(!0))},xz.prototype._enqueuePersisted=function(e){var t=NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(t){return this.saveToStorage(t.concat(e))},this)).then(NF.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(e)),t},this)).catch(NF.bind(function(t){return this.reportError("Error enqueueing items",t,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this))},xz.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(n){if(n.length){var r={};NF.each(t,function(e){r[e.id]=!0});for(var i=0;i<n.length;i++){var o=n[i];if((new Date).getTime()>o.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):tF.resolve(t)};var kz=function(e,t){var n=[];return NF.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};xz.prototype.removeItemsByID=function(e){var t={};if(NF.each(e,function(e){t[e]=!0}),this.memQueue=kz(this.memQueue,t),this.usePersistence){var n=NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(e){return e=kz(e,t),this.saveToStorage(e)},this)).then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(e){for(var n=0;n<e.length;n++){var r=e[n];if(r.id&&t[r.id])throw new Error("Item not removed from storage")}return!0},this)).catch(NF.bind(function(t){return this.reportError("Error removing items",t,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!qF(this.lock.storage,!0)&&n().then(NF.bind(function(e){return e||this.queueStorage.removeItem(this.storageKey).then(function(){return e})},this)).catch(NF.bind(function(e){return this.reportError("Error clearing queue",e),!1},this))},this))}return tF.resolve(!0)};var Sz=function(e,t){var n=[];return NF.each(e,function(e){var r=e.id;if(r in t){var i=t[r];null!==i&&(e.payload=i,n.push(e))}else n.push(e)}),n};xz.prototype.updatePayloads=function(e){return this.memQueue=Sz(this.memQueue,e),this.usePersistence?this.lock.withLock(NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(t){return t=Sz(t,e),this.saveToStorage(t)},this)).catch(NF.bind(function(t){return this.reportError("Error updating items",e,t),!1},this))},this),this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):tF.resolve(!0)},xz.prototype.readFromStorage=function(){return this.ensureInit().then(NF.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(NF.bind(function(e){return e&&(NF.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(NF.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},xz.prototype.saveToStorage=function(e){return this.ensureInit().then(NF.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(NF.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},xz.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(NF.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):tF.resolve()};var Cz=jF("batch"),Iz=function(e,t){this.errorReporter=t.errorReporter,this.queue=new xz(e,{errorReporter:NF.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Iz.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Iz.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Iz.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Iz.prototype.clear=function(){return this.queue.clear()},Iz.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Iz.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Iz.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(NF.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Iz.prototype.sendRequestPromise=function(e,t){return new tF(NF.bind(function(n){this.sendRequest(e,t,n)},this))},Iz.prototype.flush=function(e){if(this.requestInProgress)return Cz.log("Flush: Request already in progress"),tF.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(NF.bind(function(i){var o=i.length===r,s=[],a={};if(NF.each(i,function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=NF.extend({},t.properties,{mp_sent_by_lib_version:fF.LIB_VERSION}));var n=!0,r=e.id;r?(this.itemIdsSentSuccessfully[r]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[r]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&s.push(t)}a[e.id]=t},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),tF.resolve();var c=NF.bind(function(){return this.queue.removeItemsByID(NF.map(i,function(e){return e.id})).then(NF.bind(function(e){return NF.each(i,NF.bind(function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})},this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),tF.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),tF.resolve())},this))},this),l=NF.bind(function(o){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(NF.isObject(o)&&"timeout"===o.error&&(new Date).getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(NF.isObject(o)&&(o.httpStatusCode>=500||429===o.httpStatusCode||o.httpStatusCode<=0&&(u=cO.navigator.onLine,!NF.isUndefined(u)&&!u)||"timeout"===o.error)){var s=2*this.flushInterval;return o.retryAfter&&(s=1e3*parseInt(o.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),tF.resolve()}if(NF.isObject(o)&&413===o.httpStatusCode){if(i.length>1){var l=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,l,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),tF.resolve()}return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c()}return c()}catch(jHe){this.reportError("Error handling API response",jHe),this.resetFlush()}var u},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),Cz.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(l)},this)).catch(NF.bind(function(e){this.reportError("Error flushing request queue",e),this.resetFlush()},this))},Iz.prototype.reportError=function(e,t){if(Cz.error.apply(Cz.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Cz.error(n)}};var Az=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},Pz=jF("recorder"),Oz=cO.CompressionStream,Mz={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},Tz=new Set([EU.MouseMove,EU.MouseInteraction,EU.Scroll,EU.ViewportResize,EU.Input,EU.TouchMove,EU.MediaInteraction,EU.Drag,EU.Selection]);var Rz=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||XF,this._onMaxLengthReached=e.onMaxLengthReached||XF,this._onBatchSent=e.onBatchSent||XF,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.lastEventTimestamp=e.lastEventTimestamp||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=pF,this.recordMinMs=0;var t=qF(e.sharedLockStorage,!0)&&!this.getConfig("disable_persistence");this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new oz(nz),this.batcher=new Iz(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:Mz,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:250,sharedLockTimeoutMS:1e4})};Rz.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var e={distinct_id:String(this._mixpanel.get_distinct_id())},t=this._mixpanel.get_property("$device_id");t&&(e.$device_id=t);var n=this._mixpanel.get_property("$user_id");return n&&(e.$user_id=n),e},Rz.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.queueStorage.init().catch(function(){this.reportError("Error initializing IndexedDB storage for unloading persisted data.")}.bind(this)).then(function(){return this.getDurationMs()<this._getRecordMinMs()?this.queueStorage.removeItem(this.batcherKey):this.batcher.flush().then(function(){return this.queueStorage.removeItem(this.batcherKey)}.bind(this))}.bind(this))},Rz.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Rz.prototype.get_config=function(e){return this.getConfig(e)},Rz.prototype.startRecording=function(e){if(null!==this._rrwebRecord)if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>pF&&(this.recordMaxMs=pF,Pz.critical("record_max_ms cannot be greater than "+pF+"ms. Capping value.")),this.maxExpires||(this.maxExpires=(new Date).getTime()+this.recordMaxMs),this.recordMinMs=this._getRecordMinMs(),this.replayStartTime||(this.replayStartTime=(new Date).getTime(),this.batchStartUrl=NF.info.currentUrl(),this.replayStartUrl=NF.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=function(){clearTimeout(this.idleTimeoutId);var e=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,e),this.idleExpires=(new Date).getTime()+e}.bind(this);t();var n,r=this.getConfig("record_block_selector");""!==r&&null!==r||(r=void 0);try{this._stopRecording=this._rrwebRecord({emit:function(e){this.idleExpires&&this.idleExpires<e.timestamp?this._onIdleTimeout():(function(e){return e.type===_U.IncrementalSnapshot&&Tz.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(e),(null===this.lastEventTimestamp||e.timestamp>this.lastEventTimestamp)&&(this.lastEventTimestamp=e.timestamp))}.bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15},plugins:this.getConfig("record_console")?[(n={stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:50,depthOfLimit:2}},{name:"rrweb/console@1",observer:D$,options:n})]:[]})}catch(jHe){this.reportError("Unexpected error when starting rrweb recording.",jHe)}if("function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();var i=this.maxExpires-(new Date).getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),i)}else Pz.log("Recording already in progress, skipping startRecording.");else this.reportError("rrweb record function not provided. ")},Rz.prototype.stopRecording=function(e){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(jHe){this.reportError("Error with rrweb stopRecording",jHe)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},Rz.prototype.isRrwebStopped=function(){return null===this._stopRecording},Rz.prototype.flushEventsWithOptOut=function(e,t,n){var r=function(e){0===e&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}.bind(this);this._flushEvents(e,t,n,r)},Rz.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(qAe){this.reportError("Error getting tab ID for serialization ",qAe),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,lastEventTimestamp:this.lastEventTimestamp,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},Rz.deserialize=function(e,t){return new Rz(NF.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,lastEventTimestamp:e.lastEventTimestamp,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}))},Rz.prototype._sendRequest=function(e,t,n,r){var i=function(t,n){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=NF.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}.bind(this),o=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");cO.fetch(o+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(e){e.json().then(function(t){i(e,t)}).catch(function(e){r({error:e})})}).catch(function(e){r({error:e,httpStatusCode:0})})},Rz.prototype._flushEvents=uz(function(e,t,n){var r=e.length;if(r>0){for(var i=this.replayId,o=1/0,s=-1/0,a=!1,c=0;c<r;c++)o=Math.min(o,e[c].timestamp),s=Math.max(s,e[c].timestamp),e[c].type===_U.FullSnapshot&&(a=!0);if(0===this.seqNo){if(!a)return n({error:"First batch does not contain a full snapshot. Aborting recording."}),void this.stopRecording(!0);this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var l=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:fF.LIB_VERSION,batch_start_time:o/1e3,mp_lib:"web",replay_id:i,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(e);if(Object.assign(u,this.getUserIdInfo()),function(e,t,n){if(!cO.CompressionStream)return!1;var r=NF.info.browser(e,t,n),i=NF.info.browserVersion(e,t,n);return!(("Safari"===r||"Mobile Safari"===r)&&i>=16.4&&i<16.6)}(IF,xF.vendor,SF)){var h=new Blob([d],{type:"application/json"}).stream().pipeThrough(new Oz("gzip"));new Response(h).blob().then(function(e){u.format="gzip",this._sendRequest(i,u,e,n)}.bind(this))}else u.format="body",this._sendRequest(i,u,d,n)}}),Rz.prototype.reportError=function(e,t){Pz.error.apply(Pz.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Pz.error(n)}},Rz.prototype.getDurationMs=function(){return null===this.replayStartTime?0:null===this.lastEventTimestamp?(new Date).getTime()-this.replayStartTime:this.lastEventTimestamp-this.replayStartTime},Rz.prototype._getRecordMinMs=function(){var e=this.getConfig("record_min_ms");return e>mF?(Pz.critical("record_min_ms cannot be greater than 8000ms. Capping value."),mF):e};var Nz=function(e){this.idb=new oz(rz),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};Nz.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config("disable_persistence")},Nz.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},Nz.prototype.setActiveRecording=function(e){if(!this.isPersistenceEnabled())return tF.resolve();var t=e.tabId;return t?this.idb.init().then(function(){return this.idb.setItem(t,e)}.bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),tF.resolve())},Nz.prototype.getActiveRecording=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}.bind(this)).then(function(e){return Az(e)?null:e}.bind(this)).catch(this.handleError.bind(this)):tF.resolve(null)},Nz.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},Nz.prototype.markActiveRecordingExpired=function(){return this.getActiveRecording().then(function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}.bind(this)).catch(this.handleError.bind(this))},Nz.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):tF.resolve()},Nz.prototype.flushInactiveRecordings=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getAll()}.bind(this)).then(function(e){var t=e.filter(function(e){return Az(e)}).map(function(e){return Rz.deserialize(e,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage}).unloadPersistedData().then(function(){return this.idb.removeItem(e.tabId)}.bind(this)).catch(this.handleError.bind(this))}.bind(this));return tF.all(t)}.bind(this)).catch(this.handleError.bind(this)):tF.resolve([])};var Lz=jF("recorder"),Bz=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||S$,this.sharedLockStorage=n,this.recordingRegistry=new Nz({mixpanelInstance:this.mixpanelInstance,errorReporter:Lz.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Bz.prototype.startRecording=function(e){if(e=e||{},!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=function(){Lz.log("Idle timeout reached, restarting recording."),this.resetRecording()}.bind(this),n=function(){Lz.log("Max recording length reached, stopping recording."),this.resetRecording()}.bind(this),r=function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}.bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:t,onMaxLengthReached:n,replayId:NF.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=Rz.deserialize(e.activeSerializedRecording,i):this.activeRecording=new Rz(i),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())}Lz.log("Recording already in progress, skipping startRecording.")},Bz.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then(function(){return this.recordingRegistry.clearActiveRecording()}.bind(this)).then(function(){this.stopRecordingInProgress=!1}.bind(this))},Bz.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Bz.prototype._stopCurrentRecording=function(e,t){if(this.activeRecording){var n=this.activeRecording.stopRecording(e);return t&&(this.activeRecording=null),n}return tF.resolve()},Bz.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),tF.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(t){return t&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Lz.log("No resumable recording found."),null)}.bind(this))},Bz.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Bz.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Bz.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),cO.__mp_recorder=Bz;var jz="change",Dz="click",Uz="hashchange",$z="load",Fz="mp_locationchange",zz="popstate",qz="scrollend",Hz="scroll",Wz="submit",Kz="visibilitychange",Vz=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],Gz=["mp-include"],Zz=["mp-no-track"],Yz=Zz.concat(["mp-sensitive"]),Jz=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Qz={button:!0,checkbox:!0,combobox:!0,grid:!0,link:!0,listbox:!0,menu:!0,menubar:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,navigation:!0,option:!0,radio:!0,radiogroup:!0,searchbox:!0,slider:!0,spinbutton:!0,switch:!0,tab:!0,tablist:!0,textbox:!0,tree:!0,treegrid:!0,treeitem:!0},Xz={base:!0,head:!0,html:!0,link:!0,meta:!0,script:!0,style:!0,title:!0,br:!0,hr:!0,wbr:!0,noscript:!0,picture:!0,source:!0,template:!0,track:!0},eq={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},tq=["onclick","onmousedown","onmouseup","onpointerdown","onpointerup","ontouchend","ontouchstart"],nq=jF("autocapture");function rq(e){for(var t={},n=iq(e).split(" "),r=0;r<n.length;r++){var i=n[r];i&&(t[i]=!0)}return t}function iq(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function oq(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!dq(e));return e}function sq(e,t,n,r,i,o){var s={$classes:iq(e).split(" "),$tag_name:e.tagName.toLowerCase()},a=e.id;a&&(s.$id=a),pq(e,t,i,o)&&NF.each(Jz.concat(r),function(t){if(e.hasAttribute(t)&&!n[t]){var r=e.getAttribute(t);mq(r)&&(s["$attr-"+t]=r)}});for(var c=1,l=1,u=e;u=oq(u);)c++,u.tagName===e.tagName&&l++;return s.$nth_child=c,s.$nth_of_type=l,s}function aq(e,t){var n=t.allowElementCallback,r=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,c=t.captureExtraAttrs||[],l=t.capturedForHeatMap||!1,u={};NF.each(i,function(e){u[e]=!0});var d=null,h=void 0===e.target?e.srcElement:e.target;if(fq(h)&&(h=h.parentNode),function(e,t){if(!e||hq(e,"html")||!dq(e))return!1;switch(e.tagName.toLowerCase()){case"form":return t.type===Wz;case"input":return-1===["button","submit"].indexOf(e.getAttribute("type"))?t.type===jz:t.type===Dz;case"select":case"textarea":return t.type===jz;default:return t.type===Dz}}(h,e)&&lq(h,e,n,r)&&!uq(h,e,o,s)){for(var f=[h],p=h;p.parentNode&&!hq(p,"body");)f.push(p.parentNode),p=p.parentNode;var m,g=[],y=!1;if(NF.each(f,function(t){var i=pq(t,e,n,r);u.href||"a"!==t.tagName.toLowerCase()||(m=t.getAttribute("href"),m=i&&mq(m)&&m),uq(t,e,o,s)&&(y=!0),g.push(sq(t,e,u,c,n,r))},this),!y){var b=kF.documentElement;if(d={$event_type:e.type,$host:cO.location.host,$pathname:cO.location.pathname,$elements:g,$el_attr__href:m,$viewportHeight:Math.max(b.clientHeight,cO.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,cO.innerWidth||0),$pageHeight:kF.body.offsetHeight||0,$pageWidth:kF.body.offsetWidth||0},NF.each(c,function(e){if(!u[e]&&h.hasAttribute(e)){var t=h.getAttribute(e);mq(t)&&(d["$el_attr__"+e]=t)}}),a&&(v=cq(h,e,n,r))&&v.length&&(d.$el_text=v),e.type===Dz&&(NF.each(Vz,function(t){t in e&&(d["$"+t]=e[t])}),l&&(d.$captured_for_heatmap=!0),h=function(e){for(var t=e.target,n=e.composedPath(),r=0;r<n.length;r++){var i=n[r];if(hq(i,"a")||hq(i,"button")||hq(i,"input")||hq(i,"select")||i.getAttribute&&"button"===i.getAttribute("role")){t=i;break}if(i===t)break}return t}(e)),a){var v=cq(h,e,n,r);v&&v.length&&(d.$el_text=v)}if(h){if(!lq(h,e,n,r)||uq(h,e,o,s))return null;var w=sq(h,e,u,c,n,r);d.$target=w,d.$el_classes=w.$classes,NF.extend(d,NF.strip_empty_properties({$el_id:w.$id,$el_tag_name:w.$tag_name}))}}}return d}function cq(e,t,n,r){var i="";return pq(e,t,n,r)&&e.childNodes&&e.childNodes.length&&NF.each(e.childNodes,function(e){fq(e)&&e.textContent&&(i+=NF.trim(e.textContent).split(/(\s+)/).filter(mq).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),NF.trim(i)}function lq(e,t,n,r){if(n)try{if(!n(e,t))return!1}catch(jHe){return nq.critical("Error while checking element in allowElementCallback",jHe),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(jHe){nq.critical("Error while checking selector: "+o,jHe)}}return!1}function uq(e,t,n,r){var i;if(n)try{if(n(e,t))return!0}catch(jHe){return nq.critical("Error while checking element in blockElementCallback",jHe),!0}if(r&&r.length)for(i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(jHe){nq.critical("Error while checking selector: "+o,jHe)}}var s=rq(e);for(i=0;i<Zz.length;i++)if(s[Zz[i]])return!0;return!1}function dq(e){return e&&1===e.nodeType}function hq(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function fq(e){return e&&3===e.nodeType}function pq(e,t,n,r){var i;if(!lq(e,t,n,r))return!1;for(var o=e;o.parentNode&&!hq(o,"body");o=o.parentNode){var s=rq(o);for(i=0;i<Yz.length;i++)if(s[Yz[i]])return!1}var a=rq(e);for(i=0;i<Gz.length;i++)if(a[Gz[i]])return!0;if(hq(e,"input")||hq(e,"select")||hq(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;var c=e.type||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var l=e.name||e.id||"";if("string"==typeof l){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function mq(e){if(null===e||NF.isUndefined(e))return!1;if("string"==typeof e){e=NF.trim(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function gq(e){var t="onscrollend"in cO,n=DF(e),r=qz;if(!t){var i=null;n=DF(function(){clearTimeout(i),i=setTimeout(e,100)}),r=Hz}return{listener:n,eventType:r}}function yq(e){var t=e.tagName.toLowerCase();return"button"===t||"input"===t||"select"===t||"textarea"===t||"details"===t||"dialog"===t||(!!e.isContentEditable||(!!(e.onclick||e.onmousedown||e.onmouseup||e.ontouchstart||e.ontouchend)||(!!function(e){for(var t=0;t<tq.length;t++)if(e.hasAttribute(tq[t]))return!0;return!1}(e)||(!!function(e){var t=e.getAttribute("role");if(!t)return!1;var n=t.trim().split(/\s+/)[0].toLowerCase();return Qz[n]}(e)||(!("a"!==t||!e.hasAttribute("href"))||!!e.hasAttribute("tabindex"))))))}function bq(e){if(!e||!e.tagName)return!0;var t=e.tagName.toLowerCase();if(Xz[t])return!0;if(yq(e))return!1;for(var n=e.parentElement,r=0;n&&r<5;){if(yq(n))return!1;if(n.getRootNode&&n.getRootNode()!==kF){var i=n.getRootNode();if(i.host&&yq(i.host))return!1}n=n.parentElement,r++}return!!eq[t]}function vq(e){return"composedPath"in e?e.composedPath():[]}function wq(e){var t=vq(e);return t&&t.length>0?t[0]:e.target||e.srcElement}function _q(){this.clicks=[]}function Eq(e,t){this.changeCallback=e||function(){},this.observerConfig=t,this.observedShadowRoots=null,this.shadowObservers=[]}_q.prototype.isRageClick=function(e,t){var n=(t=t||{}).threshold_px||30,r=t.timeout_ms||1e3,i=t.click_count||4;if(t.interactive_elements_only||false){var o=wq(e);if(!o||bq(o))return!1}var s=Date.now(),a=e.pageX,c=e.pageY,l=this.clicks[this.clicks.length-1];if(l&&s-l.timestamp<r&&Math.sqrt(Math.pow(a-l.x,2)+Math.pow(c-l.y,2))<n){if(this.clicks.push({x:a,y:c,timestamp:s}),this.clicks.length>=i)return this.clicks=[],!0}else this.clicks=[{x:a,y:c,timestamp:s}];return!1},Eq.prototype.getEventTarget=function(e){if(this.observedShadowRoots)return wq(e)},Eq.prototype.observeFromEvent=function(e){if(this.observedShadowRoots)for(var t=vq(e),n=0;n<t.length;n++){var r=t[n];r&&r.shadowRoot&&this.observeShadowRoot(r.shadowRoot)}},Eq.prototype.observeShadowRoot=function(e){if(this.observedShadowRoots&&!this.observedShadowRoots.has(e)){var t=this;try{this.observedShadowRoots.add(e);var n=new window.MutationObserver(function(){t.changeCallback()});n.observe(e,this.observerConfig),this.shadowObservers.push(n)}catch(qAe){nq.critical("Error while observing shadow root",qAe)}}},Eq.prototype.start=function(){this.observedShadowRoots||("undefined"!=typeof WeakSet?this.observedShadowRoots=new WeakSet:nq.critical("Shadow DOM observation unavailable: WeakSet not supported"))},Eq.prototype.stop=function(){if(this.observedShadowRoots){for(var e=0;e<this.shadowObservers.length;e++)try{this.shadowObservers[e].disconnect()}catch(qAe){nq.critical("Error while disconnecting shadow DOM observer",qAe)}this.shadowObservers=[],this.observedShadowRoots=null}};var xq=[jz,"input",Wz,"select","toggle"],kq=[qz],Sq=[Uz],Cq={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","checked","selected","value","display","visibility"]};function Iq(e){this.eventListeners=[],this.mutationObserver=null,this.shadowDOMObserver=null,this.isTracking=!1,this.lastChangeEventTimestamp=0,this.pendingClicks=[],this.onDeadClickCallback=e,this.processingActive=!1,this.processingTimeout=null}Iq.prototype.addClick=function(e){var t=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(e);return t||(t=e.target||e.srcElement),!(!t||bq(t))&&(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(e),this.pendingClicks.push({element:t,event:e,timestamp:Date.now()}),!0)},Iq.prototype.trackClick=function(e,t){if(!this.isTracking)return!1;var n=this.addClick(e);return n&&this.triggerProcessing(t),n},Iq.prototype.getDeadClicks=function(e){if(0===this.pendingClicks.length)return[];var t=e.timeout_ms,n=Date.now(),r=this.pendingClicks.slice();this.pendingClicks=[];for(var i=[],o=0;o<r.length;o++){var s=r[o];n-s.timestamp>=t?this.hasChangesAfter(s.timestamp)||i.push(s):this.pendingClicks.push(s)}return i},Iq.prototype.hasChangesAfter=function(e){return this.lastChangeEventTimestamp>=e-100},Iq.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},Iq.prototype.triggerProcessing=function(e){this.processingActive||(this.processingActive=!0,this.processRecursively(e))},Iq.prototype.processRecursively=function(e){if(this.isTracking&&this.onDeadClickCallback){var t=e.timeout_ms,n=this;this.processingTimeout=setTimeout(function(){if(n.processingActive){for(var t=n.getDeadClicks(e),r=0;r<t.length;r++)n.onDeadClickCallback(t[r].event);n.pendingClicks.length>0?n.processRecursively(e):n.processingActive=!1}},t)}else this.processingActive=!1},Iq.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var e=this;xq.forEach(function(t){var n=function(){e.recordChangeEvent()};document.addEventListener(t,n,{capture:!0,passive:!0}),e.eventListeners.push({target:document,event:t,handler:n,options:{capture:!0,passive:!0}})}),Sq.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n),e.eventListeners.push({target:window,event:t,handler:n})}),kq.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n,{passive:!0}),e.eventListeners.push({target:window,event:t,handler:n,options:{passive:!0}})});var t=function(){e.recordChangeEvent()};if(document.addEventListener("selectionchange",t),e.eventListeners.push({target:document,event:"selectionchange",handler:t}),window.MutationObserver)try{this.mutationObserver=new window.MutationObserver(function(){e.recordChangeEvent()}),this.mutationObserver.observe(document.body||document.documentElement,Cq)}catch(qAe){nq.critical("Error while setting up mutation observer",qAe)}if(window.customElements)try{this.shadowDOMObserver=new Eq(function(){e.recordChangeEvent()},Cq),this.shadowDOMObserver.start()}catch(qAe){nq.critical("Error while setting up shadow DOM observer",qAe),this.shadowDOMObserver=null}}},Iq.prototype.stopTracking=function(){if(this.isTracking){this.isTracking=!1,this.pendingClicks=[],this.lastChangeEventTimestamp=0,this.processingActive=!1,this.processingTimeout&&(clearTimeout(this.processingTimeout),this.processingTimeout=null);for(var e=0;e<this.eventListeners.length;e++){var t=this.eventListeners[e];try{t.target.removeEventListener(t.event,t.handler,t.options)}catch(qAe){nq.critical("Error while removing event listener",qAe)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(qAe){nq.critical("Error while disconnecting mutation observer",qAe)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(qAe){nq.critical("Error while stopping shadow DOM observer",qAe)}this.shadowDOMObserver=null}}};var Aq="autocapture",Pq="full-url",Oq="allow_selectors",Mq="allow_url_regexes",Tq="block_attrs",Rq="block_element_callback",Nq="block_selectors",Lq="block_url_regexes",Bq="capture_extra_attrs",jq="capture_text_content",Dq="scroll_capture_all",Uq="scroll_depth_percent_checkpoints",$q="click",Fq="dead_click",zq="input",qq="pageview",Hq="rage_click",Wq="scroll",Kq="page_leave",Vq="submit",Gq={};Gq[Oq]=[],Gq[Mq]=[],Gq[Tq]=[],Gq[Rq]=null,Gq[Nq]=[],Gq[Lq]=[],Gq[Bq]=[],Gq[jq]=!1,Gq[Dq]=!1,Gq[Uq]=[25,50,75,100],Gq[$q]=!0,Gq[Fq]=!0,Gq[zq]=!0,Gq[qq]=Pq,Gq[Hq]=!0,Gq[Wq]=!0,Gq[Kq]=!1,Gq[Vq]=!0;var Zq={$mp_autocapture:!0},Yq="$mp_click",Jq="$mp_dead_click",Qq="$mp_rage_click",Xq=function(e){this.mp=e,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};Xq.prototype.init=function(){!function(){try{return!!kF.createElement("div").matches}catch(jHe){return!1}}()?nq.critical("Autocapture unavailable: missing required DOM APIs"):(this.initPageListeners(),this.initPageviewTracking(),this.initClickTracking(),this.initDeadClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking(),this.initPageLeaveTracking())},Xq.prototype.getFullConfig=function(){var e=this.mp.get_config(Aq);return e?NF.isObject(e)?NF.extend({},Gq,e):Gq:{}},Xq.prototype.getConfig=function(e){return this.getFullConfig()[e]},Xq.prototype.currentUrlBlocked=function(){var e,t=NF.info.currentUrl(),n=this.getConfig(Mq)||[];if(n.length){var r=!1;for(e=0;e<n.length;e++){var i=n[e];try{if(t.match(i)){r=!0;break}}catch(jHe){return nq.critical("Error while checking block URL regex: "+i,jHe),!0}}if(!r)return!0}var o=this.getConfig(Lq)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(jHe){return nq.critical("Error while checking block URL regex: "+o[e],jHe),!0}return!1},Xq.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(Aq)?this.getConfig(qq):this.mp.get_config("track_pageview")},Xq.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=this.mp.is_recording_heatmap_data()&&(t===Yq&&!this.getConfig($q)||t===Qq&&!this._getClickTrackingConfig(Hq)||t===Jq&&!this._getClickTrackingConfig(Fq)),r=aq(e,{allowElementCallback:this.getConfig("allow_element_callback"),allowSelectors:this.getConfig(Oq),blockAttrs:this.getConfig(Tq),blockElementCallback:this.getConfig(Rq),blockSelectors:this.getConfig(Nq),captureExtraAttrs:this.getConfig(Bq),captureTextContent:this.getConfig(jq),capturedForHeatMap:n});r&&(NF.extend(r,Zq),this.mp.track(t,r))}},Xq.prototype.initPageListeners=function(){if(cO.removeEventListener(zz,this.listenerPopstate),cO.removeEventListener(Uz,this.listenerHashchange),this.pageviewTrackingConfig()||this.getConfig(Kq)||this.mp.get_config("record_heatmap_data")){this.listenerPopstate=function(){cO.dispatchEvent(new Event(Fz))},this.listenerHashchange=function(){cO.dispatchEvent(new Event(Fz))},cO.addEventListener(zz,this.listenerPopstate),cO.addEventListener(Uz,this.listenerHashchange);var e=cO.history.pushState;"function"==typeof e&&(cO.history.pushState=function(t,n,r){e.call(cO.history,t,n,r),cO.dispatchEvent(new Event(Fz))});var t=cO.history.replaceState;"function"==typeof t&&(cO.history.replaceState=function(e,n,r){t.call(cO.history,e,n,r),cO.dispatchEvent(new Event(Fz))})}},Xq.prototype._getClickTrackingConfig=function(e){var t=this.getConfig(e);return t?!0===t?{}:"object"==typeof t?t:{}:null},Xq.prototype._trackPageLeave=function(e,t,n){if(!this.hasTrackedScrollSession&&(this.getConfig(Kq)||this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var r=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0),i=Math.round(Math.max(this.maxScrollViewDepth-r,0)/(n-r)*100),o=Math.round(r/n*100);n<=r&&(i=100,o=100);var s=NF.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:i,$fold_line_percentage:o,$scroll_height:n,$event_type:e.type,$current_url:t||NF.info.currentUrl(),$viewportHeight:r,$viewportWidth:Math.max(kF.documentElement.clientWidth,cO.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},Zq);this.mp.track("$mp_page_leave",s,{transport:"sendBeacon"})}},Xq.prototype._initScrollDepthTracking=function(){if(cO.removeEventListener(Hz,this.listenerScrollDepth),cO.removeEventListener(qz,this.listenerScrollDepth),this.mp.get_config("record_heatmap_data")){nq.log("Initializing scroll depth tracking"),this.maxScrollViewDepth=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0);var e=gq(function(){if(!this.currentUrlBlocked()){var e=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0)+cO.scrollY;e>this.maxScrollViewDepth&&(this.maxScrollViewDepth=e),this.previousScrollHeight=kF.body.scrollHeight}}.bind(this));this.listenerScrollDepth=e.listener,cO.addEventListener(e.eventType,this.listenerScrollDepth)}},Xq.prototype.initClickTracking=function(){cO.removeEventListener(Dz,this.listenerClick),(this.getConfig($q)||this.mp.get_config("record_heatmap_data"))&&(nq.log("Initializing click tracking"),this.listenerClick=function(e){(this.getConfig($q)||this.mp.is_recording_heatmap_data())&&this.trackDomEvent(e,Yq)}.bind(this),cO.addEventListener(Dz,this.listenerClick))},Xq.prototype.initDeadClickTracking=function(){this._getClickTrackingConfig(Fq)||this.mp.get_config("record_heatmap_data")?(nq.log("Initializing dead click tracking"),this._deadClickTracker||(this._deadClickTracker=new Iq(function(e){this.trackDomEvent(e,Jq)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(e){var t=this._getClickTrackingConfig(Fq);if((t||this.mp.is_recording_heatmap_data())&&!this.currentUrlBlocked()){var n=t||{};n.timeout_ms||(n.timeout_ms=500),this._deadClickTracker.trackClick(e,n)}}.bind(this),cO.addEventListener(Dz,this.listenerDeadClick))):this.stopDeadClickTracking()},Xq.prototype.initInputTracking=function(){cO.removeEventListener(jz,this.listenerChange),this.getConfig(zq)&&(nq.log("Initializing input tracking"),this.listenerChange=function(e){this.getConfig(zq)&&this.trackDomEvent(e,"$mp_input_change")}.bind(this),cO.addEventListener(jz,this.listenerChange))},Xq.prototype.initPageviewTracking=function(){if(cO.removeEventListener(Fz,this.listenerLocationchange),this.pageviewTrackingConfig()){nq.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(Zq)),t&&(e=NF.info.currentUrl()),this.listenerLocationchange=DF(function(){if(!this.currentUrlBlocked()){var t=NF.info.currentUrl(),n=!1,r=t.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],i=this.pageviewTrackingConfig();if(i===Pq?n=t!==e:"url-with-path-and-query-string"===i?n=t.split("#")[0]!==e.split("#")[0]:"url-with-path"===i&&(n=r),n)this.mp.track_pageview(Zq)&&(e=t),r&&(this.lastScrollCheckpoint=0,nq.log("Path change: re-initializing scroll depth checkpoints"))}}.bind(this)),cO.addEventListener(Fz,this.listenerLocationchange)}},Xq.prototype.initRageClickTracking=function(){cO.removeEventListener(Dz,this.listenerRageClick),(this._getClickTrackingConfig(Hq)||this.mp.get_config("record_heatmap_data"))&&(nq.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new _q),this.listenerRageClick=function(e){var t=this._getClickTrackingConfig(Hq);(t||this.mp.is_recording_heatmap_data())&&(this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e,t)&&this.trackDomEvent(e,Qq))}.bind(this),cO.addEventListener(Dz,this.listenerRageClick))},Xq.prototype.initScrollTracking=function(){if(cO.removeEventListener(qz,this.listenerScroll),cO.removeEventListener(Hz,this.listenerScroll),this.getConfig(Wq)){nq.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0;var e=function(){if(this.getConfig(Wq)&&!this.currentUrlBlocked()){var e=this.getConfig(Dq),t=(this.getConfig(Uq)||[]).slice().sort(function(e,t){return e-t}),n=cO.scrollY,r=NF.extend({$scroll_top:n},Zq);try{var i=kF.body.scrollHeight,o=Math.round(n/(i-cO.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(r.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,e=!0)}}catch(jHe){nq.critical("Error while calculating scroll percentage",jHe)}e&&this.mp.track("$mp_scroll",r)}}.bind(this),t=gq(e);this.listenerScroll=t.listener,cO.addEventListener(t.eventType,this.listenerScroll)}},Xq.prototype.initSubmitTracking=function(){cO.removeEventListener(Wz,this.listenerSubmit),this.getConfig(Vq)&&(nq.log("Initializing submit tracking"),this.listenerSubmit=function(e){this.getConfig(Vq)&&this.trackDomEvent(e,"$mp_submit")}.bind(this),cO.addEventListener(Wz,this.listenerSubmit))},Xq.prototype.initPageLeaveTracking=function(){if(kF.removeEventListener(Kz,this.listenerPageLeaveVisibilitychange),cO.removeEventListener(Fz,this.listenerPageLeaveLocationchange),cO.removeEventListener($z,this.listenerPageLoad),this.getConfig(Kq)||this.mp.get_config("record_heatmap_data")){nq.log("Initializing page visibility tracking."),this._initScrollDepthTracking();var e=NF.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=kF.body.scrollHeight}.bind(this),cO.addEventListener($z,this.listenerPageLoad),this.listenerPageLeaveLocationchange=DF(function(t){if(!this.currentUrlBlocked()){var n=NF.info.currentUrl();n!==e&&(this._trackPageLeave(t,e,this.previousScrollHeight),e=n,this.maxScrollViewDepth=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0),this.previousScrollHeight=kF.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),cO.addEventListener(Fz,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(t){kF.hidden&&this._trackPageLeave(t,e,this.previousScrollHeight)}.bind(this),kF.addEventListener(Kz,this.listenerPageLeaveVisibilitychange)}},Xq.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(cO.removeEventListener(Dz,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},UF(Xq);var eH=jF("flags"),tH="flags",nH="context",rH={};rH[nH]={};var iH=function(e){this.fetch=cO.fetch,this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};iH.prototype.init=function(){this.minApisSupported()?(this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set):eH.critical("Feature Flags unavailable: missing minimum required APIs")},iH.prototype.getFullConfig=function(){var e=this.getMpConfig(tH);return e?NF.isObject(e)?NF.extend({},rH,e):rH:{}},iH.prototype.getConfig=function(e){return this.getFullConfig()[e]},iH.prototype.isSystemEnabled=function(){return!!this.getMpConfig(tH)},iH.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return eH.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var n=this.getMpConfig(tH);NF.isObject(n)||(n={});var r=t&&t.replace?{}:this.getConfig(nH);return n[nH]=NF.extend({},r,e),this.setMpConfig(tH,n),this.fetchFlags()},iH.prototype.areFlagsReady=function(){return this.isSystemEnabled()||eH.error("Feature Flags not enabled"),!!this.flags},iH.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id"),n="00-"+NF.UUID().replace(/-/g,"")+"-"+NF.UUID().replace(/-/g,"").substring(0,16)+"-01";eH.log("Fetching flags for distinct ID: "+e);var r=NF.extend({distinct_id:e,device_id:t},this.getConfig(nH)),i=new URLSearchParams;i.set("context",JSON.stringify(r)),i.set("token",this.getMpConfig("token")),i.set("mp_lib","web"),i.set("$lib_version",fF.LIB_VERSION);var o=this.getFullApiRoute()+"?"+i.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(cO,o,{method:"GET",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),traceparent:n}}).then(function(e){return this.markFetchComplete(),e.json().then(function(e){var t=e.flags;if(!t)throw new Error("No flags in API response");var r=new Map;NF.each(t,function(e,t){r.set(t,{key:e.variant_key,value:e.variant_value,experiment_id:e.experiment_id,is_experiment_active:e.is_experiment_active,is_qa_tester:e.is_qa_tester})}),this.flags=r,this._traceparent=n}.bind(this)).catch(function(e){this.markFetchComplete(),eH.error(e)}.bind(this))}.bind(this)).catch(function(e){this.markFetchComplete(),eH.error(e)}.bind(this)),this.fetchPromise},iH.prototype.markFetchComplete=function(){this._fetchInProgressStartTime?(this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null):eH.error("Fetch in progress started time not set, cannot mark fetch complete")},iH.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(e,t)}.bind(this)).catch(function(e){return eH.error(e),t}):new Promise(function(e){eH.critical("Feature Flags not initialized"),e(t)})},iH.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return eH.log("Flags not loaded yet"),t;var n=this.flags.get(e);return n?(this.trackFeatureCheck(e,n),n):(eH.log('No flag found: "'+e+'"'),t)},iH.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(e){return e.value}).catch(function(e){return eH.error(e),t})},iH.prototype.getFeatureData=function(e,t){return eH.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(e,t)},iH.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value},iH.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then(function(){return this.isEnabledSync(e,t)}.bind(this)).catch(function(e){return eH.error(e),t})},iH.prototype.isEnabledSync=function(e,t){t=t||!1;var n=this.getVariantValueSync(e,t);return!0!==n&&!1!==n&&(eH.error('Feature flag "'+e+'" value: '+n+" is not a boolean; returning fallback value: "+t),n=t),n},iH.prototype.trackFeatureCheck=function(e,t){if(!this.trackedFeatures.has(e)){this.trackedFeatures.add(e);var n={"Experiment name":e,"Variant name":t.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency,"Variant fetch traceparent":this._traceparent};"undefined"!==t.experiment_id&&(n.$experiment_id=t.experiment_id),"undefined"!==t.is_experiment_active&&(n.$is_experiment_active=t.is_experiment_active),"undefined"!==t.is_qa_tester&&(n.$is_qa_tester=t.is_qa_tester),this.track("$experiment_started",n)}},iH.prototype.minApisSupported=function(){return!!this.fetch&&"undefined"!=typeof Promise&&"undefined"!=typeof Map&&"undefined"!=typeof Set},UF(iH),iH.prototype.are_flags_ready=iH.prototype.areFlagsReady,iH.prototype.get_variant=iH.prototype.getVariant,iH.prototype.get_variant_sync=iH.prototype.getVariantSync,iH.prototype.get_variant_value=iH.prototype.getVariantValue,iH.prototype.get_variant_value_sync=iH.prototype.getVariantValueSync,iH.prototype.is_enabled=iH.prototype.isEnabled,iH.prototype.is_enabled_sync=iH.prototype.isEnabledSync,iH.prototype.update_context=iH.prototype.updateContext,iH.prototype.get_feature_data=iH.prototype.getFeatureData;var oH=function(){};oH.prototype.create_properties=function(){},oH.prototype.event_handler=function(){},oH.prototype.after_track_handler=function(){},oH.prototype.init=function(e){return this.mp=e,this},oH.prototype.track=function(e,t,n,r){var i=this,o=NF.dom_query(e);if(0!==o.length)return NF.each(o,function(e){NF.register_event(e,this.override_event,function(e){var o={},s=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,o),window.setTimeout(i.track_callback(r,s,o,!0),a),i.mp.track(t,s,i.track_callback(r,s,o))})},this),!0;LF.error("The DOM query ("+e+") returned 0 elements")},oH.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||i.after_track_handler(t,n,r))}},oH.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):NF.extend({},e)};var sH=function(){this.override_event="click"};NF.inherit(sH,oH),sH.prototype.create_properties=function(e,t){var n=sH.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},sH.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},sH.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var aH=function(){this.override_event="submit"};NF.inherit(aH,oH),aH.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},aH.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var cH="$set",lH="$set_once",uH="$unset",dH="$add",hH="$append",fH="$union",pH="$remove",mH={set_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[cH]=r,n},unset_action:function(e){var t={},n=[];return NF.isArray(e)||(e=[e]),NF.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[uH]=n,t},set_once_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[lH]=r,n},union_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=NF.isArray(e)?e:[e])},this):r[e]=NF.isArray(t)?t:[t],n[fH]=r,n},append_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[hH]=r,n},remove_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[pH]=r,n},delete_action:function(){var e={$delete:""};return e}},gH=function(){};NF.extend(gH.prototype,mH),gH.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},gH.prototype.set=hz(function(e,t,n){var r=this.set_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),gH.prototype.set_once=hz(function(e,t,n){var r=this.set_once_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),gH.prototype.unset=hz(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),gH.prototype.union=hz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),gH.prototype.delete=hz(function(e){var t=this.delete_action();return this._send_request(t,e)}),gH.prototype.remove=hz(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),gH.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=NF.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},gH.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},gH.prototype._get_config=function(e){return this._mixpanel.get_config(e)},gH.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},gH.prototype.remove=gH.prototype.remove,gH.prototype.set=gH.prototype.set,gH.prototype.set_once=gH.prototype.set_once,gH.prototype.union=gH.prototype.union,gH.prototype.unset=gH.prototype.unset,gH.prototype.toString=gH.prototype.toString;var yH=function(){};NF.extend(yH.prototype,mH),yH.prototype._init=function(e){this._mixpanel=e},yH.prototype.set=dz(function(e,t,n){var r=this.set_action(e,t);return NF.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[cH]=NF.extend({},NF.info.people_properties(),r[cH]),this._send_request(r,n)}),yH.prototype.set_once=dz(function(e,t,n){var r=this.set_once_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),yH.prototype.unset=dz(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),yH.prototype.increment=dz(function(e,t,n){var r={},i={};return NF.isObject(e)?(NF.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void LF.error("Invalid increment value passed to mixpanel.people.increment - must be a number");i[t]=e}},this),n=t):(NF.isUndefined(t)&&(t=1),i[e]=t),r[dH]=i,this._send_request(r,n)}),yH.prototype.append=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),yH.prototype.remove=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),yH.prototype.union=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),yH.prototype.track_charge=dz(function(){LF.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),yH.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},yH.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}LF.error("mixpanel.people.delete_user() requires you to call identify() first")},yH.prototype.toString=function(){return this._mixpanel.toString()+".people"},yH.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=NF.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),NF.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),NF.truncate(o,255))},yH.prototype._get_config=function(e){return this._mixpanel.get_config(e)},yH.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},yH.prototype._enqueue=function(e){cH in e?this._mixpanel.persistence._add_to_people_queue(cH,e):lH in e?this._mixpanel.persistence._add_to_people_queue(lH,e):uH in e?this._mixpanel.persistence._add_to_people_queue(uH,e):dH in e?this._mixpanel.persistence._add_to_people_queue(dH,e):hH in e?this._mixpanel.persistence._add_to_people_queue(hH,e):pH in e?this._mixpanel.persistence._add_to_people_queue(pH,e):fH in e?this._mixpanel.persistence._add_to_people_queue(fH,e):LF.error("Invalid call to _enqueue():",e)},yH.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=NF.extend({},this._mixpanel.persistence.load_queue(e)),s=o;NF.isUndefined(o)||!NF.isObject(o)||NF.isEmptyObject(o)||(i._mixpanel.persistence._pop_from_people_queue(e,o),i._mixpanel.persistence.save(),r&&(s=r(o)),t.call(i,s,function(t,r){0===t&&i._mixpanel.persistence._add_to_people_queue(e,o),NF.isUndefined(n)||n(t,r)}))},yH.prototype._flush=function(e,t,n,r,i,o,s){var a=this;this._flush_one_queue(cH,this.set,e),this._flush_one_queue(lH,this.set_once,r),this._flush_one_queue(uH,this.unset,o,function(e){return NF.keys(e)}),this._flush_one_queue(dH,this.increment,t),this._flush_one_queue(fH,this.union,i);var c=this._mixpanel.persistence.load_queue(hH);if(!NF.isUndefined(c)&&NF.isArray(c)&&c.length)for(var l,u=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(hH,l),NF.isUndefined(n)||n(e,t)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(hH),l=c.pop(),a._mixpanel.persistence.save(),NF.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(pH);if(!NF.isUndefined(h)&&NF.isArray(h)&&h.length)for(var f,p=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(pH,f),NF.isUndefined(s)||s(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(pH),f=h.pop(),a._mixpanel.persistence.save(),NF.isEmptyObject(f)||a.remove(f,p)},yH.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},yH.prototype.set=yH.prototype.set,yH.prototype.set_once=yH.prototype.set_once,yH.prototype.unset=yH.prototype.unset,yH.prototype.increment=yH.prototype.increment,yH.prototype.append=yH.prototype.append,yH.prototype.remove=yH.prototype.remove,yH.prototype.union=yH.prototype.union,yH.prototype.track_charge=yH.prototype.track_charge,yH.prototype.clear_charges=yH.prototype.clear_charges,yH.prototype.delete_user=yH.prototype.delete_user,yH.prototype.toString=yH.prototype.toString;var bH,vH="__mps",wH="__mpso",_H="__mpus",EH="__mpa",xH="__mpap",kH="__mpr",SH="__mpu",CH="$people_distinct_id",IH="__alias",AH="__timers",PH=[vH,wH,_H,EH,xH,kH,SH,CH,IH,AH],OH=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(LF.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&NF.localStorage.is_supported()?this.storage=NF.localStorage:this.storage=NF.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};OH.prototype.properties=function(){var e={};return this.load(),NF.each(this.props,function(t,n){NF.include(PH,n)||(e[n]=t)}),e},OH.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=NF.extend({},e))}},OH.prototype.upgrade=function(){var e,t;this.storage===NF.localStorage?(e=NF.cookie.parse(this.name),NF.cookie.remove(this.name),NF.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===NF.cookie&&(t=NF.localStorage.parse(this.name),NF.localStorage.remove(this.name),t&&this.register_once(t))},OH.prototype.save=function(){this.disabled||this.storage.set(this.name,ez(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},OH.prototype.load_prop=function(e){return this.load(),this.props[e]},OH.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},OH.prototype.clear=function(){this.remove(),this.props={}},OH.prototype.register_once=function(e,t,n){return!!NF.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),NF.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},OH.prototype.register=function(e,t){return!!NF.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),NF.extend(this.props,e),this.save(),!0)},OH.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},OH.prototype.update_search_keyword=function(e){this.register(NF.info.searchInfo(e))},OH.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:NF.info.referringDomain(e)||"$direct"},"")},OH.prototype.get_referrer_info=function(){return NF.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},OH.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},OH.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},OH.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},OH.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},OH.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},OH.prototype.get_cross_subdomain=function(){return this.cross_subdomain},OH.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},OH.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(cH),o=this._get_or_create_queue(lH),s=this._get_or_create_queue(uH),a=this._get_or_create_queue(dH),c=this._get_or_create_queue(fH),l=this._get_or_create_queue(pH,[]),u=this._get_or_create_queue(hH,[]);n===vH?(NF.extend(i,r),this._pop_from_people_queue(dH,r),this._pop_from_people_queue(fH,r),this._pop_from_people_queue(uH,r)):n===wH?(NF.each(r,function(e,t){t in o||(o[t]=e)}),this._pop_from_people_queue(uH,r)):n===_H?NF.each(r,function(e){NF.each([i,o,a,c],function(t){e in t&&delete t[e]}),NF.each(u,function(t){e in t&&delete t[e]}),s[e]=!0}):n===EH?(NF.each(r,function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this),this._pop_from_people_queue(uH,r)):n===SH?(NF.each(r,function(e,t){NF.isArray(e)&&(t in c||(c[t]=[]),NF.each(e,function(e){NF.include(c[t],e)||c[t].push(e)}))}),this._pop_from_people_queue(uH,r)):n===kH?(l.push(r),this._pop_from_people_queue(hH,r)):n===xH&&(u.push(r),this._pop_from_people_queue(uH,r)),LF.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),LF.log(t),this.save()},OH.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];NF.isUndefined(n)||NF.each(t,function(t,r){e===hH||e===pH?NF.each(n,function(e){e[r]===t&&delete e[r]}):delete n[r]},this)},OH.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},OH.prototype._get_queue_key=function(e){return e===cH?vH:e===lH?wH:e===uH?_H:e===dH?EH:e===hH?xH:e===pH?kH:e===fH?SH:void LF.error("Invalid queue:",e)},OH.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=NF.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},OH.prototype.set_event_timer=function(e,t){var n=this.load_prop(AH)||{};n[e]=t,this.props[AH]=n,this.save()},OH.prototype.remove_event_timer=function(e){var t=(this.load_prop(AH)||{})[e];return NF.isUndefined(t)||(delete this.props[AH][e],this.save()),t};var MH,TH=function(e,t){throw new Error(e+" not available in this build.")},RH="mixpanel",NH="base64",LH="$device:",BH=cO.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,jH=!BH&&-1===IF.indexOf("MSIE")&&-1===IF.indexOf("Mozilla"),DH=null;xF.sendBeacon&&(DH=function(){return xF.sendBeacon.apply(xF,arguments)});var UH={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},$H={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:UH,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:NH,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:XF,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:XF,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_console:!0,record_heatmap_data:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:pF,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},FH=!1,zH=function(){},qH=function(e,t,n){var r,i=n===RH?MH:MH[n];if(i&&0===bH)r=i;else{if(i&&!NF.isArray(i))return void LF.error("You have already initialized "+n);r=new zH}if(r._cached_groups={},r._init(e,t,n),r.people=new yH,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=NF.info.campaignParams(null),s={},a=!1;NF.each(o,function(e,t){s["initial_"+t]=e,e&&(a=!0)}),a&&r.people.set_once(s)}fF.DEBUG=fF.DEBUG||r.get_config("debug");var c=0===bH?"module":"snippet";return cO.dispatchEvent(new cO.CustomEvent("$mp_sdk_to_extension_event",{detail:{instance:r,source:c,token:e,name:n,info:NF.info}})),!NF.isUndefined(i)&&NF.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};zH.prototype.init=function(e,t,n){if(NF.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==RH){var r=qH(e,t,n);return MH[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},zH.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};"api_payload_format"in t||(t.api_host||$H.api_host).match(/\.mixpanel\.com/)&&(r.api_payload_format="json");if(this.hooks={},this.set_config(NF.extend({},$H,r,t,{name:n,token:e,callback_fn:(n===RH?n:RH+"."+n)+"._jsc"})),this._jsc=XF,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(NF.localStorage.is_supported(!0)&&BH){if(this.init_batchers(),DH&&cO.addEventListener){var i=NF.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);cO.addEventListener("pagehide",function(e){e.persisted&&i()}),cO.addEventListener("visibilitychange",function(){"hidden"===kF.visibilityState&&i()})}}else this._batch_requests=!1,LF.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),NF.each(this.get_batcher_configs(),function(e){LF.log("Clearing batch queue "+e.queue_key),NF.localStorage.remove(e.queue_key)});this.persistence=this.cookie=new OH(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=NF.UUID();this.get_distinct_id()||this.register_once({distinct_id:LH+o,$device_id:o},""),this.flags=new iH({getFullApiRoute:NF.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:NF.bind(this.get_config,this),setConfigFunc:NF.bind(this.set_config,this),getPropertyFunc:NF.bind(this.get_property,this),trackingFunc:NF.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new Xq(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},zH.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))LF.log("Tab ID initialization skipped due to disable_persistence config");else if(NF.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;!NF.sessionStorage.get(n)&&NF.sessionStorage.get(t)||NF.sessionStorage.set(t,"$tab-"+NF.UUID()),NF.sessionStorage.set(n,"1"),this.tab_id=NF.sessionStorage.get(t),cO.addEventListener("beforeunload",function(){NF.sessionStorage.remove(n)})}catch(jHe){this.report_error("Error initializing tab id",jHe)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},zH.prototype.get_tab_id=function(){return this.tab_id||null},zH.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return LF.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new oz(rz),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(e){for(var n=0;n<e.length;n++)if(Az(e[n])||e[n].tabId===t)return!0;return!1}).catch(NF.bind(function(e){this.report_error("Error checking recording registry",e)},this))},zH.prototype._check_and_start_session_recording=uz(function(e){if(cO.MutationObserver){var t=NF.bind(function(e){var t=NF.bind(function(){this._recorder=this._recorder||new cO.__mp_recorder(this),this._recorder.resumeRecording(e)},this);NF.isUndefined(cO.__mp_recorder)?TH(this.get_config("recorder_src"),t):t()},this),n=this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(e){e&&t(!1)})}else LF.critical("Browser does not support MutationObserver; skipping session recording")}),zH.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},zH.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},zH.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},zH.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},zH.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},zH.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},zH.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+NF.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},zH.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},zH.prototype.__get_recorder=function(){return this._recorder},zH.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=NF.info.campaignParams(null);NF.each(e,function(e,t){this.unregister(t)}.bind(this))}},zH.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(kF.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(NF.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(kF.referrer)},zH.prototype._dom_loaded=function(){NF.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||NF.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},zH.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!FH)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},zH.prototype._prepare_callback=function(e,t){if(NF.isUndefined(e))return null;if(BH){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i},zH.prototype._send_request=function(e,t,n,r){var i=!0;if(jH)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;r||!NF.isFunction(n)&&"string"!=typeof n||(r=n,n=null),n=NF.extend(o,n||{}),BH||(n.method="GET");var a="POST"===n.method,c=DH&&a&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),BH||(r?t.callback=r:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),NF.extend(t,this.get_config("api_extra_query_params")),e+="?"+NF.HTTPBuildQuery(t);var u=this;if("img"in t){var d=kF.createElement("img");d.src=e,kF.body.appendChild(d)}else if(c){try{i=DH(e,s)}catch(qAe){u.report_error(qAe),i=!1}try{r&&r(i?1:0)}catch(qAe){u.report_error(qAe)}}else if(BH)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var f=this.get_config("xhr_headers");if(a&&(f["Content-Type"]="application/x-www-form-urlencoded"),NF.each(f,function(e,t){h.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var p=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(r)if(l){var t;try{t=NF.JSONDecode(h.responseText)}catch(qAe){if(u.report_error(qAe),!n.ignore_json_errors)return;t=h.responseText}r(t)}else r(Number(h.responseText))}else if(e=h.timeout&&!h.status&&(new Date).getTime()-p>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(e),r)if(l){var i=h.responseHeaders||{};r({status:0,httpStatusCode:h.status,error:e,retryAfter:i["Retry-After"]})}else r(0)},h.send(s)}catch(qAe){u.report_error(qAe),i=!1}else{var m=kF.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var g=kF.getElementsByTagName("script")[0];g.parentNode.insertBefore(m,g)}return i},zH.prototype._execute_array=function(e){var t,n=[],r=[],i=[];NF.each(e,function(e){e&&(t=e[0],NF.isArray(t)?i.push(e):"function"==typeof e?e.call(this):NF.isArray(e)&&"alias"===t?n.push(e):NF.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?i.push(e):r.push(e))},this);var o=function(e,t){NF.each(e,function(e){if(NF.isArray(e[0])){var n=t;NF.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(r,this),o(i,this)},zH.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},zH.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:e+"_ev"},people:{type:"people",api_name:"engage",queue_key:e+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:e+"_gr"}},this._batcher_configs},zH.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=NF.bind(function(e){return new Iz(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:NF.bind(function(t,n,r){var i=this.get_config("api_routes");this._send_request(this.get_api_host(e.api_name)+"/"+i[e.api_name],this._encode_data_for_request(t),n,this._prepare_callback(r,t))},this),beforeSendHook:NF.bind(function(t){var n=this._run_hook("before_send_"+e.type,t);return n?n[0]:null},this),stopAllBatchingFunc:NF.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},zH.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,NF.each(this.request_batchers,function(e){e.start()}))},zH.prototype.stop_batch_senders=function(){this._batch_requests=!1,NF.each(this.request_batchers,function(e){e.stop(),e.clear()})},zH.prototype.push=function(e){this._execute_array([e])},zH.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},zH.prototype._encode_data_for_request=function(e){var t=ez(e);return this.get_config("api_payload_format")===NH&&(t=NF.base64Encode(t)),{data:t}},zH.prototype._track_or_batch=function(e,t){var n=NF.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||XF;var a=!0,c=NF.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n))&&(n=n[0]),n?(LF.log("MIXPANEL REQUEST:"),LF.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n).then(function(e){e?t(1,n):c()}):a=c(),a&&n},zH.prototype.track=uz(function(e,t,n,r){var i;if(!n||!n.skip_hooks){if(null===(i=this._run_hook("before_track",e,t)))return;e=i[0],t=i[1]}r||"function"!=typeof n||(r=n,n=null);var o=(n=n||{}).transport;o&&(n.transport=o);var s=n.send_immediately;if("function"!=typeof r&&(r=XF),NF.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=NF.extend({},t)).token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!NF.isUndefined(a)){var c=(new Date).getTime()-a;t.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?NF.info.marketingParams():{};t=NF.extend({},NF.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");NF.isArray(u)?NF.each(u,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+u);var d={event:e,properties:t};return i=this._track_or_batch({type:"events",data:d,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:n},r)}r(0)}}),zH.prototype.set_group=uz(function(e,t,n){NF.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),zH.prototype.add_group=uz(function(e,t,n){var r=this.get_property(e),i={};return void 0===r?(i[e]=[t],this.register(i)):-1===r.indexOf(t)&&(r.push(t),i[e]=r,this.register(i)),this.people.union(e,t,n)}),zH.prototype.remove_group=uz(function(e,t,n){var r=this.get_property(e);if(void 0!==r){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)}),zH.prototype.track_with_groups=uz(function(e,t,n,r){var i=NF.extend({},t||{});return NF.each(n,function(e,t){null!=e&&(i[t]=e)}),this.track(e,i,r)}),zH.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},zH.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},zH.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return void 0!==r&&r._group_key===e&&r._group_id===t||((r=new gH)._init(this,e,t),this._cached_groups[n]=r),r},zH.prototype.track_pageview=uz(function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",r=NF.extend(NF.info.mpPageViewProperties(),NF.info.campaignParams(),NF.info.clickParams()),i=NF.extend({},r,e);return this.track(n,i)}),zH.prototype.track_links=function(){return this._track_dom.call(this,sH,arguments)},zH.prototype.track_forms=function(){return this._track_dom.call(this,aH,arguments)},zH.prototype.time_event=function(e){NF.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var HH={persistent:!0},WH=function(e){var t;return t=NF.isObject(e)?e:NF.isUndefined(e)?{}:{days:e},NF.extend({},HH,t)};zH.prototype.register=function(e,t){var n=this._run_hook("before_register",e,t);if(null!==n){e=n[0],t=n[1];var r=WH(t);r.persistent?this.persistence.register(e,r.days):NF.extend(this.unpersisted_superprops,e)}},zH.prototype.register_once=function(e,t,n){var r=this._run_hook("before_register_once",e,t,n);if(null!==r){e=r[0],t=r[1],n=r[2];var i=WH(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),NF.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))}},zH.prototype.unregister=function(e,t){var n=this._run_hook("before_unregister",e,t);null!==n&&(e=n[0],t=n[1],(t=WH(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e])},zH.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},zH.prototype.identify=function(e,t,n,r,i,o,s,a){var c=this._run_hook("before_identify",e);if(null===c)return-1;e=c[0];var l=this.get_distinct_id();if(e&&l!==e){if("string"==typeof e&&0===e.indexOf(LH))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==l&&e!==this.get_property(IH)&&(this.unregister(IH),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,a),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()},zH.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=NF.UUID();this.register_once({distinct_id:LH+e,$device_id:e},""),this._check_and_start_session_recording()},zH.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},zH.prototype.alias=function(e,t){if(e===this.get_property(CH))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return NF.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(IH,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},zH.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},zH.prototype.set_config=function(e){NF.isObject(e)&&(NF.extend(this.config,e),e.batch_size&&NF.each(this.request_batchers,function(e){e.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),fF.DEBUG=fF.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init(),NF.isObject(e.hooks)&&(this.hooks={},NF.each(e.hooks,function(e,t){if(NF.isFunction(e))this.hooks[t]=[e];else if(NF.isArray(e)){this.hooks[t]=[];for(var n=0;n<e.length;n++)NF.isFunction(e[n])||LF.critical("Invalid hook added. Hook is not a function"),this.hooks[t].push(e[n])}else LF.critical("Invalid hooks added. Ensure that the hook values passed into config.hooks are functions or arrays of functions.")},this)))},zH.prototype.get_config=function(e){return this.config[e]},zH.prototype._run_hook=function(e){var t=vF.call(arguments,1);return NF.each(this.hooks[e],function(n){if(null===t)return null;var r=n.apply(this,t);void 0===r?(this.report_error(e+" hook did not return a valid value"),t=null):(NF.isArray(r)||(r=[r]),t.splice.apply(t,[0,r.length].concat(r)))},this),t},zH.prototype.get_property=function(e){return this.persistence.load_prop([e])},zH.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")},zH.prototype.toString=function(){var e=this.get_config("name");return e!==RH&&(e=RH+"."+e),e},zH.prototype._event_is_disabled=function(e){return NF.isBlockedUA(IF)||this._flags.disable_all_events||NF.include(this.__disabled_events,e)},zH.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&NF.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!NF.cookie.get("mp_optout")||(NF.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},zH.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},zH.prototype._gdpr_call_func=function(e,t){return t=NF.extend({track:NF.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),NF.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},zH.prototype.opt_in_tracking=function(e){e=NF.extend({enable_persistence:!0},e),this._gdpr_call_func(sz,e),this._gdpr_update_persistence(e)},zH.prototype.opt_out_tracking=function(e){(e=NF.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(az,e),this._gdpr_update_persistence(e)},zH.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(cz,e)},zH.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(lz,e)},zH.prototype.clear_opt_in_out_tracking=function(e){e=NF.extend({enable_persistence:!0},e),this._gdpr_call_func(fz,e),this._gdpr_update_persistence(e)},zH.prototype.report_error=function(e,t){LF.error.apply(LF.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){LF.error(n)}},zH.prototype.add_hook=function(e,t){this.hooks[e]||(this.hooks[e]=[]),this.hooks[e].push(t)},zH.prototype.remove_hook=function(e,t){var n;this.hooks[e]&&(-1!==(n=this.hooks[e].indexOf(t))?this.hooks[e].splice(n,1):LF.log("remove_hook failed. Matching hook was not found"))},zH.prototype.init=zH.prototype.init,zH.prototype.reset=zH.prototype.reset,zH.prototype.disable=zH.prototype.disable,zH.prototype.time_event=zH.prototype.time_event,zH.prototype.track=zH.prototype.track,zH.prototype.track_links=zH.prototype.track_links,zH.prototype.track_forms=zH.prototype.track_forms,zH.prototype.track_pageview=zH.prototype.track_pageview,zH.prototype.register=zH.prototype.register,zH.prototype.register_once=zH.prototype.register_once,zH.prototype.unregister=zH.prototype.unregister,zH.prototype.identify=zH.prototype.identify,zH.prototype.alias=zH.prototype.alias,zH.prototype.name_tag=zH.prototype.name_tag,zH.prototype.set_config=zH.prototype.set_config,zH.prototype.get_config=zH.prototype.get_config,zH.prototype.get_api_host=zH.prototype.get_api_host,zH.prototype.get_property=zH.prototype.get_property,zH.prototype.get_distinct_id=zH.prototype.get_distinct_id,zH.prototype.toString=zH.prototype.toString,zH.prototype.opt_out_tracking=zH.prototype.opt_out_tracking,zH.prototype.opt_in_tracking=zH.prototype.opt_in_tracking,zH.prototype.has_opted_out_tracking=zH.prototype.has_opted_out_tracking,zH.prototype.has_opted_in_tracking=zH.prototype.has_opted_in_tracking,zH.prototype.clear_opt_in_out_tracking=zH.prototype.clear_opt_in_out_tracking,zH.prototype.get_group=zH.prototype.get_group,zH.prototype.set_group=zH.prototype.set_group,zH.prototype.add_group=zH.prototype.add_group,zH.prototype.remove_group=zH.prototype.remove_group,zH.prototype.add_hook=zH.prototype.add_hook,zH.prototype.remove_hook=zH.prototype.remove_hook,zH.prototype.track_with_groups=zH.prototype.track_with_groups,zH.prototype.start_batch_senders=zH.prototype.start_batch_senders,zH.prototype.stop_batch_senders=zH.prototype.stop_batch_senders,zH.prototype.start_session_recording=zH.prototype.start_session_recording,zH.prototype.stop_session_recording=zH.prototype.stop_session_recording,zH.prototype.pause_session_recording=zH.prototype.pause_session_recording,zH.prototype.resume_session_recording=zH.prototype.resume_session_recording,zH.prototype.get_session_recording_properties=zH.prototype.get_session_recording_properties,zH.prototype.get_session_replay_url=zH.prototype.get_session_replay_url,zH.prototype.get_tab_id=zH.prototype.get_tab_id,zH.prototype.DEFAULT_API_ROUTES=UH,zH.prototype.__get_recorder=zH.prototype.__get_recorder,OH.prototype.properties=OH.prototype.properties,OH.prototype.update_search_keyword=OH.prototype.update_search_keyword,OH.prototype.update_referrer_info=OH.prototype.update_referrer_info,OH.prototype.get_cross_subdomain=OH.prototype.get_cross_subdomain,OH.prototype.clear=OH.prototype.clear;var KH={},VH=function(){MH.init=function(e,t,n){if(n)return MH[n]||(MH[n]=KH[n]=qH(e,t,n),MH[n]._loaded()),MH[n];var r=MH;KH[RH]?r=KH[RH]:e&&((r=qH(e,t,RH))._loaded(),KH[RH]=r),MH=r,1===bH&&(cO[RH]=MH),NF.each(KH,function(e,t){t!==RH&&(MH[t]=e)}),MH._=NF}};var GH=(TH=function(e,t){t()},bH=0,MH=new zH,VH(),MH.init(),function(){function e(){e.done||(e.done=!0,FH=!0,jH=!1,NF.each(KH,function(e){e._dom_loaded()}))}if(kF.addEventListener)"complete"===kF.readyState?e():kF.addEventListener("DOMContentLoaded",e,!1);else if(kF.attachEvent){kF.attachEvent("onreadystatechange",e);var t=!1;try{t=null===cO.frameElement}catch(qAe){}kF.documentElement.doScroll&&t&&function t(){try{kF.documentElement.doScroll("left")}catch(qAe){return void setTimeout(t,1)}e()}()}NF.register_event(cO,"load",e,!0)}(),MH);let ZH=!1;const YH=()=>{ZH||(GH.init("c9fdb235976ef567b15bcb07bad264f3",{debug:!1,track_pageview:!1,persistence:"localStorage"}),ZH=!0)},JH={init:()=>{YH()},track:(e,t={})=>{ZH||YH(),GH.track(e,{source:"coinley-sdk",...t,timestamp:(new Date).toISOString()})},trackModalOpened:(e,t)=>{JH.track("SDK Modal Opened",{merchant_name:e,amount:t})},trackModalClosed:(e="user_closed")=>{JH.track("SDK Modal Closed",{reason:e})},trackNetworkSelected:(e,t)=>{JH.track("Network Selected",{network:e,merchant_name:t})},trackTokenSelected:(e,t,n)=>{JH.track("Token Selected",{token:e,network:t,merchant_name:n})},trackWalletConnectStarted:e=>{JH.track("Wallet Connect Started",{wallet_type:e})},trackWalletConnected:(e,t,n)=>{JH.track("Wallet Connected",{wallet_type:e,wallet_address:(null==t?void 0:t.slice(0,10))+"...",network:n})},trackWalletConnectionFailed:(e,t)=>{JH.track("Wallet Connection Failed",{wallet_type:e,error:(null==t?void 0:t.message)||t})},trackWalletDisconnected:()=>{JH.track("Wallet Disconnected")},trackPaymentCreated:(e,t,n,r)=>{JH.track("Payment Created",{payment_id:e,amount:t,network:n,token:r})},trackPaymentApprovalStarted:(e,t)=>{JH.track("Payment Approval Started",{payment_id:e,amount:t})},trackPaymentApproved:(e,t)=>{JH.track("Payment Approved",{payment_id:e,amount:t})},trackPaymentExecutionStarted:(e,t)=>{JH.track("Payment Execution Started",{payment_id:e,amount:t})},trackPaymentSuccess:(e,t,n,r,i)=>{JH.track("Payment Success",{payment_id:e,amount:t,network:n,token:r,transaction_hash:i})},trackPaymentFailed:(e,t,n,r,i)=>{JH.track("Payment Failed",{payment_id:e,amount:t,network:n,token:r,error:(null==i?void 0:i.message)||i})},trackPaymentCancelled:(e,t)=>{JH.track("Payment Cancelled",{payment_id:e,stage:t})},trackError:(e,t,n={})=>{JH.track("SDK Error",{error_type:e,error_message:t,...n})},trackNetworkSwitchRequested:(e,t)=>{JH.track("Network Switch Requested",{from_network:e,to_network:t})},trackNetworkSwitchSuccess:e=>{JH.track("Network Switch Success",{network:e})},trackNetworkSwitchFailed:(e,t)=>{JH.track("Network Switch Failed",{network:e,error:(null==t?void 0:t.message)||t})}};let QH=!1;const XH=(e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("set",e,t)},eW=e=>((e="v0r7eqoiy1")=>{QH||"undefined"==typeof window||(function(e,t,n,r,i,o,s){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},(o=t.createElement(r)).async=1,o.src="https://www.clarity.ms/tag/"+i,(s=t.getElementsByTagName(r)[0]).parentNode.insertBefore(o,s)}(window,document,"clarity","script",e),QH=!0)})(e),tW=(e,t)=>{XH("event","modal_opened"),XH("merchant",e||"unknown"),XH("amount",String(t||0))},nW=e=>{XH("event","modal_closed"),XH("close_reason",e||"unknown")},rW=(e,t)=>{XH("event","network_selected"),XH("network",e||"unknown")},iW=(e,t,n)=>{XH("event","token_selected"),XH("token",e||"unknown"),XH("network",t||"unknown")},oW=(e,t,n,r)=>{XH("event","payment_created"),XH("payment_id",e||"unknown"),XH("network",n||"unknown"),XH("token",r||"unknown")},sW=(e,t,n,r,i)=>{XH("event","payment_success"),XH("payment_id",e||"unknown"),XH("network",n||"unknown"),XH("token",r||"unknown")},aW=(e,t,n,r,i)=>{XH("event","payment_failed"),XH("payment_id",e||"unknown"),XH("error",String(i||"unknown").substring(0,100))},cW=(e,t,n)=>{XH("event","error"),XH("error_type",e||"unknown"),XH("error_message",String(t||"").substring(0,100))},lW={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};function uW(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!Vm(t))throw new cp({address:t});if(n&&!Vm(n))throw new cp({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:i,isSystemTx:o,mint:s,to:a,value:c}=e,l=[t,r,a??"0x",s?kp(s):"0x",c?kp(c):"0x",i?kp(i):"0x",o?"0x1":"0x",n??"0x"];return dg(["0x7e",W_(l)])}(e):vx(e,t)}const dW={blockTime:2e3,contracts:lW,formatters:{block:oE({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;const t=nE(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?wp(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot}}}),transaction:rE({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?wp(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Nx({format:e=>({l1GasPrice:e.l1GasPrice?wp(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?wp(e.l1GasUsed):null,l1Fee:e.l1Fee?wp(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:uW}},hW=Mx({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),fW=Mx({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),pW=1,mW=Mx({...dW,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...dW.contracts,disputeGameFactory:{[pW]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[pW]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[pW]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[pW]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),gW=Mx({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),yW={estimateFeesPerGas:async e=>{var t;if(!(null==(t=e.request)?void 0:t.feeCurrency))return null;const[n,r]=await Promise.all([bW(e.client,e.request.feeCurrency),vW(e.client,e.request.feeCurrency)]);return{maxFeePerGas:e.multiply(n-r)+r,maxPriorityFeePerGas:r}}};async function bW(e,t){const n=await e.request({method:"eth_gasPrice",params:[t]});return BigInt(n)}async function vW(e,t){const n=await e.request({method:"eth_maxPriorityFeePerGas",params:[t]});return BigInt(n)}function wW(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===bp(e).toLowerCase()||"0x00"===bp(e).toLowerCase())}function _W(e){return!wW(e)}function EW(e){return"cip64"===e.type||function(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}(e)&&_W(e.feeCurrency)}const xW={transaction:function(e,t){return EW(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o,feeCurrency:s}=e;if(t<=0)throw new By({chainId:t});if(o&&!Vm(o))throw new cp({address:o});if(r)throw new Lf("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(_W(i)&&i>kW)throw new Ww({maxFeePerGas:i});if(_W(n)&&_W(i)&&n>i)throw new e_({maxFeePerGas:i,maxPriorityFeePerGas:n});if(_W(s)&&!Vm(s))throw new Lf("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(wW(s))throw new Lf("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:i,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[kp(n),i?kp(i):"0x",c?kp(c):"0x",a?kp(a):"0x",r?kp(r):"0x",o??"0x",s?kp(s):"0x",d??"0x",bx(l),u,...wx(e,t)];return dg(["0x7b",W_(h)])}(e,t):uW(e,t)}};const kW=m_;const SW=Mx({...{blockTime:1e3,contracts:lW,formatters:{block:oE({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;return{...nE(e),...e.gatewayFee?{gatewayFee:wp(e.gatewayFee),gatewayFeeRecipient:e.gatewayFeeRecipient}:{},feeCurrency:e.feeCurrency}})}}}),transaction:rE({format(e){if("0x7e"===e.type)return{isSystemTx:e.isSystemTx,mint:e.mint?wp(e.mint):void 0,sourceHash:e.sourceHash,type:"deposit"};const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?wp(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:c_({format(e){const t={};return e.feeCurrency&&(t.feeCurrency=e.feeCurrency),EW(e)&&(t.type="0x7b"),t}})},serializers:xW,fees:yW},id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://celoscan.io",apiUrl:"https://api.celoscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),CW=Mx({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),IW=1,AW=Mx({...dW,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...dW.contracts,disputeGameFactory:{[IW]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[IW]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[IW]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[IW]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),PW=Mx({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});function OW(e={}){return"3"===e.version||e.headlessMode?function(e){const t=!1;let n,r,i,o,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:OW.type,async connect({chainId:e,withCapabilities:t}={}){try{const n=await this.getProvider(),r=(await n.request({method:"eth_requestAccounts"})).map(e=>Ym(e));i||(i=this.onAccountsChanged.bind(this),n.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),n.on("chainChanged",o)),s||(s=this.onDisconnect.bind(this),n.on("disconnect",s));let a=await this.getChainId();if(e&&a!==e){const t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===Wb.code)throw e;return{id:a}});a=(null==t?void 0:t.id)??a}return{accounts:t?r.map(e=>({address:e,capabilities:{}})):r,chainId:a}}catch(cF){if(/(user closed modal|accounts received is empty|user denied account)/i.test(cF.message))throw new Wb(cF);throw cF}},async disconnect(){const e=await this.getProvider();i&&(e.removeListener("accountsChanged",i),i=void 0),o&&(e.removeListener("chainChanged",o),o=void 0),s&&(e.removeListener("disconnect",s),s=void 0),e.disconnect(),e.close()},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=await e.request({method:"eth_chainId"});return Number(t)},async getProvider(){var i;if(!r){const o=await(async()=>{const{default:e}=await Promise.resolve().then(()=>owe);return"function"!=typeof e&&"function"==typeof e.default?e.default:e})();n=new o({...e,reloadOnDisconnect:t});const s=null==(i=n.walletExtension)?void 0:i.getChainId(),c=a.chains.find(t=>e.chainId?t.id===e.chainId:t.id===s)||a.chains[0],l=e.chainId||(null==c?void 0:c.id),u=e.jsonRpcUrl||(null==c?void 0:c.rpcUrls.default.http[0]);r=n.makeWeb3Provider(u,l)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r,i,o;const s=a.chains.find(e=>e.id===t);if(!s)throw new Yb(new zC);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(s.id)}]}),s}catch(cF){if(4902===cF.code)try{let a,l;a=(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:(null==(n=s.blockExplorers)?void 0:n.default.url)?[null==(r=s.blockExplorers)?void 0:r.default.url]:[],l=(null==(i=null==e?void 0:e.rpcUrls)?void 0:i.length)?e.rpcUrls:[(null==(o=s.rpcUrls.default)?void 0:o.http[0])??""];const u={blockExplorerUrls:a,chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??s.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??s.nativeCurrency,rpcUrls:l};return await c.request({method:"wallet_addEthereumChain",params:[u]}),s}catch(l){throw new Wb(l)}throw new Yb(cF)}},onAccountsChanged(e){0===e.length?this.onDisconnect():a.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);a.emitter.emit("change",{chainId:t})},async onDisconnect(e){a.emitter.emit("disconnect");const t=await this.getProvider();i&&(t.removeListener("accountsChanged",i),i=void 0),o&&(t.removeListener("chainChanged",o),o=void 0),s&&(t.removeListener("disconnect",s),s=void 0)}})}(e):function(e){let t,n,r,i;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:OW.type,async connect({chainId:e,withCapabilities:t,...o}={}){try{const s=await this.getProvider(),a=(await s.request({method:"eth_requestAccounts",params:"instantOnboarding"in o&&o.instantOnboarding?[{onboarding:"instant"}]:[]})).map(e=>Ym(e));n||(n=this.onAccountsChanged.bind(this),s.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),s.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),s.on("disconnect",i));let c=await this.getChainId();if(e&&c!==e){const t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===Wb.code)throw e;return{id:c}});c=(null==t?void 0:t.id)??c}return{accounts:t?a.map(e=>({address:e,capabilities:{}})):a,chainId:c}}catch(cF){if(/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(cF.message))throw new Wb(cF);throw cF}},async disconnect(){var e;const t=await this.getProvider();n&&(t.removeListener("accountsChanged",n),n=void 0),r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0),t.disconnect(),null==(e=t.close)||e.call(t)},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=await e.request({method:"eth_chainId"});return Number(t)},async getProvider(){if(!t){const r="string"==typeof e.preference?{options:e.preference}:{...e.preference,options:(null==(n=e.preference)?void 0:n.options)??"all"},{createCoinbaseWalletSDK:i}=await Promise.resolve().then(()=>pie),s=i({...e,appChainIds:o.chains.map(e=>e.id),preference:r});t=s.getProvider()}var n;return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r,i,s;const a=o.chains.find(e=>e.id===t);if(!a)throw new Yb(new zC);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(a.id)}]}),a}catch(cF){if(4902===cF.code)try{let o,l;o=(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:(null==(n=a.blockExplorers)?void 0:n.default.url)?[null==(r=a.blockExplorers)?void 0:r.default.url]:[],l=(null==(i=null==e?void 0:e.rpcUrls)?void 0:i.length)?e.rpcUrls:[(null==(s=a.rpcUrls.default)?void 0:s.http[0])??""];const u={blockExplorerUrls:o,chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??a.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??a.nativeCurrency,rpcUrls:l};return await c.request({method:"wallet_addEthereumChain",params:[u]}),a}catch(l){throw new Wb(l)}throw new Yb(cF)}},onAccountsChanged(e){0===e.length?this.onDisconnect():o.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);o.emitter.emit("change",{chainId:t})},async onDisconnect(e){o.emitter.emit("disconnect");const t=await this.getProvider();n&&(t.removeListener("accountsChanged",n),n=void 0),r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0)}})}(e)}OW.type="coinbaseWallet";var MW,TW,RW={exports:{}};function NW(){if(TW)return MW;TW=1;var e=1e3,t=6e4,n=60*t,r=24*n,i=7*r,o=365.25*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return MW=function(a,c){c=c||{};var l=typeof a;if("string"===l&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===l&&isFinite(a))return c.long?function(i){var o=Math.abs(i);if(o>=r)return s(i,o,r,"day");if(o>=n)return s(i,o,n,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}var LW=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,i=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(i=r,o=n,r++):(n++,r++);else{if(-1===i)return!1;r=i+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n)"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=NW(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(cF){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(cF){}!e&&void 0!==aO&&"env"in aO&&(e="");return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(cF){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=LW(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(cF){return"[UnexpectedJSONParseError]: "+cF.message}}}(RW,RW.exports);var BW=RW.exports,jW={exports:{}};var DW={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var UW="object"==typeof aO&&aO.env&&aO.env.NODE_DEBUG&&/\bsemver\b/i.test(aO.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=DW,o=UW,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),u[e]=i,c[i]=t,l[i]=r,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(jW,jW.exports);var $W=jW.exports;const FW=Object.freeze({loose:!0}),zW=Object.freeze({});var qW=e=>e?"object"!=typeof e?FW:e:zW;const HW=/^[0-9]+$/,WW=(e,t)=>{if("number"==typeof e&&"number"==typeof t)return e===t?0:e<t?-1:1;const n=HW.test(e),r=HW.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var KW={compareIdentifiers:WW,rcompareIdentifiers:(e,t)=>WW(t,e)};const VW=UW,{MAX_LENGTH:GW,MAX_SAFE_INTEGER:ZW}=DW,{safeRe:YW,t:JW}=$W,QW=qW,{compareIdentifiers:XW}=KW;var eK=class e{constructor(t,n){if(n=QW(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>GW)throw new TypeError(`version is longer than ${GW} characters`);VW("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?YW[JW.LOOSE]:YW[JW.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ZW||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ZW||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ZW||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<ZW)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(VW("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(VW("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return XW(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(VW("build compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return XW(e,r)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?YW[JW.PRERELEASELOOSE]:YW[JW.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===XW(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const tK=eK;const nK=(e,t,n=!1)=>{if(e instanceof tK)return e;try{return new tK(e,t)}catch(r){if(!n)return null;throw r}};var rK=(e,t)=>{const n=nK(e,t);return n?n.version:null};const iK=eK;var oK=(e,t,n)=>new iK(e,n).compare(new iK(t,n));const sK=oK;var aK=(e,t,n)=>sK(e,t,n)>0;const cK=oK;var lK=(e,t,n)=>cK(e,t,n)<0;const uK=oK;var dK=(e,t,n)=>0===uK(e,t,n);const hK=oK;var fK=(e,t,n)=>0!==hK(e,t,n);const pK=oK;var mK=(e,t,n)=>pK(e,t,n)>=0;const gK=oK;var yK=(e,t,n)=>gK(e,t,n)<=0;const bK=dK,vK=fK,wK=aK,_K=mK,EK=lK,xK=yK;var kK=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return bK(e,n,r);case"!=":return vK(e,n,r);case">":return wK(e,n,r);case">=":return _K(e,n,r);case"<":return EK(e,n,r);case"<=":return xK(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const{safeRe:SK,t:CK}=$W;var IK,AK,PK,OK,MK=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};function TK(){if(AK)return IK;AK=1;const e=/\s+/g;class t{constructor(n,o){if(o=r(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!p(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&m(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,I(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),o("caret trim",e);let g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>C(e,this.options));s&&(g=g.filter(e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE])))),o("range list",g);const b=new Map,v=g.map(e=>new i(e,this.options));for(const n of v){if(p(n))return[n];b.set(n.value,n)}b.size>1&&b.has("")&&b.delete("");const w=[...b.values()];return n.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(t){return!1}for(let n=0;n<this.set.length;n++)if(A(this.set[n],e,this.options))return!0;return!1}}IK=t;const n=new MK,r=qW,i=RK(),o=UW,s=eK,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:d}=$W,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=DW,p=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},y=(e,t)=>(e=e.replace(a[c.BUILD],""),o("comp",e,t),e=_(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=x(e,t),o("xrange",e),e=S(e,t),o("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,(t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),b(n)?a="":b(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:b(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a})},_=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),b(n)?c="":b(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c})},x=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,(n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const l=b(i),u=l||b(s),d=u||b(a),h=d;return"="===r&&h&&(r=""),c=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(s=0),a=0,">"===r?(r=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n})},S=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),C=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),I=e=>(t,n,r,i,o,s,a,c,l,u,d,h)=>`${n=b(r)?"":b(i)?`>=${r}.0.0${e?"-0":""}`:b(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=b(l)?"":b(u)?`<${+l+1}.0.0-0`:b(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),A=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return IK}function RK(){if(OK)return PK;OK=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(n){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}PK=t;const n=qW,{safeRe:r,t:i}=$W,o=kK,s=UW,a=eK,c=TK();return PK}const NK=TK();var LK=(e,t,n)=>{try{t=new NK(t,n)}catch(r){return!1}return t.test(e)};TK(),TK(),TK(),TK();const BK=TK();var jK=(e,t)=>{try{return new BK(e,t).range||"*"}catch(n){return null}};const DK=eK,UK=RK(),{ANY:$K}=UK,FK=TK(),zK=LK,qK=aK,HK=lK,WK=yK,KK=mK;const VK=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new DK(e,r),t=new FK(t,r),n){case">":i=qK,o=WK,s=HK,a=">",c=">=";break;case"<":i=HK,o=KK,s=qK,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zK(e,t,r))return!1;for(let l=0;l<t.set.length;++l){const n=t.set[l];let u=null,d=null;if(n.forEach(e=>{e.semver===$K&&(e=new UK(">=0.0.0")),u=u||e,d=d||e,i(e.semver,u.semver,r)?u=e:s(e.semver,d.semver,r)&&(d=e)}),u.operator===a||u.operator===c)return!1;if((!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};var GK=(e,t,n)=>VK(e,t,">",n);TK(),TK();const ZK=RK(),{ANY:YK}=ZK;new ZK(">=0.0.0-0"),new ZK(">=0.0.0");const JK=$W,QK=DW,XK=KW,eV=rK,tV=aK;RK(),TK();var nV={valid:eV,gt:tV,satisfies:LK,validRange:jK,gtr:GK,re:JK.re,src:JK.src,tokens:JK.t,SEMVER_SPEC_VERSION:QK.SEMVER_SPEC_VERSION,RELEASE_TYPES:QK.RELEASE_TYPES,compareIdentifiers:XK.compareIdentifiers,rcompareIdentifiers:XK.rcompareIdentifiers},rV=lV;lV.default=lV,lV.stable=fV,lV.stableStringify=fV;var iV="[...]",oV="[Circular]",sV=[],aV=[];function cV(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function lV(e,t,n,r){var i;void 0===r&&(r=cV()),dV(e,"",0,[],void 0,0,r);try{i=0===aV.length?JSON.stringify(e,t,n):JSON.stringify(e,mV(t),n)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==sV.length;){var o=sV.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function uV(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:e}),sV.push([r,n,t,i])):aV.push([t,n,e]):(r[n]=e,sV.push([r,n,t]))}function dV(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void uV(oV,e,t,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void uV(iV,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void uV(iV,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)dV(e[a],a,a,r,e,o,s);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];dV(e[l],l,a,r,e,o,s)}}r.pop()}}function hV(e,t){return e<t?-1:e>t?1:0}function fV(e,t,n,r){void 0===r&&(r=cV());var i,o=pV(e,"",0,[],void 0,0,r)||e;try{i=0===aV.length?JSON.stringify(o,t,n):JSON.stringify(o,mV(t),n)}catch(a){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==sV.length;){var s=sV.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function pV(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void uV(oV,e,t,i);try{if("function"==typeof e.toJSON)return}catch(d){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void uV(iV,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void uV(iV,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)pV(e[a],a,a,r,e,o,s);else{var c={},l=Object.keys(e).sort(hV);for(a=0;a<l.length;a++){var u=l[a];pV(e[u],u,a,r,e,o,s),c[u]=e[u]}if(void 0===i)return c;sV.push([i,t,e]),i[t]=c}r.pop()}}function mV(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(aV.length>0)for(var r=0;r<aV.length;r++){var i=aV[r];if(i[1]===t&&i[0]===n){n=i[2],aV.splice(r,1);break}}return e.call(this,t,n)}}function gV(e={}){let t,n,r,i,o,s,a,c;return l=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:gV.type,async setup(){const e=await this.getProvider();(null==e?void 0:e.on)&&(s||(s=this.onConnect.bind(this),e.on("connect",s)),i||(i=this.onAccountsChanged.bind(this),e.on("accountsChanged",i)))},async connect({chainId:n,isReconnecting:r,withCapabilities:l}={}){const u=await this.getProvider();a||(a=this.onDisplayUri,u.on("display_uri",a));let d=[];r&&(d=await this.getAccounts().catch(()=>[]));try{let r,h;if(!(null==d?void 0:d.length))if(e.connectAndSign||e.connectWith)e.connectAndSign?r=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(h=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),d=await this.getAccounts();else{d=(await t.connect()).map(e=>Ym(e))}let f=await this.getChainId();if(n&&f!==n){const e=await this.switchChain({chainId:n}).catch(e=>{if(e.code===Wb.code)throw e;return{id:f}});f=(null==e?void 0:e.id)??f}return a&&(u.removeListener("display_uri",a),a=void 0),r?u.emit("connectAndSign",{accounts:d,chainId:f,signResponse:r}):h&&u.emit("connectWith",{accounts:d,chainId:f,connectWithResponse:h}),s&&(u.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),u.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),u.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),u.on("disconnect",c)),{accounts:l?d.map(e=>({address:e,capabilities:{}})):d,chainId:f}}catch(jHe){const t=jHe;if(t.code===Wb.code)throw new Wb(t);if(t.code===$b.code)throw new $b(t);throw t}},async disconnect(){const e=await this.getProvider();o&&(e.removeListener("chainChanged",o),o=void 0),c&&(e.removeListener("disconnect",c),c=void 0),s||(s=this.onConnect.bind(this),e.on("connect",s)),await t.terminate()},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=e.getChainId()||await(null==e?void 0:e.request({method:"eth_chainId"}));return Number(t)},getProvider:async()=>(n||(r||(r=async function(){var n,r,i,o,s;const a=await(async()=>{const{default:e}=await Promise.resolve().then(()=>tDe);return"function"!=typeof e&&"function"==typeof e.default?e.default:e})(),c={};for(const e of l.chains)c[Ip(e.id)]=null==(n=GI({chain:e,transports:l.transports}))?void 0:n[0];t=new a({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:c,dappMetadata:{...e.dappMetadata,name:(null==(r=e.dappMetadata)?void 0:r.name)?null==(i=e.dappMetadata)?void 0:i.name:"wagmi",url:(null==(o=e.dappMetadata)?void 0:o.url)?null==(s=e.dappMetadata)?void 0:s.url:"undefined"!=typeof window?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const u=await t.init(),d=(null==u?void 0:u.activeProvider)?u.activeProvider:t.getProvider();if(!d)throw new vI;return d}()),n=await r),n),async isAuthorized(){try{const e=200;return!!(await xx(()=>Bx(()=>this.getAccounts(),{timeout:e}),{delay:e+1,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r;const i=await this.getProvider(),o=l.chains.find(e=>e.id===t);if(!o)throw new Yb(new zC);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(t)}]}),await c(),await u(t),o}catch(jHe){const h=jHe;if(h.code===Wb.code)throw new Wb(h);if(4902===h.code||4902===(null==(r=null==(n=null==h?void 0:h.data)?void 0:n.originalError)?void 0:r.code))try{return await i.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:t,...n}=o.blockExplorers??{};return(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:t?[t.url,...Object.values(n).map(e=>e.url)]:void 0})(),chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??o.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??o.nativeCurrency,rpcUrls:(null==(s=null==e?void 0:e.rpcUrls)?void 0:s.length)?e.rpcUrls:[(null==(a=o.rpcUrls.default)?void 0:a.http[0])??""]}]}),await c(),await u(t),o}catch(d){const e=d;if(e.code===Wb.code)throw new Wb(e);throw new Yb(e)}throw new Yb(h)}var s,a;async function c(){await xx(async()=>{const e=_p(await i.request({method:"eth_chainId"}));if(e!==t)throw new Error("User rejected switch after adding network.");return e},{delay:50,retryCount:20})}async function u(e){await new Promise(t=>{const n=r=>{"chainId"in r&&r.chainId===e&&(l.emitter.off("change",n),t())};l.emitter.on("change",n),l.emitter.emit("change",{chainId:e})})}},async onAccountsChanged(e){if(0===e.length){if(!t.isExtensionActive())return;this.onDisconnect()}else if(l.emitter.listenerCount("connect")){const e=(await this.getChainId()).toString();this.onConnect({chainId:e})}else l.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);l.emitter.emit("change",{chainId:t})},async onConnect(e){const t=await this.getAccounts();if(0===t.length)return;const n=Number(e.chainId);l.emitter.emit("connect",{accounts:t,chainId:n});const r=await this.getProvider();s&&(r.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),r.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),r.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),r.on("disconnect",c))},async onDisconnect(e){const t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),o&&(t.removeListener("chainChanged",o),o=void 0),c&&(t.removeListener("disconnect",c),c=void 0),s||(s=this.onConnect.bind(this),t.on("connect",s)))},onDisplayUri(e){l.emitter.emit("message",{type:"display_uri",data:e})}})}function yV(e,t){let n;try{n=e()}catch(qAe){return}return{getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=n.getItem(e))?t:null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)}}gV.type="metaMask";const bV=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>bV(e)(n),catch(e){return this}}}catch(qAe){return{then(e){return this},catch:t=>bV(t)(qAe)}}},vV=(e,t)=>(n,r,i)=>{let o={storage:yV(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)},r,i);const u=()=>{const e=o.partialize({...r()});return l.setItem(o.name,{state:e,version:o.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),u()};const h=e((...e)=>{n(...e),u()},r,i);let f;i.getInitialState=()=>h;const p=()=>{var e,t;if(!l)return;s=!1,a.forEach(e=>{var t;return e(null!=(t=r())?t:h)});const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=r())?e:h))||void 0;return bV(l.getItem.bind(l))(o.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return[!1,e.state];if(o.migrate){const t=o.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;const[i,s]=e;if(f=o.merge(s,null!=(t=r())?t:h),n(f,!0),i)return u()}).then(()=>{null==i||i(f,void 0),f=r(),s=!0,c.forEach(e=>e(f))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},o.skipHydration||p(),f||h},wV=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,o);return o},_V=e=>e?wV(e):wV,EV=Symbol(),xV=Object.getPrototypeOf,kV=new WeakMap,SV=e=>(e=>e&&(kV.has(e)?kV.get(e):xV(e)===Object.prototype||xV(e)===Array.prototype))(e)&&e[EV]||null,CV=(e,t=!0)=>{kV.set(e,t)},IV={},AV=e=>"object"==typeof e&&null!==e,PV=new WeakMap,OV=new WeakSet,[MV]=((e=Object.is,t=(e,t)=>new Proxy(e,t),n=e=>AV(e)&&!OV.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),r=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},i=new WeakMap,o=(e,t,n=r)=>{const s=i.get(e);if((null==s?void 0:s[0])===t)return s[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return CV(a,!0),i.set(e,[t,a]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const r=Reflect.get(e,t),i={value:r,enumerable:!0,configurable:!0};if(OV.has(r))CV(r,!1);else if(r instanceof Promise)delete i.value,i.get=()=>n(r);else if(PV.has(r)){const[e,t]=PV.get(r);i.value=o(e,t(),n)}Object.defineProperty(a,t,i)}),Object.preventExtensions(a)},s=new WeakMap,a=[1,1],c=r=>{if(!AV(r))throw new Error("object required");const i=s.get(r);if(i)return i;let l=a[0];const u=new Set,d=(e,t=++a[0])=>{l!==t&&(l=t,u.forEach(n=>n(e,t)))};let h=a[1];const f=e=>(t,n)=>{const r=[...t];r[1]=[e,...r[1]],d(r,n)},p=new Map,m=e=>{var t;const n=p.get(e);n&&(p.delete(e),null==(t=n[1])||t.call(n))},g=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),y={deleteProperty(e,t){const n=Reflect.get(e,t);m(t);const r=Reflect.deleteProperty(e,t);return r&&d(["delete",[t],n]),r},set(t,r,i,o){const a=Reflect.has(t,r),l=Reflect.get(t,r,o);if(a&&(e(l,i)||s.has(i)&&e(l,s.get(i))))return!0;m(r),AV(i)&&(i=SV(i)||i);let h=i;if(i instanceof Promise)i.then(e=>{i.status="fulfilled",i.value=e,d(["resolve",[r],e])}).catch(e=>{i.status="rejected",i.reason=e,d(["reject",[r],e])});else{!PV.has(i)&&n(i)&&(h=c(i));const e=!OV.has(h)&&PV.get(h);e&&((e,t)=>{if("production"!==(IV?"production":void 0)&&p.has(e))throw new Error("prop listener already exists");if(u.size){const n=t[3](f(e));p.set(e,[t,n])}else p.set(e,[t])})(r,e)}return Reflect.set(t,r,h,o),d(["set",[r],i,l]),!0}},b=t(g,y);s.set(r,b);const v=[g,(e=++a[1])=>(h===e||u.size||(h=e,p.forEach(([t])=>{const n=t[1](e);n>l&&(l=n)})),l),o,e=>{u.add(e),1===u.size&&p.forEach(([e,t],n)=>{if("production"!==(IV?"production":void 0)&&t)throw new Error("remove already exists");const r=e[3](f(n));p.set(n,[e,r])});return()=>{u.delete(e),0===u.size&&p.forEach(([e,t],n)=>{t&&(t(),p.set(n,[e]))})}}];return PV.set(b,v),Reflect.ownKeys(r).forEach(e=>{const t=Object.getOwnPropertyDescriptor(r,e);"value"in t&&(b[e]=r[e],delete t.value,delete t.writable),Object.defineProperty(g,e,t)}),b})=>[c,PV,OV,e,t,n,r,i,o,s,a])();function TV(e={}){return MV(e)}function RV(e,t,n){const r=PV.get(e);let i;"production"===(IV?"production":void 0)||r||console.warn("Please use proxy object");const o=[],s=r[3];let a=!1;const c=s(e=>{o.push(e),i||(i=Promise.resolve().then(()=>{i=void 0,a&&t(o.splice(0))}))});return a=!0,()=>{a=!1,c()}}const NV=TV({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),LV={state:NV,subscribe:e=>RV(NV,()=>e(NV)),push(e,t){e!==NV.view&&(NV.view=e,t&&(NV.data=t),NV.history.push(e))},reset(e){NV.view=e,NV.history=[e]},replace(e){NV.history.length>1&&(NV.history[NV.history.length-1]=e,NV.view=e)},goBack(){if(NV.history.length>1){NV.history.pop();const[e]=NV.history.slice(-1);NV.view=e}},setData(e){NV.data=e}},BV={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>"undefined"!=typeof window&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>BV.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return BV.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,isTelegram:()=>"undefined"!=typeof window&&(Boolean(window.TelegramWebviewProxy)||Boolean(window.Telegram)||Boolean(window.TelegramWebviewProxyProto)),formatNativeUrl(e,t,n){if(BV.isHttpUrl(e))return this.formatUniversalUrl(e,t,n);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,n);return`${r}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!BV.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;if(r.startsWith("https://t.me")){const e=Ke.from(t).toString("base64").replace(/[=]/g,"");r.endsWith("/")&&(r=r.slice(0,-1)),this.setWalletConnectDeepLink(r,n);const i=new URL(r);i.searchParams.set("startapp",e);return i.toString()}r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,n);return`${r}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise(t=>{setTimeout(t,e)}),openHref(e,t){const n=this.isTelegram()?"_blank":t;window.open(e,n,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(BV.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch(qAe){}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(BV.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch(qAe){}},removeWalletConnectDeepLink(){try{localStorage.removeItem(BV.WALLETCONNECT_DEEPLINK_CHOICE)}catch(qAe){}},setModalVersionInStorage(){try{"undefined"!=typeof localStorage&&localStorage.setItem(BV.WCM_VERSION,"2.7.0")}catch(qAe){}},getWalletRouterData(){var e;const t=null==(e=LV.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},jV=TV({enabled:"undefined"!=typeof location&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),DV={state:jV,subscribe:e=>RV(jV.events,()=>e(function(e,t){const n=PV.get(e);"production"===(IV?"production":void 0)||n||console.warn("Please use proxy object");const[r,i,o]=n;return o(r,i(),t)}(jV.events[jV.events.length-1]))),initialize(){jV.enabled&&void 0!==(null==crypto?void 0:crypto.randomUUID)&&(jV.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){jV.connectedWalletId=e},click(e){if(jV.enabled){const t={type:"CLICK",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}},track(e){if(jV.enabled){const t={type:"TRACK",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}},view(e){if(jV.enabled){const t={type:"VIEW",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}}},UV=TV({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),$V={state:UV,subscribe:e=>RV(UV,()=>e(UV)),setChains(e){UV.chains=e},setWalletConnectUri(e){UV.walletConnectUri=e},setIsCustomDesktop(e){UV.isCustomDesktop=e},setIsCustomMobile(e){UV.isCustomMobile=e},setIsDataLoaded(e){UV.isDataLoaded=e},setIsUiLoaded(e){UV.isUiLoaded=e},setIsAuth(e){UV.isAuth=e}},FV=TV({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),zV={state:FV,subscribe:e=>RV(FV,()=>e(FV)),setConfig(e){var t,n;DV.initialize(),$V.setChains(e.chains),$V.setIsAuth(Boolean(e.enableAuthMode)),$V.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),$V.setIsCustomDesktop(Boolean(null==(n=e.desktopWallets)?void 0:n.length)),BV.setModalVersionInStorage(),Object.assign(FV,e)}};var qV=Object.defineProperty,HV=Object.getOwnPropertySymbols,WV=Object.prototype.hasOwnProperty,KV=Object.prototype.propertyIsEnumerable,VV=(e,t,n)=>t in e?qV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const GV="https://explorer-api.walletconnect.com",ZV="wcm",YV="js-2.7.0";async function JV(e,t){const n=((e,t)=>{for(var n in t||(t={}))WV.call(t,n)&&VV(e,n,t[n]);if(HV)for(var n of HV(t))KV.call(t,n)&&VV(e,n,t[n]);return e})({sdkType:ZV,sdkVersion:YV},t),r=new URL(e,GV);r.searchParams.append("projectId",zV.state.projectId),Object.entries(n).forEach(([e,t])=>{t&&r.searchParams.append(e,String(t))});return(await fetch(r)).json()}const QV={getDesktopListings:async e=>JV("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>JV("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>JV("/w3m/v1/getInjectedListings",e),getAllListings:async e=>JV("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${GV}/w3m/v1/getWalletImage/${e}?projectId=${zV.state.projectId}&sdkType=${ZV}&sdkVersion=${YV}`,getAssetImageUrl:e=>`${GV}/w3m/v1/getAssetImage/${e}?projectId=${zV.state.projectId}&sdkType=${ZV}&sdkVersion=${YV}`};var XV=Object.defineProperty,eG=Object.getOwnPropertySymbols,tG=Object.prototype.hasOwnProperty,nG=Object.prototype.propertyIsEnumerable,rG=(e,t,n)=>t in e?XV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const iG=BV.isMobile(),oG=TV({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),sG={state:oG,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=zV.state;if("NONE"===e||"ALL"===t&&!e)return oG.recomendedWallets;if(BV.isArray(e)){const t={recommendedIds:e.join(",")},{listings:n}=await QV.getAllListings(t),r=Object.values(n);r.sort((t,n)=>e.indexOf(t.id)-e.indexOf(n.id)),oG.recomendedWallets=r}else{const{chains:e,isAuth:n}=$V.state,r=null==e?void 0:e.join(","),i=BV.isArray(t),o={page:1,sdks:n?"auth_v1":void 0,entries:BV.RECOMMENDED_WALLET_AMOUNT,chains:r,version:2,excludedIds:i?t.join(","):void 0},{listings:s}=iG?await QV.getMobileListings(o):await QV.getDesktopListings(o);oG.recomendedWallets=Object.values(s)}return oG.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var n in t||(t={}))tG.call(t,n)&&rG(e,n,t[n]);if(eG)for(var n of eG(t))nG.call(t,n)&&rG(e,n,t[n]);return e})({},e),{explorerRecommendedWalletIds:n,explorerExcludedWalletIds:r}=zV.state,{recomendedWallets:i}=oG;if("ALL"===r)return oG.wallets;i.length?t.excludedIds=i.map(e=>e.id).join(","):BV.isArray(n)&&(t.excludedIds=n.join(",")),BV.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),$V.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:s}=e,{listings:a,total:c}=iG?await QV.getMobileListings(t):await QV.getDesktopListings(t),l=Object.values(a),u=s?"search":"wallets";return oG[u]={listings:[...oG[u].listings,...l],total:c,page:null!=o?o:1},{listings:l,total:c}},getWalletImageUrl:e=>QV.getWalletImageUrl(e),getAssetImageUrl:e=>QV.getAssetImageUrl(e),resetSearch(){oG.search={listings:[],total:0,page:1}}},aG=TV({open:!1}),cG={state:aG,subscribe:e=>RV(aG,()=>e(aG)),open:async e=>new Promise(t=>{const{isUiLoaded:n,isDataLoaded:r}=$V.state;if(BV.removeWalletConnectDeepLink(),$V.setWalletConnectUri(null==e?void 0:e.uri),$V.setChains(null==e?void 0:e.chains),LV.reset("ConnectWallet"),n&&r)aG.open=!0,t();else{const e=setInterval(()=>{const n=$V.state;n.isUiLoaded&&n.isDataLoaded&&(clearInterval(e),aG.open=!0,t())},200)}}),close(){aG.open=!1}};var lG=Object.defineProperty,uG=Object.getOwnPropertySymbols,dG=Object.prototype.hasOwnProperty,hG=Object.prototype.propertyIsEnumerable,fG=(e,t,n)=>t in e?lG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const pG=TV({themeMode:"undefined"!=typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),mG={state:pG,subscribe:e=>RV(pG,()=>e(pG)),setThemeConfig(e){const{themeMode:t,themeVariables:n}=e;t&&(pG.themeMode=t),n&&(pG.themeVariables=((e,t)=>{for(var n in t||(t={}))dG.call(t,n)&&fG(e,n,t[n]);if(uG)for(var n of uG(t))hG.call(t,n)&&fG(e,n,t[n]);return e})({},n))}},gG=TV({open:!1,message:"",variant:"success"}),yG={state:gG,subscribe:e=>RV(gG,()=>e(gG)),openToast(e,t){gG.open=!0,gG.message=e,gG.variant=t},closeToast(){gG.open=!1}};class bG{constructor(e){this.openModal=cG.open,this.closeModal=cG.close,this.subscribeModal=cG.subscribe,this.setTheme=mG.setThemeConfig,mG.setThemeConfig(e),zV.setConfig(e),this.initUi()}async initUi(){if("undefined"!=typeof window){await Promise.resolve().then(()=>BHe);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),$V.setIsUiLoaded(!0)}}}const vG="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABxCAYAAAAj+QZ8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzrSURBVHgB7V3dcRs5Em4MtXWPq41gZ1+v7mwrgh3rArAUgagITNcFYDmAK9ERSBuBfQGsxY3Aku26V/MiOO7j1nqAQwMgRQ4xQONnhqOfr8q2TA4H1HzoRqO70c1g4JhUH/dhNKqgrhfT2cEMOoQaqxidyx+P5J8F8PpYjnkNPYLBgPGq+vxSFOJM/rhvXpp39ZAkGaUk40r+WK69jKT8JMdbQE8oYKDAByTJmMItGQj10OR7zyA3itFr2CQD1NhFMYYeMVhCHA8C1co7pV4yYXL4aSz/GVvfFFBBjxguIcCeOt4szYxOhiG2/V7M+T2yY7iEMOaTgIl8mBWkoth7Cduqah2u97JjuIQIUXqvYWlSohZyUEaDE/88/M+P0BMGrLIIYFAZ/R+HTGovJ+42IRqvYxZ485kKBob7QEgZZZoWoyMgrg//+vDX/0JPuA+ESLCXEApG/kxvm0LEkK2secDVZYjFpRZzIWibSyHm0COGSwjnYWoiyOIqjujXskcJUWCBqgItLuriPipOgAombqBH7EEGTKovUvz/xIdxnc8Rx8IdiHpxn7ouCVJXGnPIBD1h9p5BIU6kS6ZkBXt//uvf365fk0SIcvJJv5LUL6Wcdvq1w09z+c9MeknfSHLmEAteX8t7B30EBHsBHkLkPSsI+h482bOs3froERAT+UdLMcPlSch91M0P0w9Pz5bXpqksRcaW6Yj/H8v3vkpyLvRuOBzGxd6F2voZwpBEyKT6XMln8dF4BCzfjW2oz2hCjAu89FxmiPkctyNmMWprdOS5J11dSQsrVgXjxJAT8lyqp2aMpTnGxv1TJCRgdyzO5Jf7Giwtgv8GwWhfH5T0hK0fUQu6UeUf8UfvxY1Jl0LIHMJQBksL5zMIhXCqpLDAFpNrYSAwymnIKEkf4PUv6/+NJsQs2BHirKTlHUVaTAw9cB1xqaQijJDACYGTzUQ5adAqcbb+UuI+RPwCcTgyodjSe6UQ/4ZAtLrLi4DYhn5Y5DVscvjlguLK3xyDvWm+lEYI5+8hHiWJFMEvIRA1/3ZgfYMV9OgfYzPKZWrxfv5JLtx8DCFQhD+5bL6cRIgSN+IXb4GXlCi1VbQEt0IWdA40yRztXaG5DaEQ/Nj2crrrpP72BtJAkJRg1bhlAZr9Cc0y1LPXK/1KTYVZbcsB3rapw2RC1AwW0WvJEktS7A8sWDWyH61jkD/ul3q1xwhVUwj0HnN+1vZ2Huei4Ghvp/qwSumxfWd7I4NqRND3TdLt43rbmO7+PYYNgj93bTazEKIG4PUppELHyM+t76WrRhoEzFw+uMk/Ph0FW1O3N3/l8+9lc7/Lgd6jboR0TF5VNyeW++eQEj8EtKpf7SmGC4i78VvpRPTuUfLGQ1A3CpHkjEOIgk2ti3zXUtJiiq6gc38DXEar+15LMkgqLishSnWhOZce9tyX68mF5f4pUjL3XmHZqC1hVGkJocBnIdcN6uXZI4ZKR2obO22Rx/VE6esG6m+n/nsLW/jX/Rnp5GuTDpP7Fb6IGzJCPMadhHCVjc1rnBVppAg4b5rCinBeHzs/x7fd9uqhuNz59TfrPY3qDA8f3JIxD/lYZzH1TKRgztXEcu8ZWiztH6vtD17wlt23w/qxH1NwI5IMNRx0iDyk2POntMUiLDpftIeOOZ9ufxd5fYv1Y6RjDCFIIAPRywkq9YuxQvp8WAkxkKS2HWdT+VgFpvWw7zG24Dv2Jq8/kv6nl3rH7L4eQ9AQQojcw4BQJ7yiJ2AvhCAMKe+CQqgrKBs+bmecAIxyAlldKUk7g0R4s070ovpdadJ8DL6TM+DPoHizEeGDyeHNmZwHYYukiDA3E0HMGUAsD4fOIAP2LF/EnKtjGAqtQG2EOCzTfDT0/+UM0jFhte8QN+rnur526U+cRXIMuZ8oLgJUWG/nM9bg3wBqFXWalO7UwEplbeYORexGN+6qSLp26Wijws7ktf4sQvQvXT0hb65ywOw92twk0oSG0+mvfhd9KBQhLUeCc2EOjsQ5EjFc/vIul0YHUBOUFR8bUrxQ/jpprXV1VFoTcvgJ3d5H0D0uncRgEvSoeCGlqzIvL1xmaddYfScFft114QIEM9LxFfrFZXKq6T0FbgzT1os4YEbjR2lx9W7KDh3M1Pf4H+wKHVgqdxmFdpknx8TjgRkb1BytBwDtyxIq6N6J1UBEKd0Z7+ARmhDj0k53l6dAiGd6F/+wsfL2rjyzPR9y3ARhk3jPseF+V6RguHF3a0rZZxmLIaLV26uca9o7W0Kf4PUP0x4Lhg0NXve78ukI8boXYnbgsxoayPEQRQz6m27dGnmRGGm7LwgOUK38OwxO4oJNFjxuDldIihiazdwzGT+p1NkLnQlOdcUsVFY75+/7cNrdFWQP4Zq0nRI0MeiW2SSIq4yQxaM0POJOoCsJ0VJSjMqtC3g9x5j8dPa35Bzg+4hkQnSlAv7MxOCpiQGIOeQowXHPEEWIJkFgXZEx5ImnPAasDOj7kJxJEHagg/PgIe/SEbS8rGYlm26Aaw5meRzDA4ZTQizF8LvHA/dlWSVEp+aMLgTryE3iwKj4y/ew22DZTmHJXFQLNkbvdpH8ADX/43d4wNiIh7yqvpyY+k47IUPi8qEv6itCMP4hivC6IlnhOR/+EKAIMalAO04y8J/hfgjQEhJQdrsb7C5ddGjQi7oOPMFuICXjkYwVstTtjYKOEGJQarY6FKR8YsvSSgx37rOHpsZM9vvNNKqgfRxWKf2mqDCOW0G7ZTedfnjyCnYAU8zyRE6Mt31NDL2GpFWGo0IdLcA2dMCLmar8o01sXL9cZvaktSBN1xjt4bgTU4P4nFATOBnLzMWZ/YhxFqwRIc1q9FchEWFV2CZ9PIwtbJapnaiM/Rx9rxy4zVzUJ0hPM2UuGrVUP5fqRpXSZrB3Ysqnxh0M6rmfoML2uXZdaC22MDQBVueiOV+H8Y4K/Lv2hfkjg03YSYDPmuXrjMqZQBouJbnpNbkCoc612/Zo6oDrt+Pca4s/UW4zaWEdc/zLWexL9bHdu4qrS7gFJyE4VojbBR2o1IfpMHqyt4LtrHBABwdJrYTcdmhQ43iDXJbrvQ+05QDoGvLtpTqpddLNqV7xe8s46x0arMVqNrB1vf+w0KoOWGtYgJ3nWleyE2LUlK2NRRpsprmNdKHWvrbvZkvCsBZLa0JLkcsSxRLq6aTklxAsZ5RnzbiFpUa6+eXLrWtdSeGjkf29tmJpDZgKRI66kumkZCUkqXyqC42yfqZlats47VahcL5H2vipIjjOMoOq2UBkocyMhFD7ykahGSfRRcVaH177oR9nf13/+rMEVp9zF/scx5KST0K0Ps+PRh3dqKJiZLCXJCmhFfscx6ivLIS06vMcEFbp6Ar7VCkxxT49ZzLD15RkQjz6PA1aOmabY/mlo713LaV7KE1KEF2Qki4hHn2eBNEoX95Pu+39EL8ZlRRbtW4bkggxMzbOWeiFtZhl5f+YY7FVmfeUodkLCACFFFOt27sdSO1jWEEX0oH7jkb9QrNPKP0fdvaunQMFuh9iBQEgkLJP8QqkEcI6OOjfVprbsQPfgLt3Ldn5qI7pBSKAlNZJnEZI7h25uidvO/xJU428fdNmnI5zICEupL1GSpvqbO2Tgkjt9JlXXalSftsHQI36II7lXSeorvL92OjgihSA99YLVJ8Uu+XVU6dPAlx1FQty//OFNzbBxW9ARYTaWgKlUYYLjtsdkuLMRng8IUWLoy4UusL0gbPIJSt+Btq9CA87oPuzYLRxHdDGSUudep1EsYF4QqgmpAuqYICq3tD6kIL619JapdIJoXWf9kJ5iTHJo7nYW0pSpaislLDlQkXZrp74S2mMlGlNA6FVqmlb4b1uDVkMl7XFvlFpadMzkNILN/QX0xDq5O0BOeRJlY6QVqkhXaiLIgshCCRlevV0DJvZPUjGaow0sxe73VDThjQRz0lSsQ7q+hEyOYKaDjN6u1Yi5GJ/KScFtoc9bVqWGc6pOytTL1Lrmci4AlZM9etxDseU7pzB98WGXldPD6AnJCdbm9k+lsScgSpEY2qb6JomQR0Umghqlwr1DEKAXagpnoY+6oStIVv2uyFmDnlB1d/hR+GwCzUbUVw/+6E5XynotOVROogLKrWz8yZQgkkP2ZwM7gXDJoTSkJ7Y2bkJPeNpxT5r/sdP0BMGLiHMX6FUQHy7V+oxjFxeCcpQMGQwRljQ48+29NZfNwADlxAvLpOzz/vqQk3E3SYkw7n2oUnJsAkRwmEFiXzn/gYkJQOXEGFP51Eue07zhREwJCkZupVldxYWLH/VB1cXat5fdaJhE8JriwUl3nTRrk4T3Bbdq1NCDUEYNCFm87Z8SAtzUukMOoK94bHo7Yw6orMjbTmxDOD05U/SBz2l2wab3ncgjS78H0eagrHjdQciAAAAAElFTkSuQmCC",wG=Mx({id:143,name:"Monad",nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://monad-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp"]}},blockExplorers:{default:{name:"Monad Explorer",url:"https://monadexplorer.com"}}}),_G="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",EG="qtIcCe_-8t4rIWktnWJm0";let xG=null;const kG=()=>{const e=(xG||"undefined"==typeof window||(xG=new bG({projectId:"1d05a3403626aae7674102b52350de60",themeMode:"light",themeVariables:{"--wcm-accent-color":"#7042D2","--wcm-background-color":"#ffffff"},explorerRecommendedWalletIds:["c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96","4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0","1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369"]})),xG);e&&e.closeModal()},SG=function(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=FI({storage:qI()}),syncConnectedChain:r=!0,ssr:i=!1,...o}=e,s="undefined"!=typeof window&&t?CI():void 0,a=TI(()=>o.chains),c=TI(()=>{const e=[],t=new Set;for(const n of o.connectors??[]){const r=l(n);if(e.push(r),!i&&r.rdns){const e="string"==typeof r.rdns?[r.rdns]:r.rdns;for(const n of e)t.add(n)}}if(!i&&s){const n=s.getProviders();for(const r of n)t.has(r.info.rdns)||e.push(l(u(r)))}return e});function l(e){var t;const r=(i=function(e=11){if(!HI||WI+e>512){HI="",WI=0;for(let e=0;e<256;e++)HI+=(256+256*Math.random()|0).toString(16).substring(1)}return HI.substring(WI,WI+++e)}(),new BI(i));var i;const s={...e({emitter:r,chains:a.getState(),storage:n,transports:o.transports}),emitter:r,uid:r.uid};return r.on("connect",b),null==(t=s.setup)||t.call(s),s}function u(e){const{info:t}=e,n=e.provider;return xI({target:{...t,id:t.rdns,provider:n}})}const d=new Map;function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let f;const p="0.0.0-canary-";f=jC.startsWith(p)?Number.parseInt(jC.replace(p,""),10):Number.parseInt(jC.split(".")[0]??"0",10);const m=TI(II(n?OI(h,{migrate(e,t){if(t===f)return e;const n=h(),r=g(e,n.chainId);return{...n,chainId:r}},name:"store",partialize:e=>({connections:{__type:"Map",value:Array.from(e.connections.entries()).map(([e,t])=>{const{id:n,name:r,type:i,uid:o}=t.connector,s={id:n,name:r,type:i,uid:o};return[e,{...t,connector:s}]})},chainId:e.chainId,current:e.current}),merge(e,t){"object"==typeof e&&e&&"status"in e&&delete e.status;const n=g(e,t.chainId);return{...t,...e,chainId:n}},skipHydration:i,storage:n,version:f}):h));function g(e,t){return e&&"object"==typeof e&&"chainId"in e&&"number"==typeof e.chainId&&a.getState().some(t=>t.id===e.chainId)?e.chainId:t}function y(e){m.setState(t=>{const n=t.connections.get(e.uid);return n?{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts??n.accounts,chainId:e.chainId??n.chainId,connector:n.connector})}:t})}function b(e){"connecting"!==m.getState().status&&"reconnecting"!==m.getState().status&&m.setState(t=>{const n=c.getState().find(t=>t.uid===e.uid);return n?(n.emitter.listenerCount("connect")&&n.emitter.off("connect",y),n.emitter.listenerCount("change")||n.emitter.on("change",y),n.emitter.listenerCount("disconnect")||n.emitter.on("disconnect",v),{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts,chainId:e.chainId,connector:n}),current:e.uid,status:"connected"}):t})}function v(e){m.setState(t=>{const n=t.connections.get(e.uid);if(n){const e=n.connector;e.emitter.listenerCount("change")&&n.connector.emitter.off("change",y),e.emitter.listenerCount("disconnect")&&n.connector.emitter.off("disconnect",v),e.emitter.listenerCount("connect")||n.connector.emitter.on("connect",b)}if(t.connections.delete(e.uid),0===t.connections.size)return{...t,connections:new Map,current:null,status:"disconnected"};const r=t.connections.values().next().value;return{...t,connections:new Map(t.connections),current:r.connector.uid}})}return m.setState(h()),r&&m.subscribe(({connections:e,current:t})=>{var n;return t?null==(n=e.get(t))?void 0:n.chainId:void 0},e=>{if(a.getState().some(t=>t.id===e))return m.setState(t=>({...t,chainId:e??t.chainId}))}),null==s||s.subscribe(e=>{const t=new Set,r=new Set;for(const n of c.getState())if(t.add(n.id),n.rdns){const e="string"==typeof n.rdns?[n.rdns]:n.rdns;for(const t of e)r.add(t)}const i=[];for(const n of e){if(r.has(n.info.rdns))continue;const e=l(u(n));t.has(e.id)||i.push(e)}n&&!m.persist.hasHydrated()||c.setState(e=>[...e,...i],!0)}),{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:function(e={}){const t=e.chainId??m.getState().chainId,n=a.getState().find(e=>e.id===t);if(e.chainId&&!n)throw new zC;{const e=d.get(m.getState().chainId);if(e&&!n)return e;if(!n)throw new zC}{const e=d.get(t);if(e)return e}let r;if(o.client)r=o.client({chain:n});else{const e=n.id,t=a.getState().map(e=>e.id),i={},s=Object.entries(o);for(const[n,r]of s)if("chains"!==n&&"client"!==n&&"connectors"!==n&&"transports"!==n)if("object"==typeof r)if(e in r)i[n]=r[e];else{if(t.some(e=>e in r))continue;i[n]=r}else i[n]=r;r=JC({...i,chain:n,batch:i.batch??{multicall:!0},transport:t=>o.transports[e]({...t,connectors:c})})}return d.set(t,r),r},get state(){return m.getState()},setState(e){let t;t="function"==typeof e?e(m.getState()):e;const n=h();"object"!=typeof t&&(t=n);Object.keys(n).some(e=>!(e in t))&&(t=n),m.setState(t,!0)},subscribe:(e,t,n)=>m.subscribe(e,t,n?{...n,fireImmediately:n.emitImmediately}:void 0),_internal:{mipd:s,async revalidate(){const e=m.getState(),t=e.connections;let n=e.current;for(const[,r]of t){const e=r.connector;!!e.isAuthorized&&await e.isAuthorized()||(t.delete(e.uid),n===e.uid&&(n=null))}m.setState(e=>({...e,connections:t,current:n}))},store:m,ssr:Boolean(i),syncConnectedChain:r,transports:o.transports,chains:{setState(e){const t="function"==typeof e?e(a.getState()):e;if(0!==t.length)return a.setState(t,!0)},subscribe:e=>a.subscribe(e)},connectors:{providerDetailToConnector:u,setup:l,setState:e=>c.setState("function"==typeof e?e(c.getState()):e,!0),subscribe:e=>c.subscribe(e)},events:{change:y,connect:b,disconnect:v}}}}({chains:[CW,gW,PW,hW,AW,fW,SW,mW,wG],connectors:[xI(),gV({dappMetadata:{name:"Coinley Payment",icon:vG}}),OW({appName:"Coinley Payment",appLogoUrl:vG})],transports:{[CW.id]:VI([aI(`https://eth-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://eth-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://cloudflare-eth.com",{timeout:1e4,retryCount:1}),aI("https://eth.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://ethereum.publicnode.com",{timeout:1e4,retryCount:1})]),[gW.id]:VI([aI(`https://bnb-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://bnb-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://bsc-dataseed.bnbchain.org",{timeout:1e4,retryCount:1}),aI("https://bsc-dataseed-public.bnbchain.org",{timeout:1e4,retryCount:1}),aI("https://bsc.nodereal.io",{timeout:1e4,retryCount:1})]),[PW.id]:VI([aI(`https://polygon-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://polygon-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://polygon.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://polygon-rpc.com",{timeout:1e4,retryCount:1}),aI("https://polygon.drpc.org",{timeout:1e4,retryCount:1})]),[hW.id]:VI([aI(`https://arb-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://arb-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://arb1.arbitrum.io/rpc",{timeout:1e4,retryCount:1}),aI("https://arbitrum.llamarpc.com",{timeout:1e4,retryCount:1})]),[AW.id]:VI([aI(`https://opt-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://opt-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://mainnet.optimism.io",{timeout:1e4,retryCount:1}),aI("https://optimism.llamarpc.com",{timeout:1e4,retryCount:1})]),[fW.id]:VI([aI(`https://avax-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://avax-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://api.avax.network/ext/bc/C/rpc",{timeout:1e4,retryCount:1}),aI("https://avalanche.public-rpc.com",{timeout:1e4,retryCount:1})]),[SW.id]:VI([aI(`https://celo-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://celo-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://forno.celo.org",{timeout:1e4,retryCount:1}),aI("https://celo.drpc.org",{timeout:1e4,retryCount:1})]),[mW.id]:VI([aI(`https://base-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://base-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://mainnet.base.org",{timeout:1e4,retryCount:1}),aI("https://base.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://base.meowrpc.com",{timeout:1e4,retryCount:1})]),[wG.id]:VI([aI(`https://monad-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1})])}});class CG{constructor(e,t,n=null){this.baseURL=e.endsWith("/")?e.slice(0,-1):e,t&&t.startsWith("pk_")?(this.publicKey=t,this.apiKey=null,this.apiSecret=null):(this.publicKey=null,this.apiKey=t,this.apiSecret=n)}async request(e,t={}){const n=`${this.baseURL}${e}`,r={"Content-Type":"application/json",...t.headers};this.publicKey?r["X-Public-Key"]=this.publicKey:(r["X-API-Key"]=this.apiKey,r["X-API-Secret"]=this.apiSecret);const i=t.timeout||6e4,o=new AbortController,s=setTimeout(()=>o.abort(),i);try{const e=await fetch(n,{...t,headers:r,signal:o.signal});if(clearTimeout(s),!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error||`HTTP ${e.status}`)}return e.json()}catch(cF){if(clearTimeout(s),"AbortError"===cF.name)throw new Error(`Request timeout after ${i/1e3}s: ${e}`);throw cF}}async getNetworks(){try{return await this.request("/api/networks")}catch(cF){return{networks:[{id:"1",name:"Ethereum",shortName:"ethereum",chainId:"0x1",type:"ethereum"},{id:"56",name:"BSC",shortName:"bsc",chainId:"0x38",type:"bsc"},{id:"137",name:"Polygon",shortName:"polygon",chainId:"0x89",type:"polygon"},{id:"42161",name:"Arbitrum",shortName:"arbitrum",chainId:"0xa4b1",type:"arbitrum"},{id:"10",name:"Optimism",shortName:"optimism",chainId:"0xa",type:"optimism"},{id:"43114",name:"Avalanche",shortName:"avalanche",chainId:"0xa86a",type:"avalanche"}]}}}async getTokens(){try{return await this.request("/api/networks/stablecoins")}catch(cF){return{stablecoins:[{id:"1",name:"Tether USD",symbol:"USDT",contractAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"2",name:"USD Coin",symbol:"USDC",contractAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"3",name:"Tether USD",symbol:"USDT",contractAddress:"0x55d398326f99059fF775485246999027B3197955",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"4",name:"USD Coin",symbol:"USDC",contractAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"5",name:"Tether USD",symbol:"USDT",contractAddress:"0xc2132D05D31c914a87c6611C10748AEb04B58e8F",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"6",name:"USD Coin",symbol:"USDC",contractAddress:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"7",name:"Tether USD",symbol:"USDT",contractAddress:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"8",name:"USD Coin",symbol:"USDC",contractAddress:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"9",name:"Tether USD",symbol:"USDT",contractAddress:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"10",name:"USD Coin",symbol:"USDC",contractAddress:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"11",name:"Tether USD",symbol:"USDT",contractAddress:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"12",name:"USD Coin",symbol:"USDC",contractAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"13",name:"Tether USD",symbol:"USDT",contractAddress:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"14",name:"USD Coin",symbol:"USDC",contractAddress:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"15",name:"Tether USD",symbol:"USDT",contractAddress:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}},{id:"16",name:"USD Coin",symbol:"USDC",contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}}]}}}async createPayment(e){return await this.request("/api/payments/create",{method:"POST",body:JSON.stringify(e)})}async verifyQRPayment(e){return await this.request("/api/payments/verify-qr",{method:"POST",body:JSON.stringify({paymentId:e})})}async checkPaymentStatus(e){return await this.request(`/api/payments/status/${e}`)}async getContractInfo(e){try{const t=await this.request(`/api/payments/contract/${e}`);if(!t.success)throw new Error("Contract not supported on this network");return t.contractInfo}catch(cF){throw new Error(cF.message||"Failed to get contract information")}}async processPayment(e,t,n,r){try{return await this.request("/api/payments/process",{method:"POST",body:JSON.stringify({paymentId:e,transactionHash:t,network:n,senderAddress:r}),timeout:9e4})}catch(cF){throw console.error("❌ [API] processPayment error:",cF),console.error("❌ [API] processPayment error details:",{message:cF.message,name:cF.name,stack:cF.stack}),cF}}async failPayment(e,t="Payment cancelled by user"){return await this.request("/api/payments/fail",{method:"POST",body:JSON.stringify({paymentId:e,reason:t,status:"failed"})})}async getSupportedDepositChains(){try{return await this.request("/api/deposits/supported-chains")}catch(cF){return console.warn("Failed to get supported deposit chains:",cF.message),{success:!0,chains:[{chainId:8453,name:"Base",confirmations:20},{chainId:56,name:"BSC",confirmations:20},{chainId:42161,name:"Arbitrum",confirmations:20}]}}}async createDepositPayment(e){return await this.request("/api/deposits/create",{method:"POST",body:JSON.stringify(e)})}async getDepositStatus(e){return await this.request(`/api/deposits/status/${e}`)}async getDepositBalance(e){return await this.request(`/api/deposits/balance/${e}`)}isDepositSupported(e){return[8453,56,42161,137,10,43114,143].includes(parseInt(e))}}const IG=["https://solana-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp","https://solana-mainnet.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0","https://api.mainnet-beta.solana.com","https://solana-api.projectserum.com","https://rpc.ankr.com/solana"],AG="solana-mainnet",PG="Solana",OG={SOL:{symbol:"SOL",name:"Solana",decimals:9,isNative:!0,address:null,logo:"sol",isStablecoin:!1},USDC:{symbol:"USDC",name:"USD Coin",decimals:6,isNative:!1,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",logo:"usdc",isStablecoin:!0},USDT:{symbol:"USDT",name:"Tether USD",decimals:6,isNative:!1,address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",logo:"usdt",isStablecoin:!0},EURC:{symbol:"EURC",name:"Euro Coin",decimals:6,isNative:!1,address:"HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr",logo:"eurc",isStablecoin:!0}},MG={PHANTOM:{name:"Phantom",id:"phantom",icon:"phantom",downloadUrl:"https://phantom.app/",deepLink:"https://phantom.app/ul/browse/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",firefox:"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/",ios:"https://apps.apple.com/us/app/phantom-solana-wallet/id1598432977",android:"https://play.google.com/store/apps/details?id=app.phantom"}},SOLFLARE:{name:"Solflare",id:"solflare",icon:"solflare",downloadUrl:"https://solflare.com/",deepLink:"https://solflare.com/ul/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",firefox:"https://addons.mozilla.org/en-US/firefox/addon/solflare-wallet/",ios:"https://apps.apple.com/us/app/solflare/id1580902717",android:"https://play.google.com/store/apps/details?id=com.solflare.mobile"}},BACKPACK:{name:"Backpack",id:"backpack",icon:"backpack",downloadUrl:"https://backpack.app/",deepLink:"https://backpack.app/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",ios:"https://apps.apple.com/us/app/backpack-crypto-wallet/id6448811949"}},TRUST_WALLET:{name:"Trust Wallet",id:"trust",icon:"trust",downloadUrl:"https://trustwallet.com/",deepLink:"https://link.trustwallet.com/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp"}},MAGIC_EDEN:{name:"Magic Eden",id:"magiceden",icon:"magiceden",downloadUrl:"https://wallet.magiceden.io/",deepLink:"https://wallet.magiceden.io/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/magic-eden-wallet/mkpegjkblkkefacfnmkajcjmabijhclg",ios:"https://apps.apple.com/app/magic-eden-wallet/id6449729293",android:"https://play.google.com/store/apps/details?id=io.magiceden.wallet"}}},TG=OG,RG="evm",NG="solana",LG={ethereum:1,bsc:56,polygon:137,arbitrum:42161,optimism:10,avalanche:43114,celo:42220,base:8453,monad:143},BG=e=>"number"==typeof e?e:"string"==typeof e?e.startsWith("0x")?parseInt(e,16):parseInt(e,10):1,jG=e=>LG[e]||1,DG=e=>(e=>{var t;if(!e)return!1;const n=e.toString().toLowerCase();return["solana","solana-mainnet","103"].includes(n)||n===AG||(null==(t=PG)?void 0:t.toLowerCase())===n})(e)?NG:RG,UG=()=>{const[e,t]=Yt.useState(null),[n,r]=Yt.useState(null),[i,o]=Yt.useState(""),{connect:s,connectors:a}=qP(),{isConnected:c,address:l,chain:u}=kA(),{switchChain:d}=function(e={}){const{mutation:t}=e,n=eA(e),r=OP(n),{mutate:i,mutateAsync:o,...s}=UP({...t,...r});return{...s,chains:FP({config:n}),switchChain:i,switchChainAsync:o}}(),h=Yt.useRef(c);Yt.useEffect(()=>{r(c&&l?{account:l,chainId:null==u?void 0:u.id,walletType:e}:null)},[c,l,u,e]),Yt.useEffect(()=>{c&&!h.current&&kG(),h.current=c},[c]);return{selectedWalletType:e,connectedWallet:n,connectionError:i,isConnected:c,address:l,chain:u,connectors:a,handleWalletSelection:e=>{t(e),o("")},connectWallet:async(e,t=null)=>{var n,r,i,a;if(!e)return o("Please select a wallet first"),!1;try{o("");"walletConnect"===e.id||(null==(n=e.name)||n.toLowerCase().includes("walletconnect"));if(await s({connector:e}),t){const n=jG(t.shortName),s=(null==(r=e.name)?void 0:r.toLowerCase())||"",l=s.includes("zerion")||s.includes("trust")||s.includes("rabby")?5e3:500;await new Promise(e=>setTimeout(e,l));const u=uI(SG).chainId;if(n&&u!==n)try{await d({chainId:n}),await new Promise(e=>setTimeout(e,1e3))}catch(c){return 4001===c.code||(null==(i=c.message)?void 0:i.includes("User rejected"))?o("Network switch was cancelled by user"):(null==(a=c.message)?void 0:a.includes("Unrecognized chain ID"))?o(`${t.name} network is not added to your wallet. Please add it manually.`):o(`Failed to switch to ${t.name}. Please switch manually in your wallet.`),!1}}return!0}catch(jHe){return 4001===jHe.code||jHe.message.includes("User rejected")||jHe.message.includes("rejected")?o("User cancelled the connection request"):o(`Failed to connect to ${e.name}. Please try again.`),!1}},disconnectWallet:()=>{r(null),t(null),o("")},switchChain:d,ensureCorrectNetwork:async e=>{var t,n;if(!e)return!0;try{const i=jG(e.shortName),s=uI(SG).chainId;if(i&&s!==i)try{return await d({chainId:i}),await new Promise(e=>setTimeout(e,1e3)),!0}catch(r){return 4001===r.code||(null==(t=r.message)?void 0:t.includes("User rejected"))?o("Network switch was cancelled. Please switch to the correct network in your wallet."):(null==(n=r.message)?void 0:n.includes("Unrecognized chain ID"))?o(`${e.name} network is not added to your wallet. Please add it manually.`):o(`Failed to switch to ${e.name}. Please switch manually in your wallet.`),!1}return!0}catch(cF){return o("Failed to verify network. Please check your wallet connection."),!1}},clearError:()=>{o("")},resetState:()=>{o("")},setSelectedWalletType:t,connect:s}},$G=(e,t,n=!1)=>{if(!e||"string"!=typeof e)throw new Error(`Missing ${t} address`);if(!e.startsWith("0x"))throw new Error(`Invalid ${t} address format: must start with 0x`);if(42!==e.length)throw new Error(`Invalid ${t} address length: expected 42 characters, got ${e.length}`);if("0x0000000000000000000000000000000000000000"===e&&!n)throw new Error(`Invalid ${t} address: cannot be zero address`)},FG=e=>{const t=(e=>{$G(e.token,"token"),$G(e.recipient1,"recipient1"),$G(e.recipient2,"recipient2");const t=0n===BigInt(e.recipient3Percentage||0);if($G(e.recipient3,"recipient3",t),!e.paymentId||"string"!=typeof e.paymentId||0===e.paymentId.length)throw new Error("Invalid payment ID: must be a non-empty string");let n,r,i,o;try{n=BigInt(e.amount||0),r=BigInt(e.recipient1Percentage||0),i=BigInt(e.recipient2Percentage||0),o=BigInt(e.recipient3Percentage||0)}catch(a){throw new Error("Invalid numeric values: cannot convert to BigInt")}if(n<=0n)throw new Error(`Invalid amount: ${e.amount} (must be greater than 0)`);const s=r+i+o;if(10000n!==s)throw new Error(`Invalid percentages: total is ${s} but must equal 10000 basis points (100%). Individual: ${r}, ${i}, ${o}`);return{amount:n,percentage1:r,percentage2:i,percentage3:o}})(e);return{token:e.token,amount:t.amount,paymentId:e.paymentId,recipient1:e.recipient1,recipient2:e.recipient2,recipient3:e.recipient3,recipient1Percentage:t.percentage1,recipient2Percentage:t.percentage2,recipient3Percentage:t.percentage3}},zG=[{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],qG=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],HG=e=>{var t,n;const r=(null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())||(null==(n=null==e?void 0:e.toString())?void 0:n.toLowerCase())||"",i=(null==e?void 0:e.code)||(null==e?void 0:e.reason)||"";return r.includes("user rejected")||r.includes("user denied")||r.includes("user cancelled")||r.includes("rejected by user")||4001===i||"ACTION_REJECTED"===i?{type:"user_rejected",title:"Transaction Cancelled",message:"You cancelled the transaction. No charges were made.",suggestion:'Click "Pay Now" to try again when you\'re ready.'}:r.includes("insufficient funds")||r.includes("insufficient balance")||r.includes("insufficient eth")||r.includes("insufficient matic")||r.includes("insufficient bnb")||-32e3===i?{type:"insufficient_funds",title:"Insufficient Funds",message:"You don't have enough tokens or gas fees in your wallet.",suggestion:"Add more funds to your wallet and try again."}:r.includes("network error")||r.includes("rpc error")||r.includes("connection failed")||r.includes("timeout")||r.includes("request failed")?{type:"network_error",title:"Network Error",message:"Unable to connect to the blockchain network.",suggestion:"Check your internet connection and try again."}:r.includes("wrong network")||r.includes("unsupported network")||r.includes("chain mismatch")||4902===i?{type:"wrong_network",title:"Wrong Network",message:"Please switch to the correct network in your wallet.",suggestion:"Your wallet should prompt you to switch networks."}:r.includes("wallet not connected")||r.includes("no provider")||r.includes("wallet disconnected")||4900===i?{type:"wallet_disconnected",title:"Wallet Disconnected",message:"Your wallet is not connected.",suggestion:"Please reconnect your wallet and try again."}:r.includes("gas estimation failed")||r.includes("execution reverted")||r.includes("out of gas")?{type:"gas_error",title:"Transaction Failed",message:"The transaction couldn't be processed.",suggestion:"This might be a temporary issue. Please try again."}:r.includes("approve")&&r.includes("failed")?{type:"approval_failed",title:"Token Approval Failed",message:"Failed to approve token spending.",suggestion:"Please try the approval step again."}:r.includes("transaction failed")||r.includes("revert")||r.includes("contract call failed")?{type:"transaction_failed",title:"Transaction Failed",message:"The blockchain transaction was unsuccessful.",suggestion:"Please check your wallet and try again."}:r.includes("popup")||r.includes("blocked")?{type:"popup_blocked",title:"Wallet Popup Blocked",message:"Your browser blocked the wallet popup.",suggestion:"Please allow popups for this site and try again."}:r.includes("rate limit")||r.includes("too many requests")?{type:"rate_limited",title:"Too Many Requests",message:"Please wait a moment before trying again.",suggestion:"Wait 30 seconds and retry your transaction."}:r.includes("payment not yet confirmed")||r.includes("not yet confirmed on-chain")||r.includes("payment not found on-chain")||r.includes("please complete the payment")?{type:"payment_pending",title:"Payment Pending",message:"Your payment is still being confirmed on the blockchain.",suggestion:"Please wait a moment and try again, or check if your transaction completed successfully."}:r.includes("deep link")||r.includes("app not installed")||r.includes("wallet app")?{type:"mobile_wallet_error",title:"Wallet App Issue",message:"Unable to open or connect to your wallet app.",suggestion:"Make sure your wallet app is installed and try again."}:{type:"unknown_error",title:"Something Went Wrong",message:"An unexpected error occurred.",suggestion:"Please try again or contact support if the problem persists."}},WG=(e,t="")=>({timestamp:(new Date).toISOString(),context:t,userFriendly:HG(e),technical:{message:(null==e?void 0:e.message)||"Unknown error",code:null==e?void 0:e.code,reason:null==e?void 0:e.reason,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name}}),KG=async(e,t)=>{try{const n=await lI(e,{chainId:t}),r=120n,i=100n;return{maxFeePerGas:n.maxFeePerGas?n.maxFeePerGas*r/i:void 0,maxPriorityFeePerGas:n.maxPriorityFeePerGas?n.maxPriorityFeePerGas*r/i:void 0}}catch(cF){return{}}},VG="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",GG=(e,t,n,r,i,o)=>{const[s,a]=Yt.useState("idle"),[c,l]=Yt.useState(""),[u,d]=Yt.useState(null),{data:h,isPending:f}=function(e={}){const{mutation:t}=e,n=PP(eA(e)),{mutate:r,mutateAsync:i,...o}=UP({...t,...n});return{...o,sendTransaction:r,sendTransactionAsync:i}}(),{isLoading:p,isSuccess:m}=HP({hash:h}),g=async()=>{var e,t,n,r,o,s,c;try{a("splitPayment");const l=window.coinleyPendingSplitPayment;if(!l)throw new Error("Missing split payment data");const{contractCall:f,selectedToken:p,paymentData:m,selectedNetwork:g}=l,y=g.chainId||10,b=await i.getContractInfo(y),{abi:v}=b,w=FG(f.params),_=BG(y),E=1===_,x=E||43114===_;try{const{request:e}=await async function(e,t){const{abi:n,chainId:r,connector:i,...o}=t;let s;s=t.account?t.account:(await cI(e,{assertChainId:!1,chainId:r,connector:i})).account;const a=e.getClient({chainId:r}),c=BC(a,dC,"simulateContract"),{result:l,request:u}=await c({...o,abi:n,account:s});return{chainId:a.chain.id,result:l,request:{...u,chainId:r}}}(SG,{address:f.contractAddress,abi:v,functionName:"splitPayment",args:[w]})}catch(u){const i=u.data||(null==(e=u.cause)?void 0:e.data);i&&("string"==typeof i&&i.startsWith("0x08c379a0")||"string"==typeof i&&i.startsWith("0x4e487b71"));u.reason||(null==(t=u.cause)?void 0:t.reason)||(null==(n=u.cause)?void 0:n.shortMessage)||(null==(r=u.data)||r.message);if(!x){const{userFriendlyMessage:e}=(e=>{if(!e.message)return{revertReason:"Transaction will revert",userFriendlyMessage:"Transaction simulation failed"};const t=e.message.toLowerCase();return t.includes("abi encoding params/values length mismatch")?{revertReason:"Smart contract parameter mismatch. This is likely a technical issue.",userFriendlyMessage:"Technical error: Contract parameters mismatch. Please try again or contact support."}:t.includes("payment id already used")?{revertReason:"This payment ID has already been used.",userFriendlyMessage:"This payment has already been processed. Please check your transaction history."}:t.includes("percentages must equal 100")?{revertReason:"Payment split percentages are incorrect.",userFriendlyMessage:"Internal error: Payment split configuration is invalid. Please contact support."}:t.includes("token transfer failed")||t.includes("transfer amount exceeds")?{revertReason:"Insufficient token balance or approval.",userFriendlyMessage:"Insufficient balance or token approval. Please check your wallet balance."}:t.includes("amount must be greater than 0")?{revertReason:"Payment amount is invalid.",userFriendlyMessage:"Invalid payment amount. Please try again."}:t.includes("invalid recipient")||t.includes("zero address")?{revertReason:"One of the payment recipients has an invalid address.",userFriendlyMessage:"Payment configuration error: Invalid recipient address. Please contact support."}:t.includes("insufficient gas")||t.includes("out of gas")?{revertReason:"Insufficient gas for transaction.",userFriendlyMessage:"Not enough gas to process transaction. Please increase gas limit or check ETH balance."}:t.includes("nonce")?{revertReason:"Transaction nonce conflict.",userFriendlyMessage:"Transaction ordering conflict. Please try again in a moment."}:{revertReason:e.message,userFriendlyMessage:`Transaction simulation failed: ${e.message.substring(0,100)}${e.message.length>100?"...":""}`}})(u);throw new Error(e)}}const k=await KG(SG,y),S="arbitrum"===g.shortName,C=S?2:0;let I;for(let e=0;e<=C;e++)try{if(e>0){const t=2e3*e;await new Promise(e=>setTimeout(e,t))}I=await EI(SG,{address:f.contractAddress,abi:v,functionName:"splitPayment",args:[w],...k});break}catch(h){const t=(null==(o=h.message)?void 0:o.includes("Internal JSON-RPC error"))||(null==(s=h.message)?void 0:s.includes("-32603"))||(null==(c=h.message)?void 0:c.includes("nonce"));if(e===C||!t&&!S)throw h}return d(I),a("processing"),window.coinleyPendingSplitPayment=null,I}catch(cF){WG(cF,"split_payment_transaction");const t=HG(cF);throw l(t),a("idle"),window.coinleyPendingSplitPayment=null,d(null),cF}},y=async o=>{try{if(a("processing"),!i||!i.processPayment)throw new Error("API instance not available or missing processPayment method");await new Promise(e=>setTimeout(e,8e3));const s=await i.processPayment(e.id,o,n.shortName,r);return a("success"),JH.trackPaymentSuccess(e.id,e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),sW(e.id,e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),s}catch(cF){console.error("❌ [processFinalPayment] Error occurred:",cF),console.error("❌ [processFinalPayment] Error details:",{message:cF.message,stack:cF.stack,name:cF.name});const i=WG(cF,"final_payment_processing");console.error("❌ [processFinalPayment] Formatted error log:",i);const o=HG(cF);throw console.error("❌ [processFinalPayment] User-friendly error:",o),l(o),a("error"),JH.trackPaymentFailed(null==e?void 0:e.id,null==e?void 0:e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),aW(null==e?void 0:e.id,null==e?void 0:e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),cF}};return{transactionStep:s,transactionError:c,currentTransactionHash:u,txPending:f,isConfirming:p,isConfirmed:m,executePaymentTransaction:async()=>{var i,s;if(!r||!(null==e?void 0:e.contractCall))throw new Error("Missing wallet connection or payment data");const c=e.contractCall;if(!c.contractAddress)throw new Error("PaymentSplitter contract data missing from payment response");if((null==o?void 0:o.ensureCorrectNetwork)&&n){if(!(await o.ensureCorrectNetwork(n)))throw new Error("Network verification failed. Please ensure you are on the correct network.")}if(!t.contractAddress)throw new Error("Native token transactions not yet supported with PaymentSplitter. Please use ERC-20 tokens.");{const o=t.decimals||6,v=c.approvalAmount||Math.floor(e.totalAmount*Math.pow(10,o));try{let e,i="unknown";try{e=await dI(SG,{address:c.tokenAddress,abi:qG,functionName:"balanceOf",args:[r]}),i="wallet-rpc"}catch(u){const t=(null==n?void 0:n.chainId)||(null==n?void 0:n.id);if(!t)throw u;{const n=(e=>{const t={1:CW,56:gW,137:PW,42161:hW,10:AW,43114:fW,42220:SW,8453:mW}[e],n={1:[`https://eth-mainnet.g.alchemy.com/v2/${VG}`,"https://cloudflare-eth.com","https://eth.llamarpc.com","https://ethereum.publicnode.com"],56:[`https://bnb-mainnet.g.alchemy.com/v2/${VG}`,"https://bsc-dataseed.bnbchain.org","https://bsc-dataseed-public.bnbchain.org","https://bsc.nodereal.io"],137:[`https://polygon-mainnet.g.alchemy.com/v2/${VG}`,"https://polygon.llamarpc.com","https://polygon-rpc.com","https://polygon.drpc.org"],42161:[`https://arb-mainnet.g.alchemy.com/v2/${VG}`,"https://arb1.arbitrum.io/rpc","https://arbitrum.llamarpc.com"],10:[`https://opt-mainnet.g.alchemy.com/v2/${VG}`,"https://mainnet.optimism.io","https://optimism.llamarpc.com"],43114:[`https://avax-mainnet.g.alchemy.com/v2/${VG}`,"https://api.avax.network/ext/bc/C/rpc","https://avalanche.public-rpc.com"],42220:[`https://celo-mainnet.g.alchemy.com/v2/${VG}`,"https://forno.celo.org","https://celo.drpc.org"],8453:[`https://base-mainnet.g.alchemy.com/v2/${VG}`,"https://mainnet.base.org","https://base.llamarpc.com","https://base.meowrpc.com"]}[e];return t&&n?nI({chain:t,transport:iI(n.map(e=>aI(e,{timeout:1e4,retryCount:1})))}):null})(BG(t));if(!n)throw u;try{e=await n.readContract({address:c.tokenAddress,abi:qG,functionName:"balanceOf",args:[r]}),i="fallback-rpc"}catch(h){throw u}}}const s=BigInt(v);if(e<s){const n=`Insufficient ${t.symbol} balance. You have ${(Number(e)/Math.pow(10,o)).toFixed(6)} ${t.symbol} but need ${(Number(s)/Math.pow(10,o)).toFixed(6)} ${t.symbol}`;throw new Error(n)}}catch(f){if(f.message.includes("Insufficient"))throw f}a("approve"),window.coinleyPendingSplitPayment={contractCall:c,selectedToken:t,paymentData:e,selectedNetwork:n};try{const e="0xdac17f958d2ee523a2206206994597c13d831ec7"===c.tokenAddress.toLowerCase()||"USDT"===t.symbol.toUpperCase();let i,o=Af;e&&(o=zG);try{i=BigInt(v)}catch(p){throw new Error(`Invalid amount value: ${v}`)}let s=0n,l=0;const u=3;for(;l<u;)try{s=await dI(SG,{address:c.tokenAddress,abi:Af,functionName:"allowance",args:[r,c.contractAddress]});break}catch(m){l++,l<u?await new Promise(e=>setTimeout(e,2e3)):s=0n}if(s>=i){a("splitPayment");const e=await g();return e&&await y(e),e}if(e&&s>0n){const e=await KG(SG,n.chainId),t=await EI(SG,{address:c.tokenAddress,abi:Af,functionName:"approve",args:[c.contractAddress,0n],...e});await _I(SG,{hash:t,confirmations:1,timeout:12e4})}const h=await KG(SG,n.chainId),f=await EI(SG,{address:c.tokenAddress,abi:Af,functionName:"approve",args:[c.contractAddress,i],...h});d(f);await _I(SG,{hash:f,confirmations:1,timeout:12e4});await new Promise(e=>setTimeout(e,3e3));let w=0;const _=3;let E=!1;for(;w<_&&!E;){try{if(await dI(SG,{address:c.tokenAddress,abi:Af,functionName:"allowance",args:[r,c.contractAddress]})>=i){E=!0;break}w<_-1&&await new Promise(e=>setTimeout(e,2e3))}catch(b){w<_-1&&await new Promise(e=>setTimeout(e,2e3))}w++}const x=await g();return x&&await y(x),x}catch(cF){WG(cF,"approve_transaction");const t=HG(cF);if(l(t),a("idle"),window.coinleyPendingSplitPayment=null,d(null),(null==(i=cF.message)?void 0:i.includes("User rejected"))||(null==(s=cF.message)?void 0:s.includes("User denied"))||4001===cF.code)throw new Error("Transaction was cancelled by user");throw new Error(`Approve failed: ${cF.message}`)}}},executeSplitPayment:g,processFinalPayment:y,resetTransaction:()=>{a("idle"),l(""),d(null),window.coinleyPendingSplitPayment=null},setTransactionError:l,setTransactionStep:a}},ZG=BigInt(0),YG=BigInt(1);function JG(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function QG(e,t,n=""){const r=em(e),i=null==e?void 0:e.length,o=void 0!==t;if(!r||o&&i!==t){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(r?`length=${i}`:"type="+typeof e))}return e}function XG(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function eZ(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?ZG:BigInt("0x"+e)}function tZ(e){return eZ(fm(e))}function nZ(e){return nm(e),eZ(fm(Uint8Array.from(e).reverse()))}function rZ(e,t){return _m(e.toString(16).padStart(2*t,"0"))}function iZ(e,t){return rZ(e,t).reverse()}function oZ(e,t,n){let r;if("string"==typeof t)try{r=_m(t)}catch(qAe){throw new Error(e+" must be hex string or Uint8Array, cause: "+qAe)}else{if(!em(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}function sZ(e){return Uint8Array.from(e)}const aZ=e=>"bigint"==typeof e&&ZG<=e;function cZ(e,t,n,r){if(!function(e,t,n){return aZ(e)&&aZ(t)&&aZ(n)&&t<=e&&e<n}(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function lZ(e){let t;for(t=0;e>ZG;e>>=YG,t+=1);return t}const uZ=e=>(YG<<BigInt(e))-YG;function dZ(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const i=e[t];if(r&&void 0===i)return;const o=typeof i;if(o!==n||null===i)throw new Error(`param "${t}" is invalid: expected ${n}, got ${o}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function hZ(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(void 0!==i)return i;const o=e(n,...r);return t.set(n,o),o}}
|
|
49
|
+
*/var gA="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},yA=mA.useSyncExternalStore,bA=pA.useRef,vA=pA.useEffect,wA=pA.useMemo,_A=pA.useDebugValue;nA.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=bA(null);if(null===o.current){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=wA(function(){function e(e){if(!c){if(c=!0,o=e,e=r(e),void 0!==i&&s.hasValue){var t=s.value;if(i(t,e))return a=t}return a=e}if(t=a,gA(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,a=n)}var o,a,c=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,i]);var a=yA(e,o[0],o[1]);return vA(function(){s.hasValue=!0,s.value=a},[a]),_A(a),a},tA.exports=nA;var EA=tA.exports;const xA=e=>"object"==typeof e&&!Array.isArray(e);function kA(e={}){const t=eA(e);return function(e,t,n=t,r=fI){const i=Yt.useRef([]),o=EA.useSyncExternalStoreWithSelector(e,t,n,e=>e,(e,t)=>{if(xA(e)&&xA(t)&&i.current.length){for(const n of i.current)if(!r(e[n],t[n]))return!1;return!0}return r(e,t)});return Yt.useMemo(()=>{if(xA(o)){const e={...o};let t={};for(const[n,r]of Object.entries(e))t={...t,[n]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(n)||i.current.push(n),r)}};return Object.defineProperties(e,t),e}return o},[o])}(e=>function(e,t){const{onChange:n}=t;return e.subscribe(()=>uI(e),n,{equalityFn(e,t){const{connector:n,...r}=e,{connector:i,...o}=t;return fI(r,o)&&(null==n?void 0:n.id)===(null==i?void 0:i.id)&&(null==n?void 0:n.uid)===(null==i?void 0:i.uid)}})}(t,{onChange:e}),()=>uI(t))}var SA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},CA={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},IA=new(n=class{constructor(){Oe(this,e,CA),Oe(this,t,!1)}setTimeoutProvider(t){Me(this,e,t)}setTimeout(t,n){return Pe(this,e).setTimeout(t,n)}clearTimeout(t){Pe(this,e).clearTimeout(t)}setInterval(t,n){return Pe(this,e).setInterval(t,n)}clearInterval(t){Pe(this,e).clearInterval(t)}},e=new WeakMap,t=new WeakMap,n);var AA="undefined"==typeof window||"Deno"in globalThis;function PA(){}function OA(e){return"number"==typeof e&&e>=0&&e!==1/0}function MA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function TA(e,t){return"function"==typeof e?e(t):e}function RA(e,t){return"function"==typeof e?e(t):e}function NA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s)if(r){if(t.queryHash!==BA(s,t.options))return!1}else if(!DA(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&((!i||i===t.state.fetchStatus)&&!(o&&!o(t)))}function LA(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(jA(t.options.mutationKey)!==jA(o))return!1}else if(!DA(t.options.mutationKey,o))return!1}return(!r||t.state.status===r)&&!(i&&!i(t))}function BA(e,t){return((null==t?void 0:t.queryKeyHashFn)||jA)(e)}function jA(e){return JSON.stringify(e,(e,t)=>qA(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function DA(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>DA(e[n],t[n])))}var UA=Object.prototype.hasOwnProperty;function $A(e,t){if(e===t)return e;const n=zA(e)&&zA(t);if(!(n||qA(e)&&qA(t)))return t;const r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),o=i.length,s=n?new Array(o):{};let a=0;for(let c=0;c<o;c++){const o=n?c:i[c],l=e[o],u=t[o];if(l===u){s[o]=l,(n?c<r:UA.call(e,o))&&a++;continue}if(null===l||null===u||"object"!=typeof l||"object"!=typeof u){s[o]=u;continue}const d=$A(l,u);s[o]=d,d===l&&a++}return r===o&&a===r?e:s}function FA(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function zA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qA(e){if(!HA(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!HA(n)&&(!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype)}function HA(e){return"[object Object]"===Object.prototype.toString.call(e)}function WA(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?$A(e,t):t}function KA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function VA(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var GA=Symbol();function ZA(e,t){return!e.queryFn&&(null==t?void 0:t.initialPromise)?()=>t.initialPromise:e.queryFn&&e.queryFn!==GA?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function YA(e,t){return"function"==typeof e?e(...t):!!e}var JA=new(s=class extends SA{constructor(){super(),Oe(this,r),Oe(this,i),Oe(this,o),Me(this,o,e=>{if(!AA&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){Pe(this,i)||this.setEventListener(Pe(this,o))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=Pe(this,i))||e.call(this),Me(this,i,void 0))}setEventListener(e){var t;Me(this,o,e),null==(t=Pe(this,i))||t.call(this),Me(this,i,e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){Pe(this,r)!==e&&(Me(this,r,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return"boolean"==typeof Pe(this,r)?Pe(this,r):"hidden"!==(null==(e=globalThis.document)?void 0:e.visibilityState)}},r=new WeakMap,i=new WeakMap,o=new WeakMap,s);function QA(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}var XA=function(e){setTimeout(e,0)};var eP=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=XA;const o=r=>{t?e.push(r):i(()=>{n(r)})};return{batch:o=>{let s;t++;try{s=o()}finally{t--,t||(()=>{const t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return s},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}(),tP=new(u=class extends SA{constructor(){super(),Oe(this,a,!0),Oe(this,c),Oe(this,l),Me(this,l,e=>{if(!AA&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}})}onSubscribe(){Pe(this,c)||this.setEventListener(Pe(this,l))}onUnsubscribe(){var e;this.hasListeners()||(null==(e=Pe(this,c))||e.call(this),Me(this,c,void 0))}setEventListener(e){var t;Me(this,l,e),null==(t=Pe(this,c))||t.call(this),Me(this,c,e(this.setOnline.bind(this)))}setOnline(e){Pe(this,a)!==e&&(Me(this,a,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return Pe(this,a)}},a=new WeakMap,c=new WeakMap,l=new WeakMap,u);function nP(e){return Math.min(1e3*2**e,3e4)}function rP(e){return"online"!==(e??"online")||tP.isOnline()}var iP=class extends Error{constructor(e){super("CancelledError"),this.revert=null==e?void 0:e.revert,this.silent=null==e?void 0:e.silent}};function oP(e){let t,n=!1,r=0;const i=QA(),o=()=>"pending"!==i.status,s=()=>JA.isFocused()&&("always"===e.networkMode||tP.isOnline())&&e.canRun(),a=()=>rP(e.networkMode)&&e.canRun(),c=e=>{o()||(null==t||t(),i.resolve(e))},l=e=>{o()||(null==t||t(),i.reject(e))},u=()=>new Promise(n=>{var r;t=e=>{(o()||s())&&n(e)},null==(r=e.onPause)||r.call(e)}).then(()=>{var n;t=void 0,o()||null==(n=e.onContinue)||n.call(e)}),d=()=>{if(o())return;let t;const i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(cF){t=Promise.reject(cF)}Promise.resolve(t).then(c).catch(t=>{var i;if(o())return;const a=e.retry??(AA?0:3),c=e.retryDelay??nP,h="function"==typeof c?c(r,t):c,f=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,t);var p;!n&&f?(r++,null==(i=e.onFail)||i.call(e,r,t),(p=h,new Promise(e=>{IA.setTimeout(e,p)})).then(()=>s()?void 0:u()).then(()=>{n?l(t):d()})):l(t)})};return{promise:i,status:()=>i.status,cancel:t=>{var n;if(!o()){const r=new iP(t);l(r),null==(n=e.onCancel)||n.call(e,r)}},continue:()=>(null==t||t(),i),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:a,start:()=>(a()?d():u().then(d),i)}}var sP=(h=class{constructor(){Oe(this,d)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),OA(this.gcTime)&&Me(this,d,IA.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(AA?1/0:3e5))}clearGcTimeout(){Pe(this,d)&&(IA.clearTimeout(Pe(this,d)),Me(this,d,void 0))}},d=new WeakMap,h),aP=(E=class extends sP{constructor(e){super(),Oe(this,w),Oe(this,f),Oe(this,p),Oe(this,m),Oe(this,g),Oe(this,y),Oe(this,b),Oe(this,v),Me(this,v,!1),Me(this,b,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,g,e.client),Me(this,m,Pe(this,g).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,f,uP(this.options)),this.state=e.state??Pe(this,f),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return null==(e=Pe(this,y))?void 0:e.promise}setOptions(e){if(this.options={...Pe(this,b),...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=uP(this.options);void 0!==e.data&&(this.setState(lP(e.data,e.dataUpdatedAt)),Me(this,f,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||Pe(this,m).remove(this)}setData(e,t){const n=WA(this.state.data,e,this.options);return Te(this,w,_).call(this,{data:n,type:"success",dataUpdatedAt:null==t?void 0:t.updatedAt,manual:null==t?void 0:t.manual}),n}setState(e,t){Te(this,w,_).call(this,{type:"setState",state:e,setStateOptions:t})}cancel(e){var t,n;const r=null==(t=Pe(this,y))?void 0:t.promise;return null==(n=Pe(this,y))||n.cancel(e),r?r.then(PA).catch(PA):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Pe(this,f))}isActive(){return this.observers.some(e=>!1!==RA(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===GA||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===TA(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!MA(this.state.dataUpdatedAt,e))}onFocus(){var e;const t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null==t||t.refetch({cancelRefetch:!1}),null==(e=Pe(this,y))||e.continue()}onOnline(){var e;const t=this.observers.find(e=>e.shouldFetchOnReconnect());null==t||t.refetch({cancelRefetch:!1}),null==(e=Pe(this,y))||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Pe(this,m).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(Pe(this,y)&&(Pe(this,v)?Pe(this,y).cancel({revert:!0}):Pe(this,y).cancelRetry()),this.scheduleGc()),Pe(this,m).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,w,_).call(this,{type:"invalidate"})}async fetch(e,t){var n,r,i,o,s,a,c,l,u,d,h,f;if("idle"!==this.state.fetchStatus&&"rejected"!==(null==(n=Pe(this,y))?void 0:n.status()))if(void 0!==this.state.data&&(null==t?void 0:t.cancelRefetch))this.cancel({silent:!0});else if(Pe(this,y))return Pe(this,y).continueRetry(),Pe(this,y).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const b=new AbortController,E=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Me(this,v,!0),b.signal)})},x=()=>{const e=ZA(this.options,t),n=(()=>{const e={client:Pe(this,g),queryKey:this.queryKey,meta:this.meta};return E(e),e})();return Me(this,v,!1),this.options.persister?this.options.persister(e,n,this):e(n)},k=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:Pe(this,g),state:this.state,fetchFn:x};return E(e),e})();null==(r=this.options.behavior)||r.onFetch(k,this),Me(this,p,this.state),"idle"!==this.state.fetchStatus&&this.state.fetchMeta===(null==(i=k.fetchOptions)?void 0:i.meta)||Te(this,w,_).call(this,{type:"fetch",meta:null==(o=k.fetchOptions)?void 0:o.meta}),Me(this,y,oP({initialPromise:null==t?void 0:t.initialPromise,fn:k.fetchFn,onCancel:e=>{e instanceof iP&&e.revert&&this.setState({...Pe(this,p),fetchStatus:"idle"}),b.abort()},onFail:(e,t)=>{Te(this,w,_).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Te(this,w,_).call(this,{type:"pause"})},onContinue:()=>{Te(this,w,_).call(this,{type:"continue"})},retry:k.options.retry,retryDelay:k.options.retryDelay,networkMode:k.options.networkMode,canRun:()=>!0}));try{const e=await Pe(this,y).start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),null==(a=(s=Pe(this,m).config).onSuccess)||a.call(s,e,this),null==(l=(c=Pe(this,m).config).onSettled)||l.call(c,e,this.state.error,this),e}catch(cF){if(cF instanceof iP){if(cF.silent)return Pe(this,y).promise;if(cF.revert){if(void 0===this.state.data)throw cF;return this.state.data}}throw Te(this,w,_).call(this,{type:"error",error:cF}),null==(d=(u=Pe(this,m).config).onError)||d.call(u,cF,this),null==(f=(h=Pe(this,m).config).onSettled)||f.call(h,this.state.data,cF,this),cF}finally{this.scheduleGc()}}},f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,y=new WeakMap,b=new WeakMap,v=new WeakMap,w=new WeakSet,_=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...cP(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...lP(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,p,e.manual?n:void 0),n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),eP.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),Pe(this,m).notify({query:this,type:"updated",action:e})})},E);function cP(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:rP(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function lP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function uP(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dP=(G=class extends SA{constructor(e,t){super(),Oe(this,D),Oe(this,x),Oe(this,k),Oe(this,S),Oe(this,C),Oe(this,I),Oe(this,A),Oe(this,P),Oe(this,O),Oe(this,M),Oe(this,T),Oe(this,R),Oe(this,N),Oe(this,L),Oe(this,B),Oe(this,j,new Set),this.options=t,Me(this,x,e),Me(this,O,null),Me(this,P,QA()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(Pe(this,k).addObserver(this),hP(Pe(this,k),this.options)?Te(this,D,U).call(this):this.updateResult(),Te(this,D,q).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fP(Pe(this,k),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fP(Pe(this,k),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,D,H).call(this),Te(this,D,W).call(this),Pe(this,k).removeObserver(this)}setOptions(e){const t=this.options,n=Pe(this,k);if(this.options=Pe(this,x).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof RA(this.options.enabled,Pe(this,k)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,D,K).call(this),Pe(this,k).setOptions(this.options),t._defaulted&&!FA(this.options,t)&&Pe(this,x).getQueryCache().notify({type:"observerOptionsUpdated",query:Pe(this,k),observer:this});const r=this.hasListeners();r&&pP(Pe(this,k),n,this.options,t)&&Te(this,D,U).call(this),this.updateResult(),!r||Pe(this,k)===n&&RA(this.options.enabled,Pe(this,k))===RA(t.enabled,Pe(this,k))&&TA(this.options.staleTime,Pe(this,k))===TA(t.staleTime,Pe(this,k))||Te(this,D,$).call(this);const i=Te(this,D,F).call(this);!r||Pe(this,k)===n&&RA(this.options.enabled,Pe(this,k))===RA(t.enabled,Pe(this,k))&&i===Pe(this,B)||Te(this,D,z).call(this,i)}getOptimisticResult(e){const t=Pe(this,x).getQueryCache().build(Pe(this,x),e),n=this.createResult(t,e);return function(e,t){if(!FA(e.getCurrentResult(),t))return!0;return!1}(this,n)&&(Me(this,C,n),Me(this,A,this.options),Me(this,I,Pe(this,k).state)),n}getCurrentResult(){return Pe(this,C)}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),null==t||t(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==Pe(this,P).status||Pe(this,P).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){Pe(this,j).add(e)}getCurrentQuery(){return Pe(this,k)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=Pe(this,x).defaultQueryOptions(e),n=Pe(this,x).getQueryCache().build(Pe(this,x),t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return Te(this,D,U).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Pe(this,C)))}createResult(e,t){var n;const r=Pe(this,k),i=this.options,o=Pe(this,C),s=Pe(this,I),a=Pe(this,A),c=e!==r?e.state:Pe(this,S),{state:l}=e;let u,d={...l},h=!1;if(t._optimisticResults){const n=this.hasListeners(),o=!n&&hP(e,t),s=n&&pP(e,r,t,i);(o||s)&&(d={...d,...cP(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:p,status:m}=d;u=d.data;let g=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;(null==o?void 0:o.isPlaceholderData)&&t.placeholderData===(null==a?void 0:a.placeholderData)?(e=o.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(null==(n=Pe(this,R))?void 0:n.state.data,Pe(this,R)):t.placeholderData,void 0!==e&&(m="success",u=WA(null==o?void 0:o.data,e,t),h=!0)}if(t.select&&void 0!==u&&!g)if(o&&u===(null==s?void 0:s.data)&&t.select===Pe(this,M))u=Pe(this,T);else try{Me(this,M,t.select),u=t.select(u),u=WA(null==o?void 0:o.data,u,t),Me(this,T,u),Me(this,O,null)}catch(x){Me(this,O,x)}Pe(this,O)&&(f=Pe(this,O),u=Pe(this,T),p=Date.now(),m="error");const y="fetching"===d.fetchStatus,b="pending"===m,v="error"===m,w=b&&y,_=void 0!==u,E={status:m,fetchStatus:d.fetchStatus,isPending:b,isSuccess:"success"===m,isError:v,isInitialLoading:w,isLoading:w,data:u,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:v&&!_,isPaused:"paused"===d.fetchStatus,isPlaceholderData:h,isRefetchError:v&&_,isStale:mP(e,t),refetch:this.refetch,promise:Pe(this,P),isEnabled:!1!==RA(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=e=>{"error"===E.status?e.reject(E.error):void 0!==E.data&&e.resolve(E.data)},n=()=>{const e=Me(this,P,E.promise=QA());t(e)},i=Pe(this,P);switch(i.status){case"pending":e.queryHash===r.queryHash&&t(i);break;case"fulfilled":"error"!==E.status&&E.data===i.value||n();break;case"rejected":"error"===E.status&&E.error===i.reason||n()}}return E}updateResult(){const e=Pe(this,C),t=this.createResult(Pe(this,k),this.options);if(Me(this,I,Pe(this,k).state),Me(this,A,this.options),void 0!==Pe(this,I).data&&Me(this,R,Pe(this,k)),FA(t,e))return;Me(this,C,t);Te(this,D,V).call(this,{listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!Pe(this,j).size)return!0;const r=new Set(n??Pe(this,j));return this.options.throwOnError&&r.add("error"),Object.keys(Pe(this,C)).some(t=>{const n=t;return Pe(this,C)[n]!==e[n]&&r.has(n)})})()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,D,q).call(this)}},x=new WeakMap,k=new WeakMap,S=new WeakMap,C=new WeakMap,I=new WeakMap,A=new WeakMap,P=new WeakMap,O=new WeakMap,M=new WeakMap,T=new WeakMap,R=new WeakMap,N=new WeakMap,L=new WeakMap,B=new WeakMap,j=new WeakMap,D=new WeakSet,U=function(e){Te(this,D,K).call(this);let t=Pe(this,k).fetch(this.options,e);return(null==e?void 0:e.throwOnError)||(t=t.catch(PA)),t},$=function(){Te(this,D,H).call(this);const e=TA(this.options.staleTime,Pe(this,k));if(AA||Pe(this,C).isStale||!OA(e))return;const t=MA(Pe(this,C).dataUpdatedAt,e)+1;Me(this,N,IA.setTimeout(()=>{Pe(this,C).isStale||this.updateResult()},t))},F=function(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(Pe(this,k)):this.options.refetchInterval)??!1},z=function(e){Te(this,D,W).call(this),Me(this,B,e),!AA&&!1!==RA(this.options.enabled,Pe(this,k))&&OA(Pe(this,B))&&0!==Pe(this,B)&&Me(this,L,IA.setInterval(()=>{(this.options.refetchIntervalInBackground||JA.isFocused())&&Te(this,D,U).call(this)},Pe(this,B)))},q=function(){Te(this,D,$).call(this),Te(this,D,z).call(this,Te(this,D,F).call(this))},H=function(){Pe(this,N)&&(IA.clearTimeout(Pe(this,N)),Me(this,N,void 0))},W=function(){Pe(this,L)&&(IA.clearInterval(Pe(this,L)),Me(this,L,void 0))},K=function(){const e=Pe(this,x).getQueryCache().build(Pe(this,x),this.options);if(e===Pe(this,k))return;const t=Pe(this,k);Me(this,k,e),Me(this,S,e.state),this.hasListeners()&&(null==t||t.removeObserver(this),e.addObserver(this))},V=function(e){eP.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(Pe(this,C))}),Pe(this,x).getQueryCache().notify({query:Pe(this,k),type:"observerResultsUpdated"})})},G);function hP(e,t){return function(e,t){return!1!==RA(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&fP(e,t,t.refetchOnMount)}function fP(e,t,n){if(!1!==RA(t.enabled,e)&&"static"!==TA(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&mP(e,t)}return!1}function pP(e,t,n,r){return(e!==t||!1===RA(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&mP(e,n)}function mP(e,t){return!1!==RA(t.enabled,e)&&e.isStaleByTime(TA(t.staleTime,e))}function gP(e){return{onFetch:(t,n)=>{var r,i,o,s,a;const c=t.options,l=null==(o=null==(i=null==(r=t.fetchOptions)?void 0:r.meta)?void 0:i.fetchMore)?void 0:o.direction,u=(null==(s=t.state.data)?void 0:s.pages)||[],d=(null==(a=t.state.data)?void 0:a.pageParams)||[];let h={pages:[],pageParams:[]},f=0;const p=async()=>{let n=!1;const r=e=>{!function(e,t,n){let r,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??(r=t()),i||(i=!0,r.aborted?n():r.addEventListener("abort",n,{once:!0})),r)})}(e,()=>t.signal,()=>n=!0)},i=ZA(t.options,t.fetchOptions),o=async(e,o,s)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);const a=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:o,direction:s?"backward":"forward",meta:t.options.meta};return r(e),e})(),c=await i(a),{maxPages:l}=t.options,u=s?VA:KA;return{pages:u(e.pages,c,l),pageParams:u(e.pageParams,o,l)}};if(l&&u.length){const e="backward"===l,t={pages:u,pageParams:d},n=(e?bP:yP)(c,t);h=await o(t,n,e)}else{const t=e??u.length;do{const e=0===f?d[0]??c.initialPageParam:yP(c,h);if(f>0&&null==e)break;h=await o(h,e),f++}while(f<t)}return h};t.options.persister?t.fetchFn=()=>{var e,r;return null==(r=(e=t.options).persister)?void 0:r.call(e,p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=p}}}function yP(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bP(e,{pages:t,pageParams:n}){var r;return t.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,t[0],t,n[0],n):void 0}var vP=(te=class extends sP{constructor(e){super(),Oe(this,X),Oe(this,Z),Oe(this,Y),Oe(this,J),Oe(this,Q),Me(this,Z,e.client),this.mutationId=e.mutationId,Me(this,J,e.mutationCache),Me(this,Y,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Pe(this,Y).includes(e)||(Pe(this,Y).push(e),this.clearGcTimeout(),Pe(this,J).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,Y,Pe(this,Y).filter(t=>t!==e)),this.scheduleGc(),Pe(this,J).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Pe(this,Y).length||("pending"===this.state.status?this.scheduleGc():Pe(this,J).remove(this))}continue(){var e;return(null==(e=Pe(this,Q))?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var t,n,r,i,o,s,a,c,l,u,d,h,f,p,m,g,y,b,v,w;const _=()=>{Te(this,X,ee).call(this,{type:"continue"})},E={client:Pe(this,Z),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Q,oP({fn:()=>this.options.mutationFn?this.options.mutationFn(e,E):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{Te(this,X,ee).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Te(this,X,ee).call(this,{type:"pause"})},onContinue:_,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Pe(this,J).canRun(this)}));const x="pending"===this.state.status,k=!Pe(this,Q).canStart();try{if(x)_();else{Te(this,X,ee).call(this,{type:"pending",variables:e,isPaused:k}),await(null==(n=(t=Pe(this,J).config).onMutate)?void 0:n.call(t,e,this,E));const o=await(null==(i=(r=this.options).onMutate)?void 0:i.call(r,e,E));o!==this.state.context&&Te(this,X,ee).call(this,{type:"pending",context:o,variables:e,isPaused:k})}const f=await Pe(this,Q).start();return await(null==(s=(o=Pe(this,J).config).onSuccess)?void 0:s.call(o,f,e,this.state.context,this,E)),await(null==(c=(a=this.options).onSuccess)?void 0:c.call(a,f,e,this.state.context,E)),await(null==(u=(l=Pe(this,J).config).onSettled)?void 0:u.call(l,f,null,this.state.variables,this.state.context,this,E)),await(null==(h=(d=this.options).onSettled)?void 0:h.call(d,f,null,e,this.state.context,E)),Te(this,X,ee).call(this,{type:"success",data:f}),f}catch(cF){try{await(null==(p=(f=Pe(this,J).config).onError)?void 0:p.call(f,cF,e,this.state.context,this,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(g=(m=this.options).onError)?void 0:g.call(m,cF,e,this.state.context,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(b=(y=Pe(this,J).config).onSettled)?void 0:b.call(y,void 0,cF,this.state.variables,this.state.context,this,E))}catch(qAe){Promise.reject(qAe)}try{await(null==(w=(v=this.options).onSettled)?void 0:w.call(v,void 0,cF,e,this.state.context,E))}catch(qAe){Promise.reject(qAe)}throw Te(this,X,ee).call(this,{type:"error",error:cF}),cF}finally{Pe(this,J).runNext(this)}}},Z=new WeakMap,Y=new WeakMap,J=new WeakMap,Q=new WeakMap,X=new WeakSet,ee=function(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),eP.batch(()=>{Pe(this,Y).forEach(t=>{t.onMutationUpdate(e)}),Pe(this,J).notify({mutation:this,type:"updated",action:e})})},te);var wP=(oe=class extends SA{constructor(e={}){super(),Oe(this,ne),Oe(this,re),Oe(this,ie),this.config=e,Me(this,ne,new Set),Me(this,re,new Map),Me(this,ie,0)}build(e,t,n){const r=new vP({client:e,mutationCache:this,mutationId:++Re(this,ie)._,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){Pe(this,ne).add(e);const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t);n?n.push(e):Pe(this,re).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Pe(this,ne).delete(e)){const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&Pe(this,re).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_P(e);if("string"==typeof t){const n=Pe(this,re).get(t),r=null==n?void 0:n.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){var t;const n=_P(e);if("string"==typeof n){const r=null==(t=Pe(this,re).get(n))?void 0:t.find(t=>t!==e&&t.state.isPaused);return(null==r?void 0:r.continue())??Promise.resolve()}return Promise.resolve()}clear(){eP.batch(()=>{Pe(this,ne).forEach(e=>{this.notify({type:"removed",mutation:e})}),Pe(this,ne).clear(),Pe(this,re).clear()})}getAll(){return Array.from(Pe(this,ne))}find(e){const t={exact:!0,...e};return this.getAll().find(e=>LA(t,e))}findAll(e={}){return this.getAll().filter(t=>LA(e,t))}notify(e){eP.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return eP.batch(()=>Promise.all(e.map(e=>e.continue().catch(PA))))}},ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe);function _P(e){var t;return null==(t=e.options.scope)?void 0:t.id}var EP=(fe=class extends SA{constructor(e,t){super(),Oe(this,ue),Oe(this,se),Oe(this,ae),Oe(this,ce),Oe(this,le),Me(this,se,e),this.setOptions(t),this.bindMethods(),Te(this,ue,de).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const n=this.options;this.options=Pe(this,se).defaultMutationOptions(e),FA(this.options,n)||Pe(this,se).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Pe(this,ce),observer:this}),(null==n?void 0:n.mutationKey)&&this.options.mutationKey&&jA(n.mutationKey)!==jA(this.options.mutationKey)?this.reset():"pending"===(null==(t=Pe(this,ce))?void 0:t.state.status)&&Pe(this,ce).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||null==(e=Pe(this,ce))||e.removeObserver(this)}onMutationUpdate(e){Te(this,ue,de).call(this),Te(this,ue,he).call(this,e)}getCurrentResult(){return Pe(this,ae)}reset(){var e;null==(e=Pe(this,ce))||e.removeObserver(this),Me(this,ce,void 0),Te(this,ue,de).call(this),Te(this,ue,he).call(this)}mutate(e,t){var n;return Me(this,le,t),null==(n=Pe(this,ce))||n.removeObserver(this),Me(this,ce,Pe(this,se).getMutationCache().build(Pe(this,se),this.options)),Pe(this,ce).addObserver(this),Pe(this,ce).execute(e)}},se=new WeakMap,ae=new WeakMap,ce=new WeakMap,le=new WeakMap,ue=new WeakSet,de=function(){var e;const t=(null==(e=Pe(this,ce))?void 0:e.state)??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};Me(this,ae,{...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset})},he=function(e){eP.batch(()=>{var t,n,r,i,o,s,a,c;if(Pe(this,le)&&this.hasListeners()){const l=Pe(this,ae).variables,u=Pe(this,ae).context,d={client:Pe(this,se),meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===(null==e?void 0:e.type)){try{null==(n=(t=Pe(this,le)).onSuccess)||n.call(t,e.data,l,u,d)}catch(qAe){Promise.reject(qAe)}try{null==(i=(r=Pe(this,le)).onSettled)||i.call(r,e.data,null,l,u,d)}catch(qAe){Promise.reject(qAe)}}else if("error"===(null==e?void 0:e.type)){try{null==(s=(o=Pe(this,le)).onError)||s.call(o,e.error,l,u,d)}catch(qAe){Promise.reject(qAe)}try{null==(c=(a=Pe(this,le)).onSettled)||c.call(a,void 0,e.error,l,u,d)}catch(qAe){Promise.reject(qAe)}}}this.listeners.forEach(e=>{e(Pe(this,ae))})})},fe),xP=(me=class extends SA{constructor(e={}){super(),Oe(this,pe),this.config=e,Me(this,pe,new Map)}build(e,t,n){const r=t.queryKey,i=t.queryHash??BA(r,t);let o=this.get(i);return o||(o=new aP({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){Pe(this,pe).has(e.queryHash)||(Pe(this,pe).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=Pe(this,pe).get(e.queryHash);t&&(e.destroy(),t===e&&Pe(this,pe).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){eP.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Pe(this,pe).get(e)}getAll(){return[...Pe(this,pe).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>NA(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>NA(e,t)):t}notify(e){eP.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eP.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eP.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},pe=new WeakMap,me),kP=(ke=class{constructor(e={}){Oe(this,ge),Oe(this,ye),Oe(this,be),Oe(this,ve),Oe(this,we),Oe(this,_e),Oe(this,Ee),Oe(this,xe),Me(this,ge,e.queryCache||new xP),Me(this,ye,e.mutationCache||new wP),Me(this,be,e.defaultOptions||{}),Me(this,ve,new Map),Me(this,we,new Map),Me(this,_e,0)}mount(){Re(this,_e)._++,1===Pe(this,_e)&&(Me(this,Ee,JA.subscribe(async e=>{e&&(await this.resumePausedMutations(),Pe(this,ge).onFocus())})),Me(this,xe,tP.subscribe(async e=>{e&&(await this.resumePausedMutations(),Pe(this,ge).onOnline())})))}unmount(){var e,t;Re(this,_e)._--,0===Pe(this,_e)&&(null==(e=Pe(this,Ee))||e.call(this),Me(this,Ee,void 0),null==(t=Pe(this,xe))||t.call(this),Me(this,xe,void 0))}isFetching(e){return Pe(this,ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Pe(this,ye).findAll({...e,status:"pending"}).length}getQueryData(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=Pe(this,ge).get(n.queryHash))?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Pe(this,ge).build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(TA(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Pe(this,ge).findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Pe(this,ge).get(r.queryHash),o=function(e,t){return"function"==typeof e?e(t):e}(t,null==i?void 0:i.state.data);if(void 0!==o)return Pe(this,ge).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return eP.batch(()=>Pe(this,ge).findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){var t;const n=this.defaultQueryOptions({queryKey:e});return null==(t=Pe(this,ge).get(n.queryHash))?void 0:t.state}removeQueries(e){const t=Pe(this,ge);eP.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=Pe(this,ge);return eP.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=eP.batch(()=>Pe(this,ge).findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(PA).catch(PA)}invalidateQueries(e,t={}){return eP.batch(()=>(Pe(this,ge).findAll(e).forEach(e=>{e.invalidate()}),"none"===(null==e?void 0:e.refetchType)?Promise.resolve():this.refetchQueries({...e,type:(null==e?void 0:e.refetchType)??(null==e?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=eP.batch(()=>Pe(this,ge).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(PA)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(PA)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=Pe(this,ge).build(this,t);return n.isStaleByTime(TA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(PA).catch(PA)}fetchInfiniteQuery(e){return e.behavior=gP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(PA).catch(PA)}ensureInfiniteQueryData(e){return e.behavior=gP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tP.isOnline()?Pe(this,ye).resumePausedMutations():Promise.resolve()}getQueryCache(){return Pe(this,ge)}getMutationCache(){return Pe(this,ye)}getDefaultOptions(){return Pe(this,be)}setDefaultOptions(e){Me(this,be,e)}setQueryDefaults(e,t){Pe(this,ve).set(jA(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Pe(this,ve).values()],n={};return t.forEach(t=>{DA(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){Pe(this,we).set(jA(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Pe(this,we).values()],n={};return t.forEach(t=>{DA(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Pe(this,be).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=BA(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===GA&&(t.enabled=!1),t}defaultMutationOptions(e){return(null==e?void 0:e._defaulted)?e:{...Pe(this,be).mutations,...(null==e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Pe(this,ge).clear(),Pe(this,ye).clear()}},ge=new WeakMap,ye=new WeakMap,be=new WeakMap,ve=new WeakMap,we=new WeakMap,_e=new WeakMap,Ee=new WeakMap,xe=new WeakMap,ke);function SP(e){return JSON.stringify(e,(e,t)=>function(e){if(!CP(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!CP(n)&&!!n.hasOwnProperty("isPrototypeOf")}(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):"bigint"==typeof t?t.toString():t)}function CP(e){return"[object Object]"===Object.prototype.toString.call(e)}function IP(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:i,initialDataUpdatedAt:o,maxPages:s,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:d,queryKeyHashFn:h,retry:f,retryDelay:p,structuralSharing:m,getPreviousPageParam:g,getNextPageParam:y,initialPageParam:b,_optimisticResults:v,enabled:w,notifyOnChangeProps:_,placeholderData:E,refetchInterval:x,refetchIntervalInBackground:k,refetchOnMount:S,refetchOnReconnect:C,refetchOnWindowFocus:I,retryOnMount:A,select:P,staleTime:O,suspense:M,throwOnError:T,config:R,connector:N,query:L,...B}=e;return B}function AP(e){return{mutationFn:t=>async function(e,t){var n;let r;if(r="function"==typeof t.connector?e._internal.connectors.setup(t.connector):t.connector,r.uid===e.state.current)throw new qC;try{e.setState(e=>({...e,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const{connector:i,...o}=t,s=await r.connect(o);return r.emitter.off("connect",e._internal.events.connect),r.emitter.on("change",e._internal.events.change),r.emitter.on("disconnect",e._internal.events.disconnect),await(null==(n=e.storage)?void 0:n.setItem("recentConnectorId",r.id)),e.setState(e=>({...e,connections:new Map(e.connections).set(r.uid,{accounts:o.withCapabilities?s.accounts.map(e=>"object"==typeof e?e.address:e):s.accounts,chainId:s.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:o.withCapabilities?s.accounts.map(e=>"object"==typeof e?e:{address:e,capabilities:{}}):s.accounts,chainId:s.chainId}}catch(cF){throw e.setState(e=>({...e,status:e.current?"connected":"disconnected"})),cF}}(e,t),mutationKey:["connect"]}}function PP(e){return{mutationFn:t=>async function(e,t){const{account:n,chainId:r,connector:i,...o}=t;let s;s="object"==typeof n&&"local"===(null==n?void 0:n.type)?e.getClient({chainId:r}):await cI(e,{account:n??void 0,assertChainId:!1,chainId:r,connector:i});const a=BC(s,PC,"sendTransaction");return await a({...o,...n?{account:n}:{},chain:r?{id:r}:null,gas:o.gas??void 0})}(e,t),mutationKey:["sendTransaction"]}}function OP(e){return{mutationFn:t=>async function(e,t){var n;const{addEthereumChainParameter:r,chainId:i}=t,o=e.state.connections.get((null==(n=t.connector)?void 0:n.uid)??e.state.current);if(o){const e=o.connector;if(!e.switchChain)throw new wI({connector:e});return await e.switchChain({addEthereumChainParameter:r,chainId:i})}const s=e.chains.find(e=>e.id===i);if(!s)throw new zC;return e.setState(e=>({...e,chainId:i})),s}(e,t),mutationKey:["switchChain"]}}function MP(e={}){const{onReplaced:t,...n}=e;return["waitForTransactionReceipt",IP(n)]}var TP=Yt.createContext(void 0),RP=e=>{const t=Yt.useContext(TP);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NP=({client:e,children:t})=>(Yt.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),bf.jsx(TP.Provider,{value:e,children:t})),LP=Yt.createContext(!1);LP.Provider;var BP=Yt.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),jP=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function DP(e,t,n){var r,i,o,s,a;const c=Yt.useContext(LP),l=Yt.useContext(BP),u=RP(),d=u.defaultQueryOptions(e);null==(i=null==(r=u.getDefaultOptions().queries)?void 0:r._experimental_beforeQuery)||i.call(r,d),d._optimisticResults=c?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(d),((e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))})(d,l),(e=>{Yt.useEffect(()=>{e.clearReset()},[e])})(l);const h=!u.getQueryCache().get(d.queryHash),[f]=Yt.useState(()=>new t(u,d)),p=f.getOptimisticResult(d),m=!c&&!1!==e.subscribed;if(Yt.useSyncExternalStore(Yt.useCallback(e=>{const t=m?f.subscribe(eP.batchCalls(e)):PA;return f.updateResult(),t},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),Yt.useEffect(()=>{f.setOptions(d)},[d,f]),((e,t)=>(null==e?void 0:e.suspense)&&t.isPending)(d,p))throw jP(d,f,l);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||YA(n,[e.error,r])))({result:p,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw p.error;if(null==(s=null==(o=u.getDefaultOptions().queries)?void 0:o._experimental_afterQuery)||s.call(o,d,p),d.experimental_prefetchInRender&&!AA&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,c)){const e=h?jP(d,f,l):null==(a=u.getQueryCache().get(d.queryHash))?void 0:a.promise;null==e||e.catch(PA).finally(()=>{f.updateResult()})}return d.notifyOnChangeProps?p:f.trackResult(p)}function UP(e,t){const n=RP(),[r]=Yt.useState(()=>new EP(n,e));Yt.useEffect(()=>{r.setOptions(e)},[r,e]);const i=Yt.useSyncExternalStore(Yt.useCallback(e=>r.subscribe(eP.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=Yt.useCallback((e,t)=>{r.mutate(e,t).catch(PA)},[r]);if(i.error&&YA(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function $P(e){const t=DP({...e,queryKeyHashFn:SP},dP);return t.queryKey=e.queryKey,t}function FP(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e._internal.chains.subscribe((e,t)=>{n(e,t)})}(t,{onChange:e}),()=>mI(t),()=>mI(t))}function zP(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e._internal.connectors.subscribe((e,t)=>{n(Object.values(e),t)})}(t,{onChange:e}),()=>yI(t),()=>yI(t))}function qP(e={}){const{mutation:t}=e,n=eA(e),r=AP(n),{mutate:i,mutateAsync:o,...s}=UP({...t,...r});return Yt.useEffect(()=>n.subscribe(({status:e})=>e,(e,t)=>{"connected"===t&&"disconnected"===e&&s.reset()}),[n,s.reset]),{...s,connect:i,connectAsync:o,connectors:zP({config:n})}}function HP(e={}){const{hash:t,query:n={}}=e,r=eA(e),i=function(e={}){const t=eA(e);return Yt.useSyncExternalStore(e=>function(e,t){const{onChange:n}=t;return e.subscribe(e=>e.chainId,n)}(t,{onChange:e}),()=>hI(t),()=>hI(t))}({config:r}),o=function(e,t={}){return{async queryFn({queryKey:n}){const{hash:r,...i}=n[1];if(!r)throw new Error("hash is required");return _I(e,{...i,onReplaced:t.onReplaced,hash:r})},queryKey:MP(t)}}(r,{...e,chainId:e.chainId??i}),s=Boolean(t&&(n.enabled??!0));return $P({...n,...o,enabled:s})}function WP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var KP,VP,GP={exports:{}},ZP=GP.exports={};function YP(){throw new Error("setTimeout has not been defined")}function JP(){throw new Error("clearTimeout has not been defined")}function QP(e){if(KP===setTimeout)return setTimeout(e,0);if((KP===YP||!KP)&&setTimeout)return KP=setTimeout,setTimeout(e,0);try{return KP(e,0)}catch(qAe){try{return KP.call(null,e,0)}catch(t){return KP.call(this,e,0)}}}!function(){try{KP="function"==typeof setTimeout?setTimeout:YP}catch(qAe){KP=YP}try{VP="function"==typeof clearTimeout?clearTimeout:JP}catch(qAe){VP=JP}}();var XP,eO=[],tO=!1,nO=-1;function rO(){tO&&XP&&(tO=!1,XP.length?eO=XP.concat(eO):nO=-1,eO.length&&iO())}function iO(){if(!tO){var e=QP(rO);tO=!0;for(var t=eO.length;t;){for(XP=eO,eO=[];++nO<t;)XP&&XP[nO].run();nO=-1,t=eO.length}XP=null,tO=!1,function(e){if(VP===clearTimeout)return clearTimeout(e);if((VP===JP||!VP)&&clearTimeout)return VP=clearTimeout,clearTimeout(e);try{return VP(e)}catch(qAe){try{return VP.call(null,e)}catch(t){return VP.call(this,e)}}}(e)}}function oO(e,t){this.fun=e,this.array=t}function sO(){}ZP.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];eO.push(new oO(e,t)),1!==eO.length||tO||QP(iO)},oO.prototype.run=function(){this.fun.apply(null,this.array)},ZP.title="browser",ZP.browser=!0,ZP.env={},ZP.argv=[],ZP.version="",ZP.versions={},ZP.on=sO,ZP.addListener=sO,ZP.once=sO,ZP.off=sO,ZP.removeListener=sO,ZP.removeAllListeners=sO,ZP.emit=sO,ZP.prependListener=sO,ZP.prependOnceListener=sO,ZP.listeners=function(e){return[]},ZP.binding=function(e){throw new Error("process.binding is not supported")},ZP.cwd=function(){return"/"},ZP.chdir=function(e){throw new Error("process.chdir is not supported")},ZP.umask=function(){return 0};const aO=WP(GP.exports);var cO;if("undefined"==typeof window){var lO={hostname:""};cO={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:lO,referrer:""},screen:{width:0,height:0},location:lO,addEventListener:function(){},removeEventListener:function(){},dispatchEvent:function(){},CustomEvent:function(){}}}else cO=window;function uO(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dO(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(cF){return void n(cF)}a.done?t(c):Promise.resolve(c).then(r,i)}function hO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(e){dO(o,r,i,s,a,"next",e)}function a(e){dO(o,r,i,s,a,"throw",e)}s(void 0)})}}function fO(e,t,n){return fO=xO()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&wO(i,n.prototype),i},fO.apply(null,arguments)}function pO(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function mO(){return mO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mO.apply(this,arguments)}function gO(e){return(gO=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yO(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wO(e,t)}function bO(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function vO(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function wO(e,t){return(wO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _O(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function EO(e){var t="function"==typeof Map?new Map:void 0;return EO=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return fO(e,arguments,gO(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),wO(r,e)},EO(e)}function xO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xO=function(){return!!e})()}function kO(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return uO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uO(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function SO(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(qAe){o=[6,qAe],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function CO(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var IO,AO=Object.defineProperty,PO=function(e,t,n){return function(e,t,n){return t in e?AO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)},OO=Object.defineProperty,MO=function(e,t,n){return function(e,t,n){return t in e?OO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)},TO=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(TO||{}),RO={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},NO={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},LO={};function BO(e){if(LO[e])return LO[e];var t=globalThis[e],n=t.prototype,r=e in RO?RO[e]:void 0,i=Boolean(r&&r.every(function(e){var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in NO?NO[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return LO[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?LO[e]=l:n}catch(qAe){return n}}var jO={};function DO(e,t,n){var r,i=e+"."+String(n);if(jO[i])return jO[i].call(t);var o=BO(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(jO[i]=s,s.call(t)):t[n]}var UO={};function $O(e,t,n){var r=e+"."+String(n);if(UO[r])return UO[r].bind(t);var i=BO(e)[n];return"function"!=typeof i?t[n]:(UO[r]=i,i.bind(t))}var FO={childNodes:function(e){return DO("Node",e,"childNodes")},parentNode:function(e){return DO("Node",e,"parentNode")},parentElement:function(e){return DO("Node",e,"parentElement")},textContent:function(e){return DO("Node",e,"textContent")},contains:function(e,t){return $O("Node",e,"contains")(t)},getRootNode:function(e){return $O("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?DO("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?DO("Element",e,"shadowRoot"):null},querySelector:function(e,t){return DO("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return DO("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return BO("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}};function zO(e){return e.nodeType===e.ELEMENT_NODE}function qO(e){var t=e&&"host"in e&&"mode"in e&&FO.host(e)||null;return Boolean(t&&"shadowRoot"in t&&FO.shadowRoot(t)===e)}function HO(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function WO(e){try{var t=e.rules||e.cssRules;if(!t)return null;var n=e.href;!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href);var r=Array.from(t,function(e){return KO(e,n)}).join("");return(i=r).includes(" background-clip: text;")&&!i.includes(" -webkit-background-clip: text;")&&(i=i.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),i}catch(cF){return null}var i}function KO(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=WO(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url("+JSON.stringify(e.href)+")"];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer("+e.layerName+")"),e.supportsText&&n.push("supports("+e.supportsText+")"),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(cF){n=e.cssText}return e.styleSheet.href?rM(n,e.styleSheet.href):n}var r,i=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,i=i.replace(r,"$1\\$2")),t?rM(i,t):i}var VO=function(){function e(){MO(this,"idNodeMap",new Map),MO(this,"nodeMetaMap",new WeakMap)}var t=e.prototype;return t.getId=function(e){var t;if(!e)return-1;var n=null==(t=this.getMeta(e))?void 0:t.id;return null!=n?n:-1},t.getNode=function(e){return this.idNodeMap.get(e)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},t.has=function(e){return this.idNodeMap.has(e)},t.hasNode=function(e){return this.nodeMetaMap.has(e)},t.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},t.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function GO(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.value,s=e.maskInputFn,a=o||"",c=i&&ZO(i);return(n[r.toLowerCase()]||c&&n[c])&&(a=s?s(a,t):"*".repeat(a.length)),a}function ZO(e){return e.toLowerCase()}var YO="__rrweb_original__";function JO(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ZO(t):null}function QO(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(o){return null}var r,i=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(r=null==i?void 0:i[1])?r:null}var XO=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,eM=/^(?:[a-z+]+:)?\/\//i,tM=/^www\..*/i,nM=/^(data:)([^,]*),(.*)/i;function rM(e,t){return(e||"").replace(XO,function(e,n,r,i,o,s){var a,c=r||o||s,l=n||i||"";if(!c)return e;if(eM.test(c)||tM.test(c))return"url("+l+c+l+")";if(nM.test(c))return"url("+l+c+l+")";if("/"===c[0])return"url("+l+(((a=t).indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)+l+")";var u=t.split("/"),d=c.split("/");u.pop();for(var h,f=kO(d);!(h=f()).done;){var p=h.value;"."!==p&&(".."===p?u.pop():u.push(p))}return"url("+l+u.join("/")+l+")"})}function iM(e,t){return void 0===t&&(t=!1),t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function oM(e,t){return function(e,t,n){void 0===n&&(n=!1);var r=Array.from(t.childNodes),i=[],o=0;if(r.length>1&&e&&"string"==typeof e)for(var s=iM(e,n),a=s.length/e.length,c=1;c<r.length;c++)if(r[c].textContent&&"string"==typeof r[c].textContent){for(var l=iM(r[c].textContent,n),u=3;u<l.length&&(l[u].match(/[a-zA-Z0-9]/)||-1!==l.indexOf(l.substring(0,u),1));u++);for(;u<l.length;u++){var d=l.substring(0,u),h=s.split(d),f=-1;if(2===h.length)f=h[0].length;else if(h.length>2&&""===h[0]&&""!==r[c-1].textContent)f=s.indexOf(d,1);else if(1===h.length){if(d=d.substring(0,d.length-1),(h=s.split(d)).length<=1)return i.push(e),i;u=101}else u===l.length-1&&(f=s.indexOf(d));if(h.length>=2&&u>100){var p=r[c-1].textContent;if(p&&"string"==typeof p){var m=iM(p).length;f=s.indexOf(d,m)}-1===f&&(f=h[0].length)}if(-1!==f){for(var g=Math.floor(f/a);g>0&&g<e.length;){if((o+=1)>50*r.length)return i.push(e),i;var y=iM(e.substring(0,g),n);if(y.length===f){i.push(e.substring(0,g)),e=e.substring(g),s=s.substring(f);break}y.length<f?g+=Math.max(1,Math.floor((f-y.length)/a)):g-=Math.max(1,Math.floor((y.length-f)*a))}break}}}return i.push(e),i}(e,t).join("/* rr_split */")}var sM,aM,cM=1,lM=new RegExp("[^a-z0-9-_:]");function uM(){return cM++}var dM=/^[^ \t\n\r\u000c]+/,hM=/^[, \t\n\r\u000c]+/;var fM=new WeakMap;function pM(e,t){return t&&""!==t.trim()?gM(e,t):t}function mM(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function gM(e,t){var n=fM.get(e);if(n||(n=e.createElement("a"),fM.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function yM(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?pM(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):""}for(var i=[];r(hM),!(n>=t.length);){var o=r(dM);if(","===o.slice(-1))o=pM(e,o.substring(0,o.length-1)),i.push(o);else{var s="";o=pM(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((o+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((o+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return i.join(", ")}(e,r):"style"===n?rM(r,gM(e)):"object"===t&&"data"===n?pM(e,r):r:pM(e,r):r}function bM(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function vM(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&vM(FO.parentNode(e),t,n);for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&vM(FO.parentNode(e),t,n)}function wM(e,t,n,r){var i;if(zO(e)){if(i=e,!FO.childNodes(i).length)return!1}else{if(null===FO.parentElement(e))return!1;i=FO.parentElement(e)}try{if("string"==typeof t){if(r){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if(vM(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(qAe){}return!1}function _M(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.needsMask,a=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,u=t.maskTextFn,d=t.maskInputFn,h=t.dataURLOptions,f=void 0===h?{}:h,p=t.inlineImages,m=t.recordCanvas,g=t.keepIframeSrcFn,y=t.newlyAddedElement,b=void 0!==y&&y,v=t.cssCaptured,w=void 0!==v&&v,_=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:TO.Document,childNodes:[],compatMode:e.compatMode}:{type:TO.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:TO.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,i=t.blockClass,o=t.blockSelector,s=t.inlineStylesheet,a=t.maskInputOptions,c=void 0===a?{}:a,l=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,h=t.inlineImages,f=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,g=void 0!==m&&m,y=t.rootId,b=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(qAe){}return!1}(e,i,o),v=function(e){if(bO(e,HTMLFormElement))return"form";var t=ZO(e.tagName);return lM.test(t)?"div":t}(e),w={},_=e.attributes.length,E=0;E<_;E++){var x=e.attributes[E];bM(v,x.name,x.value)||(w[x.name]=yM(r,v,ZO(x.name),x.value))}if("link"===v&&s){var k=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),S=null;k&&(S=WO(k)),S&&(delete w.rel,delete w.href,w._cssText=S)}if("style"===v&&e.sheet){var C=WO(e.sheet);C&&(e.childNodes.length>1&&(C=oM(C,e)),w._cssText=C)}if("input"===v||"textarea"===v||"select"===v){var I=e.value,A=e.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&I?w.value=GO({element:e,type:JO(e),tagName:v,value:I,maskInputOptions:c,maskInputFn:l}):A&&(w.checked=A)}"option"===v&&(e.selected&&!c.select?w.selected=!0:delete w.selected);"dialog"===v&&e.open&&(w.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===v&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,o=YO in i?i[YO]:i;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(w.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var P=e.toDataURL(d.type,d.quality),O=r.createElement("canvas");O.width=e.width,O.height=e.height,P!==O.toDataURL(d.type,d.quality)&&(w.rr_dataURL=P)}if("img"===v&&h){sM||(sM=r.createElement("canvas"),aM=sM.getContext("2d"));var M=e,T=M.currentSrc||M.getAttribute("src")||"<unknown-src>",R=M.crossOrigin,N=function(){M.removeEventListener("load",N);try{sM.width=M.naturalWidth,sM.height=M.naturalHeight,aM.drawImage(M,0,0),w.rr_dataURL=sM.toDataURL(d.type,d.quality)}catch(e){if("anonymous"!==M.crossOrigin)return M.crossOrigin="anonymous",void(M.complete&&0!==M.naturalWidth?N():M.addEventListener("load",N));console.warn("Cannot inline img src="+T+"! Error: "+e)}"anonymous"===M.crossOrigin&&(R?w.crossOrigin=R:M.removeAttribute("crossorigin"))};M.complete&&0!==M.naturalWidth?N():M.addEventListener("load",N)}if("audio"===v||"video"===v){var L=w;L.rr_mediaState=e.paused?"paused":"played",L.rr_mediaCurrentTime=e.currentTime,L.rr_mediaPlaybackRate=e.playbackRate,L.rr_mediaMuted=e.muted,L.rr_mediaLoop=e.loop,L.rr_mediaVolume=e.volume}g||(e.scrollLeft&&(w.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(w.rr_scrollTop=e.scrollTop));if(b){var B=e.getBoundingClientRect(),j=B.width,D=B.height;w={class:w.class,rr_width:j+"px",rr_height:D+"px"}}"iframe"!==v||p(w.src)||(e.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(v)&&(n=!0)}catch(qAe){}return{type:TO.Element,tagName:v,attributes:w,childNodes:[],isSVG:mM(e)||void 0,needBlock:b,rootId:y,isCustom:n}}(e,{doc:n,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:b,rootId:_});case e.TEXT_NODE:return function(e,t){var n=t.needsMask,r=t.maskTextFn,i=t.rootId,o=t.cssCaptured,s=FO.parentNode(e),a=s&&s.tagName,c="",l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=FO.textContent(e),l&&c&&(c=rM(c,gM(t.doc))));!l&&!u&&c&&n&&(c=r?r(c,FO.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:TO.Text,textContent:c||"",rootId:i}}(e,{doc:n,needsMask:s,maskTextFn:u,rootId:_,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:TO.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:TO.Comment,textContent:FO.textContent(e)||"",rootId:_};default:return!1}}function EM(e){return null==e?"":e.toLowerCase()}function xM(e,t){var n=t.doc,r=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,c=t.skipChild,l=void 0!==c&&c,u=t.inlineStylesheet,d=void 0===u||u,h=t.maskInputOptions,f=void 0===h?{}:h,p=t.maskTextFn,m=t.maskInputFn,g=t.slimDOMOptions,y=t.dataURLOptions,b=void 0===y?{}:y,v=t.inlineImages,w=void 0!==v&&v,_=t.recordCanvas,E=void 0!==_&&_,x=t.onSerialize,k=t.onIframeLoad,S=t.iframeLoadTimeout,C=void 0===S?5e3:S,I=t.onStylesheetLoad,A=t.stylesheetLoadTimeout,P=void 0===A?5e3:A,O=t.keepIframeSrcFn,M=void 0===O?function(){return!1}:O,T=t.newlyAddedElement,R=void 0!==T&&T,N=t.cssCaptured,L=void 0!==N&&N,B=t.needsMask,j=t.preserveWhiteSpace,D=void 0===j||j;B||(B=wM(e,s,a,void 0===B));var U,$=_M(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,dataURLOptions:b,inlineImages:w,recordCanvas:E,keepIframeSrcFn:M,newlyAddedElement:R,cssCaptured:L});if(!$)return console.warn(e,"not serialized"),null;U=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===TO.Comment)return!0;if(e.type===TO.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===QO(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(EM(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===EM(e.attributes.name)||"icon"===EM(e.attributes.rel)||"apple-touch-icon"===EM(e.attributes.rel)||"shortcut icon"===EM(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&EM(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(EM(e.attributes.property).match(/^(og|twitter|fb):/)||EM(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===EM(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===EM(e.attributes.name)||"googlebot"===EM(e.attributes.name)||"bingbot"===EM(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===EM(e.attributes.name)||"generator"===EM(e.attributes.name)||"framework"===EM(e.attributes.name)||"publisher"===EM(e.attributes.name)||"progid"===EM(e.attributes.name)||EM(e.attributes.property).match(/^article:/)||EM(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===EM(e.attributes.name)||"yandex-verification"===EM(e.attributes.name)||"csrf-token"===EM(e.attributes.name)||"p:domain_verify"===EM(e.attributes.name)||"verify-v1"===EM(e.attributes.name)||"verification"===EM(e.attributes.name)||"shopify-checkout-api-token"===EM(e.attributes.name)))return!0}}return!1}($,g)||!D&&$.type===TO.Text&&!$.textContent.replace(/^\s+|\s+$/gm,"").length?-2:uM();var F=Object.assign($,{id:U});if(r.add(e,F),-2===U)return null;x&&x(e);var z=!l;if(F.type===TO.Element){z=z&&!F.needBlock,delete F.needBlock;var q=FO.shadowRoot(e);q&&HO(q)&&(F.isShadowHost=!0)}if((F.type===TO.Document||F.type===TO.Element)&&z){g.headWhitespace&&F.type===TO.Element&&"head"===F.tagName&&(D=!1);var H={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M,cssCaptured:!1};if(F.type===TO.Element&&"textarea"===F.tagName&&void 0!==F.attributes.value);else{F.type===TO.Element&&void 0!==F.attributes._cssText&&"string"==typeof F.attributes._cssText&&(H.cssCaptured=!0);for(var W,K=kO(Array.from(FO.childNodes(e)));!(W=K()).done;){var V=xM(W.value,H);V&&F.childNodes.push(V)}}var G=null;if(zO(e)&&(G=FO.shadowRoot(e)))for(var Z,Y=kO(Array.from(FO.childNodes(G)));!(Z=Y()).done;){var J=xM(Z.value,H);J&&(HO(G)&&(J.isShadow=!0),F.childNodes.push(J))}}var Q=FO.parentNode(e);return Q&&qO(Q)&&HO(Q)&&(F.isShadow=!0),F.type===TO.Element&&"iframe"===F.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(cF){return}if("complete"===i){var s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&k){var n=xM(t,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M});n&&k(e,n)}},C),F.type===TO.Element&&"link"===F.tagName&&"string"==typeof F.attributes.rel&&("stylesheet"===F.attributes.rel||"preload"===F.attributes.rel&&"string"==typeof F.attributes.href&&"css"===QO(F.attributes.href))&&function(e,t,n){var r,i=!1;try{r=e.sheet}catch(cF){return}if(!r){var o=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(o),i=!0,t()})}}(e,function(){if(I){var t=xM(e,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:B,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:b,inlineImages:w,recordCanvas:E,preserveWhiteSpace:D,onSerialize:x,onIframeLoad:k,iframeLoadTimeout:C,onStylesheetLoad:I,stylesheetLoadTimeout:P,keepIframeSrcFn:M});t&&I(e,t)}},P),F}function kM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function SM(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return bO(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var CM={exports:{}},IM=String,AM=function(){return{isColorSupported:!1,reset:IM,bold:IM,dim:IM,italic:IM,underline:IM,inverse:IM,hidden:IM,strikethrough:IM,black:IM,red:IM,green:IM,yellow:IM,blue:IM,magenta:IM,cyan:IM,white:IM,gray:IM,bgBlack:IM,bgRed:IM,bgGreen:IM,bgYellow:IM,bgBlue:IM,bgMagenta:IM,bgCyan:IM,bgWhite:IM}};CM.exports=AM(),CM.exports.createColors=AM;var PM=CM.exports,OM=SM(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),MM=PM,TM=OM,RM=function(e){function t(n,r,i,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==r&&void 0!==i&&("number"==typeof r?(c.line=r,c.column=i):(c.line=r.line,c.column=r.column,c.endLine=i.line,c.endColumn=i.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}yO(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=MM.isColorSupported),TM&&e&&(n=TM(n));var r,i,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=MM.createColors(!0),u=l.bold,d=l.gray,h=l.red;r=function(e){return u(h(e))},i=function(e){return d(e)}}else r=i=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=i(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+i(a)+e+"\n "+l+r("^")}return" "+i(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(EO(Error)),NM=RM;RM.default=RM;var LM={};LM.isClean=Symbol("isClean"),LM.my=Symbol("my");var BM={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var jM=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n},t.block=function(e,t){var n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var r;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return BM[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?r=this[a](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=BM[n]),o.rawCache[n]=r,r},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=(t=i[i.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),DM=jM;jM.default=jM;var UM=DM;function $M(e,t){new UM(t).stringify(e)}var FM=$M;$M.default=$M;var zM=LM.isClean,qM=LM.my,HM=NM,WM=DM,KM=FM;function VM(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var i=e[r],o=void 0===i?"undefined":_O(i);"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(function(e){return VM(e,n)}):("object"===o&&null!==i&&(i=VM(i)),n[r]=i)}return n}var GM=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[zM]=!1,this[qM]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=kO(e[t]);!(n=r()).done;){var i=n.value;"function"==typeof i.clone?this.append(i.clone()):this.append(i)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=VM(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),r=n.end,i=n.start;return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new HM(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[zM]){this[zM]=!1;for(var e=this;e=e.parent;)e[zM]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new WM).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var r,i=this,o=!1,s=kO(t);!(r=s()).done;){var a=r.value;a===this?o=!0:o?(this.parent.insertAfter(i,a),i=a):this.parent.insertBefore(i,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},r=null==t;t=t||new Map;var i=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":_O(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=i,t.set(s.input,i),i++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return r&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=KM),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},pO(e,[{key:"proxyOf",get:function(){return this}}]),e}(),ZM=GM;GM.default=GM;var YM=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=mO({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return yO(t,e),pO(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(ZM),JM=YM;YM.default=YM;var QM=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},XM=OM.SourceMapConsumer,eT=OM.SourceMapGenerator,tT=OM.existsSync,nT=OM.readFileSync,rT=OM.dirname,iT=OM.join;var oT=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=rT(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new XM(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Ke?Ke.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":_O(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}},t.loadFile=function(e){if(this.root=rT(e),tT(e))return this.mapFile=e,nT(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(bO(t,XM))return eT.fromSourceMap(t).toString();if(bO(t,eT))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var r=this.loadFile(n);if(!r)throw new Error("Unable to load previous source map: "+n.toString());return r}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var i=this.annotation;return e&&(i=iT(rT(e),i)),this.loadFile(i)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),sT=oT;oT.default=oT;var aT=OM.SourceMapConsumer,cT=OM.SourceMapGenerator,lT=OM.fileURLToPath,uT=OM.pathToFileURL,dT=OM.isAbsolute,hT=OM.resolve,fT=QM,pT=OM,mT=NM,gT=sT,yT=Symbol("fromOffsetCache"),bT=Boolean(aT&&cT),vT=Boolean(hT&&dT),wT=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":_O(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!vT||/^\w+:\/\//.test(t.from)||dT(t.from)?this.file=t.from:this.file=hT(t.from)),vT&&bT){var n=new gT(this.css,t);if(n.text){this.map=n;var r=n.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+fT(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var i,o,s;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":_O(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(i=h?new mT(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new mT(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(uT&&(i.input.url=uT(this.file).toString()),i.input.file=this.file),i},t.fromOffset=function(e){var t;if(this[yT])t=this[yT];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,i=0,o=n.length;i<o;i++)t[i]=r,r+=n[i].length+1;this[yT]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:hT(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=dT(a.source)?uT(a.source):new URL(a.source,this.map.consumer().sourceRoot||uT(this.map.mapFile));var c={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!lT)throw new Error("file: protocol is not available in this PostCSS build");c.file=lT(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=mO({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},pO(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),_T=wT;wT.default=wT,pT&&pT.registerInput&&pT.registerInput(wT);var ET=OM.SourceMapConsumer,xT=OM.SourceMapGenerator,kT=OM.dirname,ST=OM.relative,CT=OM.resolve,IT=OM.sep,AT=OM.pathToFileURL,PT=_T,OT=Boolean(ET&&xT),MT=Boolean(kT&&CT&&ST&&IT),TT=function(){function e(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=kO(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||kT(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new ET(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),MT&&OT&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=xT.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new xT({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new xT({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=r,s.generated.column=i-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(r+=t.length,n=a.lastIndexOf("\n"),i=a.length-n):i+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=r,s.generated.column=i-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?kT(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=kT(CT(n,this.mapOpts.annotation)));var r=ST(n,e);return this.memoizedPaths.set(e,r),r},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new PT(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Ke?Ke.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(AT){var n=AT(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===IT&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),RT=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return yO(t,e),t}(ZM),NT=RT;RT.default=RT;var LT,BT,jT,DT,UT=LM.isClean,$T=LM.my,FT=JM,zT=NT;function qT(e){return e.map(function(e){return e.nodes&&(e.nodes=qT(e.nodes)),delete e.source,e})}function HT(e){if(e[UT]=!1,e.proxyOf.nodes)for(var t,n=kO(e.proxyOf.nodes);!(t=n()).done;){HT(t.value)}}var WT=function(e){function t(){return e.apply(this,arguments)||this}yO(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t);!(r=i()).done;)for(var o,s=r.value,a=kO(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=kO(this.nodes);!(n=r()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o;return(o=e)[t].apply(o,[].concat(r.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return n.apply(void 0,[].concat([e.toProxy()],r))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var o,s=kO(i);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(r+1,0,a)}for(var c in this.indexes)r<(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(var s,a=kO(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(r,0,c)}for(var l in this.indexes)r<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=qT(LT(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var i,o=kO(e=e.slice(0));!(i=o()).done;){var s=i.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=kO(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new FT(e)]}else if(e.selector)e=[new BT(e)];else if(e.name)e=[new jT(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new zT(e)]}return e.map(function(e){return e[$T]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[UT]&&HT(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=r.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t=t.reverse());!(r=i()).done;){for(var o,s=r.value,a=this.normalize(s,this.first,"prepend").reverse(),c=kO(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=kO(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var r;try{r=e(t,n)}catch(qAe){throw t.addToError(qAe)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},pO(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(ZM);WT.registerParse=function(e){LT=e},WT.registerRule=function(e){BT=e},WT.registerAtRule=function(e){jT=e},WT.registerRoot=function(e){DT=e};var KT=WT;WT.default=WT,WT.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,jT.prototype):"rule"===e.type?Object.setPrototypeOf(e,BT.prototype):"decl"===e.type?Object.setPrototypeOf(e,FT.prototype):"comment"===e.type?Object.setPrototypeOf(e,zT.prototype):"root"===e.type&&Object.setPrototypeOf(e,DT.prototype),e[$T]=!0,e.nodes&&e.nodes.forEach(function(e){WT.rebuild(e)})};var VT,GT,ZT=function(e){function t(t){var n;return(n=e.call(this,mO({type:"document"},t))||this).nodes||(n.nodes=[]),n}return yO(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new VT(new GT,this,e).stringify()},t}(KT);ZT.registerLazyResult=function(e){VT=e},ZT.registerProcessor=function(e){GT=e};var YT=ZT;ZT.default=ZT;var JT=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var r in t)this[r]=t[r]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),QT=JT;JT.default=JT;var XT=QT,eR=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new XT(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},pO(e,[{key:"content",get:function(){return this.css}}]),e}(),tR=eR;eR.default=eR;var nR="'".charCodeAt(0),rR='"'.charCodeAt(0),iR="\\".charCodeAt(0),oR="/".charCodeAt(0),sR="\n".charCodeAt(0),aR=" ".charCodeAt(0),cR="\f".charCodeAt(0),lR="\t".charCodeAt(0),uR="\r".charCodeAt(0),dR="[".charCodeAt(0),hR="]".charCodeAt(0),fR="(".charCodeAt(0),pR=")".charCodeAt(0),mR="{".charCodeAt(0),gR="}".charCodeAt(0),yR=";".charCodeAt(0),bR="*".charCodeAt(0),vR=":".charCodeAt(0),wR="@".charCodeAt(0),_R=/[\t\n\f\r "#'()/;[\\\]{}]/g,ER=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xR=/.[\r\n"'(/\\]/,kR=/[\da-f]/i,SR=KT,CR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}yO(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.append).call.apply(i,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.prepend).call.apply(i,[].concat([this],n))},t}(SR),IR=CR;CR.default=CR,SR.registerAtRule(CR);var AR,PR,OR=KT,MR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}yO(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=kO(i);!(o=s()).done;){o.value.raws.before=n.raws.before}return i},n.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new AR(new PR,this,e).stringify()},t}(OR);MR.registerLazyResult=function(e){AR=e},MR.registerProcessor=function(e){PR=e};var TR=MR;MR.default=MR,OR.registerRoot(MR);var RR={comma:function(e){return RR.split(e,[","],!0)},space:function(e){return RR.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,i=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=kO(e);!(r=d()).done;){var h=r.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&i.push(o.trim()),i}},NR=RR;RR.default=RR;var LR=KT,BR=NR,jR=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return yO(t,e),pO(t,[{key:"selectors",get:function(){return BR.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(LR),DR=jR;jR.default=jR,LR.registerRule(jR);var UR=JM,$R=function(e,t){void 0===t&&(t={});var n,r,i,o,s,a,c,l,u,d,h=e.css.valueOf(),f=t.ignoreErrors,p=h.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=p},nextToken:function(e){if(y.length)return y.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case sR:case aR:case lR:case uR:case cR:r=m;do{r+=1,n=h.charCodeAt(r)}while(n===aR||n===sR||n===lR||n===uR||n===cR);d=["space",h.slice(m,r)],m=r-1;break;case dR:case hR:case mR:case gR:case vR:case yR:case pR:var v=String.fromCharCode(n);d=[v,v,m];break;case fR:if(l=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==nR&&u!==rR&&u!==aR&&u!==sR&&u!==lR&&u!==cR&&u!==uR){r=m;do{if(a=!1,-1===(r=h.indexOf(")",r+1))){if(f||t){r=m;break}b("bracket")}for(c=r;h.charCodeAt(c-1)===iR;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,r+1),m,r],m=r}else r=h.indexOf(")",m+1),o=h.slice(m,r+1),-1===r||xR.test(o)?d=["(","(",m]:(d=["brackets",o,m,r],m=r);break;case nR:case rR:i=n===nR?"'":'"',r=m;do{if(a=!1,-1===(r=h.indexOf(i,r+1))){if(f||t){r=m+1;break}b("string")}for(c=r;h.charCodeAt(c-1)===iR;)c-=1,a=!a}while(a);d=["string",h.slice(m,r+1),m,r],m=r;break;case wR:_R.lastIndex=m+1,_R.test(h),r=0===_R.lastIndex?h.length-1:_R.lastIndex-2,d=["at-word",h.slice(m,r+1),m,r],m=r;break;case iR:for(r=m,s=!0;h.charCodeAt(r+1)===iR;)r+=1,s=!s;if(n=h.charCodeAt(r+1),s&&n!==oR&&n!==aR&&n!==sR&&n!==lR&&n!==uR&&n!==cR&&(r+=1,kR.test(h.charAt(r)))){for(;kR.test(h.charAt(r+1));)r+=1;h.charCodeAt(r+1)===aR&&(r+=1)}d=["word",h.slice(m,r+1),m,r],m=r;break;default:n===oR&&h.charCodeAt(m+1)===bR?(0===(r=h.indexOf("*/",m+2)+1)&&(f||t?r=h.length:b("comment")),d=["comment",h.slice(m,r+1),m,r],m=r):(ER.lastIndex=m+1,ER.test(h),r=0===ER.lastIndex?h.length-1:ER.lastIndex-2,d=["word",h.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},FR=NT,zR=IR,qR=TR,HR=DR,WR={empty:!0,space:!0};var KR=function(){function e(e){this.input=e,this.root=new qR,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,r,i=new zR;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;i>=0&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,i,o=0,s=kO(e.entries());!(i=s()).done;){var a=i.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return c}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new FR;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},t.createTokenizer=function(){this.tokenizer=$R(this.input)},t.decl=function(e,t){var n=new UR;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(r=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var f=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new HR;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)i||(i=c),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,r){for(var i,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(i=n[d])[0])||d!==c-1||r?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",WR[a]||WR[s]||","===l.slice(-1)?u=!1:l+=i[1]):l+=i[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new HR;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),VR=KT,GR=KR,ZR=_T;function YR(e,t){var n=new ZR(e,t),r=new GR(n);try{r.parse()}catch(qAe){throw qAe}return r.root}var JR=YR;YR.default=YR,VR.registerParse(YR);var QR=LM.isClean,XR=LM.my,eN=TT,tN=FM,nN=KT,rN=YT,iN=tR,oN=JR,sN=TR,aN={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},cN={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},lN={Once:!0,postcssPlugin:!0,prepare:!0};function uN(e){return"object"===(void 0===e?"undefined":_O(e))&&"function"==typeof e.then}function dN(e){var t=!1,n=aN[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function hN(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:dN(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function fN(e){return e[QR]=!1,e.nodes&&e.nodes.forEach(function(e){return fN(e)}),e}var pN={},mN=function(){function e(t,n,r){var i,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":_O(n))||null===n||"root"!==n.type&&"document"!==n.type)if(bO(n,e)||bO(n,iN))i=fN(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=oN;r.syntax&&(s=r.syntax.parse),r.parser&&(s=r.parser),s.parse&&(s=s.parse);try{i=s(n,r)}catch(cF){this.processed=!0,this.error=cF}i&&!i[XR]&&nN.rebuild(i)}else i=fN(n);this.result=new iN(t,i,r),this.helpers=mO({},pN,{postcss:pN,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.prepare?mO({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,r){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,r])},r=kO(this.plugins);!(t=r()).done;){var i=t.value;if("object"===(void 0===i?"undefined":_O(i)))for(var o in i){if(!cN[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+i.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!lN[o])if("object"===_O(i[o]))for(var s in i[o])n(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&n(i,o,i[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return hO(function(){var t,n,r,i,o,s,a,c,l,u,d,h;return SO(this,function(f){switch(f.label){case 0:e.plugin=0,t=0,f.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!uN(r=e.runOnRoot(n)))return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,r];case 3:return f.sent(),[3,5];case 4:throw i=f.sent(),e.handleError(i);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,f.label=7;case 7:if(o[QR])return[3,14];o[QR]=!0,s=[hN(o)],f.label=8;case 8:if(!(s.length>0))return[3,13];if(!uN(a=e.visitTick(s)))return[3,12];f.label=9;case 9:return f.trys.push([9,11,,12]),[4,a];case 10:return f.sent(),[3,12];case 11:throw c=f.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,r,i,s;return SO(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],r=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(i=o.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(i)]);case 2:return a.sent(),[3,5];case 3:return[4,r(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=kO(e.listeners.OnceExit),f.label=15;case 15:return(h=d()).done?[3,18]:[5,CO(u())];case 16:f.sent(),f.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":_O(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return uN(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(cF){throw this.handleError(cF)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=tN;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new eN(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=kO(this.plugins);!(e=t()).done;){var n=e.value;if(uN(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[QR];)r[QR]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var i,o=kO(r.nodes);!(i=o()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,r)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,r=kO(e);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(qAe){throw this.handleError(qAe,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(uN(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(r.length>0&&t.visitorIndex<r.length){var i=r[t.visitorIndex],o=i[0],s=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(qAe){throw this.handleError(qAe,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[QR])return a[QR]=!0,void e.push(hN(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[QR]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[QR]=!0;for(var n,r=kO(dN(e));!(n=r()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[QR]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},pO(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();mN.registerPostcss=function(e){pN=e};var gN=mN;mN.default=mN,sN.registerLazyResult(mN),rN.registerLazyResult(mN);var yN=TT,bN=FM,vN=JR,wN=tR,_N=function(){function e(e,t,n){var r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var i=bN;this.result=new wN(this._processor,r,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new yN(i,r,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},pO(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=vN;try{e=t(this._css,this._opts)}catch(cF){this.error=cF}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),EN=_N;_N.default=_N;var xN=EN,kN=gN,SN=YT,CN=TR,IN=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],r=kO(e);!(t=r()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===(void 0===i?"undefined":_O(i))&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===(void 0===i?"undefined":_O(i))&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else if("object"!==(void 0===i?"undefined":_O(i))||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new kN(this,e,t):new xN(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),AN=IN;IN.default=IN,CN.registerProcessor(IN),SN.registerProcessor(IN);var PN=JM,ON=sT,MN=NT,TN=IR,RN=_T,NN=TR,LN=DR;function BN(e,t){if(Array.isArray(e))return e.map(function(e){return BN(e)});var n=e.inputs,r=vO(e,["inputs"]);if(n){t=[];for(var i,o=kO(n);!(i=o()).done;){var s=mO({},i.value,{__proto__:RN.prototype});s.map&&(s.map=mO({},s.map,{__proto__:ON.prototype})),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return BN(e,t)})),r.source){var a=r.source,c=a.inputId,l=vO(a,["inputId"]);r.source=l,null!=c&&(r.source.input=t[c])}if("root"===r.type)return new NN(r);if("decl"===r.type)return new PN(r);if("rule"===r.type)return new LN(r);if("comment"===r.type)return new MN(r);if("atrule"===r.type)return new TN(r);throw new Error("Unknown node type: "+e.type)}var jN=BN;BN.default=BN;var DN=NM,UN=JM,$N=gN,FN=KT,zN=AN,qN=FM,HN=jN,WN=YT,KN=QT,VN=NT,GN=IR,ZN=tR,YN=_T,JN=JR,QN=NR,XN=DR,eL=TR,tL=ZM;function nL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new zN(t)}nL.plugin=function(e,t){var n,r=!1;function i(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),aO.env.LANG&&aO.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(i));return s.postcssPlugin=e,s.postcssVersion=(new zN).version,s}return Object.defineProperty(i,"postcss",{get:function(){return n||(n=i()),n}}),i.process=function(e,t,n){return nL([i(n)]).process(e,t)},i},nL.stringify=qN,nL.parse=JN,nL.fromJSON=HN,nL.list=QN,nL.comment=function(e){return new VN(e)},nL.atRule=function(e){return new GN(e)},nL.decl=function(e){return new UN(e)},nL.rule=function(e){return new XN(e)},nL.root=function(e){return new eL(e)},nL.document=function(e){return new WN(e)},nL.CssSyntaxError=DN,nL.Declaration=UN,nL.Container=FN,nL.Processor=zN,nL.Document=WN,nL.Comment=VN,nL.Warning=KN,nL.AtRule=GN,nL.Result=ZN,nL.Input=YN,nL.Rule=XN,nL.Root=eL,nL.Node=tL,$N.registerPostcss(nL);var rL=nL;nL.default=nL;var iL=kM(rL);iL.stringify,iL.fromJSON,iL.plugin,iL.parse,iL.list,iL.document,iL.comment,iL.atRule,iL.rule,iL.decl,iL.root,iL.CssSyntaxError,iL.Declaration,iL.Container,iL.Processor,iL.Document,iL.Comment,iL.Warning,iL.AtRule,iL.Result,iL.Input,iL.Rule,iL.Root,iL.Node;var oL=Object.defineProperty,sL=function(e,t,n){return function(e,t,n){return t in e?oL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)};function aL(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function cL(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return bO(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var lL={exports:{}},uL=String,dL=function(){return{isColorSupported:!1,reset:uL,bold:uL,dim:uL,italic:uL,underline:uL,inverse:uL,hidden:uL,strikethrough:uL,black:uL,red:uL,green:uL,yellow:uL,blue:uL,magenta:uL,cyan:uL,white:uL,gray:uL,bgBlack:uL,bgRed:uL,bgGreen:uL,bgYellow:uL,bgBlue:uL,bgMagenta:uL,bgCyan:uL,bgWhite:uL}};lL.exports=dL(),lL.exports.createColors=dL;var hL=lL.exports,fL=cL(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),pL=hL,mL=fL,gL=function(e){function t(n,r,i,o,s,a){var c;return(c=e.call(this,n)||this).name="CssSyntaxError",c.reason=n,s&&(c.file=s),o&&(c.source=o),a&&(c.plugin=a),void 0!==r&&void 0!==i&&("number"==typeof r?(c.line=r,c.column=i):(c.line=r.line,c.column=r.column,c.endLine=i.line,c.endColumn=i.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}yO(t,e);var n=t.prototype;return n.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},n.showSourceCode=function(e){var t=this;if(!this.source)return"";var n=this.source;null==e&&(e=pL.isColorSupported),mL&&e&&(n=mL(n));var r,i,o=n.split(/\r?\n/),s=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),c=String(a).length;if(e){var l=pL.createColors(!0),u=l.bold,d=l.gray,h=l.red;r=function(e){return u(h(e))},i=function(e){return d(e)}}else r=i=function(e){return e};return o.slice(s,a).map(function(e,n){var o=s+1+n,a=" "+(" "+o).slice(-c)+" | ";if(o===t.line){var l=i(a.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+i(a)+e+"\n "+l+r("^")}return" "+i(a)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(EO(Error)),yL=gL;gL.default=gL;var bL={};bL.isClean=Symbol("isClean"),bL.my=Symbol("my");var vL={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var wL=function(){function e(e){this.builder=e}var t=e.prototype;return t.atrule=function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var i=(e.raws.between||"")+(t?";":"");this.builder(n+r+i,e)}},t.beforeAfter=function(e,t){var n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n},t.block=function(e,t){var n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")},t.body=function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}},t.comment=function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)},t.decl=function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)},t.document=function(e){this.body(e)},t.raw=function(e,t,n){var r;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var i=e.parent;if("before"===n){if(!i||"root"===i.type&&i.first===e)return"";if(i&&"document"===i.type)return""}if(!i)return vL[n];var o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s,a="raw"+((s=n)[0].toUpperCase()+s.slice(1));return this[a]?r=this[a](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=vL[n]),o.rawCache[n]=r,r},t.rawBeforeClose=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawBeforeComment=function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeDecl=function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n},t.rawBeforeOpen=function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t},t.rawBeforeRule=function(e){var t;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return(t=n.raws.before).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t},t.rawColon=function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t},t.rawEmptyBody=function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t},t.rawIndent=function(e){return e.raws.indent?e.raws.indent:(e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var i=n.raws.before.split("\n");return t=(t=i[i.length-1]).replace(/\S/g,""),!1}}),t);var t},t.rawSemicolon=function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t},t.rawValue=function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)},e}(),_L=wL;wL.default=wL;var EL=_L;function xL(e,t){new EL(t).stringify(e)}var kL=xL;xL.default=xL;var SL=bL.isClean,CL=bL.my,IL=yL,AL=_L,PL=kL;function OL(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var i=e[r],o=void 0===i?"undefined":_O(i);"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=i:Array.isArray(i)?n[r]=i.map(function(e){return OL(e,n)}):("object"===o&&null!==i&&(i=OL(i)),n[r]=i)}return n}var ML=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[SL]=!1,this[CL]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=kO(e[t]);!(n=r()).done;){var i=n.value;"function"==typeof i.clone?this.append(i.clone()):this.append(i)}}else this[t]=e[t]}var t=e.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+t.input.from+":"+t.start.line+":"+t.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){for(var t in void 0===e&&(e={}),e)this[t]=e[t];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){void 0===e&&(e={});var t=OL(this);for(var n in e)t[n]=e[n];return t},t.cloneAfter=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertAfter(this,t),t},t.cloneBefore=function(e){void 0===e&&(e={});var t=this.clone(e);return this.parent.insertBefore(this,t),t},t.error=function(e,t){if(void 0===t&&(t={}),this.source){var n=this.rangeBy(t),r=n.end,i=n.start;return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new IL(e)},t.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0}}},t.markDirty=function(){if(this[SL]){this[SL]=!1;for(var e=this;e=e.parent;)e[SL]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,t){var n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){var r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n},t.positionInside=function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?(r=1,i+=1):r+=1;return{column:r,line:i}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){var r=this.toString(),i=r.indexOf(e.word);-1!==i&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}},t.raw=function(e,t){return(new AL).raw(this,e,t)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.parent){for(var r,i=this,o=!1,s=kO(t);!(r=s()).done;){var a=r.value;a===this?o=!0:o?(this.parent.insertAfter(i,a),i=a):this.parent.insertBefore(i,a)}o||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e},t.toJSON=function(e,t){var n={},r=null==t;t=t||new Map;var i=0;for(var o in this)if(Object.prototype.hasOwnProperty.call(this,o)&&"parent"!==o&&"proxyCache"!==o){var s=this[o];if(Array.isArray(s))n[o]=s.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===s?"undefined":_O(s))&&s.toJSON)n[o]=s.toJSON(null,t);else if("source"===o){var a=t.get(s.input);null==a&&(a=i,t.set(s.input,i),i++),n[o]={end:s.end,inputId:a,start:s.start}}else n[o]=s}return r&&(n.inputs=[].concat(t.keys()).map(function(e){return e.toJSON()})),n},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){void 0===e&&(e=PL),e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t},t.warn=function(e,t,n){var r={node:this};for(var i in n)r[i]=n[i];return e.warn(t,r)},pO(e,[{key:"proxyOf",get:function(){return this}}]),e}(),TL=ML;ML.default=ML;var RL=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=mO({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return yO(t,e),pO(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(TL),NL=RL;RL.default=RL;var LL=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},BL=fL.SourceMapConsumer,jL=fL.SourceMapGenerator,DL=fL.existsSync,UL=fL.readFileSync,$L=fL.dirname,FL=fL.join;var zL=function(){function e(e,t){if(!1!==t.map){this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");var n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=$L(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new BL(this.text)),this.consumerCache},t.decodeInline=function(e){var t;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Ke?Ke.from(t,"base64").toString():window.atob(t);var n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return"object"===(void 0===e?"undefined":_O(e))&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))},t.loadAnnotation=function(e){var t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(t){var n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}},t.loadFile=function(e){if(this.root=$L(e),DL(e))return this.mapFile=e,UL(e,"utf-8").toString().trim()},t.loadMap=function(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(bO(t,BL))return jL.fromSourceMap(t).toString();if(bO(t,jL))return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){var r=this.loadFile(n);if(!r)throw new Error("Unable to load previous source map: "+n.toString());return r}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var i=this.annotation;return e&&(i=FL($L(e),i)),this.loadFile(i)}}},t.startWith=function(e,t){return!!e&&e.substr(0,t.length)===t},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},e}(),qL=zL;zL.default=zL;var HL=fL.SourceMapConsumer,WL=fL.SourceMapGenerator,KL=fL.fileURLToPath,VL=fL.pathToFileURL,GL=fL.isAbsolute,ZL=fL.resolve,YL=LL,JL=fL,QL=yL,XL=qL,eB=Symbol("fromOffsetCache"),tB=Boolean(HL&&WL),nB=Boolean(ZL&&GL),rB=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":_O(e))&&!e.toString)throw new Error("PostCSS received "+e+" instead of CSS string");if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!nB||/^\w+:\/\//.test(t.from)||GL(t.from)?this.file=t.from:this.file=ZL(t.from)),nB&&tB){var n=new XL(this.css,t);if(n.text){this.map=n;var r=n.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+YL(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var i,o,s;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":_O(t))){var a=t,c=n;if("number"==typeof a.offset){var l=this.fromOffset(a.offset);t=l.line,n=l.col}else t=a.line,n=a.column;if("number"==typeof c.offset){var u=this.fromOffset(c.offset);o=u.line,s=u.col}else o=c.line,s=c.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var h=this.origin(t,n,o,s);return(i=h?new QL(e,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,r.plugin):new QL(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:s,line:o},this.css,this.file,r.plugin)).input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(VL&&(i.input.url=VL(this.file).toString()),i.input.file=this.file),i},t.fromOffset=function(e){var t;if(this[eB])t=this[eB];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,i=0,o=n.length;i<o;i++)t[i]=r,r+=n[i].length+1;this[eB]=t}var s=0;if(e>=t[t.length-1])s=t.length-1;else for(var a,c=t.length-2;s<c;)if(e<t[a=s+(c-s>>1)])c=a-1;else{if(!(e>=t[a+1])){s=a;break}s=a+1}return{col:e-t[s]+1,line:s+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:ZL(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var i,o,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(i=s.originalPositionFor({column:r,line:n})),o=GL(a.source)?VL(a.source):new URL(a.source,this.map.consumer().sourceRoot||VL(this.map.mapFile));var c={column:a.column,endColumn:i&&i.column,endLine:i&&i.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!KL)throw new Error("file: protocol is not available in this PostCSS build");c.file=KL(o)}var l=s.sourceContentFor(a.source);return l&&(c.source=l),c},t.toJSON=function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=mO({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},pO(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),iB=rB;rB.default=rB,JL&&JL.registerInput&&JL.registerInput(rB);var oB=fL.SourceMapConsumer,sB=fL.SourceMapGenerator,aB=fL.dirname,cB=fL.relative,lB=fL.resolve,uB=fL.sep,dB=fL.pathToFileURL,hB=iB,fB=Boolean(oB&&sB),pB=Boolean(aB&&lB&&cB&&uB),mB=function(){function e(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=e.prototype;return t.addAnnotation=function(){var e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";var t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e,t=kO(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||aB(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new oB(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}},t.clearAnnotation=function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;t>=0;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),pB&&fB&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(t){e+=t}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(1===this.previous().length){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=sB.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new sB({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new sB({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,i=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(a,c,l){if(e.css+=a,c&&"end"!==l&&(s.generated.line=r,s.generated.column=i-1,c.source&&c.source.start?(s.source=e.sourcePath(c),s.original.line=c.source.start.line,s.original.column=c.source.start.column-1,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,e.map.addMapping(s))),(t=a.match(/\n/g))?(r+=t.length,n=a.lastIndexOf("\n"),i=a.length-n):i+=a.length,c&&"start"!==l){var u=c.parent||{raws:{}};("decl"===c.type||"atrule"===c.type&&!c.nodes)&&c===u.last&&!u.raws.semicolon||(c.source&&c.source.end?(s.source=e.sourcePath(c),s.original.line=c.source.end.line,s.original.column=c.source.end.column-1,s.generated.line=r,s.generated.column=i-2,e.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=r,s.generated.column=i-1,e.map.addMapping(s)))}})},t.isAnnotation=function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))},t.isInline=function(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;var e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))},t.isMap=function(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;var n=this.opts.to?aB(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=aB(lB(n,this.mapOpts.annotation)));var r=cB(n,e);return this.memoizedPaths.set(e,r),r},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(t){if(t.source&&t.source.input.map){var n=t.source.input.map;e.previousMaps.includes(n)||e.previousMaps.push(n)}});else{var t=new hB(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,t={};if(this.root)this.root.walk(function(n){if(n.source){var r=n.source.input.from;if(r&&!t[r]){t[r]=!0;var i=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(i,n.source.input.css)}}});else if(this.css){var n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Ke?Ke.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(dB){var n=dB(e).toString();return this.memoizedFileURLs.set(e,n),n}throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===uB&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),gB=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return yO(t,e),t}(TL),yB=gB;gB.default=gB;var bB,vB,wB,_B,EB=bL.isClean,xB=bL.my,kB=NL,SB=yB;function CB(e){return e.map(function(e){return e.nodes&&(e.nodes=CB(e.nodes)),delete e.source,e})}function IB(e){if(e[EB]=!1,e.proxyOf.nodes)for(var t,n=kO(e.proxyOf.nodes);!(t=n()).done;){IB(t.value)}}var AB=function(e){function t(){return e.apply(this,arguments)||this}yO(t,e);var n=t.prototype;return n.append=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t);!(r=i()).done;)for(var o,s=r.value,a=kO(this.normalize(s,this.last));!(o=a()).done;){var c=o.value;this.proxyOf.nodes.push(c)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=kO(this.nodes);!(n=r()).done;){n.value.cleanRaws(t)}},n.each=function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}},n.every=function(e){return this.nodes.every(e)},n.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e},n.getProxyProcessor=function(){return{get:function(e,t){return"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o;return(o=e)[t].apply(o,[].concat(r.map(function(e){return"function"==typeof e?function(t,n){return e(t.toProxy(),n)}:e})))}:"every"===t||"some"===t?function(n){return e[t](function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return n.apply(void 0,[].concat([e.toProxy()],r))})}:"root"===t?function(){return e.root().toProxy()}:"nodes"===t?e.nodes.map(function(e){return e.toProxy()}):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]},set:function(e,t,n){return e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0}}},n.index=function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))},n.insertAfter=function(e,t){var n,r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var o,s=kO(i);!(o=s()).done;){var a=o.value;this.proxyOf.nodes.splice(r+1,0,a)}for(var c in this.indexes)r<(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),i=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(var s,a=kO(o);!(s=a()).done;){var c=s.value;this.proxyOf.nodes.splice(r,0,c)}for(var l in this.indexes)r<=(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=CB(bB(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var i,o=kO(e=e.slice(0));!(i=o()).done;){var s=i.value;s.parent&&s.parent.removeChild(s,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var a,c=kO(e=e.nodes.slice(0));!(a=c()).done;){var l=a.value;l.parent&&l.parent.removeChild(l,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new kB(e)]}else if(e.selector)e=[new vB(e)];else if(e.name)e=[new wB(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new SB(e)]}return e.map(function(e){return e[xB]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[EB]&&IB(e),void 0===e.raws.before&&n&&void 0!==n.raws.before&&(e.raws.before=n.raws.before.replace(/\S/g,"")),e.parent=r.proxyOf,e})},n.prepend=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r,i=kO(t=t.reverse());!(r=i()).done;){for(var o,s=r.value,a=this.normalize(s,this.first,"prepend").reverse(),c=kO(a);!(o=c()).done;){var l=o.value;this.proxyOf.nodes.unshift(l)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+a.length}return this.markDirty(),this},n.push=function(e){return e.parent=this,this.proxyOf.nodes.push(e),this},n.removeAll=function(){for(var e,t=kO(this.proxyOf.nodes);!(e=t()).done;){e.value.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},n.removeChild=function(e){var t;for(var n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this},n.replaceValues=function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this},n.some=function(e){return this.nodes.some(e)},n.walk=function(e){return this.each(function(t,n){var r;try{r=e(t,n)}catch(qAe){throw t.addToError(qAe)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))},n.walkComments=function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})},n.walkDecls=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))},n.walkRules=function(e,t){return t?bO(e,RegExp)?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))},pO(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(TL);AB.registerParse=function(e){bB=e},AB.registerRule=function(e){vB=e},AB.registerAtRule=function(e){wB=e},AB.registerRoot=function(e){_B=e};var PB=AB;AB.default=AB,AB.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,wB.prototype):"rule"===e.type?Object.setPrototypeOf(e,vB.prototype):"decl"===e.type?Object.setPrototypeOf(e,kB.prototype):"comment"===e.type?Object.setPrototypeOf(e,SB.prototype):"root"===e.type&&Object.setPrototypeOf(e,_B.prototype),e[xB]=!0,e.nodes&&e.nodes.forEach(function(e){AB.rebuild(e)})};var OB,MB,TB=function(e){function t(t){var n;return(n=e.call(this,mO({type:"document"},t))||this).nodes||(n.nodes=[]),n}return yO(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new OB(new MB,this,e).stringify()},t}(PB);TB.registerLazyResult=function(e){OB=e},TB.registerProcessor=function(e){MB=e};var RB=TB;TB.default=TB;var NB=function(){function e(e,t){if(void 0===t&&(t={}),this.type="warning",this.text=e,t.node&&t.node.source){var n=t.node.rangeBy(t);this.line=n.start.line,this.column=n.start.column,this.endLine=n.end.line,this.endColumn=n.end.column}for(var r in t)this[r]=t[r]}return e.prototype.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},e}(),LB=NB;NB.default=NB;var BB=LB,jB=function(){function e(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}var t=e.prototype;return t.toString=function(){return this.css},t.warn=function(e,t){void 0===t&&(t={}),t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new BB(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},pO(e,[{key:"content",get:function(){return this.css}}]),e}(),DB=jB;jB.default=jB;var UB="'".charCodeAt(0),$B='"'.charCodeAt(0),FB="\\".charCodeAt(0),zB="/".charCodeAt(0),qB="\n".charCodeAt(0),HB=" ".charCodeAt(0),WB="\f".charCodeAt(0),KB="\t".charCodeAt(0),VB="\r".charCodeAt(0),GB="[".charCodeAt(0),ZB="]".charCodeAt(0),YB="(".charCodeAt(0),JB=")".charCodeAt(0),QB="{".charCodeAt(0),XB="}".charCodeAt(0),ej=";".charCodeAt(0),tj="*".charCodeAt(0),nj=":".charCodeAt(0),rj="@".charCodeAt(0),ij=/[\t\n\f\r "#'()/;[\\\]{}]/g,oj=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,sj=/.[\r\n"'(/\\]/,aj=/[\da-f]/i,cj=PB,lj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}yO(t,e);var n=t.prototype;return n.append=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.append).call.apply(i,[].concat([this],n))},n.prepend=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i;return this.proxyOf.nodes||(this.nodes=[]),(i=e.prototype.prepend).call.apply(i,[].concat([this],n))},t}(cj),uj=lj;lj.default=lj,cj.registerAtRule(lj);var dj,hj,fj=PB,pj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}yO(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var i=e.prototype.normalize.call(this,t);if(n)if("prepend"===r)this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(var o,s=kO(i);!(o=s()).done;){o.value.raws.before=n.raws.before}return i},n.removeChild=function(t,n){var r=this.index(t);return!n&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),e.prototype.removeChild.call(this,t)},n.toResult=function(e){return void 0===e&&(e={}),new dj(new hj,this,e).stringify()},t}(fj);pj.registerLazyResult=function(e){dj=e},pj.registerProcessor=function(e){hj=e};var mj=pj;pj.default=pj,fj.registerRoot(pj);var gj={comma:function(e){return gj.split(e,[","],!0)},space:function(e){return gj.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,i=[],o="",s=!1,a=0,c=!1,l="",u=!1,d=kO(e);!(r=d()).done;){var h=r.value;u?u=!1:"\\"===h?u=!0:c?h===l&&(c=!1):'"'===h||"'"===h?(c=!0,l=h):"("===h?a+=1:")"===h?a>0&&(a-=1):0===a&&t.includes(h)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=h}return(n||""!==o)&&i.push(o.trim()),i}},yj=gj;gj.default=gj;var bj=PB,vj=yj,wj=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return yO(t,e),pO(t,[{key:"selectors",get:function(){return vj.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}}]),t}(bj),_j=wj;wj.default=wj,bj.registerRule(wj);var Ej=NL,xj=function(e,t){void 0===t&&(t={});var n,r,i,o,s,a,c,l,u,d,h=e.css.valueOf(),f=t.ignoreErrors,p=h.length,m=0,g=[],y=[];function b(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=p},nextToken:function(e){if(y.length)return y.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=h.charCodeAt(m)){case qB:case HB:case KB:case VB:case WB:r=m;do{r+=1,n=h.charCodeAt(r)}while(n===HB||n===qB||n===KB||n===VB||n===WB);d=["space",h.slice(m,r)],m=r-1;break;case GB:case ZB:case QB:case XB:case nj:case ej:case JB:var v=String.fromCharCode(n);d=[v,v,m];break;case YB:if(l=g.length?g.pop()[1]:"",u=h.charCodeAt(m+1),"url"===l&&u!==UB&&u!==$B&&u!==HB&&u!==qB&&u!==KB&&u!==WB&&u!==VB){r=m;do{if(a=!1,-1===(r=h.indexOf(")",r+1))){if(f||t){r=m;break}b("bracket")}for(c=r;h.charCodeAt(c-1)===FB;)c-=1,a=!a}while(a);d=["brackets",h.slice(m,r+1),m,r],m=r}else r=h.indexOf(")",m+1),o=h.slice(m,r+1),-1===r||sj.test(o)?d=["(","(",m]:(d=["brackets",o,m,r],m=r);break;case UB:case $B:i=n===UB?"'":'"',r=m;do{if(a=!1,-1===(r=h.indexOf(i,r+1))){if(f||t){r=m+1;break}b("string")}for(c=r;h.charCodeAt(c-1)===FB;)c-=1,a=!a}while(a);d=["string",h.slice(m,r+1),m,r],m=r;break;case rj:ij.lastIndex=m+1,ij.test(h),r=0===ij.lastIndex?h.length-1:ij.lastIndex-2,d=["at-word",h.slice(m,r+1),m,r],m=r;break;case FB:for(r=m,s=!0;h.charCodeAt(r+1)===FB;)r+=1,s=!s;if(n=h.charCodeAt(r+1),s&&n!==zB&&n!==HB&&n!==qB&&n!==KB&&n!==VB&&n!==WB&&(r+=1,aj.test(h.charAt(r)))){for(;aj.test(h.charAt(r+1));)r+=1;h.charCodeAt(r+1)===HB&&(r+=1)}d=["word",h.slice(m,r+1),m,r],m=r;break;default:n===zB&&h.charCodeAt(m+1)===tj?(0===(r=h.indexOf("*/",m+2)+1)&&(f||t?r=h.length:b("comment")),d=["comment",h.slice(m,r+1),m,r],m=r):(oj.lastIndex=m+1,oj.test(h),r=0===oj.lastIndex?h.length-1:oj.lastIndex-2,d=["word",h.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},kj=yB,Sj=uj,Cj=mj,Ij=_j,Aj={empty:!0,space:!0};var Pj=function(){function e(e){this.input=e,this.root=new Cj,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}var t=e.prototype;return t.atrule=function(e){var t,n,r,i=new Sj;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],c=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(i.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(i,"params",a),o&&(e=a[a.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),s&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;i>=0&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,i,o=0,s=kO(e.entries());!(i=s()).done;){var a=i.value,c=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return c}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new kj;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}},t.createTokenizer=function(){this.tokenizer=xj(this.input)},t.decl=function(e,t){var n=new Ej;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||function(e){for(var t=e.length-1;t>=0;t--){var n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var c=e.length-1;c>=0;c--){if("!important"===(r=e[c])[1].toLowerCase()){n.important=!0;var l=this.stringFrom(e,c);" !important"!==(l=this.spacesFromEnd(e)+l)&&(n.raws.important=l);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",h=c;h>0;h--){var f=u[h][0];if(0===d.trim().indexOf("!")&&"space"!==f)break;d=u.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=u)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var t=new Ij;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}},t.init=function(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)},t.other=function(e){for(var t=!1,n=null,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],c=e;c;){if(n=c[0],a.push(c),"("===n||"["===n)i||(i=c),o.push("("===n?")":"]");else if(s&&r&&"{"===n)i||(i=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(i),t&&r){if(!s)for(;a.length&&("space"===(c=a[a.length-1][0])||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,t,n,r){for(var i,o,s,a,c=n.length,l="",u=!0,d=0;d<c;d+=1)"space"!==(o=(i=n[d])[0])||d!==c-1||r?"comment"===o?(a=n[d-1]?n[d-1][0]:"empty",s=n[d+1]?n[d+1][0]:"empty",Aj[a]||Aj[s]||","===l.slice(-1)?u=!1:l+=i[1]):l+=i[1]:u=!1;if(!u){var h=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:h,value:l}}e[t]=l},t.rule=function(e){e.pop();var t=new Ij;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t},t.spacesAndCommentsFromEnd=function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n},t.spacesAndCommentsFromStart=function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n},t.spacesFromEnd=function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t},t.stringFrom=function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})},e}(),Oj=PB,Mj=Pj,Tj=iB;function Rj(e,t){var n=new Tj(e,t),r=new Mj(n);try{r.parse()}catch(qAe){throw qAe}return r.root}var Nj=Rj;Rj.default=Rj,Oj.registerParse(Rj);var Lj=bL.isClean,Bj=bL.my,jj=mB,Dj=kL,Uj=PB,$j=RB,Fj=DB,zj=Nj,qj=mj,Hj={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Wj={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Kj={Once:!0,postcssPlugin:!0,prepare:!0};function Vj(e){return"object"===(void 0===e?"undefined":_O(e))&&"function"==typeof e.then}function Gj(e){var t=!1,n=Hj[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Zj(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Gj(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function Yj(e){return e[Lj]=!1,e.nodes&&e.nodes.forEach(function(e){return Yj(e)}),e}var Jj={},Qj=function(){function e(t,n,r){var i,o=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":_O(n))||null===n||"root"!==n.type&&"document"!==n.type)if(bO(n,e)||bO(n,Fj))i=Yj(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=zj;r.syntax&&(s=r.syntax.parse),r.parser&&(s=r.parser),s.parse&&(s=s.parse);try{i=s(n,r)}catch(cF){this.processed=!0,this.error=cF}i&&!i[Bj]&&Uj.rebuild(i)}else i=Yj(n);this.result=new Fj(t,i,r),this.helpers=mO({},Jj,{postcss:Jj,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":_O(e))&&e.prepare?mO({},e,e.prepare(o.result)):e})}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,t){var n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion){0}}else e.plugin=n.postcssPlugin,e.setMessage()}catch(r){console&&console.error&&console.error(r)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var t,n=function(t,n,r){e.listeners[n]||(e.listeners[n]=[]),e.listeners[n].push([t,r])},r=kO(this.plugins);!(t=r()).done;){var i=t.value;if("object"===(void 0===i?"undefined":_O(i)))for(var o in i){if(!Wj[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event "+o+" in "+i.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!Kj[o])if("object"===_O(i[o]))for(var s in i[o])n(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&n(i,o,i[o])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return hO(function(){var t,n,r,i,o,s,a,c,l,u,d,h;return SO(this,function(f){switch(f.label){case 0:e.plugin=0,t=0,f.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!Vj(r=e.runOnRoot(n)))return[3,5];f.label=2;case 2:return f.trys.push([2,4,,5]),[4,r];case 3:return f.sent(),[3,5];case 4:throw i=f.sent(),e.handleError(i);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];o=e.result.root,f.label=7;case 7:if(o[Lj])return[3,14];o[Lj]=!0,s=[Zj(o)],f.label=8;case 8:if(!(s.length>0))return[3,13];if(!Vj(a=e.visitTick(s)))return[3,12];f.label=9;case 9:return f.trys.push([9,11,,12]),[4,a];case 10:return f.sent(),[3,12];case 11:throw c=f.sent(),l=s[s.length-1].node,e.handleError(c,l);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];u=function(){var t,n,r,i,s;return SO(this,function(a){switch(a.label){case 0:t=h.value,n=t[0],r=t[1],e.result.lastPlugin=n,a.label=1;case 1:return a.trys.push([1,6,,7]),"document"!==o.type?[3,3]:(i=o.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(i)]);case 2:return a.sent(),[3,5];case 3:return[4,r(o,e.helpers)];case 4:a.sent(),a.label=5;case 5:return[3,7];case 6:throw s=a.sent(),e.handleError(s);case 7:return[2]}})},d=kO(e.listeners.OnceExit),f.label=15;case 15:return(h=d()).done?[3,18]:[5,CO(u())];case 16:f.sent(),f.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var t=this;this.result.lastPlugin=e;try{if("object"===(void 0===e?"undefined":_O(e))&&e.Once){if("document"===this.result.root.type){var n=this.result.root.nodes.map(function(n){return e.Once(n,t.helpers)});return Vj(n[0])?Promise.all(n):n}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(cF){throw this.handleError(cF)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=Dj;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new jj(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e,t=kO(this.plugins);!(e=t()).done;){var n=e.value;if(Vj(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[Lj];)r[Lj]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var i,o=kO(r.nodes);!(i=o()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}else this.visitSync(this.listeners.OnceExit,r)}return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this.css},t.visitSync=function(e,t){for(var n,r=kO(e);!(n=r()).done;){var i=n.value,o=i[0],s=i[1];this.result.lastPlugin=o;var a=void 0;try{a=s(t,this.helpers)}catch(qAe){throw this.handleError(qAe,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Vj(a))throw this.getAsyncError()}},t.visitTick=function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(r.length>0&&t.visitorIndex<r.length){var i=r[t.visitorIndex],o=i[0],s=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return s(n.toProxy(),this.helpers)}catch(qAe){throw this.handleError(qAe,n)}}if(0!==t.iterator){for(var a,c=t.iterator;a=n.nodes[n.indexes[c]];)if(n.indexes[c]+=1,!a[Lj])return a[Lj]=!0,void e.push(Zj(a));t.iterator=0,delete n.indexes[c]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[Lj]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}e.pop()}else e.pop()},t.walkSync=function(e){var t=this;e[Lj]=!0;for(var n,r=kO(Gj(e));!(n=r()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[Lj]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},pO(e,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),e}();Qj.registerPostcss=function(e){Jj=e};var Xj=Qj;Qj.default=Qj,qj.registerLazyResult(Qj),$j.registerLazyResult(Qj);var eD=mB,tD=kL,nD=Nj,rD=DB,iD=function(){function e(e,t,n){var r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;var i=tD;this.result=new rD(this._processor,r,this._opts),this.result.css=t;var o=this;Object.defineProperty(this.result,"root",{get:function(){return o.root}});var s=new eD(i,r,this._opts,t);if(s.isMap()){var a=s.generate(),c=a[0],l=a[1];c&&(this.result.css=c),l&&(this.result.map=l)}else s.clearAnnotation(),this.result.css=s.css}var t=e.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,t){return this.async().then(e,t)},t.toString=function(){return this._css},t.warnings=function(){return[]},pO(e,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=nD;try{e=t(this._css,this._opts)}catch(cF){this.error=cF}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),oD=iD;iD.default=iD;var sD=oD,aD=Xj,cD=RB,lD=mj,uD=function(){function e(e){void 0===e&&(e=[]),this.version="8.4.38",this.plugins=this.normalize(e)}var t=e.prototype;return t.normalize=function(e){for(var t,n=[],r=kO(e);!(t=r()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===(void 0===i?"undefined":_O(i))&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===(void 0===i?"undefined":_O(i))&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else if("object"!==(void 0===i?"undefined":_O(i))||!i.parse&&!i.stringify)throw new Error(i+" is not a PostCSS plugin")}return n},t.process=function(e,t){return void 0===t&&(t={}),this.plugins.length||t.parser||t.stringifier||t.syntax?new aD(this,e,t):new sD(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),dD=uD;uD.default=uD,lD.registerProcessor(uD),cD.registerProcessor(uD);var hD=NL,fD=qL,pD=yB,mD=uj,gD=iB,yD=mj,bD=_j;function vD(e,t){if(Array.isArray(e))return e.map(function(e){return vD(e)});var n=e.inputs,r=vO(e,["inputs"]);if(n){t=[];for(var i,o=kO(n);!(i=o()).done;){var s=mO({},i.value,{__proto__:gD.prototype});s.map&&(s.map=mO({},s.map,{__proto__:fD.prototype})),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return vD(e,t)})),r.source){var a=r.source,c=a.inputId,l=vO(a,["inputId"]);r.source=l,null!=c&&(r.source.input=t[c])}if("root"===r.type)return new yD(r);if("decl"===r.type)return new hD(r);if("rule"===r.type)return new bD(r);if("comment"===r.type)return new pD(r);if("atrule"===r.type)return new mD(r);throw new Error("Unknown node type: "+e.type)}var wD=vD;vD.default=vD;var _D=yL,ED=NL,xD=Xj,kD=PB,SD=dD,CD=kL,ID=wD,AD=RB,PD=LB,OD=yB,MD=uj,TD=DB,RD=iB,ND=Nj,LD=yj,BD=_j,jD=mj,DD=TL;function UD(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new SD(t)}UD.plugin=function(e,t){var n,r=!1;function i(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),aO.env.LANG&&aO.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));var s=t.apply(void 0,[].concat(i));return s.postcssPlugin=e,s.postcssVersion=(new SD).version,s}return Object.defineProperty(i,"postcss",{get:function(){return n||(n=i()),n}}),i.process=function(e,t,n){return UD([i(n)]).process(e,t)},i},UD.stringify=CD,UD.parse=ND,UD.fromJSON=ID,UD.list=LD,UD.comment=function(e){return new OD(e)},UD.atRule=function(e){return new MD(e)},UD.decl=function(e){return new ED(e)},UD.rule=function(e){return new BD(e)},UD.root=function(e){return new jD(e)},UD.document=function(e){return new AD(e)},UD.CssSyntaxError=_D,UD.Declaration=ED,UD.Container=kD,UD.Processor=SD,UD.Document=AD,UD.Comment=OD,UD.Warning=PD,UD.AtRule=MD,UD.Result=TD,UD.Input=RD,UD.Rule=BD,UD.Root=jD,UD.Node=DD,xD.registerPostcss(UD);var $D=UD;UD.default=UD;var FD=aL($D);FD.stringify,FD.fromJSON,FD.plugin,FD.parse,FD.list,FD.document,FD.comment,FD.atRule,FD.rule,FD.decl,FD.root,FD.CssSyntaxError,FD.Declaration,FD.Container,FD.Processor,FD.Document,FD.Comment,FD.Warning,FD.AtRule,FD.Result,FD.Input,FD.Rule,FD.Root,FD.Node;var zD=function(){function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sL(this,"parentElement",null),sL(this,"parentNode",null),sL(this,"ownerDocument"),sL(this,"firstChild",null),sL(this,"lastChild",null),sL(this,"previousSibling",null),sL(this,"nextSibling",null),sL(this,"ELEMENT_NODE",1),sL(this,"TEXT_NODE",3),sL(this,"nodeType"),sL(this,"nodeName"),sL(this,"RRNodeType")}var t=e.prototype;return t.contains=function(t){if(!bO(t,e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1},t.appendChild=function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},t.insertBefore=function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},t.removeChild=function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},t.toString=function(){return"RRNode"},pO(e,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}}]),e}(),qD={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},HD={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},WD={};function KD(e){if(WD[e])return WD[e];var t=globalThis[e],n=t.prototype,r=e in qD?qD[e]:void 0,i=Boolean(r&&r.every(function(e){var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in HD?HD[e]:void 0,s=Boolean(o&&o.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(i&&s&&!globalThis.Zone)return WD[e]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var c=a.contentWindow;if(!c)return t.prototype;var l=c[e].prototype;return document.body.removeChild(a),l?WD[e]=l:n}catch(qAe){return n}}var VD={};function GD(e,t,n){var r,i=e+"."+String(n);if(VD[i])return VD[i].call(t);var o=KD(e),s=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return s?(VD[i]=s,s.call(t)):t[n]}var ZD={};function YD(e,t,n){var r=e+"."+String(n);if(ZD[r])return ZD[r].bind(t);var i=KD(e)[n];return"function"!=typeof i?t[n]:(ZD[r]=i,i.bind(t))}function JD(){return KD("MutationObserver").constructor}function QD(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}var XD={childNodes:function(e){return GD("Node",e,"childNodes")},parentNode:function(e){return GD("Node",e,"parentNode")},parentElement:function(e){return GD("Node",e,"parentElement")},textContent:function(e){return GD("Node",e,"textContent")},contains:function(e,t){return YD("Node",e,"contains")(t)},getRootNode:function(e){return YD("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?GD("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?GD("Element",e,"shadowRoot"):null},querySelector:function(e,t){return GD("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return GD("Element",e,"querySelectorAll")(t)},mutationObserver:JD,patch:QD};function eU(e,t,n){void 0===n&&(n=document);var r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var tU="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",nU={map:{},getId:function(){return console.error(tU),-1},getNode:function(){return console.error(tU),null},removeNodeFromMap:function(){console.error(tU)},has:function(){return console.error(tU),!1},reset:function(){console.error(tU)}};function rU(e,t,n){void 0===n&&(n={});var r=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var c=Date.now();i||!1!==n.leading||(i=c);var l=t-(c-i),u=this;l<=0||l>t?(r&&(clearTimeout(r),r=null),i=c,e.apply(u,s)):r||!1===n.trailing||(r=setTimeout(function(){i=!1===n.leading?0:Date.now(),r=null,e.apply(u,s)},l))}}function iU(e,t,n,r,i){void 0===i&&(i=window);var o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return iU(e,t,o||{},!0)}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(nU=new Proxy(nU,{get:function(e,t,n){return"map"===t&&console.error(tU),Reflect.get(e,t,n)}}));var oU=Date.now;function sU(e){var t,n,r,i,o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=XD.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=XD.parentElement(o.body))?void 0:r.scrollTop)||(null==(i=null==o?void 0:o.body)?void 0:i.scrollTop)||0}}function aU(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function cU(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function lU(e){return e?e.nodeType===e.ELEMENT_NODE?e:XD.parentElement(e):null}function uU(e,t,n,r){if(!e)return!1;var i=lU(e);if(!i)return!1;try{if("string"==typeof t){if(i.classList.contains(t))return!0;if(r&&null!==i.closest("."+t))return!0}else if(vM(i,t,r))return!0}catch(qAe){}if(n){if(i.matches(n))return!0;if(r&&null!==i.closest(n))return!0}return!1}function dU(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function hU(e,t){if(qO(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=XD.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||hU(r,t))}function fU(e){return Boolean(e.changedTouches)}function pU(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function mU(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function gU(e){return!!e&&(bO(e,zD)&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(XD.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(oU=function(){return(new Date).getTime()});var yU=function(){function e(){PO(this,"id",1),PO(this,"styleIDMap",new WeakMap),PO(this,"idStyleMap",new Map)}var t=e.prototype;return t.getId=function(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1},t.has=function(e){return this.styleIDMap.has(e)},t.add=function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n},t.getStyle=function(e){return this.idStyleMap.get(e)||null},t.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},t.generateId=function(){return this.id++},e}();function bU(e){var t,n=null;return"getRootNode"in e&&(null==(t=XD.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&XD.host(XD.getRootNode(e))&&(n=XD.host(XD.getRootNode(e))),n}function vU(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=bU(n);)n=t;return n}(e);return XD.contains(t,n)}function wU(e){var t=e.ownerDocument;return!!t&&(XD.contains(t,e)||vU(e))}var _U=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(_U||{}),EU=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(EU||{}),xU=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(xU||{}),kU=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(kU||{}),SU=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(SU||{}),CU=function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e}(CU||{}),IU=function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e}(IU||{});function AU(e){return"__ln"in e}var PU,OU=function(){function e(){PO(this,"length",0),PO(this,"head",null),PO(this,"tail",null)}var t=e.prototype;return t.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t},t.addNode=function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&AU(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&AU(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++},t.removeNode=function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)},e}(),MU=function(e,t){return e+"@"+t},TU=function(){function e(){var e=this;PO(this,"frozen",!1),PO(this,"locked",!1),PO(this,"texts",[]),PO(this,"attributes",[]),PO(this,"attributeMap",new WeakMap),PO(this,"removes",[]),PO(this,"mapRemoves",[]),PO(this,"movedMap",{}),PO(this,"addedSet",new Set),PO(this,"movedSet",new Set),PO(this,"droppedSet",new Set),PO(this,"removesSubTreeCache",new Set),PO(this,"mutationCb"),PO(this,"blockClass"),PO(this,"blockSelector"),PO(this,"maskTextClass"),PO(this,"maskTextSelector"),PO(this,"inlineStylesheet"),PO(this,"maskInputOptions"),PO(this,"maskTextFn"),PO(this,"maskInputFn"),PO(this,"keepIframeSrcFn"),PO(this,"recordCanvas"),PO(this,"inlineImages"),PO(this,"slimDOMOptions"),PO(this,"dataURLOptions"),PO(this,"doc"),PO(this,"mirror"),PO(this,"iframeManager"),PO(this,"stylesheetManager"),PO(this,"shadowDomManager"),PO(this,"canvasManager"),PO(this,"processedNodeManager"),PO(this,"unattachedDoc"),PO(this,"processMutations",function(t){t.forEach(e.processMutation),e.emit()}),PO(this,"emit",function(){if(!e.frozen&&!e.locked){for(var t=[],n=new Set,r=new OU,i=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},o=function(o){var s=XD.parentNode(o);if(s&&wU(o)){var a=!1;if(o.nodeType===Node.TEXT_NODE){var c=s.tagName;if("TEXTAREA"===c)return;"STYLE"===c&&e.addedSet.has(s)&&(a=!0)}var l=qO(s)?e.mirror.getId(bU(o)):e.mirror.getId(s),u=i(o);if(-1===l||-1===u)return r.addNode(o);var d=xM(o,{doc:e.doc,mirror:e.mirror,blockClass:e.blockClass,blockSelector:e.blockSelector,maskTextClass:e.maskTextClass,maskTextSelector:e.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:e.inlineStylesheet,maskInputOptions:e.maskInputOptions,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:e.slimDOMOptions,dataURLOptions:e.dataURLOptions,recordCanvas:e.recordCanvas,inlineImages:e.inlineImages,onSerialize:function(t){pU(t,e.mirror)&&e.iframeManager.addIframe(t),mU(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),gU(o)&&e.shadowDomManager.addShadowRoot(XD.shadowRoot(o),e.doc)},onIframeLoad:function(t,n){e.iframeManager.attachIframe(t,n),e.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:function(t,n){e.stylesheetManager.attachLinkElement(t,n)},cssCaptured:a});d&&(t.push({parentId:l,nextId:u,node:d}),n.add(d.id))}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var s,a=kO(e.movedSet);!(s=a()).done;){var c=s.value;NU(e.removesSubTreeCache,c,e.mirror)&&!e.movedSet.has(XD.parentNode(c))||o(c)}for(var l,u=kO(e.addedSet);!(l=u()).done;){var d=l.value;LU(e.droppedSet,d)||NU(e.removesSubTreeCache,d,e.mirror)?LU(e.movedSet,d)?o(d):e.droppedSet.add(d):o(d)}for(var h=null;r.length;){var f=null;if(h){var p=e.mirror.getId(XD.parentNode(h.value)),m=i(h.value);-1!==p&&-1!==m&&(f=h)}if(!f)for(var g=r.tail;g;){var y=g;if(g=g.previous,y){var b=e.mirror.getId(XD.parentNode(y.value));if(-1===i(y.value))continue;if(-1!==b){f=y;break}var v=y.value,w=XD.parentNode(v);if(w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var _=XD.host(w);if(-1!==e.mirror.getId(_)){f=y;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}h=f.previous,r.removeNode(f.value),o(f.value)}var E={texts:e.texts.map(function(t){var n=t.node,r=XD.parentNode(n);return r&&"TEXTAREA"===r.tagName&&e.genTextAreaValueMutation(r),{id:e.mirror.getId(n),value:t.value}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),attributes:e.attributes.map(function(t){var n=t.attributes;if("string"==typeof n.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);r.length<n.style.length&&(r+i).split("var(").length===n.style.split("var(").length&&(n.style=t.styleDiff)}return{id:e.mirror.getId(t.node),attributes:n}}).filter(function(e){return!n.has(e.id)}).filter(function(t){return e.mirror.has(t.id)}),removes:e.removes,adds:t};(E.texts.length||E.attributes.length||E.removes.length||E.adds.length)&&(e.texts=[],e.attributes=[],e.attributeMap=new WeakMap,e.removes=[],e.addedSet=new Set,e.movedSet=new Set,e.droppedSet=new Set,e.removesSubTreeCache=new Set,e.movedMap={},e.mutationCb(E))}}),PO(this,"genTextAreaValueMutation",function(t){var n=e.attributeMap.get(t);n||(n={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(n),e.attributeMap.set(t,n));var r=Array.from(XD.childNodes(t),function(e){return XD.textContent(e)||""}).join("");n.attributes.value=GO({element:t,maskInputOptions:e.maskInputOptions,tagName:t.tagName,type:JO(t),value:r,maskInputFn:e.maskInputFn})}),PO(this,"processMutation",function(t){if(!dU(t.target,e.mirror,e.slimDOMOptions))switch(t.type){case"characterData":var n=XD.textContent(t.target);uU(t.target,e.blockClass,e.blockSelector,!1)||n===t.oldValue||e.texts.push({value:wM(t.target,e.maskTextClass,e.maskTextSelector,!0)&&n?e.maskTextFn?e.maskTextFn(n,lU(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":var r=t.target,i=t.attributeName,o=t.target.getAttribute(i);if("value"===i){var s=JO(r);o=GO({element:r,maskInputOptions:e.maskInputOptions,tagName:r.tagName,type:s,value:o,maskInputFn:e.maskInputFn})}if(uU(t.target,e.blockClass,e.blockSelector,!1)||o===t.oldValue)return;var a=e.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===i&&!e.keepIframeSrcFn(o)){if(r.contentDocument)return;i="rr_src"}if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(a),e.attributeMap.set(t.target,a)),"type"===i&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!bM(r.tagName,i))if(a.attributes[i]=yM(e.doc,ZO(r.tagName),ZO(i),o),"style"===i){if(!e.unattachedDoc)try{e.unattachedDoc=document.implementation.createHTMLDocument()}catch(qAe){e.unattachedDoc=e.doc}var c=e.unattachedDoc.createElement("span");t.oldValue&&c.setAttribute("style",t.oldValue);for(var l,u=kO(Array.from(r.style));!(l=u()).done;){var d=l.value,h=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);h!==c.style.getPropertyValue(d)||f!==c.style.getPropertyPriority(d)?a.styleDiff[d]=""===f?h:[h,f]:a._unchangedStyles[d]=[h,f]}for(var p,m=kO(Array.from(c.style));!(p=m()).done;){var g=p.value;""===r.style.getPropertyValue(g)&&(a.styleDiff[g]=!1)}}else"open"===i&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?a.attributes.rr_open_mode="modal":a.attributes.rr_open_mode="non-modal");break;case"childList":if(uU(t.target,e.blockClass,e.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void e.genTextAreaValueMutation(t.target);t.addedNodes.forEach(function(n){return e.genAdds(n,t.target)}),t.removedNodes.forEach(function(n){var r=e.mirror.getId(n),i=qO(t.target)?e.mirror.getId(XD.host(t.target)):e.mirror.getId(t.target);uU(t.target,e.blockClass,e.blockSelector,!1)||dU(n,e.mirror,e.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(n,e.mirror)||(e.addedSet.has(n)?(RU(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||hU(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[MU(r,i)]?RU(e.movedSet,n):(e.removes.push({parentId:i,id:r,isShadow:!(!qO(t.target)||!HO(t.target))||void 0}),function(e,t){var n=[e];for(;n.length;){var r=n.pop();t.has(r)||(t.add(r),XD.childNodes(r).forEach(function(e){return n.push(e)}))}}(n,e.removesSubTreeCache))),e.mapRemoves.push(n))})}}),PO(this,"genAdds",function(t,n){if(!e.processedNodeManager.inOtherBuffer(t,e)&&!e.addedSet.has(t)&&!e.movedSet.has(t)){if(e.mirror.hasNode(t)){if(dU(t,e.mirror,e.slimDOMOptions))return;e.movedSet.add(t);var r=null;n&&e.mirror.hasNode(n)&&(r=e.mirror.getId(n)),r&&-1!==r&&(e.movedMap[MU(e.mirror.getId(t),r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);uU(t,e.blockClass,e.blockSelector,!1)||(XD.childNodes(t).forEach(function(t){return e.genAdds(t)}),gU(t)&&XD.childNodes(XD.shadowRoot(t)).forEach(function(n){e.processedNodeManager.add(n,e),e.genAdds(n,t)}))}})}var t=e.prototype;return t.init=function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(n){t[n]=e[n]})},t.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},t.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},t.isFrozen=function(){return this.frozen},t.lock=function(){this.locked=!0,this.canvasManager.lock()},t.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},t.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},e}();function RU(e,t){e.delete(t),XD.childNodes(t).forEach(function(t){return RU(e,t)})}function NU(e,t,n){return 0!==e.size&&function(e,t){var n=XD.parentNode(t);return!!n&&e.has(n)}(e,t)}function LU(e,t){return 0!==e.size&&BU(e,t)}function BU(e,t){var n=XD.parentNode(t);return!!n&&(!!e.has(n)||BU(e,n))}var jU=function(e){if(!PU)return e;return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{return e.apply(void 0,[].concat(n))}catch(cF){if(PU&&!0===PU(cF))return;throw cF}}},DU=[];function UU(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(qAe){}return e&&e.target}function $U(e,t){var n=new TU;DU.push(n),n.init(e);var r=new(JD())(jU(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function FU(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.sampling;if(!1===s.mouseInteraction)return function(){};var a=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,c=[],l=null;return Object.keys(xU).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]}).forEach(function(e){var s=ZO(e),a=function(e){return function(n){var s=UU(n);if(!uU(s,i,o,!0)){var a=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":a=kU.Mouse;break;case"touch":a=kU.Touch;break;case"pen":a=kU.Pen}a===kU.Touch?xU[e]===xU.MouseDown?c="TouchStart":xU[e]===xU.MouseUp&&(c="TouchEnd"):kU.Pen}else fU(n)&&(a=kU.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===kU.Touch||c.startsWith("Mouse")&&a===kU.Mouse)&&(a=null)):xU[e]===xU.Click&&(a=l,l=null);var u=fU(n)?n.changedTouches[0]:n;if(u){var d=r.getId(s),h=u.clientX,f=u.clientY;jU(t)(mO({type:xU[c],id:d,x:h,y:f},null!==a&&{pointerType:a}))}}}}(e);if(window.PointerEvent)switch(xU[e]){case xU.MouseDown:case xU.MouseUp:s=s.replace("mouse","pointer");break;case xU.TouchStart:case xU.TouchEnd:return}c.push(eU(s,a,n))}),jU(function(){c.forEach(function(e){return e()})})}function zU(e){var t=e.scrollCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.sampling;return eU("scroll",jU(rU(jU(function(e){var s=UU(e);if(s&&!uU(s,i,o,!0)){var a=r.getId(s);if(s===n&&n.defaultView){var c=sU(n.defaultView);t({id:a,x:c.left,y:c.top})}else t({id:a,x:s.scrollLeft,y:s.scrollTop})}}),s.scroll||100)),n)}var qU=["INPUT","TEXTAREA","SELECT"],HU=new WeakMap;function WU(e){return function(e,t){if(ZU("CSSGroupingRule")&&bO(e.parentRule,CSSGroupingRule)||ZU("CSSMediaRule")&&bO(e.parentRule,CSSMediaRule)||ZU("CSSSupportsRule")&&bO(e.parentRule,CSSSupportsRule)||ZU("CSSConditionRule")&&bO(e.parentRule,CSSConditionRule)){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function KU(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function VU(e,t){var n,r,i,o=e.mirror,s=e.stylesheetManager,a=null;a="#document"===t.nodeName?o.getId(t):o.getId(XD.host(t));var c="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(i=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:i.ShadowRoot,l=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==a&&-1!==a&&c&&l?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:function(){var e;return null==(e=l.get)?void 0:e.call(this)},set:function(e){var t,n=null==(t=l.set)?void 0:t.call(this,e);if(null!==a&&-1!==a)try{s.adoptStyleSheets(e,a)}catch(qAe){}return n}}),jU(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):function(){}}function GU(e,t){void 0===t&&(t={});var n,r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,i=e.mouseInteractionCb,o=e.scrollCb,s=e.viewportResizeCb,a=e.inputCb,c=e.mediaInteractionCb,l=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,h=e.fontCb,f=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var o;t.mutation&&(o=t).mutation.apply(o,[].concat(r)),n.apply(void 0,[].concat(r))},e.mousemoveCb=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o;t.mousemove&&(o=t).mousemove.apply(o,[].concat(n)),r.apply(void 0,[].concat(n))},e.mouseInteractionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o;t.mouseInteraction&&(o=t).mouseInteraction.apply(o,[].concat(n)),i.apply(void 0,[].concat(n))},e.scrollCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.scroll&&(i=t).scroll.apply(i,[].concat(n)),o.apply(void 0,[].concat(n))},e.viewportResizeCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.viewportResize&&(i=t).viewportResize.apply(i,[].concat(n)),s.apply(void 0,[].concat(n))},e.inputCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.input&&(i=t).input.apply(i,[].concat(n)),a.apply(void 0,[].concat(n))},e.mediaInteractionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.mediaInteaction&&(i=t).mediaInteaction.apply(i,[].concat(n)),c.apply(void 0,[].concat(n))},e.styleSheetRuleCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.styleSheetRule&&(i=t).styleSheetRule.apply(i,[].concat(n)),l.apply(void 0,[].concat(n))},e.styleDeclarationCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.styleDeclaration&&(i=t).styleDeclaration.apply(i,[].concat(n)),u.apply(void 0,[].concat(n))},e.canvasMutationCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.canvasMutation&&(i=t).canvasMutation.apply(i,[].concat(n)),d.apply(void 0,[].concat(n))},e.fontCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.font&&(i=t).font.apply(i,[].concat(n)),h.apply(void 0,[].concat(n))},e.selectionCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.selection&&(i=t).selection.apply(i,[].concat(n)),f.apply(void 0,[].concat(n))},e.customElementCb=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i;t.customElement&&(i=t).customElement.apply(i,[].concat(n)),p.apply(void 0,[].concat(n))}}(e,t),e.recordDOM&&(n=$U(e,e.doc));var i,o,s,a,c,l=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,i=e.mirror;if(!1===n.mousemove)return function(){};var o,s="number"==typeof n.mousemove?n.mousemove:50,a="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],l=rU(jU(function(e){var n=Date.now()-o;t(c.map(function(e){return e.timeOffset-=n,e}),e),c=[],o=null}),a),u=jU(rU(jU(function(e){var t=UU(e),n=fU(e)?e.changedTouches[0]:e,r=n.clientX,s=n.clientY;o||(o=oU()),c.push({x:r,y:s,id:i.getId(t),timeOffset:oU()-o}),l("undefined"!=typeof DragEvent&&bO(e,DragEvent)?EU.Drag:bO(e,MouseEvent)?EU.MouseMove:EU.TouchMove)}),s,{trailing:!1})),d=[eU("mousemove",u,r),eU("touchmove",u,r),eU("drag",u,r)];return jU(function(){d.forEach(function(e){return e()})})}(e),u=FU(e),d=zU(e),h=(i={win:r},o=e.viewportResizeCb,s=i.win,a=-1,c=-1,eU("resize",jU(rU(jU(function(){var e=aU(),t=cU();a===e&&c===t||(o({width:Number(t),height:Number(e)}),a=e,c=t)}),200)),s)),f=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.ignoreClass,a=e.ignoreSelector,c=e.maskInputOptions,l=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function h(e){var t=UU(e),r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=XD.parentElement(t)),t&&u&&!(qU.indexOf(u)<0)&&!uU(t,i,o,!0)&&!(t.classList.contains(s)||a&&t.matches(a))){var h=t.value,p=!1,m=JO(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(c[u.toLowerCase()]||c[m])&&(h=GO({element:t,maskInputOptions:c,tagName:u,type:m,value:h,maskInputFn:l})),f(t,d?{text:h,isChecked:p,userTriggered:r}:{text:h,isChecked:p});var g=t.name;"radio"===m&&g&&p&&n.querySelectorAll('input[type="radio"][name="'+g+'"]').forEach(function(e){if(e!==t){var n=e.value;f(e,d?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}})}}function f(e,n){var i=HU.get(e);if(!i||i.text!==n.text||i.isChecked!==n.isChecked){HU.set(e,n);var o=r.getId(e);jU(t)(mO({},n,{id:o}))}}var p=("last"===u.input?["change"]:["input","change"]).map(function(e){return eU(e,jU(h),n)}),m=n.defaultView;if(!m)return function(){p.forEach(function(e){return e()})};var g,y=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),b=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return y&&y.set&&(g=p).push.apply(g,[].concat(b.map(function(e){return iU(e[0],e[1],{set:function(){jU(h)({target:this,isTrusted:!1})}},!1,m)}))),jU(function(){p.forEach(function(e){return e()})})}(e),p=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,i=e.mirror,o=e.sampling,s=e.doc,a=jU(function(e){return rU(jU(function(o){var s=UU(o);if(s&&!uU(s,n,r,!0)){var a=s.currentTime,c=s.volume,l=s.muted,u=s.playbackRate,d=s.loop;t({type:e,id:i.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u,loop:d})}}),o.media||500)}),c=[eU("play",a(CU.Play),s),eU("pause",a(CU.Pause),s),eU("seeked",a(CU.Seeked),s),eU("volumechange",a(CU.VolumeChange),s),eU("ratechange",a(CU.RateChange),s)];return jU(function(){c.forEach(function(e){return e()})})}(e),m=function(){},g=function(){},y=function(){},b=function(){};e.recordDOM&&(m=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,i=e.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:jU(function(e,t,o){var s=o[0],a=o[1],c=KU(t,r,i.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:a}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.addRule=function(e,t,n){void 0===n&&(n=this.cssRules.length);var r=e+" { "+t+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var a,c,l=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(l,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:s}]}),e.apply(t,o)})}),o.CSSStyleSheet.prototype.removeRule=function(e){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replace:s}),e.apply(t,o)})})),o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:jU(function(e,t,o){var s=o[0],a=KU(t,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,replaceSync:s}),e.apply(t,o)})}));var u={};YU("CSSGroupingRule")?u.CSSGroupingRule=o.CSSGroupingRule:(YU("CSSMediaRule")&&(u.CSSMediaRule=o.CSSMediaRule),YU("CSSConditionRule")&&(u.CSSConditionRule=o.CSSConditionRule),YU("CSSSupportsRule")&&(u.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(u).forEach(function(e){var t=e[0],o=e[1];d[t]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[t].insertRule,{apply:jU(function(e,t,o){var s=o[0],a=o[1],c=KU(t.parentStyleSheet,r,i.styleMirror),l=c.id,u=c.styleId;return(l&&-1!==l||u&&-1!==u)&&n({id:l,styleId:u,adds:[{rule:s,index:[].concat(WU(t),[a||0])}]}),e.apply(t,o)})}),o.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:jU(function(e,t,o){var s=o[0],a=KU(t.parentStyleSheet,r,i.styleMirror),c=a.id,l=a.styleId;return(c&&-1!==c||l&&-1!==l)&&n({id:c,styleId:l,removes:[{index:[].concat(WU(t),[s])}]}),e.apply(t,o)})})}),jU(function(){o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=l,a&&(o.CSSStyleSheet.prototype.replace=a),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(u).forEach(function(e){var t=e[0],n=e[1];n.prototype.insertRule=d[t].insertRule,n.prototype.deleteRule=d[t].deleteRule})})}(e,{win:r}),g=VU(e,e.doc),y=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,i=e.ignoreCSSAttributes,o=e.stylesheetManager,s=t.win,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:jU(function(e,t,s){var c,l=s[0],u=s[1],d=s[2];if(i.has(l))return a.apply(t,[l,u,d]);var h=KU(null==(c=t.parentRule)?void 0:c.parentStyleSheet,r,o.styleMirror),f=h.id,p=h.styleId;return(f&&-1!==f||p&&-1!==p)&&n({id:f,styleId:p,set:{property:l,value:u,priority:d},index:WU(t.parentRule)}),e.apply(t,s)})});var c=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:jU(function(e,t,s){var a,l=s[0];if(i.has(l))return c.apply(t,[l]);var u=KU(null==(a=t.parentRule)?void 0:a.parentStyleSheet,r,o.styleMirror),d=u.id,h=u.styleId;return(d&&-1!==d||h&&-1!==h)&&n({id:d,styleId:h,remove:{property:l},index:WU(t.parentRule)}),e.apply(t,s)})}),jU(function(){s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=c})}(e,{win:r}),e.collectFonts&&(b=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var i=[],o=new WeakMap,s=r.FontFace;r.FontFace=function(e,t,n){var r=new s(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var a=QD(n.fonts,"add",function(e){return function(n){return setTimeout(jU(function(){var e=o.get(n);e&&(t(e),o.delete(n))}),0),e.apply(this,[n])}});return i.push(function(){r.FontFace=s}),i.push(a),jU(function(){i.forEach(function(e){return e()})})}(e)));for(var v,w=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,i=e.blockSelector,o=e.selectionCb,s=!0,a=jU(function(){var e=t.getSelection();if(!(!e||s&&(null==e?void 0:e.isCollapsed))){s=e.isCollapsed||!1;for(var a=[],c=e.rangeCount||0,l=0;l<c;l++){var u=e.getRangeAt(l),d=u.startContainer,h=u.startOffset,f=u.endContainer,p=u.endOffset;uU(d,r,i,!0)||uU(f,r,i,!0)||a.push({start:n.getId(d),startOffset:h,end:n.getId(f),endOffset:p})}o({ranges:a})}});return a(),eU("selectionchange",a)}(e),_=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?QD(r.customElements,"define",function(e){return function(t,r,i){try{n({define:{name:t}})}catch(qAe){console.warn("Custom element callback failed for "+t)}return e.apply(this,[t,r,i])}}):function(){}}(e),E=[],x=kO(e.plugins);!(v=x()).done;){var k=v.value;E.push(k.observer(k.callback,r,k.options))}return jU(function(){DU.forEach(function(e){return e.reset()}),null==n||n.disconnect(),l(),u(),d(),h(),f(),p(),m(),g(),y(),b(),w(),_(),E.forEach(function(e){return e()})})}function ZU(e){return void 0!==window[e]}function YU(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var JU=function(){function e(e){PO(this,"iframeIdToRemoteIdMap",new WeakMap),PO(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}var t=e.prototype;return t.getId=function(e,t,n,r){var i=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e),s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),o.set(s,t)),s},t.getIds=function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getId(e,t,r,i)})},t.getRemoteId=function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var i=r.get(t);return i||-1},t.getRemoteIds=function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getRemoteId(e,t,r)})},t.reset=function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)},t.getIdToRemoteIdMap=function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t},t.getRemoteIdToIdMap=function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t},e}(),QU=function(){function e(e){PO(this,"iframes",new WeakMap),PO(this,"crossOriginIframeMap",new WeakMap),PO(this,"crossOriginIframeMirror",new JU(uM)),PO(this,"crossOriginIframeStyleMirror"),PO(this,"crossOriginIframeRootIdMap",new WeakMap),PO(this,"mirror"),PO(this,"mutationCb"),PO(this,"wrappedEmit"),PO(this,"loadListener"),PO(this,"stylesheetManager"),PO(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new JU(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var t=e.prototype;return t.addIframe=function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)},t.addLoadListener=function(e){this.loadListener=e},t.attachIframe=function(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))},t.handleMessage=function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}},t.transformCrossOriginEvent=function(e,t){var n,r=this;switch(t.type){case _U.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:_U.IncrementalSnapshot,data:{source:EU.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case _U.Meta:case _U.Load:case _U.DomContentLoaded:return!1;case _U.Plugin:return t;case _U.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _U.IncrementalSnapshot:switch(t.data.source){case EU.Mutation:return t.data.adds.forEach(function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(function(t){r.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(function(t){r.replaceIds(t,e,["id"])}),t.data.texts.forEach(function(t){r.replaceIds(t,e,["id"])}),t;case EU.Drag:case EU.TouchMove:case EU.MouseMove:return t.data.positions.forEach(function(t){r.replaceIds(t,e,["id"])}),t;case EU.ViewportResize:return!1;case EU.MediaInteraction:case EU.MouseInteraction:case EU.Scroll:case EU.CanvasMutation:case EU.Input:return this.replaceIds(t.data,e,["id"]),t;case EU.StyleSheetRule:case EU.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case EU.Font:return t;case EU.Selection:return t.data.ranges.forEach(function(t){r.replaceIds(t,e,["start","end"])}),t;case EU.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(function(t){r.replaceStyleIds(t,e,["styleId"])}),t}}return!1},t.replace=function(e,t,n,r){for(var i,o=kO(r);!(i=o()).done;){var s=i.value;(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}return t},t.replaceIds=function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)},t.replaceStyleIds=function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)},t.replaceIdOnNode=function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})},t.patchRootIdOnNode=function(e,t){var n=this;e.type===IU.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})},e}(),XU=function(){function e(e){PO(this,"shadowDoms",new WeakSet),PO(this,"mutationCb"),PO(this,"scrollCb"),PO(this,"bypassOptions"),PO(this,"mirror"),PO(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}var t=e.prototype;return t.init=function(){this.reset(),this.patchAttachShadow(Element,document)},t.addShadowRoot=function(e,t){var n=this;if(HO(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=$U(mO({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return r.disconnect()}),this.restoreHandlers.push(zU(mO({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(XD.host(e))),n.restoreHandlers.push(VU({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))},0)}},t.observeAttachShadow=function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)},t.patchAttachShadow=function(e,t){var n=this;this.restoreHandlers.push(QD(e.prototype,"attachShadow",function(e){return function(r){var i=e.call(this,r),o=XD.shadowRoot(this);return o&&wU(this)&&n.addShadowRoot(o,t),i}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch(qAe){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},e}(),e$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t$="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n$=0;n$<64;n$++)t$[e$.charCodeAt(n$)]=n$;var r$=new Map;var i$=function(e,t,n){if(e&&(a$(e,t)||"object"===(void 0===e?"undefined":_O(e)))){var r=function(e,t){var n=r$.get(e);return n||(n=new Map,r$.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=r.indexOf(e);return-1===i&&(i=r.length,r.push(e)),i}};function o$(e,t,n){if(bO(e,Array))return e.map(function(e){return o$(e,t,n)});if(null===e)return e;if(bO(e,Float32Array)||bO(e,Float64Array)||bO(e,Int32Array)||bO(e,Uint32Array)||bO(e,Uint8Array)||bO(e,Uint16Array)||bO(e,Int16Array)||bO(e,Int8Array)||bO(e,Uint8ClampedArray))return{rr_type:e.constructor.name,args:[Object.values(e)]};if(bO(e,ArrayBuffer))return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,i="";for(t=0;t<r;t+=3)i+=e$[n[t]>>2],i+=e$[(3&n[t])<<4|n[t+1]>>4],i+=e$[(15&n[t+1])<<2|n[t+2]>>6],i+=e$[63&n[t+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e)};if(bO(e,DataView))return{rr_type:e.constructor.name,args:[o$(e.buffer,t,n),e.byteOffset,e.byteLength]};if(bO(e,HTMLImageElement))return{rr_type:e.constructor.name,src:e.src};if(bO(e,HTMLCanvasElement)){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return bO(e,ImageData)?{rr_type:e.constructor.name,args:[o$(e.data,t,n),e.width,e.height]}:a$(e,t)||"object"===(void 0===e?"undefined":_O(e))?{rr_type:e.constructor.name,index:i$(e,t,n)}:e}var s$=function(e,t,n){return e.map(function(e){return o$(e,t,n)})},a$=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof t[e]});return Boolean(n.find(function(n){return bO(e,t[n])}))};function c$(e,t,n,r){var i=[];try{var o=QD(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];if(!uU(this,t,n,!0)){var c=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=c),r&&["webgl","webgl2"].includes(c))if(s[0]&&"object"===_O(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[].concat([i],s))}});i.push(o)}catch(qAe){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(e){return e()})}}function l$(e,t,n,r,i,o){for(var s,a=function(){var a=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))return"continue";try{if("function"!=typeof e[a])return"continue";var l=QD(e,a,function(e){return function(){for(var s=arguments.length,c=new Array(s),l=0;l<s;l++)c[l]=arguments[l];var u=e.apply(this,c);if(i$(u,o,this),"tagName"in this.canvas&&!uU(this.canvas,r,i,!0)){var d=s$(c,o,this),h={type:t,property:a,args:d};n(this.canvas,h)}return u}});c.push(l)}catch(qAe){var u=iU(e,a,{set:function(e){n(this.canvas,{type:t,property:a,args:[e],setter:!0})}});c.push(u)}},c=[],l=kO(Object.getOwnPropertyNames(e));!(s=l()).done;)a();return c}var u$,d$="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",h$="undefined"!=typeof window&&window.Blob&&new Blob([(u$=d$,Uint8Array.from(atob(u$),function(e){return e.charCodeAt(0)}))],{type:"text/javascript;charset=utf-8"});function f$(e){var t;try{if(!(t=h$&&(window.URL||window.webkitURL).createObjectURL(h$)))throw"";var n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(qAe){return new Worker("data:text/javascript;base64,"+d$,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var p$,m$,g$,y$=function(){function e(e){var t=this;PO(this,"pendingCanvasMutations",new Map),PO(this,"rafStamps",{latestId:0,invokeId:null}),PO(this,"mirror"),PO(this,"mutationCb"),PO(this,"resetObservers"),PO(this,"frozen",!1),PO(this,"locked",!1),PO(this,"processMutation",function(e,n){!(t.rafStamps.invokeId&&t.rafStamps.latestId!==t.rafStamps.invokeId)&&t.rafStamps.invokeId||(t.rafStamps.invokeId=t.rafStamps.latestId),t.pendingCanvasMutations.has(e)||t.pendingCanvasMutations.set(e,[]),t.pendingCanvasMutations.get(e).push(n)});var n=e.sampling,r=void 0===n?"all":n,i=e.win,o=e.blockClass,s=e.blockSelector,a=e.recordCanvas,c=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,s,{dataURLOptions:c})}var t=e.prototype;return t.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},t.freeze=function(){this.frozen=!0},t.unfreeze=function(){this.frozen=!1},t.lock=function(){this.locked=!0},t.unlock=function(){this.locked=!1},t.initCanvasFPSObserver=function(e,t,n,r,i){var o=this,s=c$(t,n,r,!0),a=new Map,c=new f$;c.onmessage=function(e){var t=e.data.id;if(a.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,i=n.type,s=n.width,c=n.height;o.mutationCb({id:t,type:SU["2D"],commands:[{property:"clearRect",args:[0,0,s,c]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:i}]},0,0]}]})}};var l,u=1e3/e,d=0,h=function(e){if(d&&e-d<u)l=requestAnimationFrame(h);else{d=e;var s,f=o;(s=[],t.document.querySelectorAll("canvas").forEach(function(e){uU(e,n,r,!0)||s.push(e)}),s).forEach(hO(function(e){var t,n,r,o;return SO(this,function(s){switch(s.label){case 0:return n=f.mirror.getId(e),a.get(n)?[2]:0===e.width||0===e.height?[2]:(a.set(n,!0),["webgl","webgl2"].includes(e.__context)&&(r=e.getContext(e.__context),!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)),[4,createImageBitmap(e)]);case 1:return o=s.sent(),c.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[o]),[2]}})})),l=requestAnimationFrame(h)}};l=requestAnimationFrame(h),this.resetObservers=function(){s(),cancelAnimationFrame(l)}},t.initCanvasMutationObserver=function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=c$(e,t,n,!1),i=function(e,t,n,r){for(var i,o=function(){var o=i.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[o])return"continue";var a=QD(t.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var s=this,a=arguments.length,c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return uU(this.canvas,n,r,!0)||setTimeout(function(){var n=s$(c,t,s);e(s.canvas,{type:SU["2D"],property:o,args:n})},0),i.apply(this,c)}});s.push(a)}catch(qAe){var c=iU(t.CanvasRenderingContext2D.prototype,o,{set:function(t){e(this.canvas,{type:SU["2D"],property:o,args:[t],setter:!0})}});s.push(c)}},s=[],a=kO(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));!(i=a()).done;)o();return function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){var i,o,s=[];return(i=s).push.apply(i,[].concat(l$(t.WebGLRenderingContext.prototype,SU.WebGL,e,n,r,t))),void 0!==t.WebGL2RenderingContext&&(o=s).push.apply(o,[].concat(l$(t.WebGL2RenderingContext.prototype,SU.WebGL2,e,n,r,t))),function(){s.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n);this.resetObservers=function(){r(),i(),o()}},t.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.startRAFTimestamping=function(){var e=this,t=function(n){e.rafStamps.latestId=n,requestAnimationFrame(t)};requestAnimationFrame(t)},t.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.flushPendingCanvasMutationFor=function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map(function(e){return e.type,vO(e,["type"])}),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}(),b$=function(){function e(e){PO(this,"trackedLinkElements",new WeakSet),PO(this,"mutationCb"),PO(this,"adoptedStyleSheetCb"),PO(this,"styleMirror",new yU),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}var t=e.prototype;return t.attachLinkElement=function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)},t.trackLinkElement=function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))},t.adoptStyleSheets=function(e,t){var n,r=function(){var e=i.value,t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,function(t,n){return{rule:KO(t,e.href),index:n}})})),o.styleIds.push(t)};if(0!==e.length){for(var i,o={id:t,styleIds:[]},s=[],a=kO(e);!(i=a()).done;)n=this,r();s.length>0&&(o.styles=s),this.adoptedStyleSheetCb(o)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},e}(),v$=function(){function e(){PO(this,"nodeMap",new WeakMap),PO(this,"active",!1)}var t=e.prototype;return t.inOtherBuffer=function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some(function(e){return e!==t})},t.add=function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))},t.destroy=function(){},e}(),w$=!1;try{if(2!==Array.from([1],function(e){return 2*e})[0]){var _$=document.createElement("iframe");document.body.appendChild(_$),Array.from=(null==(IO=_$.contentWindow)?void 0:IO.Array.from)||Array.from,document.body.removeChild(_$)}}catch(jHe){}var E$,x$,k$=new VO;function S$(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,s=e.blockSelector,a=void 0===s?null:s,c=e.ignoreClass,l=void 0===c?"rr-ignore":c,u=e.ignoreSelector,d=void 0===u?null:u,h=e.maskTextClass,f=void 0===h?"rr-mask":h,p=e.maskTextSelector,m=void 0===p?null:p,g=e.inlineStylesheet,y=void 0===g||g,b=e.maskAllInputs,v=e.maskInputOptions,w=e.slimDOMOptions,_=e.maskInputFn,E=e.maskTextFn,x=e.hooks,k=e.packFn,S=e.sampling,C=void 0===S?{}:S,I=e.dataURLOptions,A=void 0===I?{}:I,P=e.mousemoveWait,O=e.recordDOM,M=void 0===O||O,T=e.recordCanvas,R=void 0!==T&&T,N=e.recordCrossOriginIframes,L=void 0!==N&&N,B=e.recordAfter,j=void 0===B?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":B,D=e.userTriggeredOnInput,U=void 0!==D&&D,$=e.collectFonts,F=void 0!==$&&$,z=e.inlineImages,q=void 0!==z&&z,H=e.plugins,W=e.keepIframeSrcFn,K=void 0===W?function(){return!1}:W,V=e.ignoreCSSAttributes,G=void 0===V?new Set([]):V,Z=e.errorHandler;PU=Z;var Y=!L||window.parent===window,J=!1;if(!Y)try{window.parent.document&&(J=!1)}catch(qAe){J=!0}if(Y&&!t)throw new Error("emit function is required");if(!Y&&!J)return function(){};void 0!==P&&void 0===C.mousemove&&(C.mousemove=P),k$.reset();var Q,X,ee=!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:void 0!==v?v:{password:!0},te=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w,headTitleMutations:"all"===w}:w||{};void 0===Q&&(Q=window),"NodeList"in Q&&!Q.NodeList.prototype.forEach&&(Q.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in Q&&!Q.DOMTokenList.prototype.forEach&&(Q.DOMTokenList.prototype.forEach=Array.prototype.forEach);var ne=0,re=function(e){for(var t,n=kO(H||[]);!(t=n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}return k&&!J&&(e=k(e)),e};p$=function(e,i){var o,s=e;if(s.timestamp=oU(),!(null==(o=DU[0])?void 0:o.isFrozen())||s.type===_U.FullSnapshot||s.type===_U.IncrementalSnapshot&&s.data.source===EU.Mutation||DU.forEach(function(e){return e.unfreeze()}),Y)null==t||t(re(s),i);else if(J){var a={type:"rrweb",event:re(s),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(s.type===_U.FullSnapshot)X=s,ne=0;else if(s.type===_U.IncrementalSnapshot){if(s.data.source===EU.Mutation&&s.data.isAttachIframe)return;ne++;var c=r&&ne>=r,l=n&&s.timestamp-X.timestamp>n;(c||l)&&m$(!0)}};for(var ie,oe=function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Mutation},e)})},se=function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Scroll},e)})},ae=function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.CanvasMutation},e)})},ce=new b$({mutationCb:oe,adoptedStyleSheetCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.AdoptedStyleSheet},e)})}}),le=new QU({mirror:k$,mutationCb:oe,stylesheetManager:ce,recordCrossOriginIframes:L,wrappedEmit:p$}),ue=kO(H||[]);!(ie=ue()).done;){var de=ie.value;de.getMirror&&de.getMirror({nodeMirror:k$,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror})}var he=new v$;g$=new y$({recordCanvas:R,mutationCb:ae,win:window,blockClass:o,blockSelector:a,mirror:k$,sampling:C.canvas,dataURLOptions:A});var fe=new XU({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskInputOptions:ee,dataURLOptions:A,maskTextFn:E,maskInputFn:_,recordCanvas:R,inlineImages:q,sampling:C,slimDOMOptions:te,iframeManager:le,stylesheetManager:ce,canvasManager:g$,keepIframeSrcFn:K,processedNodeManager:he},mirror:k$});m$=function(e){if(void 0===e&&(e=!1),M){p$({type:_U.Meta,data:{href:window.location.href,width:cU(),height:aU()}},e),ce.reset(),fe.init(),DU.forEach(function(e){return e.lock()});var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new VO:r,o=n.blockClass,s=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,d=n.maskTextSelector,h=void 0===d?null:d,f=n.inlineStylesheet,p=void 0===f||f,m=n.inlineImages,g=void 0!==m&&m,y=n.recordCanvas,b=void 0!==y&&y,v=n.maskAllInputs,w=void 0!==v&&v,_=n.maskTextFn,E=n.maskInputFn,x=n.slimDOM,k=void 0!==x&&x,S=n.dataURLOptions,C=n.preserveWhiteSpace,I=n.onSerialize,A=n.onIframeLoad,P=n.iframeLoadTimeout,O=n.onStylesheetLoad,M=n.stylesheetLoadTimeout,T=n.keepIframeSrcFn;return xM(e,{doc:e,mirror:i,blockClass:s,blockSelector:c,maskTextClass:u,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===w?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0,hidden:!0}:!1===w?{password:!0}:w,maskTextFn:_,maskInputFn:E,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:S,inlineImages:g,recordCanvas:b,preserveWhiteSpace:C,onSerialize:I,onIframeLoad:A,iframeLoadTimeout:P,onStylesheetLoad:O,stylesheetLoadTimeout:M,keepIframeSrcFn:void 0===T?function(){return!1}:T,newlyAddedElement:!1})}(document,{mirror:k$,blockClass:o,blockSelector:a,maskTextClass:f,maskTextSelector:m,inlineStylesheet:y,maskAllInputs:ee,maskTextFn:E,maskInputFn:_,slimDOM:te,dataURLOptions:A,recordCanvas:R,inlineImages:q,onSerialize:function(e){pU(e,k$)&&le.addIframe(e),mU(e,k$)&&ce.trackLinkElement(e),gU(e)&&fe.addShadowRoot(XD.shadowRoot(e),document)},onIframeLoad:function(e,t){le.attachIframe(e,t),fe.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ce.attachLinkElement(e,t)},keepIframeSrcFn:K});if(!t)return console.warn("Failed to snapshot the document");p$({type:_U.FullSnapshot,data:{node:t,initialOffset:sU(window)}},e),DU.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,k$.getId(document))}};try{var pe=[],me=function(e){var t;return jU(GU)({mutationCb:oe,mousemoveCb:function(e,t){return p$({type:_U.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.MouseInteraction},e)})},scrollCb:se,viewportResizeCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.ViewportResize},e)})},inputCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Input},e)})},mediaInteractionCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.MediaInteraction},e)})},styleSheetRuleCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.StyleSheetRule},e)})},styleDeclarationCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.StyleDeclaration},e)})},canvasMutationCb:ae,fontCb:function(e){return p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Font},e)})},selectionCb:function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.Selection},e)})},customElementCb:function(e){p$({type:_U.IncrementalSnapshot,data:mO({source:EU.CustomElement},e)})},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:f,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:y,sampling:C,recordDOM:M,recordCanvas:R,inlineImages:q,userTriggeredOnInput:U,collectFonts:F,doc:e,maskInputFn:_,maskTextFn:E,keepIframeSrcFn:K,blockSelector:a,slimDOMOptions:te,dataURLOptions:A,mirror:k$,iframeManager:le,stylesheetManager:ce,shadowDomManager:fe,processedNodeManager:he,canvasManager:g$,ignoreCSSAttributes:G,plugins:(null==(t=null==H?void 0:H.filter(function(e){return e.observer}))?void 0:t.map(function(e){return{observer:e.observer,options:e.options,callback:function(t){return p$({type:_U.Plugin,data:{plugin:e.name,payload:t}})}}}))||[]},x)};le.addLoadListener(function(e){try{pe.push(me(e.contentDocument))}catch(cF){console.warn(cF)}});var ge=function(){m$(),pe.push(me(document)),w$=!0};return"interactive"===document.readyState||"complete"===document.readyState?ge():(pe.push(eU("DOMContentLoaded",function(){p$({type:_U.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&ge()})),pe.push(eU("load",function(){p$({type:_U.Load,data:{}}),"load"===j&&ge()},window))),function(){pe.forEach(function(e){try{e()}catch(cF){String(cF).toLowerCase().includes("cross-origin")||console.warn(cF)}}),he.destroy(),w$=!1,PU=void 0}}catch(cF){console.warn(cF)}}S$.addCustomEvent=function(e,t){if(!w$)throw new Error("please add custom event after start recording");p$({type:_U.Custom,data:{tag:e,payload:t}})},S$.freezePage=function(){DU.forEach(function(e){return e.freeze()})},S$.takeFullSnapshot=function(e){if(!w$)throw new Error("please take full snapshot after start recording");m$(e)},S$.mirror=k$,(x$=E$||(E$={}))[x$.NotStarted=0]="NotStarted",x$[x$.Running=1]="Running",x$[x$.Stopped=2]="Stopped",S$.addCustomEvent,S$.freezePage,S$.takeFullSnapshot;var C$=Object.defineProperty,I$=function(e,t,n){return function(e,t,n){return t in e?C$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":_O(t))?t+"":t,n)};var A$=function(){function e(e){I$(this,"fileName"),I$(this,"functionName"),I$(this,"lineNumber"),I$(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}return e.prototype.toString=function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+e+":"+t+")":this.fileName+":"+e+":"+t},e}(),P$=/(^|@)\S+:\d+/,O$=/^\s*at .*(\S+:\d+|\(native\))/m,M$=/^(eval@)?(\[native code])?$/,T$={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(O$)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: "+e);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(O$)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new A$({functionName:o,fileName:s,lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(M$)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new A$({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new A$({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new A$({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var s=t.exec(n[i]);s&&r.push(new A$({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(P$)&&!e.match(/^Error created at/)},this).map(function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new A$({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function R$(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var s=r.children[o];s.localName&&s.localName.toLowerCase&&s.localName.toLowerCase()===n&&i.push(s)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function N$(e){return"[object Object]"===Object.prototype.toString.call(e)}function L$(e,t){if(0===t)return!0;for(var n,r=kO(Object.keys(e));!(n=r()).done;){var i=n.value;if(N$(e[i])&&L$(e[i],t-1))return!0}return!1}function B$(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(N$(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(N$(e)&&L$(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=t.slice(0,n.stringLengthLimit)+"...");return t}(t);if("bigint"===(void 0===t?"undefined":_O(t)))return t.toString()+"n";if(bO(t,Event)){var s={};for(var a in t){var c=t[a];Array.isArray(c)?s[a]=R$(c.length?c[0]:null):s[a]=c}return s}return bO(t,Node)?bO(t,HTMLElement)?t?t.outerHTML:"":t.nodeName:bO(t,Error)?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var j$={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function D$(e,t,n){var r,i=n?Object.assign({},j$,n):j$,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var s=0,a=!1,c=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=T$.parse(r).map(function(e){return e.toString()}),s=[B$(n,i.stringifyOptions)];e({level:"error",trace:o,payload:s})};t.addEventListener("error",l),c.push(function(){t.removeEventListener("error",l)});var u=function(t){var n,r;bO(t.reason,Error)?r=[B$("Uncaught (in promise) "+(n=t.reason).name+": "+n.message,i.stringifyOptions)]:(n=new Error,r=[B$("Uncaught (in promise)",i.stringifyOptions),B$(t.reason,i.stringifyOptions)]);var o=T$.parse(n).map(function(e){return e.toString()});e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",u),c.push(function(){t.removeEventListener("unhandledrejection",u)})}for(var d,h=kO(i.level);!(d=h()).done;){var f=d.value;c.push(p(r,f))}return function(){c.forEach(function(e){return e()})};function p(t,n){var r=this;return t[n]?function(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}}catch(qAe){return function(){}}}(t,n,function(t){var o=r;return function(){for(var r=arguments.length,c=new Array(r),l=0;l<r;l++)c[l]=arguments[l];if(t.apply(o,c),!("assert"===n&&c[0]||a)){a=!0;try{var u=T$.parse(new Error).map(function(e){return e.toString()}).splice(1),d=("assert"===n?c.slice(1):c).map(function(e){return B$(e,i.stringifyOptions)});++s<i.lengthThreshold?e({level:n,trace:u,payload:d}):s===i.lengthThreshold&&e({level:"warn",trace:[],payload:[B$("The number of log records reached the threshold.")]})}catch(cF){t.apply(void 0,[].concat(["rrweb logger error:",cF],c))}finally{a=!1}}}}):function(){}}}var U$,$$,F$,z$=cO.setImmediate,q$=Object.prototype.toString,H$=void 0!==z$?function(e){return z$(e)}:setTimeout;try{Object.defineProperty({},"x",{}),U$=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(jHe){U$=function(e,t,n){return e[t]=n,e}}function W$(e,t){F$.add(e,t),$$||($$=H$(F$.drain))}function K$(e){var t,n=typeof e;return null===e||"object"!==n&&"function"!==n||(t=e.then),"function"==typeof t&&t}function V$(){for(var e=0;e<this.chain.length;e++)G$(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function G$(e,t,n){var r,i;try{!1===t?n.reject(e.msg):(r=!0===t?e.msg:t.call(void 0,e.msg))===n.promise?n.reject(TypeError("Promise-chain cycle")):(i=K$(r))?i.call(r,n.resolve,n.reject):n.resolve(r)}catch(jHe){n.reject(jHe)}}function Z$(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=K$(e))?W$(function(){var r=new Q$(n);try{t.call(e,function(){Z$.apply(r,arguments)},function(){Y$.apply(r,arguments)})}catch(jHe){Y$.call(r,jHe)}}):(n.msg=e,n.state=1,n.chain.length>0&&W$(V$,n))}catch(jHe){Y$.call(new Q$(n),jHe)}}}function Y$(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&W$(V$,t))}function J$(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function Q$(e){this.def=e,this.triggered=!1}function X$(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function eF(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new X$(this);this.then=function(e,n){var r={success:"function"!=typeof e||e,failure:"function"==typeof n&&n};return r.promise=new this.constructor(function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");r.resolve=e,r.reject=t}),t.chain.push(r),0!==t.state&&W$(V$,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){Z$.call(t,e)},function(e){Y$.call(t,e)})}catch(jHe){Y$.call(t,jHe)}}F$=function(){var e,t,n;function r(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(i,o){n=new r(i,o),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=$$=void 0;n;)n.fn.call(n.self),n=n.next}}}();var tF,nF=U$({},"constructor",eF,!1);eF.prototype=nF,U$(nF,"__NPO__",0,!1),U$(eF,"resolve",function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");t(e)})}),U$(eF,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),U$(eF,"all",function(e){var t=this;return"[object Array]"!==q$.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t(function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");var i=e.length,o=Array(i),s=0;J$(t,e,function(e,t){o[e]=t,++s===i&&n(o)},r)})}),U$(eF,"race",function(e){var t=this;return"[object Array]"!==q$.call(e)?t.reject(TypeError("Not an array")):new t(function(n,r){if("function"!=typeof n||"function"!=typeof r)throw TypeError("Not a function");J$(t,e,function(e,t){n(t)},r)})}),tF="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:eF;var rF,iF,oF,sF,aF,cF,lF,uF,dF,hF,fF={DEBUG:!1,LIB_VERSION:"2.73.0"},pF=864e5,mF=8e3,gF=Array.prototype,yF=Function.prototype,bF=Object.prototype,vF=gF.slice,wF=bF.toString,_F=bF.hasOwnProperty,EF=cO.console,xF=cO.navigator,kF=cO.document,SF=cO.opera,CF=cO.screen,IF=xF.userAgent,AF=yF.bind,PF=gF.forEach,OF=gF.indexOf,MF=gF.map,TF=Array.isArray,RF={},NF={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},LF={log:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF)try{EF.log.apply(EF,arguments)}catch(jHe){NF.each(arguments,function(e){EF.log(e)})}},warn:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF){var e=["Mixpanel warning:"].concat(NF.toArray(arguments));try{EF.warn.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.warn(e)})}}},error:function(){if(fF.DEBUG&&!NF.isUndefined(EF)&&EF){var e=["Mixpanel error:"].concat(NF.toArray(arguments));try{EF.error.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.error(e)})}}},critical:function(){if(!NF.isUndefined(EF)&&EF){var e=["Mixpanel error:"].concat(NF.toArray(arguments));try{EF.error.apply(EF,e)}catch(jHe){NF.each(e,function(e){EF.error(e)})}}}},BF=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(LF,arguments)}},jF=function(e){return{log:BF(LF.log,e),error:BF(LF.error,e),critical:BF(LF.critical,e)}},DF=function(e){return function(){try{return e.apply(this,arguments)}catch(qAe){LF.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),fF.DEBUG&&LF.critical(qAe)}}},UF=function(e){var t=e.prototype;for(var n in t)"function"==typeof t[n]&&(t[n]=DF(t[n]))};NF.bind=function(e,t){var n,r;if(AF&&e.bind===AF)return AF.apply(e,vF.call(arguments,1));if(!NF.isFunction(e))throw new TypeError;return n=vF.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(vF.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(vF.call(arguments)));return Object(s)===s?s:o},r},NF.each=function(e,t,n){if(null!=e)if(PF&&e.forEach===PF)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e)===RF)return}else for(var o in e)if(_F.call(e,o)&&t.call(n,e[o],o,e)===RF)return},NF.extend=function(e){return NF.each(vF.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},NF.isArray=TF||function(e){return"[object Array]"===wF.call(e)},NF.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},NF.isArguments=function(e){return!(!e||!_F.call(e,"callee"))},NF.toArray=function(e){return e?e.toArray?e.toArray():NF.isArray(e)||NF.isArguments(e)?vF.call(e):NF.values(e):[]},NF.map=function(e,t,n){if(MF&&e.map===MF)return e.map(t,n);var r=[];return NF.each(e,function(e){r.push(t.call(n,e))}),r},NF.keys=function(e){var t=[];return null===e||NF.each(e,function(e,n){t[t.length]=n}),t},NF.values=function(e){var t=[];return null===e||NF.each(e,function(e){t[t.length]=e}),t},NF.include=function(e,t){var n=!1;return null===e?n:OF&&e.indexOf===OF?-1!=e.indexOf(t):(NF.each(e,function(e){if(n||(n=e===t))return RF}),n)},NF.includes=function(e,t){return-1!==e.indexOf(t)},NF.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},NF.isObject=function(e){return e===Object(e)&&!NF.isArray(e)},NF.isEmptyObject=function(e){if(NF.isObject(e)){for(var t in e)if(_F.call(e,t))return!1;return!0}return!1},NF.isUndefined=function(e){return void 0===e},NF.isString=function(e){return"[object String]"==wF.call(e)},NF.isDate=function(e){return"[object Date]"==wF.call(e)},NF.isNumber=function(e){return"[object Number]"==wF.call(e)},NF.isElement=function(e){return!(!e||1!==e.nodeType)},NF.encodeDates=function(e){return NF.each(e,function(t,n){NF.isDate(t)?e[n]=NF.formatDate(t):NF.isObject(t)&&(e[n]=NF.encodeDates(t))}),e},NF.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},NF.formatDate=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},NF.strip_empty_properties=function(e){var t={};return NF.each(e,function(e,n){NF.isString(e)&&e.length>0&&(t[n]=e)}),t},NF.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):NF.isArray(e)?(n=[],NF.each(e,function(e){n.push(NF.truncate(e,t))})):NF.isObject(e)?(n={},NF.each(e,function(e,r){n[r]=NF.truncate(e,t)})):n=e,n},NF.JSONEncode=function(){return function(e){var t=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'},n=function(e,r){var i="",o=0,s="",a="",c=0,l=i,u=[],d=r[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),typeof d){case"string":return t(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(i+=" ",u=[],"[object Array]"===wF.apply(d)){for(c=d.length,o=0;o<c;o+=1)u[o]=n(o,d)||"null";return a=0===u.length?"[]":i?"[\n"+i+u.join(",\n"+i)+"\n"+l+"]":"["+u.join(",")+"]",i=l,a}for(s in d)_F.call(d,s)&&(a=n(s,d))&&u.push(t(s)+(i?": ":":")+a);return a=0===u.length?"{}":i?"{"+u.join(",")+l+"}":"{"+u.join(",")+"}",i=l,a}};return n("",{"":e})}}(),NF.JSONDecode=(aF={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},cF=function(e){var t=new SyntaxError(e);throw t.at=rF,t.text=oF,t},lF=function(e){return e&&e!==iF&&cF("Expected '"+e+"' instead of '"+iF+"'"),iF=oF.charAt(rF),rF+=1,iF},uF=function(){var e,t="";for("-"===iF&&(t="-",lF("-"));iF>="0"&&iF<="9";)t+=iF,lF();if("."===iF)for(t+=".";lF()&&iF>="0"&&iF<="9";)t+=iF;if("e"===iF||"E"===iF)for(t+=iF,lF(),"-"!==iF&&"+"!==iF||(t+=iF,lF());iF>="0"&&iF<="9";)t+=iF,lF();if(e=+t,isFinite(e))return e;cF("Bad number")},dF=function(){var e,t,n,r="";if('"'===iF)for(;lF();){if('"'===iF)return lF(),r;if("\\"===iF)if(lF(),"u"===iF){for(n=0,t=0;t<4&&(e=parseInt(lF(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof aF[iF])break;r+=aF[iF]}else r+=iF}cF("Bad string")},hF=function(){for(;iF&&iF<=" ";)lF()},sF=function(){switch(hF(),iF){case"{":return function(){var e,t={};if("{"===iF){if(lF("{"),hF(),"}"===iF)return lF("}"),t;for(;iF;){if(e=dF(),hF(),lF(":"),Object.hasOwnProperty.call(t,e)&&cF('Duplicate key "'+e+'"'),t[e]=sF(),hF(),"}"===iF)return lF("}"),t;lF(","),hF()}}cF("Bad object")}();case"[":return function(){var e=[];if("["===iF){if(lF("["),hF(),"]"===iF)return lF("]"),e;for(;iF;){if(e.push(sF()),hF(),"]"===iF)return lF("]"),e;lF(","),hF()}}cF("Bad array")}();case'"':return dF();case"-":return uF();default:return iF>="0"&&iF<="9"?uF():function(){switch(iF){case"t":return lF("t"),lF("r"),lF("u"),lF("e"),!0;case"f":return lF("f"),lF("a"),lF("l"),lF("s"),lF("e"),!1;case"n":return lF("n"),lF("u"),lF("l"),lF("l"),null}cF('Unexpected "'+iF+'"')}()}},function(e){var t;return oF=e,rF=0,iF=" ",t=sF(),hF(),iF&&cF("Syntax error"),t}),NF.base64Encode=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,l="",u=[];if(!e)return e;e=NF.utf8Encode(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,u[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(l=u.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},NF.utf8Encode=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},NF.UUID=function(){try{return cO.crypto.randomUUID()}catch(jHe){for(var e=new Array(36),t=0;t<36;t++)e[t]=Math.floor(16*Math.random());return e[14]=4,e[19]=e[19]&=-5,e[19]=e[19]|=8,e[8]=e[13]=e[18]=e[23]="-",NF.map(e,function(e){return e.toString(16)}).join("")}};var $F=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];NF.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<$F.length;t++)if(-1!==e.indexOf($F[t]))return!0;return!1},NF.HTTPBuildQuery=function(e,t){var n,r,i=[];return NF.isUndefined(t)&&(t="&"),NF.each(e,function(e,t){n=encodeURIComponent(e.toString()),r=encodeURIComponent(t),i[i.length]=r+"="+n}),i.join(t)},NF.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var r=n[1];try{r=decodeURIComponent(r)}catch(jHe){LF.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")},NF.cookie={get:function(e){for(var t=e+"=",n=kF.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=NF.JSONDecode(NF.cookie.get(e))||{}}catch(jHe){}return t},set_seconds:function(e,t,n,r,i,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(r){var u=QF(kF.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),c="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure"),kF.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l},set:function(e,t,n,r,i,o,s){var a="",c="",l="";if(s)a="; domain="+s;else if(r){var u=QF(kF.location.hostname);a=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),c="; expires="+d.toGMTString()}o&&(i=!0,l="; SameSite=None"),i&&(l+="; secure");var h=e+"="+encodeURIComponent(t)+c+"; path=/"+a+l;return kF.cookie=h,h},remove:function(e,t,n){NF.cookie.set(e,"",-1,t,!1,!1,n)}};var FF=function(e){var t=!0;try{var n="__mplss_"+ZF(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(t=!1),e.removeItem(n)}catch(jHe){t=!1}return t},zF=null,qF=function(e,t){return null===zF||t?zF=FF(e||cO.localStorage):zF},HF=null;function WF(e,t,n){var r=function(e){LF.error(t+" error: "+e)};return{is_supported:function(r){var i=n(e,r);return i||LF.error(t+" unsupported"),i},error:r,get:function(t){try{return e.getItem(t)}catch(jHe){r(jHe)}return null},parse:function(t){try{return NF.JSONDecode(e.getItem(t))||{}}catch(jHe){}return null},set:function(t,n){try{e.setItem(t,n)}catch(jHe){r(jHe)}},remove:function(t){try{e.removeItem(t)}catch(jHe){r(jHe)}}}}NF.localStorage=WF(cO.localStorage,"localStorage",qF),NF.sessionStorage=WF(cO.sessionStorage,"sessionStorage",function(e,t){return null===HF||t?HF=FF(e||cO.sessionStorage):HF}),NF.register_event=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){var i=function(i){if(i=i||e(cO.event)){var o,s,a=!0;return NF.isFunction(r)&&(o=r(i)),s=n.call(t,i),!1!==o&&!1!==s||(a=!1),a}};return i}(t,r,a)}else LF.error("No valid element provided to register_event")}}();var KF=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');NF.dom_query=function(){function e(e){return e.all?e.all:e.getElementsByTagName("*")}var t=/[\t\r\n]/g;function n(e,n){var r=" "+n+" ";return(" "+e.className+" ").replace(t," ").indexOf(r)>=0}function r(t){if(!kF.getElementsByTagName)return[];var r,i,o,s,a,c,l,u,d,h,f=t.split(" "),p=[kF];for(c=0;c<f.length;c++)if((r=f[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){o=(i=r.split("#"))[0];var m=i[1],g=kF.getElementById(m);if(!g||o&&g.nodeName.toLowerCase()!=o)return[];p=[g]}else if(r.indexOf(".")>-1){o=(i=r.split("."))[0];var y=i[1];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];for(p=[],h=0,l=0;l<s.length;l++)s[l].className&&NF.isString(s[l].className)&&n(s[l],y)&&(p[h++]=s[l])}else{var b=r.match(KF);if(b){o=b[1];var v,w=b[2],_=b[3],E=b[4];for(o||(o="*"),s=[],a=0,l=0;l<p.length;l++)for(d="*"==o?e(p[l]):p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];switch(p=[],h=0,_){case"=":v=function(e){return e.getAttribute(w)==E};break;case"~":v=function(e){return e.getAttribute(w).match(new RegExp("\\b"+E+"\\b"))};break;case"|":v=function(e){return e.getAttribute(w).match(new RegExp("^"+E+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(w).indexOf(E)};break;case"$":v=function(e){return e.getAttribute(w).lastIndexOf(E)==e.getAttribute(w).length-E.length};break;case"*":v=function(e){return e.getAttribute(w).indexOf(E)>-1};break;default:v=function(e){return e.getAttribute(w)}}for(p=[],h=0,l=0;l<s.length;l++)v(s[l])&&(p[h++]=s[l])}else{for(o=r,s=[],a=0,l=0;l<p.length;l++)for(d=p[l].getElementsByTagName(o),u=0;u<d.length;u++)s[a++]=d[u];p=s}}return p}return function(e){return NF.isElement(e)?[e]:NF.isObject(e)&&!NF.isUndefined(e.length)?e:r.call(this,e)}}();var VF=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],GF=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];NF.info={campaignParams:function(e){var t="",n={};return NF.each(VF,function(r){(t=NF.getQueryParam(kF.URL,r)).length?n[r]=t:void 0!==e&&(n[r]=e)}),n},clickParams:function(){var e="",t={};return NF.each(GF,function(n){(e=NF.getQueryParam(kF.URL,n)).length&&(t[n]=e)}),t},marketingParams:function(){return NF.extend(NF.info.campaignParams(),NF.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=NF.info.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=NF.getQueryParam(e,n);i.length&&(r.mp_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||NF.includes(e," OPR/")?NF.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":NF.includes(e,"IEMobile")||NF.includes(e,"WPDesktop")?"Internet Explorer Mobile":NF.includes(e,"SamsungBrowser/")?"Samsung Internet":NF.includes(e,"Edge")||NF.includes(e,"Edg/")?"Microsoft Edge":NF.includes(e,"FBIOS")?"Facebook Mobile":NF.includes(e,"Whale/")?"Whale Browser":NF.includes(e,"Chrome")?"Chrome":NF.includes(e,"CriOS")?"Chrome iOS":NF.includes(e,"UCWEB")||NF.includes(e,"UCBrowser")?"UC Browser":NF.includes(e,"FxiOS")?"Firefox iOS":NF.includes(t,"Apple")?NF.includes(e,"Mobile")?"Mobile Safari":"Safari":NF.includes(e,"Android")?"Android Mobile":NF.includes(e,"Konqueror")?"Konqueror":NF.includes(e,"Firefox")?"Firefox":NF.includes(e,"MSIE")||NF.includes(e,"Trident/")?"Internet Explorer":NF.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[NF.info.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},os:function(){var e=IF;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return cO.location.href},properties:function(e){return"object"!=typeof e&&(e={}),NF.extend(NF.strip_empty_properties({$os:NF.info.os(),$browser:NF.info.browser(IF,xF.vendor,SF),$referrer:kF.referrer,$referring_domain:NF.info.referringDomain(kF.referrer),$device:NF.info.device(IF)}),{$current_url:NF.info.currentUrl(),$browser_version:NF.info.browserVersion(IF,xF.vendor,SF),$screen_height:CF.height,$screen_width:CF.width,mp_lib:"web",$lib_version:fF.LIB_VERSION,$insert_id:ZF(),time:NF.timestamp()/1e3},NF.strip_empty_properties(e))},people_properties:function(){return NF.extend(NF.strip_empty_properties({$os:NF.info.os(),$browser:NF.info.browser(IF,xF.vendor,SF)}),{$browser_version:NF.info.browserVersion(IF,xF.vendor,SF)})},mpPageViewProperties:function(){return NF.strip_empty_properties({current_page_title:kF.title,current_domain:cO.location.hostname,current_url_path:cO.location.pathname,current_url_protocol:cO.location.protocol,current_url_search:cO.location.search})}};var ZF=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},YF=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,JF=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,QF=function(e){var t=JF,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=YF);var i=e.match(t);return i?i[0]:""},XF=function(){},ez=null,tz=null;"undefined"!=typeof JSON&&(ez=JSON.stringify,tz=JSON.parse),ez=ez||NF.JSONEncode,tz=tz||NF.JSONDecode;NF.info=NF.info,NF.info.browser=NF.info.browser,NF.info.browserVersion=NF.info.browserVersion,NF.info.device=NF.info.device,NF.info.properties=NF.info.properties,NF.isBlockedUA=NF.isBlockedUA,NF.isEmptyObject=NF.isEmptyObject,NF.isObject=NF.isObject,NF.JSONDecode=NF.JSONDecode,NF.JSONEncode=NF.JSONEncode,NF.toArray=NF.toArray,NF.NPO=eF;var nz="mixpanelRecordingEvents",rz="mixpanelRecordingRegistry",iz=[nz,rz],oz=function(e){this.dbPromise=null,this.storeName=e};oz.prototype._openDb=function(){return new tF(function(e,t){var n=cO.indexedDB.open("mixpanelBrowserDb",1);n.onerror=function(){t(n.error)},n.onsuccess=function(){e(n.result)},n.onupgradeneeded=function(e){var t=e.target.result;iz.forEach(function(e){t.createObjectStore(e)})}})},oz.prototype.init=function(){return cO.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof cO.IDBDatabase?tF.resolve():tF.reject(e)})):tF.reject("indexedDB is not supported in this browser")},oz.prototype.isInitialized=function(){return!!this.dbPromise},oz.prototype.makeTransaction=function(e,t){var n=this.storeName,r=function(r){return new tF(function(i,o){var s=r.transaction(n,e);s.oncomplete=function(){i(s)},s.onabort=s.onerror=function(){o(s.error)},t(s.objectStore(n))})};return this.dbPromise.then(r).catch(function(e){return e&&"InvalidStateError"===e.name?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):tF.reject(e)}.bind(this))},oz.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},oz.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},oz.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},oz.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};function sz(e,t){yz(!0,e,t)}function az(e,t){yz(!1,e,t)}function cz(e,t){return"1"===gz(e,t)}function lz(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||cO,n=t.navigator||{},r=!1;return NF.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){NF.includes([!0,1,"1","yes"],e)&&(r=!0)}),r}(t))return LF.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n="0"===gz(e,t);return n&&LF.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function uz(e){return bz(e,function(e){return this.get_config(e)})}function dz(e){return bz(e,function(e){return this._get_config(e)})}function hz(e){return bz(e,function(e){return this._get_config(e)})}function fz(e,t){pz(t=t||{}).remove(mz(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function pz(e){return"localStorage"===(e=e||{}).persistenceType?NF.localStorage:NF.cookie}function mz(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function gz(e,t){return pz(t).get(mz(e,t))}function yz(e,t,n){NF.isString(t)&&t.length?(pz(n=n||{}).set(mz(t,n),e?1:0,NF.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):LF.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function bz(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");r&&(n=lz(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(jHe){LF.error("Unexpected error when checking tracking opt-out status: "+jHe)}if(!n)return e.apply(this,arguments);var c=arguments[arguments.length-1];"function"==typeof c&&c(0)}}var vz=jF("lock"),wz=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||cO.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||tF};wz.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(NF.bind(function(n,r){var i=t||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),s=this.storageKey,a=this.pollIntervalMS,c=this.timeoutMS,l=this.storage,u=s+":X",d=s+":Y",h=s+":Z",f=function(e){if((new Date).getTime()-o>c)return vz.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+i+"]"),l.removeItem(h),l.removeItem(d),void g();setTimeout(function(){try{e()}catch(jHe){r(jHe)}},a*(Math.random()+.1))},p=function(e,t){e()?t():f(function(){p(e,t)})},m=function(){var e=l.getItem(d);return(!e||e===i)&&(l.setItem(d,i),l.getItem(d)===i||(qF(l,!0)||r(new Error("localStorage support dropped while acquiring lock")),!1))},g=function(){l.setItem(u,i),p(m,function(){l.getItem(u)!==i?f(function(){l.getItem(d)===i?p(function(){return!l.getItem(h)},y):g()}):y()})},y=function(){l.setItem(h,"1");var t=function(){l.removeItem(h),l.getItem(d)===i&&l.removeItem(d),l.getItem(u)===i&&l.removeItem(u)};e().then(function(e){t(),n(e)}).catch(function(e){t(),r(e)})};try{if(!qF(l,!0))throw new Error("localStorage support check failed");g()}catch(jHe){r(jHe)}},this))};var _z=function(e){this.storage=e||cO.localStorage};_z.prototype.init=function(){return tF.resolve()},_z.prototype.isInitialized=function(){return!0},_z.prototype.setItem=function(e,t){return new tF(NF.bind(function(n,r){try{this.storage.setItem(e,ez(t))}catch(qAe){r(qAe)}n()},this))},_z.prototype.getItem=function(e){return new tF(NF.bind(function(t,n){var r;try{r=tz(this.storage.getItem(e))}catch(qAe){n(qAe)}t(r)},this))},_z.prototype.removeItem=function(e){return new tF(NF.bind(function(t,n){try{this.storage.removeItem(e)}catch(qAe){n(qAe)}t()},this))};var Ez=jF("batch"),xz=function(e,t){var n,r,i,o;t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new _z,this.lock=new wz(e,{storage:t.sharedLockStorage||cO.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||NF.bind(Ez.error,Ez),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=(n=NF.bind(this._enqueuePersisted,this),r=t.enqueueThrottleMs,i=null,o=[],function(e){var t=this;return o.push(e),i||(i=new tF(function(e){setTimeout(function(){var r=n.apply(t,[o]);i=null,o=[],e(r)},r)})),i}):this.enqueuePersisted=NF.bind(function(e){return this._enqueuePersisted([e])},this)};xz.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?tF.resolve():this.queueStorage.init().then(NF.bind(function(){this.initialized=!0},this)).catch(NF.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},xz.prototype.enqueue=function(e,t){var n={id:ZF(),flushAfter:(new Date).getTime()+2*t,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),tF.resolve(!0))},xz.prototype._enqueuePersisted=function(e){var t=NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(t){return this.saveToStorage(t.concat(e))},this)).then(NF.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(e)),t},this)).catch(NF.bind(function(t){return this.reportError("Error enqueueing items",t,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this))},xz.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(n){if(n.length){var r={};NF.each(t,function(e){r[e.id]=!0});for(var i=0;i<n.length;i++){var o=n[i];if((new Date).getTime()>o.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}return t},this)):tF.resolve(t)};var kz=function(e,t){var n=[];return NF.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};xz.prototype.removeItemsByID=function(e){var t={};if(NF.each(e,function(e){t[e]=!0}),this.memQueue=kz(this.memQueue,t),this.usePersistence){var n=NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(e){return e=kz(e,t),this.saveToStorage(e)},this)).then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(e){for(var n=0;n<e.length;n++){var r=e[n];if(r.id&&t[r.id])throw new Error("Item not removed from storage")}return!0},this)).catch(NF.bind(function(t){return this.reportError("Error removing items",t,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!qF(this.lock.storage,!0)&&n().then(NF.bind(function(e){return e||this.queueStorage.removeItem(this.storageKey).then(function(){return e})},this)).catch(NF.bind(function(e){return this.reportError("Error clearing queue",e),!1},this))},this))}return tF.resolve(!0)};var Sz=function(e,t){var n=[];return NF.each(e,function(e){var r=e.id;if(r in t){var i=t[r];null!==i&&(e.payload=i,n.push(e))}else n.push(e)}),n};xz.prototype.updatePayloads=function(e){return this.memQueue=Sz(this.memQueue,e),this.usePersistence?this.lock.withLock(NF.bind(function(){return this.ensureInit().then(NF.bind(function(){return this.readFromStorage()},this)).then(NF.bind(function(t){return t=Sz(t,e),this.saveToStorage(t)},this)).catch(NF.bind(function(t){return this.reportError("Error updating items",e,t),!1},this))},this),this.pid).catch(NF.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):tF.resolve(!0)},xz.prototype.readFromStorage=function(){return this.ensureInit().then(NF.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(NF.bind(function(e){return e&&(NF.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(NF.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},xz.prototype.saveToStorage=function(e){return this.ensureInit().then(NF.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(NF.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},xz.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(NF.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):tF.resolve()};var Cz=jF("batch"),Iz=function(e,t){this.errorReporter=t.errorReporter,this.queue=new xz(e,{errorReporter:NF.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1,this._flushPromise=null};Iz.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},Iz.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Iz.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Iz.prototype.clear=function(){return this.queue.clear()},Iz.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Iz.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Iz.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(NF.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},Iz.prototype.sendRequestPromise=function(e,t){return new tF(NF.bind(function(n){this.sendRequest(e,t,n)},this))},Iz.prototype.flush=function(e){if(this.requestInProgress)return Cz.log("Flush: Request already in progress"),tF.resolve();this.requestInProgress=!0,e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),r=this.batchSize;return this.queue.fillBatch(r).then(NF.bind(function(i){var o=i.length===r,s=[],a={};if(NF.each(i,function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=NF.extend({},t.properties,{mp_sent_by_lib_version:fF.LIB_VERSION}));var n=!0,r=e.id;r?(this.itemIdsSentSuccessfully[r]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[r]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&s.push(t)}a[e.id]=t},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),tF.resolve();var c=NF.bind(function(){return this.queue.removeItemsByID(NF.map(i,function(e){return e.id})).then(NF.bind(function(e){return NF.each(i,NF.bind(function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})},this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),tF.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),tF.resolve())},this))},this),l=NF.bind(function(o){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(a);if(NF.isObject(o)&&"timeout"===o.error&&(new Date).getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(NF.isObject(o)&&(o.httpStatusCode>=500||429===o.httpStatusCode||o.httpStatusCode<=0&&(u=cO.navigator.onLine,!NF.isUndefined(u)&&!u)||"timeout"===o.error)){var s=2*this.flushInterval;return o.retryAfter&&(s=1e3*parseInt(o.retryAfter,10)||s),s=Math.min(6e5,s),this.reportError("Error; retry in "+s+" ms"),this.scheduleFlush(s),tF.resolve()}if(NF.isObject(o)&&413===o.httpStatusCode){if(i.length>1){var l=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,l,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),tF.resolve()}return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c()}return c()}catch(jHe){this.reportError("Error handling API response",jHe),this.resetFlush()}var u},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),Cz.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,u).then(l)},this)).catch(NF.bind(function(e){this.reportError("Error flushing request queue",e),this.resetFlush()},this))},Iz.prototype.reportError=function(e,t){if(Cz.error.apply(Cz.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){Cz.error(n)}};var Az=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},Pz=jF("recorder"),Oz=cO.CompressionStream,Mz={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},Tz=new Set([EU.MouseMove,EU.MouseInteraction,EU.Scroll,EU.ViewportResize,EU.Input,EU.TouchMove,EU.MediaInteraction,EU.Drag,EU.Selection]);var Rz=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||XF,this._onMaxLengthReached=e.onMaxLengthReached||XF,this._onBatchSent=e.onBatchSent||XF,this._rrwebRecord=e.rrwebRecord||null,this._stopRecording=null,this.replayId=e.replayId,this.batchStartUrl=e.batchStartUrl||null,this.replayStartUrl=e.replayStartUrl||null,this.idleExpires=e.idleExpires||null,this.maxExpires=e.maxExpires||null,this.replayStartTime=e.replayStartTime||null,this.lastEventTimestamp=e.lastEventTimestamp||null,this.seqNo=e.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=pF,this.recordMinMs=0;var t=qF(e.sharedLockStorage,!0)&&!this.getConfig("disable_persistence");this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new oz(nz),this.batcher=new Iz(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:Mz,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:250,sharedLockTimeoutMS:1e4})};Rz.prototype.getUserIdInfo=function(){if(this.finalFlushUserIdInfo)return this.finalFlushUserIdInfo;var e={distinct_id:String(this._mixpanel.get_distinct_id())},t=this._mixpanel.get_property("$device_id");t&&(e.$device_id=t);var n=this._mixpanel.get_property("$user_id");return n&&(e.$user_id=n),e},Rz.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.queueStorage.init().catch(function(){this.reportError("Error initializing IndexedDB storage for unloading persisted data.")}.bind(this)).then(function(){return this.getDurationMs()<this._getRecordMinMs()?this.queueStorage.removeItem(this.batcherKey):this.batcher.flush().then(function(){return this.queueStorage.removeItem(this.batcherKey)}.bind(this))}.bind(this))},Rz.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},Rz.prototype.get_config=function(e){return this.getConfig(e)},Rz.prototype.startRecording=function(e){if(null!==this._rrwebRecord)if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>pF&&(this.recordMaxMs=pF,Pz.critical("record_max_ms cannot be greater than "+pF+"ms. Capping value.")),this.maxExpires||(this.maxExpires=(new Date).getTime()+this.recordMaxMs),this.recordMinMs=this._getRecordMinMs(),this.replayStartTime||(this.replayStartTime=(new Date).getTime(),this.batchStartUrl=NF.info.currentUrl(),this.replayStartUrl=NF.info.currentUrl()),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=function(){clearTimeout(this.idleTimeoutId);var e=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,e),this.idleExpires=(new Date).getTime()+e}.bind(this);t();var n,r=this.getConfig("record_block_selector");""!==r&&null!==r||(r=void 0);try{this._stopRecording=this._rrwebRecord({emit:function(e){this.idleExpires&&this.idleExpires<e.timestamp?this._onIdleTimeout():(function(e){return e.type===_U.IncrementalSnapshot&&Tz.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(e),(null===this.lastEventTimestamp||e.timestamp>this.lastEventTimestamp)&&(this.lastEventTimestamp=e.timestamp))}.bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15},plugins:this.getConfig("record_console")?[(n={stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:50,depthOfLimit:2}},{name:"rrweb/console@1",observer:D$,options:n})]:[]})}catch(jHe){this.reportError("Unexpected error when starting rrweb recording.",jHe)}if("function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();var i=this.maxExpires-(new Date).getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),i)}else Pz.log("Recording already in progress, skipping startRecording.");else this.reportError("rrweb record function not provided. ")},Rz.prototype.stopRecording=function(e){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(jHe){this.reportError("Error with rrweb stopRecording",jHe)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():e||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},Rz.prototype.isRrwebStopped=function(){return null===this._stopRecording},Rz.prototype.flushEventsWithOptOut=function(e,t,n){var r=function(e){0===e&&(this.stopRecording(),n({error:"Tracking has been opted out, stopping recording."}))}.bind(this);this._flushEvents(e,t,n,r)},Rz.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(qAe){this.reportError("Error getting tab ID for serialization ",qAe),e=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,lastEventTimestamp:this.lastEventTimestamp,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:e}},Rz.deserialize=function(e,t){return new Rz(NF.extend({},t,{replayId:e.replayId,batchStartUrl:e.batchStartUrl,replayStartUrl:e.replayStartUrl,idleExpires:e.idleExpires,maxExpires:e.maxExpires,replayStartTime:e.replayStartTime,lastEventTimestamp:e.lastEventTimestamp,seqNo:e.seqNo,sharedLockStorage:t.sharedLockStorage}))},Rz.prototype._sendRequest=function(e,t,n,r){var i=function(t,n){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=NF.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}.bind(this),o=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");cO.fetch(o+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then(function(e){e.json().then(function(t){i(e,t)}).catch(function(e){r({error:e})})}).catch(function(e){r({error:e,httpStatusCode:0})})},Rz.prototype._flushEvents=uz(function(e,t,n){var r=e.length;if(r>0){for(var i=this.replayId,o=1/0,s=-1/0,a=!1,c=0;c<r;c++)o=Math.min(o,e[c].timestamp),s=Math.max(s,e[c].timestamp),e[c].type===_U.FullSnapshot&&(a=!0);if(0===this.seqNo){if(!a)return n({error:"First batch does not contain a full snapshot. Aborting recording."}),void this.stopRecording(!0);this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var l=s-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:fF.LIB_VERSION,batch_start_time:o/1e3,mp_lib:"web",replay_id:i,replay_length_ms:l,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},d=JSON.stringify(e);if(Object.assign(u,this.getUserIdInfo()),function(e,t,n){if(!cO.CompressionStream)return!1;var r=NF.info.browser(e,t,n),i=NF.info.browserVersion(e,t,n);return!(("Safari"===r||"Mobile Safari"===r)&&i>=16.4&&i<16.6)}(IF,xF.vendor,SF)){var h=new Blob([d],{type:"application/json"}).stream().pipeThrough(new Oz("gzip"));new Response(h).blob().then(function(e){u.format="gzip",this._sendRequest(i,u,e,n)}.bind(this))}else u.format="body",this._sendRequest(i,u,d,n)}}),Rz.prototype.reportError=function(e,t){Pz.error.apply(Pz.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){Pz.error(n)}},Rz.prototype.getDurationMs=function(){return null===this.replayStartTime?0:null===this.lastEventTimestamp?(new Date).getTime()-this.replayStartTime:this.lastEventTimestamp-this.replayStartTime},Rz.prototype._getRecordMinMs=function(){var e=this.getConfig("record_min_ms");return e>mF?(Pz.critical("record_min_ms cannot be greater than 8000ms. Capping value."),mF):e};var Nz=function(e){this.idb=new oz(rz),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};Nz.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config("disable_persistence")},Nz.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},Nz.prototype.setActiveRecording=function(e){if(!this.isPersistenceEnabled())return tF.resolve();var t=e.tabId;return t?this.idb.init().then(function(){return this.idb.setItem(t,e)}.bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),tF.resolve())},Nz.prototype.getActiveRecording=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}.bind(this)).then(function(e){return Az(e)?null:e}.bind(this)).catch(this.handleError.bind(this)):tF.resolve(null)},Nz.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},Nz.prototype.markActiveRecordingExpired=function(){return this.getActiveRecording().then(function(e){if(e)return e.maxExpires=0,this.setActiveRecording(e)}.bind(this)).catch(this.handleError.bind(this))},Nz.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):tF.resolve()},Nz.prototype.flushInactiveRecordings=function(){return this.isPersistenceEnabled()?this.idb.init().then(function(){return this.idb.getAll()}.bind(this)).then(function(e){var t=e.filter(function(e){return Az(e)}).map(function(e){return Rz.deserialize(e,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage}).unloadPersistedData().then(function(){return this.idb.removeItem(e.tabId)}.bind(this)).catch(this.handleError.bind(this))}.bind(this));return tF.all(t)}.bind(this)).catch(this.handleError.bind(this)):tF.resolve([])};var Lz=jF("recorder"),Bz=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||S$,this.sharedLockStorage=n,this.recordingRegistry=new Nz({mixpanelInstance:this.mixpanelInstance,errorReporter:Lz.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};Bz.prototype.startRecording=function(e){if(e=e||{},!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=function(){Lz.log("Idle timeout reached, restarting recording."),this.resetRecording()}.bind(this),n=function(){Lz.log("Max recording length reached, stopping recording."),this.resetRecording()}.bind(this),r=function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}.bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:t,onMaxLengthReached:n,replayId:NF.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=Rz.deserialize(e.activeSerializedRecording,i):this.activeRecording=new Rz(i),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())}Lz.log("Recording already in progress, skipping startRecording.")},Bz.prototype.stopRecording=function(){return this.stopRecordingInProgress=!0,this._stopCurrentRecording(!1,!0).then(function(){return this.recordingRegistry.clearActiveRecording()}.bind(this)).then(function(){this.stopRecordingInProgress=!1}.bind(this))},Bz.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Bz.prototype._stopCurrentRecording=function(e,t){if(this.activeRecording){var n=this.activeRecording.stopRecording(e);return t&&(this.activeRecording=null),n}return tF.resolve()},Bz.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),tF.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(t){return t&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(Lz.log("No resumable recording found."),null)}.bind(this))},Bz.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Bz.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Bz.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),cO.__mp_recorder=Bz;var jz="change",Dz="click",Uz="hashchange",$z="load",Fz="mp_locationchange",zz="popstate",qz="scrollend",Hz="scroll",Wz="submit",Kz="visibilitychange",Vz=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],Gz=["mp-include"],Zz=["mp-no-track"],Yz=Zz.concat(["mp-sensitive"]),Jz=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],Qz={button:!0,checkbox:!0,combobox:!0,grid:!0,link:!0,listbox:!0,menu:!0,menubar:!0,menuitem:!0,menuitemcheckbox:!0,menuitemradio:!0,navigation:!0,option:!0,radio:!0,radiogroup:!0,searchbox:!0,slider:!0,spinbutton:!0,switch:!0,tab:!0,tablist:!0,textbox:!0,tree:!0,treegrid:!0,treeitem:!0},Xz={base:!0,head:!0,html:!0,link:!0,meta:!0,script:!0,style:!0,title:!0,br:!0,hr:!0,wbr:!0,noscript:!0,picture:!0,source:!0,template:!0,track:!0},eq={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},tq=["onclick","onmousedown","onmouseup","onpointerdown","onpointerup","ontouchend","ontouchstart"],nq=jF("autocapture");function rq(e){for(var t={},n=iq(e).split(" "),r=0;r<n.length;r++){var i=n[r];i&&(t[i]=!0)}return t}function iq(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function oq(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!dq(e));return e}function sq(e,t,n,r,i,o){var s={$classes:iq(e).split(" "),$tag_name:e.tagName.toLowerCase()},a=e.id;a&&(s.$id=a),pq(e,t,i,o)&&NF.each(Jz.concat(r),function(t){if(e.hasAttribute(t)&&!n[t]){var r=e.getAttribute(t);mq(r)&&(s["$attr-"+t]=r)}});for(var c=1,l=1,u=e;u=oq(u);)c++,u.tagName===e.tagName&&l++;return s.$nth_child=c,s.$nth_of_type=l,s}function aq(e,t){var n=t.allowElementCallback,r=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,c=t.captureExtraAttrs||[],l=t.capturedForHeatMap||!1,u={};NF.each(i,function(e){u[e]=!0});var d=null,h=void 0===e.target?e.srcElement:e.target;if(fq(h)&&(h=h.parentNode),function(e,t){if(!e||hq(e,"html")||!dq(e))return!1;switch(e.tagName.toLowerCase()){case"form":return t.type===Wz;case"input":return-1===["button","submit"].indexOf(e.getAttribute("type"))?t.type===jz:t.type===Dz;case"select":case"textarea":return t.type===jz;default:return t.type===Dz}}(h,e)&&lq(h,e,n,r)&&!uq(h,e,o,s)){for(var f=[h],p=h;p.parentNode&&!hq(p,"body");)f.push(p.parentNode),p=p.parentNode;var m,g=[],y=!1;if(NF.each(f,function(t){var i=pq(t,e,n,r);u.href||"a"!==t.tagName.toLowerCase()||(m=t.getAttribute("href"),m=i&&mq(m)&&m),uq(t,e,o,s)&&(y=!0),g.push(sq(t,e,u,c,n,r))},this),!y){var b=kF.documentElement;if(d={$event_type:e.type,$host:cO.location.host,$pathname:cO.location.pathname,$elements:g,$el_attr__href:m,$viewportHeight:Math.max(b.clientHeight,cO.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,cO.innerWidth||0),$pageHeight:kF.body.offsetHeight||0,$pageWidth:kF.body.offsetWidth||0},NF.each(c,function(e){if(!u[e]&&h.hasAttribute(e)){var t=h.getAttribute(e);mq(t)&&(d["$el_attr__"+e]=t)}}),a&&(v=cq(h,e,n,r))&&v.length&&(d.$el_text=v),e.type===Dz&&(NF.each(Vz,function(t){t in e&&(d["$"+t]=e[t])}),l&&(d.$captured_for_heatmap=!0),h=function(e){for(var t=e.target,n=e.composedPath(),r=0;r<n.length;r++){var i=n[r];if(hq(i,"a")||hq(i,"button")||hq(i,"input")||hq(i,"select")||i.getAttribute&&"button"===i.getAttribute("role")){t=i;break}if(i===t)break}return t}(e)),a){var v=cq(h,e,n,r);v&&v.length&&(d.$el_text=v)}if(h){if(!lq(h,e,n,r)||uq(h,e,o,s))return null;var w=sq(h,e,u,c,n,r);d.$target=w,d.$el_classes=w.$classes,NF.extend(d,NF.strip_empty_properties({$el_id:w.$id,$el_tag_name:w.$tag_name}))}}}return d}function cq(e,t,n,r){var i="";return pq(e,t,n,r)&&e.childNodes&&e.childNodes.length&&NF.each(e.childNodes,function(e){fq(e)&&e.textContent&&(i+=NF.trim(e.textContent).split(/(\s+)/).filter(mq).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),NF.trim(i)}function lq(e,t,n,r){if(n)try{if(!n(e,t))return!1}catch(jHe){return nq.critical("Error while checking element in allowElementCallback",jHe),!1}if(!r.length)return!0;for(var i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(jHe){nq.critical("Error while checking selector: "+o,jHe)}}return!1}function uq(e,t,n,r){var i;if(n)try{if(n(e,t))return!0}catch(jHe){return nq.critical("Error while checking element in blockElementCallback",jHe),!0}if(r&&r.length)for(i=0;i<r.length;i++){var o=r[i];try{if(e.matches(o))return!0}catch(jHe){nq.critical("Error while checking selector: "+o,jHe)}}var s=rq(e);for(i=0;i<Zz.length;i++)if(s[Zz[i]])return!0;return!1}function dq(e){return e&&1===e.nodeType}function hq(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function fq(e){return e&&3===e.nodeType}function pq(e,t,n,r){var i;if(!lq(e,t,n,r))return!1;for(var o=e;o.parentNode&&!hq(o,"body");o=o.parentNode){var s=rq(o);for(i=0;i<Yz.length;i++)if(s[Yz[i]])return!1}var a=rq(e);for(i=0;i<Gz.length;i++)if(a[Gz[i]])return!0;if(hq(e,"input")||hq(e,"select")||hq(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;var c=e.type||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var l=e.name||e.id||"";if("string"==typeof l){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(l.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function mq(e){if(null===e||NF.isUndefined(e))return!1;if("string"==typeof e){e=NF.trim(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function gq(e){var t="onscrollend"in cO,n=DF(e),r=qz;if(!t){var i=null;n=DF(function(){clearTimeout(i),i=setTimeout(e,100)}),r=Hz}return{listener:n,eventType:r}}function yq(e){var t=e.tagName.toLowerCase();return"button"===t||"input"===t||"select"===t||"textarea"===t||"details"===t||"dialog"===t||(!!e.isContentEditable||(!!(e.onclick||e.onmousedown||e.onmouseup||e.ontouchstart||e.ontouchend)||(!!function(e){for(var t=0;t<tq.length;t++)if(e.hasAttribute(tq[t]))return!0;return!1}(e)||(!!function(e){var t=e.getAttribute("role");if(!t)return!1;var n=t.trim().split(/\s+/)[0].toLowerCase();return Qz[n]}(e)||(!("a"!==t||!e.hasAttribute("href"))||!!e.hasAttribute("tabindex"))))))}function bq(e){if(!e||!e.tagName)return!0;var t=e.tagName.toLowerCase();if(Xz[t])return!0;if(yq(e))return!1;for(var n=e.parentElement,r=0;n&&r<5;){if(yq(n))return!1;if(n.getRootNode&&n.getRootNode()!==kF){var i=n.getRootNode();if(i.host&&yq(i.host))return!1}n=n.parentElement,r++}return!!eq[t]}function vq(e){return"composedPath"in e?e.composedPath():[]}function wq(e){var t=vq(e);return t&&t.length>0?t[0]:e.target||e.srcElement}function _q(){this.clicks=[]}function Eq(e,t){this.changeCallback=e||function(){},this.observerConfig=t,this.observedShadowRoots=null,this.shadowObservers=[]}_q.prototype.isRageClick=function(e,t){var n=(t=t||{}).threshold_px||30,r=t.timeout_ms||1e3,i=t.click_count||4;if(t.interactive_elements_only||false){var o=wq(e);if(!o||bq(o))return!1}var s=Date.now(),a=e.pageX,c=e.pageY,l=this.clicks[this.clicks.length-1];if(l&&s-l.timestamp<r&&Math.sqrt(Math.pow(a-l.x,2)+Math.pow(c-l.y,2))<n){if(this.clicks.push({x:a,y:c,timestamp:s}),this.clicks.length>=i)return this.clicks=[],!0}else this.clicks=[{x:a,y:c,timestamp:s}];return!1},Eq.prototype.getEventTarget=function(e){if(this.observedShadowRoots)return wq(e)},Eq.prototype.observeFromEvent=function(e){if(this.observedShadowRoots)for(var t=vq(e),n=0;n<t.length;n++){var r=t[n];r&&r.shadowRoot&&this.observeShadowRoot(r.shadowRoot)}},Eq.prototype.observeShadowRoot=function(e){if(this.observedShadowRoots&&!this.observedShadowRoots.has(e)){var t=this;try{this.observedShadowRoots.add(e);var n=new window.MutationObserver(function(){t.changeCallback()});n.observe(e,this.observerConfig),this.shadowObservers.push(n)}catch(qAe){nq.critical("Error while observing shadow root",qAe)}}},Eq.prototype.start=function(){this.observedShadowRoots||("undefined"!=typeof WeakSet?this.observedShadowRoots=new WeakSet:nq.critical("Shadow DOM observation unavailable: WeakSet not supported"))},Eq.prototype.stop=function(){if(this.observedShadowRoots){for(var e=0;e<this.shadowObservers.length;e++)try{this.shadowObservers[e].disconnect()}catch(qAe){nq.critical("Error while disconnecting shadow DOM observer",qAe)}this.shadowObservers=[],this.observedShadowRoots=null}};var xq=[jz,"input",Wz,"select","toggle"],kq=[qz],Sq=[Uz],Cq={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","checked","selected","value","display","visibility"]};function Iq(e){this.eventListeners=[],this.mutationObserver=null,this.shadowDOMObserver=null,this.isTracking=!1,this.lastChangeEventTimestamp=0,this.pendingClicks=[],this.onDeadClickCallback=e,this.processingActive=!1,this.processingTimeout=null}Iq.prototype.addClick=function(e){var t=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(e);return t||(t=e.target||e.srcElement),!(!t||bq(t))&&(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(e),this.pendingClicks.push({element:t,event:e,timestamp:Date.now()}),!0)},Iq.prototype.trackClick=function(e,t){if(!this.isTracking)return!1;var n=this.addClick(e);return n&&this.triggerProcessing(t),n},Iq.prototype.getDeadClicks=function(e){if(0===this.pendingClicks.length)return[];var t=e.timeout_ms,n=Date.now(),r=this.pendingClicks.slice();this.pendingClicks=[];for(var i=[],o=0;o<r.length;o++){var s=r[o];n-s.timestamp>=t?this.hasChangesAfter(s.timestamp)||i.push(s):this.pendingClicks.push(s)}return i},Iq.prototype.hasChangesAfter=function(e){return this.lastChangeEventTimestamp>=e-100},Iq.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},Iq.prototype.triggerProcessing=function(e){this.processingActive||(this.processingActive=!0,this.processRecursively(e))},Iq.prototype.processRecursively=function(e){if(this.isTracking&&this.onDeadClickCallback){var t=e.timeout_ms,n=this;this.processingTimeout=setTimeout(function(){if(n.processingActive){for(var t=n.getDeadClicks(e),r=0;r<t.length;r++)n.onDeadClickCallback(t[r].event);n.pendingClicks.length>0?n.processRecursively(e):n.processingActive=!1}},t)}else this.processingActive=!1},Iq.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var e=this;xq.forEach(function(t){var n=function(){e.recordChangeEvent()};document.addEventListener(t,n,{capture:!0,passive:!0}),e.eventListeners.push({target:document,event:t,handler:n,options:{capture:!0,passive:!0}})}),Sq.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n),e.eventListeners.push({target:window,event:t,handler:n})}),kq.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n,{passive:!0}),e.eventListeners.push({target:window,event:t,handler:n,options:{passive:!0}})});var t=function(){e.recordChangeEvent()};if(document.addEventListener("selectionchange",t),e.eventListeners.push({target:document,event:"selectionchange",handler:t}),window.MutationObserver)try{this.mutationObserver=new window.MutationObserver(function(){e.recordChangeEvent()}),this.mutationObserver.observe(document.body||document.documentElement,Cq)}catch(qAe){nq.critical("Error while setting up mutation observer",qAe)}if(window.customElements)try{this.shadowDOMObserver=new Eq(function(){e.recordChangeEvent()},Cq),this.shadowDOMObserver.start()}catch(qAe){nq.critical("Error while setting up shadow DOM observer",qAe),this.shadowDOMObserver=null}}},Iq.prototype.stopTracking=function(){if(this.isTracking){this.isTracking=!1,this.pendingClicks=[],this.lastChangeEventTimestamp=0,this.processingActive=!1,this.processingTimeout&&(clearTimeout(this.processingTimeout),this.processingTimeout=null);for(var e=0;e<this.eventListeners.length;e++){var t=this.eventListeners[e];try{t.target.removeEventListener(t.event,t.handler,t.options)}catch(qAe){nq.critical("Error while removing event listener",qAe)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(qAe){nq.critical("Error while disconnecting mutation observer",qAe)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(qAe){nq.critical("Error while stopping shadow DOM observer",qAe)}this.shadowDOMObserver=null}}};var Aq="autocapture",Pq="full-url",Oq="allow_selectors",Mq="allow_url_regexes",Tq="block_attrs",Rq="block_element_callback",Nq="block_selectors",Lq="block_url_regexes",Bq="capture_extra_attrs",jq="capture_text_content",Dq="scroll_capture_all",Uq="scroll_depth_percent_checkpoints",$q="click",Fq="dead_click",zq="input",qq="pageview",Hq="rage_click",Wq="scroll",Kq="page_leave",Vq="submit",Gq={};Gq[Oq]=[],Gq[Mq]=[],Gq[Tq]=[],Gq[Rq]=null,Gq[Nq]=[],Gq[Lq]=[],Gq[Bq]=[],Gq[jq]=!1,Gq[Dq]=!1,Gq[Uq]=[25,50,75,100],Gq[$q]=!0,Gq[Fq]=!0,Gq[zq]=!0,Gq[qq]=Pq,Gq[Hq]=!0,Gq[Wq]=!0,Gq[Kq]=!1,Gq[Vq]=!0;var Zq={$mp_autocapture:!0},Yq="$mp_click",Jq="$mp_dead_click",Qq="$mp_rage_click",Xq=function(e){this.mp=e,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};Xq.prototype.init=function(){!function(){try{return!!kF.createElement("div").matches}catch(jHe){return!1}}()?nq.critical("Autocapture unavailable: missing required DOM APIs"):(this.initPageListeners(),this.initPageviewTracking(),this.initClickTracking(),this.initDeadClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking(),this.initRageClickTracking(),this.initPageLeaveTracking())},Xq.prototype.getFullConfig=function(){var e=this.mp.get_config(Aq);return e?NF.isObject(e)?NF.extend({},Gq,e):Gq:{}},Xq.prototype.getConfig=function(e){return this.getFullConfig()[e]},Xq.prototype.currentUrlBlocked=function(){var e,t=NF.info.currentUrl(),n=this.getConfig(Mq)||[];if(n.length){var r=!1;for(e=0;e<n.length;e++){var i=n[e];try{if(t.match(i)){r=!0;break}}catch(jHe){return nq.critical("Error while checking block URL regex: "+i,jHe),!0}}if(!r)return!0}var o=this.getConfig(Lq)||[];if(!o||!o.length)return!1;for(e=0;e<o.length;e++)try{if(t.match(o[e]))return!0}catch(jHe){return nq.critical("Error while checking block URL regex: "+o[e],jHe),!0}return!1},Xq.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(Aq)?this.getConfig(qq):this.mp.get_config("track_pageview")},Xq.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=this.mp.is_recording_heatmap_data()&&(t===Yq&&!this.getConfig($q)||t===Qq&&!this._getClickTrackingConfig(Hq)||t===Jq&&!this._getClickTrackingConfig(Fq)),r=aq(e,{allowElementCallback:this.getConfig("allow_element_callback"),allowSelectors:this.getConfig(Oq),blockAttrs:this.getConfig(Tq),blockElementCallback:this.getConfig(Rq),blockSelectors:this.getConfig(Nq),captureExtraAttrs:this.getConfig(Bq),captureTextContent:this.getConfig(jq),capturedForHeatMap:n});r&&(NF.extend(r,Zq),this.mp.track(t,r))}},Xq.prototype.initPageListeners=function(){if(cO.removeEventListener(zz,this.listenerPopstate),cO.removeEventListener(Uz,this.listenerHashchange),this.pageviewTrackingConfig()||this.getConfig(Kq)||this.mp.get_config("record_heatmap_data")){this.listenerPopstate=function(){cO.dispatchEvent(new Event(Fz))},this.listenerHashchange=function(){cO.dispatchEvent(new Event(Fz))},cO.addEventListener(zz,this.listenerPopstate),cO.addEventListener(Uz,this.listenerHashchange);var e=cO.history.pushState;"function"==typeof e&&(cO.history.pushState=function(t,n,r){e.call(cO.history,t,n,r),cO.dispatchEvent(new Event(Fz))});var t=cO.history.replaceState;"function"==typeof t&&(cO.history.replaceState=function(e,n,r){t.call(cO.history,e,n,r),cO.dispatchEvent(new Event(Fz))})}},Xq.prototype._getClickTrackingConfig=function(e){var t=this.getConfig(e);return t?!0===t?{}:"object"==typeof t?t:{}:null},Xq.prototype._trackPageLeave=function(e,t,n){if(!this.hasTrackedScrollSession&&(this.getConfig(Kq)||this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var r=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0),i=Math.round(Math.max(this.maxScrollViewDepth-r,0)/(n-r)*100),o=Math.round(r/n*100);n<=r&&(i=100,o=100);var s=NF.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:i,$fold_line_percentage:o,$scroll_height:n,$event_type:e.type,$current_url:t||NF.info.currentUrl(),$viewportHeight:r,$viewportWidth:Math.max(kF.documentElement.clientWidth,cO.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},Zq);this.mp.track("$mp_page_leave",s,{transport:"sendBeacon"})}},Xq.prototype._initScrollDepthTracking=function(){if(cO.removeEventListener(Hz,this.listenerScrollDepth),cO.removeEventListener(qz,this.listenerScrollDepth),this.mp.get_config("record_heatmap_data")){nq.log("Initializing scroll depth tracking"),this.maxScrollViewDepth=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0);var e=gq(function(){if(!this.currentUrlBlocked()){var e=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0)+cO.scrollY;e>this.maxScrollViewDepth&&(this.maxScrollViewDepth=e),this.previousScrollHeight=kF.body.scrollHeight}}.bind(this));this.listenerScrollDepth=e.listener,cO.addEventListener(e.eventType,this.listenerScrollDepth)}},Xq.prototype.initClickTracking=function(){cO.removeEventListener(Dz,this.listenerClick),(this.getConfig($q)||this.mp.get_config("record_heatmap_data"))&&(nq.log("Initializing click tracking"),this.listenerClick=function(e){(this.getConfig($q)||this.mp.is_recording_heatmap_data())&&this.trackDomEvent(e,Yq)}.bind(this),cO.addEventListener(Dz,this.listenerClick))},Xq.prototype.initDeadClickTracking=function(){this._getClickTrackingConfig(Fq)||this.mp.get_config("record_heatmap_data")?(nq.log("Initializing dead click tracking"),this._deadClickTracker||(this._deadClickTracker=new Iq(function(e){this.trackDomEvent(e,Jq)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(e){var t=this._getClickTrackingConfig(Fq);if((t||this.mp.is_recording_heatmap_data())&&!this.currentUrlBlocked()){var n=t||{};n.timeout_ms||(n.timeout_ms=500),this._deadClickTracker.trackClick(e,n)}}.bind(this),cO.addEventListener(Dz,this.listenerDeadClick))):this.stopDeadClickTracking()},Xq.prototype.initInputTracking=function(){cO.removeEventListener(jz,this.listenerChange),this.getConfig(zq)&&(nq.log("Initializing input tracking"),this.listenerChange=function(e){this.getConfig(zq)&&this.trackDomEvent(e,"$mp_input_change")}.bind(this),cO.addEventListener(jz,this.listenerChange))},Xq.prototype.initPageviewTracking=function(){if(cO.removeEventListener(Fz,this.listenerLocationchange),this.pageviewTrackingConfig()){nq.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(Zq)),t&&(e=NF.info.currentUrl()),this.listenerLocationchange=DF(function(){if(!this.currentUrlBlocked()){var t=NF.info.currentUrl(),n=!1,r=t.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],i=this.pageviewTrackingConfig();if(i===Pq?n=t!==e:"url-with-path-and-query-string"===i?n=t.split("#")[0]!==e.split("#")[0]:"url-with-path"===i&&(n=r),n)this.mp.track_pageview(Zq)&&(e=t),r&&(this.lastScrollCheckpoint=0,nq.log("Path change: re-initializing scroll depth checkpoints"))}}.bind(this)),cO.addEventListener(Fz,this.listenerLocationchange)}},Xq.prototype.initRageClickTracking=function(){cO.removeEventListener(Dz,this.listenerRageClick),(this._getClickTrackingConfig(Hq)||this.mp.get_config("record_heatmap_data"))&&(nq.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new _q),this.listenerRageClick=function(e){var t=this._getClickTrackingConfig(Hq);(t||this.mp.is_recording_heatmap_data())&&(this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e,t)&&this.trackDomEvent(e,Qq))}.bind(this),cO.addEventListener(Dz,this.listenerRageClick))},Xq.prototype.initScrollTracking=function(){if(cO.removeEventListener(qz,this.listenerScroll),cO.removeEventListener(Hz,this.listenerScroll),this.getConfig(Wq)){nq.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0;var e=function(){if(this.getConfig(Wq)&&!this.currentUrlBlocked()){var e=this.getConfig(Dq),t=(this.getConfig(Uq)||[]).slice().sort(function(e,t){return e-t}),n=cO.scrollY,r=NF.extend({$scroll_top:n},Zq);try{var i=kF.body.scrollHeight,o=Math.round(n/(i-cO.innerHeight)*100);if(r.$scroll_height=i,r.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(r.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,e=!0)}}catch(jHe){nq.critical("Error while calculating scroll percentage",jHe)}e&&this.mp.track("$mp_scroll",r)}}.bind(this),t=gq(e);this.listenerScroll=t.listener,cO.addEventListener(t.eventType,this.listenerScroll)}},Xq.prototype.initSubmitTracking=function(){cO.removeEventListener(Wz,this.listenerSubmit),this.getConfig(Vq)&&(nq.log("Initializing submit tracking"),this.listenerSubmit=function(e){this.getConfig(Vq)&&this.trackDomEvent(e,"$mp_submit")}.bind(this),cO.addEventListener(Wz,this.listenerSubmit))},Xq.prototype.initPageLeaveTracking=function(){if(kF.removeEventListener(Kz,this.listenerPageLeaveVisibilitychange),cO.removeEventListener(Fz,this.listenerPageLeaveLocationchange),cO.removeEventListener($z,this.listenerPageLoad),this.getConfig(Kq)||this.mp.get_config("record_heatmap_data")){nq.log("Initializing page visibility tracking."),this._initScrollDepthTracking();var e=NF.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=kF.body.scrollHeight}.bind(this),cO.addEventListener($z,this.listenerPageLoad),this.listenerPageLeaveLocationchange=DF(function(t){if(!this.currentUrlBlocked()){var n=NF.info.currentUrl();n!==e&&(this._trackPageLeave(t,e,this.previousScrollHeight),e=n,this.maxScrollViewDepth=Math.max(kF.documentElement.clientHeight,cO.innerHeight||0),this.previousScrollHeight=kF.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),cO.addEventListener(Fz,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(t){kF.hidden&&this._trackPageLeave(t,e,this.previousScrollHeight)}.bind(this),kF.addEventListener(Kz,this.listenerPageLeaveVisibilitychange)}},Xq.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(cO.removeEventListener(Dz,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},UF(Xq);var eH=jF("flags"),tH="flags",nH="context",rH={};rH[nH]={};var iH=function(e){this.fetch=cO.fetch,this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};iH.prototype.init=function(){this.minApisSupported()?(this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set):eH.critical("Feature Flags unavailable: missing minimum required APIs")},iH.prototype.getFullConfig=function(){var e=this.getMpConfig(tH);return e?NF.isObject(e)?NF.extend({},rH,e):rH:{}},iH.prototype.getConfig=function(e){return this.getFullConfig()[e]},iH.prototype.isSystemEnabled=function(){return!!this.getMpConfig(tH)},iH.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return eH.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var n=this.getMpConfig(tH);NF.isObject(n)||(n={});var r=t&&t.replace?{}:this.getConfig(nH);return n[nH]=NF.extend({},r,e),this.setMpConfig(tH,n),this.fetchFlags()},iH.prototype.areFlagsReady=function(){return this.isSystemEnabled()||eH.error("Feature Flags not enabled"),!!this.flags},iH.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id"),n="00-"+NF.UUID().replace(/-/g,"")+"-"+NF.UUID().replace(/-/g,"").substring(0,16)+"-01";eH.log("Fetching flags for distinct ID: "+e);var r=NF.extend({distinct_id:e,device_id:t},this.getConfig(nH)),i=new URLSearchParams;i.set("context",JSON.stringify(r)),i.set("token",this.getMpConfig("token")),i.set("mp_lib","web"),i.set("$lib_version",fF.LIB_VERSION);var o=this.getFullApiRoute()+"?"+i.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(cO,o,{method:"GET",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),traceparent:n}}).then(function(e){return this.markFetchComplete(),e.json().then(function(e){var t=e.flags;if(!t)throw new Error("No flags in API response");var r=new Map;NF.each(t,function(e,t){r.set(t,{key:e.variant_key,value:e.variant_value,experiment_id:e.experiment_id,is_experiment_active:e.is_experiment_active,is_qa_tester:e.is_qa_tester})}),this.flags=r,this._traceparent=n}.bind(this)).catch(function(e){this.markFetchComplete(),eH.error(e)}.bind(this))}.bind(this)).catch(function(e){this.markFetchComplete(),eH.error(e)}.bind(this)),this.fetchPromise},iH.prototype.markFetchComplete=function(){this._fetchInProgressStartTime?(this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null):eH.error("Fetch in progress started time not set, cannot mark fetch complete")},iH.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(e,t)}.bind(this)).catch(function(e){return eH.error(e),t}):new Promise(function(e){eH.critical("Feature Flags not initialized"),e(t)})},iH.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return eH.log("Flags not loaded yet"),t;var n=this.flags.get(e);return n?(this.trackFeatureCheck(e,n),n):(eH.log('No flag found: "'+e+'"'),t)},iH.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(e){return e.value}).catch(function(e){return eH.error(e),t})},iH.prototype.getFeatureData=function(e,t){return eH.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(e,t)},iH.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value},iH.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then(function(){return this.isEnabledSync(e,t)}.bind(this)).catch(function(e){return eH.error(e),t})},iH.prototype.isEnabledSync=function(e,t){t=t||!1;var n=this.getVariantValueSync(e,t);return!0!==n&&!1!==n&&(eH.error('Feature flag "'+e+'" value: '+n+" is not a boolean; returning fallback value: "+t),n=t),n},iH.prototype.trackFeatureCheck=function(e,t){if(!this.trackedFeatures.has(e)){this.trackedFeatures.add(e);var n={"Experiment name":e,"Variant name":t.key,$experiment_type:"feature_flag","Variant fetch start time":new Date(this._fetchStartTime).toISOString(),"Variant fetch complete time":new Date(this._fetchCompleteTime).toISOString(),"Variant fetch latency (ms)":this._fetchLatency,"Variant fetch traceparent":this._traceparent};"undefined"!==t.experiment_id&&(n.$experiment_id=t.experiment_id),"undefined"!==t.is_experiment_active&&(n.$is_experiment_active=t.is_experiment_active),"undefined"!==t.is_qa_tester&&(n.$is_qa_tester=t.is_qa_tester),this.track("$experiment_started",n)}},iH.prototype.minApisSupported=function(){return!!this.fetch&&"undefined"!=typeof Promise&&"undefined"!=typeof Map&&"undefined"!=typeof Set},UF(iH),iH.prototype.are_flags_ready=iH.prototype.areFlagsReady,iH.prototype.get_variant=iH.prototype.getVariant,iH.prototype.get_variant_sync=iH.prototype.getVariantSync,iH.prototype.get_variant_value=iH.prototype.getVariantValue,iH.prototype.get_variant_value_sync=iH.prototype.getVariantValueSync,iH.prototype.is_enabled=iH.prototype.isEnabled,iH.prototype.is_enabled_sync=iH.prototype.isEnabledSync,iH.prototype.update_context=iH.prototype.updateContext,iH.prototype.get_feature_data=iH.prototype.getFeatureData;var oH=function(){};oH.prototype.create_properties=function(){},oH.prototype.event_handler=function(){},oH.prototype.after_track_handler=function(){},oH.prototype.init=function(e){return this.mp=e,this},oH.prototype.track=function(e,t,n,r){var i=this,o=NF.dom_query(e);if(0!==o.length)return NF.each(o,function(e){NF.register_event(e,this.override_event,function(e){var o={},s=i.create_properties(n,this),a=i.mp.get_config("track_links_timeout");i.event_handler(e,this,o),window.setTimeout(i.track_callback(r,s,o,!0),a),i.mp.track(t,s,i.track_callback(r,s,o))})},this),!0;LF.error("The DOM query ("+e+") returned 0 elements")},oH.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||i.after_track_handler(t,n,r))}},oH.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):NF.extend({},e)};var sH=function(){this.override_event="click"};NF.inherit(sH,oH),sH.prototype.create_properties=function(e,t){var n=sH.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},sH.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},sH.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var aH=function(){this.override_event="submit"};NF.inherit(aH,oH),aH.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},aH.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var cH="$set",lH="$set_once",uH="$unset",dH="$add",hH="$append",fH="$union",pH="$remove",mH={set_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[cH]=r,n},unset_action:function(e){var t={},n=[];return NF.isArray(e)||(e=[e]),NF.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[uH]=n,t},set_once_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[lH]=r,n},union_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=NF.isArray(e)?e:[e])},this):r[e]=NF.isArray(t)?t:[t],n[fH]=r,n},append_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[hH]=r,n},remove_action:function(e,t){var n={},r={};return NF.isObject(e)?NF.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[pH]=r,n},delete_action:function(){var e={$delete:""};return e}},gH=function(){};NF.extend(gH.prototype,mH),gH.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},gH.prototype.set=hz(function(e,t,n){var r=this.set_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),gH.prototype.set_once=hz(function(e,t,n){var r=this.set_once_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),gH.prototype.unset=hz(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),gH.prototype.union=hz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),gH.prototype.delete=hz(function(e){var t=this.delete_action();return this._send_request(t,e)}),gH.prototype.remove=hz(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),gH.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=NF.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._mixpanel.get_api_host("groups")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},gH.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},gH.prototype._get_config=function(e){return this._mixpanel.get_config(e)},gH.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},gH.prototype.remove=gH.prototype.remove,gH.prototype.set=gH.prototype.set,gH.prototype.set_once=gH.prototype.set_once,gH.prototype.union=gH.prototype.union,gH.prototype.unset=gH.prototype.unset,gH.prototype.toString=gH.prototype.toString;var yH=function(){};NF.extend(yH.prototype,mH),yH.prototype._init=function(e){this._mixpanel=e},yH.prototype.set=dz(function(e,t,n){var r=this.set_action(e,t);return NF.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[cH]=NF.extend({},NF.info.people_properties(),r[cH]),this._send_request(r,n)}),yH.prototype.set_once=dz(function(e,t,n){var r=this.set_once_action(e,t);return NF.isObject(e)&&(n=t),this._send_request(r,n)}),yH.prototype.unset=dz(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),yH.prototype.increment=dz(function(e,t,n){var r={},i={};return NF.isObject(e)?(NF.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void LF.error("Invalid increment value passed to mixpanel.people.increment - must be a number");i[t]=e}},this),n=t):(NF.isUndefined(t)&&(t=1),i[e]=t),r[dH]=i,this._send_request(r,n)}),yH.prototype.append=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),yH.prototype.remove=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),yH.prototype.union=dz(function(e,t,n){NF.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),yH.prototype.track_charge=dz(function(){LF.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),yH.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},yH.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}LF.error("mixpanel.people.delete_user() requires you to call identify() first")},yH.prototype.toString=function(){return this._mixpanel.toString()+".people"},yH.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=NF.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),NF.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),NF.truncate(o,255))},yH.prototype._get_config=function(e){return this._mixpanel.get_config(e)},yH.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},yH.prototype._enqueue=function(e){cH in e?this._mixpanel.persistence._add_to_people_queue(cH,e):lH in e?this._mixpanel.persistence._add_to_people_queue(lH,e):uH in e?this._mixpanel.persistence._add_to_people_queue(uH,e):dH in e?this._mixpanel.persistence._add_to_people_queue(dH,e):hH in e?this._mixpanel.persistence._add_to_people_queue(hH,e):pH in e?this._mixpanel.persistence._add_to_people_queue(pH,e):fH in e?this._mixpanel.persistence._add_to_people_queue(fH,e):LF.error("Invalid call to _enqueue():",e)},yH.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=NF.extend({},this._mixpanel.persistence.load_queue(e)),s=o;NF.isUndefined(o)||!NF.isObject(o)||NF.isEmptyObject(o)||(i._mixpanel.persistence._pop_from_people_queue(e,o),i._mixpanel.persistence.save(),r&&(s=r(o)),t.call(i,s,function(t,r){0===t&&i._mixpanel.persistence._add_to_people_queue(e,o),NF.isUndefined(n)||n(t,r)}))},yH.prototype._flush=function(e,t,n,r,i,o,s){var a=this;this._flush_one_queue(cH,this.set,e),this._flush_one_queue(lH,this.set_once,r),this._flush_one_queue(uH,this.unset,o,function(e){return NF.keys(e)}),this._flush_one_queue(dH,this.increment,t),this._flush_one_queue(fH,this.union,i);var c=this._mixpanel.persistence.load_queue(hH);if(!NF.isUndefined(c)&&NF.isArray(c)&&c.length)for(var l,u=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(hH,l),NF.isUndefined(n)||n(e,t)},d=c.length-1;d>=0;d--)c=this._mixpanel.persistence.load_queue(hH),l=c.pop(),a._mixpanel.persistence.save(),NF.isEmptyObject(l)||a.append(l,u);var h=this._mixpanel.persistence.load_queue(pH);if(!NF.isUndefined(h)&&NF.isArray(h)&&h.length)for(var f,p=function(e,t){0===e&&a._mixpanel.persistence._add_to_people_queue(pH,f),NF.isUndefined(s)||s(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(pH),f=h.pop(),a._mixpanel.persistence.save(),NF.isEmptyObject(f)||a.remove(f,p)},yH.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},yH.prototype.set=yH.prototype.set,yH.prototype.set_once=yH.prototype.set_once,yH.prototype.unset=yH.prototype.unset,yH.prototype.increment=yH.prototype.increment,yH.prototype.append=yH.prototype.append,yH.prototype.remove=yH.prototype.remove,yH.prototype.union=yH.prototype.union,yH.prototype.track_charge=yH.prototype.track_charge,yH.prototype.clear_charges=yH.prototype.clear_charges,yH.prototype.delete_user=yH.prototype.delete_user,yH.prototype.toString=yH.prototype.toString;var bH,vH="__mps",wH="__mpso",_H="__mpus",EH="__mpa",xH="__mpap",kH="__mpr",SH="__mpu",CH="$people_distinct_id",IH="__alias",AH="__timers",PH=[vH,wH,_H,EH,xH,kH,SH,CH,IH,AH],OH=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(LF.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&NF.localStorage.is_supported()?this.storage=NF.localStorage:this.storage=NF.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};OH.prototype.properties=function(){var e={};return this.load(),NF.each(this.props,function(t,n){NF.include(PH,n)||(e[n]=t)}),e},OH.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=NF.extend({},e))}},OH.prototype.upgrade=function(){var e,t;this.storage===NF.localStorage?(e=NF.cookie.parse(this.name),NF.cookie.remove(this.name),NF.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===NF.cookie&&(t=NF.localStorage.parse(this.name),NF.localStorage.remove(this.name),t&&this.register_once(t))},OH.prototype.save=function(){this.disabled||this.storage.set(this.name,ez(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},OH.prototype.load_prop=function(e){return this.load(),this.props[e]},OH.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},OH.prototype.clear=function(){this.remove(),this.props={}},OH.prototype.register_once=function(e,t,n){return!!NF.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),NF.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},OH.prototype.register=function(e,t){return!!NF.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),NF.extend(this.props,e),this.save(),!0)},OH.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},OH.prototype.update_search_keyword=function(e){this.register(NF.info.searchInfo(e))},OH.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:NF.info.referringDomain(e)||"$direct"},"")},OH.prototype.get_referrer_info=function(){return NF.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},OH.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},OH.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},OH.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},OH.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},OH.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},OH.prototype.get_cross_subdomain=function(){return this.cross_subdomain},OH.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},OH.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(cH),o=this._get_or_create_queue(lH),s=this._get_or_create_queue(uH),a=this._get_or_create_queue(dH),c=this._get_or_create_queue(fH),l=this._get_or_create_queue(pH,[]),u=this._get_or_create_queue(hH,[]);n===vH?(NF.extend(i,r),this._pop_from_people_queue(dH,r),this._pop_from_people_queue(fH,r),this._pop_from_people_queue(uH,r)):n===wH?(NF.each(r,function(e,t){t in o||(o[t]=e)}),this._pop_from_people_queue(uH,r)):n===_H?NF.each(r,function(e){NF.each([i,o,a,c],function(t){e in t&&delete t[e]}),NF.each(u,function(t){e in t&&delete t[e]}),s[e]=!0}):n===EH?(NF.each(r,function(e,t){t in i?i[t]+=e:(t in a||(a[t]=0),a[t]+=e)},this),this._pop_from_people_queue(uH,r)):n===SH?(NF.each(r,function(e,t){NF.isArray(e)&&(t in c||(c[t]=[]),NF.each(e,function(e){NF.include(c[t],e)||c[t].push(e)}))}),this._pop_from_people_queue(uH,r)):n===kH?(l.push(r),this._pop_from_people_queue(hH,r)):n===xH&&(u.push(r),this._pop_from_people_queue(uH,r)),LF.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),LF.log(t),this.save()},OH.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];NF.isUndefined(n)||NF.each(t,function(t,r){e===hH||e===pH?NF.each(n,function(e){e[r]===t&&delete e[r]}):delete n[r]},this)},OH.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},OH.prototype._get_queue_key=function(e){return e===cH?vH:e===lH?wH:e===uH?_H:e===dH?EH:e===hH?xH:e===pH?kH:e===fH?SH:void LF.error("Invalid queue:",e)},OH.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=NF.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},OH.prototype.set_event_timer=function(e,t){var n=this.load_prop(AH)||{};n[e]=t,this.props[AH]=n,this.save()},OH.prototype.remove_event_timer=function(e){var t=(this.load_prop(AH)||{})[e];return NF.isUndefined(t)||(delete this.props[AH][e],this.save()),t};var MH,TH=function(e,t){throw new Error(e+" not available in this build.")},RH="mixpanel",NH="base64",LH="$device:",BH=cO.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,jH=!BH&&-1===IF.indexOf("MSIE")&&-1===IF.indexOf("Mozilla"),DH=null;xF.sendBeacon&&(DH=function(){return xF.sendBeacon.apply(xF,arguments)});var UH={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},$H={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:UH,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:NH,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:XF,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:XF,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_console:!0,record_heatmap_data:!1,record_idle_timeout_ms:18e5,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:pF,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},FH=!1,zH=function(){},qH=function(e,t,n){var r,i=n===RH?MH:MH[n];if(i&&0===bH)r=i;else{if(i&&!NF.isArray(i))return void LF.error("You have already initialized "+n);r=new zH}if(r._cached_groups={},r._init(e,t,n),r.people=new yH,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=NF.info.campaignParams(null),s={},a=!1;NF.each(o,function(e,t){s["initial_"+t]=e,e&&(a=!0)}),a&&r.people.set_once(s)}fF.DEBUG=fF.DEBUG||r.get_config("debug");var c=0===bH?"module":"snippet";return cO.dispatchEvent(new cO.CustomEvent("$mp_sdk_to_extension_event",{detail:{instance:r,source:c,token:e,name:n,info:NF.info}})),!NF.isUndefined(i)&&NF.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};zH.prototype.init=function(e,t,n){if(NF.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==RH){var r=qH(e,t,n);return MH[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},zH.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};"api_payload_format"in t||(t.api_host||$H.api_host).match(/\.mixpanel\.com/)&&(r.api_payload_format="json");if(this.hooks={},this.set_config(NF.extend({},$H,r,t,{name:n,token:e,callback_fn:(n===RH?n:RH+"."+n)+"._jsc"})),this._jsc=XF,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(NF.localStorage.is_supported(!0)&&BH){if(this.init_batchers(),DH&&cO.addEventListener){var i=NF.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);cO.addEventListener("pagehide",function(e){e.persisted&&i()}),cO.addEventListener("visibilitychange",function(){"hidden"===kF.visibilityState&&i()})}}else this._batch_requests=!1,LF.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),NF.each(this.get_batcher_configs(),function(e){LF.log("Clearing batch queue "+e.queue_key),NF.localStorage.remove(e.queue_key)});this.persistence=this.cookie=new OH(this.config),this.unpersisted_superprops={},this._gdpr_init();var o=NF.UUID();this.get_distinct_id()||this.register_once({distinct_id:LH+o,$device_id:o},""),this.flags=new iH({getFullApiRoute:NF.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:NF.bind(this.get_config,this),setConfigFunc:NF.bind(this.set_config,this),getPropertyFunc:NF.bind(this.get_property,this),trackingFunc:NF.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new Xq(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},zH.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))LF.log("Tab ID initialization skipped due to disable_persistence config");else if(NF.sessionStorage.is_supported())try{var e=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+e,n="mp_gen_new_tab_id_"+e;!NF.sessionStorage.get(n)&&NF.sessionStorage.get(t)||NF.sessionStorage.set(t,"$tab-"+NF.UUID()),NF.sessionStorage.set(n,"1"),this.tab_id=NF.sessionStorage.get(t),cO.addEventListener("beforeunload",function(){NF.sessionStorage.remove(n)})}catch(jHe){this.report_error("Error initializing tab id",jHe)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},zH.prototype.get_tab_id=function(){return this.tab_id||null},zH.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return LF.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new oz(rz),t=this.get_tab_id();return e.init().then(function(){return e.getAll()}).then(function(e){for(var n=0;n<e.length;n++)if(Az(e[n])||e[n].tabId===t)return!0;return!1}).catch(NF.bind(function(e){this.report_error("Error checking recording registry",e)},this))},zH.prototype._check_and_start_session_recording=uz(function(e){if(cO.MutationObserver){var t=NF.bind(function(e){var t=NF.bind(function(){this._recorder=this._recorder||new cO.__mp_recorder(this),this._recorder.resumeRecording(e)},this);NF.isUndefined(cO.__mp_recorder)?TH(this.get_config("recorder_src"),t):t()},this),n=this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent");e||n?t(!0):this._should_load_recorder().then(function(e){e&&t(!1)})}else LF.critical("Browser does not support MutationObserver; skipping session recording")}),zH.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},zH.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},zH.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},zH.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},zH.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},zH.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},zH.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+NF.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},zH.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},zH.prototype.__get_recorder=function(){return this._recorder},zH.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=NF.info.campaignParams(null);NF.each(e,function(e,t){this.unregister(t)}.bind(this))}},zH.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(kF.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(NF.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(kF.referrer)},zH.prototype._dom_loaded=function(){NF.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||NF.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},zH.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!FH)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},zH.prototype._prepare_callback=function(e,t){if(NF.isUndefined(e))return null;if(BH){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i},zH.prototype._send_request=function(e,t,n,r){var i=!0;if(jH)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;r||!NF.isFunction(n)&&"string"!=typeof n||(r=n,n=null),n=NF.extend(o,n||{}),BH||(n.method="GET");var a="POST"===n.method,c=DH&&a&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),BH||(r?t.callback=r:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),NF.extend(t,this.get_config("api_extra_query_params")),e+="?"+NF.HTTPBuildQuery(t);var u=this;if("img"in t){var d=kF.createElement("img");d.src=e,kF.body.appendChild(d)}else if(c){try{i=DH(e,s)}catch(qAe){u.report_error(qAe),i=!1}try{r&&r(i?1:0)}catch(qAe){u.report_error(qAe)}}else if(BH)try{var h=new XMLHttpRequest;h.open(n.method,e,!0);var f=this.get_config("xhr_headers");if(a&&(f["Content-Type"]="application/x-www-form-urlencoded"),NF.each(f,function(e,t){h.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==h.timeout){h.timeout=n.timeout_ms;var p=(new Date).getTime()}h.withCredentials=!0,h.onreadystatechange=function(){var e;if(4===h.readyState)if(200===h.status){if(r)if(l){var t;try{t=NF.JSONDecode(h.responseText)}catch(qAe){if(u.report_error(qAe),!n.ignore_json_errors)return;t=h.responseText}r(t)}else r(Number(h.responseText))}else if(e=h.timeout&&!h.status&&(new Date).getTime()-p>=h.timeout?"timeout":"Bad HTTP status: "+h.status+" "+h.statusText,u.report_error(e),r)if(l){var i=h.responseHeaders||{};r({status:0,httpStatusCode:h.status,error:e,retryAfter:i["Retry-After"]})}else r(0)},h.send(s)}catch(qAe){u.report_error(qAe),i=!1}else{var m=kF.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var g=kF.getElementsByTagName("script")[0];g.parentNode.insertBefore(m,g)}return i},zH.prototype._execute_array=function(e){var t,n=[],r=[],i=[];NF.each(e,function(e){e&&(t=e[0],NF.isArray(t)?i.push(e):"function"==typeof e?e.call(this):NF.isArray(e)&&"alias"===t?n.push(e):NF.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?i.push(e):r.push(e))},this);var o=function(e,t){NF.each(e,function(e){if(NF.isArray(e[0])){var n=t;NF.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(r,this),o(i,this)},zH.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},zH.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token");return this._batcher_configs=this._batcher_configs||{events:{type:"events",api_name:"track",queue_key:e+"_ev"},people:{type:"people",api_name:"engage",queue_key:e+"_pp"},groups:{type:"groups",api_name:"groups",queue_key:e+"_gr"}},this._batcher_configs},zH.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=NF.bind(function(e){return new Iz(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:NF.bind(function(t,n,r){var i=this.get_config("api_routes");this._send_request(this.get_api_host(e.api_name)+"/"+i[e.api_name],this._encode_data_for_request(t),n,this._prepare_callback(r,t))},this),beforeSendHook:NF.bind(function(t){var n=this._run_hook("before_send_"+e.type,t);return n?n[0]:null},this),stopAllBatchingFunc:NF.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},zH.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,NF.each(this.request_batchers,function(e){e.start()}))},zH.prototype.stop_batch_senders=function(){this._batch_requests=!1,NF.each(this.request_batchers,function(e){e.stop(),e.clear()})},zH.prototype.push=function(e){this._execute_array([e])},zH.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},zH.prototype._encode_data_for_request=function(e){var t=ez(e);return this.get_config("api_payload_format")===NH&&(t=NF.base64Encode(t)),{data:t}},zH.prototype._track_or_batch=function(e,t){var n=NF.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||XF;var a=!0,c=NF.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n))&&(n=n[0]),n?(LF.log("MIXPANEL REQUEST:"),LF.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n).then(function(e){e?t(1,n):c()}):a=c(),a&&n},zH.prototype.track=uz(function(e,t,n,r){var i;if(!n||!n.skip_hooks){if(null===(i=this._run_hook("before_track",e,t)))return;e=i[0],t=i[1]}r||"function"!=typeof n||(r=n,n=null);var o=(n=n||{}).transport;o&&(n.transport=o);var s=n.send_immediately;if("function"!=typeof r&&(r=XF),NF.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=NF.extend({},t)).token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!NF.isUndefined(a)){var c=(new Date).getTime()-a;t.$duration=parseFloat((c/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?NF.info.marketingParams():{};t=NF.extend({},NF.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var u=this.get_config("property_blacklist");NF.isArray(u)?NF.each(u,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+u);var d={event:e,properties:t};return i=this._track_or_batch({type:"events",data:d,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:n},r)}r(0)}}),zH.prototype.set_group=uz(function(e,t,n){NF.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),zH.prototype.add_group=uz(function(e,t,n){var r=this.get_property(e),i={};return void 0===r?(i[e]=[t],this.register(i)):-1===r.indexOf(t)&&(r.push(t),i[e]=r,this.register(i)),this.people.union(e,t,n)}),zH.prototype.remove_group=uz(function(e,t,n){var r=this.get_property(e);if(void 0!==r){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)}),zH.prototype.track_with_groups=uz(function(e,t,n,r){var i=NF.extend({},t||{});return NF.each(n,function(e,t){null!=e&&(i[t]=e)}),this.track(e,i,r)}),zH.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},zH.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},zH.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return void 0!==r&&r._group_key===e&&r._group_id===t||((r=new gH)._init(this,e,t),this._cached_groups[n]=r),r},zH.prototype.track_pageview=uz(function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",r=NF.extend(NF.info.mpPageViewProperties(),NF.info.campaignParams(),NF.info.clickParams()),i=NF.extend({},r,e);return this.track(n,i)}),zH.prototype.track_links=function(){return this._track_dom.call(this,sH,arguments)},zH.prototype.track_forms=function(){return this._track_dom.call(this,aH,arguments)},zH.prototype.time_event=function(e){NF.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var HH={persistent:!0},WH=function(e){var t;return t=NF.isObject(e)?e:NF.isUndefined(e)?{}:{days:e},NF.extend({},HH,t)};zH.prototype.register=function(e,t){var n=this._run_hook("before_register",e,t);if(null!==n){e=n[0],t=n[1];var r=WH(t);r.persistent?this.persistence.register(e,r.days):NF.extend(this.unpersisted_superprops,e)}},zH.prototype.register_once=function(e,t,n){var r=this._run_hook("before_register_once",e,t,n);if(null!==r){e=r[0],t=r[1],n=r[2];var i=WH(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),NF.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))}},zH.prototype.unregister=function(e,t){var n=this._run_hook("before_unregister",e,t);null!==n&&(e=n[0],t=n[1],(t=WH(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e])},zH.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},zH.prototype.identify=function(e,t,n,r,i,o,s,a){var c=this._run_hook("before_identify",e);if(null===c)return-1;e=c[0];var l=this.get_distinct_id();if(e&&l!==e){if("string"==typeof e&&0===e.indexOf(LH))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==l&&e!==this.get_property(IH)&&(this.unregister(IH),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,a),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()},zH.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=NF.UUID();this.register_once({distinct_id:LH+e,$device_id:e},""),this._check_and_start_session_recording()},zH.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},zH.prototype.alias=function(e,t){if(e===this.get_property(CH))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return NF.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(IH,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},zH.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},zH.prototype.set_config=function(e){NF.isObject(e)&&(NF.extend(this.config,e),e.batch_size&&NF.each(this.request_batchers,function(e){e.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),fF.DEBUG=fF.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init(),NF.isObject(e.hooks)&&(this.hooks={},NF.each(e.hooks,function(e,t){if(NF.isFunction(e))this.hooks[t]=[e];else if(NF.isArray(e)){this.hooks[t]=[];for(var n=0;n<e.length;n++)NF.isFunction(e[n])||LF.critical("Invalid hook added. Hook is not a function"),this.hooks[t].push(e[n])}else LF.critical("Invalid hooks added. Ensure that the hook values passed into config.hooks are functions or arrays of functions.")},this)))},zH.prototype.get_config=function(e){return this.config[e]},zH.prototype._run_hook=function(e){var t=vF.call(arguments,1);return NF.each(this.hooks[e],function(n){if(null===t)return null;var r=n.apply(this,t);void 0===r?(this.report_error(e+" hook did not return a valid value"),t=null):(NF.isArray(r)||(r=[r]),t.splice.apply(t,[0,r.length].concat(r)))},this),t},zH.prototype.get_property=function(e){return this.persistence.load_prop([e])},zH.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")},zH.prototype.toString=function(){var e=this.get_config("name");return e!==RH&&(e=RH+"."+e),e},zH.prototype._event_is_disabled=function(e){return NF.isBlockedUA(IF)||this._flags.disable_all_events||NF.include(this.__disabled_events,e)},zH.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&NF.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!NF.cookie.get("mp_optout")||(NF.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},zH.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},zH.prototype._gdpr_call_func=function(e,t){return t=NF.extend({track:NF.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),NF.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},zH.prototype.opt_in_tracking=function(e){e=NF.extend({enable_persistence:!0},e),this._gdpr_call_func(sz,e),this._gdpr_update_persistence(e)},zH.prototype.opt_out_tracking=function(e){(e=NF.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(az,e),this._gdpr_update_persistence(e)},zH.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(cz,e)},zH.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(lz,e)},zH.prototype.clear_opt_in_out_tracking=function(e){e=NF.extend({enable_persistence:!0},e),this._gdpr_call_func(fz,e),this._gdpr_update_persistence(e)},zH.prototype.report_error=function(e,t){LF.error.apply(LF.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){LF.error(n)}},zH.prototype.add_hook=function(e,t){this.hooks[e]||(this.hooks[e]=[]),this.hooks[e].push(t)},zH.prototype.remove_hook=function(e,t){var n;this.hooks[e]&&(-1!==(n=this.hooks[e].indexOf(t))?this.hooks[e].splice(n,1):LF.log("remove_hook failed. Matching hook was not found"))},zH.prototype.init=zH.prototype.init,zH.prototype.reset=zH.prototype.reset,zH.prototype.disable=zH.prototype.disable,zH.prototype.time_event=zH.prototype.time_event,zH.prototype.track=zH.prototype.track,zH.prototype.track_links=zH.prototype.track_links,zH.prototype.track_forms=zH.prototype.track_forms,zH.prototype.track_pageview=zH.prototype.track_pageview,zH.prototype.register=zH.prototype.register,zH.prototype.register_once=zH.prototype.register_once,zH.prototype.unregister=zH.prototype.unregister,zH.prototype.identify=zH.prototype.identify,zH.prototype.alias=zH.prototype.alias,zH.prototype.name_tag=zH.prototype.name_tag,zH.prototype.set_config=zH.prototype.set_config,zH.prototype.get_config=zH.prototype.get_config,zH.prototype.get_api_host=zH.prototype.get_api_host,zH.prototype.get_property=zH.prototype.get_property,zH.prototype.get_distinct_id=zH.prototype.get_distinct_id,zH.prototype.toString=zH.prototype.toString,zH.prototype.opt_out_tracking=zH.prototype.opt_out_tracking,zH.prototype.opt_in_tracking=zH.prototype.opt_in_tracking,zH.prototype.has_opted_out_tracking=zH.prototype.has_opted_out_tracking,zH.prototype.has_opted_in_tracking=zH.prototype.has_opted_in_tracking,zH.prototype.clear_opt_in_out_tracking=zH.prototype.clear_opt_in_out_tracking,zH.prototype.get_group=zH.prototype.get_group,zH.prototype.set_group=zH.prototype.set_group,zH.prototype.add_group=zH.prototype.add_group,zH.prototype.remove_group=zH.prototype.remove_group,zH.prototype.add_hook=zH.prototype.add_hook,zH.prototype.remove_hook=zH.prototype.remove_hook,zH.prototype.track_with_groups=zH.prototype.track_with_groups,zH.prototype.start_batch_senders=zH.prototype.start_batch_senders,zH.prototype.stop_batch_senders=zH.prototype.stop_batch_senders,zH.prototype.start_session_recording=zH.prototype.start_session_recording,zH.prototype.stop_session_recording=zH.prototype.stop_session_recording,zH.prototype.pause_session_recording=zH.prototype.pause_session_recording,zH.prototype.resume_session_recording=zH.prototype.resume_session_recording,zH.prototype.get_session_recording_properties=zH.prototype.get_session_recording_properties,zH.prototype.get_session_replay_url=zH.prototype.get_session_replay_url,zH.prototype.get_tab_id=zH.prototype.get_tab_id,zH.prototype.DEFAULT_API_ROUTES=UH,zH.prototype.__get_recorder=zH.prototype.__get_recorder,OH.prototype.properties=OH.prototype.properties,OH.prototype.update_search_keyword=OH.prototype.update_search_keyword,OH.prototype.update_referrer_info=OH.prototype.update_referrer_info,OH.prototype.get_cross_subdomain=OH.prototype.get_cross_subdomain,OH.prototype.clear=OH.prototype.clear;var KH={},VH=function(){MH.init=function(e,t,n){if(n)return MH[n]||(MH[n]=KH[n]=qH(e,t,n),MH[n]._loaded()),MH[n];var r=MH;KH[RH]?r=KH[RH]:e&&((r=qH(e,t,RH))._loaded(),KH[RH]=r),MH=r,1===bH&&(cO[RH]=MH),NF.each(KH,function(e,t){t!==RH&&(MH[t]=e)}),MH._=NF}};var GH=(TH=function(e,t){t()},bH=0,MH=new zH,VH(),MH.init(),function(){function e(){e.done||(e.done=!0,FH=!0,jH=!1,NF.each(KH,function(e){e._dom_loaded()}))}if(kF.addEventListener)"complete"===kF.readyState?e():kF.addEventListener("DOMContentLoaded",e,!1);else if(kF.attachEvent){kF.attachEvent("onreadystatechange",e);var t=!1;try{t=null===cO.frameElement}catch(qAe){}kF.documentElement.doScroll&&t&&function t(){try{kF.documentElement.doScroll("left")}catch(qAe){return void setTimeout(t,1)}e()}()}NF.register_event(cO,"load",e,!0)}(),MH);let ZH=!1;const YH=()=>{ZH||(GH.init("c9fdb235976ef567b15bcb07bad264f3",{debug:!1,track_pageview:!1,persistence:"localStorage"}),ZH=!0)},JH={init:()=>{YH()},track:(e,t={})=>{ZH||YH(),GH.track(e,{source:"coinley-sdk",...t,timestamp:(new Date).toISOString()})},trackModalOpened:(e,t)=>{JH.track("SDK Modal Opened",{merchant_name:e,amount:t})},trackModalClosed:(e="user_closed")=>{JH.track("SDK Modal Closed",{reason:e})},trackNetworkSelected:(e,t)=>{JH.track("Network Selected",{network:e,merchant_name:t})},trackTokenSelected:(e,t,n)=>{JH.track("Token Selected",{token:e,network:t,merchant_name:n})},trackWalletConnectStarted:e=>{JH.track("Wallet Connect Started",{wallet_type:e})},trackWalletConnected:(e,t,n)=>{JH.track("Wallet Connected",{wallet_type:e,wallet_address:(null==t?void 0:t.slice(0,10))+"...",network:n})},trackWalletConnectionFailed:(e,t)=>{JH.track("Wallet Connection Failed",{wallet_type:e,error:(null==t?void 0:t.message)||t})},trackWalletDisconnected:()=>{JH.track("Wallet Disconnected")},trackPaymentCreated:(e,t,n,r)=>{JH.track("Payment Created",{payment_id:e,amount:t,network:n,token:r})},trackPaymentApprovalStarted:(e,t)=>{JH.track("Payment Approval Started",{payment_id:e,amount:t})},trackPaymentApproved:(e,t)=>{JH.track("Payment Approved",{payment_id:e,amount:t})},trackPaymentExecutionStarted:(e,t)=>{JH.track("Payment Execution Started",{payment_id:e,amount:t})},trackPaymentSuccess:(e,t,n,r,i)=>{JH.track("Payment Success",{payment_id:e,amount:t,network:n,token:r,transaction_hash:i})},trackPaymentFailed:(e,t,n,r,i)=>{JH.track("Payment Failed",{payment_id:e,amount:t,network:n,token:r,error:(null==i?void 0:i.message)||i})},trackPaymentCancelled:(e,t)=>{JH.track("Payment Cancelled",{payment_id:e,stage:t})},trackError:(e,t,n={})=>{JH.track("SDK Error",{error_type:e,error_message:t,...n})},trackNetworkSwitchRequested:(e,t)=>{JH.track("Network Switch Requested",{from_network:e,to_network:t})},trackNetworkSwitchSuccess:e=>{JH.track("Network Switch Success",{network:e})},trackNetworkSwitchFailed:(e,t)=>{JH.track("Network Switch Failed",{network:e,error:(null==t?void 0:t.message)||t})}};let QH=!1;const XH=(e,t)=>{"undefined"!=typeof window&&window.clarity&&window.clarity("set",e,t)},eW=e=>((e="v0r7eqoiy1")=>{QH||"undefined"==typeof window||(function(e,t,n,r,i,o,s){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},(o=t.createElement(r)).async=1,o.src="https://www.clarity.ms/tag/"+i,(s=t.getElementsByTagName(r)[0]).parentNode.insertBefore(o,s)}(window,document,"clarity","script",e),QH=!0)})(e),tW=(e,t)=>{XH("event","modal_opened"),XH("merchant",e||"unknown"),XH("amount",String(t||0))},nW=e=>{XH("event","modal_closed"),XH("close_reason",e||"unknown")},rW=(e,t)=>{XH("event","network_selected"),XH("network",e||"unknown")},iW=(e,t,n)=>{XH("event","token_selected"),XH("token",e||"unknown"),XH("network",t||"unknown")},oW=(e,t,n,r)=>{XH("event","payment_created"),XH("payment_id",e||"unknown"),XH("network",n||"unknown"),XH("token",r||"unknown")},sW=(e,t,n,r,i)=>{XH("event","payment_success"),XH("payment_id",e||"unknown"),XH("network",n||"unknown"),XH("token",r||"unknown")},aW=(e,t,n,r,i)=>{XH("event","payment_failed"),XH("payment_id",e||"unknown"),XH("error",String(i||"unknown").substring(0,100))},cW=(e,t,n)=>{XH("event","error"),XH("error_type",e||"unknown"),XH("error_message",String(t||"").substring(0,100))},lW={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};function uW(e,t){return function(e){return"deposit"===e.type||void 0!==e.sourceHash}(e)?function(e){!function(e){const{from:t,to:n}=e;if(t&&!Vm(t))throw new cp({address:t});if(n&&!Vm(n))throw new cp({address:n})}(e);const{sourceHash:t,data:n,from:r,gas:i,isSystemTx:o,mint:s,to:a,value:c}=e,l=[t,r,a??"0x",s?kp(s):"0x",c?kp(c):"0x",i?kp(i):"0x",o?"0x1":"0x",n??"0x"];return dg(["0x7e",W_(l)])}(e):vx(e,t)}const dW={blockTime:2e3,contracts:lW,formatters:{block:oE({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;const t=nE(e);return"0x7e"===t.typeHex&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?wp(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}),stateRoot:e.stateRoot}}}),transaction:rE({format(e){const t={};return"0x7e"===e.type&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?wp(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Nx({format:e=>({l1GasPrice:e.l1GasPrice?wp(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?wp(e.l1GasUsed):null,l1Fee:e.l1Fee?wp(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null})})},serializers:{transaction:uW}},hW=Mx({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),fW=Mx({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),pW=1,mW=Mx({...dW,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...dW.contracts,disputeGameFactory:{[pW]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[pW]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[pW]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[pW]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:1}),gW=Mx({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}}),yW={estimateFeesPerGas:async e=>{var t;if(!(null==(t=e.request)?void 0:t.feeCurrency))return null;const[n,r]=await Promise.all([bW(e.client,e.request.feeCurrency),vW(e.client,e.request.feeCurrency)]);return{maxFeePerGas:e.multiply(n-r)+r,maxPriorityFeePerGas:r}}};async function bW(e,t){const n=await e.request({method:"eth_gasPrice",params:[t]});return BigInt(n)}async function vW(e,t){const n=await e.request({method:"eth_maxPriorityFeePerGas",params:[t]});return BigInt(n)}function wW(e){return 0===e||0n===e||null==e||"0"===e||""===e||"string"==typeof e&&("0x"===bp(e).toLowerCase()||"0x00"===bp(e).toLowerCase())}function _W(e){return!wW(e)}function EW(e){return"cip64"===e.type||function(e){return void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas}(e)&&_W(e.feeCurrency)}const xW={transaction:function(e,t){return EW(e)?function(e,t){!function(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o,feeCurrency:s}=e;if(t<=0)throw new By({chainId:t});if(o&&!Vm(o))throw new cp({address:o});if(r)throw new Lf("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(_W(i)&&i>kW)throw new Ww({maxFeePerGas:i});if(_W(n)&&_W(i)&&n>i)throw new e_({maxFeePerGas:i,maxPriorityFeePerGas:n});if(_W(s)&&!Vm(s))throw new Lf("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(wW(s))throw new Lf("`feeCurrency` must be provided for CIP-64 transactions.")}(e);const{chainId:n,gas:r,nonce:i,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,feeCurrency:u,data:d}=e,h=[kp(n),i?kp(i):"0x",c?kp(c):"0x",a?kp(a):"0x",r?kp(r):"0x",o??"0x",s?kp(s):"0x",d??"0x",bx(l),u,...wx(e,t)];return dg(["0x7b",W_(h)])}(e,t):uW(e,t)}};const kW=m_;const SW=Mx({...{blockTime:1e3,contracts:lW,formatters:{block:oE({format(e){var t;return{transactions:null==(t=e.transactions)?void 0:t.map(e=>{if("string"==typeof e)return e;return{...nE(e),...e.gatewayFee?{gatewayFee:wp(e.gatewayFee),gatewayFeeRecipient:e.gatewayFeeRecipient}:{},feeCurrency:e.feeCurrency}})}}}),transaction:rE({format(e){if("0x7e"===e.type)return{isSystemTx:e.isSystemTx,mint:e.mint?wp(e.mint):void 0,sourceHash:e.sourceHash,type:"deposit"};const t={feeCurrency:e.feeCurrency};return"0x7b"===e.type?t.type="cip64":("0x7c"===e.type&&(t.type="cip42"),t.gatewayFee=e.gatewayFee?wp(e.gatewayFee):null,t.gatewayFeeRecipient=e.gatewayFeeRecipient),t}}),transactionRequest:c_({format(e){const t={};return e.feeCurrency&&(t.feeCurrency=e.feeCurrency),EW(e)&&(t.type="0x7b"),t}})},serializers:xW,fees:yW},id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://celoscan.io",apiUrl:"https://api.celoscan.io/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),CW=Mx({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),IW=1,AW=Mx({...dW,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...dW.contracts,disputeGameFactory:{[IW]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[IW]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[IW]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[IW]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:1}),PW=Mx({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});function OW(e={}){return"3"===e.version||e.headlessMode?function(e){const t=!1;let n,r,i,o,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:OW.type,async connect({chainId:e,withCapabilities:t}={}){try{const n=await this.getProvider(),r=(await n.request({method:"eth_requestAccounts"})).map(e=>Ym(e));i||(i=this.onAccountsChanged.bind(this),n.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),n.on("chainChanged",o)),s||(s=this.onDisconnect.bind(this),n.on("disconnect",s));let a=await this.getChainId();if(e&&a!==e){const t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===Wb.code)throw e;return{id:a}});a=(null==t?void 0:t.id)??a}return{accounts:t?r.map(e=>({address:e,capabilities:{}})):r,chainId:a}}catch(cF){if(/(user closed modal|accounts received is empty|user denied account)/i.test(cF.message))throw new Wb(cF);throw cF}},async disconnect(){const e=await this.getProvider();i&&(e.removeListener("accountsChanged",i),i=void 0),o&&(e.removeListener("chainChanged",o),o=void 0),s&&(e.removeListener("disconnect",s),s=void 0),e.disconnect(),e.close()},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=await e.request({method:"eth_chainId"});return Number(t)},async getProvider(){var i;if(!r){const o=await(async()=>{const{default:e}=await Promise.resolve().then(()=>owe);return"function"!=typeof e&&"function"==typeof e.default?e.default:e})();n=new o({...e,reloadOnDisconnect:t});const s=null==(i=n.walletExtension)?void 0:i.getChainId(),c=a.chains.find(t=>e.chainId?t.id===e.chainId:t.id===s)||a.chains[0],l=e.chainId||(null==c?void 0:c.id),u=e.jsonRpcUrl||(null==c?void 0:c.rpcUrls.default.http[0]);r=n.makeWeb3Provider(u,l)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r,i,o;const s=a.chains.find(e=>e.id===t);if(!s)throw new Yb(new zC);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(s.id)}]}),s}catch(cF){if(4902===cF.code)try{let a,l;a=(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:(null==(n=s.blockExplorers)?void 0:n.default.url)?[null==(r=s.blockExplorers)?void 0:r.default.url]:[],l=(null==(i=null==e?void 0:e.rpcUrls)?void 0:i.length)?e.rpcUrls:[(null==(o=s.rpcUrls.default)?void 0:o.http[0])??""];const u={blockExplorerUrls:a,chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??s.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??s.nativeCurrency,rpcUrls:l};return await c.request({method:"wallet_addEthereumChain",params:[u]}),s}catch(l){throw new Wb(l)}throw new Yb(cF)}},onAccountsChanged(e){0===e.length?this.onDisconnect():a.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);a.emitter.emit("change",{chainId:t})},async onDisconnect(e){a.emitter.emit("disconnect");const t=await this.getProvider();i&&(t.removeListener("accountsChanged",i),i=void 0),o&&(t.removeListener("chainChanged",o),o=void 0),s&&(t.removeListener("disconnect",s),s=void 0)}})}(e):function(e){let t,n,r,i;return o=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:OW.type,async connect({chainId:e,withCapabilities:t,...o}={}){try{const s=await this.getProvider(),a=(await s.request({method:"eth_requestAccounts",params:"instantOnboarding"in o&&o.instantOnboarding?[{onboarding:"instant"}]:[]})).map(e=>Ym(e));n||(n=this.onAccountsChanged.bind(this),s.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),s.on("chainChanged",r)),i||(i=this.onDisconnect.bind(this),s.on("disconnect",i));let c=await this.getChainId();if(e&&c!==e){const t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===Wb.code)throw e;return{id:c}});c=(null==t?void 0:t.id)??c}return{accounts:t?a.map(e=>({address:e,capabilities:{}})):a,chainId:c}}catch(cF){if(/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(cF.message))throw new Wb(cF);throw cF}},async disconnect(){var e;const t=await this.getProvider();n&&(t.removeListener("accountsChanged",n),n=void 0),r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0),t.disconnect(),null==(e=t.close)||e.call(t)},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=await e.request({method:"eth_chainId"});return Number(t)},async getProvider(){if(!t){const r="string"==typeof e.preference?{options:e.preference}:{...e.preference,options:(null==(n=e.preference)?void 0:n.options)??"all"},{createCoinbaseWalletSDK:i}=await Promise.resolve().then(()=>pie),s=i({...e,appChainIds:o.chains.map(e=>e.id),preference:r});t=s.getProvider()}var n;return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r,i,s;const a=o.chains.find(e=>e.id===t);if(!a)throw new Yb(new zC);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(a.id)}]}),a}catch(cF){if(4902===cF.code)try{let o,l;o=(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:(null==(n=a.blockExplorers)?void 0:n.default.url)?[null==(r=a.blockExplorers)?void 0:r.default.url]:[],l=(null==(i=null==e?void 0:e.rpcUrls)?void 0:i.length)?e.rpcUrls:[(null==(s=a.rpcUrls.default)?void 0:s.http[0])??""];const u={blockExplorerUrls:o,chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??a.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??a.nativeCurrency,rpcUrls:l};return await c.request({method:"wallet_addEthereumChain",params:[u]}),a}catch(l){throw new Wb(l)}throw new Yb(cF)}},onAccountsChanged(e){0===e.length?this.onDisconnect():o.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);o.emitter.emit("change",{chainId:t})},async onDisconnect(e){o.emitter.emit("disconnect");const t=await this.getProvider();n&&(t.removeListener("accountsChanged",n),n=void 0),r&&(t.removeListener("chainChanged",r),r=void 0),i&&(t.removeListener("disconnect",i),i=void 0)}})}(e)}OW.type="coinbaseWallet";var MW,TW,RW={exports:{}};function NW(){if(TW)return MW;TW=1;var e=1e3,t=6e4,n=60*t,r=24*n,i=7*r,o=365.25*r;function s(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}return MW=function(a,c){c=c||{};var l=typeof a;if("string"===l&&a.length>0)return function(s){if((s=String(s)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===l&&isFinite(a))return c.long?function(i){var o=Math.abs(i);if(o>=r)return s(i,o,r,"day");if(o>=n)return s(i,o,n,"hour");if(o>=t)return s(i,o,t,"minute");if(o>=e)return s(i,o,e,"second");return i+" ms"}(a):function(i){var o=Math.abs(i);if(o>=r)return Math.round(i/r)+"d";if(o>=n)return Math.round(i/n)+"h";if(o>=t)return Math.round(i/t)+"m";if(o>=e)return Math.round(i/e)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}var LW=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,i=-1,o=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(i=r,o=n,r++):(n++,r++);else{if(-1===i)return!1;r=i+1,o++,n=o}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const r of n)"-"===r[0]?t.skips.push(r.slice(1)):t.names.push(r)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=NW(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(cF){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(cF){}!e&&void 0!==aO&&"env"in aO&&(e="");return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(cF){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=LW(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(cF){return"[UnexpectedJSONParseError]: "+cF.message}}}(RW,RW.exports);var BW=RW.exports,jW={exports:{}};var DW={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var UW="object"==typeof aO&&aO.env&&aO.env.NODE_DEBUG&&/\bsemver\b/i.test(aO.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=DW,o=UW,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const h="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[h,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),u[e]=i,c[i]=t,l[i]=r,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("COERCERTLFULL",c[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(jW,jW.exports);var $W=jW.exports;const FW=Object.freeze({loose:!0}),zW=Object.freeze({});var qW=e=>e?"object"!=typeof e?FW:e:zW;const HW=/^[0-9]+$/,WW=(e,t)=>{if("number"==typeof e&&"number"==typeof t)return e===t?0:e<t?-1:1;const n=HW.test(e),r=HW.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var KW={compareIdentifiers:WW,rcompareIdentifiers:(e,t)=>WW(t,e)};const VW=UW,{MAX_LENGTH:GW,MAX_SAFE_INTEGER:ZW}=DW,{safeRe:YW,t:JW}=$W,QW=qW,{compareIdentifiers:XW}=KW;var eK=class e{constructor(t,n){if(n=QW(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>GW)throw new TypeError(`version is longer than ${GW} characters`);VW("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?YW[JW.LOOSE]:YW[JW.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ZW||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ZW||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ZW||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<ZW)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(VW("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(VW("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return XW(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(VW("build compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return XW(e,r)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?YW[JW.PRERELEASELOOSE]:YW[JW.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===XW(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const tK=eK;const nK=(e,t,n=!1)=>{if(e instanceof tK)return e;try{return new tK(e,t)}catch(r){if(!n)return null;throw r}};var rK=(e,t)=>{const n=nK(e,t);return n?n.version:null};const iK=eK;var oK=(e,t,n)=>new iK(e,n).compare(new iK(t,n));const sK=oK;var aK=(e,t,n)=>sK(e,t,n)>0;const cK=oK;var lK=(e,t,n)=>cK(e,t,n)<0;const uK=oK;var dK=(e,t,n)=>0===uK(e,t,n);const hK=oK;var fK=(e,t,n)=>0!==hK(e,t,n);const pK=oK;var mK=(e,t,n)=>pK(e,t,n)>=0;const gK=oK;var yK=(e,t,n)=>gK(e,t,n)<=0;const bK=dK,vK=fK,wK=aK,_K=mK,EK=lK,xK=yK;var kK=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return bK(e,n,r);case"!=":return vK(e,n,r);case">":return wK(e,n,r);case">=":return _K(e,n,r);case"<":return EK(e,n,r);case"<=":return xK(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const{safeRe:SK,t:CK}=$W;var IK,AK,PK,OK,MK=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}};function TK(){if(AK)return IK;AK=1;const e=/\s+/g;class t{constructor(n,o){if(o=r(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!p(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&m(t[0])){this.set=[t];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,I(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),o("caret trim",e);let g=e.split(" ").map(e=>y(e,this.options)).join(" ").split(/\s+/).map(e=>C(e,this.options));s&&(g=g.filter(e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE])))),o("range list",g);const b=new Map,v=g.map(e=>new i(e,this.options));for(const n of v){if(p(n))return[n];b.set(n.value,n)}b.size>1&&b.has("")&&b.delete("");const w=[...b.values()];return n.set(t,w),w}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>g(t,n)&&e.set.some(e=>g(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(t){return!1}for(let n=0;n<this.set.length;n++)if(A(this.set[n],e,this.options))return!0;return!1}}IK=t;const n=new MK,r=qW,i=RK(),o=UW,s=eK,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:d}=$W,{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:f}=DW,p=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},y=(e,t)=>(e=e.replace(a[c.BUILD],""),o("comp",e,t),e=_(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=x(e,t),o("xrange",e),e=S(e,t),o("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,(t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),b(n)?a="":b(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:b(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a})},_=(e,t)=>e.trim().split(/\s+/).map(e=>E(e,t)).join(" "),E=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),b(n)?c="":b(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c})},x=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,(n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const l=b(i),u=l||b(s),d=u||b(a),h=d;return"="===r&&h&&(r=""),c=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(u&&(s=0),a=0,">"===r?(r=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n})},S=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),C=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),I=e=>(t,n,r,i,o,s,a,c,l,u,d,h)=>`${n=b(r)?"":b(i)?`>=${r}.0.0${e?"-0":""}`:b(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=b(l)?"":b(u)?`<${+l+1}.0.0-0`:b(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),A=(e,t,n)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return IK}function RK(){if(OK)return PK;OK=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(n){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}PK=t;const n=qW,{safeRe:r,t:i}=$W,o=kK,s=UW,a=eK,c=TK();return PK}const NK=TK();var LK=(e,t,n)=>{try{t=new NK(t,n)}catch(r){return!1}return t.test(e)};TK(),TK(),TK(),TK();const BK=TK();var jK=(e,t)=>{try{return new BK(e,t).range||"*"}catch(n){return null}};const DK=eK,UK=RK(),{ANY:$K}=UK,FK=TK(),zK=LK,qK=aK,HK=lK,WK=yK,KK=mK;const VK=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new DK(e,r),t=new FK(t,r),n){case">":i=qK,o=WK,s=HK,a=">",c=">=";break;case"<":i=HK,o=KK,s=qK,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(zK(e,t,r))return!1;for(let l=0;l<t.set.length;++l){const n=t.set[l];let u=null,d=null;if(n.forEach(e=>{e.semver===$K&&(e=new UK(">=0.0.0")),u=u||e,d=d||e,i(e.semver,u.semver,r)?u=e:s(e.semver,d.semver,r)&&(d=e)}),u.operator===a||u.operator===c)return!1;if((!d.operator||d.operator===a)&&o(e,d.semver))return!1;if(d.operator===c&&s(e,d.semver))return!1}return!0};var GK=(e,t,n)=>VK(e,t,">",n);TK(),TK();const ZK=RK(),{ANY:YK}=ZK;new ZK(">=0.0.0-0"),new ZK(">=0.0.0");const JK=$W,QK=DW,XK=KW,eV=rK,tV=aK;RK(),TK();var nV={valid:eV,gt:tV,satisfies:LK,validRange:jK,gtr:GK,re:JK.re,src:JK.src,tokens:JK.t,SEMVER_SPEC_VERSION:QK.SEMVER_SPEC_VERSION,RELEASE_TYPES:QK.RELEASE_TYPES,compareIdentifiers:XK.compareIdentifiers,rcompareIdentifiers:XK.rcompareIdentifiers},rV=lV;lV.default=lV,lV.stable=fV,lV.stableStringify=fV;var iV="[...]",oV="[Circular]",sV=[],aV=[];function cV(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function lV(e,t,n,r){var i;void 0===r&&(r=cV()),dV(e,"",0,[],void 0,0,r);try{i=0===aV.length?JSON.stringify(e,t,n):JSON.stringify(e,mV(t),n)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==sV.length;){var o=sV.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function uV(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:e}),sV.push([r,n,t,i])):aV.push([t,n,e]):(r[n]=e,sV.push([r,n,t]))}function dV(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void uV(oV,e,t,i);if(void 0!==s.depthLimit&&o>s.depthLimit)return void uV(iV,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void uV(iV,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)dV(e[a],a,a,r,e,o,s);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];dV(e[l],l,a,r,e,o,s)}}r.pop()}}function hV(e,t){return e<t?-1:e>t?1:0}function fV(e,t,n,r){void 0===r&&(r=cV());var i,o=pV(e,"",0,[],void 0,0,r)||e;try{i=0===aV.length?JSON.stringify(o,t,n):JSON.stringify(o,mV(t),n)}catch(a){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==sV.length;){var s=sV.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function pV(e,t,n,r,i,o,s){var a;if(o+=1,"object"==typeof e&&null!==e){for(a=0;a<r.length;a++)if(r[a]===e)return void uV(oV,e,t,i);try{if("function"==typeof e.toJSON)return}catch(d){return}if(void 0!==s.depthLimit&&o>s.depthLimit)return void uV(iV,e,t,i);if(void 0!==s.edgesLimit&&n+1>s.edgesLimit)return void uV(iV,e,t,i);if(r.push(e),Array.isArray(e))for(a=0;a<e.length;a++)pV(e[a],a,a,r,e,o,s);else{var c={},l=Object.keys(e).sort(hV);for(a=0;a<l.length;a++){var u=l[a];pV(e[u],u,a,r,e,o,s),c[u]=e[u]}if(void 0===i)return c;sV.push([i,t,e]),i[t]=c}r.pop()}}function mV(e){return e=void 0!==e?e:function(e,t){return t},function(t,n){if(aV.length>0)for(var r=0;r<aV.length;r++){var i=aV[r];if(i[1]===t&&i[0]===n){n=i[2],aV.splice(r,1);break}}return e.call(this,t,n)}}function gV(e={}){let t,n,r,i,o,s,a,c;return l=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:gV.type,async setup(){const e=await this.getProvider();(null==e?void 0:e.on)&&(s||(s=this.onConnect.bind(this),e.on("connect",s)),i||(i=this.onAccountsChanged.bind(this),e.on("accountsChanged",i)))},async connect({chainId:n,isReconnecting:r,withCapabilities:l}={}){const u=await this.getProvider();a||(a=this.onDisplayUri,u.on("display_uri",a));let d=[];r&&(d=await this.getAccounts().catch(()=>[]));try{let r,h;if(!(null==d?void 0:d.length))if(e.connectAndSign||e.connectWith)e.connectAndSign?r=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(h=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),d=await this.getAccounts();else{d=(await t.connect()).map(e=>Ym(e))}let f=await this.getChainId();if(n&&f!==n){const e=await this.switchChain({chainId:n}).catch(e=>{if(e.code===Wb.code)throw e;return{id:f}});f=(null==e?void 0:e.id)??f}return a&&(u.removeListener("display_uri",a),a=void 0),r?u.emit("connectAndSign",{accounts:d,chainId:f,signResponse:r}):h&&u.emit("connectWith",{accounts:d,chainId:f,connectWithResponse:h}),s&&(u.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),u.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),u.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),u.on("disconnect",c)),{accounts:l?d.map(e=>({address:e,capabilities:{}})):d,chainId:f}}catch(jHe){const t=jHe;if(t.code===Wb.code)throw new Wb(t);if(t.code===$b.code)throw new $b(t);throw t}},async disconnect(){const e=await this.getProvider();o&&(e.removeListener("chainChanged",o),o=void 0),c&&(e.removeListener("disconnect",c),c=void 0),s||(s=this.onConnect.bind(this),e.on("connect",s)),await t.terminate()},async getAccounts(){const e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>Ym(e))},async getChainId(){const e=await this.getProvider(),t=e.getChainId()||await(null==e?void 0:e.request({method:"eth_chainId"}));return Number(t)},getProvider:async()=>(n||(r||(r=async function(){var n,r,i,o,s;const a=await(async()=>{const{default:e}=await Promise.resolve().then(()=>tDe);return"function"!=typeof e&&"function"==typeof e.default?e.default:e})(),c={};for(const e of l.chains)c[Ip(e.id)]=null==(n=GI({chain:e,transports:l.transports}))?void 0:n[0];t=new a({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:c,dappMetadata:{...e.dappMetadata,name:(null==(r=e.dappMetadata)?void 0:r.name)?null==(i=e.dappMetadata)?void 0:i.name:"wagmi",url:(null==(o=e.dappMetadata)?void 0:o.url)?null==(s=e.dappMetadata)?void 0:s.url:"undefined"!=typeof window?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const u=await t.init(),d=(null==u?void 0:u.activeProvider)?u.activeProvider:t.getProvider();if(!d)throw new vI;return d}()),n=await r),n),async isAuthorized(){try{const e=200;return!!(await xx(()=>Bx(()=>this.getAccounts(),{timeout:e}),{delay:e+1,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){var n,r;const i=await this.getProvider(),o=l.chains.find(e=>e.id===t);if(!o)throw new Yb(new zC);try{return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:Ip(t)}]}),await c(),await u(t),o}catch(jHe){const h=jHe;if(h.code===Wb.code)throw new Wb(h);if(4902===h.code||4902===(null==(r=null==(n=null==h?void 0:h.data)?void 0:n.originalError)?void 0:r.code))try{return await i.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:t,...n}=o.blockExplorers??{};return(null==e?void 0:e.blockExplorerUrls)?e.blockExplorerUrls:t?[t.url,...Object.values(n).map(e=>e.url)]:void 0})(),chainId:Ip(t),chainName:(null==e?void 0:e.chainName)??o.name,iconUrls:null==e?void 0:e.iconUrls,nativeCurrency:(null==e?void 0:e.nativeCurrency)??o.nativeCurrency,rpcUrls:(null==(s=null==e?void 0:e.rpcUrls)?void 0:s.length)?e.rpcUrls:[(null==(a=o.rpcUrls.default)?void 0:a.http[0])??""]}]}),await c(),await u(t),o}catch(d){const e=d;if(e.code===Wb.code)throw new Wb(e);throw new Yb(e)}throw new Yb(h)}var s,a;async function c(){await xx(async()=>{const e=_p(await i.request({method:"eth_chainId"}));if(e!==t)throw new Error("User rejected switch after adding network.");return e},{delay:50,retryCount:20})}async function u(e){await new Promise(t=>{const n=r=>{"chainId"in r&&r.chainId===e&&(l.emitter.off("change",n),t())};l.emitter.on("change",n),l.emitter.emit("change",{chainId:e})})}},async onAccountsChanged(e){if(0===e.length){if(!t.isExtensionActive())return;this.onDisconnect()}else if(l.emitter.listenerCount("connect")){const e=(await this.getChainId()).toString();this.onConnect({chainId:e})}else l.emitter.emit("change",{accounts:e.map(e=>Ym(e))})},onChainChanged(e){const t=Number(e);l.emitter.emit("change",{chainId:t})},async onConnect(e){const t=await this.getAccounts();if(0===t.length)return;const n=Number(e.chainId);l.emitter.emit("connect",{accounts:t,chainId:n});const r=await this.getProvider();s&&(r.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),r.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),r.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),r.on("disconnect",c))},async onDisconnect(e){const t=await this.getProvider();e&&1013===e.code&&t&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),o&&(t.removeListener("chainChanged",o),o=void 0),c&&(t.removeListener("disconnect",c),c=void 0),s||(s=this.onConnect.bind(this),t.on("connect",s)))},onDisplayUri(e){l.emitter.emit("message",{type:"display_uri",data:e})}})}function yV(e,t){let n;try{n=e()}catch(qAe){return}return{getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),i=null!=(t=n.getItem(e))?t:null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)}}gV.type="metaMask";const bV=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>bV(e)(n),catch(e){return this}}}catch(qAe){return{then(e){return this},catch:t=>bV(t)(qAe)}}},vV=(e,t)=>(n,r,i)=>{let o={storage:yV(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...e)},r,i);const u=()=>{const e=o.partialize({...r()});return l.setItem(o.name,{state:e,version:o.version})},d=i.setState;i.setState=(e,t)=>{d(e,t),u()};const h=e((...e)=>{n(...e),u()},r,i);let f;i.getInitialState=()=>h;const p=()=>{var e,t;if(!l)return;s=!1,a.forEach(e=>{var t;return e(null!=(t=r())?t:h)});const i=(null==(t=o.onRehydrateStorage)?void 0:t.call(o,null!=(e=r())?e:h))||void 0;return bV(l.getItem.bind(l))(o.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===o.version)return[!1,e.state];if(o.migrate){const t=o.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;const[i,s]=e;if(f=o.merge(s,null!=(t=r())?t:h),n(f,!0),i)return u()}).then(()=>{null==i||i(f,void 0),f=r(),s=!0,c.forEach(e=>e(f))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{o={...o,...e},e.storage&&(l=e.storage)},clearStorage:()=>{null==l||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},o.skipHydration||p(),f||h},wV=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>s,subscribe:e=>(n.add(e),()=>n.delete(e))},s=t=e(r,i,o);return o},_V=e=>e?wV(e):wV,EV=Symbol(),xV=Object.getPrototypeOf,kV=new WeakMap,SV=e=>(e=>e&&(kV.has(e)?kV.get(e):xV(e)===Object.prototype||xV(e)===Array.prototype))(e)&&e[EV]||null,CV=(e,t=!0)=>{kV.set(e,t)},IV={},AV=e=>"object"==typeof e&&null!==e,PV=new WeakMap,OV=new WeakSet,[MV]=((e=Object.is,t=(e,t)=>new Proxy(e,t),n=e=>AV(e)&&!OV.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),r=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},i=new WeakMap,o=(e,t,n=r)=>{const s=i.get(e);if((null==s?void 0:s[0])===t)return s[1];const a=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return CV(a,!0),i.set(e,[t,a]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(a,t))return;const r=Reflect.get(e,t),i={value:r,enumerable:!0,configurable:!0};if(OV.has(r))CV(r,!1);else if(r instanceof Promise)delete i.value,i.get=()=>n(r);else if(PV.has(r)){const[e,t]=PV.get(r);i.value=o(e,t(),n)}Object.defineProperty(a,t,i)}),Object.preventExtensions(a)},s=new WeakMap,a=[1,1],c=r=>{if(!AV(r))throw new Error("object required");const i=s.get(r);if(i)return i;let l=a[0];const u=new Set,d=(e,t=++a[0])=>{l!==t&&(l=t,u.forEach(n=>n(e,t)))};let h=a[1];const f=e=>(t,n)=>{const r=[...t];r[1]=[e,...r[1]],d(r,n)},p=new Map,m=e=>{var t;const n=p.get(e);n&&(p.delete(e),null==(t=n[1])||t.call(n))},g=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),y={deleteProperty(e,t){const n=Reflect.get(e,t);m(t);const r=Reflect.deleteProperty(e,t);return r&&d(["delete",[t],n]),r},set(t,r,i,o){const a=Reflect.has(t,r),l=Reflect.get(t,r,o);if(a&&(e(l,i)||s.has(i)&&e(l,s.get(i))))return!0;m(r),AV(i)&&(i=SV(i)||i);let h=i;if(i instanceof Promise)i.then(e=>{i.status="fulfilled",i.value=e,d(["resolve",[r],e])}).catch(e=>{i.status="rejected",i.reason=e,d(["reject",[r],e])});else{!PV.has(i)&&n(i)&&(h=c(i));const e=!OV.has(h)&&PV.get(h);e&&((e,t)=>{if("production"!==(IV?"production":void 0)&&p.has(e))throw new Error("prop listener already exists");if(u.size){const n=t[3](f(e));p.set(e,[t,n])}else p.set(e,[t])})(r,e)}return Reflect.set(t,r,h,o),d(["set",[r],i,l]),!0}},b=t(g,y);s.set(r,b);const v=[g,(e=++a[1])=>(h===e||u.size||(h=e,p.forEach(([t])=>{const n=t[1](e);n>l&&(l=n)})),l),o,e=>{u.add(e),1===u.size&&p.forEach(([e,t],n)=>{if("production"!==(IV?"production":void 0)&&t)throw new Error("remove already exists");const r=e[3](f(n));p.set(n,[e,r])});return()=>{u.delete(e),0===u.size&&p.forEach(([e,t],n)=>{t&&(t(),p.set(n,[e]))})}}];return PV.set(b,v),Reflect.ownKeys(r).forEach(e=>{const t=Object.getOwnPropertyDescriptor(r,e);"value"in t&&(b[e]=r[e],delete t.value,delete t.writable),Object.defineProperty(g,e,t)}),b})=>[c,PV,OV,e,t,n,r,i,o,s,a])();function TV(e={}){return MV(e)}function RV(e,t,n){const r=PV.get(e);let i;"production"===(IV?"production":void 0)||r||console.warn("Please use proxy object");const o=[],s=r[3];let a=!1;const c=s(e=>{o.push(e),i||(i=Promise.resolve().then(()=>{i=void 0,a&&t(o.splice(0))}))});return a=!0,()=>{a=!1,c()}}const NV=TV({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),LV={state:NV,subscribe:e=>RV(NV,()=>e(NV)),push(e,t){e!==NV.view&&(NV.view=e,t&&(NV.data=t),NV.history.push(e))},reset(e){NV.view=e,NV.history=[e]},replace(e){NV.history.length>1&&(NV.history[NV.history.length-1]=e,NV.view=e)},goBack(){if(NV.history.length>1){NV.history.pop();const[e]=NV.history.slice(-1);NV.view=e}},setData(e){NV.data=e}},BV={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>"undefined"!=typeof window&&Boolean(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>BV.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){const e=navigator.userAgent.toLowerCase();return BV.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,isTelegram:()=>"undefined"!=typeof window&&(Boolean(window.TelegramWebviewProxy)||Boolean(window.Telegram)||Boolean(window.TelegramWebviewProxyProto)),formatNativeUrl(e,t,n){if(BV.isHttpUrl(e))return this.formatUniversalUrl(e,t,n);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,n);return`${r}wc?uri=${encodeURIComponent(t)}`},formatUniversalUrl(e,t,n){if(!BV.isHttpUrl(e))return this.formatNativeUrl(e,t,n);let r=e;if(r.startsWith("https://t.me")){const e=Ke.from(t).toString("base64").replace(/[=]/g,"");r.endsWith("/")&&(r=r.slice(0,-1)),this.setWalletConnectDeepLink(r,n);const i=new URL(r);i.searchParams.set("startapp",e);return i.toString()}r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,n);return`${r}wc?uri=${encodeURIComponent(t)}`},wait:async e=>new Promise(t=>{setTimeout(t,e)}),openHref(e,t){const n=this.isTelegram()?"_blank":t;window.open(e,n,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(BV.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch(qAe){}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(BV.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch(qAe){}},removeWalletConnectDeepLink(){try{localStorage.removeItem(BV.WALLETCONNECT_DEEPLINK_CHOICE)}catch(qAe){}},setModalVersionInStorage(){try{"undefined"!=typeof localStorage&&localStorage.setItem(BV.WCM_VERSION,"2.7.0")}catch(qAe){}},getWalletRouterData(){var e;const t=null==(e=LV.state.data)?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},jV=TV({enabled:"undefined"!=typeof location&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),DV={state:jV,subscribe:e=>RV(jV.events,()=>e(function(e,t){const n=PV.get(e);"production"===(IV?"production":void 0)||n||console.warn("Please use proxy object");const[r,i,o]=n;return o(r,i(),t)}(jV.events[jV.events.length-1]))),initialize(){jV.enabled&&void 0!==(null==crypto?void 0:crypto.randomUUID)&&(jV.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){jV.connectedWalletId=e},click(e){if(jV.enabled){const t={type:"CLICK",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}},track(e){if(jV.enabled){const t={type:"TRACK",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}},view(e){if(jV.enabled){const t={type:"VIEW",name:e.name,userSessionId:jV.userSessionId,timestamp:Date.now(),data:e};jV.events.push(t)}}},UV=TV({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),$V={state:UV,subscribe:e=>RV(UV,()=>e(UV)),setChains(e){UV.chains=e},setWalletConnectUri(e){UV.walletConnectUri=e},setIsCustomDesktop(e){UV.isCustomDesktop=e},setIsCustomMobile(e){UV.isCustomMobile=e},setIsDataLoaded(e){UV.isDataLoaded=e},setIsUiLoaded(e){UV.isUiLoaded=e},setIsAuth(e){UV.isAuth=e}},FV=TV({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),zV={state:FV,subscribe:e=>RV(FV,()=>e(FV)),setConfig(e){var t,n;DV.initialize(),$V.setChains(e.chains),$V.setIsAuth(Boolean(e.enableAuthMode)),$V.setIsCustomMobile(Boolean(null==(t=e.mobileWallets)?void 0:t.length)),$V.setIsCustomDesktop(Boolean(null==(n=e.desktopWallets)?void 0:n.length)),BV.setModalVersionInStorage(),Object.assign(FV,e)}};var qV=Object.defineProperty,HV=Object.getOwnPropertySymbols,WV=Object.prototype.hasOwnProperty,KV=Object.prototype.propertyIsEnumerable,VV=(e,t,n)=>t in e?qV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const GV="https://explorer-api.walletconnect.com",ZV="wcm",YV="js-2.7.0";async function JV(e,t){const n=((e,t)=>{for(var n in t||(t={}))WV.call(t,n)&&VV(e,n,t[n]);if(HV)for(var n of HV(t))KV.call(t,n)&&VV(e,n,t[n]);return e})({sdkType:ZV,sdkVersion:YV},t),r=new URL(e,GV);r.searchParams.append("projectId",zV.state.projectId),Object.entries(n).forEach(([e,t])=>{t&&r.searchParams.append(e,String(t))});return(await fetch(r)).json()}const QV={getDesktopListings:async e=>JV("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>JV("/w3m/v1/getMobileListings",e),getInjectedListings:async e=>JV("/w3m/v1/getInjectedListings",e),getAllListings:async e=>JV("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${GV}/w3m/v1/getWalletImage/${e}?projectId=${zV.state.projectId}&sdkType=${ZV}&sdkVersion=${YV}`,getAssetImageUrl:e=>`${GV}/w3m/v1/getAssetImage/${e}?projectId=${zV.state.projectId}&sdkType=${ZV}&sdkVersion=${YV}`};var XV=Object.defineProperty,eG=Object.getOwnPropertySymbols,tG=Object.prototype.hasOwnProperty,nG=Object.prototype.propertyIsEnumerable,rG=(e,t,n)=>t in e?XV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const iG=BV.isMobile(),oG=TV({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),sG={state:oG,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=zV.state;if("NONE"===e||"ALL"===t&&!e)return oG.recomendedWallets;if(BV.isArray(e)){const t={recommendedIds:e.join(",")},{listings:n}=await QV.getAllListings(t),r=Object.values(n);r.sort((t,n)=>e.indexOf(t.id)-e.indexOf(n.id)),oG.recomendedWallets=r}else{const{chains:e,isAuth:n}=$V.state,r=null==e?void 0:e.join(","),i=BV.isArray(t),o={page:1,sdks:n?"auth_v1":void 0,entries:BV.RECOMMENDED_WALLET_AMOUNT,chains:r,version:2,excludedIds:i?t.join(","):void 0},{listings:s}=iG?await QV.getMobileListings(o):await QV.getDesktopListings(o);oG.recomendedWallets=Object.values(s)}return oG.recomendedWallets},async getWallets(e){const t=((e,t)=>{for(var n in t||(t={}))tG.call(t,n)&&rG(e,n,t[n]);if(eG)for(var n of eG(t))nG.call(t,n)&&rG(e,n,t[n]);return e})({},e),{explorerRecommendedWalletIds:n,explorerExcludedWalletIds:r}=zV.state,{recomendedWallets:i}=oG;if("ALL"===r)return oG.wallets;i.length?t.excludedIds=i.map(e=>e.id).join(","):BV.isArray(n)&&(t.excludedIds=n.join(",")),BV.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),$V.state.isAuth&&(t.sdks="auth_v1");const{page:o,search:s}=e,{listings:a,total:c}=iG?await QV.getMobileListings(t):await QV.getDesktopListings(t),l=Object.values(a),u=s?"search":"wallets";return oG[u]={listings:[...oG[u].listings,...l],total:c,page:null!=o?o:1},{listings:l,total:c}},getWalletImageUrl:e=>QV.getWalletImageUrl(e),getAssetImageUrl:e=>QV.getAssetImageUrl(e),resetSearch(){oG.search={listings:[],total:0,page:1}}},aG=TV({open:!1}),cG={state:aG,subscribe:e=>RV(aG,()=>e(aG)),open:async e=>new Promise(t=>{const{isUiLoaded:n,isDataLoaded:r}=$V.state;if(BV.removeWalletConnectDeepLink(),$V.setWalletConnectUri(null==e?void 0:e.uri),$V.setChains(null==e?void 0:e.chains),LV.reset("ConnectWallet"),n&&r)aG.open=!0,t();else{const e=setInterval(()=>{const n=$V.state;n.isUiLoaded&&n.isDataLoaded&&(clearInterval(e),aG.open=!0,t())},200)}}),close(){aG.open=!1}};var lG=Object.defineProperty,uG=Object.getOwnPropertySymbols,dG=Object.prototype.hasOwnProperty,hG=Object.prototype.propertyIsEnumerable,fG=(e,t,n)=>t in e?lG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const pG=TV({themeMode:"undefined"!=typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),mG={state:pG,subscribe:e=>RV(pG,()=>e(pG)),setThemeConfig(e){const{themeMode:t,themeVariables:n}=e;t&&(pG.themeMode=t),n&&(pG.themeVariables=((e,t)=>{for(var n in t||(t={}))dG.call(t,n)&&fG(e,n,t[n]);if(uG)for(var n of uG(t))hG.call(t,n)&&fG(e,n,t[n]);return e})({},n))}},gG=TV({open:!1,message:"",variant:"success"}),yG={state:gG,subscribe:e=>RV(gG,()=>e(gG)),openToast(e,t){gG.open=!0,gG.message=e,gG.variant=t},closeToast(){gG.open=!1}};class bG{constructor(e){this.openModal=cG.open,this.closeModal=cG.close,this.subscribeModal=cG.subscribe,this.setTheme=mG.setThemeConfig,mG.setThemeConfig(e),zV.setConfig(e),this.initUi()}async initUi(){if("undefined"!=typeof window){await Promise.resolve().then(()=>BHe);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),$V.setIsUiLoaded(!0)}}}const vG="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABxCAYAAAAj+QZ8AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzrSURBVHgB7V3dcRs5Em4MtXWPq41gZ1+v7mwrgh3rArAUgagITNcFYDmAK9ERSBuBfQGsxY3Aku26V/MiOO7j1nqAQwMgRQ4xQONnhqOfr8q2TA4H1HzoRqO70c1g4JhUH/dhNKqgrhfT2cEMOoQaqxidyx+P5J8F8PpYjnkNPYLBgPGq+vxSFOJM/rhvXpp39ZAkGaUk40r+WK69jKT8JMdbQE8oYKDAByTJmMItGQj10OR7zyA3itFr2CQD1NhFMYYeMVhCHA8C1co7pV4yYXL4aSz/GVvfFFBBjxguIcCeOt4szYxOhiG2/V7M+T2yY7iEMOaTgIl8mBWkoth7Cduqah2u97JjuIQIUXqvYWlSohZyUEaDE/88/M+P0BMGrLIIYFAZ/R+HTGovJ+42IRqvYxZ485kKBob7QEgZZZoWoyMgrg//+vDX/0JPuA+ESLCXEApG/kxvm0LEkK2secDVZYjFpRZzIWibSyHm0COGSwjnYWoiyOIqjujXskcJUWCBqgItLuriPipOgAombqBH7EEGTKovUvz/xIdxnc8Rx8IdiHpxn7ouCVJXGnPIBD1h9p5BIU6kS6ZkBXt//uvf365fk0SIcvJJv5LUL6Wcdvq1w09z+c9MeknfSHLmEAteX8t7B30EBHsBHkLkPSsI+h482bOs3froERAT+UdLMcPlSch91M0P0w9Pz5bXpqksRcaW6Yj/H8v3vkpyLvRuOBzGxd6F2voZwpBEyKT6XMln8dF4BCzfjW2oz2hCjAu89FxmiPkctyNmMWprdOS5J11dSQsrVgXjxJAT8lyqp2aMpTnGxv1TJCRgdyzO5Jf7Giwtgv8GwWhfH5T0hK0fUQu6UeUf8UfvxY1Jl0LIHMJQBksL5zMIhXCqpLDAFpNrYSAwymnIKEkf4PUv6/+NJsQs2BHirKTlHUVaTAw9cB1xqaQijJDACYGTzUQ5adAqcbb+UuI+RPwCcTgyodjSe6UQ/4ZAtLrLi4DYhn5Y5DVscvjlguLK3xyDvWm+lEYI5+8hHiWJFMEvIRA1/3ZgfYMV9OgfYzPKZWrxfv5JLtx8DCFQhD+5bL6cRIgSN+IXb4GXlCi1VbQEt0IWdA40yRztXaG5DaEQ/Nj2crrrpP72BtJAkJRg1bhlAZr9Cc0y1LPXK/1KTYVZbcsB3rapw2RC1AwW0WvJEktS7A8sWDWyH61jkD/ul3q1xwhVUwj0HnN+1vZ2Huei4Ghvp/qwSumxfWd7I4NqRND3TdLt43rbmO7+PYYNgj93bTazEKIG4PUppELHyM+t76WrRhoEzFw+uMk/Ph0FW1O3N3/l8+9lc7/Lgd6jboR0TF5VNyeW++eQEj8EtKpf7SmGC4i78VvpRPTuUfLGQ1A3CpHkjEOIgk2ti3zXUtJiiq6gc38DXEar+15LMkgqLishSnWhOZce9tyX68mF5f4pUjL3XmHZqC1hVGkJocBnIdcN6uXZI4ZKR2obO22Rx/VE6esG6m+n/nsLW/jX/Rnp5GuTDpP7Fb6IGzJCPMadhHCVjc1rnBVppAg4b5rCinBeHzs/x7fd9uqhuNz59TfrPY3qDA8f3JIxD/lYZzH1TKRgztXEcu8ZWiztH6vtD17wlt23w/qxH1NwI5IMNRx0iDyk2POntMUiLDpftIeOOZ9ufxd5fYv1Y6RjDCFIIAPRywkq9YuxQvp8WAkxkKS2HWdT+VgFpvWw7zG24Dv2Jq8/kv6nl3rH7L4eQ9AQQojcw4BQJ7yiJ2AvhCAMKe+CQqgrKBs+bmecAIxyAlldKUk7g0R4s070ovpdadJ8DL6TM+DPoHizEeGDyeHNmZwHYYukiDA3E0HMGUAsD4fOIAP2LF/EnKtjGAqtQG2EOCzTfDT0/+UM0jFhte8QN+rnur526U+cRXIMuZ8oLgJUWG/nM9bg3wBqFXWalO7UwEplbeYORexGN+6qSLp26Wijws7ktf4sQvQvXT0hb65ywOw92twk0oSG0+mvfhd9KBQhLUeCc2EOjsQ5EjFc/vIul0YHUBOUFR8bUrxQ/jpprXV1VFoTcvgJ3d5H0D0uncRgEvSoeCGlqzIvL1xmaddYfScFft114QIEM9LxFfrFZXKq6T0FbgzT1os4YEbjR2lx9W7KDh3M1Pf4H+wKHVgqdxmFdpknx8TjgRkb1BytBwDtyxIq6N6J1UBEKd0Z7+ARmhDj0k53l6dAiGd6F/+wsfL2rjyzPR9y3ARhk3jPseF+V6RguHF3a0rZZxmLIaLV26uca9o7W0Kf4PUP0x4Lhg0NXve78ukI8boXYnbgsxoayPEQRQz6m27dGnmRGGm7LwgOUK38OwxO4oJNFjxuDldIihiazdwzGT+p1NkLnQlOdcUsVFY75+/7cNrdFWQP4Zq0nRI0MeiW2SSIq4yQxaM0POJOoCsJ0VJSjMqtC3g9x5j8dPa35Bzg+4hkQnSlAv7MxOCpiQGIOeQowXHPEEWIJkFgXZEx5ImnPAasDOj7kJxJEHagg/PgIe/SEbS8rGYlm26Aaw5meRzDA4ZTQizF8LvHA/dlWSVEp+aMLgTryE3iwKj4y/ew22DZTmHJXFQLNkbvdpH8ADX/43d4wNiIh7yqvpyY+k47IUPi8qEv6itCMP4hivC6IlnhOR/+EKAIMalAO04y8J/hfgjQEhJQdrsb7C5ddGjQi7oOPMFuICXjkYwVstTtjYKOEGJQarY6FKR8YsvSSgx37rOHpsZM9vvNNKqgfRxWKf2mqDCOW0G7ZTedfnjyCnYAU8zyRE6Mt31NDL2GpFWGo0IdLcA2dMCLmar8o01sXL9cZvaktSBN1xjt4bgTU4P4nFATOBnLzMWZ/YhxFqwRIc1q9FchEWFV2CZ9PIwtbJapnaiM/Rx9rxy4zVzUJ0hPM2UuGrVUP5fqRpXSZrB3Ysqnxh0M6rmfoML2uXZdaC22MDQBVueiOV+H8Y4K/Lv2hfkjg03YSYDPmuXrjMqZQBouJbnpNbkCoc612/Zo6oDrt+Pca4s/UW4zaWEdc/zLWexL9bHdu4qrS7gFJyE4VojbBR2o1IfpMHqyt4LtrHBABwdJrYTcdmhQ43iDXJbrvQ+05QDoGvLtpTqpddLNqV7xe8s46x0arMVqNrB1vf+w0KoOWGtYgJ3nWleyE2LUlK2NRRpsprmNdKHWvrbvZkvCsBZLa0JLkcsSxRLq6aTklxAsZ5RnzbiFpUa6+eXLrWtdSeGjkf29tmJpDZgKRI66kumkZCUkqXyqC42yfqZlats47VahcL5H2vipIjjOMoOq2UBkocyMhFD7ykahGSfRRcVaH177oR9nf13/+rMEVp9zF/scx5KST0K0Ps+PRh3dqKJiZLCXJCmhFfscx6ivLIS06vMcEFbp6Ar7VCkxxT49ZzLD15RkQjz6PA1aOmabY/mlo713LaV7KE1KEF2Qki4hHn2eBNEoX95Pu+39EL8ZlRRbtW4bkggxMzbOWeiFtZhl5f+YY7FVmfeUodkLCACFFFOt27sdSO1jWEEX0oH7jkb9QrNPKP0fdvaunQMFuh9iBQEgkLJP8QqkEcI6OOjfVprbsQPfgLt3Ldn5qI7pBSKAlNZJnEZI7h25uidvO/xJU428fdNmnI5zICEupL1GSpvqbO2Tgkjt9JlXXalSftsHQI36II7lXSeorvL92OjgihSA99YLVJ8Uu+XVU6dPAlx1FQty//OFNzbBxW9ARYTaWgKlUYYLjtsdkuLMRng8IUWLoy4UusL0gbPIJSt+Btq9CA87oPuzYLRxHdDGSUudep1EsYF4QqgmpAuqYICq3tD6kIL619JapdIJoXWf9kJ5iTHJo7nYW0pSpaislLDlQkXZrp74S2mMlGlNA6FVqmlb4b1uDVkMl7XFvlFpadMzkNILN/QX0xDq5O0BOeRJlY6QVqkhXaiLIgshCCRlevV0DJvZPUjGaow0sxe73VDThjQRz0lSsQ7q+hEyOYKaDjN6u1Yi5GJ/KScFtoc9bVqWGc6pOytTL1Lrmci4AlZM9etxDseU7pzB98WGXldPD6AnJCdbm9k+lsScgSpEY2qb6JomQR0Umghqlwr1DEKAXagpnoY+6oStIVv2uyFmDnlB1d/hR+GwCzUbUVw/+6E5XynotOVROogLKrWz8yZQgkkP2ZwM7gXDJoTSkJ7Y2bkJPeNpxT5r/sdP0BMGLiHMX6FUQHy7V+oxjFxeCcpQMGQwRljQ48+29NZfNwADlxAvLpOzz/vqQk3E3SYkw7n2oUnJsAkRwmEFiXzn/gYkJQOXEGFP51Eue07zhREwJCkZupVldxYWLH/VB1cXat5fdaJhE8JriwUl3nTRrk4T3Bbdq1NCDUEYNCFm87Z8SAtzUukMOoK94bHo7Yw6orMjbTmxDOD05U/SBz2l2wab3ncgjS78H0eagrHjdQciAAAAAElFTkSuQmCC",wG=Mx({id:143,name:"Monad",nativeCurrency:{name:"Monad",symbol:"MON",decimals:18},rpcUrls:{default:{http:["https://monad-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp"]}},blockExplorers:{default:{name:"Monad Explorer",url:"https://monadvision.com"}}}),_G="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",EG="qtIcCe_-8t4rIWktnWJm0";let xG=null;const kG=()=>{const e=(xG||"undefined"==typeof window||(xG=new bG({projectId:"1d05a3403626aae7674102b52350de60",themeMode:"light",themeVariables:{"--wcm-accent-color":"#7042D2","--wcm-background-color":"#ffffff"},explorerRecommendedWalletIds:["c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96","4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0","1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369"]})),xG);e&&e.closeModal()},SG=function(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=FI({storage:qI()}),syncConnectedChain:r=!0,ssr:i=!1,...o}=e,s="undefined"!=typeof window&&t?CI():void 0,a=TI(()=>o.chains),c=TI(()=>{const e=[],t=new Set;for(const n of o.connectors??[]){const r=l(n);if(e.push(r),!i&&r.rdns){const e="string"==typeof r.rdns?[r.rdns]:r.rdns;for(const n of e)t.add(n)}}if(!i&&s){const n=s.getProviders();for(const r of n)t.has(r.info.rdns)||e.push(l(u(r)))}return e});function l(e){var t;const r=(i=function(e=11){if(!HI||WI+e>512){HI="",WI=0;for(let e=0;e<256;e++)HI+=(256+256*Math.random()|0).toString(16).substring(1)}return HI.substring(WI,WI+++e)}(),new BI(i));var i;const s={...e({emitter:r,chains:a.getState(),storage:n,transports:o.transports}),emitter:r,uid:r.uid};return r.on("connect",b),null==(t=s.setup)||t.call(s),s}function u(e){const{info:t}=e,n=e.provider;return xI({target:{...t,id:t.rdns,provider:n}})}const d=new Map;function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let f;const p="0.0.0-canary-";f=jC.startsWith(p)?Number.parseInt(jC.replace(p,""),10):Number.parseInt(jC.split(".")[0]??"0",10);const m=TI(II(n?OI(h,{migrate(e,t){if(t===f)return e;const n=h(),r=g(e,n.chainId);return{...n,chainId:r}},name:"store",partialize:e=>({connections:{__type:"Map",value:Array.from(e.connections.entries()).map(([e,t])=>{const{id:n,name:r,type:i,uid:o}=t.connector,s={id:n,name:r,type:i,uid:o};return[e,{...t,connector:s}]})},chainId:e.chainId,current:e.current}),merge(e,t){"object"==typeof e&&e&&"status"in e&&delete e.status;const n=g(e,t.chainId);return{...t,...e,chainId:n}},skipHydration:i,storage:n,version:f}):h));function g(e,t){return e&&"object"==typeof e&&"chainId"in e&&"number"==typeof e.chainId&&a.getState().some(t=>t.id===e.chainId)?e.chainId:t}function y(e){m.setState(t=>{const n=t.connections.get(e.uid);return n?{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts??n.accounts,chainId:e.chainId??n.chainId,connector:n.connector})}:t})}function b(e){"connecting"!==m.getState().status&&"reconnecting"!==m.getState().status&&m.setState(t=>{const n=c.getState().find(t=>t.uid===e.uid);return n?(n.emitter.listenerCount("connect")&&n.emitter.off("connect",y),n.emitter.listenerCount("change")||n.emitter.on("change",y),n.emitter.listenerCount("disconnect")||n.emitter.on("disconnect",v),{...t,connections:new Map(t.connections).set(e.uid,{accounts:e.accounts,chainId:e.chainId,connector:n}),current:e.uid,status:"connected"}):t})}function v(e){m.setState(t=>{const n=t.connections.get(e.uid);if(n){const e=n.connector;e.emitter.listenerCount("change")&&n.connector.emitter.off("change",y),e.emitter.listenerCount("disconnect")&&n.connector.emitter.off("disconnect",v),e.emitter.listenerCount("connect")||n.connector.emitter.on("connect",b)}if(t.connections.delete(e.uid),0===t.connections.size)return{...t,connections:new Map,current:null,status:"disconnected"};const r=t.connections.values().next().value;return{...t,connections:new Map(t.connections),current:r.connector.uid}})}return m.setState(h()),r&&m.subscribe(({connections:e,current:t})=>{var n;return t?null==(n=e.get(t))?void 0:n.chainId:void 0},e=>{if(a.getState().some(t=>t.id===e))return m.setState(t=>({...t,chainId:e??t.chainId}))}),null==s||s.subscribe(e=>{const t=new Set,r=new Set;for(const n of c.getState())if(t.add(n.id),n.rdns){const e="string"==typeof n.rdns?[n.rdns]:n.rdns;for(const t of e)r.add(t)}const i=[];for(const n of e){if(r.has(n.info.rdns))continue;const e=l(u(n));t.has(e.id)||i.push(e)}n&&!m.persist.hasHydrated()||c.setState(e=>[...e,...i],!0)}),{get chains(){return a.getState()},get connectors(){return c.getState()},storage:n,getClient:function(e={}){const t=e.chainId??m.getState().chainId,n=a.getState().find(e=>e.id===t);if(e.chainId&&!n)throw new zC;{const e=d.get(m.getState().chainId);if(e&&!n)return e;if(!n)throw new zC}{const e=d.get(t);if(e)return e}let r;if(o.client)r=o.client({chain:n});else{const e=n.id,t=a.getState().map(e=>e.id),i={},s=Object.entries(o);for(const[n,r]of s)if("chains"!==n&&"client"!==n&&"connectors"!==n&&"transports"!==n)if("object"==typeof r)if(e in r)i[n]=r[e];else{if(t.some(e=>e in r))continue;i[n]=r}else i[n]=r;r=JC({...i,chain:n,batch:i.batch??{multicall:!0},transport:t=>o.transports[e]({...t,connectors:c})})}return d.set(t,r),r},get state(){return m.getState()},setState(e){let t;t="function"==typeof e?e(m.getState()):e;const n=h();"object"!=typeof t&&(t=n);Object.keys(n).some(e=>!(e in t))&&(t=n),m.setState(t,!0)},subscribe:(e,t,n)=>m.subscribe(e,t,n?{...n,fireImmediately:n.emitImmediately}:void 0),_internal:{mipd:s,async revalidate(){const e=m.getState(),t=e.connections;let n=e.current;for(const[,r]of t){const e=r.connector;!!e.isAuthorized&&await e.isAuthorized()||(t.delete(e.uid),n===e.uid&&(n=null))}m.setState(e=>({...e,connections:t,current:n}))},store:m,ssr:Boolean(i),syncConnectedChain:r,transports:o.transports,chains:{setState(e){const t="function"==typeof e?e(a.getState()):e;if(0!==t.length)return a.setState(t,!0)},subscribe:e=>a.subscribe(e)},connectors:{providerDetailToConnector:u,setup:l,setState:e=>c.setState("function"==typeof e?e(c.getState()):e,!0),subscribe:e=>c.subscribe(e)},events:{change:y,connect:b,disconnect:v}}}}({chains:[CW,gW,PW,hW,AW,fW,SW,mW,wG],connectors:[xI(),gV({dappMetadata:{name:"Coinley Payment",icon:vG}}),OW({appName:"Coinley Payment",appLogoUrl:vG})],transports:{[CW.id]:VI([aI(`https://eth-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://eth-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://cloudflare-eth.com",{timeout:1e4,retryCount:1}),aI("https://eth.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://ethereum.publicnode.com",{timeout:1e4,retryCount:1})]),[gW.id]:VI([aI(`https://bnb-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://bnb-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://bsc-dataseed.bnbchain.org",{timeout:1e4,retryCount:1}),aI("https://bsc-dataseed-public.bnbchain.org",{timeout:1e4,retryCount:1}),aI("https://bsc.nodereal.io",{timeout:1e4,retryCount:1})]),[PW.id]:VI([aI(`https://polygon-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://polygon-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://polygon.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://polygon-rpc.com",{timeout:1e4,retryCount:1}),aI("https://polygon.drpc.org",{timeout:1e4,retryCount:1})]),[hW.id]:VI([aI(`https://arb-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://arb-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://arb1.arbitrum.io/rpc",{timeout:1e4,retryCount:1}),aI("https://arbitrum.llamarpc.com",{timeout:1e4,retryCount:1})]),[AW.id]:VI([aI(`https://opt-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://opt-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://mainnet.optimism.io",{timeout:1e4,retryCount:1}),aI("https://optimism.llamarpc.com",{timeout:1e4,retryCount:1})]),[fW.id]:VI([aI(`https://avax-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://avax-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://api.avax.network/ext/bc/C/rpc",{timeout:1e4,retryCount:1}),aI("https://avalanche.public-rpc.com",{timeout:1e4,retryCount:1})]),[SW.id]:VI([aI(`https://celo-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://celo-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://forno.celo.org",{timeout:1e4,retryCount:1}),aI("https://celo.drpc.org",{timeout:1e4,retryCount:1})]),[mW.id]:VI([aI(`https://base-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1}),aI(`https://base-mainnet.g.alchemy.com/v2/${EG}`,{timeout:1e4,retryCount:1}),aI("https://mainnet.base.org",{timeout:1e4,retryCount:1}),aI("https://base.llamarpc.com",{timeout:1e4,retryCount:1}),aI("https://base.meowrpc.com",{timeout:1e4,retryCount:1})]),[wG.id]:VI([aI(`https://monad-mainnet.g.alchemy.com/v2/${_G}`,{timeout:1e4,retryCount:1})])}});class CG{constructor(e,t,n=null){this.baseURL=e.endsWith("/")?e.slice(0,-1):e,t&&t.startsWith("pk_")?(this.publicKey=t,this.apiKey=null,this.apiSecret=null):(this.publicKey=null,this.apiKey=t,this.apiSecret=n)}async request(e,t={}){const n=`${this.baseURL}${e}`,r={"Content-Type":"application/json",...t.headers};this.publicKey?r["X-Public-Key"]=this.publicKey:(r["X-API-Key"]=this.apiKey,r["X-API-Secret"]=this.apiSecret);const i=t.timeout||6e4,o=new AbortController,s=setTimeout(()=>o.abort(),i);try{const e=await fetch(n,{...t,headers:r,signal:o.signal});if(clearTimeout(s),!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error||`HTTP ${e.status}`)}return e.json()}catch(cF){if(clearTimeout(s),"AbortError"===cF.name)throw new Error(`Request timeout after ${i/1e3}s: ${e}`);throw cF}}async getNetworks(){try{return await this.request("/api/networks")}catch(cF){return{networks:[{id:"1",name:"Ethereum",shortName:"ethereum",chainId:"0x1",type:"ethereum"},{id:"56",name:"BSC",shortName:"bsc",chainId:"0x38",type:"bsc"},{id:"137",name:"Polygon",shortName:"polygon",chainId:"0x89",type:"polygon"},{id:"42161",name:"Arbitrum",shortName:"arbitrum",chainId:"0xa4b1",type:"arbitrum"},{id:"10",name:"Optimism",shortName:"optimism",chainId:"0xa",type:"optimism"},{id:"43114",name:"Avalanche",shortName:"avalanche",chainId:"0xa86a",type:"avalanche"}]}}}async getTokens(){try{return await this.request("/api/networks/stablecoins")}catch(cF){return{stablecoins:[{id:"1",name:"Tether USD",symbol:"USDT",contractAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"2",name:"USD Coin",symbol:"USDC",contractAddress:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",decimals:6,networkId:"1",Network:{shortName:"ethereum",name:"Ethereum"}},{id:"3",name:"Tether USD",symbol:"USDT",contractAddress:"0x55d398326f99059fF775485246999027B3197955",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"4",name:"USD Coin",symbol:"USDC",contractAddress:"0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",decimals:18,networkId:"56",Network:{shortName:"bsc",name:"BSC"}},{id:"5",name:"Tether USD",symbol:"USDT",contractAddress:"0xc2132D05D31c914a87c6611C10748AEb04B58e8F",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"6",name:"USD Coin",symbol:"USDC",contractAddress:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",decimals:6,networkId:"137",Network:{shortName:"polygon",name:"Polygon"}},{id:"7",name:"Tether USD",symbol:"USDT",contractAddress:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"8",name:"USD Coin",symbol:"USDC",contractAddress:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",decimals:6,networkId:"42161",Network:{shortName:"arbitrum",name:"Arbitrum"}},{id:"9",name:"Tether USD",symbol:"USDT",contractAddress:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"10",name:"USD Coin",symbol:"USDC",contractAddress:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",decimals:6,networkId:"10",Network:{shortName:"optimism",name:"Optimism"}},{id:"11",name:"Tether USD",symbol:"USDT",contractAddress:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"12",name:"USD Coin",symbol:"USDC",contractAddress:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",decimals:6,networkId:"43114",Network:{shortName:"avalanche",name:"Avalanche"}},{id:"13",name:"Tether USD",symbol:"USDT",contractAddress:"0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"14",name:"USD Coin",symbol:"USDC",contractAddress:"0xcebA9300f2b948710d2653dD7B07f33A8B32118C",decimals:6,networkId:"42220",Network:{shortName:"celo",name:"Celo"}},{id:"15",name:"Tether USD",symbol:"USDT",contractAddress:"0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}},{id:"16",name:"USD Coin",symbol:"USDC",contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",decimals:6,networkId:"8453",Network:{shortName:"base",name:"Base"}}]}}}async createPayment(e){return await this.request("/api/payments/create",{method:"POST",body:JSON.stringify(e)})}async verifyQRPayment(e){return await this.request("/api/payments/verify-qr",{method:"POST",body:JSON.stringify({paymentId:e})})}async checkPaymentStatus(e){return await this.request(`/api/payments/status/${e}`)}async getContractInfo(e){try{const t=await this.request(`/api/payments/contract/${e}`);if(!t.success)throw new Error("Contract not supported on this network");return t.contractInfo}catch(cF){throw new Error(cF.message||"Failed to get contract information")}}async processPayment(e,t,n,r){try{return await this.request("/api/payments/process",{method:"POST",body:JSON.stringify({paymentId:e,transactionHash:t,network:n,senderAddress:r}),timeout:9e4})}catch(cF){throw console.error("❌ [API] processPayment error:",cF),console.error("❌ [API] processPayment error details:",{message:cF.message,name:cF.name,stack:cF.stack}),cF}}async failPayment(e,t="Payment cancelled by user"){return await this.request("/api/payments/fail",{method:"POST",body:JSON.stringify({paymentId:e,reason:t,status:"failed"})})}async getSupportedDepositChains(){try{return await this.request("/api/deposits/supported-chains")}catch(cF){return console.warn("Failed to get supported deposit chains:",cF.message),{success:!0,chains:[{chainId:8453,name:"Base",confirmations:20},{chainId:56,name:"BSC",confirmations:20},{chainId:42161,name:"Arbitrum",confirmations:20}]}}}async createDepositPayment(e){return await this.request("/api/deposits/create",{method:"POST",body:JSON.stringify(e)})}async getDepositStatus(e){return await this.request(`/api/deposits/status/${e}`)}async getDepositBalance(e){return await this.request(`/api/deposits/balance/${e}`)}isDepositSupported(e){return[8453,56,42161,137,10,43114,143].includes(parseInt(e))}}const IG=["https://solana-mainnet.g.alchemy.com/v2/YWG990wOlIikc1tU7-WWTepfU8d1f4dp","https://solana-mainnet.g.alchemy.com/v2/qtIcCe_-8t4rIWktnWJm0","https://api.mainnet-beta.solana.com","https://solana-api.projectserum.com","https://rpc.ankr.com/solana"],AG="solana-mainnet",PG="Solana",OG={SOL:{symbol:"SOL",name:"Solana",decimals:9,isNative:!0,address:null,logo:"sol",isStablecoin:!1},USDC:{symbol:"USDC",name:"USD Coin",decimals:6,isNative:!1,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",logo:"usdc",isStablecoin:!0},USDT:{symbol:"USDT",name:"Tether USD",decimals:6,isNative:!1,address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",logo:"usdt",isStablecoin:!0},EURC:{symbol:"EURC",name:"Euro Coin",decimals:6,isNative:!1,address:"HzwqbKZw8HxMN6bF2yFZNrht3c2iXXzpKcFu7uBEDKtr",logo:"eurc",isStablecoin:!0}},MG={PHANTOM:{name:"Phantom",id:"phantom",icon:"phantom",downloadUrl:"https://phantom.app/",deepLink:"https://phantom.app/ul/browse/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa",firefox:"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/",ios:"https://apps.apple.com/us/app/phantom-solana-wallet/id1598432977",android:"https://play.google.com/store/apps/details?id=app.phantom"}},SOLFLARE:{name:"Solflare",id:"solflare",icon:"solflare",downloadUrl:"https://solflare.com/",deepLink:"https://solflare.com/ul/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",firefox:"https://addons.mozilla.org/en-US/firefox/addon/solflare-wallet/",ios:"https://apps.apple.com/us/app/solflare/id1580902717",android:"https://play.google.com/store/apps/details?id=com.solflare.mobile"}},BACKPACK:{name:"Backpack",id:"backpack",icon:"backpack",downloadUrl:"https://backpack.app/",deepLink:"https://backpack.app/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",ios:"https://apps.apple.com/us/app/backpack-crypto-wallet/id6448811949"}},TRUST_WALLET:{name:"Trust Wallet",id:"trust",icon:"trust",downloadUrl:"https://trustwallet.com/",deepLink:"https://link.trustwallet.com/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp"}},MAGIC_EDEN:{name:"Magic Eden",id:"magiceden",icon:"magiceden",downloadUrl:"https://wallet.magiceden.io/",deepLink:"https://wallet.magiceden.io/",installUrl:{chrome:"https://chrome.google.com/webstore/detail/magic-eden-wallet/mkpegjkblkkefacfnmkajcjmabijhclg",ios:"https://apps.apple.com/app/magic-eden-wallet/id6449729293",android:"https://play.google.com/store/apps/details?id=io.magiceden.wallet"}}},TG=OG,RG="evm",NG="solana",LG={ethereum:1,bsc:56,polygon:137,arbitrum:42161,optimism:10,avalanche:43114,celo:42220,base:8453,monad:143},BG=e=>"number"==typeof e?e:"string"==typeof e?e.startsWith("0x")?parseInt(e,16):parseInt(e,10):1,jG=e=>LG[e]||1,DG=e=>(e=>{var t;if(!e)return!1;const n=e.toString().toLowerCase();return["solana","solana-mainnet","103"].includes(n)||n===AG||(null==(t=PG)?void 0:t.toLowerCase())===n})(e)?NG:RG,UG=()=>{const[e,t]=Yt.useState(null),[n,r]=Yt.useState(null),[i,o]=Yt.useState(""),{connect:s,connectors:a}=qP(),{isConnected:c,address:l,chain:u}=kA(),{switchChain:d}=function(e={}){const{mutation:t}=e,n=eA(e),r=OP(n),{mutate:i,mutateAsync:o,...s}=UP({...t,...r});return{...s,chains:FP({config:n}),switchChain:i,switchChainAsync:o}}(),h=Yt.useRef(c);Yt.useEffect(()=>{r(c&&l?{account:l,chainId:null==u?void 0:u.id,walletType:e}:null)},[c,l,u,e]),Yt.useEffect(()=>{c&&!h.current&&kG(),h.current=c},[c]);return{selectedWalletType:e,connectedWallet:n,connectionError:i,isConnected:c,address:l,chain:u,connectors:a,handleWalletSelection:e=>{t(e),o("")},connectWallet:async(e,t=null)=>{var n,r,i,a;if(!e)return o("Please select a wallet first"),!1;try{o("");"walletConnect"===e.id||(null==(n=e.name)||n.toLowerCase().includes("walletconnect"));if(await s({connector:e}),t){const n=jG(t.shortName),s=(null==(r=e.name)?void 0:r.toLowerCase())||"",l=s.includes("zerion")||s.includes("trust")||s.includes("rabby")?5e3:500;await new Promise(e=>setTimeout(e,l));const u=uI(SG).chainId;if(n&&u!==n)try{await d({chainId:n}),await new Promise(e=>setTimeout(e,1e3))}catch(c){return 4001===c.code||(null==(i=c.message)?void 0:i.includes("User rejected"))?o("Network switch was cancelled by user"):(null==(a=c.message)?void 0:a.includes("Unrecognized chain ID"))?o(`${t.name} network is not added to your wallet. Please add it manually.`):o(`Failed to switch to ${t.name}. Please switch manually in your wallet.`),!1}}return!0}catch(jHe){return 4001===jHe.code||jHe.message.includes("User rejected")||jHe.message.includes("rejected")?o("User cancelled the connection request"):o(`Failed to connect to ${e.name}. Please try again.`),!1}},disconnectWallet:()=>{r(null),t(null),o("")},switchChain:d,ensureCorrectNetwork:async e=>{var t,n;if(!e)return!0;try{const i=jG(e.shortName),s=uI(SG).chainId;if(i&&s!==i)try{return await d({chainId:i}),await new Promise(e=>setTimeout(e,1e3)),!0}catch(r){return 4001===r.code||(null==(t=r.message)?void 0:t.includes("User rejected"))?o("Network switch was cancelled. Please switch to the correct network in your wallet."):(null==(n=r.message)?void 0:n.includes("Unrecognized chain ID"))?o(`${e.name} network is not added to your wallet. Please add it manually.`):o(`Failed to switch to ${e.name}. Please switch manually in your wallet.`),!1}return!0}catch(cF){return o("Failed to verify network. Please check your wallet connection."),!1}},clearError:()=>{o("")},resetState:()=>{o("")},setSelectedWalletType:t,connect:s}},$G=(e,t,n=!1)=>{if(!e||"string"!=typeof e)throw new Error(`Missing ${t} address`);if(!e.startsWith("0x"))throw new Error(`Invalid ${t} address format: must start with 0x`);if(42!==e.length)throw new Error(`Invalid ${t} address length: expected 42 characters, got ${e.length}`);if("0x0000000000000000000000000000000000000000"===e&&!n)throw new Error(`Invalid ${t} address: cannot be zero address`)},FG=e=>{const t=(e=>{$G(e.token,"token"),$G(e.recipient1,"recipient1"),$G(e.recipient2,"recipient2");const t=0n===BigInt(e.recipient3Percentage||0);if($G(e.recipient3,"recipient3",t),!e.paymentId||"string"!=typeof e.paymentId||0===e.paymentId.length)throw new Error("Invalid payment ID: must be a non-empty string");let n,r,i,o;try{n=BigInt(e.amount||0),r=BigInt(e.recipient1Percentage||0),i=BigInt(e.recipient2Percentage||0),o=BigInt(e.recipient3Percentage||0)}catch(a){throw new Error("Invalid numeric values: cannot convert to BigInt")}if(n<=0n)throw new Error(`Invalid amount: ${e.amount} (must be greater than 0)`);const s=r+i+o;if(10000n!==s)throw new Error(`Invalid percentages: total is ${s} but must equal 10000 basis points (100%). Individual: ${r}, ${i}, ${o}`);return{amount:n,percentage1:r,percentage2:i,percentage3:o}})(e);return{token:e.token,amount:t.amount,paymentId:e.paymentId,recipient1:e.recipient1,recipient2:e.recipient2,recipient3:e.recipient3,recipient1Percentage:t.percentage1,recipient2Percentage:t.percentage2,recipient3Percentage:t.percentage3}},zG=[{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],qG=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],HG=e=>{var t,n;const r=(null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())||(null==(n=null==e?void 0:e.toString())?void 0:n.toLowerCase())||"",i=(null==e?void 0:e.code)||(null==e?void 0:e.reason)||"";return r.includes("user rejected")||r.includes("user denied")||r.includes("user cancelled")||r.includes("rejected by user")||4001===i||"ACTION_REJECTED"===i?{type:"user_rejected",title:"Transaction Cancelled",message:"You cancelled the transaction. No charges were made.",suggestion:'Click "Pay Now" to try again when you\'re ready.'}:r.includes("insufficient funds")||r.includes("insufficient balance")||r.includes("insufficient eth")||r.includes("insufficient matic")||r.includes("insufficient bnb")||-32e3===i?{type:"insufficient_funds",title:"Insufficient Funds",message:"You don't have enough tokens or gas fees in your wallet.",suggestion:"Add more funds to your wallet and try again."}:r.includes("network error")||r.includes("rpc error")||r.includes("connection failed")||r.includes("timeout")||r.includes("request failed")?{type:"network_error",title:"Network Error",message:"Unable to connect to the blockchain network.",suggestion:"Check your internet connection and try again."}:r.includes("wrong network")||r.includes("unsupported network")||r.includes("chain mismatch")||4902===i?{type:"wrong_network",title:"Wrong Network",message:"Please switch to the correct network in your wallet.",suggestion:"Your wallet should prompt you to switch networks."}:r.includes("wallet not connected")||r.includes("no provider")||r.includes("wallet disconnected")||4900===i?{type:"wallet_disconnected",title:"Wallet Disconnected",message:"Your wallet is not connected.",suggestion:"Please reconnect your wallet and try again."}:r.includes("gas estimation failed")||r.includes("execution reverted")||r.includes("out of gas")?{type:"gas_error",title:"Transaction Failed",message:"The transaction couldn't be processed.",suggestion:"This might be a temporary issue. Please try again."}:r.includes("approve")&&r.includes("failed")?{type:"approval_failed",title:"Token Approval Failed",message:"Failed to approve token spending.",suggestion:"Please try the approval step again."}:r.includes("transaction failed")||r.includes("revert")||r.includes("contract call failed")?{type:"transaction_failed",title:"Transaction Failed",message:"The blockchain transaction was unsuccessful.",suggestion:"Please check your wallet and try again."}:r.includes("popup")||r.includes("blocked")?{type:"popup_blocked",title:"Wallet Popup Blocked",message:"Your browser blocked the wallet popup.",suggestion:"Please allow popups for this site and try again."}:r.includes("rate limit")||r.includes("too many requests")?{type:"rate_limited",title:"Too Many Requests",message:"Please wait a moment before trying again.",suggestion:"Wait 30 seconds and retry your transaction."}:r.includes("payment not yet confirmed")||r.includes("not yet confirmed on-chain")||r.includes("payment not found on-chain")||r.includes("please complete the payment")?{type:"payment_pending",title:"Payment Pending",message:"Your payment is still being confirmed on the blockchain.",suggestion:"Please wait a moment and try again, or check if your transaction completed successfully."}:r.includes("deep link")||r.includes("app not installed")||r.includes("wallet app")?{type:"mobile_wallet_error",title:"Wallet App Issue",message:"Unable to open or connect to your wallet app.",suggestion:"Make sure your wallet app is installed and try again."}:{type:"unknown_error",title:"Something Went Wrong",message:"An unexpected error occurred.",suggestion:"Please try again or contact support if the problem persists."}},WG=(e,t="")=>({timestamp:(new Date).toISOString(),context:t,userFriendly:HG(e),technical:{message:(null==e?void 0:e.message)||"Unknown error",code:null==e?void 0:e.code,reason:null==e?void 0:e.reason,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name}}),KG=async(e,t)=>{try{const n=await lI(e,{chainId:t}),r=120n,i=100n;return{maxFeePerGas:n.maxFeePerGas?n.maxFeePerGas*r/i:void 0,maxPriorityFeePerGas:n.maxPriorityFeePerGas?n.maxPriorityFeePerGas*r/i:void 0}}catch(cF){return{}}},VG="YWG990wOlIikc1tU7-WWTepfU8d1f4dp",GG=(e,t,n,r,i,o)=>{const[s,a]=Yt.useState("idle"),[c,l]=Yt.useState(""),[u,d]=Yt.useState(null),{data:h,isPending:f}=function(e={}){const{mutation:t}=e,n=PP(eA(e)),{mutate:r,mutateAsync:i,...o}=UP({...t,...n});return{...o,sendTransaction:r,sendTransactionAsync:i}}(),{isLoading:p,isSuccess:m}=HP({hash:h}),g=async()=>{var e,t,n,r,o,s,c;try{a("splitPayment");const l=window.coinleyPendingSplitPayment;if(!l)throw new Error("Missing split payment data");const{contractCall:f,selectedToken:p,paymentData:m,selectedNetwork:g}=l,y=g.chainId||10,b=await i.getContractInfo(y),{abi:v}=b,w=FG(f.params),_=BG(y),E=1===_,x=E||43114===_;try{const{request:e}=await async function(e,t){const{abi:n,chainId:r,connector:i,...o}=t;let s;s=t.account?t.account:(await cI(e,{assertChainId:!1,chainId:r,connector:i})).account;const a=e.getClient({chainId:r}),c=BC(a,dC,"simulateContract"),{result:l,request:u}=await c({...o,abi:n,account:s});return{chainId:a.chain.id,result:l,request:{...u,chainId:r}}}(SG,{address:f.contractAddress,abi:v,functionName:"splitPayment",args:[w]})}catch(u){const i=u.data||(null==(e=u.cause)?void 0:e.data);i&&("string"==typeof i&&i.startsWith("0x08c379a0")||"string"==typeof i&&i.startsWith("0x4e487b71"));u.reason||(null==(t=u.cause)?void 0:t.reason)||(null==(n=u.cause)?void 0:n.shortMessage)||(null==(r=u.data)||r.message);if(!x){const{userFriendlyMessage:e}=(e=>{if(!e.message)return{revertReason:"Transaction will revert",userFriendlyMessage:"Transaction simulation failed"};const t=e.message.toLowerCase();return t.includes("abi encoding params/values length mismatch")?{revertReason:"Smart contract parameter mismatch. This is likely a technical issue.",userFriendlyMessage:"Technical error: Contract parameters mismatch. Please try again or contact support."}:t.includes("payment id already used")?{revertReason:"This payment ID has already been used.",userFriendlyMessage:"This payment has already been processed. Please check your transaction history."}:t.includes("percentages must equal 100")?{revertReason:"Payment split percentages are incorrect.",userFriendlyMessage:"Internal error: Payment split configuration is invalid. Please contact support."}:t.includes("token transfer failed")||t.includes("transfer amount exceeds")?{revertReason:"Insufficient token balance or approval.",userFriendlyMessage:"Insufficient balance or token approval. Please check your wallet balance."}:t.includes("amount must be greater than 0")?{revertReason:"Payment amount is invalid.",userFriendlyMessage:"Invalid payment amount. Please try again."}:t.includes("invalid recipient")||t.includes("zero address")?{revertReason:"One of the payment recipients has an invalid address.",userFriendlyMessage:"Payment configuration error: Invalid recipient address. Please contact support."}:t.includes("insufficient gas")||t.includes("out of gas")?{revertReason:"Insufficient gas for transaction.",userFriendlyMessage:"Not enough gas to process transaction. Please increase gas limit or check ETH balance."}:t.includes("nonce")?{revertReason:"Transaction nonce conflict.",userFriendlyMessage:"Transaction ordering conflict. Please try again in a moment."}:{revertReason:e.message,userFriendlyMessage:`Transaction simulation failed: ${e.message.substring(0,100)}${e.message.length>100?"...":""}`}})(u);throw new Error(e)}}const k=await KG(SG,y),S="arbitrum"===g.shortName,C=S?2:0;let I;for(let e=0;e<=C;e++)try{if(e>0){const t=2e3*e;await new Promise(e=>setTimeout(e,t))}I=await EI(SG,{address:f.contractAddress,abi:v,functionName:"splitPayment",args:[w],...k});break}catch(h){const t=(null==(o=h.message)?void 0:o.includes("Internal JSON-RPC error"))||(null==(s=h.message)?void 0:s.includes("-32603"))||(null==(c=h.message)?void 0:c.includes("nonce"));if(e===C||!t&&!S)throw h}return d(I),a("processing"),window.coinleyPendingSplitPayment=null,I}catch(cF){WG(cF,"split_payment_transaction");const t=HG(cF);throw l(t),a("idle"),window.coinleyPendingSplitPayment=null,d(null),cF}},y=async o=>{try{if(a("processing"),!i||!i.processPayment)throw new Error("API instance not available or missing processPayment method");await new Promise(e=>setTimeout(e,8e3));const s=await i.processPayment(e.id,o,n.shortName,r);return a("success"),JH.trackPaymentSuccess(e.id,e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),sW(e.id,e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),s}catch(cF){console.error("❌ [processFinalPayment] Error occurred:",cF),console.error("❌ [processFinalPayment] Error details:",{message:cF.message,stack:cF.stack,name:cF.name});const i=WG(cF,"final_payment_processing");console.error("❌ [processFinalPayment] Formatted error log:",i);const o=HG(cF);throw console.error("❌ [processFinalPayment] User-friendly error:",o),l(o),a("error"),JH.trackPaymentFailed(null==e?void 0:e.id,null==e?void 0:e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),aW(null==e?void 0:e.id,null==e?void 0:e.amount,null==n?void 0:n.shortName,null==t?void 0:t.symbol,o),cF}};return{transactionStep:s,transactionError:c,currentTransactionHash:u,txPending:f,isConfirming:p,isConfirmed:m,executePaymentTransaction:async()=>{var i,s;if(!r||!(null==e?void 0:e.contractCall))throw new Error("Missing wallet connection or payment data");const c=e.contractCall;if(!c.contractAddress)throw new Error("PaymentSplitter contract data missing from payment response");if((null==o?void 0:o.ensureCorrectNetwork)&&n){if(!(await o.ensureCorrectNetwork(n)))throw new Error("Network verification failed. Please ensure you are on the correct network.")}if(!t.contractAddress)throw new Error("Native token transactions not yet supported with PaymentSplitter. Please use ERC-20 tokens.");{const o=t.decimals||6,v=c.approvalAmount||Math.floor(e.totalAmount*Math.pow(10,o));try{let e,i="unknown";try{e=await dI(SG,{address:c.tokenAddress,abi:qG,functionName:"balanceOf",args:[r]}),i="wallet-rpc"}catch(u){const t=(null==n?void 0:n.chainId)||(null==n?void 0:n.id);if(!t)throw u;{const n=(e=>{const t={1:CW,56:gW,137:PW,42161:hW,10:AW,43114:fW,42220:SW,8453:mW}[e],n={1:[`https://eth-mainnet.g.alchemy.com/v2/${VG}`,"https://cloudflare-eth.com","https://eth.llamarpc.com","https://ethereum.publicnode.com"],56:[`https://bnb-mainnet.g.alchemy.com/v2/${VG}`,"https://bsc-dataseed.bnbchain.org","https://bsc-dataseed-public.bnbchain.org","https://bsc.nodereal.io"],137:[`https://polygon-mainnet.g.alchemy.com/v2/${VG}`,"https://polygon.llamarpc.com","https://polygon-rpc.com","https://polygon.drpc.org"],42161:[`https://arb-mainnet.g.alchemy.com/v2/${VG}`,"https://arb1.arbitrum.io/rpc","https://arbitrum.llamarpc.com"],10:[`https://opt-mainnet.g.alchemy.com/v2/${VG}`,"https://mainnet.optimism.io","https://optimism.llamarpc.com"],43114:[`https://avax-mainnet.g.alchemy.com/v2/${VG}`,"https://api.avax.network/ext/bc/C/rpc","https://avalanche.public-rpc.com"],42220:[`https://celo-mainnet.g.alchemy.com/v2/${VG}`,"https://forno.celo.org","https://celo.drpc.org"],8453:[`https://base-mainnet.g.alchemy.com/v2/${VG}`,"https://mainnet.base.org","https://base.llamarpc.com","https://base.meowrpc.com"]}[e];return t&&n?nI({chain:t,transport:iI(n.map(e=>aI(e,{timeout:1e4,retryCount:1})))}):null})(BG(t));if(!n)throw u;try{e=await n.readContract({address:c.tokenAddress,abi:qG,functionName:"balanceOf",args:[r]}),i="fallback-rpc"}catch(h){throw u}}}const s=BigInt(v);if(e<s){const n=`Insufficient ${t.symbol} balance. You have ${(Number(e)/Math.pow(10,o)).toFixed(6)} ${t.symbol} but need ${(Number(s)/Math.pow(10,o)).toFixed(6)} ${t.symbol}`;throw new Error(n)}}catch(f){if(f.message.includes("Insufficient"))throw f}a("approve"),window.coinleyPendingSplitPayment={contractCall:c,selectedToken:t,paymentData:e,selectedNetwork:n};try{const e="0xdac17f958d2ee523a2206206994597c13d831ec7"===c.tokenAddress.toLowerCase()||"USDT"===t.symbol.toUpperCase();let i,o=Af;e&&(o=zG);try{i=BigInt(v)}catch(p){throw new Error(`Invalid amount value: ${v}`)}let s=0n,l=0;const u=3;for(;l<u;)try{s=await dI(SG,{address:c.tokenAddress,abi:Af,functionName:"allowance",args:[r,c.contractAddress]});break}catch(m){l++,l<u?await new Promise(e=>setTimeout(e,2e3)):s=0n}if(s>=i){a("splitPayment");const e=await g();return e&&await y(e),e}if(e&&s>0n){const e=await KG(SG,n.chainId),t=await EI(SG,{address:c.tokenAddress,abi:Af,functionName:"approve",args:[c.contractAddress,0n],...e});await _I(SG,{hash:t,confirmations:1,timeout:12e4})}const h=await KG(SG,n.chainId),f=await EI(SG,{address:c.tokenAddress,abi:Af,functionName:"approve",args:[c.contractAddress,i],...h});d(f);await _I(SG,{hash:f,confirmations:1,timeout:12e4});await new Promise(e=>setTimeout(e,3e3));let w=0;const _=3;let E=!1;for(;w<_&&!E;){try{if(await dI(SG,{address:c.tokenAddress,abi:Af,functionName:"allowance",args:[r,c.contractAddress]})>=i){E=!0;break}w<_-1&&await new Promise(e=>setTimeout(e,2e3))}catch(b){w<_-1&&await new Promise(e=>setTimeout(e,2e3))}w++}const x=await g();return x&&await y(x),x}catch(cF){WG(cF,"approve_transaction");const t=HG(cF);if(l(t),a("idle"),window.coinleyPendingSplitPayment=null,d(null),(null==(i=cF.message)?void 0:i.includes("User rejected"))||(null==(s=cF.message)?void 0:s.includes("User denied"))||4001===cF.code)throw new Error("Transaction was cancelled by user");throw new Error(`Approve failed: ${cF.message}`)}}},executeSplitPayment:g,processFinalPayment:y,resetTransaction:()=>{a("idle"),l(""),d(null),window.coinleyPendingSplitPayment=null},setTransactionError:l,setTransactionStep:a}},ZG=BigInt(0),YG=BigInt(1);function JG(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e)}return e}function QG(e,t,n=""){const r=em(e),i=null==e?void 0:e.length,o=void 0!==t;if(!r||o&&i!==t){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(r?`length=${i}`:"type="+typeof e))}return e}function XG(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function eZ(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?ZG:BigInt("0x"+e)}function tZ(e){return eZ(fm(e))}function nZ(e){return nm(e),eZ(fm(Uint8Array.from(e).reverse()))}function rZ(e,t){return _m(e.toString(16).padStart(2*t,"0"))}function iZ(e,t){return rZ(e,t).reverse()}function oZ(e,t,n){let r;if("string"==typeof t)try{r=_m(t)}catch(qAe){throw new Error(e+" must be hex string or Uint8Array, cause: "+qAe)}else{if(!em(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}function sZ(e){return Uint8Array.from(e)}const aZ=e=>"bigint"==typeof e&&ZG<=e;function cZ(e,t,n,r){if(!function(e,t,n){return aZ(e)&&aZ(t)&&aZ(n)&&t<=e&&e<n}(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function lZ(e){let t;for(t=0;e>ZG;e>>=YG,t+=1);return t}const uZ=e=>(YG<<BigInt(e))-YG;function dZ(e,t,n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function r(t,n,r){const i=e[t];if(r&&void 0===i)return;const o=typeof i;if(o!==n||null===i)throw new Error(`param "${t}" is invalid: expected ${n}, got ${o}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function hZ(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(void 0!==i)return i;const o=e(n,...r);return t.set(n,o),o}}
|
|
50
50
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fZ=BigInt(0),pZ=BigInt(1),mZ=BigInt(2),gZ=BigInt(3),yZ=BigInt(4),bZ=BigInt(5),vZ=BigInt(7),wZ=BigInt(8),_Z=BigInt(9),EZ=BigInt(16);function xZ(e,t){const n=e%t;return n>=fZ?n:t+n}function kZ(e,t,n){let r=e;for(;t-- >fZ;)r*=r,r%=n;return r}function SZ(e,t){if(e===fZ)throw new Error("invert: expected non-zero number");if(t<=fZ)throw new Error("invert: expected positive modulus, got "+t);let n=xZ(e,t),r=t,i=fZ,o=pZ;for(;n!==fZ;){const e=r%n,t=i-o*(r/n);r=n,n=e,i=o,o=t}if(r!==pZ)throw new Error("invert: does not exist");return xZ(i,t)}function CZ(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function IZ(e,t){const n=(e.ORDER+pZ)/yZ,r=e.pow(t,n);return CZ(e,r,t),r}function AZ(e,t){const n=(e.ORDER-bZ)/wZ,r=e.mul(t,mZ),i=e.pow(r,n),o=e.mul(t,i),s=e.mul(e.mul(o,mZ),i),a=e.mul(o,e.sub(s,e.ONE));return CZ(e,a,t),a}function PZ(e){if(e<gZ)throw new Error("sqrt is not defined for small field");let t=e-pZ,n=0;for(;t%mZ===fZ;)t/=mZ,n++;let r=mZ;const i=LZ(e);for(;1===RZ(i,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return IZ;let o=i.pow(r,t);const s=(t+pZ)/mZ;return function(e,r){if(e.is0(r))return r;if(1!==RZ(e,r))throw new Error("Cannot find square root");let i=n,a=e.mul(e.ONE,o),c=e.pow(r,t),l=e.pow(r,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw new Error("Cannot find square root");const r=pZ<<BigInt(i-t-1),o=e.pow(a,r);i=t,a=e.sqr(o),c=e.mul(c,a),l=e.mul(l,o)}return l}}function OZ(e){return e%yZ===gZ?IZ:e%wZ===bZ?AZ:e%EZ===_Z?function(e){const t=LZ(e),n=PZ(e),r=n(t,t.neg(t.ONE)),i=n(t,r),o=n(t,t.neg(r)),s=(e+vZ)/EZ;return(e,t)=>{let n=e.pow(t,s),a=e.mul(n,r);const c=e.mul(n,i),l=e.mul(n,o),u=e.eql(e.sqr(a),t),d=e.eql(e.sqr(c),t);n=e.cmov(n,a,u),a=e.cmov(l,c,d);const h=e.eql(e.sqr(a),t),f=e.cmov(n,a,h);return CZ(e,f,t),f}}(e):PZ(e)}const MZ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function TZ(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),o=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),o),r}function RZ(e,t){const n=(e.ORDER-pZ)/mZ,r=e.pow(t,n),i=e.eql(r,e.ONE),o=e.eql(r,e.ZERO),s=e.eql(r,e.neg(e.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function NZ(e,t){void 0!==t&&tm(t);const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function LZ(e,t,n=!1,r={}){if(e<=fZ)throw new Error("invalid field: expected ORDER > 0, got "+e);let i,o,s,a=!1;if("object"==typeof t&&null!=t){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(i=e.BITS),e.sqrt&&(o=e.sqrt),"boolean"==typeof e.isLE&&(n=e.isLE),"boolean"==typeof e.modFromBytes&&(a=e.modFromBytes),s=e.allowedLengths}else"number"==typeof t&&(i=t),r.sqrt&&(o=r.sqrt);const{nBitLength:c,nByteLength:l}=NZ(e,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:e,isLE:n,BITS:c,BYTES:l,MASK:uZ(c),ZERO:fZ,ONE:pZ,allowedLengths:s,create:t=>xZ(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return fZ<=t&&t<e},is0:e=>e===fZ,isValidNot0:e=>!d.is0(e)&&d.isValid(e),isOdd:e=>(e&pZ)===pZ,neg:t=>xZ(-t,e),eql:(e,t)=>e===t,sqr:t=>xZ(t*t,e),add:(t,n)=>xZ(t+n,e),sub:(t,n)=>xZ(t-n,e),mul:(t,n)=>xZ(t*n,e),pow:(e,t)=>function(e,t,n){if(n<fZ)throw new Error("invalid exponent, negatives unsupported");if(n===fZ)return e.ONE;if(n===pZ)return t;let r=e.ONE,i=t;for(;n>fZ;)n&pZ&&(r=e.mul(r,i)),i=e.sqr(i),n>>=pZ;return r}(d,e,t),div:(t,n)=>xZ(t*SZ(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>SZ(t,e),sqrt:o||(t=>(u||(u=OZ(e)),u(d,t))),toBytes:e=>n?iZ(e,l):rZ(e,l),fromBytes:(t,r=!0)=>{if(s){if(!s.includes(t.length)||t.length>l)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);const e=new Uint8Array(l);e.set(t,n?0:e.length-t.length),t=e}if(t.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);let i=n?nZ(t):tZ(t);if(a&&(i=xZ(i,e)),!r&&!d.isValid(i))throw new Error("invalid field element: outside of range 0..ORDER");return i},invertBatch:e=>TZ(d,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(d)}function BZ(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function jZ(e){const t=BZ(e);return t+Math.ceil(t/2)}
|
|
51
51
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
52
52
|
const DZ=BigInt(0),UZ=BigInt(1);function $Z(e,t){const n=t.negate();return e?n:t}function FZ(e,t){const n=TZ(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function zZ(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function qZ(e,t){zZ(e,t);const n=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:uZ(e),maxNumber:n,shiftBy:BigInt(e)}}function HZ(e,t,n){const{windowSize:r,mask:i,maxNumber:o,shiftBy:s}=n;let a=Number(e&i),c=e>>s;a>r&&(a-=o,c+=UZ);const l=t*r;return{nextN:c,offset:l+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:l}}const WZ=new WeakMap,KZ=new WeakMap;function VZ(e){return KZ.get(e)||1}function GZ(e){if(e!==DZ)throw new Error("invalid wNAF")}class ZZ{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,n=this.ZERO){let r=e;for(;t>DZ;)t&UZ&&(n=n.add(r)),r=r.double(),t>>=UZ;return n}precomputeWindow(e,t){const{windows:n,windowSize:r}=qZ(t,this.bits),i=[];let o=e,s=o;for(let a=0;a<n;a++){s=o,i.push(s);for(let e=1;e<r;e++)s=s.add(o),i.push(s);o=s.double()}return i}wNAF(e,t,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let r=this.ZERO,i=this.BASE;const o=qZ(e,this.bits);for(let s=0;s<o.windows;s++){const{nextN:e,offset:a,isZero:c,isNeg:l,isNegF:u,offsetF:d}=HZ(n,s,o);n=e,c?i=i.add($Z(u,t[d])):r=r.add($Z(l,t[a]))}return GZ(n),{p:r,f:i}}wNAFUnsafe(e,t,n,r=this.ZERO){const i=qZ(e,this.bits);for(let o=0;o<i.windows&&n!==DZ;o++){const{nextN:e,offset:s,isZero:a,isNeg:c}=HZ(n,o,i);if(n=e,!a){const e=t[s];r=r.add(c?e.negate():e)}}return GZ(n),r}getPrecomputes(e,t,n){let r=WZ.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&("function"==typeof n&&(r=n(r)),WZ.set(t,r))),r}cached(e,t,n){const r=VZ(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)}unsafe(e,t,n,r){const i=VZ(e);return 1===i?this._unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)}createCache(e,t){zZ(t,this.bits),KZ.set(e,t),WZ.delete(e)}hasCache(e){return 1!==VZ(e)}}function YZ(e,t,n,r){!function(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)})}(n,e),function(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)})}(r,t);const i=n.length,o=r.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,a=lZ(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=uZ(c),u=new Array(Number(l)+1).fill(s);let d=s;for(let h=Math.floor((t.BITS-1)/c)*c;h>=0;h-=c){u.fill(s);for(let t=0;t<o;t++){const e=r[t],i=Number(e>>BigInt(h)&l);u[i]=u[i].add(n[t])}let e=s;for(let t=u.length-1,n=s;t>0;t--)n=n.add(u[t]),e=e.add(n);if(d=d.add(e),0!==h)for(let t=0;t<c;t++)d=d.double()}return d}function JZ(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){dZ(e,MZ.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"}))}(t),t}return LZ(e,{isLE:n})}function QZ(e,t,n={},r){if(void 0===r&&(r="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const a of["p","n","h"]){const e=t[a];if(!("bigint"==typeof e&&e>DZ))throw new Error(`CURVE.${a} must be positive bigint`)}const i=JZ(t.p,n.Fp,r),o=JZ(t.n,n.Fn,r),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const a of s)if(!i.isValid(t[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:i,Fn:o}}
|