@runflow-ai/cli 0.2.34 → 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/create/code-generator.js +157 -146
- package/dist/commands/create/code-generator.js.map +1 -1
- package/package.json +1 -1
- package/static/dist-test/assets/main-BSOmdwZa.css +1 -0
- package/static/dist-test/assets/main-CQQ-Gu_h.css +1 -0
- package/static/dist-test/assets/main-Cle8CQ3-.js +59 -0
- package/static/dist-test/assets/main-D8GGdXDN.js +68 -0
- package/static/dist-test/assets/main-DVwOzbXX.js +59 -0
- package/static/dist-test/assets/main-Dix5w906.css +1 -0
- package/static/dist-test/index-test.html +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r)(t,"symbol"!=typeof n?n+"":n,r);!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var o={exports:{}},i={},a={exports:{}},s={},l=Symbol.for("react.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),p=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),b=Symbol.iterator;var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,k={};function _(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||x}function S(){}function C(e,t,n){this.props=e,this.context=t,this.refs=k,this.updater=n||x}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=_.prototype;var E=C.prototype=new S;E.constructor=C,w(E,_.prototype),E.isPureReactComponent=!0;var N=Array.isArray,I=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function j(e,t,n){var r,o={},i=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(i=""+t.key),t)I.call(t,r)&&!M.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var c=Array(s),u=0;u<s;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:a,props:o,_owner:O.current}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var P=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function R(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case l:case c:a=!0}}if(a)return o=o(a=e),e=""===r?"."+A(a,0):r,N(o)?(n="",null!=e&&(n=e.replace(P,"$&/")+"/"),R(o,t,n,"",function(e){return e})):null!=o&&(T(o)&&(o=function(e,t){return{$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(P,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=""===r?".":r+":",N(e))for(var s=0;s<e.length;s++){var u=r+A(i=e[s],s);a+=R(i,t,n,u,o)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=b&&e[b]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),s=0;!(i=e.next()).done;)a+=R(i=i.value,t,n,u=r+A(i,s++),o);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function L(e,t,n){if(null==e)return e;var r=[],o=0;return R(e,r,"","",function(e){return t.call(n,e,o++)}),r}function D(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var z={current:null},F={transition:null},U={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:F,ReactCurrentOwner:O};function B(){throw Error("act(...) is not supported in production builds of React.")}s.Children={map:L,forEach:function(e,t,n){L(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return L(e,function(){t++}),t},toArray:function(e){return L(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=_,s.Fragment=u,s.Profiler=f,s.PureComponent=C,s.StrictMode=d,s.Suspense=g,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,s.act=B,s.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=w({},e.props),o=e.key,i=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,a=O.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(c in t)I.call(t,c)&&!M.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==s?s[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=n;else if(1<c){s=Array(c);for(var u=0;u<c;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:l,type:e.type,key:o,ref:i,props:r,_owner:a}},s.createContext=function(e){return(e={$$typeof:p,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:h,_context:e},e.Consumer=e},s.createElement=j,s.createFactory=function(e){var t=j.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:m,render:e}},s.isValidElement=T,s.lazy=function(e){return{$$typeof:y,_payload:{_status:-1,_result:e},_init:D}},s.memo=function(e,t){return{$$typeof:v,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=F.transition;F.transition={};try{e()}finally{F.transition=t}},s.unstable_act=B,s.useCallback=function(e,t){return z.current.useCallback(e,t)},s.useContext=function(e){return z.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return z.current.useDeferredValue(e)},s.useEffect=function(e,t){return z.current.useEffect(e,t)},s.useId=function(){return z.current.useId()},s.useImperativeHandle=function(e,t,n){return z.current.useImperativeHandle(e,t,n)},s.useInsertionEffect=function(e,t){return z.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return z.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return z.current.useMemo(e,t)},s.useReducer=function(e,t,n){return z.current.useReducer(e,t,n)},s.useRef=function(e){return z.current.useRef(e)},s.useState=function(e){return z.current.useState(e)},s.useSyncExternalStore=function(e,t,n){return z.current.useSyncExternalStore(e,t,n)},s.useTransition=function(){return z.current.useTransition()},s.version="18.3.1",a.exports=s;var $=a.exports;const V=r($);
|
|
2
|
+
/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var H=$,W=Symbol.for("react.element"),q=Symbol.for("react.fragment"),K=Object.prototype.hasOwnProperty,Z=H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y={key:!0,ref:!0,__self:!0,__source:!0};function X(e,t,n){var r,o={},i=null,a=null;for(r in void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(a=t.ref),t)K.call(t,r)&&!Y.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:W,type:e,key:i,ref:a,props:o,_owner:Z.current}}i.Fragment=q,i.jsx=X,i.jsxs=X,o.exports=i;var G=o.exports,J={},Q={exports:{}},ee={},te={exports:{}},ne={};
|
|
11
|
+
/**
|
|
12
|
+
* @license React
|
|
13
|
+
* scheduler.production.min.js
|
|
14
|
+
*
|
|
15
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the MIT license found in the
|
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>o(l,n))c<i&&0>o(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<i&&0>o(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(c);null!==o;){if(null===o.callback)r(c);else{if(!(o.startTime<=e))break;r(c),o.sortIndex=o.expirationTime,t(l,o)}o=n(c)}}function x(e){if(m=!1,b(e),!p)if(null!==n(l))p=!0,T(w);else{var t=n(c);null!==t&&P(x,t.startTime-e)}}function w(t,o){p=!1,m&&(m=!1,v(C),C=-1),h=!0;var i=f;try{for(b(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!I());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(o)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&P(x,g.startTime-o),u=!1}return u}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var k,_=!1,S=null,C=-1,E=5,N=-1;function I(){return!(e.unstable_now()-N<E)}function O(){if(null!==S){var t=e.unstable_now();N=t;var n=!0;try{n=S(!0,t)}finally{n?k():(_=!1,S=null)}}else _=!1}if("function"==typeof y)k=function(){y(O)};else if("undefined"!=typeof MessageChannel){var M=new MessageChannel,j=M.port2;M.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function T(e){S=e,_||(_=!0,k())}function P(t,n){C=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,T(w))},e.unstable_forceFrameRate=function(e){0>e||125<e||(E=0<e?Math.floor(1e3/e):5)},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch("object"==typeof i&&null!==i?i="number"==typeof(i=i.delay)&&0<i?a+i:a:i=a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(c,r),null===n(l)&&r===n(c)&&(m?(v(C),C=-1):m=!0,P(x,i-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,T(w))),r},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(ne),te.exports=ne;var re=te.exports,oe=$,ie=re;
|
|
21
|
+
/**
|
|
22
|
+
* @license React
|
|
23
|
+
* react-dom.production.min.js
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/function ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var se=new Set,le={};function ce(e,t){ue(e,t),ue(e+"Capture",t)}function ue(e,t){for(le[e]=t,e=0;e<t.length;e++)se.add(t[e])}var de=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),fe=Object.prototype.hasOwnProperty,he=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,pe={},me={};function ge(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ve[e]=new ge(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ve[t]=new ge(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){ve[e]=new ge(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ve[e]=new ge(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ve[e]=new ge(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){ve[e]=new ge(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){ve[e]=new ge(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){ve[e]=new ge(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){ve[e]=new ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var ye=/[\-:]([a-z])/g;function be(e){return e[1].toUpperCase()}function xe(e,t,n,r){var o=ve.hasOwnProperty(t)?ve[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!fe.call(me,e)||!fe.call(pe,e)&&(he.test(e)?me[e]=!0:(pe[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ye,be);ve[t]=new ge(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ye,be);ve[t]=new ge(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ye,be);ve[t]=new ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){ve[e]=new ge(e,1,!1,e.toLowerCase(),null,!1,!1)}),ve.xlinkHref=new ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){ve[e]=new ge(e,1,!1,e.toLowerCase(),null,!0,!0)});var we=oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ke=Symbol.for("react.element"),_e=Symbol.for("react.portal"),Se=Symbol.for("react.fragment"),Ce=Symbol.for("react.strict_mode"),Ee=Symbol.for("react.profiler"),Ne=Symbol.for("react.provider"),Ie=Symbol.for("react.context"),Oe=Symbol.for("react.forward_ref"),Me=Symbol.for("react.suspense"),je=Symbol.for("react.suspense_list"),Te=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),Ae=Symbol.for("react.offscreen"),Re=Symbol.iterator;function Le(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=Re&&e[Re]||e["@@iterator"])?e:null}var De,ze=Object.assign;function Fe(e){if(void 0===De)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||""}return"\n"+De+e}var Ue=!1;function Be(e,t){if(!e||Ue)return"";Ue=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&"string"==typeof c.stack){for(var o=c.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{Ue=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fe(e):""}function $e(e){switch(e.tag){case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 2:case 15:return e=Be(e.type,!1);case 11:return e=Be(e.type.render,!1);case 1:return e=Be(e.type,!0);default:return""}}function Ve(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Se:return"Fragment";case _e:return"Portal";case Ee:return"Profiler";case Ce:return"StrictMode";case Me:return"Suspense";case je:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Ie:return(e.displayName||"Context")+".Consumer";case Ne:return(e._context.displayName||"Context")+".Provider";case Oe:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case Te:return null!==(t=e.displayName||null)?t:Ve(e.type)||"Memo";case Pe:t=e._payload,e=e._init;try{return Ve(e(t))}catch(n){}}return null}function He(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ve(t);case 8:return t===Ce?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function We(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function qe(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Ke(e){e._valueTracker||(e._valueTracker=function(e){var t=qe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ze(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qe(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Ye(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Xe(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Ge(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=We(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Je(e,t){null!=(t=t.checked)&&xe(e,"checked",t,!1)}function Qe(e,t){Je(e,t);var n=We(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?tt(e,t.type,n):t.hasOwnProperty("defaultValue")&&tt(e,t.type,We(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function et(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function tt(e,t,n){"number"===t&&Ye(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var nt=Array.isArray;function rt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+We(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ot(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(ae(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function it(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(ae(92));if(nt(n)){if(1<n.length)throw Error(ae(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:We(n)}}function at(e,t){var n=We(t.value),r=We(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function st(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function lt(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ct(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?lt(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ut,dt,ft=(dt=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ut=ut||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ut.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return dt(e,t)})}:dt);function ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mt=["Webkit","ms","Moz","O"];function gt(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pt.hasOwnProperty(e)&&pt[e]?(""+t).trim():t+"px"}function vt(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=gt(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pt).forEach(function(e){mt.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pt[t]=pt[e]})});var yt=ze({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bt(e,t){if(t){if(yt[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(ae(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(ae(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(ae(62))}}function xt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wt=null;function kt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var _t=null,St=null,Ct=null;function Et(e){if(e=wi(e)){if("function"!=typeof _t)throw Error(ae(280));var t=e.stateNode;t&&(t=_i(t),_t(e.stateNode,e.type,t))}}function Nt(e){St?Ct?Ct.push(e):Ct=[e]:St=e}function It(){if(St){var e=St,t=Ct;if(Ct=St=null,Et(e),t)for(e=0;e<t.length;e++)Et(t[e])}}function Ot(e,t){return e(t)}function Mt(){}var jt=!1;function Tt(e,t,n){if(jt)return e(t,n);jt=!0;try{return Ot(e,t,n)}finally{jt=!1,(null!==St||null!==Ct)&&(Mt(),It())}}function Pt(e,t){var n=e.stateNode;if(null===n)return null;var r=_i(n);if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(ae(231,t,typeof n));return n}var At=!1;if(de)try{var Rt={};Object.defineProperty(Rt,"passive",{get:function(){At=!0}}),window.addEventListener("test",Rt,Rt),window.removeEventListener("test",Rt,Rt)}catch(dt){At=!1}function Lt(e,t,n,r,o,i,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Dt=!1,zt=null,Ft=!1,Ut=null,Bt={onError:function(e){Dt=!0,zt=e}};function $t(e,t,n,r,o,i,a,s,l){Dt=!1,zt=null,Lt.apply(Bt,arguments)}function Vt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ht(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Wt(e){if(Vt(e)!==e)throw Error(ae(188))}function qt(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=Vt(e)))throw Error(ae(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(null===o)break;var i=o.alternate;if(null===i){if(null!==(r=o.return)){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Wt(o),e;if(i===r)return Wt(o),t;i=i.sibling}throw Error(ae(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a){for(s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a)throw Error(ae(189))}}if(n.alternate!==r)throw Error(ae(190))}if(3!==n.tag)throw Error(ae(188));return n.stateNode.current===n?e:t}(e))?Kt(e):null}function Kt(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Kt(e);if(null!==t)return t;e=e.sibling}return null}var Zt=ie.unstable_scheduleCallback,Yt=ie.unstable_cancelCallback,Xt=ie.unstable_shouldYield,Gt=ie.unstable_requestPaint,Jt=ie.unstable_now,Qt=ie.unstable_getCurrentPriorityLevel,en=ie.unstable_ImmediatePriority,tn=ie.unstable_UserBlockingPriority,nn=ie.unstable_NormalPriority,rn=ie.unstable_LowPriority,on=ie.unstable_IdlePriority,an=null,sn=null;var ln=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(cn(e)/un|0)|0},cn=Math.log,un=Math.LN2;var dn=64,fn=4194304;function hn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pn(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=hn(s):0!==(i&=a)&&(r=hn(i))}else 0!==(a=n&~o)?r=hn(a):0!==i&&(r=hn(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-ln(t)),r|=e[n],t&=~o;return r}function mn(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function gn(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function vn(){var e=dn;return!(4194240&(dn<<=1))&&(dn=64),e}function yn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bn(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-ln(t)]=n}function xn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ln(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var wn=0;function kn(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var _n,Sn,Cn,En,Nn,In=!1,On=[],Mn=null,jn=null,Tn=null,Pn=new Map,An=new Map,Rn=[],Ln="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dn(e,t){switch(e){case"focusin":case"focusout":Mn=null;break;case"dragenter":case"dragleave":jn=null;break;case"mouseover":case"mouseout":Tn=null;break;case"pointerover":case"pointerout":Pn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":An.delete(t.pointerId)}}function zn(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&(null!==(t=wi(t))&&Sn(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Fn(e){var t=xi(e.target);if(null!==t){var n=Vt(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ht(n)))return e.blockedOn=t,void Nn(e.priority,function(){Cn(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Un(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=wi(n))&&Sn(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);wt=r,n.target.dispatchEvent(r),wt=null,t.shift()}return!0}function Bn(e,t,n){Un(e)&&n.delete(t)}function $n(){In=!1,null!==Mn&&Un(Mn)&&(Mn=null),null!==jn&&Un(jn)&&(jn=null),null!==Tn&&Un(Tn)&&(Tn=null),Pn.forEach(Bn),An.forEach(Bn)}function Vn(e,t){e.blockedOn===t&&(e.blockedOn=null,In||(In=!0,ie.unstable_scheduleCallback(ie.unstable_NormalPriority,$n)))}function Hn(e){function t(t){return Vn(t,e)}if(0<On.length){Vn(On[0],e);for(var n=1;n<On.length;n++){var r=On[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Mn&&Vn(Mn,e),null!==jn&&Vn(jn,e),null!==Tn&&Vn(Tn,e),Pn.forEach(t),An.forEach(t),n=0;n<Rn.length;n++)(r=Rn[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&null===(n=Rn[0]).blockedOn;)Fn(n),null===n.blockedOn&&Rn.shift()}var Wn=we.ReactCurrentBatchConfig,qn=!0;function Kn(e,t,n,r){var o=wn,i=Wn.transition;Wn.transition=null;try{wn=1,Yn(e,t,n,r)}finally{wn=o,Wn.transition=i}}function Zn(e,t,n,r){var o=wn,i=Wn.transition;Wn.transition=null;try{wn=4,Yn(e,t,n,r)}finally{wn=o,Wn.transition=i}}function Yn(e,t,n,r){if(qn){var o=Gn(e,t,n,r);if(null===o)qo(e,t,r,Xn,n),Dn(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Mn=zn(Mn,e,t,n,r,o),!0;case"dragenter":return jn=zn(jn,e,t,n,r,o),!0;case"mouseover":return Tn=zn(Tn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Pn.set(i,zn(Pn.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,An.set(i,zn(An.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(Dn(e,r),4&t&&-1<Ln.indexOf(e)){for(;null!==o;){var i=wi(o);if(null!==i&&_n(i),null===(i=Gn(e,t,n,r))&&qo(e,t,r,Xn,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else qo(e,t,r,null,n)}}var Xn=null;function Gn(e,t,n,r){if(Xn=null,null!==(e=xi(e=kt(r))))if(null===(t=Vt(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Ht(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xn=e,null}function Jn(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qt()){case en:return 1;case tn:return 4;case nn:case rn:return 16;case on:return 536870912;default:return 16}default:return 16}}var Qn=null,er=null,tr=null;function nr(){if(tr)return tr;var e,t,n=er,r=n.length,o="value"in Qn?Qn.value:Qn.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return tr=o.slice(e,1<t?1-t:void 0)}function rr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function or(){return!0}function ir(){return!1}function ar(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?or:ir,this.isPropagationStopped=ir,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=or)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=or)},persist:function(){},isPersistent:or}),t}var sr,lr,cr,ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dr=ar(ur),fr=ze({},ur,{view:0,detail:0}),hr=ar(fr),pr=ze({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cr&&(cr&&"mousemove"===e.type?(sr=e.screenX-cr.screenX,lr=e.screenY-cr.screenY):lr=sr=0,cr=e),sr)},movementY:function(e){return"movementY"in e?e.movementY:lr}}),mr=ar(pr),gr=ar(ze({},pr,{dataTransfer:0})),vr=ar(ze({},fr,{relatedTarget:0})),yr=ar(ze({},ur,{animationName:0,elapsedTime:0,pseudoElement:0})),br=ze({},ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xr=ar(br),wr=ar(ze({},ur,{data:0})),kr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_r={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sr[e])&&!!t[e]}function Er(){return Cr}var Nr=ze({},fr,{key:function(e){if(e.key){var t=kr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?_r[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return"keypress"===e.type?rr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ir=ar(Nr),Or=ar(ze({},pr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mr=ar(ze({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er})),jr=ar(ze({},ur,{propertyName:0,elapsedTime:0,pseudoElement:0})),Tr=ze({},pr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Pr=ar(Tr),Ar=[9,13,27,32],Rr=de&&"CompositionEvent"in window,Lr=null;de&&"documentMode"in document&&(Lr=document.documentMode);var Dr=de&&"TextEvent"in window&&!Lr,zr=de&&(!Rr||Lr&&8<Lr&&11>=Lr),Fr=String.fromCharCode(32),Ur=!1;function Br(e,t){switch(e){case"keyup":return-1!==Ar.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $r(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vr=!1;var Hr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hr[e.type]:"textarea"===t}function qr(e,t,n,r){Nt(r),0<(t=Zo(t,"onChange")).length&&(n=new dr("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Kr=null,Zr=null;function Yr(e){Uo(e,0)}function Xr(e){if(Ze(ki(e)))return e}function Gr(e,t){if("change"===e)return t}var Jr=!1;if(de){var Qr;if(de){var eo="oninput"in document;if(!eo){var to=document.createElement("div");to.setAttribute("oninput","return;"),eo="function"==typeof to.oninput}Qr=eo}else Qr=!1;Jr=Qr&&(!document.documentMode||9<document.documentMode)}function no(){Kr&&(Kr.detachEvent("onpropertychange",ro),Zr=Kr=null)}function ro(e){if("value"===e.propertyName&&Xr(Zr)){var t=[];qr(t,Zr,e,kt(e)),Tt(Yr,t)}}function oo(e,t,n){"focusin"===e?(no(),Zr=n,(Kr=t).attachEvent("onpropertychange",ro)):"focusout"===e&&no()}function io(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Xr(Zr)}function ao(e,t){if("click"===e)return Xr(t)}function so(e,t){if("input"===e||"change"===e)return Xr(t)}var lo="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function co(e,t){if(lo(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!fe.call(t,o)||!lo(e[o],t[o]))return!1}return!0}function uo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fo(e,t){var n,r=uo(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=uo(r)}}function ho(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ho(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function po(){for(var e=window,t=Ye();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Ye((e=t.contentWindow).document)}return t}function mo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function go(e){var t=po(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ho(n.ownerDocument.documentElement,n)){if(null!==r&&mo(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=fo(n,i);var a=fo(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vo=de&&"documentMode"in document&&11>=document.documentMode,yo=null,bo=null,xo=null,wo=!1;function ko(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;wo||null==yo||yo!==Ye(r)||("selectionStart"in(r=yo)&&mo(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},xo&&co(xo,r)||(xo=r,0<(r=Zo(bo,"onSelect")).length&&(t=new dr("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yo)))}function _o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var So={animationend:_o("Animation","AnimationEnd"),animationiteration:_o("Animation","AnimationIteration"),animationstart:_o("Animation","AnimationStart"),transitionend:_o("Transition","TransitionEnd")},Co={},Eo={};function No(e){if(Co[e])return Co[e];if(!So[e])return e;var t,n=So[e];for(t in n)if(n.hasOwnProperty(t)&&t in Eo)return Co[e]=n[t];return e}de&&(Eo=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);var Io=No("animationend"),Oo=No("animationiteration"),Mo=No("animationstart"),jo=No("transitionend"),To=new Map,Po="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ao(e,t){To.set(e,t),ce(t,[e])}for(var Ro=0;Ro<Po.length;Ro++){var Lo=Po[Ro];Ao(Lo.toLowerCase(),"on"+(Lo[0].toUpperCase()+Lo.slice(1)))}Ao(Io,"onAnimationEnd"),Ao(Oo,"onAnimationIteration"),Ao(Mo,"onAnimationStart"),Ao("dblclick","onDoubleClick"),Ao("focusin","onFocus"),Ao("focusout","onBlur"),Ao(jo,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),ce("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ce("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ce("onBeforeInput",["compositionend","keypress","textInput","paste"]),ce("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ce("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Do="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zo=new Set("cancel close invalid load scroll toggle".split(" ").concat(Do));function Fo(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,r,o,i,a,s,l){if($t.apply(this,arguments),Dt){if(!Dt)throw Error(ae(198));var c=zt;Dt=!1,zt=null,Ft||(Ft=!0,Ut=c)}}(r,t,void 0,e),e.currentTarget=null}function Uo(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Fo(o,s,c),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Fo(o,s,c),i=l}}}if(Ft)throw e=Ut,Ft=!1,Ut=null,e}function Bo(e,t){var n=t[vi];void 0===n&&(n=t[vi]=new Set);var r=e+"__bubble";n.has(r)||(Wo(t,e,2,!1),n.add(r))}function $o(e,t,n){var r=0;t&&(r|=4),Wo(n,e,r,t)}var Vo="_reactListening"+Math.random().toString(36).slice(2);function Ho(e){if(!e[Vo]){e[Vo]=!0,se.forEach(function(t){"selectionchange"!==t&&(zo.has(t)||$o(t,!1,e),$o(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Vo]||(t[Vo]=!0,$o("selectionchange",!1,t))}}function Wo(e,t,n,r){switch(Jn(t)){case 1:var o=Kn;break;case 4:o=Zn;break;default:o=Yn}n=o.bind(null,t,n,e),o=void 0,!At||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function qo(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=xi(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}Tt(function(){var r=i,o=kt(n),a=[];e:{var s=To.get(e);if(void 0!==s){var l=dr,c=e;switch(e){case"keypress":if(0===rr(n))break e;case"keydown":case"keyup":l=Ir;break;case"focusin":c="focus",l=vr;break;case"focusout":c="blur",l=vr;break;case"beforeblur":case"afterblur":l=vr;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=mr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=gr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Mr;break;case Io:case Oo:case Mo:l=yr;break;case jo:l=jr;break;case"scroll":l=hr;break;case"wheel":l=Pr;break;case"copy":case"cut":case"paste":l=xr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Or}var u=!!(4&t),d=!u&&"scroll"===e,f=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=Pt(p,f))&&u.push(Ko(p,m,h)))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,o),a.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===wt||!(c=n.relatedTarget||n.fromElement)||!xi(c)&&!c[gi])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?xi(c):null)&&(c!==(d=Vt(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=mr,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=Or,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:ki(l),h=null==c?s:ki(c),(s=new u(m,p+"leave",l,n,o)).target=d,s.relatedTarget=h,m=null,xi(o)===r&&((u=new u(f,p+"enter",c,n,o)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=Yo(h))p++;for(h=0,m=f;m;m=Yo(m))h++;for(;0<p-h;)u=Yo(u),p--;for(;0<h-p;)f=Yo(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=Yo(u),f=Yo(f)}u=null}else u=null;null!==l&&Xo(a,s,l,u,!1),null!==c&&null!==d&&Xo(a,d,c,u,!0)}if("select"===(l=(s=r?ki(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Gr;else if(Wr(s))if(Jr)g=so;else{g=io;var v=oo}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=ao);switch(g&&(g=g(e,r))?qr(a,g,n,o):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&tt(s,"number",s.value)),v=r?ki(r):window,e){case"focusin":(Wr(v)||"true"===v.contentEditable)&&(yo=v,bo=r,xo=null);break;case"focusout":xo=bo=yo=null;break;case"mousedown":wo=!0;break;case"contextmenu":case"mouseup":case"dragend":wo=!1,ko(a,n,o);break;case"selectionchange":if(vo)break;case"keydown":case"keyup":ko(a,n,o)}var y;if(Rr)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Vr?Br(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(zr&&"ko"!==n.locale&&(Vr||"onCompositionStart"!==b?"onCompositionEnd"===b&&Vr&&(y=nr()):(er="value"in(Qn=o)?Qn.value:Qn.textContent,Vr=!0)),0<(v=Zo(r,b)).length&&(b=new wr(b,e,null,n,o),a.push({event:b,listeners:v}),y?b.data=y:null!==(y=$r(n))&&(b.data=y))),(y=Dr?function(e,t){switch(e){case"compositionend":return $r(t);case"keypress":return 32!==t.which?null:(Ur=!0,Fr);case"textInput":return(e=t.data)===Fr&&Ur?null:e;default:return null}}(e,n):function(e,t){if(Vr)return"compositionend"===e||!Rr&&Br(e,t)?(e=nr(),tr=er=Qn=null,Vr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zr&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Zo(r,"onBeforeInput")).length&&(o=new wr("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=y))}Uo(a,t)})}function Ko(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zo(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Pt(e,n))&&r.unshift(Ko(e,i,o)),null!=(i=Pt(e,t))&&r.push(Ko(e,i,o))),e=e.return}return r}function Yo(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Xo(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,o?null!=(l=Pt(n,i))&&a.unshift(Ko(n,l,s)):o||null!=(l=Pt(n,i))&&a.push(Ko(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Go=/\r\n?/g,Jo=/\u0000|\uFFFD/g;function Qo(e){return("string"==typeof e?e:""+e).replace(Go,"\n").replace(Jo,"")}function ei(e,t,n){if(t=Qo(t),Qo(e)!==t&&n)throw Error(ae(425))}function ti(){}var ni=null,ri=null;function oi(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ii="function"==typeof setTimeout?setTimeout:void 0,ai="function"==typeof clearTimeout?clearTimeout:void 0,si="function"==typeof Promise?Promise:void 0,li="function"==typeof queueMicrotask?queueMicrotask:void 0!==si?function(e){return si.resolve(null).then(e).catch(ci)}:ii;function ci(e){setTimeout(function(){throw e})}function ui(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Hn(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Hn(t)}function di(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function fi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),pi="__reactFiber$"+hi,mi="__reactProps$"+hi,gi="__reactContainer$"+hi,vi="__reactEvents$"+hi,yi="__reactListeners$"+hi,bi="__reactHandles$"+hi;function xi(e){var t=e[pi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gi]||n[pi]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=fi(e);null!==e;){if(n=e[pi])return n;e=fi(e)}return t}n=(e=n).parentNode}return null}function wi(e){return!(e=e[pi]||e[gi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ki(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(ae(33))}function _i(e){return e[mi]||null}var Si=[],Ci=-1;function Ei(e){return{current:e}}function Ni(e){0>Ci||(e.current=Si[Ci],Si[Ci]=null,Ci--)}function Ii(e,t){Ci++,Si[Ci]=e.current,e.current=t}var Oi={},Mi=Ei(Oi),ji=Ei(!1),Ti=Oi;function Pi(e,t){var n=e.type.contextTypes;if(!n)return Oi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ai(e){return null!=(e=e.childContextTypes)}function Ri(){Ni(ji),Ni(Mi)}function Li(e,t,n){if(Mi.current!==Oi)throw Error(ae(168));Ii(Mi,t),Ii(ji,n)}function Di(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(ae(108,He(e)||"Unknown",o));return ze({},n,r)}function zi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Oi,Ti=Mi.current,Ii(Mi,e),Ii(ji,ji.current),!0}function Fi(e,t,n){var r=e.stateNode;if(!r)throw Error(ae(169));n?(e=Di(e,t,Ti),r.__reactInternalMemoizedMergedChildContext=e,Ni(ji),Ni(Mi),Ii(Mi,e)):Ni(ji),Ii(ji,n)}var Ui=null,Bi=!1,$i=!1;function Vi(e){null===Ui?Ui=[e]:Ui.push(e)}function Hi(){if(!$i&&null!==Ui){$i=!0;var e=0,t=wn;try{var n=Ui;for(wn=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Ui=null,Bi=!1}catch(rp){throw null!==Ui&&(Ui=Ui.slice(e+1)),Zt(en,Hi),rp}finally{wn=t,$i=!1}}return null}var Wi=[],qi=0,Ki=null,Zi=0,Yi=[],Xi=0,Gi=null,Ji=1,Qi="";function ea(e,t){Wi[qi++]=Zi,Wi[qi++]=Ki,Ki=e,Zi=t}function ta(e,t,n){Yi[Xi++]=Ji,Yi[Xi++]=Qi,Yi[Xi++]=Gi,Gi=e;var r=Ji;e=Qi;var o=32-ln(r)-1;r&=~(1<<o),n+=1;var i=32-ln(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Ji=1<<32-ln(t)+o|n<<o|r,Qi=i+e}else Ji=1<<i|n<<o|r,Qi=e}function na(e){null!==e.return&&(ea(e,1),ta(e,1,0))}function ra(e){for(;e===Ki;)Ki=Wi[--qi],Wi[qi]=null,Zi=Wi[--qi],Wi[qi]=null;for(;e===Gi;)Gi=Yi[--Xi],Yi[Xi]=null,Qi=Yi[--Xi],Yi[Xi]=null,Ji=Yi[--Xi],Yi[Xi]=null}var oa=null,ia=null,aa=!1,sa=null;function la(e,t){var n=ju(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ca(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,oa=e,ia=di(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,oa=e,ia=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Gi?{id:Ji,overflow:Qi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=ju(18,null,null,0)).stateNode=t,n.return=e,e.child=n,oa=e,ia=null,!0);default:return!1}}function ua(e){return!(!(1&e.mode)||128&e.flags)}function da(e){if(aa){var t=ia;if(t){var n=t;if(!ca(e,t)){if(ua(e))throw Error(ae(418));t=di(n.nextSibling);var r=oa;t&&ca(e,t)?la(r,n):(e.flags=-4097&e.flags|2,aa=!1,oa=e)}}else{if(ua(e))throw Error(ae(418));e.flags=-4097&e.flags|2,aa=!1,oa=e}}}function fa(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;oa=e}function ha(e){if(e!==oa)return!1;if(!aa)return fa(e),aa=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!oi(e.type,e.memoizedProps)),t&&(t=ia)){if(ua(e))throw pa(),Error(ae(418));for(;t;)la(e,t),t=di(t.nextSibling)}if(fa(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(ae(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ia=di(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ia=null}}else ia=oa?di(e.stateNode.nextSibling):null;return!0}function pa(){for(var e=ia;e;)e=di(e.nextSibling)}function ma(){ia=oa=null,aa=!1}function ga(e){null===sa?sa=[e]:sa.push(e)}var va=we.ReactCurrentBatchConfig;function ya(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(ae(309));var r=n.stateNode}if(!r)throw Error(ae(147,e));var o=r,i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=o.refs;null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!=typeof e)throw Error(ae(284));if(!n._owner)throw Error(ae(290,e))}return e}function ba(e,t){throw e=Object.prototype.toString.call(t),Error(ae(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xa(e){return(0,e._init)(e._payload)}function wa(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Pu(e,t)).index=0,e.sibling=null,e}function i(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function a(t){return e&&null===t.alternate&&(t.flags|=2),t}function s(e,t,n,r){return null===t||6!==t.tag?((t=Du(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function l(e,t,n,r){var i=n.type;return i===Se?u(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===Pe&&xa(i)===t.type)?((r=o(t,n.props)).ref=ya(e,t,n),r.return=e,r):((r=Au(n.type,n.key,n.props,null,e.mode,r)).ref=ya(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=zu(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function u(e,t,n,r,i){return null===t||7!==t.tag?((t=Ru(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Du(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case ke:return(n=Au(t.type,t.key,t.props,null,e.mode,n)).ref=ya(e,null,t),n.return=e,n;case _e:return(t=zu(t,e.mode,n)).return=e,t;case Pe:return d(e,(0,t._init)(t._payload),n)}if(nt(t)||Le(t))return(t=Ru(t,e.mode,n,null)).return=e,t;ba(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:s(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case ke:return n.key===o?l(e,t,n,r):null;case _e:return n.key===o?c(e,t,n,r):null;case Pe:return f(e,t,(o=n._init)(n._payload),r)}if(nt(n)||Le(n))return null!==o?null:u(e,t,n,r,null);ba(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return s(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case ke:return l(t,e=e.get(null===r.key?n:r.key)||null,r,o);case _e:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case Pe:return h(e,t,n,(0,r._init)(r._payload),o)}if(nt(r)||Le(r))return u(t,e=e.get(n)||null,r,o,null);ba(t,r)}return null}return function s(l,c,u,p){if("object"==typeof u&&null!==u&&u.type===Se&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case ke:e:{for(var m=u.key,g=c;null!==g;){if(g.key===m){if((m=u.type)===Se){if(7===g.tag){n(l,g.sibling),(c=o(g,u.props.children)).return=l,l=c;break e}}else if(g.elementType===m||"object"==typeof m&&null!==m&&m.$$typeof===Pe&&xa(m)===g.type){n(l,g.sibling),(c=o(g,u.props)).ref=ya(l,g,u),c.return=l,l=c;break e}n(l,g);break}t(l,g),g=g.sibling}u.type===Se?((c=Ru(u.props.children,l.mode,p,u.key)).return=l,l=c):((p=Au(u.type,u.key,u.props,null,l.mode,p)).ref=ya(l,c,u),p.return=l,l=p)}return a(l);case _e:e:{for(g=u.key;null!==c;){if(c.key===g){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(c=o(c,u.children||[])).return=l,l=c;break e}n(l,c);break}t(l,c),c=c.sibling}(c=zu(u,l.mode,p)).return=l,l=c}return a(l);case Pe:return s(l,c,(g=u._init)(u._payload),p)}if(nt(u))return function(o,a,s,l){for(var c=null,u=null,p=a,m=a=0,g=null;null!==p&&m<s.length;m++){p.index>m?(g=p,p=null):g=p.sibling;var v=f(o,p,s[m],l);if(null===v){null===p&&(p=g);break}e&&p&&null===v.alternate&&t(o,p),a=i(v,a,m),null===u?c=v:u.sibling=v,u=v,p=g}if(m===s.length)return n(o,p),aa&&ea(o,m),c;if(null===p){for(;m<s.length;m++)null!==(p=d(o,s[m],l))&&(a=i(p,a,m),null===u?c=p:u.sibling=p,u=p);return aa&&ea(o,m),c}for(p=r(o,p);m<s.length;m++)null!==(g=h(p,o,m,s[m],l))&&(e&&null!==g.alternate&&p.delete(null===g.key?m:g.key),a=i(g,a,m),null===u?c=g:u.sibling=g,u=g);return e&&p.forEach(function(e){return t(o,e)}),aa&&ea(o,m),c}(l,c,u,p);if(Le(u))return function(o,a,s,l){var c=Le(s);if("function"!=typeof c)throw Error(ae(150));if(null==(s=c.call(s)))throw Error(ae(151));for(var u=c=null,p=a,m=a=0,g=null,v=s.next();null!==p&&!v.done;m++,v=s.next()){p.index>m?(g=p,p=null):g=p.sibling;var y=f(o,p,v.value,l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(o,p),a=i(y,a,m),null===u?c=y:u.sibling=y,u=y,p=g}if(v.done)return n(o,p),aa&&ea(o,m),c;if(null===p){for(;!v.done;m++,v=s.next())null!==(v=d(o,v.value,l))&&(a=i(v,a,m),null===u?c=v:u.sibling=v,u=v);return aa&&ea(o,m),c}for(p=r(o,p);!v.done;m++,v=s.next())null!==(v=h(p,o,m,v.value,l))&&(e&&null!==v.alternate&&p.delete(null===v.key?m:v.key),a=i(v,a,m),null===u?c=v:u.sibling=v,u=v);return e&&p.forEach(function(e){return t(o,e)}),aa&&ea(o,m),c}(l,c,u,p);ba(l,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(c=o(c,u)).return=l,l=c):(n(l,c),(c=Du(u,l.mode,p)).return=l,l=c),a(l)):n(l,c)}}var ka=wa(!0),_a=wa(!1),Sa=Ei(null),Ca=null,Ea=null,Na=null;function Ia(){Na=Ea=Ca=null}function Oa(e){var t=Sa.current;Ni(Sa),e._currentValue=t}function Ma(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ja(e,t){Ca=e,Na=Ea=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(bl=!0),e.firstContext=null)}function Ta(e){var t=e._currentValue;if(Na!==e)if(e={context:e,memoizedValue:t,next:null},null===Ea){if(null===Ca)throw Error(ae(308));Ea=e,Ca.dependencies={lanes:0,firstContext:e}}else Ea=Ea.next=e;return t}var Pa=null;function Aa(e){null===Pa?Pa=[e]:Pa.push(e)}function Ra(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Aa(t)):(n.next=o.next,o.next=n),t.interleaved=n,La(e,r)}function La(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Da=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ua(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&Ic){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,La(e,n)}return null===(o=r.interleaved)?(t.next=t,Aa(r)):(t.next=o.next,o.next=t),r.interleaved=t,La(e,n)}function $a(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xn(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ha(e,t,n,r){var o=e.updateQueue;Da=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?i=c:a.next=c,a=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==i){var d=o.baseState;for(a=0,u=c=l=null,s=i;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=m.payload)?p.call(h,d,f):p))break e;d=ze({},d,f);break e;case 2:Da=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=o.effects)?o.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,a|=f;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(f=s).next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}if(null===u&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Lc|=a,e.lanes=a,e.memoizedState=d}}function Wa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(null!==o){if(r.callback=null,r=n,"function"!=typeof o)throw Error(ae(191,o));o.call(r)}}}var qa={},Ka=Ei(qa),Za=Ei(qa),Ya=Ei(qa);function Xa(e){if(e===qa)throw Error(ae(174));return e}function Ga(e,t){switch(Ii(Ya,t),Ii(Za,e),Ii(Ka,qa),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ct(null,"");break;default:t=ct(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ni(Ka),Ii(Ka,t)}function Ja(){Ni(Ka),Ni(Za),Ni(Ya)}function Qa(e){Xa(Ya.current);var t=Xa(Ka.current),n=ct(t,e.type);t!==n&&(Ii(Za,e),Ii(Ka,n))}function es(e){Za.current===e&&(Ni(Ka),Ni(Za))}var ts=Ei(0);function ns(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rs=[];function os(){for(var e=0;e<rs.length;e++)rs[e]._workInProgressVersionPrimary=null;rs.length=0}var is=we.ReactCurrentDispatcher,as=we.ReactCurrentBatchConfig,ss=0,ls=null,cs=null,us=null,ds=!1,fs=!1,hs=0,ps=0;function ms(){throw Error(ae(321))}function gs(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lo(e[n],t[n]))return!1;return!0}function vs(e,t,n,r,o,i){if(ss=i,ls=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,is.current=null===e||null===e.memoizedState?el:tl,e=n(r,o),fs){i=0;do{if(fs=!1,hs=0,25<=i)throw Error(ae(301));i+=1,us=cs=null,t.updateQueue=null,is.current=nl,e=n(r,o)}while(fs)}if(is.current=Qs,t=null!==cs&&null!==cs.next,ss=0,us=cs=ls=null,ds=!1,t)throw Error(ae(300));return e}function ys(){var e=0!==hs;return hs=0,e}function bs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===us?ls.memoizedState=us=e:us=us.next=e,us}function xs(){if(null===cs){var e=ls.alternate;e=null!==e?e.memoizedState:null}else e=cs.next;var t=null===us?ls.memoizedState:us.next;if(null!==t)us=t,cs=e;else{if(null===e)throw Error(ae(310));e={memoizedState:(cs=e).memoizedState,baseState:cs.baseState,baseQueue:cs.baseQueue,queue:cs.queue,next:null},null===us?ls.memoizedState=us=e:us=us.next=e}return us}function ws(e,t){return"function"==typeof t?t(e):t}function ks(e){var t=xs(),n=t.queue;if(null===n)throw Error(ae(311));n.lastRenderedReducer=e;var r=cs,o=r.baseQueue,i=n.pending;if(null!==i){if(null!==o){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(null!==o){i=o.next,r=r.baseState;var s=a=null,l=null,c=i;do{var u=c.lane;if((ss&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===l?(s=l=d,a=r):l=l.next=d,ls.lanes|=u,Lc|=u}c=c.next}while(null!==c&&c!==i);null===l?a=r:l.next=s,lo(r,t.memoizedState)||(bl=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(null!==(e=n.interleaved)){o=e;do{i=o.lane,ls.lanes|=i,Lc|=i,o=o.next}while(o!==e)}else null===o&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function _s(e){var t=xs(),n=t.queue;if(null===n)throw Error(ae(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(null!==o){n.pending=null;var a=o=o.next;do{i=e(i,a.action),a=a.next}while(a!==o);lo(i,t.memoizedState)||(bl=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ss(){}function Cs(e,t){var n=ls,r=xs(),o=t(),i=!lo(r.memoizedState,o);if(i&&(r.memoizedState=o,bl=!0),r=r.queue,Ds(Is.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||null!==us&&1&us.memoizedState.tag){if(n.flags|=2048,Ts(9,Ns.bind(null,n,r,o,t),void 0,null),null===Oc)throw Error(ae(349));30&ss||Es(n,t,o)}return o}function Es(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ls.updateQueue)?(t={lastEffect:null,stores:null},ls.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ns(e,t,n,r){t.value=n,t.getSnapshot=r,Os(t)&&Ms(e)}function Is(e,t,n){return n(function(){Os(t)&&Ms(e)})}function Os(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lo(e,n)}catch(r){return!0}}function Ms(e){var t=La(e,1);null!==t&&nu(t,e,1,-1)}function js(e){var t=bs();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:e},t.queue=e,e=e.dispatch=Ys.bind(null,ls,e),[t.memoizedState,e]}function Ts(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ls.updateQueue)?(t={lastEffect:null,stores:null},ls.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ps(){return xs().memoizedState}function As(e,t,n,r){var o=bs();ls.flags|=e,o.memoizedState=Ts(1|t,n,void 0,void 0===r?null:r)}function Rs(e,t,n,r){var o=xs();r=void 0===r?null:r;var i=void 0;if(null!==cs){var a=cs.memoizedState;if(i=a.destroy,null!==r&&gs(r,a.deps))return void(o.memoizedState=Ts(t,n,i,r))}ls.flags|=e,o.memoizedState=Ts(1|t,n,i,r)}function Ls(e,t){return As(8390656,8,e,t)}function Ds(e,t){return Rs(2048,8,e,t)}function zs(e,t){return Rs(4,2,e,t)}function Fs(e,t){return Rs(4,4,e,t)}function Us(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Bs(e,t,n){return n=null!=n?n.concat([e]):null,Rs(4,4,Us.bind(null,t,e),n)}function $s(){}function Vs(e,t){var n=xs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&gs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hs(e,t){var n=xs();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&gs(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ws(e,t,n){return 21&ss?(lo(n,t)||(n=vn(),ls.lanes|=n,Lc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,bl=!0),e.memoizedState=n)}function qs(e,t){var n=wn;wn=0!==n&&4>n?n:4,e(!0);var r=as.transition;as.transition={};try{e(!1),t()}finally{wn=n,as.transition=r}}function Ks(){return xs().memoizedState}function Zs(e,t,n){var r=tu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xs(e))Gs(t,n);else if(null!==(n=Ra(e,t,n,r))){nu(n,e,r,eu()),Js(n,t,r)}}function Ys(e,t,n){var r=tu(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xs(e))Gs(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,lo(s,a)){var l=t.interleaved;return null===l?(o.next=o,Aa(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(c){}null!==(n=Ra(e,t,o,r))&&(nu(n,e,r,o=eu()),Js(n,t,r))}}function Xs(e){var t=e.alternate;return e===ls||null!==t&&t===ls}function Gs(e,t){fs=ds=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Js(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,xn(e,n)}}var Qs={readContext:Ta,useCallback:ms,useContext:ms,useEffect:ms,useImperativeHandle:ms,useInsertionEffect:ms,useLayoutEffect:ms,useMemo:ms,useReducer:ms,useRef:ms,useState:ms,useDebugValue:ms,useDeferredValue:ms,useTransition:ms,useMutableSource:ms,useSyncExternalStore:ms,useId:ms,unstable_isNewReconciler:!1},el={readContext:Ta,useCallback:function(e,t){return bs().memoizedState=[e,void 0===t?null:t],e},useContext:Ta,useEffect:Ls,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,As(4194308,4,Us.bind(null,t,e),n)},useLayoutEffect:function(e,t){return As(4194308,4,e,t)},useInsertionEffect:function(e,t){return As(4,2,e,t)},useMemo:function(e,t){var n=bs();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=bs();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Zs.bind(null,ls,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},bs().memoizedState=e},useState:js,useDebugValue:$s,useDeferredValue:function(e){return bs().memoizedState=e},useTransition:function(){var e=js(!1),t=e[0];return e=qs.bind(null,e[1]),bs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ls,o=bs();if(aa){if(void 0===n)throw Error(ae(407));n=n()}else{if(n=t(),null===Oc)throw Error(ae(349));30&ss||Es(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ls(Is.bind(null,r,i,e),[e]),r.flags|=2048,Ts(9,Ns.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=bs(),t=Oc.identifierPrefix;if(aa){var n=Qi;t=":"+t+"R"+(n=(Ji&~(1<<32-ln(Ji)-1)).toString(32)+n),0<(n=hs++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ps++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tl={readContext:Ta,useCallback:Vs,useContext:Ta,useEffect:Ds,useImperativeHandle:Bs,useInsertionEffect:zs,useLayoutEffect:Fs,useMemo:Hs,useReducer:ks,useRef:Ps,useState:function(){return ks(ws)},useDebugValue:$s,useDeferredValue:function(e){return Ws(xs(),cs.memoizedState,e)},useTransition:function(){return[ks(ws)[0],xs().memoizedState]},useMutableSource:Ss,useSyncExternalStore:Cs,useId:Ks,unstable_isNewReconciler:!1},nl={readContext:Ta,useCallback:Vs,useContext:Ta,useEffect:Ds,useImperativeHandle:Bs,useInsertionEffect:zs,useLayoutEffect:Fs,useMemo:Hs,useReducer:_s,useRef:Ps,useState:function(){return _s(ws)},useDebugValue:$s,useDeferredValue:function(e){var t=xs();return null===cs?t.memoizedState=e:Ws(t,cs.memoizedState,e)},useTransition:function(){return[_s(ws)[0],xs().memoizedState]},useMutableSource:Ss,useSyncExternalStore:Cs,useId:Ks,unstable_isNewReconciler:!1};function rl(e,t){if(e&&e.defaultProps){for(var n in t=ze({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function ol(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:ze({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var il={isMounted:function(e){return!!(e=e._reactInternals)&&Vt(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=eu(),o=tu(e),i=Ua(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=Ba(e,i,o))&&(nu(t,e,o,r),$a(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=eu(),o=tu(e),i=Ua(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Ba(e,i,o))&&(nu(t,e,o,r),$a(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=eu(),r=tu(e),o=Ua(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ba(e,o,r))&&(nu(t,e,r,n),$a(t,e,r))}};function al(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!t.prototype||!t.prototype.isPureReactComponent||(!co(n,r)||!co(o,i))}function sl(e,t,n){var r=!1,o=Oi,i=t.contextType;return"object"==typeof i&&null!==i?i=Ta(i):(o=Ai(t)?Ti:Mi.current,i=(r=null!=(r=t.contextTypes))?Pi(e,o):Oi),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=il,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ll(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&il.enqueueReplaceState(t,t.state,null)}function cl(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},za(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=Ta(i):(i=Ai(t)?Ti:Mi.current,o.context=Pi(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(ol(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&il.enqueueReplaceState(o,o.state,null),Ha(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function ul(e,t){try{var n="",r=t;do{n+=$e(r),r=r.return}while(r);var o=n}catch(i){o="\nError generating stack: "+i.message+"\n"+i.stack}return{value:e,source:t,stack:o,digest:null}}function dl(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}var fl="function"==typeof WeakMap?WeakMap:Map;function hl(e,t,n){(n=Ua(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hc||(Hc=!0,Wc=r)},n}function pl(e,t,n){(n=Ua(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===qc?qc=new Set([this]):qc.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ml(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fl;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Cu.bind(null,e,t,n),t.then(e,e))}function gl(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function vl(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Ua(-1,1)).tag=2,Ba(n,t,1))),n.lanes|=1),e)}var yl=we.ReactCurrentOwner,bl=!1;function xl(e,t,n,r){t.child=null===e?_a(t,null,n,r):ka(t,e.child,n,r)}function wl(e,t,n,r,o){n=n.render;var i=t.ref;return ja(t,o),r=vs(e,t,n,r,i,o),n=ys(),null===e||bl?(aa&&n&&na(t),t.flags|=1,xl(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hl(e,t,o))}function kl(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Tu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Au(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,_l(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:co)(a,r)&&e.ref===t.ref)return Hl(e,t,o)}return t.flags|=1,(e=Pu(i,r)).ref=t.ref,e.return=t,t.child=e}function _l(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(co(i,r)&&e.ref===t.ref){if(bl=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,Hl(e,t,o);131072&e.flags&&(bl=!0)}}return El(e,t,n,r,o)}function Sl(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ii(Pc,Tc),Tc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Ii(Pc,Tc),Tc|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ii(Pc,Tc),Tc|=n;else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ii(Pc,Tc),Tc|=r;return xl(e,t,o,n),t.child}function Cl(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function El(e,t,n,r,o){var i=Ai(n)?Ti:Mi.current;return i=Pi(t,i),ja(t,o),n=vs(e,t,n,r,i,o),r=ys(),null===e||bl?(aa&&r&&na(t),t.flags|=1,xl(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Hl(e,t,o))}function Nl(e,t,n,r,o){if(Ai(n)){var i=!0;zi(t)}else i=!1;if(ja(t,o),null===t.stateNode)Vl(e,t),sl(t,n,r),cl(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Ta(c):c=Pi(t,c=Ai(n)?Ti:Mi.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&ll(t,a,r,c),Da=!1;var f=t.memoizedState;a.state=f,Ha(t,r,a,o),l=t.memoizedState,s!==r||f!==l||ji.current||Da?("function"==typeof u&&(ol(t,n,u,r),l=t.memoizedState),(s=Da||al(t,n,s,r,f,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fa(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:rl(t.type,s),a.props=c,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Ta(l):l=Pi(t,l=Ai(n)?Ti:Mi.current);var h=n.getDerivedStateFromProps;(u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&ll(t,a,r,l),Da=!1,f=t.memoizedState,a.state=f,Ha(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||ji.current||Da?("function"==typeof h&&(ol(t,n,h,r),p=t.memoizedState),(c=Da||al(t,n,c,r,f,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Il(e,t,n,r,i,o)}function Il(e,t,n,r,o,i){Cl(e,t);var a=!!(128&t.flags);if(!r&&!a)return o&&Fi(t,n,!1),Hl(e,t,i);r=t.stateNode,yl.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=ka(t,e.child,null,i),t.child=ka(t,null,s,i)):xl(e,t,s,i),t.memoizedState=r.state,o&&Fi(t,n,!0),t.child}function Ol(e){var t=e.stateNode;t.pendingContext?Li(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Li(0,t.context,!1),Ga(e,t.containerInfo)}function Ml(e,t,n,r,o){return ma(),ga(o),t.flags|=256,xl(e,t,n,r),t.child}var jl,Tl,Pl,Al,Rl={dehydrated:null,treeContext:null,retryLane:0};function Ll(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dl(e,t,n){var r,o=t.pendingProps,i=ts.current,a=!1,s=!!(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&!!(2&i)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Ii(ts,1&i),null===e)return da(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=o.children,e=o.fallback,a?(o=t.mode,a=t.child,s={mode:"hidden",children:s},1&o||null===a?a=Lu(s,o,0,null):(a.childLanes=0,a.pendingProps=s),e=Ru(e,o,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ll(n),t.memoizedState=Rl,e):zl(t,s));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,a){if(n)return 256&t.flags?(t.flags&=-257,Fl(e,t,a,r=dl(Error(ae(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Lu({mode:"visible",children:r.children},o,0,null),(i=Ru(i,o,a,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,1&t.mode&&ka(t,e.child,null,a),t.child.memoizedState=Ll(a),t.memoizedState=Rl,i);if(!(1&t.mode))return Fl(e,t,a,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var s=r.dgst;return r=s,Fl(e,t,a,r=dl(i=Error(ae(419)),r,void 0))}if(s=0!==(a&e.childLanes),bl||s){if(null!==(r=Oc)){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(r.suspendedLanes|a))?0:o)&&o!==i.retryLane&&(i.retryLane=o,La(e,o),nu(r,e,o,-1))}return mu(),Fl(e,t,a,r=dl(Error(ae(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=Nu.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ia=di(o.nextSibling),oa=t,aa=!0,sa=null,null!==e&&(Yi[Xi++]=Ji,Yi[Xi++]=Qi,Yi[Xi++]=Gi,Ji=e.id,Qi=e.overflow,Gi=t),t=zl(t,r.children),t.flags|=4096,t)}(e,t,s,o,r,i,n);if(a){a=o.fallback,s=t.mode,r=(i=e.child).sibling;var l={mode:"hidden",children:o.children};return 1&s||t.child===i?(o=Pu(i,l)).subtreeFlags=14680064&i.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=l,t.deletions=null),null!==r?a=Pu(r,a):(a=Ru(a,s,n,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,s=null===(s=e.child.memoizedState)?Ll(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=Rl,o}return e=(a=e.child).sibling,o=Pu(a,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function zl(e,t){return(t=Lu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fl(e,t,n,r){return null!==r&&ga(r),ka(t,e.child,null,n),(e=zl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ul(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),Ma(e.return,t,n)}function Bl(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function $l(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xl(e,t,r.children,n),2&(r=ts.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ul(e,n,t);else if(19===e.tag)Ul(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ii(ts,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ns(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bl(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ns(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bl(t,!0,n,null,i);break;case"together":Bl(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Vl(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Lc|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(ae(153));if(null!==t.child){for(n=Pu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Pu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Wl(e,t){if(!aa)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ql(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Kl(e,t,n){var r=t.pendingProps;switch(ra(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ql(t),null;case 1:case 17:return Ai(t.type)&&Ri(),ql(t),null;case 3:return r=t.stateNode,Ja(),Ni(ji),Ni(Mi),os(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ha(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==sa&&(au(sa),sa=null))),Tl(e,t),ql(t),null;case 5:es(t);var o=Xa(Ya.current);if(n=t.type,null!==e&&null!=t.stateNode)Pl(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(ae(166));return ql(t),null}if(e=Xa(Ka.current),ha(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[pi]=t,r[mi]=i,e=!!(1&t.mode),n){case"dialog":Bo("cancel",r),Bo("close",r);break;case"iframe":case"object":case"embed":Bo("load",r);break;case"video":case"audio":for(o=0;o<Do.length;o++)Bo(Do[o],r);break;case"source":Bo("error",r);break;case"img":case"image":case"link":Bo("error",r),Bo("load",r);break;case"details":Bo("toggle",r);break;case"input":Ge(r,i),Bo("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Bo("invalid",r);break;case"textarea":it(r,i),Bo("invalid",r)}for(var a in bt(n,i),o=null,i)if(i.hasOwnProperty(a)){var s=i[a];"children"===a?"string"==typeof s?r.textContent!==s&&(!0!==i.suppressHydrationWarning&&ei(r.textContent,s,e),o=["children",s]):"number"==typeof s&&r.textContent!==""+s&&(!0!==i.suppressHydrationWarning&&ei(r.textContent,s,e),o=["children",""+s]):le.hasOwnProperty(a)&&null!=s&&"onScroll"===a&&Bo("scroll",r)}switch(n){case"input":Ke(r),et(r,i,!0);break;case"textarea":Ke(r),st(r);break;case"select":case"option":break;default:"function"==typeof i.onClick&&(r.onclick=ti)}r=o,t.updateQueue=r,null!==r&&(t.flags|=4)}else{a=9===o.nodeType?o:o.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=lt(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[pi]=t,e[mi]=r,jl(e,t,!1,!1),t.stateNode=e;e:{switch(a=xt(n,r),n){case"dialog":Bo("cancel",e),Bo("close",e),o=r;break;case"iframe":case"object":case"embed":Bo("load",e),o=r;break;case"video":case"audio":for(o=0;o<Do.length;o++)Bo(Do[o],e);o=r;break;case"source":Bo("error",e),o=r;break;case"img":case"image":case"link":Bo("error",e),Bo("load",e),o=r;break;case"details":Bo("toggle",e),o=r;break;case"input":Ge(e,r),o=Xe(e,r),Bo("invalid",e);break;case"option":default:o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ze({},r,{value:void 0}),Bo("invalid",e);break;case"textarea":it(e,r),o=ot(e,r),Bo("invalid",e)}for(i in bt(n,o),s=o)if(s.hasOwnProperty(i)){var l=s[i];"style"===i?vt(e,l):"dangerouslySetInnerHTML"===i?null!=(l=l?l.__html:void 0)&&ft(e,l):"children"===i?"string"==typeof l?("textarea"!==n||""!==l)&&ht(e,l):"number"==typeof l&&ht(e,""+l):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(le.hasOwnProperty(i)?null!=l&&"onScroll"===i&&Bo("scroll",e):null!=l&&xe(e,i,l,a))}switch(n){case"input":Ke(e),et(e,r,!1);break;case"textarea":Ke(e),st(e);break;case"option":null!=r.value&&e.setAttribute("value",""+We(r.value));break;case"select":e.multiple=!!r.multiple,null!=(i=r.value)?rt(e,!!r.multiple,i,!1):null!=r.defaultValue&&rt(e,!!r.multiple,r.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=ti)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return ql(t),null;case 6:if(e&&null!=t.stateNode)Al(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(ae(166));if(n=Xa(Ya.current),Xa(Ka.current),ha(t)){if(r=t.stateNode,n=t.memoizedProps,r[pi]=t,(i=r.nodeValue!==n)&&null!==(e=oa))switch(e.tag){case 3:ei(r.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&ei(r.nodeValue,n,!!(1&e.mode))}i&&(t.flags|=4)}else(r=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[pi]=t,t.stateNode=r}return ql(t),null;case 13:if(Ni(ts),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(aa&&null!==ia&&1&t.mode&&!(128&t.flags))pa(),ma(),t.flags|=98560,i=!1;else if(i=ha(t),null!==r&&null!==r.dehydrated){if(null===e){if(!i)throw Error(ae(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(ae(317));i[pi]=t}else ma(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;ql(t),i=!1}else null!==sa&&(au(sa),sa=null),i=!0;if(!i)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((r=null!==r)!==(null!==e&&null!==e.memoizedState)&&r&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ts.current?0===Ac&&(Ac=3):mu())),null!==t.updateQueue&&(t.flags|=4),ql(t),null);case 4:return Ja(),Tl(e,t),null===e&&Ho(t.stateNode.containerInfo),ql(t),null;case 10:return Oa(t.type._context),ql(t),null;case 19:if(Ni(ts),null===(i=t.memoizedState))return ql(t),null;if(r=!!(128&t.flags),null===(a=i.rendering))if(r)Wl(i,!1);else{if(0!==Ac||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(a=ns(e))){for(t.flags|=128,Wl(i,!1),null!==(r=a.updateQueue)&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;null!==n;)e=r,(i=n).flags&=14680066,null===(a=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ii(ts,1&ts.current|2),t.child}e=e.sibling}null!==i.tail&&Jt()>$c&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ns(a))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Wl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!aa)return ql(t),null}else 2*Jt()-i.renderingStartTime>$c&&1073741824!==n&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(n=i.last)?n.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Jt(),t.sibling=null,n=ts.current,Ii(ts,r?1&n|2:1&n),t):(ql(t),null);case 22:case 23:return du(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&1&t.mode?!!(1073741824&Tc)&&(ql(t),6&t.subtreeFlags&&(t.flags|=8192)):ql(t),null;case 24:case 25:return null}throw Error(ae(156,t.tag))}function Zl(e,t){switch(ra(t),t.tag){case 1:return Ai(t.type)&&Ri(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ja(),Ni(ji),Ni(Mi),os(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return es(t),null;case 13:if(Ni(ts),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(ae(340));ma()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ni(ts),null;case 4:return Ja(),null;case 10:return Oa(t.type._context),null;case 22:case 23:return du(),null;default:return null}}jl=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Tl=function(){},Pl=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Xa(Ka.current);var i,a=null;switch(n){case"input":o=Xe(e,o),r=Xe(e,r),a=[];break;case"select":o=ze({},o,{value:void 0}),r=ze({},r,{value:void 0}),a=[];break;case"textarea":o=ot(e,o),r=ot(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=ti)}for(c in bt(n,r),n=null,o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&null!=o[c])if("style"===c){var s=o[c];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(le.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in r){var l=r[c];if(s=null!=o?o[c]:void 0,r.hasOwnProperty(c)&&l!==s&&(null!=l||null!=s))if("style"===c)if(s){for(i in s)!s.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&s[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(a||(a=[]),a.push(c,n)),n=l;else"dangerouslySetInnerHTML"===c?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(c,l)):"children"===c?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(c,""+l):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(le.hasOwnProperty(c)?(null!=l&&"onScroll"===c&&Bo("scroll",e),a||s===l||(a=[])):(a=a||[]).push(c,l))}n&&(a=a||[]).push("style",n);var c=a;(t.updateQueue=c)&&(t.flags|=4)}},Al=function(e,t,n,r){n!==r&&(t.flags|=4)};var Yl=!1,Xl=!1,Gl="function"==typeof WeakSet?WeakSet:Set,Jl=null;function Ql(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(r){Su(e,t,r)}else n.current=null}function ec(e,t,n){try{n()}catch(r){Su(e,t,r)}}var tc=!1;function nc(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&ec(t,n,i)}o=o.next}while(o!==r)}}function rc(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function oc(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function ic(e){var t=e.alternate;null!==t&&(e.alternate=null,ic(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[pi],delete t[mi],delete t[vi],delete t[yi],delete t[bi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ac(e){return 5===e.tag||3===e.tag||4===e.tag}function sc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||ac(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function lc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=ti));else if(4!==r&&null!==(e=e.child))for(lc(e,t,n),e=e.sibling;null!==e;)lc(e,t,n),e=e.sibling}function cc(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(cc(e,t,n),e=e.sibling;null!==e;)cc(e,t,n),e=e.sibling}var uc=null,dc=!1;function fc(e,t,n){for(n=n.child;null!==n;)hc(e,t,n),n=n.sibling}function hc(e,t,n){if(sn&&"function"==typeof sn.onCommitFiberUnmount)try{sn.onCommitFiberUnmount(an,n)}catch(s){}switch(n.tag){case 5:Xl||Ql(n,t);case 6:var r=uc,o=dc;uc=null,fc(e,t,n),dc=o,null!==(uc=r)&&(dc?(e=uc,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):uc.removeChild(n.stateNode));break;case 18:null!==uc&&(dc?(e=uc,n=n.stateNode,8===e.nodeType?ui(e.parentNode,n):1===e.nodeType&&ui(e,n),Hn(e)):ui(uc,n.stateNode));break;case 4:r=uc,o=dc,uc=n.stateNode.containerInfo,dc=!0,fc(e,t,n),uc=r,dc=o;break;case 0:case 11:case 14:case 15:if(!Xl&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(2&i||4&i)&&ec(n,t,a),o=o.next}while(o!==r)}fc(e,t,n);break;case 1:if(!Xl&&(Ql(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Su(n,t,s)}fc(e,t,n);break;case 21:fc(e,t,n);break;case 22:1&n.mode?(Xl=(r=Xl)||null!==n.memoizedState,fc(e,t,n),Xl=r):fc(e,t,n);break;default:fc(e,t,n)}}function pc(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Gl),t.forEach(function(t){var r=Iu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function mc(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,s=a;e:for(;null!==s;){switch(s.tag){case 5:uc=s.stateNode,dc=!1;break e;case 3:case 4:uc=s.stateNode.containerInfo,dc=!0;break e}s=s.return}if(null===uc)throw Error(ae(160));hc(i,a,o),uc=null,dc=!1;var l=o.alternate;null!==l&&(l.return=null),o.return=null}catch(c){Su(o,t,c)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gc(t,e),t=t.sibling}function gc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(mc(t,e),vc(e),4&r){try{nc(3,e,e.return),rc(3,e)}catch(DC){Su(e,e.return,DC)}try{nc(5,e,e.return)}catch(DC){Su(e,e.return,DC)}}break;case 1:mc(t,e),vc(e),512&r&&null!==n&&Ql(n,n.return);break;case 5:if(mc(t,e),vc(e),512&r&&null!==n&&Ql(n,n.return),32&e.flags){var o=e.stateNode;try{ht(o,"")}catch(DC){Su(e,e.return,DC)}}if(4&r&&null!=(o=e.stateNode)){var i=e.memoizedProps,a=null!==n?n.memoizedProps:i,s=e.type,l=e.updateQueue;if(e.updateQueue=null,null!==l)try{"input"===s&&"radio"===i.type&&null!=i.name&&Je(o,i),xt(s,a);var c=xt(s,i);for(a=0;a<l.length;a+=2){var u=l[a],d=l[a+1];"style"===u?vt(o,d):"dangerouslySetInnerHTML"===u?ft(o,d):"children"===u?ht(o,d):xe(o,u,d,c)}switch(s){case"input":Qe(o,i);break;case"textarea":at(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;null!=h?rt(o,!!i.multiple,h,!1):f!==!!i.multiple&&(null!=i.defaultValue?rt(o,!!i.multiple,i.defaultValue,!0):rt(o,!!i.multiple,i.multiple?[]:"",!1))}o[mi]=i}catch(DC){Su(e,e.return,DC)}}break;case 6:if(mc(t,e),vc(e),4&r){if(null===e.stateNode)throw Error(ae(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(DC){Su(e,e.return,DC)}}break;case 3:if(mc(t,e),vc(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{Hn(t.containerInfo)}catch(DC){Su(e,e.return,DC)}break;case 4:default:mc(t,e),vc(e);break;case 13:mc(t,e),vc(e),8192&(o=e.child).flags&&(i=null!==o.memoizedState,o.stateNode.isHidden=i,!i||null!==o.alternate&&null!==o.alternate.memoizedState||(Bc=Jt())),4&r&&pc(e);break;case 22:if(u=null!==n&&null!==n.memoizedState,1&e.mode?(Xl=(c=Xl)||u,mc(t,e),Xl=c):mc(t,e),vc(e),8192&r){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!u&&1&e.mode)for(Jl=e,u=e.child;null!==u;){for(d=Jl=u;null!==Jl;){switch(h=(f=Jl).child,f.tag){case 0:case 11:case 14:case 15:nc(4,f,f.return);break;case 1:Ql(f,f.return);var p=f.stateNode;if("function"==typeof p.componentWillUnmount){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(DC){Su(r,n,DC)}}break;case 5:Ql(f,f.return);break;case 22:if(null!==f.memoizedState){wc(d);continue}}null!==h?(h.return=f,Jl=h):wc(d)}u=u.sibling}e:for(u=null,d=e;;){if(5===d.tag){if(null===u){u=d;try{o=d.stateNode,c?"function"==typeof(i=o.style).setProperty?i.setProperty("display","none","important"):i.display="none":(s=d.stateNode,a=null!=(l=d.memoizedProps.style)&&l.hasOwnProperty("display")?l.display:null,s.style.display=gt("display",a))}catch(DC){Su(e,e.return,DC)}}}else if(6===d.tag){if(null===u)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(DC){Su(e,e.return,DC)}}else if((22!==d.tag&&23!==d.tag||null===d.memoizedState||d===e)&&null!==d.child){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;null===d.sibling;){if(null===d.return||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:mc(t,e),vc(e),4&r&&pc(e);case 21:}}function vc(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(ac(n)){var r=n;break e}n=n.return}throw Error(ae(160))}switch(r.tag){case 5:var o=r.stateNode;32&r.flags&&(ht(o,""),r.flags&=-33),cc(e,sc(e),o);break;case 3:case 4:var i=r.stateNode.containerInfo;lc(e,sc(e),i);break;default:throw Error(ae(161))}}catch(a){Su(e,e.return,a)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function yc(e,t,n){Jl=e,bc(e)}function bc(e,t,n){for(var r=!!(1&e.mode);null!==Jl;){var o=Jl,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Yl;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||Xl;s=Yl;var c=Xl;if(Yl=a,(Xl=l)&&!c)for(Jl=o;null!==Jl;)l=(a=Jl).child,22===a.tag&&null!==a.memoizedState?kc(o):null!==l?(l.return=a,Jl=l):kc(o);for(;null!==i;)Jl=i,bc(i),i=i.sibling;Jl=o,Yl=s,Xl=c}xc(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Jl=i):xc(e)}}function xc(e){for(;null!==Jl;){var t=Jl;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Xl||rc(5,t);break;case 1:var r=t.stateNode;if(4&t.flags&&!Xl)if(null===n)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:rl(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&Wa(t,i,r);break;case 3:var a=t.updateQueue;if(null!==a){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}Wa(t,a,n)}break;case 5:var s=t.stateNode;if(null===n&&4&t.flags){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var u=c.memoizedState;if(null!==u){var d=u.dehydrated;null!==d&&Hn(d)}}}break;default:throw Error(ae(163))}Xl||512&t.flags&&oc(t)}catch(f){Su(t,t.return,f)}}if(t===e){Jl=null;break}if(null!==(n=t.sibling)){n.return=t.return,Jl=n;break}Jl=t.return}}function wc(e){for(;null!==Jl;){var t=Jl;if(t===e){Jl=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Jl=n;break}Jl=t.return}}function kc(e){for(;null!==Jl;){var t=Jl;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rc(4,t)}catch(l){Su(t,n,l)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(l){Su(t,o,l)}}var i=t.return;try{oc(t)}catch(l){Su(t,i,l)}break;case 5:var a=t.return;try{oc(t)}catch(l){Su(t,a,l)}}}catch(l){Su(t,t.return,l)}if(t===e){Jl=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Jl=s;break}Jl=t.return}}var _c,Sc=Math.ceil,Cc=we.ReactCurrentDispatcher,Ec=we.ReactCurrentOwner,Nc=we.ReactCurrentBatchConfig,Ic=0,Oc=null,Mc=null,jc=0,Tc=0,Pc=Ei(0),Ac=0,Rc=null,Lc=0,Dc=0,zc=0,Fc=null,Uc=null,Bc=0,$c=1/0,Vc=null,Hc=!1,Wc=null,qc=null,Kc=!1,Zc=null,Yc=0,Xc=0,Gc=null,Jc=-1,Qc=0;function eu(){return 6&Ic?Jt():-1!==Jc?Jc:Jc=Jt()}function tu(e){return 1&e.mode?2&Ic&&0!==jc?jc&-jc:null!==va.transition?(0===Qc&&(Qc=vn()),Qc):0!==(e=wn)?e:e=void 0===(e=window.event)?16:Jn(e.type):1}function nu(e,t,n,r){if(50<Xc)throw Xc=0,Gc=null,Error(ae(185));bn(e,n,r),2&Ic&&e===Oc||(e===Oc&&(!(2&Ic)&&(Dc|=n),4===Ac&&su(e,jc)),ru(e,r),1===n&&0===Ic&&!(1&t.mode)&&($c=Jt()+500,Bi&&Hi()))}function ru(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-ln(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=mn(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=pn(e,e===Oc?jc:0);if(0===r)null!==n&&Yt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&Yt(n),1===t)0===e.tag?function(e){Bi=!0,Vi(e)}(lu.bind(null,e)):Vi(lu.bind(null,e)),li(function(){!(6&Ic)&&Hi()}),n=null;else{switch(kn(r)){case 1:n=en;break;case 4:n=tn;break;case 16:default:n=nn;break;case 536870912:n=on}n=Ou(n,ou.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ou(e,t){if(Jc=-1,Qc=0,6&Ic)throw Error(ae(327));var n=e.callbackNode;if(ku()&&e.callbackNode!==n)return null;var r=pn(e,e===Oc?jc:0);if(0===r)return null;if(30&r||0!==(r&e.expiredLanes)||t)t=gu(e,r);else{t=r;var o=Ic;Ic|=2;var i=pu();for(Oc===e&&jc===t||(Vc=null,$c=Jt()+500,fu(e,t));;)try{yu();break}catch(s){hu(e,s)}Ia(),Cc.current=i,Ic=o,null!==Mc?t=0:(Oc=null,jc=0,t=Ac)}if(0!==t){if(2===t&&(0!==(o=gn(e))&&(r=o,t=iu(e,o))),1===t)throw n=Rc,fu(e,0),su(e,r),ru(e,Jt()),n;if(6===t)su(e,r);else{if(o=e.current.alternate,!(30&r||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!lo(i(),o))return!1}catch(a){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)||(t=gu(e,r),2===t&&(i=gn(e),0!==i&&(r=i,t=iu(e,i))),1!==t)))throw n=Rc,fu(e,0),su(e,r),ru(e,Jt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(ae(345));case 2:case 5:wu(e,Uc,Vc);break;case 3:if(su(e,r),(130023424&r)===r&&10<(t=Bc+500-Jt())){if(0!==pn(e,0))break;if(((o=e.suspendedLanes)&r)!==r){eu(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ii(wu.bind(null,e,Uc,Vc),t);break}wu(e,Uc,Vc);break;case 4:if(su(e,r),(4194240&r)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-ln(r);i=1<<a,(a=t[a])>o&&(o=a),r&=~i}if(r=o,10<(r=(120>(r=Jt()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Sc(r/1960))-r)){e.timeoutHandle=ii(wu.bind(null,e,Uc,Vc),r);break}wu(e,Uc,Vc);break;default:throw Error(ae(329))}}}return ru(e,Jt()),e.callbackNode===n?ou.bind(null,e):null}function iu(e,t){var n=Fc;return e.current.memoizedState.isDehydrated&&(fu(e,t).flags|=256),2!==(e=gu(e,t))&&(t=Uc,Uc=n,null!==t&&au(t)),e}function au(e){null===Uc?Uc=e:Uc.push.apply(Uc,e)}function su(e,t){for(t&=~zc,t&=~Dc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ln(t),r=1<<n;e[n]=-1,t&=~r}}function lu(e){if(6&Ic)throw Error(ae(327));ku();var t=pn(e,0);if(!(1&t))return ru(e,Jt()),null;var n=gu(e,t);if(0!==e.tag&&2===n){var r=gn(e);0!==r&&(t=r,n=iu(e,r))}if(1===n)throw n=Rc,fu(e,0),su(e,t),ru(e,Jt()),n;if(6===n)throw Error(ae(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wu(e,Uc,Vc),ru(e,Jt()),null}function cu(e,t){var n=Ic;Ic|=1;try{return e(t)}finally{0===(Ic=n)&&($c=Jt()+500,Bi&&Hi())}}function uu(e){null!==Zc&&0===Zc.tag&&!(6&Ic)&&ku();var t=Ic;Ic|=1;var n=Nc.transition,r=wn;try{if(Nc.transition=null,wn=1,e)return e()}finally{wn=r,Nc.transition=n,!(6&(Ic=t))&&Hi()}}function du(){Tc=Pc.current,Ni(Pc)}function fu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ai(n)),null!==Mc)for(n=Mc.return;null!==n;){var r=n;switch(ra(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Ri();break;case 3:Ja(),Ni(ji),Ni(Mi),os();break;case 5:es(r);break;case 4:Ja();break;case 13:case 19:Ni(ts);break;case 10:Oa(r.type._context);break;case 22:case 23:du()}n=n.return}if(Oc=e,Mc=e=Pu(e.current,null),jc=Tc=t,Ac=0,Rc=null,zc=Dc=Lc=0,Uc=Fc=null,null!==Pa){for(t=0;t<Pa.length;t++)if(null!==(r=(n=Pa[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Pa=null}return e}function hu(e,t){for(;;){var n=Mc;try{if(Ia(),is.current=Qs,ds){for(var r=ls.memoizedState;null!==r;){var o=r.queue;null!==o&&(o.pending=null),r=r.next}ds=!1}if(ss=0,us=cs=ls=null,fs=!1,hs=0,Ec.current=null,null===n||null===n.return){Ac=1,Rc=t,Mc=null;break}e:{var i=e,a=n.return,s=n,l=t;if(t=jc,s.flags|=32768,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l,u=s,d=u.tag;if(!(1&u.mode||0!==d&&11!==d&&15!==d)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=gl(a);if(null!==h){h.flags&=-257,vl(h,a,s,0,t),1&h.mode&&ml(i,c,t),l=c;var p=(t=h).updateQueue;if(null===p){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}if(!(1&t)){ml(i,c,t),mu();break e}l=Error(ae(426))}else if(aa&&1&s.mode){var g=gl(a);if(null!==g){!(65536&g.flags)&&(g.flags|=256),vl(g,a,s,0,t),ga(ul(l,s));break e}}i=l=ul(l,s),4!==Ac&&(Ac=2),null===Fc?Fc=[i]:Fc.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,Va(i,hl(0,l,t));break e;case 1:s=l;var v=i.type,y=i.stateNode;if(!(128&i.flags||"function"!=typeof v.getDerivedStateFromError&&(null===y||"function"!=typeof y.componentDidCatch||null!==qc&&qc.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t,Va(i,pl(i,s,t));break e}}i=i.return}while(null!==i)}xu(n)}catch(b){t=b,Mc===n&&null!==n&&(Mc=n=n.return);continue}break}}function pu(){var e=Cc.current;return Cc.current=Qs,null===e?Qs:e}function mu(){0!==Ac&&3!==Ac&&2!==Ac||(Ac=4),null===Oc||!(268435455&Lc)&&!(268435455&Dc)||su(Oc,jc)}function gu(e,t){var n=Ic;Ic|=2;var r=pu();for(Oc===e&&jc===t||(Vc=null,fu(e,t));;)try{vu();break}catch(rp){hu(e,rp)}if(Ia(),Ic=n,Cc.current=r,null!==Mc)throw Error(ae(261));return Oc=null,jc=0,Ac}function vu(){for(;null!==Mc;)bu(Mc)}function yu(){for(;null!==Mc&&!Xt();)bu(Mc)}function bu(e){var t=_c(e.alternate,e,Tc);e.memoizedProps=e.pendingProps,null===t?xu(e):Mc=t,Ec.current=null}function xu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Zl(n,t)))return n.flags&=32767,void(Mc=n);if(null===e)return Ac=6,void(Mc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Kl(n,t,Tc)))return void(Mc=n);if(null!==(t=t.sibling))return void(Mc=t);Mc=t=e}while(null!==t);0===Ac&&(Ac=5)}function wu(e,t,n){var r=wn,o=Nc.transition;try{Nc.transition=null,wn=1,function(e,t,n,r){do{ku()}while(null!==Zc);if(6&Ic)throw Error(ae(327));n=e.finishedWork;var o=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ae(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-ln(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,i),e===Oc&&(Mc=Oc=null,jc=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Kc||(Kc=!0,Ou(nn,function(){return ku(),null})),i=!!(15990&n.flags),!!(15990&n.subtreeFlags)||i){i=Nc.transition,Nc.transition=null;var a=wn;wn=1;var s=Ic;Ic|=4,Ec.current=null,function(e,t){if(ni=qn,mo(e=po())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(x){n=null;break e}var a=0,s=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var h;d!==n||0!==o&&3!==d.nodeType||(s=a+o),d!==i||0!==r&&3!==d.nodeType||(l=a+r),3===d.nodeType&&(a+=d.nodeValue.length),null!==(h=d.firstChild);)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++c===o&&(s=a),f===i&&++u===r&&(l=a),null!==(h=d.nextSibling))break;f=(d=f).parentNode}d=h}n=-1===s||-1===l?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ri={focusedElem:e,selectionRange:n},qn=!1,Jl=t;null!==Jl;)if(e=(t=Jl).child,1028&t.subtreeFlags&&null!==e)e.return=t,Jl=e;else for(;null!==Jl;){t=Jl;try{var p=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==p){var m=p.memoizedProps,g=p.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?m:rl(t.type,m),g);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;default:throw Error(ae(163))}}catch(x){Su(t,t.return,x)}if(null!==(e=t.sibling)){e.return=t.return,Jl=e;break}Jl=t.return}p=tc,tc=!1}(e,n),gc(n,e),go(ri),qn=!!ni,ri=ni=null,e.current=n,yc(n),Gt(),Ic=s,wn=a,Nc.transition=i}else e.current=n;if(Kc&&(Kc=!1,Zc=e,Yc=o),i=e.pendingLanes,0===i&&(qc=null),function(e){if(sn&&"function"==typeof sn.onCommitFiberRoot)try{sn.onCommitFiberRoot(an,e,void 0,!(128&~e.current.flags))}catch(t){}}(n.stateNode),ru(e,Jt()),null!==t)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Hc)throw Hc=!1,e=Wc,Wc=null,e;!!(1&Yc)&&0!==e.tag&&ku(),i=e.pendingLanes,1&i?e===Gc?Xc++:(Xc=0,Gc=e):Xc=0,Hi()}(e,t,n,r)}finally{Nc.transition=o,wn=r}return null}function ku(){if(null!==Zc){var e=kn(Yc),t=Nc.transition,n=wn;try{if(Nc.transition=null,wn=16>e?16:e,null===Zc)var r=!1;else{if(e=Zc,Zc=null,Yc=0,6&Ic)throw Error(ae(331));var o=Ic;for(Ic|=4,Jl=e.current;null!==Jl;){var i=Jl,a=i.child;if(16&Jl.flags){var s=i.deletions;if(null!==s){for(var l=0;l<s.length;l++){var c=s[l];for(Jl=c;null!==Jl;){var u=Jl;switch(u.tag){case 0:case 11:case 15:nc(8,u,i)}var d=u.child;if(null!==d)d.return=u,Jl=d;else for(;null!==Jl;){var f=(u=Jl).sibling,h=u.return;if(ic(u),u===c){Jl=null;break}if(null!==f){f.return=h,Jl=f;break}Jl=h}}}var p=i.alternate;if(null!==p){var m=p.child;if(null!==m){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(null!==m)}}Jl=i}}if(2064&i.subtreeFlags&&null!==a)a.return=i,Jl=a;else e:for(;null!==Jl;){if(2048&(i=Jl).flags)switch(i.tag){case 0:case 11:case 15:nc(9,i,i.return)}var v=i.sibling;if(null!==v){v.return=i.return,Jl=v;break e}Jl=i.return}}var y=e.current;for(Jl=y;null!==Jl;){var b=(a=Jl).child;if(2064&a.subtreeFlags&&null!==b)b.return=a,Jl=b;else e:for(a=y;null!==Jl;){if(2048&(s=Jl).flags)try{switch(s.tag){case 0:case 11:case 15:rc(9,s)}}catch(w){Su(s,s.return,w)}if(s===a){Jl=null;break e}var x=s.sibling;if(null!==x){x.return=s.return,Jl=x;break e}Jl=s.return}}if(Ic=o,Hi(),sn&&"function"==typeof sn.onPostCommitFiberRoot)try{sn.onPostCommitFiberRoot(an,e)}catch(w){}r=!0}return r}finally{wn=n,Nc.transition=t}}return!1}function _u(e,t,n){e=Ba(e,t=hl(0,t=ul(n,t),1),1),t=eu(),null!==e&&(bn(e,1,t),ru(e,t))}function Su(e,t,n){if(3===e.tag)_u(e,e,n);else for(;null!==t;){if(3===t.tag){_u(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===qc||!qc.has(r))){t=Ba(t,e=pl(t,e=ul(n,e),1),1),e=eu(),null!==t&&(bn(t,1,e),ru(t,e));break}}t=t.return}}function Cu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=eu(),e.pingedLanes|=e.suspendedLanes&n,Oc===e&&(jc&n)===n&&(4===Ac||3===Ac&&(130023424&jc)===jc&&500>Jt()-Bc?fu(e,0):zc|=n),ru(e,t)}function Eu(e,t){0===t&&(1&e.mode?(t=fn,!(130023424&(fn<<=1))&&(fn=4194304)):t=1);var n=eu();null!==(e=La(e,t))&&(bn(e,t,n),ru(e,n))}function Nu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Eu(e,n)}function Iu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ae(314))}null!==r&&r.delete(t),Eu(e,n)}function Ou(e,t){return Zt(e,t)}function Mu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ju(e,t,n,r){return new Mu(e,t,n,r)}function Tu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Pu(e,t){var n=e.alternate;return null===n?((n=ju(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Au(e,t,n,r,o,i){var a=2;if(r=e,"function"==typeof e)Tu(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case Se:return Ru(n.children,o,i,t);case Ce:a=8,o|=8;break;case Ee:return(e=ju(12,n,t,2|o)).elementType=Ee,e.lanes=i,e;case Me:return(e=ju(13,n,t,o)).elementType=Me,e.lanes=i,e;case je:return(e=ju(19,n,t,o)).elementType=je,e.lanes=i,e;case Ae:return Lu(n,o,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Ne:a=10;break e;case Ie:a=9;break e;case Oe:a=11;break e;case Te:a=14;break e;case Pe:a=16,r=null;break e}throw Error(ae(130,null==e?e:typeof e,""))}return(t=ju(a,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function Ru(e,t,n,r){return(e=ju(7,e,r,t)).lanes=n,e}function Lu(e,t,n,r){return(e=ju(22,e,r,t)).elementType=Ae,e.lanes=n,e.stateNode={isHidden:!1},e}function Du(e,t,n){return(e=ju(6,e,null,t)).lanes=n,e}function zu(e,t,n){return(t=ju(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yn(0),this.expirationTimes=yn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uu(e,t,n,r,o,i,a,s,l){return e=new Fu(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=ju(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},za(i),e}function Bu(e){if(!e)return Oi;e:{if(Vt(e=e._reactInternals)!==e||1!==e.tag)throw Error(ae(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ai(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(ae(171))}if(1===e.tag){var n=e.type;if(Ai(n))return Di(e,n,t)}return t}function $u(e,t,n,r,o,i,a,s,l){return(e=Uu(n,r,!0,e,0,i,0,s,l)).context=Bu(null),n=e.current,(i=Ua(r=eu(),o=tu(n))).callback=null!=t?t:null,Ba(n,i,o),e.current.lanes=o,bn(e,o,r),ru(e,r),e}function Vu(e,t,n,r){var o=t.current,i=eu(),a=tu(o);return n=Bu(n),null===t.context?t.context=n:t.pendingContext=n,(t=Ua(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ba(o,t,a))&&(nu(e,o,a,i),$a(e,o,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Wu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function qu(e,t){Wu(e,t),(e=e.alternate)&&Wu(e,t)}_c=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||ji.current)bl=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return bl=!1,function(e,t,n){switch(t.tag){case 3:Ol(t),ma();break;case 5:Qa(t);break;case 1:Ai(t.type)&&zi(t);break;case 4:Ga(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ii(Sa,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Ii(ts,1&ts.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Dl(e,t,n):(Ii(ts,1&ts.current),null!==(e=Hl(e,t,n))?e.sibling:null);Ii(ts,1&ts.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return $l(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ii(ts,ts.current),r)break;return null;case 22:case 23:return t.lanes=0,Sl(e,t,n)}return Hl(e,t,n)}(e,t,n);bl=!!(131072&e.flags)}else bl=!1,aa&&1048576&t.flags&&ta(t,Zi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vl(e,t),e=t.pendingProps;var o=Pi(t,Mi.current);ja(t,n),o=vs(null,t,r,e,o,n);var i=ys();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ai(r)?(i=!0,zi(t)):i=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,za(t),o.updater=il,t.stateNode=o,o._reactInternals=t,cl(t,r,e,n),t=Il(null,t,r,!0,i,n)):(t.tag=0,aa&&i&&na(t),xl(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vl(e,t),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"==typeof e)return Tu(e)?1:0;if(null!=e){if((e=e.$$typeof)===Oe)return 11;if(e===Te)return 14}return 2}(r),e=rl(r,e),o){case 0:t=El(null,t,r,e,n);break e;case 1:t=Nl(null,t,r,e,n);break e;case 11:t=wl(null,t,r,e,n);break e;case 14:t=kl(null,t,r,rl(r.type,e),n);break e}throw Error(ae(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,El(e,t,r,o=t.elementType===r?o:rl(r,o),n);case 1:return r=t.type,o=t.pendingProps,Nl(e,t,r,o=t.elementType===r?o:rl(r,o),n);case 3:e:{if(Ol(t),null===e)throw Error(ae(387));r=t.pendingProps,o=(i=t.memoizedState).element,Fa(e,t),Ha(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated){if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=Ml(e,t,r,n,o=ul(Error(ae(423)),t));break e}if(r!==o){t=Ml(e,t,r,n,o=ul(Error(ae(424)),t));break e}for(ia=di(t.stateNode.containerInfo.firstChild),oa=t,aa=!0,sa=null,n=_a(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ma(),r===o){t=Hl(e,t,n);break e}xl(e,t,r,n)}t=t.child}return t;case 5:return Qa(t),null===e&&da(t),r=t.type,o=t.pendingProps,i=null!==e?e.memoizedProps:null,a=o.children,oi(r,o)?a=null:null!==i&&oi(r,i)&&(t.flags|=32),Cl(e,t),xl(e,t,a,n),t.child;case 6:return null===e&&da(t),null;case 13:return Dl(e,t,n);case 4:return Ga(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=ka(t,null,r,n):xl(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,wl(e,t,r,o=t.elementType===r?o:rl(r,o),n);case 7:return xl(e,t,t.pendingProps,n),t.child;case 8:case 12:return xl(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ii(Sa,r._currentValue),r._currentValue=a,null!==i)if(lo(i.value,a)){if(i.children===o.children&&!ji.current){t=Hl(e,t,n);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var s=i.dependencies;if(null!==s){a=i.child;for(var l=s.firstContext;null!==l;){if(l.context===r){if(1===i.tag){(l=Ua(-1,n&-n)).tag=2;var c=i.updateQueue;if(null!==c){var u=(c=c.shared).pending;null===u?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,null!==(l=i.alternate)&&(l.lanes|=n),Ma(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(10===i.tag)a=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(a=i.return))throw Error(ae(341));a.lanes|=n,null!==(s=a.alternate)&&(s.lanes|=n),Ma(a,n,t),a=i.sibling}else a=i.child;if(null!==a)a.return=i;else for(a=i;null!==a;){if(a===t){a=null;break}if(null!==(i=a.sibling)){i.return=a.return,a=i;break}a=a.return}i=a}xl(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ja(t,n),r=r(o=Ta(o)),t.flags|=1,xl(e,t,r,n),t.child;case 14:return o=rl(r=t.type,t.pendingProps),kl(e,t,r,o=rl(r.type,o),n);case 15:return _l(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rl(r,o),Vl(e,t),t.tag=1,Ai(r)?(e=!0,zi(t)):e=!1,ja(t,n),sl(t,r,o),cl(t,r,o,n),Il(null,t,r,!0,e,n);case 19:return $l(e,t,n);case 22:return Sl(e,t,n)}throw Error(ae(156,t.tag))};var Ku="function"==typeof reportError?reportError:function(e){};function Zu(e){this._internalRoot=e}function Yu(e){this._internalRoot=e}function Xu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Gu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Ju(){}function Qu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Hu(a);s.call(e)}}Vu(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Hu(a);i.call(e)}}var a=$u(t,r,e,0,null,!1,0,"",Ju);return e._reactRootContainer=a,e[gi]=a.current,Ho(8===e.nodeType?e.parentNode:e),uu(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Hu(l);s.call(e)}}var l=Uu(e,0,!1,null,0,!1,0,"",Ju);return e._reactRootContainer=l,e[gi]=l.current,Ho(8===e.nodeType?e.parentNode:e),uu(function(){Vu(t,l,n,r)}),l}(n,t,e,o,r);return Hu(a)}Yu.prototype.render=Zu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(ae(409));Vu(e,t,null,null)},Yu.prototype.unmount=Zu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uu(function(){Vu(null,e,null,null)}),t[gi]=null}},Yu.prototype.unstable_scheduleHydration=function(e){if(e){var t=En();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&0!==t&&t<Rn[n].priority;n++);Rn.splice(n,0,e),0===n&&Fn(e)}},_n=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=hn(t.pendingLanes);0!==n&&(xn(t,1|n),ru(t,Jt()),!(6&Ic)&&($c=Jt()+500,Hi()))}break;case 13:uu(function(){var t=La(e,1);if(null!==t){var n=eu();nu(t,e,1,n)}}),qu(e,1)}},Sn=function(e){if(13===e.tag){var t=La(e,134217728);if(null!==t)nu(t,e,134217728,eu());qu(e,134217728)}},Cn=function(e){if(13===e.tag){var t=tu(e),n=La(e,t);if(null!==n)nu(n,e,t,eu());qu(e,t)}},En=function(){return wn},Nn=function(e,t){var n=wn;try{return wn=e,t()}finally{wn=n}},_t=function(e,t,n){switch(t){case"input":if(Qe(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=_i(r);if(!o)throw Error(ae(90));Ze(r),Qe(r,o)}}}break;case"textarea":at(e,n);break;case"select":null!=(t=n.value)&&rt(e,!!n.multiple,t,!1)}},Ot=cu,Mt=uu;var ed={usingClientEntryPoint:!1,Events:[wi,ki,_i,Nt,It,cu]},td={findFiberByHostInstance:xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},nd={bundleType:td.bundleType,version:td.version,rendererPackageName:td.rendererPackageName,rendererConfig:td.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:we.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=qt(e))?null:e.stateNode},findFiberByHostInstance:td.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var rd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rd.isDisabled&&rd.supportsFiber)try{an=rd.inject(nd),sn=rd}catch(dt){}}ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ed,ee.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Xu(t))throw Error(ae(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:_e,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},ee.createRoot=function(e,t){if(!Xu(e))throw Error(ae(299));var n=!1,r="",o=Ku;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=Uu(e,1,!1,null,0,n,0,r,o),e[gi]=t.current,Ho(8===e.nodeType?e.parentNode:e),new Zu(t)},ee.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(ae(188));throw e=Object.keys(e).join(","),Error(ae(268,e))}return e=null===(e=qt(t))?null:e.stateNode},ee.flushSync=function(e){return uu(e)},ee.hydrate=function(e,t,n){if(!Gu(t))throw Error(ae(200));return Qu(null,e,t,!0,n)},ee.hydrateRoot=function(e,t,n){if(!Xu(e))throw Error(ae(405));var r=null!=n&&n.hydratedSources||null,o=!1,i="",a=Ku;if(null!=n&&(!0===n.unstable_strictMode&&(o=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),t=$u(t,null,e,1,null!=n?n:null,o,0,i,a),e[gi]=t.current,Ho(e),r)for(e=0;e<r.length;e++)o=(o=(n=r[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Yu(t)},ee.render=function(e,t,n){if(!Gu(t))throw Error(ae(200));return Qu(null,e,t,!1,n)},ee.unmountComponentAtNode=function(e){if(!Gu(e))throw Error(ae(40));return!!e._reactRootContainer&&(uu(function(){Qu(null,null,e,!1,function(){e._reactRootContainer=null,e[gi]=null})}),!0)},ee.unstable_batchedUpdates=cu,ee.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Gu(n))throw Error(ae(200));if(null==e||void 0===e._reactInternals)throw Error(ae(38));return Qu(e,t,n,!1,r)},ee.version="18.3.1-next-f1338f8080-20240426",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){}}(),Q.exports=ee;var od=Q.exports;J.createRoot=od.createRoot,J.hydrateRoot=od.hydrateRoot;
|
|
30
|
+
/**
|
|
31
|
+
* react-router v7.10.1
|
|
32
|
+
*
|
|
33
|
+
* Copyright (c) Remix Software Inc.
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the MIT license found in the
|
|
36
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
37
|
+
*
|
|
38
|
+
* @license MIT
|
|
39
|
+
*/
|
|
40
|
+
var id="popstate";function ad(e={}){return function(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,s="POP",l=null,c=u();null==c&&(c=0,a.replaceState({...a.state,idx:c},""));function u(){return(a.state||{idx:null}).idx}function d(){s="POP";let e=u(),t=null==e?null:e-c;c=e,l&&l({action:s,location:m.location,delta:t})}function f(e,t){s="PUSH";let n=ud(m.location,e,t);c=u()+1;let r=cd(n,c),d=m.createHref(n);try{a.pushState(r,"",d)}catch(kE){if(kE instanceof DOMException&&"DataCloneError"===kE.name)throw kE;o.location.assign(d)}i&&l&&l({action:s,location:m.location,delta:1})}function h(e,t){s="REPLACE";let n=ud(m.location,e,t);c=u();let r=cd(n,c),o=m.createHref(n);a.replaceState(r,"",o),i&&l&&l({action:s,location:m.location,delta:0})}function p(e){return function(e,t=!1){let n="http://localhost";"undefined"!=typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href);sd(n,"No window.location.(origin|href) available to create URL");let r="string"==typeof e?e:dd(e);r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r);return new URL(r,n)}(e)}let m={get action(){return s},get location(){return e(o,a)},listen(e){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(id,d),l=e,()=>{o.removeEventListener(id,d),l=null}},createHref:e=>t(o,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:h,go:e=>a.go(e)};return m}(function(e,t){let{pathname:n,search:r,hash:o}=e.location;return ud("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:dd(t)},0,e)}function sd(e,t){if(!1===e||null==e)throw new Error(t)}function ld(e,t){if(!e)try{throw new Error(t)}catch(rp){}}function cd(e,t){return{usr:e.state,key:e.key,idx:t}}function ud(e,t,n=null,r){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?fd(t):t,state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)}}function dd({pathname:e="/",search:t="",hash:n=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),n&&"#"!==n&&(e+="#"===n.charAt(0)?n:"#"+n),e}function fd(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function hd(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?fd(t):t,i=Nd(o.pathname||"/",n);if(null==i)return null;let a=pd(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let s=null;for(let l=0;null==s&&l<a.length;++l){let e=Ed(i);s=Sd(a[l],e,r)}return s}(e,t,n,!1)}function pd(e,t=[],n=[],r="",o=!1){let i=(e,i,a=o,s)=>{let l={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(r)&&a)return;sd(l.relativePath.startsWith(r),`Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(r.length)}let c=Ad([r,l.relativePath]),u=n.concat(l);e.children&&e.children.length>0&&(sd(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),pd(e.children,t,u,c,a)),(null!=e.path||e.index)&&t.push({path:c,score:_d(c,e.index),routesMeta:u})};return e.forEach((e,t)=>{var n;if(""!==e.path&&(null==(n=e.path)?void 0:n.includes("?")))for(let r of md(e.path))i(e,t,!0,r);else i(e,t)}),t}function md(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let a=md(r.join("/")),s=[];return s.push(...a.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...a),s.map(t=>e.startsWith("/")&&""===t?"/":t)}var gd=/^:[\w-]+$/,vd=3,yd=2,bd=1,xd=10,wd=-2,kd=e=>"*"===e;function _d(e,t){let n=e.split("/"),r=n.length;return n.some(kd)&&(r+=wd),t&&(r+=yd),n.filter(e=>!kd(e)).reduce((e,t)=>e+(gd.test(t)?vd:""===t?bd:xd),r)}function Sd(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",a=[];for(let s=0;s<r.length;++s){let e=r[s],l=s===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Cd({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Cd({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),a.push({params:o,pathname:Ad([i,u.pathname]),pathnameBase:Rd(Ad([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=Ad([i,u.pathnameBase]))}return a}function Cd(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){ld("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if("*"===t){let e=s[r]||"";a=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const o=s[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e},{}),pathname:i,pathnameBase:a,pattern:e}}function Ed(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(kE){return ld(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${kE}).`),e}}function Nd(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}var Id=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Od(e,t="/"){let n,{pathname:r,search:o="",hash:i=""}="string"==typeof e?fd(e):e;if(r)if(a=r,Id.test(a))n=r;else{if(r.includes("//")){let e=r;r=r.replace(/\/\/+/g,"/"),ld(!1,`Pathnames cannot have embedded double slashes - normalizing ${e} -> ${r}`)}n=r.startsWith("/")?Md(r.substring(1),"/"):Md(r,t)}else n=t;var a;return{pathname:n,search:Ld(o),hash:Dd(i)}}function Md(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function jd(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Td(e){let t=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Pd(e,t,n,r=!1){let o;"string"==typeof e?o=fd(e):(o={...e},sd(!o.pathname||!o.pathname.includes("?"),jd("?","pathname","search",o)),sd(!o.pathname||!o.pathname.includes("#"),jd("#","pathname","hash",o)),sd(!o.search||!o.search.includes("#"),jd("#","search","hash",o)));let i,a=""===e||""===o.pathname,s=a?"/":o.pathname;if(null==s)i=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=Od(o,i),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var Ad=e=>e.join("/").replace(/\/\/+/g,"/"),Rd=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ld=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Dd=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function zd(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Fd=["POST","PUT","PATCH","DELETE"];new Set(Fd);var Ud=["GET",...Fd];new Set(Ud);var Bd=$.createContext(null);Bd.displayName="DataRouter";var $d=$.createContext(null);$d.displayName="DataRouterState",$.createContext(!1);var Vd=$.createContext({isTransitioning:!1});Vd.displayName="ViewTransition",$.createContext(new Map).displayName="Fetchers",$.createContext(null).displayName="Await";var Hd=$.createContext(null);Hd.displayName="Navigation";var Wd=$.createContext(null);Wd.displayName="Location";var qd=$.createContext({outlet:null,matches:[],isDataRoute:!1});qd.displayName="Route";var Kd=$.createContext(null);function Zd(){return null!=$.useContext(Wd)}function Yd(){return sd(Zd(),"useLocation() may be used only in the context of a <Router> component."),$.useContext(Wd).location}Kd.displayName="RouteError";var Xd="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gd(e){$.useContext(Hd).static||$.useLayoutEffect(e)}function Jd(){let{isDataRoute:e}=$.useContext(qd);return e?function(){let{router:e}=function(e){let t=$.useContext(Bd);return sd(t,af(e)),t}("useNavigate"),t=sf("useNavigate"),n=$.useRef(!1);return Gd(()=>{n.current=!0}),$.useCallback(async(r,o={})=>{ld(n.current,Xd),n.current&&("number"==typeof r?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))},[e,t])}():function(){sd(Zd(),"useNavigate() may be used only in the context of a <Router> component.");let e=$.useContext(Bd),{basename:t,navigator:n}=$.useContext(Hd),{matches:r}=$.useContext(qd),{pathname:o}=Yd(),i=JSON.stringify(Td(r)),a=$.useRef(!1);return Gd(()=>{a.current=!0}),$.useCallback((r,s={})=>{if(ld(a.current,Xd),!a.current)return;if("number"==typeof r)return void n.go(r);let l=Pd(r,JSON.parse(i),o,"path"===s.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:Ad([t,l.pathname])),(s.replace?n.replace:n.push)(l,s.state,s)},[t,n,i,o,e])}()}function Qd(e,{relative:t}={}){let{matches:n}=$.useContext(qd),{pathname:r}=Yd(),o=JSON.stringify(Td(n));return $.useMemo(()=>Pd(e,JSON.parse(o),r,"path"===t),[e,o,r,t])}function ef(e,t,n,r,o){var i;sd(Zd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=$.useContext(Hd),{matches:s}=$.useContext(qd),l=s[s.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",f=l&&l.route;{let e=f&&f.path||"";cf(u,!f||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let h,p=Yd();if(t){let e="string"==typeof t?fd(t):t;sd("/"===d||(null==(i=e.pathname)?void 0:i.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${e.pathname}" was given in the \`location\` prop.`),h=e}else h=p;let m=h.pathname||"/",g=m;if("/"!==d){let e=d.replace(/^\//,"").split("/");g="/"+m.replace(/^\//,"").split("/").slice(e.length).join("/")}let v=hd(e,{pathname:g});ld(f||null!=v,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),ld(null==v||void 0!==v[v.length-1].route.element||void 0!==v[v.length-1].route.Component||void 0!==v[v.length-1].route.lazy,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=function(e,t=[],n=null,r=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let o=e,i=null==n?void 0:n.errors;if(null!=i){let e=o.findIndex(e=>e.route.id&&void 0!==(null==i?void 0:i[e.route.id]));sd(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let a=!1,s=-1;if(n)for(let c=0;c<o.length;c++){let e=o[c];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(s=c),e.route.id){let{loaderData:t,errors:r}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!r||void 0===r[e.route.id]);if(e.route.lazy||i){a=!0,o=s>=0?o.slice(0,s+1):[o[0]];break}}}let l=n&&r?(e,t)=>{var o,i;r(e,{location:n.location,params:(null==(i=null==(o=n.matches)?void 0:o[0])?void 0:i.params)??{},unstable_pattern:zd(n.matches),errorInfo:t})}:void 0;return o.reduceRight((e,r,c)=>{let u,d=!1,f=null,h=null;n&&(u=i&&r.route.id?i[r.route.id]:void 0,f=r.route.errorElement||nf,a&&(s<0&&0===c?(cf("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,h=null):s===c&&(d=!0,h=r.route.hydrateFallbackElement||null)));let p=t.concat(o.slice(0,c+1)),m=()=>{let t;return t=u?f:d?h:r.route.Component?$.createElement(r.route.Component,null):r.route.element?r.route.element:e,$.createElement(of,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===c)?$.createElement(rf,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:l}):m()},null)}(v&&v.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:Ad([d,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:Ad([d,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,n,r,o);return t&&y?$.createElement(Wd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},y):y}function tf(){let e=function(){var e;let t=$.useContext(Kd),n=function(e){let t=$.useContext($d);return sd(t,af(e)),t}("useRouteError"),r=sf("useRouteError");if(void 0!==t)return t;return null==(e=n.errors)?void 0:e[r]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},a=null;return a=$.createElement($.Fragment,null,$.createElement("p",null,"💿 Hey developer 👋"),$.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",$.createElement("code",{style:i},"ErrorBoundary")," or"," ",$.createElement("code",{style:i},"errorElement")," prop on your route.")),$.createElement($.Fragment,null,$.createElement("h2",null,"Unexpected Application Error!"),$.createElement("h3",{style:{fontStyle:"italic"}},t),n?$.createElement("pre",{style:o},n):null,a)}$.createContext(null);var nf=$.createElement(tf,null),rf=class extends $.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){return void 0!==this.state.error?$.createElement(qd.Provider,{value:this.props.routeContext},$.createElement(Kd.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function of({routeContext:e,match:t,children:n}){let r=$.useContext(Bd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),$.createElement(qd.Provider,{value:e},n)}function af(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sf(e){let t=function(e){let t=$.useContext(qd);return sd(t,af(e)),t}(e),n=t.matches[t.matches.length-1];return sd(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var lf={};function cf(e,t,n){t||lf[e]||(lf[e]=!0,ld(!1,n))}function uf(e){sd(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function df({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1,unstable_useTransitions:a}){sd(!Zd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),l=$.useMemo(()=>({basename:s,navigator:o,static:i,unstable_useTransitions:a,future:{}}),[s,o,i,a]);"string"==typeof n&&(n=fd(n));let{pathname:c="/",search:u="",hash:d="",state:f=null,key:h="default"}=n,p=$.useMemo(()=>{let e=Nd(c,s);return null==e?null:{location:{pathname:e,search:u,hash:d,state:f,key:h},navigationType:r}},[s,c,u,d,f,h,r]);return ld(null!=p,`<Router basename="${s}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==p?null:$.createElement(Hd.Provider,{value:l},$.createElement(Wd.Provider,{children:t,value:p}))}function ff({children:e,location:t}){return ef(hf(e),t)}function hf(e,t=[]){let n=[];return $.Children.forEach(e,(e,r)=>{if(!$.isValidElement(e))return;let o=[...t,r];if(e.type===$.Fragment)return void n.push.apply(n,hf(e.props.children,o));sd(e.type===uf,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),sd(!e.props.index||!e.props.children,"An index route cannot have child routes.");let i={id:e.props.id||o.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=hf(e.props.children,o)),n.push(i)}),n}$.memo(function({routes:e,future:t,state:n,unstable_onError:r}){return ef(e,void 0,n,r,t)});var pf="get",mf="application/x-www-form-urlencoded";function gf(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function vf(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}var yf=null;var bf=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xf(e){return null==e||bf.has(e)?e:(ld(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mf}"`),null)}function wf(e,t){let n,r,o,i,a;if(gf(s=e)&&"form"===s.tagName.toLowerCase()){let a=e.getAttribute("action");r=a?Nd(a,t):null,n=e.getAttribute("method")||pf,o=xf(e.getAttribute("enctype"))||mf,i=new FormData(e)}else if(function(e){return gf(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return gf(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let a=e.form;if(null==a)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||a.getAttribute("action");if(r=s?Nd(s,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||pf,o=xf(e.getAttribute("formenctype"))||xf(a.getAttribute("enctype"))||mf,i=new FormData(a,e),!function(){if(null===yf)try{new FormData(document.createElement("form"),0),yf=!1}catch(rp){yf=!0}return yf}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(gf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=pf,r=null,o=mf,a=e}var s;return i&&"text/plain"===o&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}function kf(e,t){if(!1===e||null==e)throw new Error(t)}function _f(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function Sf(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e},[])}((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(kE){return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(_f).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}function Cf(e,t,n,r,o,i){let a=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null==(r=n[t].route.path)?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===i?t.filter((e,t)=>a(e,t)||s(e,t)):"data"===i?t.filter((t,i)=>{var l;let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(a(t,i)||s(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:(null==(l=n[0])?void 0:l.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0}):[]}function Ef(e,t,{includeHydrateFallback:n}={}){return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1),[...new Set(r)];var r}function Nf(){let e=$.useContext(Bd);return kf(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var If=$.createContext(void 0);function Of(){let e=$.useContext(If);return kf(e,"You must render this element inside a <HydratedRouter> element"),e}function Mf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function jf({page:e,...t}){let{router:n}=Nf(),r=$.useMemo(()=>hd(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?$.createElement(Tf,{page:e,matches:r,...t}):null}function Tf({page:e,matches:t,...n}){let r=Yd(),{manifest:o,routeModules:i}=Of(),{basename:a}=Nf(),{loaderData:s,matches:l}=function(){let e=$.useContext($d);return kf(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=$.useMemo(()=>Cf(e,t,l,o,r,"data"),[e,t,l,o,r]),u=$.useMemo(()=>Cf(e,t,l,o,r,"assets"),[e,t,l,o,r]),d=$.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{var t;let r=o.routes[e.route.id];r&&r.hasLoader&&(!c.some(t=>t.route.id===e.route.id)&&e.route.id in s&&(null==(t=i[e.route.id])?void 0:t.shouldRevalidate)||r.hasClientLoader?l=!0:n.add(e.route.id))}),0===n.size)return[];let u=function(e,t,n){let r="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===r.pathname?r.pathname=`_root.${n}`:t&&"/"===Nd(r.pathname,t)?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}(e,a,"data");return l&&n.size>0&&u.searchParams.set("_routes",t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(",")),[u.pathname+u.search]},[a,s,r,o,c,t,e,i]),f=$.useMemo(()=>Ef(u,o),[u,o]),h=function(e){let{manifest:t,routeModules:n}=Of(),[r,o]=$.useState([]);return $.useEffect(()=>{let r=!1;return Sf(e,t,n).then(e=>{r||o(e)}),()=>{r=!0}},[e,t,n]),r}(u);return $.createElement($.Fragment,null,d.map(e=>$.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n})),f.map(e=>$.createElement("link",{key:e,rel:"modulepreload",href:e,...n})),h.map(({key:e,link:t})=>$.createElement("link",{key:e,nonce:n.nonce,...t})))}function Pf(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}If.displayName="FrameworkContext";var Af="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Af&&(window.__reactRouterVersion="7.10.1")}catch(rp){}function Rf({basename:e,children:t,unstable_useTransitions:n,window:r}){let o=$.useRef();null==o.current&&(o.current=ad({window:r,v5Compat:!0}));let i=o.current,[a,s]=$.useState({action:i.action,location:i.location}),l=$.useCallback(e=>{!1===n?s(e):$.startTransition(()=>s(e))},[n]);return $.useLayoutEffect(()=>i.listen(l),[i,l]),$.createElement(df,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:i,unstable_useTransitions:!0===n})}var Lf=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Df=$.forwardRef(function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:i,state:a,target:s,to:l,preventScrollReset:c,viewTransition:u,...d},f){let h,{basename:p,unstable_useTransitions:m}=$.useContext(Hd),g="string"==typeof l&&Lf.test(l),v=!1;if("string"==typeof l&&g&&(h=l,Af))try{let e=new URL(window.location.href),t=l.startsWith("//")?new URL(e.protocol+l):new URL(l),n=Nd(t.pathname,p);t.origin===e.origin&&null!=n?l=n+t.search+t.hash:v=!0}catch(rp){ld(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){sd(Zd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=$.useContext(Hd),{hash:o,pathname:i,search:a}=Qd(e,{relative:t}),s=i;return"/"!==n&&(s="/"===i?n:Ad([n,i])),r.createHref({pathname:s,search:a,hash:o})}(l,{relative:r}),[b,x,w]=function(e,t){let n=$.useContext(If),[r,o]=$.useState(!1),[i,a]=$.useState(!1),{onFocus:s,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:d}=t,f=$.useRef(null);$.useEffect(()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{a(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),$.useEffect(()=>{if(r){let e=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(e)}}},[r]);let h=()=>{o(!0)},p=()=>{o(!1),a(!1)};return n?"intent"!==e?[i,f,{}]:[i,f,{onFocus:Mf(s,h),onBlur:Mf(l,p),onMouseEnter:Mf(c,h),onMouseLeave:Mf(u,p),onTouchStart:Mf(d,h)}]:[!1,f,{}]}(n,d),k=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:a,unstable_useTransitions:s}={}){let l=Jd(),c=Yd(),u=Qd(e,{relative:i});return $.useCallback(d=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(d,t)){d.preventDefault();let t=void 0!==n?n:dd(c)===dd(u),f=()=>l(e,{replace:t,state:r,preventScrollReset:o,relative:i,viewTransition:a});s?$.startTransition(()=>f()):f()}},[c,l,u,n,r,t,e,o,i,a,s])}(l,{replace:i,state:a,target:s,preventScrollReset:c,relative:r,viewTransition:u,unstable_useTransitions:m});let _=$.createElement("a",{...d,...w,href:h||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||k(t)},ref:Pf(f,x),target:s,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?$.createElement($.Fragment,null,_,$.createElement(jf,{page:y})):_});function zf(e){let t=$.useContext(Bd);return sd(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function Ff(e){ld("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=$.useRef(vf(e)),n=$.useRef(!1),r=Yd(),o=$.useMemo(()=>function(e,t){let n=vf(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}(r.search,n.current?null:t.current),[r.search]),i=Jd(),a=$.useCallback((e,t)=>{const r=vf("function"==typeof e?e(new URLSearchParams(o)):e);n.current=!0,i("?"+r,t)},[i,o]);return[o,a]}Df.displayName="Link",$.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:i,viewTransition:a,children:s,...l},c){let u=Qd(i,{relative:l.relative}),d=Yd(),f=$.useContext($d),{navigator:h,basename:p}=$.useContext(Hd),m=null!=f&&function(e,{relative:t}={}){let n=$.useContext(Vd);sd(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zf("useViewTransitionState"),o=Qd(e,{relative:t});if(!n.isTransitioning)return!1;let i=Nd(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Nd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Cd(o.pathname,a)||null!=Cd(o.pathname,i)}(u)&&!0===a,g=h.encodeLocation?h.encodeLocation(u).pathname:u.pathname,v=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&p&&(y=Nd(y,p)||y);const b="/"!==g&&g.endsWith("/")?g.length-1:g.length;let x,w=v===g||!r&&v.startsWith(g)&&"/"===v.charAt(b),k=null!=y&&(y===g||!r&&y.startsWith(g)&&"/"===y.charAt(g.length)),_={isActive:w,isPending:k,isTransitioning:m},S=w?e:void 0;x="function"==typeof n?n(_):[n,w?"active":null,k?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let C="function"==typeof o?o(_):o;return $.createElement(Df,{...l,"aria-current":S,className:x,ref:c,style:C,to:i,viewTransition:a},"function"==typeof s?s(_):s)}).displayName="NavLink",$.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:a=pf,action:s,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:d,...f},h)=>{let{unstable_useTransitions:p}=$.useContext(Hd),m=function(){let{router:e}=zf("useSubmit"),{basename:t}=$.useContext(Hd),n=sf("useRouteId"),r=e.fetch,o=e.navigate;return $.useCallback(async(e,i={})=>{let{action:a,method:s,encType:l,formData:c,body:u}=wf(e,t);if(!1===i.navigate){let e=i.fetcherKey||Bf();await r(e,n,i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||s,formEncType:i.encType||l,flushSync:i.flushSync})}else await o(i.action||a,{preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||s,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[r,o,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=$.useContext(Hd),r=$.useContext(qd);sd(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Qd(e||".",{relative:t})},a=Yd();if(null==e){i.search=a.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();i.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(i.pathname="/"===i.pathname?n:Ad([n,i.pathname]));return dd(i)}(s,{relative:c}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof s&&Lf.test(s);return $.createElement("form",{ref:h,method:v,action:g,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=(null==r?void 0:r.getAttribute("formmethod"))||a,f=()=>m(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:o,state:i,relative:c,preventScrollReset:u,viewTransition:d});p&&!1!==n?$.startTransition(()=>f()):f()},...f,"data-discover":y||"render"!==e?void 0:"true"})}).displayName="Form";var Uf=0,Bf=()=>`__${String(++Uf)}__`;var $f=function(e,t){return($f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var Vf=function(){return Vf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Vf.apply(this,arguments)};function Hf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Wf(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(rp){i(rp)}}function s(e){try{l(r.throw(e))}catch(rp){i(rp)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function qf(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(rp){s=[6,rp],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Kf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError,"function"==typeof SuppressedError&&SuppressedError;var Zf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Xf(e,t){return e(t={exports:{}},t.exports),t.exports}var Gf=Xf(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise(function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())})},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}});Yf(Gf);var Jf=Yf(Xf(function(e,t){var n=Zf&&Zf.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})},r=Zf&&Zf.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(s){i=[6,s],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},o=Zf;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(e){return n(o,void 0,void 0,function(){return r(this,function(e){throw new Error("Unsupported")})})},getItem:function(e){return n(o,void 0,void 0,function(){return r(this,function(e){throw new Error("Unsupported")})})},clear:function(){return n(o,void 0,void 0,function(){return r(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return n(o,void 0,void 0,function(){return r(this,function(e){throw new Error("Unsupported")})})},setItem:function(e,t){return n(o,void 0,void 0,function(){return r(this,function(e){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function s(e){return new Promise(function(t){return setTimeout(t,e)})}function l(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++)n+=t[Math.floor(61*Math.random())];return n}var c=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=t,void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,o){return void 0===o&&(o=5e3),n(this,void 0,void 0,function(){var n,c,u,d,f,h,p;return r(this,function(r){switch(r.label){case 0:n=Date.now()+l(4),c=Date.now()+o,u=i+"-"+t,d=void 0===this.storageHandler?a:this.storageHandler,r.label=1;case 1:return Date.now()<c?[4,s(30)]:[3,8];case 2:return r.sent(),null!==d.getItemSync(u)?[3,5]:(f=this.id+"-"+t+"-"+n,[4,s(Math.floor(25*Math.random()))]);case 3:return r.sent(),d.setItemSync(u,JSON.stringify({id:this.id,iat:n,timeoutKey:f,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return r.sent(),null!==(h=d.getItemSync(u))&&(p=JSON.parse(h)).id===this.id&&p.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return e.lockCorrector(void 0===this.storageHandler?a:this.storageHandler),[4,this.waitForSomethingToChange(c)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,function(){var o=this;return r(this,function(i){return setTimeout(function(){return n(o,void 0,void 0,function(){var n,o,i;return r(this,function(r){switch(r.label){case 0:return[4,Gf.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=void 0===this.storageHandler?a:this.storageHandler,null===(o=n.getItemSync(e))?(Gf.default().unlock(t),[2]):((i=JSON.parse(o)).timeRefreshed=Date.now(),n.setItemSync(e,JSON.stringify(i)),Gf.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Gf.default().unlock(t),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=!1;function a(){if(i||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(s),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n(null)}}window.addEventListener("storage",a),e.addToWaiting(a);var s=setTimeout(a,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}})})},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,function(){var n,o,s,l;return r(this,function(r){switch(r.label){case 0:return n=void 0===this.storageHandler?a:this.storageHandler,o=i+"-"+t,null===(s=n.getItemSync(o))?[2]:(l=JSON.parse(s)).id!==this.id?[3,2]:[4,Gf.default().lock(l.iat)];case 1:r.sent(),this.acquiredIatSet.delete(l.iat),n.removeItemSync(o),Gf.default().unlock(l.iat),e.notifyWaiters(),r.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],a=0;;){var s=r.keySync(a);if(null===s)break;o.push(s),a++}for(var l=!1,c=0;c<o.length;c++){var u=o[c];if(u.includes(i)){var d=r.getItemSync(u);if(null!==d){var f=JSON.parse(d);(void 0===f.timeRefreshed&&f.timeAcquired<n||void 0!==f.timeRefreshed&&f.timeRefreshed<n)&&(r.removeItemSync(u),l=!0)}}}l&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=c}));const Qf={timeoutInSeconds:60},eh={name:"auth0-spa-js",version:"2.11.0"},th=()=>Date.now();class nh extends Error{constructor(e,t){super(t),this.error=e,this.error_description=t,Object.setPrototypeOf(this,nh.prototype)}static fromPayload({error:e,error_description:t}){return new nh(e,t)}}class rh extends nh{constructor(e,t,n,r=null){super(e,t),this.state=n,this.appState=r,Object.setPrototypeOf(this,rh.prototype)}}let oh=class e extends nh{constructor(t,n,r,o,i=null){super(t,n),this.connection=r,this.state=o,this.appState=i,Object.setPrototypeOf(this,e.prototype)}},ih=class e extends nh{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,e.prototype)}};class ah extends ih{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,ah.prototype)}}class sh extends nh{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,sh.prototype)}}class lh extends nh{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,lh.prototype)}}class ch extends nh{constructor(e,t,n){super(e,t),this.mfa_token=n,Object.setPrototypeOf(this,ch.prototype)}}class uh extends nh{constructor(e,t){super("missing_refresh_token",`Missing Refresh Token (audience: '${hh(e,["default"])}', scope: '${hh(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,uh.prototype)}}class dh extends nh{constructor(e,t){super("missing_scopes",`Missing requested scopes after refresh (audience: '${hh(e,["default"])}', missing scope: '${hh(t)}')`),this.audience=e,this.scope=t,Object.setPrototypeOf(this,dh.prototype)}}class fh extends nh{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,fh.prototype)}}function hh(e,t=[]){return e&&!t.includes(e)?e:""}const ph=()=>window.crypto,mh=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(ph().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%66]),t},gh=e=>btoa(e),vh=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],yh=e=>{var t,{clientId:n}=e,r=Kf(e,["clientId"]);return new URLSearchParams((t=Object.assign({client_id:n},r),Object.keys(t).filter(e=>void 0!==t[e]).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{}))).toString()},bh=async e=>{const t=ph().subtle.digest({name:"SHA-256"},(new TextEncoder).encode(e));return await t},xh=e=>{return t=e.replace(/_/g,"/").replace(/-/g,"+"),decodeURIComponent(atob(t).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""));var t},wh=e=>{const t=new Uint8Array(e);return(e=>{const t={"+":"-","/":"_","=":""};return e.replace(/[+/=]/g,e=>t[e])})(window.btoa(String.fromCharCode(...Array.from(t))))},kh=new TextEncoder,_h=new TextDecoder;function Sh(e){return"string"==typeof e?kh.encode(e):_h.decode(e)}function Ch(e){if("number"!=typeof e.modulusLength||e.modulusLength<2048)throw new Oh(`${e.name} modulusLength must be at least 2048 bits`)}let Eh;if(Uint8Array.prototype.toBase64)Eh=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0}));else{const e=32768;Eh=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}function Nh(e){return Eh(e)}class Ih extends Error{constructor(e){var t;super(null!=e?e:"operation not supported"),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class Oh extends Error{constructor(e){var t;super(e),this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}function Mh(e){switch(e.algorithm.name){case"RSA-PSS":return function(e){if("SHA-256"===e.algorithm.hash.name)return"PS256";throw new Ih("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(e){if("SHA-256"===e.algorithm.hash.name)return"RS256";throw new Ih("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(e){if("P-256"===e.algorithm.namedCurve)return"ES256";throw new Ih("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new Ih("unsupported CryptoKey algorithm name")}}function jh(e){return e instanceof CryptoKey}function Th(e){return jh(e)&&"public"===e.type}async function Ph(e,t,n,r,o,i){const a=null==e?void 0:e.privateKey,s=null==e?void 0:e.publicKey;if(!jh(l=a)||"private"!==l.type)throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var l;if(!Th(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(!0!==s.extractable)throw new TypeError('"keypair.publicKey.extractable" must be true');if("string"!=typeof t)throw new TypeError('"htu" must be a string');if("string"!=typeof n)throw new TypeError('"htm" must be a string');if(void 0!==r&&"string"!=typeof r)throw new TypeError('"nonce" must be a string or undefined');if(void 0!==o&&"string"!=typeof o)throw new TypeError('"accessToken" must be a string or undefined');return async function(e,t,n){if(!1===n.usages.includes("sign"))throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const r=`${Nh(Sh(JSON.stringify(e)))}.${Nh(Sh(JSON.stringify(t)))}`;return`${r}.${Nh(await crypto.subtle.sign(function(e){switch(e.algorithm.name){case"ECDSA":return{name:e.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Ch(e.algorithm),{name:e.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Ch(e.algorithm),{name:e.algorithm.name};case"Ed25519":return{name:e.algorithm.name}}throw new Ih}(n),n,Sh(r)))}`}({alg:Mh(a),typ:"dpop+jwt",jwk:await Ah(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:r,htu:t,ath:o?Nh(await crypto.subtle.digest("SHA-256",Sh(o))):void 0}),a)}async function Ah(e){const{kty:t,e:n,n:r,x:o,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:r,x:o,y:i}}const Rh=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];const Lh=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce((e,[t,n])=>(e[t]=n,e),{}))};var r},Dh=async(e,t,n,r,o,i,a=1e4,s)=>o?(async(e,t,n,r,o,i,a,s)=>{return l={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:a,useMrrt:s},c=i,new Promise(function(e,t){const n=new MessageChannel;n.port1.onmessage=function(r){r.data.error?t(new Error(r.data.error)):e(r.data),n.port1.close()},c.postMessage(l,[n.port2])});var l,c})(e,t,n,r,a,o,i,s):(async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([Lh(e,t),new Promise((e,t)=>{o=setTimeout(()=>{r.abort(),t(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(o)})})(e,r,a);async function zh(e,t,n,r,o,i,a,s,l,c){if(l){const t=await l.generateProof({url:e,method:o.method||"GET",nonce:await l.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:t})}let u,d=null;for(let x=0;x<3;x++)try{u=await Dh(e,n,r,o,i,a,t,s),d=null;break}catch(b){d=b}if(d)throw d;const f=u.json,{error:h,error_description:p}=f,m=Kf(f,["error","error_description"]),{headers:g,ok:v}=u;let y;if(l&&(y=g["dpop-nonce"],y&&await l.setNonce(y)),!v){const u=p||`HTTP error. Unable to fetch ${e}`;if("mfa_required"===h)throw new ch(h,u,m.mfa_token);if("missing_refresh_token"===h)throw new uh(n,r);if("use_dpop_nonce"===h){if(!l||!y||c)throw new fh(y);return zh(e,t,n,r,o,i,a,s,l,!0)}throw new nh(h||"request_error",u)}return m}async function Fh(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:a,useFormData:s,useMrrt:l,dpop:c}=e,u=Kf(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const d="urn:ietf:params:oauth:grant-type:token-exchange"===u.grant_type,f="refresh_token"===u.grant_type&&l,h=Object.assign(Object.assign(Object.assign(Object.assign({},u),d&&o&&{audience:o}),d&&i&&{scope:i}),f&&{audience:o,scope:i}),p=s?yh(h):JSON.stringify(h),m=(g=u.grant_type,Rh.includes(g));var g,v;return await zh(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:p,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify((v=a||eh,Object.keys(v).reduce((e,t)=>{const n=vh.find(e=>e.key===t);return n&&n.type.includes(typeof v[t])&&(e[t]=v[t]),e},{}))))}},t,s,l,m?c:void 0)}const Uh=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},Bh=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),Uh(r,t)};class $h{constructor(e,t="@@auth0spajs@@",n){this.prefix=t,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[t,n,r,o]=e.split("::");return new $h({clientId:n,scope:o,audience:r},t)}static fromCacheEntry(e){const{scope:t,audience:n,client_id:r}=e;return new $h({scope:t,audience:n,clientId:r})}}class Vh{set(e,t){localStorage.setItem(e,JSON.stringify(t))}get(e){const t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(n){return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter(e=>e.startsWith("@@auth0spajs@@"))}}let Hh=class{constructor(){this.enclosedCache=function(){let e={};return{set(t,n){e[t]=n},get(t){const n=e[t];if(n)return n},remove(t){delete e[t]},allKeys:()=>Object.keys(e)}}()}},Wh=class{constructor(e,t,n){this.cache=e,this.keyManifest=t,this.nowProvider=n||th}async setIdToken(e,t,n){var r;const o=this.getIdTokenCacheKey(e);await this.cache.set(o,{id_token:t,decodedToken:n}),await(null===(r=this.keyManifest)||void 0===r?void 0:r.add(o))}async getIdToken(e){const t=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!t&&e.scope&&e.audience){const t=await this.get(e);if(!t)return;if(!t.id_token||!t.decodedToken)return;return{id_token:t.id_token,decodedToken:t.decodedToken}}if(t)return{id_token:t.id_token,decodedToken:t.decodedToken}}async get(e,t=0,n=!1,r){var o;let i=await this.cache.get(e.toKey());if(!i){const t=await this.getCacheKeys();if(!t)return;const o=this.matchExistingCacheKey(e,t);if(o&&(i=await this.cache.get(o)),!o&&n&&"cache-only"!==r)return this.getEntryWithRefreshToken(e,t)}if(!i)return;const a=await this.nowProvider(),s=Math.floor(a/1e3);return i.expiresAt-t<s?i.body.refresh_token?this.modifiedCachedEntry(i,e):(await this.cache.remove(e.toKey()),void(await(null===(o=this.keyManifest)||void 0===o?void 0:o.remove(e.toKey())))):i.body}async modifiedCachedEntry(e,t){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(t.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var t;const n=new $h({clientId:e.client_id,scope:e.scope,audience:e.audience}),r=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),r),await(null===(t=this.keyManifest)||void 0===t?void 0:t.add(n.toKey()))}async remove(e,t,n){const r=new $h({clientId:e,scope:n,audience:t});await this.cache.remove(r.toKey())}async clear(e){var t;const n=await this.getCacheKeys();n&&(await n.filter(t=>!e||t.includes(e)).reduce(async(e,t)=>{await e,await this.cache.remove(t)},Promise.resolve()),await(null===(t=this.keyManifest)||void 0===t?void 0:t.clear()))}async wrapCacheEntry(e){const t=await this.nowProvider();return{body:e,expiresAt:Math.floor(t/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?null===(e=await this.keyManifest.get())||void 0===e?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new $h({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,t){return t.filter(t=>{var n;const r=$h.fromKey(t),o=new Set(r.scope&&r.scope.split(" ")),i=(null===(n=e.scope)||void 0===n?void 0:n.split(" "))||[],a=r.scope&&i.reduce((e,t)=>e&&o.has(t),!0);return"@@auth0spajs@@"===r.prefix&&r.clientId===e.clientId&&r.audience===e.audience&&a})[0]}async getEntryWithRefreshToken(e,t){var n;for(const r of t){const t=$h.fromKey(r);if("@@auth0spajs@@"===t.prefix&&t.clientId===e.clientId){const t=await this.cache.get(r);if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.refresh_token)return this.modifiedCachedEntry(t,e)}}}async updateEntry(e,t){var n;const r=await this.getCacheKeys();if(r)for(const o of r){const r=await this.cache.get(o);if((null===(n=null==r?void 0:r.body)||void 0===n?void 0:n.refresh_token)===e){const e=Object.assign(Object.assign({},r.body),{refresh_token:t});await this.set(e)}}}},qh=class{constructor(e,t,n){this.storage=e,this.clientId=t,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const Kh=e=>"number"==typeof e,Zh=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"];var Yh=Xf(function(e,t){var n=Zf&&Zf.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function i(e){for(var t={},n=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(s){}}return t}function a(){return i(document.cookie)}function s(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=a,t.get=function(e){return a()[e]},t.set=s,t.remove=function(e,t){s(e,"",n(n({},t),{expires:-1}))}});Yf(Yh),Yh.encode,Yh.parse,Yh.getAll;var Xh=Yh.get,Gh=Yh.set,Jh=Yh.remove;const Qh={get(e){const t=Xh(e);if(void 0!==t)return JSON.parse(t)},save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),Gh(e,JSON.stringify(t),r)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Jh(e,n)}},ep={get:e=>Qh.get(e)||Qh.get(`_legacy_${e}`),save(e,t,n){let r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),(null==n?void 0:n.cookieDomain)&&(r.domain=n.cookieDomain),Gh(`_legacy_${e}`,JSON.stringify(t),r),Qh.save(e,t,n)},remove(e,t){let n={};(null==t?void 0:t.cookieDomain)&&(n.domain=t.cookieDomain),Jh(e,n),Qh.remove(e,t),Qh.remove(`_legacy_${e}`,t)}},tp={get(e){if("undefined"==typeof sessionStorage)return;const t=sessionStorage.getItem(e);return null!=t?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var np,rp;(rp=np||(np={})).Code="code",rp.ConnectCode="connect_code";var op,ip=function(e){return op=op||function(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,a=o.substring(i)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",null,false),new Worker(op,e)};const ap={};class sp{constructor(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var t;const n=new Set((null===(t=await this.cache.get(this.manifestKey))||void 0===t?void 0:t.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const t=await this.cache.get(this.manifestKey);if(t){const n=new Set(t.keys);return n.delete(e),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(e){return`@@auth0spajs@@::${e}`}}const lp={memory:()=>(new Hh).enclosedCache,localstorage:()=>new Vh},cp=e=>lp[e],up=e=>{const{openUrl:t,onRedirect:n}=e,r=Kf(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:!1===t||t?t:n})},dp=(e,t)=>{const n=(null==t?void 0:t.split(" "))||[];return((null==e?void 0:e.split(" "))||[]).every(e=>n.includes(e))},fp={NONCE:"nonce",KEYPAIR:"keypair"};class hp{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((t,n)=>{e.onupgradeneeded=()=>Object.values(fp).forEach(t=>e.result.createObjectStore(t)),e.onerror=()=>n(e.error),e.onsuccess=()=>t(e.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,t,n){const r=n((await this.getDbHandle()).transaction(e,t).objectStore(e));return new Promise((e,t)=>{r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)})}buildKey(e){const t=e?`_${e}`:"auth0";return`${this.clientId}::${t}`}setNonce(e,t){return this.save(fp.NONCE,this.buildKey(t),e)}setKeyPair(e){return this.save(fp.KEYPAIR,this.buildKey(),e)}async save(e,t,n){await this.executeDbRequest(e,"readwrite",e=>e.put(n,t))}findNonce(e){return this.find(fp.NONCE,this.buildKey(e))}findKeyPair(){return this.find(fp.KEYPAIR,this.buildKey())}find(e,t){return this.executeDbRequest(e,"readonly",e=>e.get(t))}async deleteBy(e,t){const n=await this.executeDbRequest(e,"readonly",e=>e.getAllKeys());null==n||n.filter(t).map(t=>this.executeDbRequest(e,"readwrite",e=>e.delete(t)))}deleteByClientId(e,t){return this.deleteBy(e,e=>"string"==typeof e&&e.startsWith(`${t}::`))}clearNonces(){return this.deleteByClientId(fp.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(fp.KEYPAIR,this.clientId)}}let pp=class{constructor(e){this.storage=new hp(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,t){return this.storage.setNonce(e,t)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await async function(e,t){var n;let r;return r={name:"ECDSA",namedCurve:"P-256"},crypto.subtle.generateKey(r,null!==(n=null==t?void 0:t.extractable)&&void 0!==n&&n,["sign","verify"])}(0,{extractable:!1}),await this.storage.setKeyPair(e)),e}async generateProof(e){const t=await this.getOrGenerateKeyPair();return function({keyPair:e,url:t,method:n,nonce:r,accessToken:o}){return Ph(e,function(e){const t=new URL(e);return t.search="",t.hash="",t.href}(t),n,r,o)}(Object.assign({keyPair:t},e))}async calculateThumbprint(){return function(e){return async function(e){if(!Th(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(!0!==e.extractable)throw new TypeError('"publicKey.extractable" must be true');const t=await Ah(e);let n;switch(t.kty){case"EC":n={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":n={crv:t.crv,kty:t.kty,x:t.x};break;case"RSA":n={e:t.e,kty:t.kty,n:t.n};break;default:throw new Ih("unsupported JWK kty")}return Nh(await crypto.subtle.digest({name:"SHA-256"},Sh(JSON.stringify(n))))}(e.publicKey)}(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var mp;!function(e){e.Bearer="Bearer",e.DPoP="DPoP"}(mp||(mp={}));class gp{constructor(e,t){this.hooks=t,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||("undefined"==typeof window?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,t){if(t){if(this.isAbsoluteUrl(t))return t;if(e)return`${e.replace(/\/?\/$/,"")}/${t.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return"string"==typeof e?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,t){if(!this.config.baseUrl)return new Request(e,t);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),r=e instanceof Request?new Request(n,e):n;return new Request(r,t)}setAuthorizationHeader(e,t,n=mp.Bearer){e.headers.set("authorization",`${n} ${t}`)}async setDpopProofHeader(e,t){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:t,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",r)}async prepareRequest(e,t){const n=await this.getAccessToken(t);let r,o;"string"==typeof n?(r=this.config.dpopNonceId?mp.DPoP:mp.Bearer,o=n):(r=n.token_type,o=n.access_token),this.setAuthorizationHeader(e,o,r),r===mp.DPoP&&await this.setDpopProofHeader(e,o)}getHeader(e,t){return Array.isArray(e)?new Headers(e).get(t)||"":"function"==typeof e.get?e.get(t)||"":e[t]||""}hasUseDpopNonceError(e){if(401!==e.status)return!1;const t=this.getHeader(e.headers,"www-authenticate");return t.includes("invalid_dpop_nonce")||t.includes("use_dpop_nonce")}async handleResponse(e,t){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!t.onUseDpopNonceError)throw new fh(n);return t.onUseDpopNonceError()}async internalFetchWithAuth(e,t,n,r){const o=this.buildBaseRequest(e,t);await this.prepareRequest(o,r);const i=await this.config.fetch(o);return this.handleResponse(i,n)}fetchWithAuth(e,t,n){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,t,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,t,r,n)}}let vp=class{constructor(e,t){this.myAccountFetcher=e,this.apiBase=t}async connectAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async completeAccount(e){const t=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(t)}async _handleResponse(e){let t;try{t=await e.text(),t=JSON.parse(t)}catch(n){throw new yp({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:t||String(n)})}if(e.ok)return t;throw new yp(t)}};class yp extends Error{constructor({type:e,status:t,title:n,detail:r,validation_errors:o}){super(r),this.name="MyAccountApiError",this.type=e,this.status=t,this.title=n,this.detail=r,this.validation_errors=o,Object.setPrototypeOf(this,yp.prototype)}}const bp=new Jf;class xp{constructor(e){let t,n;if(this.userCache=(new Hh).enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const e=Array.from(this.activeLockKeys);for(const t of e)await bp.releaseLock(t);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),"undefined"!=typeof window&&(()=>{if(!ph())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===ph().subtle)throw new Error("\n auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.\n ")})(),e.cache&&e.cacheLocation,e.cache)n=e.cache;else{if(t=e.cacheLocation||"memory",!cp(t))throw new Error(`Invalid cache location "${t}"`);n=cp(t)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=!1===e.legacySameSiteCookie?Qh:ep,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(()=>`auth0.${this.options.clientId}.is.authenticated`)(),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const r=e.useCookiesForTransactions?this.cookieStorage:tp;var o,i,a;this.scope=((e,t,...n)=>{if("object"!=typeof e)return{default:Uh(t,e,...n)};let r={default:Uh(t,...n)};return Object.keys(e).forEach(o=>{const i=e[o];r[o]=Uh(t,i,...n)}),r})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new qh(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||th,this.cacheManager=new Wh(n,n.allKeys?void 0:new sp(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new pp(this.options.clientId):void 0,this.domainUrl=(o=this.options.domain,/^https?:\/\//.test(o)?o:`https://${o}`),this.tokenIssuer=(i=this.options.issuer,a=this.domainUrl,i?i.startsWith("https://")?i:`https://${i}/`:`${a}/`);const s=`${this.domainUrl}/me/`,l=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new vp(l,s),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===t&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new ip)}_url(e){const t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||eh)));return`${this.domainUrl}${e}&auth0Client=${t}`}_authorizeUrl(e){return this._url(`/authorize?${yh(e)}`)}async _verifyIdToken(e,t,n){const r=await this.nowProvider();return(e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(e=>{const t=e.split("."),[n,r,o]=t;if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");const i=JSON.parse(xh(r)),a={__raw:e},s={};return Object.keys(i).forEach(e=>{a[e]=i[e],Zh.includes(e)||(s[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(xh(n)),claims:a,user:s}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!Kh(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(null==t.claims.exp||!Kh(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Kh(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(null!=t.claims.nbf&&Kh(t.claims.nbf)){const e=new Date(0);if(e.setUTCSeconds(t.claims.nbf-n),r<e)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${e}`)}if(null!=t.claims.auth_time&&Kh(t.claims.auth_time)){const o=new Date(0);if(o.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),r>o)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`)}if(e.organization){const n=e.organization.trim();if(n.startsWith("org_")){const e=n;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_id}"`)}else{const e=n.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(e!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${e}", found "${t.claims.org_name}"`)}}return t})({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,nonce:t,organization:n,leeway:this.options.leeway,max_age:(o=this.options.authorizationParams.max_age,"string"!=typeof o?o:parseInt(o,10)||void 0),now:r});var o}_processOrgHint(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,t,n){var r;const o=gh(mh()),i=gh(mh()),a=mh(),s=await bh(a),l=wh(s),c=await(null===(r=this.dpop)||void 0===r?void 0:r.calculateThumbprint()),u=(f=this.options,h=this.scope,p=e,m=o,g=i,v=l,y=e.redirect_uri||this.options.authorizationParams.redirect_uri||n,b=null==t?void 0:t.response_mode,x=c,Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:Bh(h,p.scope,p.audience),response_type:"code",response_mode:b||"query",state:m,nonce:g,redirect_uri:y||f.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256",dpop_jkt:x})),d=this._authorizeUrl(u);var f,h,p,m,g,v,y,b,x;return{nonce:i,code_verifier:a,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:o,url:d}}async loginWithPopup(e,t){var n;if(e=e||{},!(t=t||{}).popup&&(t.popup=(()=>{const e=window.screenX+(window.innerWidth-400)/2,t=window.screenY+(window.innerHeight-600)/2;return window.open("","auth0:authorize:popup",`left=${e},top=${t},width=400,height=600,resizable,scrollbars=yes,status=1`)})(),!t.popup))throw new lh;const r=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);t.popup.location.href=r.url;const o=await(i=Object.assign(Object.assign({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}),new Promise((e,t)=>{let n;const r=setInterval(()=>{i.popup&&i.popup.closed&&(clearInterval(r),clearTimeout(o),window.removeEventListener("message",n,!1),t(new sh(i.popup)))},1e3),o=setTimeout(()=>{clearInterval(r),t(new ah(i.popup)),window.removeEventListener("message",n,!1)},1e3*(i.timeoutInSeconds||60));n=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(o),clearInterval(r),window.removeEventListener("message",n,!1),i.popup.close(),a.data.response.error)return t(nh.fromPayload(a.data.response));e(a.data.response)}},window.addEventListener("message",n)}));var i;if(r.state!==o.state)throw new nh("state_mismatch","Invalid state");const a=(null===(n=e.authorizationParams)||void 0===n?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:o.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.user}async getIdTokenClaims(){var e;const t=await this._getIdTokenFromCache();return null===(e=null==t?void 0:t.decodedToken)||void 0===e?void 0:e.claims}async loginWithRedirect(e={}){var t;const n=up(e),{openUrl:r,fragment:o,appState:i}=n,a=Kf(n,["openUrl","fragment","appState"]),s=(null===(t=a.authorizationParams)||void 0===t?void 0:t.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:c}=l,u=Kf(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},u),{appState:i,response_type:np.Code}),s&&{organization:s}));const d=o?`${c}#${o}`:c;r?await r(d):window.location.assign(d)}async handleRedirectCallback(e=window.location.href){const t=e.split("?").slice(1);if(0===t.length)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new nh("missing_transaction","Invalid state");this.transactionManager.remove();const r=(e=>{e.indexOf("#")>-1&&(e=e.substring(0,e.indexOf("#")));const t=new URLSearchParams(e);return{state:t.get("state"),code:t.get("code")||void 0,connect_code:t.get("connect_code")||void 0,error:t.get("error")||void 0,error_description:t.get("error_description")||void 0}})(t.join(""));return n.response_type===np.ConnectCode?this._handleConnectAccountRedirectCallback(r,n):this._handleLoginRedirectCallback(r,n)}async _handleLoginRedirectCallback(e,t){const{code:n,state:r,error:o,error_description:i}=e;if(o)throw new rh(o,i||o,r,t.appState);if(!t.code_verifier||t.state&&t.state!==r)throw new nh("state_mismatch","Invalid state");const a=t.organization,s=t.nonce,l=t.redirect_uri;return await this._requestToken(Object.assign({audience:t.audience,scope:t.scope,code_verifier:t.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:s,organization:a}),{appState:t.appState,response_type:np.Code}}async _handleConnectAccountRedirectCallback(e,t){const{connect_code:n,state:r,error:o,error_description:i}=e;if(o)throw new oh(o,i||o,t.connection,r,t.appState);if(!n)throw new nh("missing_connect_code","Missing connect code");if(!(t.code_verifier&&t.state&&t.auth_session&&t.redirect_uri&&t.state===r))throw new nh("state_mismatch","Invalid state");const a=await this.myAccountApi.completeAccount({auth_session:t.auth_session,connect_code:n,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier});return Object.assign(Object.assign({},a),{appState:t.appState,response_type:np.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch(t){}}async getTokenSilently(e={}){var t,n;const r=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Bh(this.scope,null===(t=e.authorizationParams)||void 0===t?void 0:t.scope,(null===(n=e.authorizationParams)||void 0===n?void 0:n.audience)||this.options.authorizationParams.audience)})}),o=await((e,t)=>{let n=ap[t];return n||(n=e().finally(()=>{delete ap[t],n=null}),ap[t]=n),n})(()=>this._getTokenSilently(r),`${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);return e.detailedResponse?o:null==o?void 0:o.access_token}async _getTokenSilently(e){const{cacheMode:t}=e,n=Kf(e,["cacheMode"]);if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:t});if(e)return e}if("cache-only"===t)return;const r=`auth0.lock.getTokenSilently.${this.options.clientId}.${n.authorizationParams.audience||"default"}`;if(!(await(async(e,t=3)=>{for(let n=0;n<t;n++)if(await e())return!0;return!1})(()=>bp.acquireLock(r,5e3),10)))throw new ih;this.activeLockKeys.add(r),1===this.activeLockKeys.size&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if("off"!==t){const e=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(e)return e}const e=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:r,token_type:o,access_token:i,oauthTokenScope:a,expires_in:s}=e;return Object.assign(Object.assign({id_token:r,token_type:o,access_token:i},a?{scope:a}:null),{expires_in:s})}finally{await bp.releaseLock(r),this.activeLockKeys.delete(r),0===this.activeLockKeys.size&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},t={}){var n,r;const o=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Bh(this.scope,null===(n=e.authorizationParams)||void 0===n?void 0:n.scope,(null===(r=e.authorizationParams)||void 0===r?void 0:r.audience)||this.options.authorizationParams.audience)})});return t=Object.assign(Object.assign({},Qf),t),await this.loginWithPopup(o,t),(await this.cacheManager.get(new $h({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!(await this.getUser())}_buildLogoutUrl(e){null!==e.clientId?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const t=e.logoutParams||{},{federated:n}=t,r=Kf(t,["federated"]),o=n?"&federated":"";return this._url(`/v2/logout?${yh(Object.assign({clientId:e.clientId},r))}`)+o}async logout(e={}){var t;const n=up(e),{openUrl:r}=n,o=Kf(n,["openUrl"]);null===e.clientId?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await(null===(t=this.dpop)||void 0===t?void 0:t.clear());const i=this._buildLogoutUrl(o);r?await r(i):!1!==r&&window.location.assign(i)}async _getTokenFromIFrame(e){const t=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!t.organization&&(t.organization=n);const{url:r,state:o,nonce:i,code_verifier:a,redirect_uri:s,scope:l,audience:c}=await this._prepareAuthorizeUrl(t,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new nh("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const n=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let d;try{d=new URL(this.domainUrl).origin}catch(u){d=this.domainUrl}const f=await((e,t,n=60)=>new Promise((r,o)=>{const i=window.document.createElement("iframe");i.setAttribute("width","0"),i.setAttribute("height","0"),i.style.display="none";const a=()=>{window.document.body.contains(i)&&(window.document.body.removeChild(i),window.removeEventListener("message",s,!1))};let s;const l=setTimeout(()=>{o(new ih),a()},1e3*n);s=function(e){if(e.origin!=t)return;if(!e.data||"authorization_response"!==e.data.type)return;const n=e.source;n&&n.close(),e.data.response.error?o(nh.fromPayload(e.data.response)):r(e.data.response),clearTimeout(l),window.removeEventListener("message",s,!1),setTimeout(a,2e3)},window.addEventListener("message",s,!1),window.document.body.appendChild(i),i.setAttribute("src",e)}))(r,d,n);if(o!==f.state)throw new nh("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:a,code:f.code,grant_type:"authorization_code",redirect_uri:s,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:i,organization:t.organization});return Object.assign(Object.assign({},h),{scope:l,oauthTokenScope:h.scope,audience:c})}catch(u){throw"login_required"===u.error&&this.logout({openUrl:!1}),u}}async _getTokenUsingRefreshToken(e){const t=await this.cacheManager.get(new $h({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(t&&t.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new uh(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,o=((e,t,n,r)=>{var o;if(e&&n&&r){if(t.audience!==n)return t.scope;const e=r.split(" "),i=(null===(o=t.scope)||void 0===o?void 0:o.split(" "))||[],a=i.every(t=>e.includes(t));return e.length>=i.length&&a?r:t.scope}return t.scope})(this.options.useMrrt,e.authorizationParams,null==t?void 0:t.audience,null==t?void 0:t.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:n}),r&&{timeout:r}),{scopesToRequest:o});if(c.refresh_token&&this.options.useMrrt&&(null==t?void 0:t.refresh_token)&&await this.cacheManager.updateEntry(t.refresh_token,c.refresh_token),this.options.useMrrt&&!(i=null==t?void 0:t.audience,a=null==t?void 0:t.scope,s=e.authorizationParams.audience,l=e.authorizationParams.scope,i===s&&dp(l,a)||dp(o,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const t=((e,t)=>{const n=(null==e?void 0:e.split(" "))||[],r=(null==t?void 0:t.split(" "))||[];return n.filter(e=>-1==r.indexOf(e)).join(",")})(o,c.scope);throw new dh(e.authorizationParams.audience||"default",t)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var i,a,s,l}async _saveEntryInCache(e){const{id_token:t,decodedToken:n}=e,r=Kf(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:t,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",t=this.scope[e],n=await this.cacheManager.getIdToken(new $h({clientId:this.options.clientId,audience:e,scope:t})),r=this.userCache.get("@@user@@");return n&&n.id_token===(null==r?void 0:r.id_token)?r:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:t,clientId:n,cacheMode:r}){const o=await this.cacheManager.get(new $h({scope:e,audience:t,clientId:n}),60,this.options.useMrrt,r);if(o&&o.access_token){const{token_type:e,access_token:t,oauthTokenScope:n,expires_in:r}=o,i=await this._getIdTokenFromCache();return i&&Object.assign(Object.assign({id_token:i.id_token,token_type:e||"Bearer",access_token:t},n?{scope:n}:null),{expires_in:r})}}async _requestToken(e,t){const{nonceIn:n,organization:r,scopesToRequest:o}=t||{},i=await Fh(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:o||e.scope}),this.worker),a=await this._verifyIdToken(i.id_token,n,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:e.scope,audience:e.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:Bh(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience,organization:e.organization||this.options.authorizationParams.organization})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,t){return this._assertDpop(this.dpop),this.dpop.setNonce(e,t)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new gp(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:e=>{var t;return this.getTokenSilently({authorizationParams:{scope:null===(t=null==e?void 0:e.scope)||void 0===t?void 0:t.join(" "),audience:null==e?void 0:e.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:t=>this.setDpopNonce(t,e.dpopNonceId),generateDpopProof:e=>this.generateDpopProof(e)})}async connectAccountWithRedirect(e){const{openUrl:t,appState:n,connection:r,scopes:o,authorization_params:i,redirectUri:a=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!r)throw new Error("connection is required");const s=gh(mh()),l=mh(),c=await bh(l),u=wh(c),{connect_uri:d,connect_params:f,auth_session:h}=await this.myAccountApi.connectAccount({connection:r,scopes:o,redirect_uri:a,state:s,code_challenge:u,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:l,auth_session:h,redirect_uri:a,appState:n,connection:r,response_type:np.ConnectCode});const p=new URL(d);p.searchParams.set("ticket",f.ticket),t?await t(p.toString()):window.location.assign(p)}}var wp={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},kp=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},_p=Vf(Vf({},wp),{buildAuthorizeUrl:kp,buildLogoutUrl:kp,getAccessTokenSilently:kp,getAccessTokenWithPopup:kp,getIdTokenClaims:kp,exchangeToken:kp,loginWithRedirect:kp,loginWithPopup:kp,connectAccountWithRedirect:kp,logout:kp,handleRedirectCallback:kp,getDpopNonce:kp,setDpopNonce:kp,generateDpopProof:kp,createFetcher:kp}),Sp=$.createContext(_p),Cp=function(e){function t(n,r){var o=e.call(this,null!=r?r:n)||this;return o.error=n,o.error_description=r,Object.setPrototypeOf(o,t.prototype),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Ep=/[?&](?:connect_)?code=[^&]+/,Np=/[?&]state=[^&]+/,Ip=/[?&]error=[^&]+/,Op=function(e){return function(t){if(t instanceof Error)return t;if(null!==t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error){if("error_description"in t&&"string"==typeof t.error_description){var n=t;return new Cp(n.error,n.error_description)}return new Cp(t.error)}return new Error(e)}},Mp=Op("Login failed"),jp=Op("Get access token failed"),Tp=function(e){var t,n;(null==e?void 0:e.redirectUri)&&(e.authorizationParams=null!==(t=e.authorizationParams)&&void 0!==t?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),(null===(n=null==e?void 0:e.authorizationParams)||void 0===n?void 0:n.redirectUri)&&(e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},Pp=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return Vf(Vf({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Vf(Vf({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:Vf(Vf({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return Vf(Vf({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return Vf(Vf({},e),{isLoading:!1,error:t.error})}},Ap=function(e){var t;window.history.replaceState({},document.title,null!==(t=e.returnTo)&&void 0!==t?t:window.location.pathname)},Rp=function(e){var t=e.children,n=e.skipRedirectCallback,r=e.onRedirectCallback,o=void 0===r?Ap:r,i=e.context,a=void 0===i?Sp:i,s=Hf(e,["children","skipRedirectCallback","onRedirectCallback","context"]),l=$.useState(function(){return new xp(function(e){return Tp(e),Vf(Vf({},e),{auth0Client:{name:"auth0-react",version:"2.11.0"}})}(s))})[0],c=$.useReducer(Pp,wp),u=c[0],d=c[1],f=$.useRef(!1),h=$.useCallback(function(e){return d({type:"ERROR",error:e}),e},[]);$.useEffect(function(){f.current||(f.current=!0,Wf(void 0,void 0,void 0,function(){var e,t,r,i,a,s,c;return qf(this,function(u){switch(u.label){case 0:return u.trys.push([0,7,,8]),e=void 0,void 0===f&&(f=window.location.search),!Ep.test(f)&&!Ip.test(f)||!Np.test(f)||n?[3,3]:[4,l.handleRedirectCallback()];case 1:return t=u.sent(),r=t.appState,i=void 0===r?{}:r,a=t.response_type,s=Hf(t,["appState","response_type"]),[4,l.getUser()];case 2:return e=u.sent(),i.response_type=a,a===np.ConnectCode&&(i.connectedAccount=s),o(i,e),[3,6];case 3:return[4,l.checkSession()];case 4:return u.sent(),[4,l.getUser()];case 5:e=u.sent(),u.label=6;case 6:return d({type:"INITIALISED",user:e}),[3,8];case 7:return c=u.sent(),h(Mp(c)),[3,8];case 8:return[2]}var f})}))},[l,o,n,h]);var p=$.useCallback(function(e){return Tp(e),l.loginWithRedirect(e)},[l]),m=$.useCallback(function(e,t){return Wf(void 0,void 0,void 0,function(){var n,r;return qf(this,function(o){switch(o.label){case 0:d({type:"LOGIN_POPUP_STARTED"}),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,l.loginWithPopup(e,t)];case 2:return o.sent(),[3,4];case 3:return n=o.sent(),h(Mp(n)),[2];case 4:return[4,l.getUser()];case 5:return r=o.sent(),d({type:"LOGIN_POPUP_COMPLETE",user:r}),[2]}})})},[l,h]),g=$.useCallback(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Wf(void 0,function(e,t){for(var n,r=0,o=t.length;r<o;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([],e),void 0,function(e){return void 0===e&&(e={}),qf(this,function(t){switch(t.label){case 0:return[4,l.logout(e)];case 1:return t.sent(),(e.openUrl||!1===e.openUrl)&&d({type:"LOGOUT"}),[2]}})})},[l]),v=$.useCallback(function(e){return Wf(void 0,void 0,void 0,function(){var t,n,r,o;return qf(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,3,5]),[4,l.getTokenSilently(e)];case 1:return t=i.sent(),[3,5];case 2:throw n=i.sent(),jp(n);case 3:return r=d,o={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return r.apply(void 0,[(o.user=i.sent(),o)]),[7];case 5:return[2,t]}})})},[l]),y=$.useCallback(function(e,t){return Wf(void 0,void 0,void 0,function(){var n,r,o,i;return qf(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(e,t)];case 1:return n=a.sent(),[3,5];case 2:throw r=a.sent(),jp(r);case 3:return o=d,i={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return o.apply(void 0,[(i.user=a.sent(),i)]),[7];case 5:return[2,n]}})})},[l]),b=$.useCallback(function(e){return l.connectAccountWithRedirect(e)},[l]),x=$.useCallback(function(){return l.getIdTokenClaims()},[l]),w=$.useCallback(function(e){return Wf(void 0,void 0,void 0,function(){var t,n,r,o;return qf(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,3,5]),[4,l.exchangeToken(e)];case 1:return t=i.sent(),[3,5];case 2:throw n=i.sent(),jp(n);case 3:return r=d,o={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return r.apply(void 0,[(o.user=i.sent(),o)]),[7];case 5:return[2,t]}})})},[l]),k=$.useCallback(function(e){return Wf(void 0,void 0,void 0,function(){var t,n,r;return qf(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(e)];case 1:return[2,o.sent()];case 2:throw t=o.sent(),jp(t);case 3:return n=d,r={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return n.apply(void 0,[(r.user=o.sent(),r)]),[7];case 5:return[2]}})})},[l]),_=$.useCallback(function(e){return l.getDpopNonce(e)},[l]),S=$.useCallback(function(e,t){return l.setDpopNonce(e,t)},[l]),C=$.useCallback(function(e){return l.generateDpopProof(e)},[l]),E=$.useCallback(function(e){return l.createFetcher(e)},[l]),N=$.useMemo(function(){return Vf(Vf({},u),{getAccessTokenSilently:v,getAccessTokenWithPopup:y,getIdTokenClaims:x,exchangeToken:w,loginWithRedirect:p,loginWithPopup:m,connectAccountWithRedirect:b,logout:g,handleRedirectCallback:k,getDpopNonce:_,setDpopNonce:S,generateDpopProof:C,createFetcher:E})},[u,v,y,x,w,p,m,b,g,k,_,S,C,E]);return V.createElement(a.Provider,{value:N},t)};const Lp={},Dp=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},zp=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Fp=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
41
|
+
/**
|
|
42
|
+
* @license lucide-react v0.561.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
var Up={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
48
|
+
/**
|
|
49
|
+
* @license lucide-react v0.561.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/const Bp=$.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>$.createElement("svg",{ref:l,...Up,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:zp("lucide",o),...!i&&!Fp(s)&&{"aria-hidden":"true"},...s},[...a.map(([e,t])=>$.createElement(e,t)),...Array.isArray(i)?i:[i]])),$p=(e,t)=>{const n=$.forwardRef(({className:n,...r},o)=>{return $.createElement(Bp,{ref:o,iconNode:t,className:zp(`lucide-${i=Dp(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var i});return n.displayName=Dp(e),n},Vp=$p("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),Hp=$p("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Wp=$p("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),qp=$p("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),Kp=$p("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Zp=$p("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Yp=$p("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Xp=$p("circle-arrow-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]),Gp=$p("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),Jp=$p("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Qp=$p("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),em=$p("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]),tm=$p("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),nm=$p("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rm=$p("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),om=$p("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),im=$p("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]),am=$p("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),sm=$p("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),lm=$p("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),cm=$p("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),um=$p("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),dm=$p("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),fm=$p("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),hm=$p("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),pm=$p("repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]),mm=$p("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),gm=$p("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),vm=$p("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ym=$p("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),bm=$p("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),xm=$p("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wm=$p("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);
|
|
54
|
+
/**
|
|
55
|
+
* @license lucide-react v0.561.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var km,_m={};if("undefined"==typeof window){var Sm={hostname:""};km={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Sm,referrer:""},screen:{width:0,height:0},location:Sm,addEventListener:function(){},removeEventListener:function(){}}}else km=window;function Cm(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 Em(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(kE){return void n(kE)}s.done?t(l):Promise.resolve(l).then(r,o)}function Nm(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Em(i,r,o,a,s,"next",e)}function s(e){Em(i,r,o,a,s,"throw",e)}a(void 0)})}}function Im(e,t,n){return Im=zm()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Rm(o,n.prototype),o},Im.apply(null,arguments)}function Om(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 Mm(){return Mm=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},Mm.apply(this,arguments)}function jm(e){return(jm=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tm(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&&Rm(e,t)}function Pm(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function Am(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function Rm(e,t){return(Rm=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lm(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function Dm(e){var t="function"==typeof Map?new Map:void 0;return Dm=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 Im(e,arguments,jm(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Rm(r,e)},Dm(e)}function zm(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zm=function(){return!!e})()}function Fm(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 Cm(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)?Cm(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 Um(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(rp){i=[6,rp],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function Bm(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 $m,Vm=Object.defineProperty,Hm=function(e,t,n){return function(e,t,n){return t in e?Vm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Lm(t))?t+"":t,n)},Wm=Object.defineProperty,qm=function(e,t,n){return function(e,t,n){return t in e?Wm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Lm(t))?t+"":t,n)},Km=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}(Km||{}),Zm={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ym={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xm={};function Gm(e){if(Xm[e])return Xm[e];var t=globalThis[e],n=t.prototype,r=e in Zm?Zm[e]:void 0,o=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]"))})),i=e in Ym?Ym[e]:void 0,a=Boolean(i&&i.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&a&&!globalThis.Zone)return Xm[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(s),c?Xm[e]=c:n}catch(rp){return n}}var Jm={};function Qm(e,t,n){var r,o=e+"."+String(n);if(Jm[o])return Jm[o].call(t);var i=Gm(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(Jm[o]=a,a.call(t)):t[n]}var eg={};function tg(e,t,n){var r=e+"."+String(n);if(eg[r])return eg[r].bind(t);var o=Gm(e)[n];return"function"!=typeof o?t[n]:(eg[r]=o,o.bind(t))}var ng={childNodes:function(e){return Qm("Node",e,"childNodes")},parentNode:function(e){return Qm("Node",e,"parentNode")},parentElement:function(e){return Qm("Node",e,"parentElement")},textContent:function(e){return Qm("Node",e,"textContent")},contains:function(e,t){return tg("Node",e,"contains")(t)},getRootNode:function(e){return tg("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Qm("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Qm("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Qm("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Qm("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Gm("MutationObserver").constructor},patch:function(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(rp){return function(){}}}};function rg(e){return e.nodeType===e.ELEMENT_NODE}function og(e){var t=e&&"host"in e&&"mode"in e&&ng.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ng.shadowRoot(t)===e)}function ig(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function ag(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 sg(e,n)}).join("");return(o=r).includes(" background-clip: text;")&&!o.includes(" -webkit-background-clip: text;")&&(o=o.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),o}catch(kE){return null}var o}function sg(e,t){if(function(e){return"styleSheet"in e}(e)){var n;try{n=ag(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(kE){n=e.cssText}return e.styleSheet.href?yg(n,e.styleSheet.href):n}var r,o=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,o=o.replace(r,"$1\\$2")),t?yg(o,t):o}var lg=function(){function e(){qm(this,"idNodeMap",new Map),qm(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 cg(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,i=e.value,a=e.maskInputFn,s=i||"",l=o&&ug(o);return(n[r.toLowerCase()]||l&&n[l])&&(s=a?a(s,t):"*".repeat(s.length)),s}function ug(e){return e.toLowerCase()}var dg="__rrweb_original__";function fg(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?ug(t):null}function hg(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(i){return null}var r,o=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(r=null==o?void 0:o[1])?r:null}var pg=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,mg=/^(?:[a-z+]+:)?\/\//i,gg=/^www\..*/i,vg=/^(data:)([^,]*),(.*)/i;function yg(e,t){return(e||"").replace(pg,function(e,n,r,o,i,a){var s,l=r||i||a,c=n||o||"";if(!l)return e;if(mg.test(l)||gg.test(l))return"url("+c+l+c+")";if(vg.test(l))return"url("+c+l+c+")";if("/"===l[0])return"url("+c+(((s=t).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+l)+c+")";var u=t.split("/"),d=l.split("/");u.pop();for(var f,h=Fm(d);!(f=h()).done;){var p=f.value;"."!==p&&(".."===p?u.pop():u.push(p))}return"url("+c+u.join("/")+c+")"})}function bg(e,t){return void 0===t&&(t=!1),t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function xg(e,t){return function(e,t,n){void 0===n&&(n=!1);var r=Array.from(t.childNodes),o=[],i=0;if(r.length>1&&e&&"string"==typeof e)for(var a=bg(e,n),s=a.length/e.length,l=1;l<r.length;l++)if(r[l].textContent&&"string"==typeof r[l].textContent){for(var c=bg(r[l].textContent,n),u=3;u<c.length&&(c[u].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,u),1));u++);for(;u<c.length;u++){var d=c.substring(0,u),f=a.split(d),h=-1;if(2===f.length)h=f[0].length;else if(f.length>2&&""===f[0]&&""!==r[l-1].textContent)h=a.indexOf(d,1);else if(1===f.length){if(d=d.substring(0,d.length-1),(f=a.split(d)).length<=1)return o.push(e),o;u=101}else u===c.length-1&&(h=a.indexOf(d));if(f.length>=2&&u>100){var p=r[l-1].textContent;if(p&&"string"==typeof p){var m=bg(p).length;h=a.indexOf(d,m)}-1===h&&(h=f[0].length)}if(-1!==h){for(var g=Math.floor(h/s);g>0&&g<e.length;){if((i+=1)>50*r.length)return o.push(e),o;var v=bg(e.substring(0,g),n);if(v.length===h){o.push(e.substring(0,g)),e=e.substring(g),a=a.substring(h);break}v.length<h?g+=Math.max(1,Math.floor((h-v.length)/s)):g-=Math.max(1,Math.floor((v.length-h)*s))}break}}}return o.push(e),o}(e,t).join("/* rr_split */")}var wg,kg,_g=1,Sg=new RegExp("[^a-z0-9-_:]");function Cg(){return _g++}var Eg=/^[^ \t\n\r\u000c]+/,Ng=/^[, \t\n\r\u000c]+/;var Ig=new WeakMap;function Og(e,t){return t&&""!==t.trim()?jg(e,t):t}function Mg(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function jg(e,t){var n=Ig.get(e);if(n||(n=e.createElement("a"),Ig.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Tg(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?Og(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,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(Ng),!(n>=t.length);){var i=r(Eg);if(","===i.slice(-1))i=Og(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=Og(e,i);for(var s=!1;;){var l=t.charAt(n);if(""===l){o.push((i+a).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,o.push((i+a).trim());break}"("===l&&(s=!0)}a+=l,n+=1}}}return o.join(", ")}(e,r):"style"===n?yg(r,jg(e)):"object"===t&&"data"===n?Og(e,r):r:Og(e,r):r}function Pg(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function Ag(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Ag(ng.parentNode(e),t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&Ag(ng.parentNode(e),t,n)}function Rg(e,t,n,r){var o;if(rg(e)){if(o=e,!ng.childNodes(o).length)return!1}else{if(null===ng.parentElement(e))return!1;o=ng.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest("."+t))return!0}else if(o.classList.contains(t))return!0}else if(Ag(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(rp){}return!1}function Lg(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.needsMask,s=t.inlineStylesheet,l=t.maskInputOptions,c=void 0===l?{}:l,u=t.maskTextFn,d=t.maskInputFn,f=t.dataURLOptions,h=void 0===f?{}:f,p=t.inlineImages,m=t.recordCanvas,g=t.keepIframeSrcFn,v=t.newlyAddedElement,y=void 0!==v&&v,b=t.cssCaptured,x=void 0!==b&&b,w=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:Km.Document,childNodes:[],compatMode:e.compatMode}:{type:Km.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Km.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,o=t.blockClass,i=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,l=void 0===s?{}:s,c=t.maskInputFn,u=t.dataURLOptions,d=void 0===u?{}:u,f=t.inlineImages,h=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,g=void 0!==m&&m,v=t.rootId,y=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 o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(rp){}return!1}(e,o,i),b=function(e){if(Pm(e,HTMLFormElement))return"form";var t=ug(e.tagName);return Sg.test(t)?"div":t}(e),x={},w=e.attributes.length,k=0;k<w;k++){var _=e.attributes[k];Pg(b,_.name,_.value)||(x[_.name]=Tg(r,b,ug(_.name),_.value))}if("link"===b&&a){var S=Array.from(r.styleSheets).find(function(t){return t.href===e.href}),C=null;S&&(C=ag(S)),C&&(delete x.rel,delete x.href,x._cssText=C)}if("style"===b&&e.sheet){var E=ag(e.sheet);E&&(e.childNodes.length>1&&(E=xg(E,e)),x._cssText=E)}if("input"===b||"textarea"===b||"select"===b){var N=e.value,I=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&N?x.value=cg({element:e,type:fg(e),tagName:b,value:N,maskInputOptions:l,maskInputFn:c}):I&&(x.checked=I)}"option"===b&&(e.selected&&!l.select?x.selected=!0:delete x.selected);"dialog"===b&&e.open&&(x.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===b&&h)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 o=t.getImageData,i=dg in o?o[dg]:o;if(new Uint32Array(i.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)||(x.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var O=e.toDataURL(d.type,d.quality),M=r.createElement("canvas");M.width=e.width,M.height=e.height,O!==M.toDataURL(d.type,d.quality)&&(x.rr_dataURL=O)}if("img"===b&&f){wg||(wg=r.createElement("canvas"),kg=wg.getContext("2d"));var j=e,T=(j.currentSrc||j.getAttribute("src"),j.crossOrigin),P=function(){j.removeEventListener("load",P);try{wg.width=j.naturalWidth,wg.height=j.naturalHeight,kg.drawImage(j,0,0),x.rr_dataURL=wg.toDataURL(d.type,d.quality)}catch(e){if("anonymous"!==j.crossOrigin)return j.crossOrigin="anonymous",void(j.complete&&0!==j.naturalWidth?P():j.addEventListener("load",P))}"anonymous"===j.crossOrigin&&(T?x.crossOrigin=T:j.removeAttribute("crossorigin"))};j.complete&&0!==j.naturalWidth?P():j.addEventListener("load",P)}if("audio"===b||"video"===b){var A=x;A.rr_mediaState=e.paused?"paused":"played",A.rr_mediaCurrentTime=e.currentTime,A.rr_mediaPlaybackRate=e.playbackRate,A.rr_mediaMuted=e.muted,A.rr_mediaLoop=e.loop,A.rr_mediaVolume=e.volume}g||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop));if(y){var R=e.getBoundingClientRect(),L=R.width,D=R.height;x={class:x.class,rr_width:L+"px",rr_height:D+"px"}}"iframe"!==b||p(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(b)&&(n=!0)}catch(rp){}return{type:Km.Element,tagName:b,attributes:x,childNodes:[],isSVG:Mg(e)||void 0,needBlock:y,rootId:v,isCustom:n}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:c,maskInputFn:d,dataURLOptions:h,inlineImages:p,recordCanvas:m,keepIframeSrcFn:g,newlyAddedElement:y,rootId:w});case e.TEXT_NODE:return function(e,t){var n=t.needsMask,r=t.maskTextFn,o=t.rootId,i=t.cssCaptured,a=ng.parentNode(e),s=a&&a.tagName,l="",c="STYLE"===s||void 0,u="SCRIPT"===s||void 0;u?l="SCRIPT_PLACEHOLDER":i||(l=ng.textContent(e),c&&l&&(l=yg(l,jg(t.doc))));!c&&!u&&l&&n&&(l=r?r(l,ng.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:Km.Text,textContent:l||"",rootId:o}}(e,{doc:n,needsMask:a,maskTextFn:u,rootId:w,cssCaptured:x});case e.CDATA_SECTION_NODE:return{type:Km.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Km.Comment,textContent:ng.textContent(e)||"",rootId:w};default:return!1}}function Dg(e){return null==e?"":e.toLowerCase()}function zg(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,l=t.skipChild,c=void 0!==l&&l,u=t.inlineStylesheet,d=void 0===u||u,f=t.maskInputOptions,h=void 0===f?{}:f,p=t.maskTextFn,m=t.maskInputFn,g=t.slimDOMOptions,v=t.dataURLOptions,y=void 0===v?{}:v,b=t.inlineImages,x=void 0!==b&&b,w=t.recordCanvas,k=void 0!==w&&w,_=t.onSerialize,S=t.onIframeLoad,C=t.iframeLoadTimeout,E=void 0===C?5e3:C,N=t.onStylesheetLoad,I=t.stylesheetLoadTimeout,O=void 0===I?5e3:I,M=t.keepIframeSrcFn,j=void 0===M?function(){return!1}:M,T=t.newlyAddedElement,P=void 0!==T&&T,A=t.cssCaptured,R=void 0!==A&&A,L=t.needsMask,D=t.preserveWhiteSpace,z=void 0===D||D;L||(L=Rg(e,a,s,void 0===L));var F,U=Lg(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:m,dataURLOptions:y,inlineImages:x,recordCanvas:k,keepIframeSrcFn:j,newlyAddedElement:P,cssCaptured:R});if(!U)return null;F=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Km.Comment)return!0;if(e.type===Km.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"===hg(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Dg(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Dg(e.attributes.name)||"icon"===Dg(e.attributes.rel)||"apple-touch-icon"===Dg(e.attributes.rel)||"shortcut icon"===Dg(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Dg(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Dg(e.attributes.property).match(/^(og|twitter|fb):/)||Dg(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Dg(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Dg(e.attributes.name)||"googlebot"===Dg(e.attributes.name)||"bingbot"===Dg(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Dg(e.attributes.name)||"generator"===Dg(e.attributes.name)||"framework"===Dg(e.attributes.name)||"publisher"===Dg(e.attributes.name)||"progid"===Dg(e.attributes.name)||Dg(e.attributes.property).match(/^article:/)||Dg(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Dg(e.attributes.name)||"yandex-verification"===Dg(e.attributes.name)||"csrf-token"===Dg(e.attributes.name)||"p:domain_verify"===Dg(e.attributes.name)||"verify-v1"===Dg(e.attributes.name)||"verification"===Dg(e.attributes.name)||"shopify-checkout-api-token"===Dg(e.attributes.name)))return!0}}return!1}(U,g)||!z&&U.type===Km.Text&&!U.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Cg();var B=Object.assign(U,{id:F});if(r.add(e,B),-2===F)return null;_&&_(e);var $=!c;if(B.type===Km.Element){$=$&&!B.needBlock,delete B.needBlock;var V=ng.shadowRoot(e);V&&ig(V)&&(B.isShadowHost=!0)}if((B.type===Km.Document||B.type===Km.Element)&&$){g.headWhitespace&&B.type===Km.Element&&"head"===B.tagName&&(z=!1);var H={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:a,maskTextSelector:s,skipChild:c,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:x,recordCanvas:k,preserveWhiteSpace:z,onSerialize:_,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:j,cssCaptured:!1};if(B.type===Km.Element&&"textarea"===B.tagName&&void 0!==B.attributes.value);else{B.type===Km.Element&&void 0!==B.attributes._cssText&&"string"==typeof B.attributes._cssText&&(H.cssCaptured=!0);for(var W,q=Fm(Array.from(ng.childNodes(e)));!(W=q()).done;){var K=zg(W.value,H);K&&B.childNodes.push(K)}}var Z=null;if(rg(e)&&(Z=ng.shadowRoot(e)))for(var Y,X=Fm(Array.from(ng.childNodes(Z)));!(Y=X()).done;){var G=zg(Y.value,H);G&&(ig(Z)&&(G.isShadow=!0),B.childNodes.push(G))}}var J=ng.parentNode(e);return J&&og(J)&&ig(J)&&(B.isShadow=!0),B.type===Km.Element&&"iframe"===B.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(kE){return}if("complete"===o){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&S){var n=zg(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:x,recordCanvas:k,preserveWhiteSpace:z,onSerialize:_,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:j});n&&S(e,n)}},E),B.type===Km.Element&&"link"===B.tagName&&"string"==typeof B.attributes.rel&&("stylesheet"===B.attributes.rel||"preload"===B.attributes.rel&&"string"==typeof B.attributes.href&&"css"===hg(B.attributes.href))&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(kE){return}if(!r){var i=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(i),o=!0,t()})}}(e,function(){if(N){var t=zg(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:L,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:h,maskTextFn:p,maskInputFn:m,slimDOMOptions:g,dataURLOptions:y,inlineImages:x,recordCanvas:k,preserveWhiteSpace:z,onSerialize:_,onIframeLoad:S,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:j});t&&N(e,t)}},O),B}function Fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ug(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Pm(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 Bg={exports:{}},$g=String,Vg=function(){return{isColorSupported:!1,reset:$g,bold:$g,dim:$g,italic:$g,underline:$g,inverse:$g,hidden:$g,strikethrough:$g,black:$g,red:$g,green:$g,yellow:$g,blue:$g,magenta:$g,cyan:$g,white:$g,gray:$g,bgBlack:$g,bgRed:$g,bgGreen:$g,bgYellow:$g,bgBlue:$g,bgMagenta:$g,bgCyan:$g,bgWhite:$g}};Bg.exports=Vg(),Bg.exports.createColors=Vg;var Hg=Bg.exports,Wg=Ug(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),qg=Hg,Kg=Wg,Zg=function(e){function t(n,r,o,i,a,s){var l;return(l=e.call(this,n)||this).name="CssSyntaxError",l.reason=n,a&&(l.file=a),i&&(l.source=i),s&&(l.plugin=s),void 0!==r&&void 0!==o&&("number"==typeof r?(l.line=r,l.column=o):(l.line=r.line,l.column=r.column,l.endLine=o.line,l.endColumn=o.column)),l.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(l,t),l}Tm(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=qg.isColorSupported),Kg&&e&&(n=Kg(n));var r,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),l=String(s).length;if(e){var c=qg.createColors(!0),u=c.bold,d=c.gray,f=c.red;r=function(e){return u(f(e))},o=function(e){return d(e)}}else r=o=function(e){return e};return i.slice(a,s).map(function(e,n){var i=a+1+n,s=" "+(" "+i).slice(-l)+" | ";if(i===t.line){var c=o(s.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+o(s)+e+"\n "+c+r("^")}return" "+o(s)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Dm(Error)),Yg=Zg;Zg.default=Zg;var Xg={};Xg.isClean=Symbol("isClean"),Xg.my=Symbol("my");var Gg={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Jg=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 o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,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,o=0;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(var a=0;a<o;a++)n+=i}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 o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,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 o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return Gg[n];var i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var a,s="raw"+((a=n)[0].toUpperCase()+a.slice(1));return this[s]?r=this[s](i,e):i.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=Gg[n]),i.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 o=n.raws.before.split("\n");return t=(t=o[o.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}(),Qg=Jg;Jg.default=Jg;var ev=Qg;function tv(e,t){new ev(t).stringify(e)}var nv=tv;tv.default=tv;var rv=Xg.isClean,ov=Xg.my,iv=Yg,av=Qg,sv=nv;function lv(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var o=e[r],i=void 0===o?"undefined":Lm(o);"parent"===r&&"object"===i?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(function(e){return lv(e,n)}):("object"===i&&null!==o&&(o=lv(o)),n[r]=o)}return n}var cv=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[rv]=!1,this[ov]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=Fm(e[t]);!(n=r()).done;){var o=n.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}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=lv(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,o=n.start;return this.source.input.error(e,{column:o.column,line:o.line},{column:r.column,line:r.line},t)}return new iv(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[rv]){this[rv]=!1;for(var e=this;e=e.parent;)e[rv]=!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,o=this.source.start.line,i=0;i<e;i++)"\n"===n[i]?(r=1,o+=1):r+=1;return{column:r,line:o}},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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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 av).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,o=this,i=!1,a=Fm(t);!(r=a()).done;){var s=r.value;s===this?i=!0:i?(this.parent.insertAfter(o,s),o=s):this.parent.insertBefore(o,s)}i||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 o=0;for(var i in this)if(Object.prototype.hasOwnProperty.call(this,i)&&"parent"!==i&&"proxyCache"!==i){var a=this[i];if(Array.isArray(a))n[i]=a.map(function(e){return"object"===(void 0===e?"undefined":Lm(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===a?"undefined":Lm(a))&&a.toJSON)n[i]=a.toJSON(null,t);else if("source"===i){var s=t.get(a.input);null==s&&(s=o,t.set(a.input,o),o++),n[i]={end:a.end,inputId:s,start:a.start}}else n[i]=a}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=sv),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 o in n)r[o]=n[o];return e.warn(t,r)},Om(e,[{key:"proxyOf",get:function(){return this}}]),e}(),uv=cv;cv.default=cv;var dv=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=Mm({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Tm(t,e),Om(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(uv),fv=dv;dv.default=dv;var hv=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},pv=Wg.SourceMapConsumer,mv=Wg.SourceMapGenerator,gv=Wg.existsSync,vv=Wg.readFileSync,yv=Wg.dirname,bv=Wg.join;var xv=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=yv(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new pv(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),Buffer?Buffer.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":Lm(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=yv(e),gv(e))return this.mapFile=e,vv(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(Pm(t,pv))return mv.fromSourceMap(t).toString();if(Pm(t,mv))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 o=this.annotation;return e&&(o=bv(yv(e),o)),this.loadFile(o)}}},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}(),wv=xv;xv.default=xv;var kv=Wg.SourceMapConsumer,_v=Wg.SourceMapGenerator,Sv=Wg.fileURLToPath,Cv=Wg.pathToFileURL,Ev=Wg.isAbsolute,Nv=Wg.resolve,Iv=hv,Ov=Wg,Mv=Yg,jv=wv,Tv=Symbol("fromOffsetCache"),Pv=Boolean(kv&&_v),Av=Boolean(Nv&&Ev),Rv=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Lm(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&&(!Av||/^\w+:\/\//.test(t.from)||Ev(t.from)?this.file=t.from:this.file=Nv(t.from)),Av&&Pv){var n=new jv(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 "+Iv(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var o,i,a;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":Lm(t))){var s=t,l=n;if("number"==typeof s.offset){var c=this.fromOffset(s.offset);t=c.line,n=c.col}else t=s.line,n=s.column;if("number"==typeof l.offset){var u=this.fromOffset(l.offset);i=u.line,a=u.col}else i=l.line,a=l.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var f=this.origin(t,n,i,a);return(o=f?new Mv(e,void 0===f.endLine?f.line:{column:f.column,line:f.line},void 0===f.endLine?f.column:{column:f.endColumn,line:f.endLine},f.source,f.file,r.plugin):new Mv(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:a,line:i},this.css,this.file,r.plugin)).input={column:n,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(Cv&&(o.input.url=Cv(this.file).toString()),o.input.file=this.file),o},t.fromOffset=function(e){var t;if(this[Tv])t=this[Tv];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,o=0,i=n.length;o<i;o++)t[o]=r,r+=n[o].length+1;this[Tv]=t}var a=0;if(e>=t[t.length-1])a=t.length-1;else for(var s,l=t.length-2;a<l;)if(e<t[s=a+(l-a>>1)])l=s-1;else{if(!(e>=t[s+1])){a=s;break}a=s+1}return{col:e-t[a]+1,line:a+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:Nv(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var o,i,a=this.map.consumer(),s=a.originalPositionFor({column:t,line:e});if(!s.source)return!1;"number"==typeof n&&(o=a.originalPositionFor({column:r,line:n})),i=Ev(s.source)?Cv(s.source):new URL(s.source,this.map.consumer().sourceRoot||Cv(this.map.mapFile));var l={column:s.column,endColumn:o&&o.column,endLine:o&&o.line,line:s.line,url:i.toString()};if("file:"===i.protocol){if(!Sv)throw new Error("file: protocol is not available in this PostCSS build");l.file=Sv(i)}var c=a.sourceContentFor(s.source);return c&&(l.source=c),l},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=Mm({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},Om(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),Lv=Rv;Rv.default=Rv,Ov&&Ov.registerInput&&Ov.registerInput(Rv);var Dv=Wg.SourceMapConsumer,zv=Wg.SourceMapGenerator,Fv=Wg.dirname,Uv=Wg.relative,Bv=Wg.resolve,$v=Wg.sep,Vv=Wg.pathToFileURL,Hv=Lv,Wv=Boolean(Dv&&zv),qv=Boolean(Fv&&Bv&&Uv&&$v),Kv=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=Fm(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),o=n.root||Fv(n.file),i=void 0;!1===this.mapOpts.sourcesContent?(i=new Dv(n.text)).sourcesContent&&(i.sourcesContent=null):i=n.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(o)))}},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(),qv&&Wv&&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=zv.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new zv({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 zv({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,o=1,i="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(s,l,c){if(e.css+=s,l&&"end"!==c&&(a.generated.line=r,a.generated.column=o-1,l.source&&l.source.start?(a.source=e.sourcePath(l),a.original.line=l.source.start.line,a.original.column=l.source.start.column-1,e.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,e.map.addMapping(a))),(t=s.match(/\n/g))?(r+=t.length,n=s.lastIndexOf("\n"),o=s.length-n):o+=s.length,l&&"start"!==c){var u=l.parent||{raws:{}};("decl"===l.type||"atrule"===l.type&&!l.nodes)&&l===u.last&&!u.raws.semicolon||(l.source&&l.source.end?(a.source=e.sourcePath(l),a.original.line=l.source.end.line,a.original.column=l.source.end.column-1,a.generated.line=r,a.generated.column=o-2,e.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,a.generated.line=r,a.generated.column=o-1,e.map.addMapping(a)))}})},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?Fv(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=Fv(Bv(n,this.mapOpts.annotation)));var r=Uv(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 Hv(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 o=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(o,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 Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(Vv){var n=Vv(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;"\\"===$v&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),Zv=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Tm(t,e),t}(uv),Yv=Zv;Zv.default=Zv;var Xv,Gv,Jv,Qv,ey=Xg.isClean,ty=Xg.my,ny=fv,ry=Yv;function oy(e){return e.map(function(e){return e.nodes&&(e.nodes=oy(e.nodes)),delete e.source,e})}function iy(e){if(e[ey]=!1,e.proxyOf.nodes)for(var t,n=Fm(e.proxyOf.nodes);!(t=n()).done;){iy(t.value)}}var ay=function(e){function t(){return e.apply(this,arguments)||this}Tm(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,o=Fm(t);!(r=o()).done;)for(var i,a=r.value,s=Fm(this.normalize(a,this.last));!(i=s()).done;){var l=i.value;this.proxyOf.nodes.push(l)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=Fm(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),o=0;o<n;o++)r[o]=arguments[o];var i;return(i=e)[t].apply(i,[].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),o=1;o<t;o++)r[o-1]=arguments[o];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),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var i,a=Fm(o);!(i=a()).done;){var s=i.value;this.proxyOf.nodes.splice(r+1,0,s)}for(var l in this.indexes)r<(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),o=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(var a,s=Fm(i);!(a=s()).done;){var l=a.value;this.proxyOf.nodes.splice(r,0,l)}for(var c in this.indexes)r<=(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=oy(Xv(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var o,i=Fm(e=e.slice(0));!(o=i()).done;){var a=o.value;a.parent&&a.parent.removeChild(a,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var s,l=Fm(e=e.nodes.slice(0));!(s=l()).done;){var c=s.value;c.parent&&c.parent.removeChild(c,"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 ny(e)]}else if(e.selector)e=[new Gv(e)];else if(e.name)e=[new Jv(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new ry(e)]}return e.map(function(e){return e[ty]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[ey]&&iy(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,o=Fm(t=t.reverse());!(r=o()).done;){for(var i,a=r.value,s=this.normalize(a,this.first,"prepend").reverse(),l=Fm(s);!(i=l()).done;){var c=i.value;this.proxyOf.nodes.unshift(c)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+s.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=Fm(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(rp){throw t.addToError(rp)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?Pm(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?Pm(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?Pm(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)}))},Om(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}(uv);ay.registerParse=function(e){Xv=e},ay.registerRule=function(e){Gv=e},ay.registerAtRule=function(e){Jv=e},ay.registerRoot=function(e){Qv=e};var sy=ay;ay.default=ay,ay.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Jv.prototype):"rule"===e.type?Object.setPrototypeOf(e,Gv.prototype):"decl"===e.type?Object.setPrototypeOf(e,ny.prototype):"comment"===e.type?Object.setPrototypeOf(e,ry.prototype):"root"===e.type&&Object.setPrototypeOf(e,Qv.prototype),e[ty]=!0,e.nodes&&e.nodes.forEach(function(e){ay.rebuild(e)})};var ly,cy,uy=function(e){function t(t){var n;return(n=e.call(this,Mm({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Tm(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new ly(new cy,this,e).stringify()},t}(sy);uy.registerLazyResult=function(e){ly=e},uy.registerProcessor=function(e){cy=e};var dy=uy;uy.default=uy;var fy=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}(),hy=fy;fy.default=fy;var py=hy,my=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 py(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},Om(e,[{key:"content",get:function(){return this.css}}]),e}(),gy=my;my.default=my;var vy="'".charCodeAt(0),yy='"'.charCodeAt(0),by="\\".charCodeAt(0),xy="/".charCodeAt(0),wy="\n".charCodeAt(0),ky=" ".charCodeAt(0),_y="\f".charCodeAt(0),Sy="\t".charCodeAt(0),Cy="\r".charCodeAt(0),Ey="[".charCodeAt(0),Ny="]".charCodeAt(0),Iy="(".charCodeAt(0),Oy=")".charCodeAt(0),My="{".charCodeAt(0),jy="}".charCodeAt(0),Ty=";".charCodeAt(0),Py="*".charCodeAt(0),Ay=":".charCodeAt(0),Ry="@".charCodeAt(0),Ly=/[\t\n\f\r "#'()/;[\\\]{}]/g,Dy=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,zy=/.[\r\n"'(/\\]/,Fy=/[\da-f]/i,Uy=sy,By=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Tm(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 o;return this.proxyOf.nodes||(this.nodes=[]),(o=e.prototype.append).call.apply(o,[].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 o;return this.proxyOf.nodes||(this.nodes=[]),(o=e.prototype.prepend).call.apply(o,[].concat([this],n))},t}(Uy),$y=By;By.default=By,Uy.registerAtRule(By);var Vy,Hy,Wy=sy,qy=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Tm(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var o=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 i,a=Fm(o);!(i=a()).done;){i.value.raws.before=n.raws.before}return o},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 Vy(new Hy,this,e).stringify()},t}(Wy);qy.registerLazyResult=function(e){Vy=e},qy.registerProcessor=function(e){Hy=e};var Ky=qy;qy.default=qy,Wy.registerRoot(qy);var Zy={comma:function(e){return Zy.split(e,[","],!0)},space:function(e){return Zy.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,o=[],i="",a=!1,s=0,l=!1,c="",u=!1,d=Fm(e);!(r=d()).done;){var f=r.value;u?u=!1:"\\"===f?u=!0:l?f===c&&(l=!1):'"'===f||"'"===f?(l=!0,c=f):"("===f?s+=1:")"===f?s>0&&(s-=1):0===s&&t.includes(f)&&(a=!0),a?(""!==i&&o.push(i.trim()),i="",a=!1):i+=f}return(n||""!==i)&&o.push(i.trim()),o}},Yy=Zy;Zy.default=Zy;var Xy=sy,Gy=Yy,Jy=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Tm(t,e),Om(t,[{key:"selectors",get:function(){return Gy.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}(Xy),Qy=Jy;Jy.default=Jy,Xy.registerRule(Jy);var eb=fv,tb=function(e,t){void 0===t&&(t={});var n,r,o,i,a,s,l,c,u,d,f=e.css.valueOf(),h=t.ignoreErrors,p=f.length,m=0,g=[],v=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=p},nextToken:function(e){if(v.length)return v.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=f.charCodeAt(m)){case wy:case ky:case Sy:case Cy:case _y:r=m;do{r+=1,n=f.charCodeAt(r)}while(n===ky||n===wy||n===Sy||n===Cy||n===_y);d=["space",f.slice(m,r)],m=r-1;break;case Ey:case Ny:case My:case jy:case Ay:case Ty:case Oy:var b=String.fromCharCode(n);d=[b,b,m];break;case Iy:if(c=g.length?g.pop()[1]:"",u=f.charCodeAt(m+1),"url"===c&&u!==vy&&u!==yy&&u!==ky&&u!==wy&&u!==Sy&&u!==_y&&u!==Cy){r=m;do{if(s=!1,-1===(r=f.indexOf(")",r+1))){if(h||t){r=m;break}y("bracket")}for(l=r;f.charCodeAt(l-1)===by;)l-=1,s=!s}while(s);d=["brackets",f.slice(m,r+1),m,r],m=r}else r=f.indexOf(")",m+1),i=f.slice(m,r+1),-1===r||zy.test(i)?d=["(","(",m]:(d=["brackets",i,m,r],m=r);break;case vy:case yy:o=n===vy?"'":'"',r=m;do{if(s=!1,-1===(r=f.indexOf(o,r+1))){if(h||t){r=m+1;break}y("string")}for(l=r;f.charCodeAt(l-1)===by;)l-=1,s=!s}while(s);d=["string",f.slice(m,r+1),m,r],m=r;break;case Ry:Ly.lastIndex=m+1,Ly.test(f),r=0===Ly.lastIndex?f.length-1:Ly.lastIndex-2,d=["at-word",f.slice(m,r+1),m,r],m=r;break;case by:for(r=m,a=!0;f.charCodeAt(r+1)===by;)r+=1,a=!a;if(n=f.charCodeAt(r+1),a&&n!==xy&&n!==ky&&n!==wy&&n!==Sy&&n!==Cy&&n!==_y&&(r+=1,Fy.test(f.charAt(r)))){for(;Fy.test(f.charAt(r+1));)r+=1;f.charCodeAt(r+1)===ky&&(r+=1)}d=["word",f.slice(m,r+1),m,r],m=r;break;default:n===xy&&f.charCodeAt(m+1)===Py?(0===(r=f.indexOf("*/",m+2)+1)&&(h||t?r=f.length:y("comment")),d=["comment",f.slice(m,r+1),m,r],m=r):(Dy.lastIndex=m+1,Dy.test(f),r=0===Dy.lastIndex?f.length-1:Dy.lastIndex-2,d=["word",f.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},nb=Yv,rb=$y,ob=Ky,ib=Qy,ab={empty:!0,space:!0};var sb=function(){function e(e){this.input=e,this.root=new ob,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,o=new rb;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);for(var i=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(s.length>0){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}s.push(e)}else s.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(o.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(o,"params",s),i&&(e=s[s.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,o=t-1;o>=0&&("space"===(n=e[o])[0]||2!==(r+=1));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,o,i=0,a=Fm(e.entries());!(o=a()).done;){var s=o.value,l=s[0];if("("===(n=(t=s[1])[0])&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new nb;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=tb(this.input)},t.decl=function(e,t){var n=new eb;this.init(n,e[0][2]);var r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[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 i=e[0][0];if(":"===i||"space"===i||"comment"===i)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 a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;l>=0;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var c=this.stringFrom(e,l);" !important"!==(c=this.spacesFromEnd(e)+c)&&(n.raws.important=c);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",f=l;f>0;f--){var h=u[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)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+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.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 ib;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,o=null,i=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(n=l[0],s.push(l),"("===n||"["===n)o||(o=l),i.push("("===n?")":"]");else if(a&&r&&"{"===n)o||(o=l),i.push("}");else if(0===i.length){if(";"===n){if(r)return void this.decl(s,a);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)},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 o,i,a,s,l=n.length,c="",u=!0,d=0;d<l;d+=1)"space"!==(i=(o=n[d])[0])||d!==l-1||r?"comment"===i?(s=n[d-1]?n[d-1][0]:"empty",a=n[d+1]?n[d+1][0]:"empty",ab[s]||ab[a]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){var f=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:f,value:c}}e[t]=c},t.rule=function(e){e.pop();var t=new ib;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}(),lb=sy,cb=sb,ub=Lv;function db(e,t){var n=new ub(e,t),r=new cb(n);try{r.parse()}catch(rp){throw rp}return r.root}var fb=db;db.default=db,lb.registerParse(db);var hb=Xg.isClean,pb=Xg.my,mb=Kv,gb=nv,vb=sy,yb=dy,bb=gy,xb=fb,wb=Ky,kb={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_b={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},Sb={Once:!0,postcssPlugin:!0,prepare:!0};function Cb(e){return"object"===(void 0===e?"undefined":Lm(e))&&"function"==typeof e.then}function Eb(e){var t=!1,n=kb[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 Nb(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Eb(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ib(e){return e[hb]=!1,e.nodes&&e.nodes.forEach(function(e){return Ib(e)}),e}var Ob={},Mb=function(){function e(t,n,r){var o,i=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Lm(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Pm(n,e)||Pm(n,bb))o=Ib(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=xb;r.syntax&&(a=r.syntax.parse),r.parser&&(a=r.parser),a.parse&&(a=a.parse);try{o=a(n,r)}catch(kE){this.processed=!0,this.error=kE}o&&!o[pb]&&vb.rebuild(o)}else o=Ib(n);this.result=new bb(t,o,r),this.helpers=Mm({},Ob,{postcss:Ob,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Lm(e))&&e.prepare?Mm({},e,e.prepare(i.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}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=Fm(this.plugins);!(t=r()).done;){var o=t.value;if("object"===(void 0===o?"undefined":Lm(o)))for(var i in o){if(!_b[i]&&/^[A-Z]/.test(i))throw new Error("Unknown event "+i+" in "+o.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!Sb[i])if("object"===Lm(o[i]))for(var a in o[i])n(o,"*"===a?i:i+"-"+a.toLowerCase(),o[i][a]);else"function"==typeof o[i]&&n(o,i,o[i])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return Nm(function(){var t,n,r,o,i,a,s,l,c,u,d,f;return Um(this,function(h){switch(h.label){case 0:e.plugin=0,t=0,h.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!Cb(r=e.runOnRoot(n)))return[3,5];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,r];case 3:return h.sent(),[3,5];case 4:throw o=h.sent(),e.handleError(o);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];i=e.result.root,h.label=7;case 7:if(i[hb])return[3,14];i[hb]=!0,a=[Nb(i)],h.label=8;case 8:if(!(a.length>0))return[3,13];if(!Cb(s=e.visitTick(a)))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,s];case 10:return h.sent(),[3,12];case 11:throw l=h.sent(),c=a[a.length-1].node,e.handleError(l,c);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,o,a;return Um(this,function(s){switch(s.label){case 0:t=f.value,n=t[0],r=t[1],e.result.lastPlugin=n,s.label=1;case 1:return s.trys.push([1,6,,7]),"document"!==i.type?[3,3]:(o=i.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(o)]);case 2:return s.sent(),[3,5];case 3:return[4,r(i,e.helpers)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:throw a=s.sent(),e.handleError(a);case 7:return[2]}})},d=Fm(e.listeners.OnceExit),h.label=15;case 15:return(f=d()).done?[3,18]:[5,Bm(u())];case 16:h.sent(),h.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":Lm(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 Cb(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(kE){throw this.handleError(kE)}},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=gb;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new mb(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=Fm(this.plugins);!(e=t()).done;){var n=e.value;if(Cb(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[hb];)r[hb]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var o,i=Fm(r.nodes);!(o=i()).done;){var a=o.value;this.visitSync(this.listeners.OnceExit,a)}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=Fm(e);!(n=r()).done;){var o=n.value,i=o[0],a=o[1];this.result.lastPlugin=i;var s=void 0;try{s=a(t,this.helpers)}catch(rp){throw this.handleError(rp,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Cb(s))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 o=r[t.visitorIndex],i=o[0],a=o[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return a(n.toProxy(),this.helpers)}catch(rp){throw this.handleError(rp,n)}}if(0!==t.iterator){for(var s,l=t.iterator;s=n.nodes[n.indexes[l]];)if(n.indexes[l]+=1,!s[hb])return s[hb]=!0,void e.push(Nb(s));t.iterator=0,delete n.indexes[l]}for(var c=t.events;t.eventIndex<c.length;){var u=c[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[hb]=!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[hb]=!0;for(var n,r=Fm(Eb(e));!(n=r()).done;){var o=n.value;if(0===o)e.nodes&&e.each(function(e){e[hb]||t.walkSync(e)});else{var i=this.listeners[o];if(i&&this.visitSync(i,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},Om(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}();Mb.registerPostcss=function(e){Ob=e};var jb=Mb;Mb.default=Mb,wb.registerLazyResult(Mb),yb.registerLazyResult(Mb);var Tb=Kv,Pb=nv,Ab=fb,Rb=gy,Lb=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 o=Pb;this.result=new Rb(this._processor,r,this._opts),this.result.css=t;var i=this;Object.defineProperty(this.result,"root",{get:function(){return i.root}});var a=new Tb(o,r,this._opts,t);if(a.isMap()){var s=a.generate(),l=s[0],c=s[1];l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.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[]},Om(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=Ab;try{e=t(this._css,this._opts)}catch(kE){this.error=kE}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),Db=Lb;Lb.default=Lb;var zb=Db,Fb=jb,Ub=dy,Bb=Ky,$b=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=Fm(e);!(t=r()).done;){var o=t.value;if(!0===o.postcss?o=o():o.postcss&&(o=o.postcss),"object"===(void 0===o?"undefined":Lm(o))&&Array.isArray(o.plugins))n=n.concat(o.plugins);else if("object"===(void 0===o?"undefined":Lm(o))&&o.postcssPlugin)n.push(o);else if("function"==typeof o)n.push(o);else if("object"!==(void 0===o?"undefined":Lm(o))||!o.parse&&!o.stringify)throw new Error(o+" 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 Fb(this,e,t):new zb(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),Vb=$b;$b.default=$b,Bb.registerProcessor($b),Ub.registerProcessor($b);var Hb=fv,Wb=wv,qb=Yv,Kb=$y,Zb=Lv,Yb=Ky,Xb=Qy;function Gb(e,t){if(Array.isArray(e))return e.map(function(e){return Gb(e)});var n=e.inputs,r=Am(e,["inputs"]);if(n){t=[];for(var o,i=Fm(n);!(o=i()).done;){var a=Mm({},o.value,{__proto__:Zb.prototype});a.map&&(a.map=Mm({},a.map,{__proto__:Wb.prototype})),t.push(a)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return Gb(e,t)})),r.source){var s=r.source,l=s.inputId,c=Am(s,["inputId"]);r.source=c,null!=l&&(r.source.input=t[l])}if("root"===r.type)return new Yb(r);if("decl"===r.type)return new Hb(r);if("rule"===r.type)return new Xb(r);if("comment"===r.type)return new qb(r);if("atrule"===r.type)return new Kb(r);throw new Error("Unknown node type: "+e.type)}var Jb=Gb;Gb.default=Gb;var Qb=Yg,ex=fv,tx=jb,nx=sy,rx=Vb,ox=nv,ix=Jb,ax=dy,sx=hy,lx=Yv,cx=$y,ux=gy,dx=Lv,fx=fb,hx=Yy,px=Qy,mx=Ky,gx=uv;function vx(){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 rx(t)}vx.plugin=function(e,t){var n,r=!1;function o(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console&&console.warn&&!r&&(r=!0,_m.LANG&&_m.LANG.startsWith("cn"));var a=t.apply(void 0,[].concat(o));return a.postcssPlugin=e,a.postcssVersion=(new rx).version,a}return Object.defineProperty(o,"postcss",{get:function(){return n||(n=o()),n}}),o.process=function(e,t,n){return vx([o(n)]).process(e,t)},o},vx.stringify=ox,vx.parse=fx,vx.fromJSON=ix,vx.list=hx,vx.comment=function(e){return new lx(e)},vx.atRule=function(e){return new cx(e)},vx.decl=function(e){return new ex(e)},vx.rule=function(e){return new px(e)},vx.root=function(e){return new mx(e)},vx.document=function(e){return new ax(e)},vx.CssSyntaxError=Qb,vx.Declaration=ex,vx.Container=nx,vx.Processor=rx,vx.Document=ax,vx.Comment=lx,vx.Warning=sx,vx.AtRule=cx,vx.Result=ux,vx.Input=dx,vx.Rule=px,vx.Root=mx,vx.Node=gx,tx.registerPostcss(vx);var yx=vx;vx.default=vx;var bx=Fg(yx);bx.stringify,bx.fromJSON,bx.plugin,bx.parse,bx.list,bx.document,bx.comment,bx.atRule,bx.rule,bx.decl,bx.root,bx.CssSyntaxError,bx.Declaration,bx.Container,bx.Processor,bx.Document,bx.Comment,bx.Warning,bx.AtRule,bx.Result,bx.Input,bx.Rule,bx.Root,bx.Node;var xx=Object.defineProperty,wx=function(e,t,n){return function(e,t,n){return t in e?xx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Lm(t))?t+"":t,n)};function kx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function _x(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return Pm(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 Sx={exports:{}},Cx=String,Ex=function(){return{isColorSupported:!1,reset:Cx,bold:Cx,dim:Cx,italic:Cx,underline:Cx,inverse:Cx,hidden:Cx,strikethrough:Cx,black:Cx,red:Cx,green:Cx,yellow:Cx,blue:Cx,magenta:Cx,cyan:Cx,white:Cx,gray:Cx,bgBlack:Cx,bgRed:Cx,bgGreen:Cx,bgYellow:Cx,bgBlue:Cx,bgMagenta:Cx,bgCyan:Cx,bgWhite:Cx}};Sx.exports=Ex(),Sx.exports.createColors=Ex;var Nx=Sx.exports,Ix=_x(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))),Ox=Nx,Mx=Ix,jx=function(e){function t(n,r,o,i,a,s){var l;return(l=e.call(this,n)||this).name="CssSyntaxError",l.reason=n,a&&(l.file=a),i&&(l.source=i),s&&(l.plugin=s),void 0!==r&&void 0!==o&&("number"==typeof r?(l.line=r,l.column=o):(l.line=r.line,l.column=r.column,l.endLine=o.line,l.endColumn=o.column)),l.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(l,t),l}Tm(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=Ox.isColorSupported),Mx&&e&&(n=Mx(n));var r,o,i=n.split(/\r?\n/),a=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),l=String(s).length;if(e){var c=Ox.createColors(!0),u=c.bold,d=c.gray,f=c.red;r=function(e){return u(f(e))},o=function(e){return d(e)}}else r=o=function(e){return e};return i.slice(a,s).map(function(e,n){var i=a+1+n,s=" "+(" "+i).slice(-l)+" | ";if(i===t.line){var c=o(s.replace(/\d/g," "))+e.slice(0,t.column-1).replace(/[^\t]/g," ");return r(">")+o(s)+e+"\n "+c+r("^")}return" "+o(s)+e}).join("\n")},n.toString=function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e},t}(Dm(Error)),Tx=jx;jx.default=jx;var Px={};Px.isClean=Symbol("isClean"),Px.my=Symbol("my");var Ax={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var Rx=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 o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,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,o=0;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(var a=0;a<o;a++)n+=i}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 o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,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 o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return Ax[n];var i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var a,s="raw"+((a=n)[0].toUpperCase()+a.slice(1));return this[s]?r=this[s](i,e):i.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=Ax[n]),i.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 o=n.raws.before.split("\n");return t=(t=o[o.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}(),Lx=Rx;Rx.default=Rx;var Dx=Lx;function zx(e,t){new Dx(t).stringify(e)}var Fx=zx;zx.default=zx;var Ux=Px.isClean,Bx=Px.my,$x=Tx,Vx=Lx,Hx=Fx;function Wx(e,t){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r){var o=e[r],i=void 0===o?"undefined":Lm(o);"parent"===r&&"object"===i?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(function(e){return Wx(e,n)}):("object"===i&&null!==o&&(o=Wx(o)),n[r]=o)}return n}var qx=function(){function e(e){for(var t in void 0===e&&(e={}),this.raws={},this[Ux]=!1,this[Bx]=!0,e)if("nodes"===t){this.nodes=[];for(var n,r=Fm(e[t]);!(n=r()).done;){var o=n.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}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=Wx(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,o=n.start;return this.source.input.error(e,{column:o.column,line:o.line},{column:r.column,line:r.line},t)}return new $x(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[Ux]){this[Ux]=!1;for(var e=this;e=e.parent;)e[Ux]=!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,o=this.source.start.line,i=0;i<e;i++)"\n"===n[i]?(r=1,o+=1):r+=1;return{column:r,line:o}},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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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 Vx).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,o=this,i=!1,a=Fm(t);!(r=a()).done;){var s=r.value;s===this?i=!0:i?(this.parent.insertAfter(o,s),o=s):this.parent.insertBefore(o,s)}i||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 o=0;for(var i in this)if(Object.prototype.hasOwnProperty.call(this,i)&&"parent"!==i&&"proxyCache"!==i){var a=this[i];if(Array.isArray(a))n[i]=a.map(function(e){return"object"===(void 0===e?"undefined":Lm(e))&&e.toJSON?e.toJSON(null,t):e});else if("object"===(void 0===a?"undefined":Lm(a))&&a.toJSON)n[i]=a.toJSON(null,t);else if("source"===i){var s=t.get(a.input);null==s&&(s=o,t.set(a.input,o),o++),n[i]={end:a.end,inputId:s,start:a.start}}else n[i]=a}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=Hx),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 o in n)r[o]=n[o];return e.warn(t,r)},Om(e,[{key:"proxyOf",get:function(){return this}}]),e}(),Kx=qx;qx.default=qx;var Zx=function(e){function t(t){var n;return t&&void 0!==t.value&&"string"!=typeof t.value&&(t=Mm({},t,{value:String(t.value)})),(n=e.call(this,t)||this).type="decl",n}return Tm(t,e),Om(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),t}(Kx),Yx=Zx;Zx.default=Zx;var Xx=function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},Gx=Ix.SourceMapConsumer,Jx=Ix.SourceMapGenerator,Qx=Ix.existsSync,ew=Ix.readFileSync,tw=Ix.dirname,nw=Ix.join;var rw=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=tw(this.mapFile)),r&&(this.text=r)}}var t=e.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new Gx(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),Buffer?Buffer.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":Lm(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=tw(e),Qx(e))return this.mapFile=e,ew(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(Pm(t,Gx))return Jx.fromSourceMap(t).toString();if(Pm(t,Jx))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 o=this.annotation;return e&&(o=nw(tw(e),o)),this.loadFile(o)}}},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}(),ow=rw;rw.default=rw;var iw=Ix.SourceMapConsumer,aw=Ix.SourceMapGenerator,sw=Ix.fileURLToPath,lw=Ix.pathToFileURL,cw=Ix.isAbsolute,uw=Ix.resolve,dw=Xx,fw=Ix,hw=Tx,pw=ow,mw=Symbol("fromOffsetCache"),gw=Boolean(iw&&aw),vw=Boolean(uw&&cw),yw=function(){function e(e,t){if(void 0===t&&(t={}),null==e||"object"===(void 0===e?"undefined":Lm(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&&(!vw||/^\w+:\/\//.test(t.from)||cw(t.from)?this.file=t.from:this.file=uw(t.from)),vw&&gw){var n=new pw(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 "+dw(6)+">"),this.map&&(this.map.file=this.from)}var t=e.prototype;return t.error=function(e,t,n,r){var o,i,a;if(void 0===r&&(r={}),t&&"object"===(void 0===t?"undefined":Lm(t))){var s=t,l=n;if("number"==typeof s.offset){var c=this.fromOffset(s.offset);t=c.line,n=c.col}else t=s.line,n=s.column;if("number"==typeof l.offset){var u=this.fromOffset(l.offset);i=u.line,a=u.col}else i=l.line,a=l.column}else if(!n){var d=this.fromOffset(t);t=d.line,n=d.col}var f=this.origin(t,n,i,a);return(o=f?new hw(e,void 0===f.endLine?f.line:{column:f.column,line:f.line},void 0===f.endLine?f.column:{column:f.endColumn,line:f.endLine},f.source,f.file,r.plugin):new hw(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:a,line:i},this.css,this.file,r.plugin)).input={column:n,endColumn:a,endLine:i,line:t,source:this.css},this.file&&(lw&&(o.input.url=lw(this.file).toString()),o.input.file=this.file),o},t.fromOffset=function(e){var t;if(this[mw])t=this[mw];else{var n=this.css.split("\n");t=new Array(n.length);for(var r=0,o=0,i=n.length;o<i;o++)t[o]=r,r+=n[o].length+1;this[mw]=t}var a=0;if(e>=t[t.length-1])a=t.length-1;else for(var s,l=t.length-2;a<l;)if(e<t[s=a+(l-a>>1)])l=s-1;else{if(!(e>=t[s+1])){a=s;break}a=s+1}return{col:e-t[a]+1,line:a+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:uw(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,t,n,r){if(!this.map)return!1;var o,i,a=this.map.consumer(),s=a.originalPositionFor({column:t,line:e});if(!s.source)return!1;"number"==typeof n&&(o=a.originalPositionFor({column:r,line:n})),i=cw(s.source)?lw(s.source):new URL(s.source,this.map.consumer().sourceRoot||lw(this.map.mapFile));var l={column:s.column,endColumn:o&&o.column,endLine:o&&o.line,line:s.line,url:i.toString()};if("file:"===i.protocol){if(!sw)throw new Error("file: protocol is not available in this PostCSS build");l.file=sw(i)}var c=a.sourceContentFor(s.source);return c&&(l.source=c),l},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=Mm({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},Om(e,[{key:"from",get:function(){return this.file||this.id}}]),e}(),bw=yw;yw.default=yw,fw&&fw.registerInput&&fw.registerInput(yw);var xw=Ix.SourceMapConsumer,ww=Ix.SourceMapGenerator,kw=Ix.dirname,_w=Ix.relative,Sw=Ix.resolve,Cw=Ix.sep,Ew=Ix.pathToFileURL,Nw=bw,Iw=Boolean(xw&&ww),Ow=Boolean(kw&&Sw&&_w&&Cw),Mw=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=Fm(this.previous());!(e=t()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),o=n.root||kw(n.file),i=void 0;!1===this.mapOpts.sourcesContent?(i=new xw(n.text)).sourcesContent&&(i.sourcesContent=null):i=n.consumer(),this.map.applySourceMap(i,r,this.toUrl(this.path(o)))}},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(),Ow&&Iw&&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=ww.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ww({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 ww({file:this.outputFile(),ignoreInvalidMapping:!0});var t,n,r=1,o=1,i="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(s,l,c){if(e.css+=s,l&&"end"!==c&&(a.generated.line=r,a.generated.column=o-1,l.source&&l.source.start?(a.source=e.sourcePath(l),a.original.line=l.source.start.line,a.original.column=l.source.start.column-1,e.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,e.map.addMapping(a))),(t=s.match(/\n/g))?(r+=t.length,n=s.lastIndexOf("\n"),o=s.length-n):o+=s.length,l&&"start"!==c){var u=l.parent||{raws:{}};("decl"===l.type||"atrule"===l.type&&!l.nodes)&&l===u.last&&!u.raws.semicolon||(l.source&&l.source.end?(a.source=e.sourcePath(l),a.original.line=l.source.end.line,a.original.column=l.source.end.column-1,a.generated.line=r,a.generated.column=o-2,e.map.addMapping(a)):(a.source=i,a.original.line=1,a.original.column=0,a.generated.line=r,a.generated.column=o-1,e.map.addMapping(a)))}})},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?kw(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=kw(Sw(n,this.mapOpts.annotation)));var r=_w(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 Nw(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 o=e.usesFileUrls?e.toFileUrl(r):e.toUrl(e.path(r));e.map.setSourceContent(o,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 Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(Ew){var n=Ew(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;"\\"===Cw&&(e=e.replace(/\\/g,"/"));var n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n},e}(),jw=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="comment",n}return Tm(t,e),t}(Kx),Tw=jw;jw.default=jw;var Pw,Aw,Rw,Lw,Dw=Px.isClean,zw=Px.my,Fw=Yx,Uw=Tw;function Bw(e){return e.map(function(e){return e.nodes&&(e.nodes=Bw(e.nodes)),delete e.source,e})}function $w(e){if(e[Dw]=!1,e.proxyOf.nodes)for(var t,n=Fm(e.proxyOf.nodes);!(t=n()).done;){$w(t.value)}}var Vw=function(e){function t(){return e.apply(this,arguments)||this}Tm(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,o=Fm(t);!(r=o()).done;)for(var i,a=r.value,s=Fm(this.normalize(a,this.last));!(i=s()).done;){var l=i.value;this.proxyOf.nodes.push(l)}return this.markDirty(),this},n.cleanRaws=function(t){if(e.prototype.cleanRaws.call(this,t),this.nodes)for(var n,r=Fm(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),o=0;o<n;o++)r[o]=arguments[o];var i;return(i=e)[t].apply(i,[].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),o=1;o<t;o++)r[o-1]=arguments[o];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),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(var i,a=Fm(o);!(i=a()).done;){var s=i.value;this.proxyOf.nodes.splice(r+1,0,s)}for(var l in this.indexes)r<(n=this.indexes[l])&&(this.indexes[l]=n+o.length);return this.markDirty(),this},n.insertBefore=function(e,t){var n,r=this.index(e),o=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(var a,s=Fm(i);!(a=s()).done;){var l=a.value;this.proxyOf.nodes.splice(r,0,l)}for(var c in this.indexes)r<=(n=this.indexes[c])&&(this.indexes[c]=n+i.length);return this.markDirty(),this},n.normalize=function(e,n){var r=this;if("string"==typeof e)e=Bw(Pw(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var o,i=Fm(e=e.slice(0));!(o=i()).done;){var a=o.value;a.parent&&a.parent.removeChild(a,"ignore")}else if("root"===e.type&&"document"!==this.type)for(var s,l=Fm(e=e.nodes.slice(0));!(s=l()).done;){var c=s.value;c.parent&&c.parent.removeChild(c,"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 Fw(e)]}else if(e.selector)e=[new Aw(e)];else if(e.name)e=[new Rw(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Uw(e)]}return e.map(function(e){return e[zw]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Dw]&&$w(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,o=Fm(t=t.reverse());!(r=o()).done;){for(var i,a=r.value,s=this.normalize(a,this.first,"prepend").reverse(),l=Fm(s);!(i=l()).done;){var c=i.value;this.proxyOf.nodes.unshift(c)}for(var u in this.indexes)this.indexes[u]=this.indexes[u]+s.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=Fm(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(rp){throw t.addToError(rp)}return!1!==r&&t.walk&&(r=t.walk(e)),r})},n.walkAtRules=function(e,t){return t?Pm(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?Pm(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?Pm(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)}))},Om(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}(Kx);Vw.registerParse=function(e){Pw=e},Vw.registerRule=function(e){Aw=e},Vw.registerAtRule=function(e){Rw=e},Vw.registerRoot=function(e){Lw=e};var Hw=Vw;Vw.default=Vw,Vw.rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,Rw.prototype):"rule"===e.type?Object.setPrototypeOf(e,Aw.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fw.prototype):"comment"===e.type?Object.setPrototypeOf(e,Uw.prototype):"root"===e.type&&Object.setPrototypeOf(e,Lw.prototype),e[zw]=!0,e.nodes&&e.nodes.forEach(function(e){Vw.rebuild(e)})};var Ww,qw,Kw=function(e){function t(t){var n;return(n=e.call(this,Mm({type:"document"},t))||this).nodes||(n.nodes=[]),n}return Tm(t,e),t.prototype.toResult=function(e){return void 0===e&&(e={}),new Ww(new qw,this,e).stringify()},t}(Hw);Kw.registerLazyResult=function(e){Ww=e},Kw.registerProcessor=function(e){qw=e};var Zw=Kw;Kw.default=Kw;var Yw=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}(),Xw=Yw;Yw.default=Yw;var Gw=Xw,Jw=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 Gw(e,t);return this.messages.push(n),n},t.warnings=function(){return this.messages.filter(function(e){return"warning"===e.type})},Om(e,[{key:"content",get:function(){return this.css}}]),e}(),Qw=Jw;Jw.default=Jw;var ek="'".charCodeAt(0),tk='"'.charCodeAt(0),nk="\\".charCodeAt(0),rk="/".charCodeAt(0),ok="\n".charCodeAt(0),ik=" ".charCodeAt(0),ak="\f".charCodeAt(0),sk="\t".charCodeAt(0),lk="\r".charCodeAt(0),ck="[".charCodeAt(0),uk="]".charCodeAt(0),dk="(".charCodeAt(0),fk=")".charCodeAt(0),hk="{".charCodeAt(0),pk="}".charCodeAt(0),mk=";".charCodeAt(0),gk="*".charCodeAt(0),vk=":".charCodeAt(0),yk="@".charCodeAt(0),bk=/[\t\n\f\r "#'()/;[\\\]{}]/g,xk=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,wk=/.[\r\n"'(/\\]/,kk=/[\da-f]/i,_k=Hw,Sk=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="atrule",n}Tm(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 o;return this.proxyOf.nodes||(this.nodes=[]),(o=e.prototype.append).call.apply(o,[].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 o;return this.proxyOf.nodes||(this.nodes=[]),(o=e.prototype.prepend).call.apply(o,[].concat([this],n))},t}(_k),Ck=Sk;Sk.default=Sk,_k.registerAtRule(Sk);var Ek,Nk,Ik=Hw,Ok=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="root",n.nodes||(n.nodes=[]),n}Tm(t,e);var n=t.prototype;return n.normalize=function(t,n,r){var o=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 i,a=Fm(o);!(i=a()).done;){i.value.raws.before=n.raws.before}return o},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 Ek(new Nk,this,e).stringify()},t}(Ik);Ok.registerLazyResult=function(e){Ek=e},Ok.registerProcessor=function(e){Nk=e};var Mk=Ok;Ok.default=Ok,Ik.registerRoot(Ok);var jk={comma:function(e){return jk.split(e,[","],!0)},space:function(e){return jk.split(e,[" ","\n","\t"])},split:function(e,t,n){for(var r,o=[],i="",a=!1,s=0,l=!1,c="",u=!1,d=Fm(e);!(r=d()).done;){var f=r.value;u?u=!1:"\\"===f?u=!0:l?f===c&&(l=!1):'"'===f||"'"===f?(l=!0,c=f):"("===f?s+=1:")"===f?s>0&&(s-=1):0===s&&t.includes(f)&&(a=!0),a?(""!==i&&o.push(i.trim()),i="",a=!1):i+=f}return(n||""!==i)&&o.push(i.trim()),o}},Tk=jk;jk.default=jk;var Pk=Hw,Ak=Tk,Rk=function(e){function t(t){var n;return(n=e.call(this,t)||this).type="rule",n.nodes||(n.nodes=[]),n}return Tm(t,e),Om(t,[{key:"selectors",get:function(){return Ak.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}(Pk),Lk=Rk;Rk.default=Rk,Pk.registerRule(Rk);var Dk=Yx,zk=function(e,t){void 0===t&&(t={});var n,r,o,i,a,s,l,c,u,d,f=e.css.valueOf(),h=t.ignoreErrors,p=f.length,m=0,g=[],v=[];function y(t){throw e.error("Unclosed "+t,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=p},nextToken:function(e){if(v.length)return v.pop();if(!(m>=p)){var t=!!e&&e.ignoreUnclosed;switch(n=f.charCodeAt(m)){case ok:case ik:case sk:case lk:case ak:r=m;do{r+=1,n=f.charCodeAt(r)}while(n===ik||n===ok||n===sk||n===lk||n===ak);d=["space",f.slice(m,r)],m=r-1;break;case ck:case uk:case hk:case pk:case vk:case mk:case fk:var b=String.fromCharCode(n);d=[b,b,m];break;case dk:if(c=g.length?g.pop()[1]:"",u=f.charCodeAt(m+1),"url"===c&&u!==ek&&u!==tk&&u!==ik&&u!==ok&&u!==sk&&u!==ak&&u!==lk){r=m;do{if(s=!1,-1===(r=f.indexOf(")",r+1))){if(h||t){r=m;break}y("bracket")}for(l=r;f.charCodeAt(l-1)===nk;)l-=1,s=!s}while(s);d=["brackets",f.slice(m,r+1),m,r],m=r}else r=f.indexOf(")",m+1),i=f.slice(m,r+1),-1===r||wk.test(i)?d=["(","(",m]:(d=["brackets",i,m,r],m=r);break;case ek:case tk:o=n===ek?"'":'"',r=m;do{if(s=!1,-1===(r=f.indexOf(o,r+1))){if(h||t){r=m+1;break}y("string")}for(l=r;f.charCodeAt(l-1)===nk;)l-=1,s=!s}while(s);d=["string",f.slice(m,r+1),m,r],m=r;break;case yk:bk.lastIndex=m+1,bk.test(f),r=0===bk.lastIndex?f.length-1:bk.lastIndex-2,d=["at-word",f.slice(m,r+1),m,r],m=r;break;case nk:for(r=m,a=!0;f.charCodeAt(r+1)===nk;)r+=1,a=!a;if(n=f.charCodeAt(r+1),a&&n!==rk&&n!==ik&&n!==ok&&n!==sk&&n!==lk&&n!==ak&&(r+=1,kk.test(f.charAt(r)))){for(;kk.test(f.charAt(r+1));)r+=1;f.charCodeAt(r+1)===ik&&(r+=1)}d=["word",f.slice(m,r+1),m,r],m=r;break;default:n===rk&&f.charCodeAt(m+1)===gk?(0===(r=f.indexOf("*/",m+2)+1)&&(h||t?r=f.length:y("comment")),d=["comment",f.slice(m,r+1),m,r],m=r):(xk.lastIndex=m+1,xk.test(f),r=0===xk.lastIndex?f.length-1:xk.lastIndex-2,d=["word",f.slice(m,r+1),m,r],g.push(d),m=r)}return m++,d}},position:function(){return m}}},Fk=Tw,Uk=Ck,Bk=Mk,$k=Lk,Vk={empty:!0,space:!0};var Hk=function(){function e(e){this.input=e,this.root=new Bk,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,o=new Uk;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);for(var i=!1,a=!1,s=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){a=!0;break}if("}"===t){if(s.length>0){for(n=s[r=s.length-1];n&&"space"===n[0];)n=s[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}s.push(e)}else s.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(o.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(o,"params",s),i&&(e=s[s.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),a&&(o.nodes=[],this.current=o)},t.checkMissedSemicolon=function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,o=t-1;o>=0&&("space"===(n=e[o])[0]||2!==(r+=1));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}},t.colon=function(e){for(var t,n,r,o,i=0,a=Fm(e.entries());!(o=a()).done;){var s=o.value,l=s[0];if("("===(n=(t=s[1])[0])&&(i+=1),")"===n&&(i-=1),0===i&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}return!1},t.comment=function(e){var t=new Fk;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=zk(this.input)},t.decl=function(e,t){var n=new Dk;this.init(n,e[0][2]);var r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[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 i=e[0][0];if(":"===i||"space"===i||"comment"===i)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 a,s=[];e.length&&("space"===(a=e[0][0])||"comment"===a);)s.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;l>=0;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var c=this.stringFrom(e,l);" !important"!==(c=this.spacesFromEnd(e)+c)&&(n.raws.important=c);break}if("important"===r[1].toLowerCase()){for(var u=e.slice(0),d="",f=l;f>0;f--){var h=u[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)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+=s.map(function(e){return e[1]}).join(""),s=[]),this.raw(n,"value",s.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 $k;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,o=null,i=[],a=e[1].startsWith("--"),s=[],l=e;l;){if(n=l[0],s.push(l),"("===n||"["===n)o||(o=l),i.push("("===n?")":"]");else if(a&&r&&"{"===n)o||(o=l),i.push("}");else if(0===i.length){if(";"===n){if(r)return void this.decl(s,a);break}if("{"===n)return void this.rule(s);if("}"===n){this.tokenizer.back(s.pop()),t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&r){if(!a)for(;s.length&&("space"===(l=s[s.length-1][0])||"comment"===l);)this.tokenizer.back(s.pop());this.decl(s,a)}else this.unknownWord(s)},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 o,i,a,s,l=n.length,c="",u=!0,d=0;d<l;d+=1)"space"!==(i=(o=n[d])[0])||d!==l-1||r?"comment"===i?(s=n[d-1]?n[d-1][0]:"empty",a=n[d+1]?n[d+1][0]:"empty",Vk[s]||Vk[a]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){var f=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={raw:f,value:c}}e[t]=c},t.rule=function(e){e.pop();var t=new $k;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}(),Wk=Hw,qk=Hk,Kk=bw;function Zk(e,t){var n=new Kk(e,t),r=new qk(n);try{r.parse()}catch(rp){throw rp}return r.root}var Yk=Zk;Zk.default=Zk,Wk.registerParse(Zk);var Xk=Px.isClean,Gk=Px.my,Jk=Mw,Qk=Fx,e_=Hw,t_=Zw,n_=Qw,r_=Yk,o_=Mk,i_={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},a_={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},s_={Once:!0,postcssPlugin:!0,prepare:!0};function l_(e){return"object"===(void 0===e?"undefined":Lm(e))&&"function"==typeof e.then}function c_(e){var t=!1,n=i_[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 u_(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:c_(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function d_(e){return e[Xk]=!1,e.nodes&&e.nodes.forEach(function(e){return d_(e)}),e}var f_={},h_=function(){function e(t,n,r){var o,i=this;if(this.stringified=!1,this.processed=!1,"object"!==(void 0===n?"undefined":Lm(n))||null===n||"root"!==n.type&&"document"!==n.type)if(Pm(n,e)||Pm(n,n_))o=d_(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var a=r_;r.syntax&&(a=r.syntax.parse),r.parser&&(a=r.parser),a.parse&&(a=a.parse);try{o=a(n,r)}catch(kE){this.processed=!0,this.error=kE}o&&!o[Gk]&&e_.rebuild(o)}else o=d_(n);this.result=new n_(t,o,r),this.helpers=Mm({},f_,{postcss:f_,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===(void 0===e?"undefined":Lm(e))&&e.prepare?Mm({},e,e.prepare(i.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}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=Fm(this.plugins);!(t=r()).done;){var o=t.value;if("object"===(void 0===o?"undefined":Lm(o)))for(var i in o){if(!a_[i]&&/^[A-Z]/.test(i))throw new Error("Unknown event "+i+" in "+o.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!s_[i])if("object"===Lm(o[i]))for(var a in o[i])n(o,"*"===a?i:i+"-"+a.toLowerCase(),o[i][a]);else"function"==typeof o[i]&&n(o,i,o[i])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return Nm(function(){var t,n,r,o,i,a,s,l,c,u,d,f;return Um(this,function(h){switch(h.label){case 0:e.plugin=0,t=0,h.label=1;case 1:if(!(t<e.plugins.length))return[3,6];if(n=e.plugins[t],!l_(r=e.runOnRoot(n)))return[3,5];h.label=2;case 2:return h.trys.push([2,4,,5]),[4,r];case 3:return h.sent(),[3,5];case 4:throw o=h.sent(),e.handleError(o);case 5:return t++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];i=e.result.root,h.label=7;case 7:if(i[Xk])return[3,14];i[Xk]=!0,a=[u_(i)],h.label=8;case 8:if(!(a.length>0))return[3,13];if(!l_(s=e.visitTick(a)))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,s];case 10:return h.sent(),[3,12];case 11:throw l=h.sent(),c=a[a.length-1].node,e.handleError(l,c);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,o,a;return Um(this,function(s){switch(s.label){case 0:t=f.value,n=t[0],r=t[1],e.result.lastPlugin=n,s.label=1;case 1:return s.trys.push([1,6,,7]),"document"!==i.type?[3,3]:(o=i.nodes.map(function(t){return r(t,e.helpers)}),[4,Promise.all(o)]);case 2:return s.sent(),[3,5];case 3:return[4,r(i,e.helpers)];case 4:s.sent(),s.label=5;case 5:return[3,7];case 6:throw a=s.sent(),e.handleError(a);case 7:return[2]}})},d=Fm(e.listeners.OnceExit),h.label=15;case 15:return(f=d()).done?[3,18]:[5,Bm(u())];case 16:h.sent(),h.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":Lm(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 l_(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(kE){throw this.handleError(kE)}},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=Qk;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n=new Jk(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=Fm(this.plugins);!(e=t()).done;){var n=e.value;if(l_(this.runOnRoot(n)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[Xk];)r[Xk]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type)for(var o,i=Fm(r.nodes);!(o=i()).done;){var a=o.value;this.visitSync(this.listeners.OnceExit,a)}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=Fm(e);!(n=r()).done;){var o=n.value,i=o[0],a=o[1];this.result.lastPlugin=i;var s=void 0;try{s=a(t,this.helpers)}catch(rp){throw this.handleError(rp,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(l_(s))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 o=r[t.visitorIndex],i=o[0],a=o[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=i;try{return a(n.toProxy(),this.helpers)}catch(rp){throw this.handleError(rp,n)}}if(0!==t.iterator){for(var s,l=t.iterator;s=n.nodes[n.indexes[l]];)if(n.indexes[l]+=1,!s[Xk])return s[Xk]=!0,void e.push(u_(s));t.iterator=0,delete n.indexes[l]}for(var c=t.events;t.eventIndex<c.length;){var u=c[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[Xk]=!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[Xk]=!0;for(var n,r=Fm(c_(e));!(n=r()).done;){var o=n.value;if(0===o)e.nodes&&e.each(function(e){e[Xk]||t.walkSync(e)});else{var i=this.listeners[o];if(i&&this.visitSync(i,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},Om(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}();h_.registerPostcss=function(e){f_=e};var p_=h_;h_.default=h_,o_.registerLazyResult(h_),t_.registerLazyResult(h_);var m_=Mw,g_=Fx,v_=Yk,y_=Qw,b_=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 o=g_;this.result=new y_(this._processor,r,this._opts),this.result.css=t;var i=this;Object.defineProperty(this.result,"root",{get:function(){return i.root}});var a=new m_(o,r,this._opts,t);if(a.isMap()){var s=a.generate(),l=s[0],c=s[1];l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.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[]},Om(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=v_;try{e=t(this._css,this._opts)}catch(kE){this.error=kE}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),e}(),x_=b_;b_.default=b_;var w_=x_,k_=p_,__=Zw,S_=Mk,C_=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=Fm(e);!(t=r()).done;){var o=t.value;if(!0===o.postcss?o=o():o.postcss&&(o=o.postcss),"object"===(void 0===o?"undefined":Lm(o))&&Array.isArray(o.plugins))n=n.concat(o.plugins);else if("object"===(void 0===o?"undefined":Lm(o))&&o.postcssPlugin)n.push(o);else if("function"==typeof o)n.push(o);else if("object"!==(void 0===o?"undefined":Lm(o))||!o.parse&&!o.stringify)throw new Error(o+" 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 k_(this,e,t):new w_(this,e,t)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},e}(),E_=C_;C_.default=C_,S_.registerProcessor(C_),__.registerProcessor(C_);var N_=Yx,I_=ow,O_=Tw,M_=Ck,j_=bw,T_=Mk,P_=Lk;function A_(e,t){if(Array.isArray(e))return e.map(function(e){return A_(e)});var n=e.inputs,r=Am(e,["inputs"]);if(n){t=[];for(var o,i=Fm(n);!(o=i()).done;){var a=Mm({},o.value,{__proto__:j_.prototype});a.map&&(a.map=Mm({},a.map,{__proto__:I_.prototype})),t.push(a)}}if(r.nodes&&(r.nodes=e.nodes.map(function(e){return A_(e,t)})),r.source){var s=r.source,l=s.inputId,c=Am(s,["inputId"]);r.source=c,null!=l&&(r.source.input=t[l])}if("root"===r.type)return new T_(r);if("decl"===r.type)return new N_(r);if("rule"===r.type)return new P_(r);if("comment"===r.type)return new O_(r);if("atrule"===r.type)return new M_(r);throw new Error("Unknown node type: "+e.type)}var R_=A_;A_.default=A_;var L_=Tx,D_=Yx,z_=p_,F_=Hw,U_=E_,B_=Fx,$_=R_,V_=Zw,H_=Xw,W_=Tw,q_=Ck,K_=Qw,Z_=bw,Y_=Yk,X_=Tk,G_=Lk,J_=Mk,Q_=Kx;function eS(){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 U_(t)}eS.plugin=function(e,t){var n,r=!1;function o(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];console&&console.warn&&!r&&(r=!0,_m.LANG&&_m.LANG.startsWith("cn"));var a=t.apply(void 0,[].concat(o));return a.postcssPlugin=e,a.postcssVersion=(new U_).version,a}return Object.defineProperty(o,"postcss",{get:function(){return n||(n=o()),n}}),o.process=function(e,t,n){return eS([o(n)]).process(e,t)},o},eS.stringify=B_,eS.parse=Y_,eS.fromJSON=$_,eS.list=X_,eS.comment=function(e){return new W_(e)},eS.atRule=function(e){return new q_(e)},eS.decl=function(e){return new D_(e)},eS.rule=function(e){return new G_(e)},eS.root=function(e){return new J_(e)},eS.document=function(e){return new V_(e)},eS.CssSyntaxError=L_,eS.Declaration=D_,eS.Container=F_,eS.Processor=U_,eS.Document=V_,eS.Comment=W_,eS.Warning=H_,eS.AtRule=q_,eS.Result=K_,eS.Input=Z_,eS.Rule=G_,eS.Root=J_,eS.Node=Q_,z_.registerPostcss(eS);var tS=eS;eS.default=eS;var nS=kx(tS);nS.stringify,nS.fromJSON,nS.plugin,nS.parse,nS.list,nS.document,nS.comment,nS.atRule,nS.rule,nS.decl,nS.root,nS.CssSyntaxError,nS.Declaration,nS.Container,nS.Processor,nS.Document,nS.Comment,nS.Warning,nS.AtRule,nS.Result,nS.Input,nS.Rule,nS.Root,nS.Node;var rS=function(){function e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];wx(this,"parentElement",null),wx(this,"parentNode",null),wx(this,"ownerDocument"),wx(this,"firstChild",null),wx(this,"lastChild",null),wx(this,"previousSibling",null),wx(this,"nextSibling",null),wx(this,"ELEMENT_NODE",1),wx(this,"TEXT_NODE",3),wx(this,"nodeType"),wx(this,"nodeName"),wx(this,"RRNodeType")}var t=e.prototype;return t.contains=function(t){if(!Pm(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"},Om(e,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}}]),e}(),oS={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},iS={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},aS={};function sS(e){if(aS[e])return aS[e];var t=globalThis[e],n=t.prototype,r=e in oS?oS[e]:void 0,o=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]"))})),i=e in iS?iS[e]:void 0,a=Boolean(i&&i.every(function(e){var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&a&&!globalThis.Zone)return aS[e]=t.prototype,t.prototype;try{var s=document.createElement("iframe");document.body.appendChild(s);var l=s.contentWindow;if(!l)return t.prototype;var c=l[e].prototype;return document.body.removeChild(s),c?aS[e]=c:n}catch(rp){return n}}var lS={};function cS(e,t,n){var r,o=e+"."+String(n);if(lS[o])return lS[o].call(t);var i=sS(e),a=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return a?(lS[o]=a,a.call(t)):t[n]}var uS={};function dS(e,t,n){var r=e+"."+String(n);if(uS[r])return uS[r].bind(t);var o=sS(e)[n];return"function"!=typeof o?t[n]:(uS[r]=o,o.bind(t))}function fS(){return sS("MutationObserver").constructor}function hS(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(rp){return function(){}}}var pS={childNodes:function(e){return cS("Node",e,"childNodes")},parentNode:function(e){return cS("Node",e,"parentNode")},parentElement:function(e){return cS("Node",e,"parentElement")},textContent:function(e){return cS("Node",e,"textContent")},contains:function(e,t){return dS("Node",e,"contains")(t)},getRootNode:function(e){return dS("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cS("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cS("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cS("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cS("Element",e,"querySelectorAll")(t)},mutationObserver:fS,patch:hS};function mS(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 gS={map:{},getId:function(){return-1},getNode:function(){return null},removeNodeFromMap:function(){},has:function(){return!1},reset:function(){}};function vS(e,t,n){void 0===n&&(n={});var r=null,o=0;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var l=Date.now();o||!1!==n.leading||(o=l);var c=t-(l-o),u=this;c<=0||c>t?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,a)):r||!1===n.trailing||(r=setTimeout(function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,a)},c))}}function yS(e,t,n,r,o){void 0===o&&(o=window);var i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),i&&i.set&&i.set.call(this,e)}}),function(){return yS(e,t,i||{},!0)}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(gS=new Proxy(gS,{get:function(e,t,n){return Reflect.get(e,t,n)}}));var bS=Date.now;function xS(e){var t,n,r,o,i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=pS.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=pS.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function wS(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kS(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _S(e){return e?e.nodeType===e.ELEMENT_NODE?e:pS.parentElement(e):null}function SS(e,t,n,r){if(!e)return!1;var o=_S(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(Ag(o,t,r))return!0}catch(rp){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function CS(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function ES(e,t){if(og(e))return!1;var n=t.getId(e);if(!t.has(n))return!0;var r=pS.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||ES(r,t))}function NS(e){return Boolean(e.changedTouches)}function IS(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function OS(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function MS(e){return!!e&&(Pm(e,rS)&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(pS.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bS=function(){return(new Date).getTime()});var jS=function(){function e(){Hm(this,"id",1),Hm(this,"styleIDMap",new WeakMap),Hm(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 TS(e){var t,n=null;return"getRootNode"in e&&(null==(t=pS.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&pS.host(pS.getRootNode(e))&&(n=pS.host(pS.getRootNode(e))),n}function PS(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=TS(n);)n=t;return n}(e);return pS.contains(t,n)}function AS(e){var t=e.ownerDocument;return!!t&&(pS.contains(t,e)||PS(e))}var RS=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}(RS||{}),LS=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}(LS||{}),DS=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}(DS||{}),zS=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(zS||{}),FS=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(FS||{}),US=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}(US||{}),BS=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}(BS||{});function $S(e){return"__ln"in e}var VS,HS=function(){function e(){Hm(this,"length",0),Hm(this,"head",null),Hm(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&&$S(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&&$S(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}(),WS=function(e,t){return e+"@"+t},qS=function(){function e(){var e=this;Hm(this,"frozen",!1),Hm(this,"locked",!1),Hm(this,"texts",[]),Hm(this,"attributes",[]),Hm(this,"attributeMap",new WeakMap),Hm(this,"removes",[]),Hm(this,"mapRemoves",[]),Hm(this,"movedMap",{}),Hm(this,"addedSet",new Set),Hm(this,"movedSet",new Set),Hm(this,"droppedSet",new Set),Hm(this,"removesSubTreeCache",new Set),Hm(this,"mutationCb"),Hm(this,"blockClass"),Hm(this,"blockSelector"),Hm(this,"maskTextClass"),Hm(this,"maskTextSelector"),Hm(this,"inlineStylesheet"),Hm(this,"maskInputOptions"),Hm(this,"maskTextFn"),Hm(this,"maskInputFn"),Hm(this,"keepIframeSrcFn"),Hm(this,"recordCanvas"),Hm(this,"inlineImages"),Hm(this,"slimDOMOptions"),Hm(this,"dataURLOptions"),Hm(this,"doc"),Hm(this,"mirror"),Hm(this,"iframeManager"),Hm(this,"stylesheetManager"),Hm(this,"shadowDomManager"),Hm(this,"canvasManager"),Hm(this,"processedNodeManager"),Hm(this,"unattachedDoc"),Hm(this,"processMutations",function(t){t.forEach(e.processMutation),e.emit()}),Hm(this,"emit",function(){if(!e.frozen&&!e.locked){for(var t=[],n=new Set,r=new HS,o=function(t){for(var n=t,r=-2;-2===r;)r=(n=n&&n.nextSibling)&&e.mirror.getId(n);return r},i=function(i){var a=pS.parentNode(i);if(a&&AS(i)){var s=!1;if(i.nodeType===Node.TEXT_NODE){var l=a.tagName;if("TEXTAREA"===l)return;"STYLE"===l&&e.addedSet.has(a)&&(s=!0)}var c=og(a)?e.mirror.getId(TS(i)):e.mirror.getId(a),u=o(i);if(-1===c||-1===u)return r.addNode(i);var d=zg(i,{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){IS(t,e.mirror)&&e.iframeManager.addIframe(t),OS(t,e.mirror)&&e.stylesheetManager.trackLinkElement(t),MS(i)&&e.shadowDomManager.addShadowRoot(pS.shadowRoot(i),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:s});d&&(t.push({parentId:c,nextId:u,node:d}),n.add(d.id))}};e.mapRemoves.length;)e.mirror.removeNodeFromMap(e.mapRemoves.shift());for(var a,s=Fm(e.movedSet);!(a=s()).done;){var l=a.value;ZS(e.removesSubTreeCache,l,e.mirror)&&!e.movedSet.has(pS.parentNode(l))||i(l)}for(var c,u=Fm(e.addedSet);!(c=u()).done;){var d=c.value;YS(e.droppedSet,d)||ZS(e.removesSubTreeCache,d,e.mirror)?YS(e.movedSet,d)?i(d):e.droppedSet.add(d):i(d)}for(var f=null;r.length;){var h=null;if(f){var p=e.mirror.getId(pS.parentNode(f.value)),m=o(f.value);-1!==p&&-1!==m&&(h=f)}if(!h)for(var g=r.tail;g;){var v=g;if(g=g.previous,v){var y=e.mirror.getId(pS.parentNode(v.value));if(-1===o(v.value))continue;if(-1!==y){h=v;break}var b=v.value,x=pS.parentNode(b);if(x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var w=pS.host(x);if(-1!==e.mirror.getId(w)){h=v;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}f=h.previous,r.removeNode(h.value),i(h.value)}var k={texts:e.texts.map(function(t){var n=t.node,r=pS.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),o=JSON.stringify(t._unchangedStyles);r.length<n.style.length&&(r+o).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};(k.texts.length||k.attributes.length||k.removes.length||k.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(k))}}),Hm(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(pS.childNodes(t),function(e){return pS.textContent(e)||""}).join("");n.attributes.value=cg({element:t,maskInputOptions:e.maskInputOptions,tagName:t.tagName,type:fg(t),value:r,maskInputFn:e.maskInputFn})}),Hm(this,"processMutation",function(t){if(!CS(t.target,e.mirror,e.slimDOMOptions))switch(t.type){case"characterData":var n=pS.textContent(t.target);SS(t.target,e.blockClass,e.blockSelector,!1)||n===t.oldValue||e.texts.push({value:Rg(t.target,e.maskTextClass,e.maskTextSelector,!0)&&n?e.maskTextFn?e.maskTextFn(n,_S(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break;case"attributes":var r=t.target,o=t.attributeName,i=t.target.getAttribute(o);if("value"===o){var a=fg(r);i=cg({element:r,maskInputOptions:e.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:e.maskInputFn})}if(SS(t.target,e.blockClass,e.blockSelector,!1)||i===t.oldValue)return;var s=e.attributeMap.get(t.target);if("IFRAME"===r.tagName&&"src"===o&&!e.keepIframeSrcFn(i)){if(r.contentDocument)return;o="rr_src"}if(s||(s={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},e.attributes.push(s),e.attributeMap.set(t.target,s)),"type"===o&&"INPUT"===r.tagName&&"password"===(t.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!Pg(r.tagName,o))if(s.attributes[o]=Tg(e.doc,ug(r.tagName),ug(o),i),"style"===o){if(!e.unattachedDoc)try{e.unattachedDoc=document.implementation.createHTMLDocument()}catch(rp){e.unattachedDoc=e.doc}var l=e.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(var c,u=Fm(Array.from(r.style));!(c=u()).done;){var d=c.value,f=r.style.getPropertyValue(d),h=r.style.getPropertyPriority(d);f!==l.style.getPropertyValue(d)||h!==l.style.getPropertyPriority(d)?s.styleDiff[d]=""===h?f:[f,h]:s._unchangedStyles[d]=[f,h]}for(var p,m=Fm(Array.from(l.style));!(p=m()).done;){var g=p.value;""===r.style.getPropertyValue(g)&&(s.styleDiff[g]=!1)}}else"open"===o&&"DIALOG"===r.tagName&&(r.matches("dialog:modal")?s.attributes.rr_open_mode="modal":s.attributes.rr_open_mode="non-modal");break;case"childList":if(SS(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),o=og(t.target)?e.mirror.getId(pS.host(t.target)):e.mirror.getId(t.target);SS(t.target,e.blockClass,e.blockSelector,!1)||CS(n,e.mirror,e.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(n,e.mirror)||(e.addedSet.has(n)?(KS(e.addedSet,n),e.droppedSet.add(n)):e.addedSet.has(t.target)&&-1===r||ES(t.target,e.mirror)||(e.movedSet.has(n)&&e.movedMap[WS(r,o)]?KS(e.movedSet,n):(e.removes.push({parentId:o,id:r,isShadow:!(!og(t.target)||!ig(t.target))||void 0}),function(e,t){var n=[e];for(;n.length;){var r=n.pop();t.has(r)||(t.add(r),pS.childNodes(r).forEach(function(e){return n.push(e)}))}}(n,e.removesSubTreeCache))),e.mapRemoves.push(n))})}}),Hm(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(CS(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[WS(e.mirror.getId(t),r)]=!0)}else e.addedSet.add(t),e.droppedSet.delete(t);SS(t,e.blockClass,e.blockSelector,!1)||(pS.childNodes(t).forEach(function(t){return e.genAdds(t)}),MS(t)&&pS.childNodes(pS.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 KS(e,t){e.delete(t),pS.childNodes(t).forEach(function(t){return KS(e,t)})}function ZS(e,t,n){return 0!==e.size&&function(e,t){var n=pS.parentNode(t);return!!n&&e.has(n)}(e,t)}function YS(e,t){return 0!==e.size&&XS(e,t)}function XS(e,t){var n=pS.parentNode(t);return!!n&&(!!e.has(n)||XS(e,n))}var GS=function(e){if(!VS)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(kE){if(VS&&!0===VS(kE))return;throw kE}}},JS=[];function QS(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(rp){}return e&&e.target}function eC(e,t){var n=new qS;JS.push(n),n.init(e);var r=new(fS())(GS(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function tC(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,l=[],c=null;return Object.keys(DS).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]}).forEach(function(e){var a=ug(e),s=function(e){return function(n){var a=QS(n);if(!SS(a,o,i,!0)){var s=null,l=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=zS.Mouse;break;case"touch":s=zS.Touch;break;case"pen":s=zS.Pen}s===zS.Touch?DS[e]===DS.MouseDown?l="TouchStart":DS[e]===DS.MouseUp&&(l="TouchEnd"):zS.Pen}else NS(n)&&(s=zS.Touch);null!==s?(c=s,(l.startsWith("Touch")&&s===zS.Touch||l.startsWith("Mouse")&&s===zS.Mouse)&&(s=null)):DS[e]===DS.Click&&(s=c,c=null);var u=NS(n)?n.changedTouches[0]:n;if(u){var d=r.getId(a),f=u.clientX,h=u.clientY;GS(t)(Mm({type:DS[l],id:d,x:f,y:h},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(DS[e]){case DS.MouseDown:case DS.MouseUp:a=a.replace("mouse","pointer");break;case DS.TouchStart:case DS.TouchEnd:return}l.push(mS(a,s,n))}),GS(function(){l.forEach(function(e){return e()})})}function nC(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;return mS("scroll",GS(vS(GS(function(e){var a=QS(e);if(a&&!SS(a,o,i,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var l=xS(n.defaultView);t({id:s,x:l.left,y:l.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}}),a.scroll||100)),n)}var rC=["INPUT","TEXTAREA","SELECT"],oC=new WeakMap;function iC(e){return function(e,t){if(cC("CSSGroupingRule")&&Pm(e.parentRule,CSSGroupingRule)||cC("CSSMediaRule")&&Pm(e.parentRule,CSSMediaRule)||cC("CSSSupportsRule")&&Pm(e.parentRule,CSSSupportsRule)||cC("CSSConditionRule")&&Pm(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 aC(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function sC(e,t){var n,r,o,i=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?i.getId(t):i.getId(pS.host(t));var l="#document"===t.nodeName?null==(n=t.defaultView)?void 0:n.Document:null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.ShadowRoot,c=(null==l?void 0:l.prototype)?Object.getOwnPropertyDescriptor(null==l?void 0:l.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&l&&c?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var e;return null==(e=c.get)?void 0:e.call(this)},set:function(e){var t,n=null==(t=c.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(rp){}return n}}),GS(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):function(){}}function lC(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,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,f=e.fontCb,h=e.selectionCb,p=e.customElementCb;e.mutationCb=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i;t.mutation&&(i=t).mutation.apply(i,[].concat(r)),n.apply(void 0,[].concat(r))},e.mousemoveCb=function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];var i;t.mousemove&&(i=t).mousemove.apply(i,[].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 i;t.mouseInteraction&&(i=t).mouseInteraction.apply(i,[].concat(n)),o.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 o;t.scroll&&(o=t).scroll.apply(o,[].concat(n)),i.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 o;t.viewportResize&&(o=t).viewportResize.apply(o,[].concat(n)),a.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 o;t.input&&(o=t).input.apply(o,[].concat(n)),s.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 o;t.mediaInteaction&&(o=t).mediaInteaction.apply(o,[].concat(n)),l.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 o;t.styleSheetRule&&(o=t).styleSheetRule.apply(o,[].concat(n)),c.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 o;t.styleDeclaration&&(o=t).styleDeclaration.apply(o,[].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 o;t.canvasMutation&&(o=t).canvasMutation.apply(o,[].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 o;t.font&&(o=t).font.apply(o,[].concat(n)),f.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 o;t.selection&&(o=t).selection.apply(o,[].concat(n)),h.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 o;t.customElement&&(o=t).customElement.apply(o,[].concat(n)),p.apply(void 0,[].concat(n))}}(e,t),e.recordDOM&&(n=eC(e,e.doc));var o,i,a,s,l,c=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,l=[],c=vS(GS(function(e){var n=Date.now()-i;t(l.map(function(e){return e.timeOffset-=n,e}),e),l=[],i=null}),s),u=GS(vS(GS(function(e){var t=QS(e),n=NS(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=bS()),l.push({x:r,y:a,id:o.getId(t),timeOffset:bS()-i}),c("undefined"!=typeof DragEvent&&Pm(e,DragEvent)?LS.Drag:Pm(e,MouseEvent)?LS.MouseMove:LS.TouchMove)}),a,{trailing:!1})),d=[mS("mousemove",u,r),mS("touchmove",u,r),mS("drag",u,r)];return GS(function(){d.forEach(function(e){return e()})})}(e),u=tC(e),d=nC(e),f=(o={win:r},i=e.viewportResizeCb,a=o.win,s=-1,l=-1,mS("resize",GS(vS(GS(function(){var e=wS(),t=kS();s===e&&l===t||(i({width:Number(t),height:Number(e)}),s=e,l=t)}),200)),a)),h=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,l=e.maskInputOptions,c=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function f(e){var t=QS(e),r=e.isTrusted,u=t&&t.tagName;if(t&&"OPTION"===u&&(t=pS.parentElement(t)),t&&u&&!(rC.indexOf(u)<0)&&!SS(t,o,i,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var f=t.value,p=!1,m=fg(t)||"";"radio"===m||"checkbox"===m?p=t.checked:(l[u.toLowerCase()]||l[m])&&(f=cg({element:t,maskInputOptions:l,tagName:u,type:m,value:f,maskInputFn:c})),h(t,d?{text:f,isChecked:p,userTriggered:r}:{text:f,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;h(e,d?{text:n,isChecked:!p,userTriggered:!1}:{text:n,isChecked:!p})}})}}function h(e,n){var o=oC.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){oC.set(e,n);var i=r.getId(e);GS(t)(Mm({},n,{id:i}))}}var p=("last"===u.input?["change"]:["input","change"]).map(function(e){return mS(e,GS(f),n)}),m=n.defaultView;if(!m)return function(){p.forEach(function(e){return e()})};var g,v=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[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 v&&v.set&&(g=p).push.apply(g,[].concat(y.map(function(e){return yS(e[0],e[1],{set:function(){GS(f)({target:this,isTrusted:!1})}},!1,m)}))),GS(function(){p.forEach(function(e){return e()})})}(e),p=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,i=e.sampling,a=e.doc,s=GS(function(e){return vS(GS(function(i){var a=QS(i);if(a&&!SS(a,n,r,!0)){var s=a.currentTime,l=a.volume,c=a.muted,u=a.playbackRate,d=a.loop;t({type:e,id:o.getId(a),currentTime:s,volume:l,muted:c,playbackRate:u,loop:d})}}),i.media||500)}),l=[mS("play",s(US.Play),a),mS("pause",s(US.Pause),a),mS("seeked",s(US.Seeked),a),mS("volumechange",s(US.VolumeChange),a),mS("ratechange",s(US.RateChange),a)];return GS(function(){l.forEach(function(e){return e()})})}(e),m=function(){},g=function(){},v=function(){},y=function(){};e.recordDOM&&(m=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,i=t.win;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return function(){};var a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:GS(function(e,t,i){var a=i[0],s=i[1],l=aC(t,r,o.styleMirror),c=l.id,u=l.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,adds:[{rule:a,index:s}]}),e.apply(t,i)})}),i.CSSStyleSheet.prototype.addRule=function(e,t,n){void 0===n&&(n=this.cssRules.length);var r=e+" { "+t+" }";return i.CSSStyleSheet.prototype.insertRule.apply(this,[r,n])};var s,l,c=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(c,{apply:GS(function(e,t,i){var a=i[0],s=aC(t,r,o.styleMirror),l=s.id,c=s.styleId;return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,removes:[{index:a}]}),e.apply(t,i)})}),i.CSSStyleSheet.prototype.removeRule=function(e){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},i.CSSStyleSheet.prototype.replace&&(s=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:GS(function(e,t,i){var a=i[0],s=aC(t,r,o.styleMirror),l=s.id,c=s.styleId;return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,replace:a}),e.apply(t,i)})})),i.CSSStyleSheet.prototype.replaceSync&&(l=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:GS(function(e,t,i){var a=i[0],s=aC(t,r,o.styleMirror),l=s.id,c=s.styleId;return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,replaceSync:a}),e.apply(t,i)})}));var u={};uC("CSSGroupingRule")?u.CSSGroupingRule=i.CSSGroupingRule:(uC("CSSMediaRule")&&(u.CSSMediaRule=i.CSSMediaRule),uC("CSSConditionRule")&&(u.CSSConditionRule=i.CSSConditionRule),uC("CSSSupportsRule")&&(u.CSSSupportsRule=i.CSSSupportsRule));var d={};return Object.entries(u).forEach(function(e){var t=e[0],i=e[1];d[t]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(d[t].insertRule,{apply:GS(function(e,t,i){var a=i[0],s=i[1],l=aC(t.parentStyleSheet,r,o.styleMirror),c=l.id,u=l.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,adds:[{rule:a,index:[].concat(iC(t),[s||0])}]}),e.apply(t,i)})}),i.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:GS(function(e,t,i){var a=i[0],s=aC(t.parentStyleSheet,r,o.styleMirror),l=s.id,c=s.styleId;return(l&&-1!==l||c&&-1!==c)&&n({id:l,styleId:c,removes:[{index:[].concat(iC(t),[a])}]}),e.apply(t,i)})})}),GS(function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=c,s&&(i.CSSStyleSheet.prototype.replace=s),l&&(i.CSSStyleSheet.prototype.replaceSync=l),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=sC(e,e.doc),v=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,i=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:GS(function(e,t,a){var l,c=a[0],u=a[1],d=a[2];if(o.has(c))return s.apply(t,[c,u,d]);var f=aC(null==(l=t.parentRule)?void 0:l.parentStyleSheet,r,i.styleMirror),h=f.id,p=f.styleId;return(h&&-1!==h||p&&-1!==p)&&n({id:h,styleId:p,set:{property:c,value:u,priority:d},index:iC(t.parentRule)}),e.apply(t,a)})});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:GS(function(e,t,a){var s,c=a[0];if(o.has(c))return l.apply(t,[c]);var u=aC(null==(s=t.parentRule)?void 0:s.parentStyleSheet,r,i.styleMirror),d=u.id,f=u.styleId;return(d&&-1!==d||f&&-1!==f)&&n({id:d,styleId:f,remove:{property:c},index:iC(t.parentRule)}),e.apply(t,a)})}),GS(function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=l})}(e,{win:r}),e.collectFonts&&(y=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=hS(n.fonts,"add",function(e){return function(n){return setTimeout(GS(function(){var e=i.get(n);e&&(t(e),i.delete(n))}),0),e.apply(this,[n])}});return o.push(function(){r.FontFace=a}),o.push(s),GS(function(){o.forEach(function(e){return e()})})}(e)));for(var b,x=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,i=e.selectionCb,a=!0,s=GS(function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],l=e.rangeCount||0,c=0;c<l;c++){var u=e.getRangeAt(c),d=u.startContainer,f=u.startOffset,h=u.endContainer,p=u.endOffset;SS(d,r,o,!0)||SS(h,r,o,!0)||s.push({start:n.getId(d),startOffset:f,end:n.getId(h),endOffset:p})}i({ranges:s})}});return s(),mS("selectionchange",s)}(e),w=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?hS(r.customElements,"define",function(e){return function(t,r,o){try{n({define:{name:t}})}catch(rp){}return e.apply(this,[t,r,o])}}):function(){}}(e),k=[],_=Fm(e.plugins);!(b=_()).done;){var S=b.value;k.push(S.observer(S.callback,r,S.options))}return GS(function(){JS.forEach(function(e){return e.reset()}),null==n||n.disconnect(),c(),u(),d(),f(),h(),p(),m(),g(),v(),y(),x(),w(),k.forEach(function(e){return e()})})}function cC(e){return void 0!==window[e]}function uC(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var dC=function(){function e(e){Hm(this,"iframeIdToRemoteIdMap",new WeakMap),Hm(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}var t=e.prototype;return t.getId=function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e),a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a},t.getIds=function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map(function(t){return n.getId(e,t,r,o)})},t.getRemoteId=function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-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}(),fC=function(){function e(e){Hm(this,"iframes",new WeakMap),Hm(this,"crossOriginIframeMap",new WeakMap),Hm(this,"crossOriginIframeMirror",new dC(Cg)),Hm(this,"crossOriginIframeStyleMirror"),Hm(this,"crossOriginIframeRootIdMap",new WeakMap),Hm(this,"mirror"),Hm(this,"mutationCb"),Hm(this,"wrappedEmit"),Hm(this,"loadListener"),Hm(this,"stylesheetManager"),Hm(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dC(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 RS.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:RS.IncrementalSnapshot,data:{source:LS.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case RS.Meta:case RS.Load:case RS.DomContentLoaded:return!1;case RS.Plugin:return t;case RS.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case RS.IncrementalSnapshot:switch(t.data.source){case LS.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 LS.Drag:case LS.TouchMove:case LS.MouseMove:return t.data.positions.forEach(function(t){r.replaceIds(t,e,["id"])}),t;case LS.ViewportResize:return!1;case LS.MediaInteraction:case LS.MouseInteraction:case LS.Scroll:case LS.CanvasMutation:case LS.Input:return this.replaceIds(t.data,e,["id"]),t;case LS.StyleSheetRule:case LS.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case LS.Font:return t;case LS.Selection:return t.data.ranges.forEach(function(t){r.replaceIds(t,e,["start","end"])}),t;case LS.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 o,i=Fm(r);!(o=i()).done;){var a=o.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}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===BS.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})},e}(),hC=function(){function e(e){Hm(this,"shadowDoms",new WeakSet),Hm(this,"mutationCb"),Hm(this,"scrollCb"),Hm(this,"bypassOptions"),Hm(this,"mirror"),Hm(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(ig(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=eC(Mm({},this.bypassOptions,{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return r.disconnect()}),this.restoreHandlers.push(nC(Mm({},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(pS.host(e))),n.restoreHandlers.push(sC({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(hS(e.prototype,"attachShadow",function(e){return function(r){var o=e.call(this,r),i=pS.shadowRoot(this);return i&&AS(this)&&n.addShadowRoot(i,t),o}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch(rp){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},e}(),pC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mC="undefined"==typeof Uint8Array?[]:new Uint8Array(256),gC=0;gC<64;gC++)mC[pC.charCodeAt(gC)]=gC;var vC=new Map;var yC=function(e,t,n){if(e&&(wC(e,t)||"object"===(void 0===e?"undefined":Lm(e)))){var r=function(e,t){var n=vC.get(e);return n||(n=new Map,vC.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function bC(e,t,n){if(Pm(e,Array))return e.map(function(e){return bC(e,t,n)});if(null===e)return e;if(Pm(e,Float32Array)||Pm(e,Float64Array)||Pm(e,Int32Array)||Pm(e,Uint32Array)||Pm(e,Uint8Array)||Pm(e,Uint16Array)||Pm(e,Int16Array)||Pm(e,Int8Array)||Pm(e,Uint8ClampedArray))return{rr_type:e.constructor.name,args:[Object.values(e)]};if(Pm(e,ArrayBuffer))return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=pC[n[t]>>2],o+=pC[(3&n[t])<<4|n[t+1]>>4],o+=pC[(15&n[t+1])<<2|n[t+2]>>6],o+=pC[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(Pm(e,DataView))return{rr_type:e.constructor.name,args:[bC(e.buffer,t,n),e.byteOffset,e.byteLength]};if(Pm(e,HTMLImageElement))return{rr_type:e.constructor.name,src:e.src};if(Pm(e,HTMLCanvasElement)){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return Pm(e,ImageData)?{rr_type:e.constructor.name,args:[bC(e.data,t,n),e.width,e.height]}:wC(e,t)||"object"===(void 0===e?"undefined":Lm(e))?{rr_type:e.constructor.name,index:yC(e,t,n)}:e}var xC=function(e,t,n){return e.map(function(e){return bC(e,t,n)})},wC=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 Pm(e,t[n])}))};function kC(e,t,n,r){var o=[];try{var i=hS(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(!SS(this,t,n,!0)){var l=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=l),r&&["webgl","webgl2"].includes(l))if(a[0]&&"object"===Lm(a[0])){var c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[].concat([o],a))}});o.push(i)}catch(rp){}return function(){o.forEach(function(e){return e()})}}function _C(e,t,n,r,o,i){for(var a,s=function(){var s=a.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return"continue";try{if("function"!=typeof e[s])return"continue";var c=hS(e,s,function(e){return function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var u=e.apply(this,l);if(yC(u,i,this),"tagName"in this.canvas&&!SS(this.canvas,r,o,!0)){var d=xC(l,i,this),f={type:t,property:s,args:d};n(this.canvas,f)}return u}});l.push(c)}catch(rp){var u=yS(e,s,{set:function(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});l.push(u)}},l=[],c=Fm(Object.getOwnPropertyNames(e));!(a=c()).done;)s();return l}var SC,CC="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",EC="undefined"!=typeof window&&window.Blob&&new Blob([(SC=CC,Uint8Array.from(atob(SC),function(e){return e.charCodeAt(0)}))],{type:"text/javascript;charset=utf-8"});function NC(e){var t;try{if(!(t=EC&&(window.URL||window.webkitURL).createObjectURL(EC)))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(rp){return new Worker("data:text/javascript;base64,"+CC,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var IC,OC,MC,jC=function(){function e(e){var t=this;Hm(this,"pendingCanvasMutations",new Map),Hm(this,"rafStamps",{latestId:0,invokeId:null}),Hm(this,"mirror"),Hm(this,"mutationCb"),Hm(this,"resetObservers"),Hm(this,"frozen",!1),Hm(this,"locked",!1),Hm(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,o=e.win,i=e.blockClass,a=e.blockSelector,s=e.recordCanvas,l=e.dataURLOptions;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===r&&this.initCanvasMutationObserver(o,i,a),s&&"number"==typeof r&&this.initCanvasFPSObserver(r,o,i,a,{dataURLOptions:l})}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,o){var i=this,a=kC(t,n,r,!0),s=new Map,l=new NC;l.onmessage=function(e){var t=e.data.id;if(s.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,a=n.width,l=n.height;i.mutationCb({id:t,type:FS["2D"],commands:[{property:"clearRect",args:[0,0,a,l]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var c,u=1e3/e,d=0,f=function(e){if(d&&e-d<u)c=requestAnimationFrame(f);else{d=e;var a,h=i;(a=[],t.document.querySelectorAll("canvas").forEach(function(e){SS(e,n,r,!0)||a.push(e)}),a).forEach(Nm(function(e){var t,n,r,i;return Um(this,function(a){switch(a.label){case 0:return n=h.mirror.getId(e),s.get(n)?[2]:0===e.width||0===e.height?[2]:(s.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 i=a.sent(),l.postMessage({id:n,bitmap:i,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[i]),[2]}})})),c=requestAnimationFrame(f)}};c=requestAnimationFrame(f),this.resetObservers=function(){a(),cancelAnimationFrame(c)}},t.initCanvasMutationObserver=function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=kC(e,t,n,!1),o=function(e,t,n,r){for(var o,i=function(){var i=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])return"continue";var s=hS(t.CanvasRenderingContext2D.prototype,i,function(o){return function(){for(var a=this,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return SS(this.canvas,n,r,!0)||setTimeout(function(){var n=xC(l,t,a);e(a.canvas,{type:FS["2D"],property:i,args:n})},0),o.apply(this,l)}});a.push(s)}catch(rp){var l=yS(t.CanvasRenderingContext2D.prototype,i,{set:function(t){e(this.canvas,{type:FS["2D"],property:i,args:[t],setter:!0})}});a.push(l)}},a=[],s=Fm(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));!(o=s()).done;)i();return function(){a.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){var o,i,a=[];return(o=a).push.apply(o,[].concat(_C(t.WebGLRenderingContext.prototype,FS.WebGL,e,n,r,t))),void 0!==t.WebGL2RenderingContext&&(i=a).push.apply(i,[].concat(_C(t.WebGL2RenderingContext.prototype,FS.WebGL2,e,n,r,t))),function(){a.forEach(function(e){return e()})}}(this.processMutation.bind(this),e,t,n);this.resetObservers=function(){r(),o(),i()}},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,Am(e,["type"])}),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}},e}(),TC=function(){function e(e){Hm(this,"trackedLinkElements",new WeakSet),Hm(this,"mutationCb"),Hm(this,"adoptedStyleSheetCb"),Hm(this,"styleMirror",new jS),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=o.value,t=void 0;n.styleMirror.has(e)?t=n.styleMirror.getId(e):(t=n.styleMirror.add(e),a.push({styleId:t,rules:Array.from(e.rules||CSSRule,function(t,n){return{rule:sg(t,e.href),index:n}})})),i.styleIds.push(t)};if(0!==e.length){for(var o,i={id:t,styleIds:[]},a=[],s=Fm(e);!(o=s()).done;)n=this,r();a.length>0&&(i.styles=a),this.adoptedStyleSheetCb(i)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},e}(),PC=function(){function e(){Hm(this,"nodeMap",new WeakMap),Hm(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}(),AC=!1;try{if(2!==Array.from([1],function(e){return 2*e})[0]){var RC=document.createElement("iframe");document.body.appendChild(RC),Array.from=(null==($m=RC.contentWindow)?void 0:$m.Array.from)||Array.from,document.body.removeChild(RC)}}catch(v7){}var LC,DC,zC=new lg;function FC(e){void 0===e&&(e={});var t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,i=void 0===o?"rr-block":o,a=e.blockSelector,s=void 0===a?null:a,l=e.ignoreClass,c=void 0===l?"rr-ignore":l,u=e.ignoreSelector,d=void 0===u?null:u,f=e.maskTextClass,h=void 0===f?"rr-mask":f,p=e.maskTextSelector,m=void 0===p?null:p,g=e.inlineStylesheet,v=void 0===g||g,y=e.maskAllInputs,b=e.maskInputOptions,x=e.slimDOMOptions,w=e.maskInputFn,k=e.maskTextFn,_=e.hooks,S=e.packFn,C=e.sampling,E=void 0===C?{}:C,N=e.dataURLOptions,I=void 0===N?{}:N,O=e.mousemoveWait,M=e.recordDOM,j=void 0===M||M,T=e.recordCanvas,P=void 0!==T&&T,A=e.recordCrossOriginIframes,R=void 0!==A&&A,L=e.recordAfter,D=void 0===L?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":L,z=e.userTriggeredOnInput,F=void 0!==z&&z,U=e.collectFonts,B=void 0!==U&&U,$=e.inlineImages,V=void 0!==$&&$,H=e.plugins,W=e.keepIframeSrcFn,q=void 0===W?function(){return!1}:W,K=e.ignoreCSSAttributes,Z=void 0===K?new Set([]):K,Y=e.errorHandler;VS=Y;var X=!R||window.parent===window,G=!1;if(!X)try{window.parent.document&&(G=!1)}catch(rp){G=!0}if(X&&!t)throw new Error("emit function is required");if(!X&&!G)return function(){};void 0!==O&&void 0===E.mousemove&&(E.mousemove=O),zC.reset();var J,Q,ee=!0===y?{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!==b?b:{password:!0},te=!0===x||"all"===x?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===x,headMetaDescKeywords:"all"===x,headTitleMutations:"all"===x}:x||{};void 0===J&&(J=window),"NodeList"in J&&!J.NodeList.prototype.forEach&&(J.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in J&&!J.DOMTokenList.prototype.forEach&&(J.DOMTokenList.prototype.forEach=Array.prototype.forEach);var ne=0,re=function(e){for(var t,n=Fm(H||[]);!(t=n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}return S&&!G&&(e=S(e)),e};IC=function(e,o){var i,a=e;if(a.timestamp=bS(),!(null==(i=JS[0])?void 0:i.isFrozen())||a.type===RS.FullSnapshot||a.type===RS.IncrementalSnapshot&&a.data.source===LS.Mutation||JS.forEach(function(e){return e.unfreeze()}),X)null==t||t(re(a),o);else if(G){var s={type:"rrweb",event:re(a),origin:window.location.origin,isCheckout:o};window.parent.postMessage(s,"*")}if(a.type===RS.FullSnapshot)Q=a,ne=0;else if(a.type===RS.IncrementalSnapshot){if(a.data.source===LS.Mutation&&a.data.isAttachIframe)return;ne++;var l=r&&ne>=r,c=n&&a.timestamp-Q.timestamp>n;(l||c)&&OC(!0)}};for(var oe,ie=function(e){IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.Mutation},e)})},ae=function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.Scroll},e)})},se=function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.CanvasMutation},e)})},le=new TC({mutationCb:ie,adoptedStyleSheetCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.AdoptedStyleSheet},e)})}}),ce=new fC({mirror:zC,mutationCb:ie,stylesheetManager:le,recordCrossOriginIframes:R,wrappedEmit:IC}),ue=Fm(H||[]);!(oe=ue()).done;){var de=oe.value;de.getMirror&&de.getMirror({nodeMirror:zC,crossOriginIframeMirror:ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:ce.crossOriginIframeStyleMirror})}var fe=new PC;MC=new jC({recordCanvas:P,mutationCb:se,win:window,blockClass:i,blockSelector:s,mirror:zC,sampling:E.canvas,dataURLOptions:I});var he=new hC({mutationCb:ie,scrollCb:ae,bypassOptions:{blockClass:i,blockSelector:s,maskTextClass:h,maskTextSelector:m,inlineStylesheet:v,maskInputOptions:ee,dataURLOptions:I,maskTextFn:k,maskInputFn:w,recordCanvas:P,inlineImages:V,sampling:E,slimDOMOptions:te,iframeManager:ce,stylesheetManager:le,canvasManager:MC,keepIframeSrcFn:q,processedNodeManager:fe},mirror:zC});OC=function(e){if(void 0===e&&(e=!1),j){IC({type:RS.Meta,data:{href:window.location.href,width:kS(),height:wS()}},e),le.reset(),he.init(),JS.forEach(function(e){return e.lock()});var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new lg:r,i=n.blockClass,a=void 0===i?"rr-block":i,s=n.blockSelector,l=void 0===s?null:s,c=n.maskTextClass,u=void 0===c?"rr-mask":c,d=n.maskTextSelector,f=void 0===d?null:d,h=n.inlineStylesheet,p=void 0===h||h,m=n.inlineImages,g=void 0!==m&&m,v=n.recordCanvas,y=void 0!==v&&v,b=n.maskAllInputs,x=void 0!==b&&b,w=n.maskTextFn,k=n.maskInputFn,_=n.slimDOM,S=void 0!==_&&_,C=n.dataURLOptions,E=n.preserveWhiteSpace,N=n.onSerialize,I=n.onIframeLoad,O=n.iframeLoadTimeout,M=n.onStylesheetLoad,j=n.stylesheetLoadTimeout,T=n.keepIframeSrcFn;return zg(e,{doc:e,mirror:o,blockClass:a,blockSelector:l,maskTextClass:u,maskTextSelector:f,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===x?{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===x?{password:!0}:x,maskTextFn:w,maskInputFn:k,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:C,inlineImages:g,recordCanvas:y,preserveWhiteSpace:E,onSerialize:N,onIframeLoad:I,iframeLoadTimeout:O,onStylesheetLoad:M,stylesheetLoadTimeout:j,keepIframeSrcFn:void 0===T?function(){return!1}:T,newlyAddedElement:!1})}(document,{mirror:zC,blockClass:i,blockSelector:s,maskTextClass:h,maskTextSelector:m,inlineStylesheet:v,maskAllInputs:ee,maskTextFn:k,maskInputFn:w,slimDOM:te,dataURLOptions:I,recordCanvas:P,inlineImages:V,onSerialize:function(e){IS(e,zC)&&ce.addIframe(e),OS(e,zC)&&le.trackLinkElement(e),MS(e)&&he.addShadowRoot(pS.shadowRoot(e),document)},onIframeLoad:function(e,t){ce.attachIframe(e,t),he.observeAttachShadow(e)},onStylesheetLoad:function(e,t){le.attachLinkElement(e,t)},keepIframeSrcFn:q});t&&(IC({type:RS.FullSnapshot,data:{node:t,initialOffset:xS(window)}},e),JS.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&le.adoptStyleSheets(document.adoptedStyleSheets,zC.getId(document)))}};try{var pe=[],me=function(e){var t;return GS(lC)({mutationCb:ie,mousemoveCb:function(e,t){return IC({type:RS.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.MouseInteraction},e)})},scrollCb:ae,viewportResizeCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.ViewportResize},e)})},inputCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.Input},e)})},mediaInteractionCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.MediaInteraction},e)})},styleSheetRuleCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.StyleSheetRule},e)})},styleDeclarationCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.StyleDeclaration},e)})},canvasMutationCb:se,fontCb:function(e){return IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.Font},e)})},selectionCb:function(e){IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.Selection},e)})},customElementCb:function(e){IC({type:RS.IncrementalSnapshot,data:Mm({source:LS.CustomElement},e)})},blockClass:i,ignoreClass:c,ignoreSelector:d,maskTextClass:h,maskTextSelector:m,maskInputOptions:ee,inlineStylesheet:v,sampling:E,recordDOM:j,recordCanvas:P,inlineImages:V,userTriggeredOnInput:F,collectFonts:B,doc:e,maskInputFn:w,maskTextFn:k,keepIframeSrcFn:q,blockSelector:s,slimDOMOptions:te,dataURLOptions:I,mirror:zC,iframeManager:ce,stylesheetManager:le,shadowDomManager:he,processedNodeManager:fe,canvasManager:MC,ignoreCSSAttributes:Z,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 IC({type:RS.Plugin,data:{plugin:e.name,payload:t}})}}}))||[]},_)};ce.addLoadListener(function(e){try{pe.push(me(e.contentDocument))}catch(kE){}});var ge=function(){OC(),pe.push(me(document)),AC=!0};return"interactive"===document.readyState||"complete"===document.readyState?ge():(pe.push(mS("DOMContentLoaded",function(){IC({type:RS.DomContentLoaded,data:{}}),"DOMContentLoaded"===D&&ge()})),pe.push(mS("load",function(){IC({type:RS.Load,data:{}}),"load"===D&&ge()},window))),function(){pe.forEach(function(e){try{e()}catch(kE){String(kE).toLowerCase().includes("cross-origin")}}),fe.destroy(),AC=!1,VS=void 0}}catch(kE){}}FC.addCustomEvent=function(e,t){if(!AC)throw new Error("please add custom event after start recording");IC({type:RS.Custom,data:{tag:e,payload:t}})},FC.freezePage=function(){JS.forEach(function(e){return e.freeze()})},FC.takeFullSnapshot=function(e){if(!AC)throw new Error("please take full snapshot after start recording");OC(e)},FC.mirror=zC,(DC=LC||(LC={}))[DC.NotStarted=0]="NotStarted",DC[DC.Running=1]="Running",DC[DC.Stopped=2]="Stopped",FC.addCustomEvent,FC.freezePage,FC.takeFullSnapshot;var UC=Object.defineProperty,BC=function(e,t,n){return function(e,t,n){return t in e?UC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}(e,"symbol"!==(void 0===t?"undefined":Lm(t))?t+"":t,n)};var $C=function(){function e(e){BC(this,"fileName"),BC(this,"functionName"),BC(this,"lineNumber"),BC(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}(),VC=/(^|@)\S+:\d+/,HC=/^\s*at .*(\S+:\d+|\(native\))/m,WC=/^(eval@)?(\[native code])?$/,qC={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(HC)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(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(HC)},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),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new $C({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(WC)},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 $C({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new $C({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new $C({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new $C({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(VC)&&!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 $C({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function KC(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,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq("+o.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function ZC(e){return"[object Object]"===Object.prototype.toString.call(e)}function YC(e,t){if(0===t)return!0;for(var n,r=Fm(Object.keys(e));!(n=r()).done;){var o=n.value;if(ZC(e[o])&&YC(e[o],t-1))return!0}return!1}function XC(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.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(ZC(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(ZC(e)&&YC(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":Lm(t)))return t.toString()+"n";if(Pm(t,Event)){var a={};for(var s in t){var l=t[s];Array.isArray(l)?a[s]=KC(l.length?l[0]:null):a[s]=l}return a}return Pm(t,Node)?Pm(t,HTMLElement)?t?t.outerHTML:"":t.nodeName:Pm(t,Error)?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}var GC={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 JC(e,t,n){var r,o=n?Object.assign({},GC,n):GC,i=o.logger;if(!i)return function(){};r="string"==typeof i?t[i]:i;var a=0,s=!1,l=[];if(o.level.includes("error")){var c=function(t){var n=t.message,r=t.error,i=qC.parse(r).map(function(e){return e.toString()}),a=[XC(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",c),l.push(function(){t.removeEventListener("error",c)});var u=function(t){var n,r;Pm(t.reason,Error)?r=[XC("Uncaught (in promise) "+(n=t.reason).name+": "+n.message,o.stringifyOptions)]:(n=new Error,r=[XC("Uncaught (in promise)",o.stringifyOptions),XC(t.reason,o.stringifyOptions)]);var i=qC.parse(n).map(function(e){return e.toString()});e({level:"error",trace:i,payload:r})};t.addEventListener("unhandledrejection",u),l.push(function(){t.removeEventListener("unhandledrejection",u)})}for(var d,f=Fm(o.level);!(d=f()).done;){var h=d.value;l.push(p(r,h))}return function(){l.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],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(rp){return function(){}}}(t,n,function(t){var i=r;return function(){for(var r=arguments.length,l=new Array(r),c=0;c<r;c++)l[c]=arguments[c];if(t.apply(i,l),!("assert"===n&&l[0]||s)){s=!0;try{var u=qC.parse(new Error).map(function(e){return e.toString()}).splice(1),d=("assert"===n?l.slice(1):l).map(function(e){return XC(e,o.stringifyOptions)});++a<o.lengthThreshold?e({level:n,trace:u,payload:d}):a===o.lengthThreshold&&e({level:"warn",trace:[],payload:[XC("The number of log records reached the threshold.")]})}catch(kE){t.apply(void 0,[].concat(["rrweb logger error:",kE],l))}finally{s=!1}}}}):function(){}}}var QC,eE,tE,nE=km.setImmediate,rE=Object.prototype.toString,oE=void 0!==nE?function(e){return nE(e)}:setTimeout;try{Object.defineProperty({},"x",{}),QC=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:!1!==r})}}catch(v7){QC=function(e,t,n){return e[t]=n,e}}function iE(e,t){tE.add(e,t),eE||(eE=oE(tE.drain))}function aE(e){var t,n=typeof e;return null===e||"object"!==n&&"function"!==n||(t=e.then),"function"==typeof t&&t}function sE(){for(var e=0;e<this.chain.length;e++)lE(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function lE(e,t,n){var r,o;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")):(o=aE(r))?o.call(r,n.resolve,n.reject):n.resolve(r)}catch(v7){n.reject(v7)}}function cE(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=aE(e))?iE(function(){var r=new fE(n);try{t.call(e,function(){cE.apply(r,arguments)},function(){uE.apply(r,arguments)})}catch(v7){uE.call(r,v7)}}):(n.msg=e,n.state=1,n.chain.length>0&&iE(sE,n))}catch(v7){uE.call(new fE(n),v7)}}}function uE(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&iE(sE,t))}function dE(e,t,n,r){for(var o=0;o<t.length;o++)(function(o){e.resolve(t[o]).then(function(e){n(o,e)},r)})(o)}function fE(e){this.def=e,this.triggered=!1}function hE(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function pE(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 hE(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&&iE(sE,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){cE.call(t,e)},function(e){uE.call(t,e)})}catch(v7){uE.call(t,v7)}}tE=function(){var e,t,n;function r(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(o,i){n=new r(o,i),t?t.next=n:e=n,t=n,n=void 0},drain:function(){var n=e;for(e=t=eE=void 0;n;)n.fn.call(n.self),n=n.next}}}();var mE,gE=QC({},"constructor",pE,!1);pE.prototype=gE,QC(gE,"__NPO__",0,!1),QC(pE,"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)})}),QC(pE,"reject",function(e){return new this(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");n(e)})}),QC(pE,"all",function(e){var t=this;return"[object Array]"!==rE.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 o=e.length,i=Array(o),a=0;dE(t,e,function(e,t){i[e]=t,++a===o&&n(i)},r)})}),QC(pE,"race",function(e){var t=this;return"[object Array]"!==rE.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");dE(t,e,function(e,t){n(t)},r)})}),mE="undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?Promise:pE;var vE,yE,bE,xE,wE,kE,_E,SE,CE,EE,NE={DEBUG:!1,LIB_VERSION:"2.72.0"},IE=864e5,OE=8e3,ME=Array.prototype,jE=Function.prototype,TE=Object.prototype,PE=ME.slice,AE=TE.toString,RE=TE.hasOwnProperty,LE=km.console,DE=km.navigator,zE=km.document,FE=km.opera,UE=km.screen,BE=DE.userAgent,$E=jE.bind,VE=ME.forEach,HE=ME.indexOf,WE=ME.map,qE=Array.isArray,KE={},ZE={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},YE={log:function(){if(NE.DEBUG&&!ZE.isUndefined(LE)&&LE)try{LE.log.apply(LE,arguments)}catch(v7){ZE.each(arguments,function(e){LE.log(e)})}},warn:function(){if(NE.DEBUG&&!ZE.isUndefined(LE)&&LE){var e=["Mixpanel warning:"].concat(ZE.toArray(arguments));try{LE.warn.apply(LE,e)}catch(v7){ZE.each(e,function(e){LE.warn(e)})}}},error:function(){if(NE.DEBUG&&!ZE.isUndefined(LE)&&LE){var e=["Mixpanel error:"].concat(ZE.toArray(arguments));try{LE.error.apply(LE,e)}catch(v7){ZE.each(e,function(e){LE.error(e)})}}},critical:function(){if(!ZE.isUndefined(LE)&&LE){var e=["Mixpanel error:"].concat(ZE.toArray(arguments));try{LE.error.apply(LE,e)}catch(v7){ZE.each(e,function(e){LE.error(e)})}}}},XE=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(YE,arguments)}},GE=function(e){return{log:XE(YE.log,e),error:XE(YE.error,e),critical:XE(YE.critical,e)}},JE=function(e){return function(){try{return e.apply(this,arguments)}catch(rp){YE.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),NE.DEBUG&&YE.critical(rp)}}},QE=function(e){var t=e.prototype;for(var n in t)"function"==typeof t[n]&&(t[n]=JE(t[n]))};ZE.bind=function(e,t){var n,r;if($E&&e.bind===$E)return $E.apply(e,PE.call(arguments,1));if(!ZE.isFunction(e))throw new TypeError;return n=PE.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(PE.call(arguments)));var o={};o.prototype=e.prototype;var i=new o;o.prototype=null;var a=e.apply(i,n.concat(PE.call(arguments)));return Object(a)===a?a:i},r},ZE.each=function(e,t,n){if(null!=e)if(VE&&e.forEach===VE)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r,e)===KE)return}else for(var i in e)if(RE.call(e,i)&&t.call(n,e[i],i,e)===KE)return},ZE.extend=function(e){return ZE.each(PE.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},ZE.isArray=qE||function(e){return"[object Array]"===AE.call(e)},ZE.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},ZE.isArguments=function(e){return!(!e||!RE.call(e,"callee"))},ZE.toArray=function(e){return e?e.toArray?e.toArray():ZE.isArray(e)||ZE.isArguments(e)?PE.call(e):ZE.values(e):[]},ZE.map=function(e,t,n){if(WE&&e.map===WE)return e.map(t,n);var r=[];return ZE.each(e,function(e){r.push(t.call(n,e))}),r},ZE.keys=function(e){var t=[];return null===e||ZE.each(e,function(e,n){t[t.length]=n}),t},ZE.values=function(e){var t=[];return null===e||ZE.each(e,function(e){t[t.length]=e}),t},ZE.include=function(e,t){var n=!1;return null===e?n:HE&&e.indexOf===HE?-1!=e.indexOf(t):(ZE.each(e,function(e){if(n||(n=e===t))return KE}),n)},ZE.includes=function(e,t){return-1!==e.indexOf(t)},ZE.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},ZE.isObject=function(e){return e===Object(e)&&!ZE.isArray(e)},ZE.isEmptyObject=function(e){if(ZE.isObject(e)){for(var t in e)if(RE.call(e,t))return!1;return!0}return!1},ZE.isUndefined=function(e){return void 0===e},ZE.isString=function(e){return"[object String]"==AE.call(e)},ZE.isDate=function(e){return"[object Date]"==AE.call(e)},ZE.isNumber=function(e){return"[object Number]"==AE.call(e)},ZE.isElement=function(e){return!(!e||1!==e.nodeType)},ZE.encodeDates=function(e){return ZE.each(e,function(t,n){ZE.isDate(t)?e[n]=ZE.formatDate(t):ZE.isObject(t)&&(e[n]=ZE.encodeDates(t))}),e},ZE.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},ZE.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())},ZE.strip_empty_properties=function(e){var t={};return ZE.each(e,function(e,n){ZE.isString(e)&&e.length>0&&(t[n]=e)}),t},ZE.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):ZE.isArray(e)?(n=[],ZE.each(e,function(e){n.push(ZE.truncate(e,t))})):ZE.isObject(e)?(n={},ZE.each(e,function(e,r){n[r]=ZE.truncate(e,t)})):n=e,n},ZE.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 o="",i=0,a="",s="",l=0,c=o,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(o+=" ",u=[],"[object Array]"===AE.apply(d)){for(l=d.length,i=0;i<l;i+=1)u[i]=n(i,d)||"null";return s=0===u.length?"[]":o?"[\n"+o+u.join(",\n"+o)+"\n"+c+"]":"["+u.join(",")+"]",o=c,s}for(a in d)RE.call(d,a)&&(s=n(a,d))&&u.push(t(a)+(o?": ":":")+s);return s=0===u.length?"{}":o?"{"+u.join(",")+c+"}":"{"+u.join(",")+"}",o=c,s}};return n("",{"":e})}}(),ZE.JSONDecode=(wE={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},kE=function(e){var t=new SyntaxError(e);throw t.at=vE,t.text=bE,t},_E=function(e){return e&&e!==yE&&kE("Expected '"+e+"' instead of '"+yE+"'"),yE=bE.charAt(vE),vE+=1,yE},SE=function(){var e,t="";for("-"===yE&&(t="-",_E("-"));yE>="0"&&yE<="9";)t+=yE,_E();if("."===yE)for(t+=".";_E()&&yE>="0"&&yE<="9";)t+=yE;if("e"===yE||"E"===yE)for(t+=yE,_E(),"-"!==yE&&"+"!==yE||(t+=yE,_E());yE>="0"&&yE<="9";)t+=yE,_E();if(e=+t,isFinite(e))return e;kE("Bad number")},CE=function(){var e,t,n,r="";if('"'===yE)for(;_E();){if('"'===yE)return _E(),r;if("\\"===yE)if(_E(),"u"===yE){for(n=0,t=0;t<4&&(e=parseInt(_E(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof wE[yE])break;r+=wE[yE]}else r+=yE}kE("Bad string")},EE=function(){for(;yE&&yE<=" ";)_E()},xE=function(){switch(EE(),yE){case"{":return function(){var e,t={};if("{"===yE){if(_E("{"),EE(),"}"===yE)return _E("}"),t;for(;yE;){if(e=CE(),EE(),_E(":"),Object.hasOwnProperty.call(t,e)&&kE('Duplicate key "'+e+'"'),t[e]=xE(),EE(),"}"===yE)return _E("}"),t;_E(","),EE()}}kE("Bad object")}();case"[":return function(){var e=[];if("["===yE){if(_E("["),EE(),"]"===yE)return _E("]"),e;for(;yE;){if(e.push(xE()),EE(),"]"===yE)return _E("]"),e;_E(","),EE()}}kE("Bad array")}();case'"':return CE();case"-":return SE();default:return yE>="0"&&yE<="9"?SE():function(){switch(yE){case"t":return _E("t"),_E("r"),_E("u"),_E("e"),!0;case"f":return _E("f"),_E("a"),_E("l"),_E("s"),_E("e"),!1;case"n":return _E("n"),_E("u"),_E("l"),_E("l"),null}kE('Unexpected "'+yE+'"')}()}},function(e){var t;return bE=e,vE=0,yE=" ",t=xE(),EE(),yE&&kE("Syntax error"),t}),ZE.base64Encode=function(e){var t,n,r,o,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,l=0,c="",u=[];if(!e)return e;e=ZE.utf8Encode(e);do{t=(i=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=i>>12&63,r=i>>6&63,o=63&i,u[l++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(o)}while(s<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c},ZE.utf8Encode=function(e){var t,n,r,o,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,o=0;o<r;o++){var a=e.charCodeAt(o),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(i+=e.substring(t,n)),i+=s,t=n=o+1)}return n>t&&(i+=e.substring(t,e.length)),i},ZE.UUID=function(){try{return km.crypto.randomUUID()}catch(v7){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]="-",ZE.map(e,function(e){return e.toString(16)}).join("")}};var eN=["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"];ZE.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<eN.length;t++)if(-1!==e.indexOf(eN[t]))return!0;return!1},ZE.HTTPBuildQuery=function(e,t){var n,r,o=[];return ZE.isUndefined(t)&&(t="&"),ZE.each(e,function(e,t){n=encodeURIComponent(e.toString()),r=encodeURIComponent(t),o[o.length]=r+"="+n}),o.join(t)},ZE.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(v7){YE.error("Skipping decoding for malformed query param: "+r)}return r.replace(/\+/g," ")},ZE.cookie={get:function(e){for(var t=e+"=",n=zE.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null},parse:function(e){var t;try{t=ZE.JSONDecode(ZE.cookie.get(e))||{}}catch(v7){}return t},set_seconds:function(e,t,n,r,o,i,a){var s="",l="",c="";if(a)s="; domain="+a;else if(r){var u=fN(zE.location.hostname);s=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+1e3*n),l="; expires="+d.toGMTString()}i&&(o=!0,c="; SameSite=None"),o&&(c+="; secure"),zE.cookie=e+"="+encodeURIComponent(t)+l+"; path=/"+s+c},set:function(e,t,n,r,o,i,a){var s="",l="",c="";if(a)s="; domain="+a;else if(r){var u=fN(zE.location.hostname);s=u?"; domain=."+u:""}if(n){var d=new Date;d.setTime(d.getTime()+24*n*60*60*1e3),l="; expires="+d.toGMTString()}i&&(o=!0,c="; SameSite=None"),o&&(c+="; secure");var f=e+"="+encodeURIComponent(t)+l+"; path=/"+s+c;return zE.cookie=f,f},remove:function(e,t,n){ZE.cookie.set(e,"",-1,t,!1,!1,n)}};var tN=function(e){var t=!0;try{var n="__mplss_"+cN(8);e.setItem(n,"xyz"),"xyz"!==e.getItem(n)&&(t=!1),e.removeItem(n)}catch(v7){t=!1}return t},nN=null,rN=function(e,t){return null===nN||t?nN=tN(e||km.localStorage):nN},oN=null;function iN(e,t,n){var r=function(e){YE.error(t+" error: "+e)};return{is_supported:function(r){var o=n(e,r);return o||YE.error(t+" unsupported"),o},error:r,get:function(t){try{return e.getItem(t)}catch(v7){r(v7)}return null},parse:function(t){try{return ZE.JSONDecode(e.getItem(t))||{}}catch(v7){}return null},set:function(t,n){try{e.setItem(t,n)}catch(v7){r(v7)}},remove:function(t){try{e.removeItem(t)}catch(v7){r(v7)}}}}ZE.localStorage=iN(km.localStorage,"localStorage",rN),ZE.sessionStorage=iN(km.sessionStorage,"sessionStorage",function(e,t){return null===oN||t?oN=tN(e||km.sessionStorage):oN}),ZE.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,o,i){if(t)if(t.addEventListener&&!o)t.addEventListener(n,r,!!i);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){var o=function(o){if(o=o||e(km.event)){var i,a,s=!0;return ZE.isFunction(r)&&(i=r(o)),a=n.call(t,o),!1!==i&&!1!==a||(s=!1),s}};return o}(t,r,s)}else YE.error("No valid element provided to register_event")}}();var aN=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');ZE.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(!zE.getElementsByTagName)return[];var r,o,i,a,s,l,c,u,d,f,h=t.split(" "),p=[zE];for(l=0;l<h.length;l++)if((r=h[l].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(o=r.split("#"))[0];var m=o[1],g=zE.getElementById(m);if(!g||i&&g.nodeName.toLowerCase()!=i)return[];p=[g]}else if(r.indexOf(".")>-1){i=(o=r.split("."))[0];var v=o[1];for(i||(i="*"),a=[],s=0,c=0;c<p.length;c++)for(d="*"==i?e(p[c]):p[c].getElementsByTagName(i),u=0;u<d.length;u++)a[s++]=d[u];for(p=[],f=0,c=0;c<a.length;c++)a[c].className&&ZE.isString(a[c].className)&&n(a[c],v)&&(p[f++]=a[c])}else{var y=r.match(aN);if(y){i=y[1];var b,x=y[2],w=y[3],k=y[4];for(i||(i="*"),a=[],s=0,c=0;c<p.length;c++)for(d="*"==i?e(p[c]):p[c].getElementsByTagName(i),u=0;u<d.length;u++)a[s++]=d[u];switch(p=[],f=0,w){case"=":b=function(e){return e.getAttribute(x)==k};break;case"~":b=function(e){return e.getAttribute(x).match(new RegExp("\\b"+k+"\\b"))};break;case"|":b=function(e){return e.getAttribute(x).match(new RegExp("^"+k+"-?"))};break;case"^":b=function(e){return 0===e.getAttribute(x).indexOf(k)};break;case"$":b=function(e){return e.getAttribute(x).lastIndexOf(k)==e.getAttribute(x).length-k.length};break;case"*":b=function(e){return e.getAttribute(x).indexOf(k)>-1};break;default:b=function(e){return e.getAttribute(x)}}for(p=[],f=0,c=0;c<a.length;c++)b(a[c])&&(p[f++]=a[c])}else{for(i=r,a=[],s=0,c=0;c<p.length;c++)for(d=p[c].getElementsByTagName(i),u=0;u<d.length;u++)a[s++]=d[u];p=a}}return p}return function(e){return ZE.isElement(e)?[e]:ZE.isObject(e)&&!ZE.isUndefined(e.length)?e:r.call(this,e)}}();var sN=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],lN=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];ZE.info={campaignParams:function(e){var t="",n={};return ZE.each(sN,function(r){(t=ZE.getQueryParam(zE.URL,r)).length?n[r]=t:void 0!==e&&(n[r]=e)}),n},clickParams:function(){var e="",t={};return ZE.each(lN,function(n){(e=ZE.getQueryParam(zE.URL,n)).length&&(t[n]=e)}),t},marketingParams:function(){return ZE.extend(ZE.info.campaignParams(),ZE.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=ZE.info.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var o=ZE.getQueryParam(e,n);o.length&&(r.mp_keyword=o)}return r},browser:function(e,t,n){return t=t||"",n||ZE.includes(e," OPR/")?ZE.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":ZE.includes(e,"IEMobile")||ZE.includes(e,"WPDesktop")?"Internet Explorer Mobile":ZE.includes(e,"SamsungBrowser/")?"Samsung Internet":ZE.includes(e,"Edge")||ZE.includes(e,"Edg/")?"Microsoft Edge":ZE.includes(e,"FBIOS")?"Facebook Mobile":ZE.includes(e,"Whale/")?"Whale Browser":ZE.includes(e,"Chrome")?"Chrome":ZE.includes(e,"CriOS")?"Chrome iOS":ZE.includes(e,"UCWEB")||ZE.includes(e,"UCBrowser")?"UC Browser":ZE.includes(e,"FxiOS")?"Firefox iOS":ZE.includes(t,"Apple")?ZE.includes(e,"Mobile")?"Mobile Safari":"Safari":ZE.includes(e,"Android")?"Android Mobile":ZE.includes(e,"Konqueror")?"Konqueror":ZE.includes(e,"Firefox")?"Firefox":ZE.includes(e,"MSIE")||ZE.includes(e,"Trident/")?"Internet Explorer":ZE.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+)?)/}[ZE.info.browser(e,t,n)];if(void 0===r)return null;var o=e.match(r);return o?parseFloat(o[o.length-2]):null},os:function(){var e=BE;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 km.location.href},properties:function(e){return"object"!=typeof e&&(e={}),ZE.extend(ZE.strip_empty_properties({$os:ZE.info.os(),$browser:ZE.info.browser(BE,DE.vendor,FE),$referrer:zE.referrer,$referring_domain:ZE.info.referringDomain(zE.referrer),$device:ZE.info.device(BE)}),{$current_url:ZE.info.currentUrl(),$browser_version:ZE.info.browserVersion(BE,DE.vendor,FE),$screen_height:UE.height,$screen_width:UE.width,mp_lib:"web",$lib_version:NE.LIB_VERSION,$insert_id:cN(),time:ZE.timestamp()/1e3},ZE.strip_empty_properties(e))},people_properties:function(){return ZE.extend(ZE.strip_empty_properties({$os:ZE.info.os(),$browser:ZE.info.browser(BE,DE.vendor,FE)}),{$browser_version:ZE.info.browserVersion(BE,DE.vendor,FE)})},mpPageViewProperties:function(){return ZE.strip_empty_properties({current_page_title:zE.title,current_domain:km.location.hostname,current_url_path:km.location.pathname,current_url_protocol:km.location.protocol,current_url_search:km.location.search})}};var cN=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},uN=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,dN=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,fN=function(e){var t=dN,n=e.split("."),r=n[n.length-1];(r.length>4||"com"===r||"org"===r)&&(t=uN);var o=e.match(t);return o?o[0]:""},hN=function(){},pN=null,mN=null;"undefined"!=typeof JSON&&(pN=JSON.stringify,mN=JSON.parse),pN=pN||ZE.JSONEncode,mN=mN||ZE.JSONDecode;ZE.info=ZE.info,ZE.info.browser=ZE.info.browser,ZE.info.browserVersion=ZE.info.browserVersion,ZE.info.device=ZE.info.device,ZE.info.properties=ZE.info.properties,ZE.isBlockedUA=ZE.isBlockedUA,ZE.isEmptyObject=ZE.isEmptyObject,ZE.isObject=ZE.isObject,ZE.JSONDecode=ZE.JSONDecode,ZE.JSONEncode=ZE.JSONEncode,ZE.toArray=ZE.toArray,ZE.NPO=pE;var gN="mixpanelRecordingEvents",vN="mixpanelRecordingRegistry",yN=[gN,vN],bN=function(e){this.dbPromise=null,this.storeName=e};bN.prototype._openDb=function(){return new mE(function(e,t){var n=km.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;yN.forEach(function(e){t.createObjectStore(e)})}})},bN.prototype.init=function(){return km.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(e){return e instanceof km.IDBDatabase?mE.resolve():mE.reject(e)})):mE.reject("indexedDB is not supported in this browser")},bN.prototype.isInitialized=function(){return!!this.dbPromise},bN.prototype.makeTransaction=function(e,t){var n=this.storeName,r=function(r){return new mE(function(o,i){var a=r.transaction(n,e);a.oncomplete=function(){o(a)},a.onabort=a.onerror=function(){i(a.error)},t(a.objectStore(n))})};return this.dbPromise.then(r).catch(function(e){return e&&"InvalidStateError"===e.name?(this.dbPromise=this._openDb(),this.dbPromise.then(r)):mE.reject(e)}.bind(this))},bN.prototype.setItem=function(e,t){return this.makeTransaction("readwrite",function(n){n.put(t,e)})},bN.prototype.getItem=function(e){var t;return this.makeTransaction("readonly",function(n){t=n.get(e)}).then(function(){return t.result})},bN.prototype.removeItem=function(e){return this.makeTransaction("readwrite",function(t){t.delete(e)})},bN.prototype.getAll=function(){var e;return this.makeTransaction("readonly",function(t){e=t.getAll()}).then(function(){return e.result})};function xN(e,t){jN(!0,e,t)}function wN(e,t){jN(!1,e,t)}function kN(e,t){return"1"===MN(e,t)}function _N(e,t){if(function(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||km,n=t.navigator||{},r=!1;return ZE.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(e){ZE.includes([!0,1,"1","yes"],e)&&(r=!0)}),r}(t))return YE.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"===MN(e,t);return n&&YE.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function SN(e){return TN(e,function(e){return this.get_config(e)})}function CN(e){return TN(e,function(e){return this._get_config(e)})}function EN(e){return TN(e,function(e){return this._get_config(e)})}function NN(e,t){IN(t=t||{}).remove(ON(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function IN(e){return"localStorage"===(e=e||{}).persistenceType?ZE.localStorage:ZE.cookie}function ON(e,t){return((t=t||{}).persistencePrefix||"__mp_opt_in_out_")+e}function MN(e,t){return IN(t).get(ON(e,t))}function jN(e,t,n){ZE.isString(t)&&t.length?(IN(n=n||{}).set(ON(t,n),e?1:0,ZE.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})):YE.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function TN(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),o=t.call(this,"ignore_dnt"),i=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),s=t.call(this,"window");r&&(n=_N(r,{ignoreDnt:o,persistenceType:i,persistencePrefix:a,window:s}))}catch(v7){YE.error("Unexpected error when checking tracking opt-out status: "+v7)}if(!n)return e.apply(this,arguments);var l=arguments[arguments.length-1];"function"==typeof l&&l(0)}}var PN=GE("lock"),AN=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||km.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||mE};AN.prototype.withLock=function(e,t){return new(0,this.promiseImpl)(ZE.bind(function(n,r){var o=t||(new Date).getTime()+"|"+Math.random(),i=(new Date).getTime(),a=this.storageKey,s=this.pollIntervalMS,l=this.timeoutMS,c=this.storage,u=a+":X",d=a+":Y",f=a+":Z",h=function(e){if((new Date).getTime()-i>l)return PN.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+o+"]"),c.removeItem(f),c.removeItem(d),void g();setTimeout(function(){try{e()}catch(v7){r(v7)}},s*(Math.random()+.1))},p=function(e,t){e()?t():h(function(){p(e,t)})},m=function(){var e=c.getItem(d);return(!e||e===o)&&(c.setItem(d,o),c.getItem(d)===o||(rN(c,!0)||r(new Error("localStorage support dropped while acquiring lock")),!1))},g=function(){c.setItem(u,o),p(m,function(){c.getItem(u)!==o?h(function(){c.getItem(d)===o?p(function(){return!c.getItem(f)},v):g()}):v()})},v=function(){c.setItem(f,"1");var t=function(){c.removeItem(f),c.getItem(d)===o&&c.removeItem(d),c.getItem(u)===o&&c.removeItem(u)};e().then(function(e){t(),n(e)}).catch(function(e){t(),r(e)})};try{if(!rN(c,!0))throw new Error("localStorage support check failed");g()}catch(v7){r(v7)}},this))};var RN=function(e){this.storage=e||km.localStorage};RN.prototype.init=function(){return mE.resolve()},RN.prototype.isInitialized=function(){return!0},RN.prototype.setItem=function(e,t){return new mE(ZE.bind(function(n,r){try{this.storage.setItem(e,pN(t))}catch(rp){r(rp)}n()},this))},RN.prototype.getItem=function(e){return new mE(ZE.bind(function(t,n){var r;try{r=mN(this.storage.getItem(e))}catch(rp){n(rp)}t(r)},this))},RN.prototype.removeItem=function(e){return new mE(ZE.bind(function(t,n){try{this.storage.removeItem(e)}catch(rp){n(rp)}t()},this))};var LN=GE("batch"),DN=function(e,t){var n,r,o,i;t=t||{},this.storageKey=e,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new RN,this.lock=new AN(e,{storage:t.sharedLockStorage||km.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||ZE.bind(LN.error,LN),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=(n=ZE.bind(this._enqueuePersisted,this),r=t.enqueueThrottleMs,o=null,i=[],function(e){var t=this;return i.push(e),o||(o=new mE(function(e){setTimeout(function(){var r=n.apply(t,[i]);o=null,i=[],e(r)},r)})),o}):this.enqueuePersisted=ZE.bind(function(e){return this._enqueuePersisted([e])},this)};DN.prototype.ensureInit=function(){return this.initialized||!this.usePersistence?mE.resolve():this.queueStorage.init().then(ZE.bind(function(){this.initialized=!0},this)).catch(ZE.bind(function(e){this.reportError("Error initializing queue persistence. Disabling persistence",e),this.initialized=!0,this.usePersistence=!1},this))},DN.prototype.enqueue=function(e,t){var n={id:cN(),flushAfter:(new Date).getTime()+2*t,payload:e};return this.usePersistence?this.enqueuePersisted(n):(this.memQueue.push(n),mE.resolve(!0))},DN.prototype._enqueuePersisted=function(e){var t=ZE.bind(function(){return this.ensureInit().then(ZE.bind(function(){return this.readFromStorage()},this)).then(ZE.bind(function(t){return this.saveToStorage(t.concat(e))},this)).then(ZE.bind(function(t){return t&&(this.memQueue=this.memQueue.concat(e)),t},this)).catch(ZE.bind(function(t){return this.reportError("Error enqueueing items",t,e),!1},this))},this);return this.lock.withLock(t,this.pid).catch(ZE.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this))},DN.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);return this.usePersistence&&t.length<e?this.ensureInit().then(ZE.bind(function(){return this.readFromStorage()},this)).then(ZE.bind(function(n){if(n.length){var r={};ZE.each(t,function(e){r[e.id]=!0});for(var o=0;o<n.length;o++){var i=n[o];if((new Date).getTime()>i.flushAfter&&!r[i.id]&&(i.orphaned=!0,t.push(i),t.length>=e))break}}return t},this)):mE.resolve(t)};var zN=function(e,t){var n=[];return ZE.each(e,function(e){e.id&&!t[e.id]&&n.push(e)}),n};DN.prototype.removeItemsByID=function(e){var t={};if(ZE.each(e,function(e){t[e]=!0}),this.memQueue=zN(this.memQueue,t),this.usePersistence){var n=ZE.bind(function(){return this.ensureInit().then(ZE.bind(function(){return this.readFromStorage()},this)).then(ZE.bind(function(e){return e=zN(e,t),this.saveToStorage(e)},this)).then(ZE.bind(function(){return this.readFromStorage()},this)).then(ZE.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(ZE.bind(function(t){return this.reportError("Error removing items",t,e),!1},this))},this);return this.lock.withLock(n,this.pid).catch(ZE.bind(function(e){return this.reportError("Error acquiring storage lock",e),!rN(this.lock.storage,!0)&&n().then(ZE.bind(function(e){return e||this.queueStorage.removeItem(this.storageKey).then(function(){return e})},this)).catch(ZE.bind(function(e){return this.reportError("Error clearing queue",e),!1},this))},this))}return mE.resolve(!0)};var FN=function(e,t){var n=[];return ZE.each(e,function(e){var r=e.id;if(r in t){var o=t[r];null!==o&&(e.payload=o,n.push(e))}else n.push(e)}),n};DN.prototype.updatePayloads=function(e){return this.memQueue=FN(this.memQueue,e),this.usePersistence?this.lock.withLock(ZE.bind(function(){return this.ensureInit().then(ZE.bind(function(){return this.readFromStorage()},this)).then(ZE.bind(function(t){return t=FN(t,e),this.saveToStorage(t)},this)).catch(ZE.bind(function(t){return this.reportError("Error updating items",e,t),!1},this))},this),this.pid).catch(ZE.bind(function(e){return this.reportError("Error acquiring storage lock",e),!1},this)):mE.resolve(!0)},DN.prototype.readFromStorage=function(){return this.ensureInit().then(ZE.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(ZE.bind(function(e){return e&&(ZE.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null)),e||[]},this)).catch(ZE.bind(function(e){return this.reportError("Error retrieving queue",e),[]},this))},DN.prototype.saveToStorage=function(e){return this.ensureInit().then(ZE.bind(function(){return this.queueStorage.setItem(this.storageKey,e)},this)).then(function(){return!0}).catch(ZE.bind(function(e){return this.reportError("Error saving queue",e),!1},this))},DN.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(ZE.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):mE.resolve()};var UN=GE("batch"),BN=function(e,t){this.errorReporter=t.errorReporter,this.queue=new DN(e,{errorReporter:ZE.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};BN.prototype.enqueue=function(e){return this.queue.enqueue(e,this.flushInterval)},BN.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},BN.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},BN.prototype.clear=function(){return this.queue.clear()},BN.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},BN.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},BN.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(ZE.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},BN.prototype.sendRequestPromise=function(e,t){return new mE(ZE.bind(function(n){this.sendRequest(e,t,n)},this))},BN.prototype.flush=function(e){if(this.requestInProgress)return UN.log("Flush: Request already in progress"),mE.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(ZE.bind(function(o){var i=o.length===r,a=[],s={};if(ZE.each(o,function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=ZE.extend({},t.properties,{mp_sent_by_lib_version:NE.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:o.length,timesSent:this.itemIdsSentSuccessfully[r]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&a.push(t)}s[e.id]=t},this),a.length<1)return this.requestInProgress=!1,this.resetFlush(),mE.resolve();var l=ZE.bind(function(){return this.queue.removeItemsByID(ZE.map(o,function(e){return e.id})).then(ZE.bind(function(e){return ZE.each(o,ZE.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:o.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})},this)),e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!i?(this.resetFlush(),mE.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),mE.resolve())},this))},this),c=ZE.bind(function(i){this.requestInProgress=!1;try{if(e.unloading)return this.queue.updatePayloads(s);if(ZE.isObject(i)&&"timeout"===i.error&&(new Date).getTime()-n>=t)return this.reportError("Network timeout; retrying"),this.flush();if(ZE.isObject(i)&&(i.httpStatusCode>=500||429===i.httpStatusCode||i.httpStatusCode<=0&&(u=km.navigator.onLine,!ZE.isUndefined(u)&&!u)||"timeout"===i.error)){var a=2*this.flushInterval;return i.retryAfter&&(a=1e3*parseInt(i.retryAfter,10)||a),a=Math.min(6e5,a),this.reportError("Error; retry in "+a+" ms"),this.scheduleFlush(a),mE.resolve()}if(ZE.isObject(i)&&413===i.httpStatusCode){if(o.length>1){var c=Math.max(1,Math.floor(r/2));return this.batchSize=Math.min(this.batchSize,c,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),mE.resolve()}return this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),l()}return l()}catch(v7){this.reportError("Error handling API response",v7),this.resetFlush()}var u},this),u={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return e.unloading&&(u.transport="sendBeacon"),UN.log("MIXPANEL REQUEST:",a),this.sendRequestPromise(a,u).then(c)},this)).catch(ZE.bind(function(e){this.reportError("Error flushing request queue",e),this.resetFlush()},this))},BN.prototype.reportError=function(e,t){if(UN.error.apply(UN.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){UN.error(n)}};var $N=function(e){var t=Date.now();return!e||t>e.maxExpires||t>e.idleExpires},VN=GE("recorder"),HN=km.CompressionStream,WN={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},qN=new Set([LS.MouseMove,LS.MouseInteraction,LS.Scroll,LS.ViewportResize,LS.Input,LS.TouchMove,LS.MediaInteraction,LS.Drag,LS.Selection]);var KN=function(e){this._mixpanel=e.mixpanelInstance,this._onIdleTimeout=e.onIdleTimeout||hN,this._onMaxLengthReached=e.onMaxLengthReached||hN,this._onBatchSent=e.onBatchSent||hN,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=IE,this.recordMinMs=0;var t=rN(e.sharedLockStorage,!0)&&!this.getConfig("disable_persistence");this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new bN(gN),this.batcher=new BN(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:WN,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:e.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:250,sharedLockTimeoutMS:1e4})};KN.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},KN.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))},KN.prototype.getConfig=function(e){return this._mixpanel.get_config(e)},KN.prototype.get_config=function(e){return this.getConfig(e)},KN.prototype.startRecording=function(e){if(null!==this._rrwebRecord)if(null===this._stopRecording){this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>IE&&(this.recordMaxMs=IE,VN.critical("record_max_ms cannot be greater than "+IE+"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=ZE.info.currentUrl(),this.replayStartUrl=ZE.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===RS.IncrementalSnapshot&&qN.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:JC,options:n})]:[]})}catch(v7){this.reportError("Unexpected error when starting rrweb recording.",v7)}if("function"!=typeof this._stopRecording)return this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,void this.stopRecording();var o=this.maxExpires-(new Date).getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),o)}else VN.log("Recording already in progress, skipping startRecording.");else this.reportError("rrweb record function not provided. ")},KN.prototype.stopRecording=function(e){if(this.finalFlushUserIdInfo=this.getUserIdInfo(),!this.isRrwebStopped()){try{this._stopRecording()}catch(v7){this.reportError("Error with rrweb stopRecording",v7)}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},KN.prototype.isRrwebStopped=function(){return null===this._stopRecording},KN.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)},KN.prototype.serialize=function(){var e;try{e=this._mixpanel.get_tab_id()}catch(rp){this.reportError("Error getting tab ID for serialization ",rp),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}},KN.deserialize=function(e,t){return new KN(ZE.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}))},KN.prototype._sendRequest=function(e,t,n,r){var o=function(t,n){200===t.status&&this.replayId===e&&(this.seqNo++,this.batchStartUrl=ZE.info.currentUrl()),this._onBatchSent(),r({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}.bind(this),i=this._mixpanel.get_api_host&&this._mixpanel.get_api_host("record")||this.getConfig("api_host");km.fetch(i+"/"+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){o(e,t)}).catch(function(e){r({error:e})})}).catch(function(e){r({error:e,httpStatusCode:0})})},KN.prototype._flushEvents=SN(function(e,t,n){var r=e.length;if(r>0){for(var o=this.replayId,i=1/0,a=-1/0,s=!1,l=0;l<r;l++)i=Math.min(i,e[l].timestamp),a=Math.max(a,e[l].timestamp),e[l].type===RS.FullSnapshot&&(s=!0);if(0===this.seqNo){if(!s)return n({error:"First batch does not contain a full snapshot. Aborting recording."}),void this.stopRecording(!0);this.replayStartTime=i}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=i);var c=a-this.replayStartTime,u={$current_url:this.batchStartUrl,$lib_version:NE.LIB_VERSION,batch_start_time:i/1e3,mp_lib:"web",replay_id:o,replay_length_ms:c,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(!km.CompressionStream)return!1;var r=ZE.info.browser(e,t,n),o=ZE.info.browserVersion(e,t,n);return!(("Safari"===r||"Mobile Safari"===r)&&o>=16.4&&o<16.6)}(BE,DE.vendor,FE)){var f=new Blob([d],{type:"application/json"}).stream().pipeThrough(new HN("gzip"));new Response(f).blob().then(function(e){u.format="gzip",this._sendRequest(o,u,e,n)}.bind(this))}else u.format="body",this._sendRequest(o,u,d,n)}}),KN.prototype.reportError=function(e,t){VN.error.apply(VN.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.getConfig("error_reporter")(e,t)}catch(n){VN.error(n)}},KN.prototype.getDurationMs=function(){return null===this.replayStartTime?0:null===this.lastEventTimestamp?(new Date).getTime()-this.replayStartTime:this.lastEventTimestamp-this.replayStartTime},KN.prototype._getRecordMinMs=function(){var e=this.getConfig("record_min_ms");return e>OE?(VN.critical("record_min_ms cannot be greater than 8000ms. Capping value."),OE):e};var ZN=function(e){this.idb=new bN(vN),this.errorReporter=e.errorReporter,this.mixpanelInstance=e.mixpanelInstance,this.sharedLockStorage=e.sharedLockStorage};ZN.prototype.isPersistenceEnabled=function(){return!this.mixpanelInstance.get_config("disable_persistence")},ZN.prototype.handleError=function(e){this.errorReporter("IndexedDB error: ",e)},ZN.prototype.setActiveRecording=function(e){if(!this.isPersistenceEnabled())return mE.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)):mE.resolve()},ZN.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 $N(e)?null:e}.bind(this)).catch(this.handleError.bind(this)):mE.resolve(null)},ZN.prototype.clearActiveRecording=function(){return this.isPersistenceEnabled()?this.markActiveRecordingExpired():this.deleteActiveRecording()},ZN.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))},ZN.prototype.deleteActiveRecording=function(){return this.idb.isInitialized()?this.idb.removeItem(this.mixpanelInstance.get_tab_id()).catch(this.handleError.bind(this)):mE.resolve()},ZN.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 $N(e)}).map(function(e){return KN.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 mE.all(t)}.bind(this)).catch(this.handleError.bind(this)):mE.resolve([])};var YN=GE("recorder"),XN=function(e,t,n){this.mixpanelInstance=e,this.rrwebRecord=t||FC,this.sharedLockStorage=n,this.recordingRegistry=new ZN({mixpanelInstance:this.mixpanelInstance,errorReporter:YN.error,sharedLockStorage:n}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null,this.stopRecordingInProgress=!1};XN.prototype.startRecording=function(e){if(e=e||{},!this.activeRecording||this.activeRecording.isRrwebStopped()){var t=function(){YN.log("Idle timeout reached, restarting recording."),this.resetRecording()}.bind(this),n=function(){YN.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),o={mixpanelInstance:this.mixpanelInstance,onBatchSent:r,onIdleTimeout:t,onMaxLengthReached:n,replayId:ZE.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return e.activeSerializedRecording?this.activeRecording=KN.deserialize(e.activeSerializedRecording,o):this.activeRecording=new KN(o),this.activeRecording.startRecording(e.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())}YN.log("Recording already in progress, skipping startRecording.")},XN.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))},XN.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},XN.prototype._stopCurrentRecording=function(e,t){if(this.activeRecording){var n=this.activeRecording.stopRecording(e);return t&&(this.activeRecording=null),n}return mE.resolve()},XN.prototype.resumeRecording=function(e){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),mE.resolve(null)):this.recordingRegistry.getActiveRecording().then(function(t){return t&&!this.stopRecordingInProgress?this.startRecording({activeSerializedRecording:t}):e?this.startRecording({shouldStopBatcher:!1}):(YN.log("No resumable recording found."),null)}.bind(this))},XN.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},XN.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(XN.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),km.__mp_recorder=XN;var GN="change",JN="click",QN="hashchange",eI="load",tI="mp_locationchange",nI="popstate",rI="scrollend",oI="scroll",iI="submit",aI="visibilitychange",sI=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],lI=["mp-include"],cI=["mp-no-track"],uI=cI.concat(["mp-sensitive"]),dI=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],fI={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},hI={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},pI={article:!0,div:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,p:!0,section:!0,span:!0},mI=["onclick","onmousedown","onmouseup","onpointerdown","onpointerup","ontouchend","ontouchstart"],gI=GE("autocapture");function vI(e){for(var t={},n=yI(e).split(" "),r=0;r<n.length;r++){var o=n[r];o&&(t[o]=!0)}return t}function yI(e){switch(typeof e.className){case"string":return e.className;case"object":return e.className.baseVal||e.getAttribute("class")||"";default:return""}}function bI(e){if(e.previousElementSibling)return e.previousElementSibling;do{e=e.previousSibling}while(e&&!CI(e));return e}function xI(e,t,n,r,o,i){var a={$classes:yI(e).split(" "),$tag_name:e.tagName.toLowerCase()},s=e.id;s&&(a.$id=s),II(e,t,o,i)&&ZE.each(dI.concat(r),function(t){if(e.hasAttribute(t)&&!n[t]){var r=e.getAttribute(t);OI(r)&&(a["$attr-"+t]=r)}});for(var l=1,c=1,u=e;u=bI(u);)l++,u.tagName===e.tagName&&c++;return a.$nth_child=l,a.$nth_of_type=c,a}function wI(e,t){var n=t.allowElementCallback,r=t.allowSelectors||[],o=t.blockAttrs||[],i=t.blockElementCallback,a=t.blockSelectors||[],s=t.captureTextContent||!1,l=t.captureExtraAttrs||[],c=t.capturedForHeatMap||!1,u={};ZE.each(o,function(e){u[e]=!0});var d=null,f=void 0===e.target?e.srcElement:e.target;if(NI(f)&&(f=f.parentNode),function(e,t){if(!e||EI(e,"html")||!CI(e))return!1;switch(e.tagName.toLowerCase()){case"form":return t.type===iI;case"input":return-1===["button","submit"].indexOf(e.getAttribute("type"))?t.type===GN:t.type===JN;case"select":case"textarea":return t.type===GN;default:return t.type===JN}}(f,e)&&_I(f,e,n,r)&&!SI(f,e,i,a)){for(var h=[f],p=f;p.parentNode&&!EI(p,"body");)h.push(p.parentNode),p=p.parentNode;var m,g=[],v=!1;if(ZE.each(h,function(t){var o=II(t,e,n,r);u.href||"a"!==t.tagName.toLowerCase()||(m=t.getAttribute("href"),m=o&&OI(m)&&m),SI(t,e,i,a)&&(v=!0),g.push(xI(t,e,u,l,n,r))},this),!v){var y=zE.documentElement;if(d={$event_type:e.type,$host:km.location.host,$pathname:km.location.pathname,$elements:g,$el_attr__href:m,$viewportHeight:Math.max(y.clientHeight,km.innerHeight||0),$viewportWidth:Math.max(y.clientWidth,km.innerWidth||0),$pageHeight:zE.body.offsetHeight||0,$pageWidth:zE.body.offsetWidth||0},ZE.each(l,function(e){if(!u[e]&&f.hasAttribute(e)){var t=f.getAttribute(e);OI(t)&&(d["$el_attr__"+e]=t)}}),s&&(b=kI(f,e,n,r))&&b.length&&(d.$el_text=b),e.type===JN&&(ZE.each(sI,function(t){t in e&&(d["$"+t]=e[t])}),c&&(d.$captured_for_heatmap=!0),f=function(e){for(var t=e.target,n=e.composedPath(),r=0;r<n.length;r++){var o=n[r];if(EI(o,"a")||EI(o,"button")||EI(o,"input")||EI(o,"select")||o.getAttribute&&"button"===o.getAttribute("role")){t=o;break}if(o===t)break}return t}(e)),s){var b=kI(f,e,n,r);b&&b.length&&(d.$el_text=b)}if(f){if(!_I(f,e,n,r)||SI(f,e,i,a))return null;var x=xI(f,e,u,l,n,r);d.$target=x,d.$el_classes=x.$classes,ZE.extend(d,ZE.strip_empty_properties({$el_id:x.$id,$el_tag_name:x.$tag_name}))}}}return d}function kI(e,t,n,r){var o="";return II(e,t,n,r)&&e.childNodes&&e.childNodes.length&&ZE.each(e.childNodes,function(e){NI(e)&&e.textContent&&(o+=ZE.trim(e.textContent).split(/(\s+)/).filter(OI).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),ZE.trim(o)}function _I(e,t,n,r){if(n)try{if(!n(e,t))return!1}catch(v7){return gI.critical("Error while checking element in allowElementCallback",v7),!1}if(!r.length)return!0;for(var o=0;o<r.length;o++){var i=r[o];try{if(e.matches(i))return!0}catch(v7){gI.critical("Error while checking selector: "+i,v7)}}return!1}function SI(e,t,n,r){var o;if(n)try{if(n(e,t))return!0}catch(v7){return gI.critical("Error while checking element in blockElementCallback",v7),!0}if(r&&r.length)for(o=0;o<r.length;o++){var i=r[o];try{if(e.matches(i))return!0}catch(v7){gI.critical("Error while checking selector: "+i,v7)}}var a=vI(e);for(o=0;o<cI.length;o++)if(a[cI[o]])return!0;return!1}function CI(e){return e&&1===e.nodeType}function EI(e,t){return e&&e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function NI(e){return e&&3===e.nodeType}function II(e,t,n,r){var o;if(!_I(e,t,n,r))return!1;for(var i=e;i.parentNode&&!EI(i,"body");i=i.parentNode){var a=vI(i);for(o=0;o<uI.length;o++)if(a[uI[o]])return!1}var s=vI(e);for(o=0;o<lI.length;o++)if(s[lI[o]])return!0;if(EI(e,"input")||EI(e,"select")||EI(e,"textarea")||"true"===e.getAttribute("contenteditable"))return!1;var l=e.type||"";if("string"==typeof l)switch(l.toLowerCase()){case"hidden":case"password":return!1}var c=e.name||e.id||"";if("string"==typeof c){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function OI(e){if(null===e||ZE.isUndefined(e))return!1;if("string"==typeof e){e=ZE.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 MI(e){var t="onscrollend"in km,n=JE(e),r=rI;if(!t){var o=null;n=JE(function(){clearTimeout(o),o=setTimeout(e,100)}),r=oI}return{listener:n,eventType:r}}function jI(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<mI.length;t++)if(e.hasAttribute(mI[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 fI[n]}(e)||(!("a"!==t||!e.hasAttribute("href"))||!!e.hasAttribute("tabindex"))))))}function TI(e){if(!e||!e.tagName)return!0;var t=e.tagName.toLowerCase();if(hI[t])return!0;if(jI(e))return!1;for(var n=e.parentElement,r=0;n&&r<5;){if(jI(n))return!1;if(n.getRootNode&&n.getRootNode()!==zE){var o=n.getRootNode();if(o.host&&jI(o.host))return!1}n=n.parentElement,r++}return!!pI[t]}function PI(e){return"composedPath"in e?e.composedPath():[]}function AI(e){var t=PI(e);return t&&t.length>0?t[0]:e.target||e.srcElement}function RI(){this.clicks=[]}function LI(e,t){this.changeCallback=e||function(){},this.observerConfig=t,this.observedShadowRoots=null,this.shadowObservers=[]}RI.prototype.isRageClick=function(e,t){var n=(t=t||{}).threshold_px||30,r=t.timeout_ms||1e3,o=t.click_count||4;if(t.interactive_elements_only||false){var i=AI(e);if(!i||TI(i))return!1}var a=Date.now(),s=e.pageX,l=e.pageY,c=this.clicks[this.clicks.length-1];if(c&&a-c.timestamp<r&&Math.sqrt(Math.pow(s-c.x,2)+Math.pow(l-c.y,2))<n){if(this.clicks.push({x:s,y:l,timestamp:a}),this.clicks.length>=o)return this.clicks=[],!0}else this.clicks=[{x:s,y:l,timestamp:a}];return!1},LI.prototype.getEventTarget=function(e){if(this.observedShadowRoots)return AI(e)},LI.prototype.observeFromEvent=function(e){if(this.observedShadowRoots)for(var t=PI(e),n=0;n<t.length;n++){var r=t[n];r&&r.shadowRoot&&this.observeShadowRoot(r.shadowRoot)}},LI.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(rp){gI.critical("Error while observing shadow root",rp)}}},LI.prototype.start=function(){this.observedShadowRoots||("undefined"!=typeof WeakSet?this.observedShadowRoots=new WeakSet:gI.critical("Shadow DOM observation unavailable: WeakSet not supported"))},LI.prototype.stop=function(){if(this.observedShadowRoots){for(var e=0;e<this.shadowObservers.length;e++)try{this.shadowObservers[e].disconnect()}catch(rp){gI.critical("Error while disconnecting shadow DOM observer",rp)}this.shadowObservers=[],this.observedShadowRoots=null}};var DI=[GN,"input",iI,"select","toggle"],zI=[rI],FI=[QN],UI={characterData:!0,childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class","hidden","checked","selected","value","display","visibility"]};function BI(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}BI.prototype.addClick=function(e){var t=this.shadowDOMObserver&&this.shadowDOMObserver.getEventTarget(e);return t||(t=e.target||e.srcElement),!(!t||TI(t))&&(this.shadowDOMObserver&&this.shadowDOMObserver.observeFromEvent(e),this.pendingClicks.push({element:t,event:e,timestamp:Date.now()}),!0)},BI.prototype.trackClick=function(e,t){if(!this.isTracking)return!1;var n=this.addClick(e);return n&&this.triggerProcessing(t),n},BI.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 o=[],i=0;i<r.length;i++){var a=r[i];n-a.timestamp>=t?this.hasChangesAfter(a.timestamp)||o.push(a):this.pendingClicks.push(a)}return o},BI.prototype.hasChangesAfter=function(e){return this.lastChangeEventTimestamp>=e-100},BI.prototype.recordChangeEvent=function(){this.lastChangeEventTimestamp=Date.now()},BI.prototype.triggerProcessing=function(e){this.processingActive||(this.processingActive=!0,this.processRecursively(e))},BI.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},BI.prototype.startTracking=function(){if(!this.isTracking){this.isTracking=!0;var e=this;DI.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}})}),FI.forEach(function(t){var n=function(){e.recordChangeEvent()};window.addEventListener(t,n),e.eventListeners.push({target:window,event:t,handler:n})}),zI.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,UI)}catch(rp){gI.critical("Error while setting up mutation observer",rp)}if(window.customElements)try{this.shadowDOMObserver=new LI(function(){e.recordChangeEvent()},UI),this.shadowDOMObserver.start()}catch(rp){gI.critical("Error while setting up shadow DOM observer",rp),this.shadowDOMObserver=null}}},BI.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(rp){gI.critical("Error while removing event listener",rp)}}if(this.eventListeners=[],this.mutationObserver){try{this.mutationObserver.disconnect()}catch(rp){gI.critical("Error while disconnecting mutation observer",rp)}this.mutationObserver=null}if(this.shadowDOMObserver){try{this.shadowDOMObserver.stop()}catch(rp){gI.critical("Error while stopping shadow DOM observer",rp)}this.shadowDOMObserver=null}}};var $I="autocapture",VI="full-url",HI="allow_selectors",WI="allow_url_regexes",qI="block_attrs",KI="block_element_callback",ZI="block_selectors",YI="block_url_regexes",XI="capture_extra_attrs",GI="capture_text_content",JI="scroll_capture_all",QI="scroll_depth_percent_checkpoints",eO="click",tO="dead_click",nO="input",rO="pageview",oO="rage_click",iO="scroll",aO="page_leave",sO="submit",lO={};lO[HI]=[],lO[WI]=[],lO[qI]=[],lO[KI]=null,lO[ZI]=[],lO[YI]=[],lO[XI]=[],lO[GI]=!1,lO[JI]=!1,lO[QI]=[25,50,75,100],lO[eO]=!0,lO[tO]=!0,lO[nO]=!0,lO[rO]=VI,lO[oO]=!0,lO[iO]=!0,lO[aO]=!1,lO[sO]=!0;var cO={$mp_autocapture:!0},uO="$mp_click",dO="$mp_dead_click",fO="$mp_rage_click",hO=function(e){this.mp=e,this.maxScrollViewDepth=0,this.hasTrackedScrollSession=!1,this.previousScrollHeight=0};hO.prototype.init=function(){!function(){try{return!!zE.createElement("div").matches}catch(v7){return!1}}()?gI.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())},hO.prototype.getFullConfig=function(){var e=this.mp.get_config($I);return e?ZE.isObject(e)?ZE.extend({},lO,e):lO:{}},hO.prototype.getConfig=function(e){return this.getFullConfig()[e]},hO.prototype.currentUrlBlocked=function(){var e,t=ZE.info.currentUrl(),n=this.getConfig(WI)||[];if(n.length){var r=!1;for(e=0;e<n.length;e++){var o=n[e];try{if(t.match(o)){r=!0;break}}catch(v7){return gI.critical("Error while checking block URL regex: "+o,v7),!0}}if(!r)return!0}var i=this.getConfig(YI)||[];if(!i||!i.length)return!1;for(e=0;e<i.length;e++)try{if(t.match(i[e]))return!0}catch(v7){return gI.critical("Error while checking block URL regex: "+i[e],v7),!0}return!1},hO.prototype.pageviewTrackingConfig=function(){return this.mp.get_config($I)?this.getConfig(rO):this.mp.get_config("track_pageview")},hO.prototype.trackDomEvent=function(e,t){if(!this.currentUrlBlocked()){var n=this.mp.is_recording_heatmap_data()&&(t===uO&&!this.getConfig(eO)||t===fO&&!this._getClickTrackingConfig(oO)||t===dO&&!this._getClickTrackingConfig(tO)),r=wI(e,{allowElementCallback:this.getConfig("allow_element_callback"),allowSelectors:this.getConfig(HI),blockAttrs:this.getConfig(qI),blockElementCallback:this.getConfig(KI),blockSelectors:this.getConfig(ZI),captureExtraAttrs:this.getConfig(XI),captureTextContent:this.getConfig(GI),capturedForHeatMap:n});r&&(ZE.extend(r,cO),this.mp.track(t,r))}},hO.prototype.initPageListeners=function(){if(km.removeEventListener(nI,this.listenerPopstate),km.removeEventListener(QN,this.listenerHashchange),this.pageviewTrackingConfig()||this.getConfig(aO)||this.mp.get_config("record_heatmap_data")){this.listenerPopstate=function(){km.dispatchEvent(new Event(tI))},this.listenerHashchange=function(){km.dispatchEvent(new Event(tI))},km.addEventListener(nI,this.listenerPopstate),km.addEventListener(QN,this.listenerHashchange);var e=km.history.pushState;"function"==typeof e&&(km.history.pushState=function(t,n,r){e.call(km.history,t,n,r),km.dispatchEvent(new Event(tI))});var t=km.history.replaceState;"function"==typeof t&&(km.history.replaceState=function(e,n,r){t.call(km.history,e,n,r),km.dispatchEvent(new Event(tI))})}},hO.prototype._getClickTrackingConfig=function(e){var t=this.getConfig(e);return t?!0===t?{}:"object"==typeof t?t:{}:null},hO.prototype._trackPageLeave=function(e,t,n){if(!this.hasTrackedScrollSession&&(this.getConfig(aO)||this.mp.is_recording_heatmap_data())){this.hasTrackedScrollSession=!0;var r=Math.max(zE.documentElement.clientHeight,km.innerHeight||0),o=Math.round(Math.max(this.maxScrollViewDepth-r,0)/(n-r)*100),i=Math.round(r/n*100);n<=r&&(o=100,i=100);var a=ZE.extend({$max_scroll_view_depth:this.maxScrollViewDepth,$max_scroll_percentage:o,$fold_line_percentage:i,$scroll_height:n,$event_type:e.type,$current_url:t||ZE.info.currentUrl(),$viewportHeight:r,$viewportWidth:Math.max(zE.documentElement.clientWidth,km.innerWidth||0),$captured_for_heatmap:this.mp.is_recording_heatmap_data()},cO);this.mp.track("$mp_page_leave",a,{transport:"sendBeacon"})}},hO.prototype._initScrollDepthTracking=function(){if(km.removeEventListener(oI,this.listenerScrollDepth),km.removeEventListener(rI,this.listenerScrollDepth),this.mp.get_config("record_heatmap_data")){gI.log("Initializing scroll depth tracking"),this.maxScrollViewDepth=Math.max(zE.documentElement.clientHeight,km.innerHeight||0);var e=MI(function(){if(!this.currentUrlBlocked()){var e=Math.max(zE.documentElement.clientHeight,km.innerHeight||0)+km.scrollY;e>this.maxScrollViewDepth&&(this.maxScrollViewDepth=e),this.previousScrollHeight=zE.body.scrollHeight}}.bind(this));this.listenerScrollDepth=e.listener,km.addEventListener(e.eventType,this.listenerScrollDepth)}},hO.prototype.initClickTracking=function(){km.removeEventListener(JN,this.listenerClick),(this.getConfig(eO)||this.mp.get_config("record_heatmap_data"))&&(gI.log("Initializing click tracking"),this.listenerClick=function(e){(this.getConfig(eO)||this.mp.is_recording_heatmap_data())&&this.trackDomEvent(e,uO)}.bind(this),km.addEventListener(JN,this.listenerClick))},hO.prototype.initDeadClickTracking=function(){this._getClickTrackingConfig(tO)||this.mp.get_config("record_heatmap_data")?(gI.log("Initializing dead click tracking"),this._deadClickTracker||(this._deadClickTracker=new BI(function(e){this.trackDomEvent(e,dO)}.bind(this)),this._deadClickTracker.startTracking()),this.listenerDeadClick||(this.listenerDeadClick=function(e){var t=this._getClickTrackingConfig(tO);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),km.addEventListener(JN,this.listenerDeadClick))):this.stopDeadClickTracking()},hO.prototype.initInputTracking=function(){km.removeEventListener(GN,this.listenerChange),this.getConfig(nO)&&(gI.log("Initializing input tracking"),this.listenerChange=function(e){this.getConfig(nO)&&this.trackDomEvent(e,"$mp_input_change")}.bind(this),km.addEventListener(GN,this.listenerChange))},hO.prototype.initPageviewTracking=function(){if(km.removeEventListener(tI,this.listenerLocationchange),this.pageviewTrackingConfig()){gI.log("Initializing pageview tracking");var e="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(cO)),t&&(e=ZE.info.currentUrl()),this.listenerLocationchange=JE(function(){if(!this.currentUrlBlocked()){var t=ZE.info.currentUrl(),n=!1,r=t.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0],o=this.pageviewTrackingConfig();if(o===VI?n=t!==e:"url-with-path-and-query-string"===o?n=t.split("#")[0]!==e.split("#")[0]:"url-with-path"===o&&(n=r),n)this.mp.track_pageview(cO)&&(e=t),r&&(this.lastScrollCheckpoint=0,gI.log("Path change: re-initializing scroll depth checkpoints"))}}.bind(this)),km.addEventListener(tI,this.listenerLocationchange)}},hO.prototype.initRageClickTracking=function(){km.removeEventListener(JN,this.listenerRageClick),(this._getClickTrackingConfig(oO)||this.mp.get_config("record_heatmap_data"))&&(gI.log("Initializing rage click tracking"),this._rageClickTracker||(this._rageClickTracker=new RI),this.listenerRageClick=function(e){var t=this._getClickTrackingConfig(oO);(t||this.mp.is_recording_heatmap_data())&&(this.currentUrlBlocked()||this._rageClickTracker.isRageClick(e,t)&&this.trackDomEvent(e,fO))}.bind(this),km.addEventListener(JN,this.listenerRageClick))},hO.prototype.initScrollTracking=function(){if(km.removeEventListener(rI,this.listenerScroll),km.removeEventListener(oI,this.listenerScroll),this.getConfig(iO)){gI.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0;var e=function(){if(this.getConfig(iO)&&!this.currentUrlBlocked()){var e=this.getConfig(JI),t=(this.getConfig(QI)||[]).slice().sort(function(e,t){return e-t}),n=km.scrollY,r=ZE.extend({$scroll_top:n},cO);try{var o=zE.body.scrollHeight,i=Math.round(n/(o-km.innerHeight)*100);if(r.$scroll_height=o,r.$scroll_percentage=i,i>this.lastScrollCheckpoint)for(var a=0;a<t.length;a++){var s=t[a];i>=s&&this.lastScrollCheckpoint<s&&(r.$scroll_checkpoint=s,this.lastScrollCheckpoint=s,e=!0)}}catch(v7){gI.critical("Error while calculating scroll percentage",v7)}e&&this.mp.track("$mp_scroll",r)}}.bind(this),t=MI(e);this.listenerScroll=t.listener,km.addEventListener(t.eventType,this.listenerScroll)}},hO.prototype.initSubmitTracking=function(){km.removeEventListener(iI,this.listenerSubmit),this.getConfig(sO)&&(gI.log("Initializing submit tracking"),this.listenerSubmit=function(e){this.getConfig(sO)&&this.trackDomEvent(e,"$mp_submit")}.bind(this),km.addEventListener(iI,this.listenerSubmit))},hO.prototype.initPageLeaveTracking=function(){if(zE.removeEventListener(aI,this.listenerPageLeaveVisibilitychange),km.removeEventListener(tI,this.listenerPageLeaveLocationchange),km.removeEventListener(eI,this.listenerPageLoad),this.getConfig(aO)||this.mp.get_config("record_heatmap_data")){gI.log("Initializing page visibility tracking."),this._initScrollDepthTracking();var e=ZE.info.currentUrl();this.listenerPageLoad=function(){this.previousScrollHeight=zE.body.scrollHeight}.bind(this),km.addEventListener(eI,this.listenerPageLoad),this.listenerPageLeaveLocationchange=JE(function(t){if(!this.currentUrlBlocked()){var n=ZE.info.currentUrl();n!==e&&(this._trackPageLeave(t,e,this.previousScrollHeight),e=n,this.maxScrollViewDepth=Math.max(zE.documentElement.clientHeight,km.innerHeight||0),this.previousScrollHeight=zE.body.scrollHeight,this.hasTrackedScrollSession=!1)}}.bind(this)),km.addEventListener(tI,this.listenerPageLeaveLocationchange),this.listenerPageLeaveVisibilitychange=function(t){zE.hidden&&this._trackPageLeave(t,e,this.previousScrollHeight)}.bind(this),zE.addEventListener(aI,this.listenerPageLeaveVisibilitychange)}},hO.prototype.stopDeadClickTracking=function(){this.listenerDeadClick&&(km.removeEventListener(JN,this.listenerDeadClick),this.listenerDeadClick=null),this._deadClickTracker&&(this._deadClickTracker.stopTracking(),this._deadClickTracker=null)},QE(hO);var pO=GE("flags"),mO="flags",gO="context",vO={};vO[gO]={};var yO=function(e){this.fetch=km.fetch,this.getFullApiRoute=e.getFullApiRoute,this.getMpConfig=e.getConfigFunc,this.setMpConfig=e.setConfigFunc,this.getMpProperty=e.getPropertyFunc,this.track=e.trackingFunc};yO.prototype.init=function(){this.minApisSupported()?(this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set):pO.critical("Feature Flags unavailable: missing minimum required APIs")},yO.prototype.getFullConfig=function(){var e=this.getMpConfig(mO);return e?ZE.isObject(e)?ZE.extend({},vO,e):vO:{}},yO.prototype.getConfig=function(e){return this.getFullConfig()[e]},yO.prototype.isSystemEnabled=function(){return!!this.getMpConfig(mO)},yO.prototype.updateContext=function(e,t){if(!this.isSystemEnabled())return pO.critical("Feature Flags not enabled, cannot update context"),Promise.resolve();var n=this.getMpConfig(mO);ZE.isObject(n)||(n={});var r=t&&t.replace?{}:this.getConfig(gO);return n[gO]=ZE.extend({},r,e),this.setMpConfig(mO,n),this.fetchFlags()},yO.prototype.areFlagsReady=function(){return this.isSystemEnabled()||pO.error("Feature Flags not enabled"),!!this.flags},yO.prototype.fetchFlags=function(){if(!this.isSystemEnabled())return Promise.resolve();var e=this.getMpProperty("distinct_id"),t=this.getMpProperty("$device_id"),n="00-"+ZE.UUID().replace(/-/g,"")+"-"+ZE.UUID().replace(/-/g,"").substring(0,16)+"-01";pO.log("Fetching flags for distinct ID: "+e);var r=ZE.extend({distinct_id:e,device_id:t},this.getConfig(gO)),o=new URLSearchParams;o.set("context",JSON.stringify(r)),o.set("token",this.getMpConfig("token")),o.set("mp_lib","web"),o.set("$lib_version",NE.LIB_VERSION);var i=this.getFullApiRoute()+"?"+o.toString();return this._fetchInProgressStartTime=Date.now(),this.fetchPromise=this.fetch.call(km,i,{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;ZE.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(),pO.error(e)}.bind(this))}.bind(this)).catch(function(e){this.markFetchComplete(),pO.error(e)}.bind(this)),this.fetchPromise},yO.prototype.markFetchComplete=function(){this._fetchInProgressStartTime?(this._fetchStartTime=this._fetchInProgressStartTime,this._fetchCompleteTime=Date.now(),this._fetchLatency=this._fetchCompleteTime-this._fetchStartTime,this._fetchInProgressStartTime=null):pO.error("Fetch in progress started time not set, cannot mark fetch complete")},yO.prototype.getVariant=function(e,t){return this.fetchPromise?this.fetchPromise.then(function(){return this.getVariantSync(e,t)}.bind(this)).catch(function(e){return pO.error(e),t}):new Promise(function(e){pO.critical("Feature Flags not initialized"),e(t)})},yO.prototype.getVariantSync=function(e,t){if(!this.areFlagsReady())return pO.log("Flags not loaded yet"),t;var n=this.flags.get(e);return n?(this.trackFeatureCheck(e,n),n):(pO.log('No flag found: "'+e+'"'),t)},yO.prototype.getVariantValue=function(e,t){return this.getVariant(e,{value:t}).then(function(e){return e.value}).catch(function(e){return pO.error(e),t})},yO.prototype.getFeatureData=function(e,t){return pO.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)},yO.prototype.getVariantValueSync=function(e,t){return this.getVariantSync(e,{value:t}).value},yO.prototype.isEnabled=function(e,t){return this.getVariantValue(e).then(function(){return this.isEnabledSync(e,t)}.bind(this)).catch(function(e){return pO.error(e),t})},yO.prototype.isEnabledSync=function(e,t){t=t||!1;var n=this.getVariantValueSync(e,t);return!0!==n&&!1!==n&&(pO.error('Feature flag "'+e+'" value: '+n+" is not a boolean; returning fallback value: "+t),n=t),n},yO.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)}},yO.prototype.minApisSupported=function(){return!!this.fetch&&"undefined"!=typeof Promise&&"undefined"!=typeof Map&&"undefined"!=typeof Set},QE(yO),yO.prototype.are_flags_ready=yO.prototype.areFlagsReady,yO.prototype.get_variant=yO.prototype.getVariant,yO.prototype.get_variant_sync=yO.prototype.getVariantSync,yO.prototype.get_variant_value=yO.prototype.getVariantValue,yO.prototype.get_variant_value_sync=yO.prototype.getVariantValueSync,yO.prototype.is_enabled=yO.prototype.isEnabled,yO.prototype.is_enabled_sync=yO.prototype.isEnabledSync,yO.prototype.update_context=yO.prototype.updateContext,yO.prototype.get_feature_data=yO.prototype.getFeatureData;var bO=function(){};bO.prototype.create_properties=function(){},bO.prototype.event_handler=function(){},bO.prototype.after_track_handler=function(){},bO.prototype.init=function(e){return this.mp=e,this},bO.prototype.track=function(e,t,n,r){var o=this,i=ZE.dom_query(e);if(0!==i.length)return ZE.each(i,function(e){ZE.register_event(e,this.override_event,function(e){var i={},a=o.create_properties(n,this),s=o.mp.get_config("track_links_timeout");o.event_handler(e,this,i),window.setTimeout(o.track_callback(r,a,i,!0),s),o.mp.track(t,a,o.track_callback(r,a,i))})},this),!0;YE.error("The DOM query ("+e+") returned 0 elements")},bO.prototype.track_callback=function(e,t,n,r){r=r||!1;var o=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(r,t)||o.after_track_handler(t,n,r))}},bO.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):ZE.extend({},e)};var xO=function(){this.override_event="click"};ZE.inherit(xO,bO),xO.prototype.create_properties=function(e,t){var n=xO.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},xO.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()},xO.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var wO=function(){this.override_event="submit"};ZE.inherit(wO,bO),wO.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},wO.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var kO="$set",_O="$set_once",SO="$unset",CO="$add",EO="$append",NO="$union",IO="$remove",OO={set_action:function(e,t){var n={},r={};return ZE.isObject(e)?ZE.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[kO]=r,n},unset_action:function(e){var t={},n=[];return ZE.isArray(e)||(e=[e]),ZE.each(e,function(e){this._is_reserved_property(e)||n.push(e)},this),t[SO]=n,t},set_once_action:function(e,t){var n={},r={};return ZE.isObject(e)?ZE.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[_O]=r,n},union_action:function(e,t){var n={},r={};return ZE.isObject(e)?ZE.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=ZE.isArray(e)?e:[e])},this):r[e]=ZE.isArray(t)?t:[t],n[NO]=r,n},append_action:function(e,t){var n={},r={};return ZE.isObject(e)?ZE.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[EO]=r,n},remove_action:function(e,t){var n={},r={};return ZE.isObject(e)?ZE.each(e,function(e,t){this._is_reserved_property(t)||(r[t]=e)},this):r[e]=t,n[IO]=r,n},delete_action:function(){var e={$delete:""};return e}},MO=function(){};ZE.extend(MO.prototype,OO),MO.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},MO.prototype.set=EN(function(e,t,n){var r=this.set_action(e,t);return ZE.isObject(e)&&(n=t),this._send_request(r,n)}),MO.prototype.set_once=EN(function(e,t,n){var r=this.set_once_action(e,t);return ZE.isObject(e)&&(n=t),this._send_request(r,n)}),MO.prototype.unset=EN(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),MO.prototype.union=EN(function(e,t,n){ZE.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),MO.prototype.delete=EN(function(e){var t=this.delete_action();return this._send_request(t,e)}),MO.prototype.remove=EN(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)}),MO.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=ZE.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)},MO.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},MO.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MO.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MO.prototype.remove=MO.prototype.remove,MO.prototype.set=MO.prototype.set,MO.prototype.set_once=MO.prototype.set_once,MO.prototype.union=MO.prototype.union,MO.prototype.unset=MO.prototype.unset,MO.prototype.toString=MO.prototype.toString;var jO=function(){};ZE.extend(jO.prototype,OO),jO.prototype._init=function(e){this._mixpanel=e},jO.prototype.set=CN(function(e,t,n){var r=this.set_action(e,t);return ZE.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[kO]=ZE.extend({},ZE.info.people_properties(),r[kO]),this._send_request(r,n)}),jO.prototype.set_once=CN(function(e,t,n){var r=this.set_once_action(e,t);return ZE.isObject(e)&&(n=t),this._send_request(r,n)}),jO.prototype.unset=CN(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)}),jO.prototype.increment=CN(function(e,t,n){var r={},o={};return ZE.isObject(e)?(ZE.each(e,function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void YE.error("Invalid increment value passed to mixpanel.people.increment - must be a number");o[t]=e}},this),n=t):(ZE.isUndefined(t)&&(t=1),o[e]=t),r[CO]=o,this._send_request(r,n)}),jO.prototype.append=CN(function(e,t,n){ZE.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)}),jO.prototype.remove=CN(function(e,t,n){ZE.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)}),jO.prototype.union=CN(function(e,t,n){ZE.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)}),jO.prototype.track_charge=CN(function(){YE.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),jO.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},jO.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}YE.error("mixpanel.people.delete_user() requires you to call identify() first")},jO.prototype.toString=function(){return this._mixpanel.toString()+".people"},jO.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"),o=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),o&&(e.$had_persisted_distinct_id=o);var i=ZE.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:i,endpoint:this._mixpanel.get_api_host("people")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),ZE.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),ZE.truncate(i,255))},jO.prototype._get_config=function(e){return this._mixpanel.get_config(e)},jO.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},jO.prototype._enqueue=function(e){kO in e?this._mixpanel.persistence._add_to_people_queue(kO,e):_O in e?this._mixpanel.persistence._add_to_people_queue(_O,e):SO in e?this._mixpanel.persistence._add_to_people_queue(SO,e):CO in e?this._mixpanel.persistence._add_to_people_queue(CO,e):EO in e?this._mixpanel.persistence._add_to_people_queue(EO,e):IO in e?this._mixpanel.persistence._add_to_people_queue(IO,e):NO in e?this._mixpanel.persistence._add_to_people_queue(NO,e):YE.error("Invalid call to _enqueue():",e)},jO.prototype._flush_one_queue=function(e,t,n,r){var o=this,i=ZE.extend({},this._mixpanel.persistence.load_queue(e)),a=i;ZE.isUndefined(i)||!ZE.isObject(i)||ZE.isEmptyObject(i)||(o._mixpanel.persistence._pop_from_people_queue(e,i),o._mixpanel.persistence.save(),r&&(a=r(i)),t.call(o,a,function(t,r){0===t&&o._mixpanel.persistence._add_to_people_queue(e,i),ZE.isUndefined(n)||n(t,r)}))},jO.prototype._flush=function(e,t,n,r,o,i,a){var s=this;this._flush_one_queue(kO,this.set,e),this._flush_one_queue(_O,this.set_once,r),this._flush_one_queue(SO,this.unset,i,function(e){return ZE.keys(e)}),this._flush_one_queue(CO,this.increment,t),this._flush_one_queue(NO,this.union,o);var l=this._mixpanel.persistence.load_queue(EO);if(!ZE.isUndefined(l)&&ZE.isArray(l)&&l.length)for(var c,u=function(e,t){0===e&&s._mixpanel.persistence._add_to_people_queue(EO,c),ZE.isUndefined(n)||n(e,t)},d=l.length-1;d>=0;d--)l=this._mixpanel.persistence.load_queue(EO),c=l.pop(),s._mixpanel.persistence.save(),ZE.isEmptyObject(c)||s.append(c,u);var f=this._mixpanel.persistence.load_queue(IO);if(!ZE.isUndefined(f)&&ZE.isArray(f)&&f.length)for(var h,p=function(e,t){0===e&&s._mixpanel.persistence._add_to_people_queue(IO,h),ZE.isUndefined(a)||a(e,t)},m=f.length-1;m>=0;m--)f=this._mixpanel.persistence.load_queue(IO),h=f.pop(),s._mixpanel.persistence.save(),ZE.isEmptyObject(h)||s.remove(h,p)},jO.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},jO.prototype.set=jO.prototype.set,jO.prototype.set_once=jO.prototype.set_once,jO.prototype.unset=jO.prototype.unset,jO.prototype.increment=jO.prototype.increment,jO.prototype.append=jO.prototype.append,jO.prototype.remove=jO.prototype.remove,jO.prototype.union=jO.prototype.union,jO.prototype.track_charge=jO.prototype.track_charge,jO.prototype.clear_charges=jO.prototype.clear_charges,jO.prototype.delete_user=jO.prototype.delete_user,jO.prototype.toString=jO.prototype.toString;var TO,PO="__mps",AO="__mpso",RO="__mpus",LO="__mpa",DO="__mpap",zO="__mpr",FO="__mpu",UO="$people_distinct_id",BO="__alias",$O="__timers",VO=[PO,AO,RO,LO,DO,zO,FO,UO,BO,$O],HO=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&&(YE.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&ZE.localStorage.is_supported()?this.storage=ZE.localStorage:this.storage=ZE.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};HO.prototype.properties=function(){var e={};return this.load(),ZE.each(this.props,function(t,n){ZE.include(VO,n)||(e[n]=t)}),e},HO.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=ZE.extend({},e))}},HO.prototype.upgrade=function(){var e,t;this.storage===ZE.localStorage?(e=ZE.cookie.parse(this.name),ZE.cookie.remove(this.name),ZE.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===ZE.cookie&&(t=ZE.localStorage.parse(this.name),ZE.localStorage.remove(this.name),t&&this.register_once(t))},HO.prototype.save=function(){this.disabled||this.storage.set(this.name,pN(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},HO.prototype.load_prop=function(e){return this.load(),this.props[e]},HO.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},HO.prototype.clear=function(){this.remove(),this.props={}},HO.prototype.register_once=function(e,t,n){return!!ZE.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),ZE.each(e,function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)},this),this.save(),!0)},HO.prototype.register=function(e,t){return!!ZE.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),ZE.extend(this.props,e),this.save(),!0)},HO.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},HO.prototype.update_search_keyword=function(e){this.register(ZE.info.searchInfo(e))},HO.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:ZE.info.referringDomain(e)||"$direct"},"")},HO.prototype.get_referrer_info=function(){return ZE.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},HO.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)},HO.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},HO.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},HO.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},HO.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},HO.prototype.get_cross_subdomain=function(){return this.cross_subdomain},HO.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},HO.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],o=this._get_or_create_queue(kO),i=this._get_or_create_queue(_O),a=this._get_or_create_queue(SO),s=this._get_or_create_queue(CO),l=this._get_or_create_queue(NO),c=this._get_or_create_queue(IO,[]),u=this._get_or_create_queue(EO,[]);n===PO?(ZE.extend(o,r),this._pop_from_people_queue(CO,r),this._pop_from_people_queue(NO,r),this._pop_from_people_queue(SO,r)):n===AO?(ZE.each(r,function(e,t){t in i||(i[t]=e)}),this._pop_from_people_queue(SO,r)):n===RO?ZE.each(r,function(e){ZE.each([o,i,s,l],function(t){e in t&&delete t[e]}),ZE.each(u,function(t){e in t&&delete t[e]}),a[e]=!0}):n===LO?(ZE.each(r,function(e,t){t in o?o[t]+=e:(t in s||(s[t]=0),s[t]+=e)},this),this._pop_from_people_queue(SO,r)):n===FO?(ZE.each(r,function(e,t){ZE.isArray(e)&&(t in l||(l[t]=[]),ZE.each(e,function(e){ZE.include(l[t],e)||l[t].push(e)}))}),this._pop_from_people_queue(SO,r)):n===zO?(c.push(r),this._pop_from_people_queue(EO,r)):n===DO&&(u.push(r),this._pop_from_people_queue(SO,r)),YE.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),YE.log(t),this.save()},HO.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];ZE.isUndefined(n)||ZE.each(t,function(t,r){e===EO||e===IO?ZE.each(n,function(e){e[r]===t&&delete e[r]}):delete n[r]},this)},HO.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},HO.prototype._get_queue_key=function(e){return e===kO?PO:e===_O?AO:e===SO?RO:e===CO?LO:e===EO?DO:e===IO?zO:e===NO?FO:void YE.error("Invalid queue:",e)},HO.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=ZE.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},HO.prototype.set_event_timer=function(e,t){var n=this.load_prop($O)||{};n[e]=t,this.props[$O]=n,this.save()},HO.prototype.remove_event_timer=function(e){var t=(this.load_prop($O)||{})[e];return ZE.isUndefined(t)||(delete this.props[$O][e],this.save()),t};var WO,qO=function(e,t){throw new Error(e+" not available in this build.")},KO=function(e){return e},ZO="mixpanel",YO="base64",XO="$device:",GO=km.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,JO=!GO&&-1===BE.indexOf("MSIE")&&-1===BE.indexOf("Mozilla"),QO=null;DE.sendBeacon&&(QO=function(){return DE.sendBeacon.apply(DE,arguments)});var eM={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},tM={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:eM,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:YO,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:hN,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:hN,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:IE,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},nM=!1,rM=function(){},oM=function(e,t,n){var r,o=n===ZO?WO:WO[n];if(o&&0===TO)r=o;else{if(o&&!ZE.isArray(o))return void YE.error("You have already initialized "+n);r=new rM}if(r._cached_groups={},r._init(e,t,n),r.people=new jO,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var i=ZE.info.campaignParams(null),a={},s=!1;ZE.each(i,function(e,t){a["initial_"+t]=e,e&&(s=!0)}),s&&r.people.set_once(a)}return NE.DEBUG=NE.DEBUG||r.get_config("debug"),!ZE.isUndefined(o)&&ZE.isArray(o)&&(r._execute_array.call(r.people,o.people),r._execute_array(o)),r};rM.prototype.init=function(e,t,n){if(ZE.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==ZO){var r=oM(e,t,n);return WO[n]=r,r._loaded(),r}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},rM.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};"api_payload_format"in t||(t.api_host||tM.api_host).match(/\.mixpanel\.com/)&&(r.api_payload_format="json");if(this.set_config(ZE.extend({},tM,r,t,{name:n,token:e,callback_fn:(n===ZO?n:ZO+"."+n)+"._jsc"})),this._jsc=hN,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(ZE.localStorage.is_supported(!0)&&GO){if(this.init_batchers(),QO&&km.addEventListener){var o=ZE.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);km.addEventListener("pagehide",function(e){e.persisted&&o()}),km.addEventListener("visibilitychange",function(){"hidden"===zE.visibilityState&&o()})}}else this._batch_requests=!1,YE.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),ZE.each(this.get_batcher_configs(),function(e){YE.log("Clearing batch queue "+e.queue_key),ZE.localStorage.remove(e.queue_key)});this.persistence=this.cookie=new HO(this.config),this.unpersisted_superprops={},this._gdpr_init();var i=ZE.UUID();this.get_distinct_id()||this.register_once({distinct_id:XO+i,$device_id:i},""),this.flags=new yO({getFullApiRoute:ZE.bind(function(){return this.get_api_host("flags")+"/"+this.get_config("api_routes").flags},this),getConfigFunc:ZE.bind(this.get_config,this),setConfigFunc:ZE.bind(this.set_config,this),getPropertyFunc:ZE.bind(this.get_property,this),trackingFunc:ZE.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new hO(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},rM.prototype._init_tab_id=function(){if(this.get_config("disable_persistence"))YE.log("Tab ID initialization skipped due to disable_persistence config");else if(ZE.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;!ZE.sessionStorage.get(n)&&ZE.sessionStorage.get(t)||ZE.sessionStorage.set(t,"$tab-"+ZE.UUID()),ZE.sessionStorage.set(n,"1"),this.tab_id=ZE.sessionStorage.get(t),km.addEventListener("beforeunload",function(){ZE.sessionStorage.remove(n)})}catch(v7){this.report_error("Error initializing tab id",v7)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},rM.prototype.get_tab_id=function(){return this.tab_id||null},rM.prototype._should_load_recorder=function(){if(this.get_config("disable_persistence"))return YE.log("Load recorder check skipped due to disable_persistence config"),Promise.resolve(!1);var e=new bN(vN),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($N(e[n])||e[n].tabId===t)return!0;return!1}).catch(ZE.bind(function(e){this.report_error("Error checking recording registry",e)},this))},rM.prototype._check_and_start_session_recording=SN(function(e){if(km.MutationObserver){var t=ZE.bind(function(e){var t=ZE.bind(function(){this._recorder=this._recorder||new km.__mp_recorder(this),this._recorder.resumeRecording(e)},this);ZE.isUndefined(km.__mp_recorder)?qO(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 YE.critical("Browser does not support MutationObserver; skipping session recording")}),rM.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},rM.prototype.stop_session_recording=function(){return this._recorder?this._recorder.stopRecording():Promise.resolve()},rM.prototype.pause_session_recording=function(){return this._recorder?this._recorder.pauseRecording():Promise.resolve()},rM.prototype.resume_session_recording=function(){return this._recorder?this._recorder.resumeRecording():Promise.resolve()},rM.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},rM.prototype.get_session_recording_properties=function(){var e={},t=this._get_session_replay_id();return t&&(e.$mp_replay_id=t),e},rM.prototype.get_session_replay_url=function(){var e=null,t=this._get_session_replay_id();t&&(e="https://mixpanel.com/projects/replay-redirect?"+ZE.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")}));return e},rM.prototype._get_session_replay_id=function(){var e=null;return this._recorder&&(e=this._recorder.replayId),e||null},rM.prototype.__get_recorder=function(){return this._recorder},rM.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=ZE.info.campaignParams(null);ZE.each(e,function(e,t){this.unregister(t)}.bind(this))}},rM.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(zE.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(ZE.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(zE.referrer)},rM.prototype._dom_loaded=function(){ZE.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||ZE.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue},rM.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(!nM)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},rM.prototype._prepare_callback=function(e,t){if(ZE.isUndefined(e))return null;if(GO){return function(n){e(n,t)}}var n=this._jsc,r=""+Math.floor(1e8*Math.random()),o=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(o){delete n[r],e(o,t)},o},rM.prototype._send_request=function(e,t,n,r){var o=!0;if(JO)return this.__request_queue.push(arguments),o;var i={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;r||!ZE.isFunction(n)&&"string"!=typeof n||(r=n,n=null),n=ZE.extend(i,n||{}),GO||(n.method="GET");var s="POST"===n.method,l=QO&&s&&"sendbeacon"===n.transport.toLowerCase(),c=n.verbose;t.verbose&&(c=!0),this.get_config("test")&&(t.test=1),c&&(t.verbose=1),this.get_config("img")&&(t.img=1),GO||(r?t.callback=r:(c||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),s&&(a="data="+encodeURIComponent(t.data),delete t.data),ZE.extend(t,this.get_config("api_extra_query_params")),e+="?"+ZE.HTTPBuildQuery(t);var u=this;if("img"in t){var d=zE.createElement("img");d.src=e,zE.body.appendChild(d)}else if(l){try{o=QO(e,a)}catch(rp){u.report_error(rp),o=!1}try{r&&r(o?1:0)}catch(rp){u.report_error(rp)}}else if(GO)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var h=this.get_config("xhr_headers");if(s&&(h["Content-Type"]="application/x-www-form-urlencoded"),ZE.each(h,function(e,t){f.setRequestHeader(t,e)}),n.timeout_ms&&void 0!==f.timeout){f.timeout=n.timeout_ms;var p=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(r)if(c){var t;try{t=ZE.JSONDecode(f.responseText)}catch(rp){if(u.report_error(rp),!n.ignore_json_errors)return;t=f.responseText}r(t)}else r(Number(f.responseText))}else if(e=f.timeout&&!f.status&&(new Date).getTime()-p>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,u.report_error(e),r)if(c){var o=f.responseHeaders||{};r({status:0,httpStatusCode:f.status,error:e,retryAfter:o["Retry-After"]})}else r(0)},f.send(a)}catch(rp){u.report_error(rp),o=!1}else{var m=zE.createElement("script");m.type="text/javascript",m.async=!0,m.defer=!0,m.src=e;var g=zE.getElementsByTagName("script")[0];g.parentNode.insertBefore(m,g)}return o},rM.prototype._execute_array=function(e){var t,n=[],r=[],o=[];ZE.each(e,function(e){e&&(t=e[0],ZE.isArray(t)?o.push(e):"function"==typeof e?e.call(this):ZE.isArray(e)&&"alias"===t?n.push(e):ZE.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?o.push(e):r.push(e))},this);var i=function(e,t){ZE.each(e,function(e){if(ZE.isArray(e[0])){var n=t;ZE.each(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};i(n,this),i(r,this),i(o,this)},rM.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},rM.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},rM.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=ZE.bind(function(e){return new BN(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:ZE.bind(function(t,n,r){var o=this.get_config("api_routes");this._send_request(this.get_api_host(e.api_name)+"/"+o[e.api_name],this._encode_data_for_request(t),n,this._prepare_callback(r,t))},this),beforeSendHook:ZE.bind(function(t){return this._run_hook("before_send_"+e.type,t)},this),stopAllBatchingFunc:ZE.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()},rM.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,ZE.each(this.request_batchers,function(e){e.start()}))},rM.prototype.stop_batch_senders=function(){this._batch_requests=!1,ZE.each(this.request_batchers,function(e){e.stop(),e.clear()})},rM.prototype.push=function(e){this._execute_array([e])},rM.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},rM.prototype._encode_data_for_request=function(e){var t=pN(e);return this.get_config("api_payload_format")===YO&&(t=ZE.base64Encode(t)),{data:t}},rM.prototype._track_or_batch=function(e,t){var n=ZE.truncate(e.data,255),r=e.endpoint,o=e.batcher,i=e.should_send_immediately,a=e.send_request_options||{};t=t||hN;var s=!0,l=ZE.bind(function(){return a.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(YE.log("MIXPANEL REQUEST:"),YE.log(n),this._send_request(r,this._encode_data_for_request(n),a,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!i?o.enqueue(n).then(function(e){e?t(1,n):l()}):s=l(),s&&n},rM.prototype.track=SN(function(e,t,n,r){r||"function"!=typeof n||(r=n,n=null);var o=(n=n||{}).transport;o&&(n.transport=o);var i=n.send_immediately;if("function"!=typeof r&&(r=hN),ZE.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=ZE.extend({},t)).token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!ZE.isUndefined(a)){var s=(new Date).getTime()-a;t.$duration=parseFloat((s/1e3).toFixed(3))}this._set_default_superprops();var l=this.get_config("track_marketing")?ZE.info.marketingParams():{};t=ZE.extend({},ZE.info.properties({mp_loader:this.get_config("mp_loader")}),l,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var c=this.get_config("property_blacklist");ZE.isArray(c)?ZE.each(c,function(e){delete t[e]}):this.report_error("Invalid value for property_blacklist config: "+c);var u={event:e,properties:t};return this._track_or_batch({type:"events",data:u,endpoint:this.get_api_host("events")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:i,send_request_options:n},r)}r(0)}}),rM.prototype.set_group=SN(function(e,t,n){ZE.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)}),rM.prototype.add_group=SN(function(e,t,n){var r=this.get_property(e),o={};return void 0===r?(o[e]=[t],this.register(o)):-1===r.indexOf(t)&&(r.push(t),o[e]=r,this.register(o)),this.people.union(e,t,n)}),rM.prototype.remove_group=SN(function(e,t,n){var r=this.get_property(e);if(void 0!==r){var o=r.indexOf(t);o>-1&&(r.splice(o,1),this.register({group_key:r})),0===r.length&&this.unregister(e)}return this.people.remove(e,t,n)}),rM.prototype.track_with_groups=SN(function(e,t,n,r){var o=ZE.extend({},t||{});return ZE.each(n,function(e,t){null!=e&&(o[t]=e)}),this.track(e,o,r)}),rM.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},rM.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},rM.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 MO)._init(this,e,t),this._cached_groups[n]=r),r},rM.prototype.track_pageview=SN(function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",r=ZE.extend(ZE.info.mpPageViewProperties(),ZE.info.campaignParams(),ZE.info.clickParams()),o=ZE.extend({},r,e);return this.track(n,o)}),rM.prototype.track_links=function(){return this._track_dom.call(this,xO,arguments)},rM.prototype.track_forms=function(){return this._track_dom.call(this,wO,arguments)},rM.prototype.time_event=function(e){ZE.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 iM={persistent:!0},aM=function(e){var t;return t=ZE.isObject(e)?e:ZE.isUndefined(e)?{}:{days:e},ZE.extend({},iM,t)};rM.prototype.register=function(e,t){var n=aM(t);n.persistent?this.persistence.register(e,n.days):ZE.extend(this.unpersisted_superprops,e)},rM.prototype.register_once=function(e,t,n){var r=aM(n);r.persistent?this.persistence.register_once(e,t,r.days):(void 0===t&&(t="None"),ZE.each(e,function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)},this))},rM.prototype.unregister=function(e,t){(t=aM(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},rM.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},rM.prototype.identify=function(e,t,n,r,o,i,a,s){var l=this.get_distinct_id();if(e&&l!==e){if("string"==typeof e&&0===e.indexOf(XO))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var c=l;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}e!==l&&e!==this.get_property(BO)&&(this.unregister(BO),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,o,i,a,s),e!==l&&this.track("$identify",{distinct_id:e,$anon_distinct_id:l},{skip_hooks:!0}),e!==l&&this.flags.fetchFlags()},rM.prototype.reset=function(){this.stop_session_recording(),this.persistence.clear(),this._flags.identify_called=!1;var e=ZE.UUID();this.register_once({distinct_id:XO+e,$device_id:e},""),this._check_and_start_session_recording()},rM.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},rM.prototype.alias=function(e,t){if(e===this.get_property(UO))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return ZE.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(BO,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)},rM.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},rM.prototype.set_config=function(e){ZE.isObject(e)&&(ZE.extend(this.config,e),e.batch_size&&ZE.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),NE.DEBUG=NE.DEBUG||this.get_config("debug"),("autocapture"in e||"record_heatmap_data"in e)&&this.autocapture&&this.autocapture.init())},rM.prototype.get_config=function(e){return this.config[e]},rM.prototype._run_hook=function(e){var t=(this.config.hooks[e]||KO).apply(this,PE.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},rM.prototype.get_property=function(e){return this.persistence.load_prop([e])},rM.prototype.get_api_host=function(e){return this.get_config("api_hosts")[e]||this.get_config("api_host")},rM.prototype.toString=function(){var e=this.get_config("name");return e!==ZO&&(e=ZO+"."+e),e},rM.prototype._event_is_disabled=function(e){return ZE.isBlockedUA(BE)||this._flags.disable_all_events||ZE.include(this.__disabled_events,e)},rM.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&ZE.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")&&!ZE.cookie.get("mp_optout")||(ZE.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},rM.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()},rM.prototype._gdpr_call_func=function(e,t){return t=ZE.extend({track:ZE.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),ZE.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})},rM.prototype.opt_in_tracking=function(e){e=ZE.extend({enable_persistence:!0},e),this._gdpr_call_func(xN,e),this._gdpr_update_persistence(e)},rM.prototype.opt_out_tracking=function(e){(e=ZE.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(wN,e),this._gdpr_update_persistence(e)},rM.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(kN,e)},rM.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(_N,e)},rM.prototype.clear_opt_in_out_tracking=function(e){e=ZE.extend({enable_persistence:!0},e),this._gdpr_call_func(NN,e),this._gdpr_update_persistence(e)},rM.prototype.report_error=function(e,t){YE.error.apply(YE.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){YE.error(n)}},rM.prototype.init=rM.prototype.init,rM.prototype.reset=rM.prototype.reset,rM.prototype.disable=rM.prototype.disable,rM.prototype.time_event=rM.prototype.time_event,rM.prototype.track=rM.prototype.track,rM.prototype.track_links=rM.prototype.track_links,rM.prototype.track_forms=rM.prototype.track_forms,rM.prototype.track_pageview=rM.prototype.track_pageview,rM.prototype.register=rM.prototype.register,rM.prototype.register_once=rM.prototype.register_once,rM.prototype.unregister=rM.prototype.unregister,rM.prototype.identify=rM.prototype.identify,rM.prototype.alias=rM.prototype.alias,rM.prototype.name_tag=rM.prototype.name_tag,rM.prototype.set_config=rM.prototype.set_config,rM.prototype.get_config=rM.prototype.get_config,rM.prototype.get_api_host=rM.prototype.get_api_host,rM.prototype.get_property=rM.prototype.get_property,rM.prototype.get_distinct_id=rM.prototype.get_distinct_id,rM.prototype.toString=rM.prototype.toString,rM.prototype.opt_out_tracking=rM.prototype.opt_out_tracking,rM.prototype.opt_in_tracking=rM.prototype.opt_in_tracking,rM.prototype.has_opted_out_tracking=rM.prototype.has_opted_out_tracking,rM.prototype.has_opted_in_tracking=rM.prototype.has_opted_in_tracking,rM.prototype.clear_opt_in_out_tracking=rM.prototype.clear_opt_in_out_tracking,rM.prototype.get_group=rM.prototype.get_group,rM.prototype.set_group=rM.prototype.set_group,rM.prototype.add_group=rM.prototype.add_group,rM.prototype.remove_group=rM.prototype.remove_group,rM.prototype.track_with_groups=rM.prototype.track_with_groups,rM.prototype.start_batch_senders=rM.prototype.start_batch_senders,rM.prototype.stop_batch_senders=rM.prototype.stop_batch_senders,rM.prototype.start_session_recording=rM.prototype.start_session_recording,rM.prototype.stop_session_recording=rM.prototype.stop_session_recording,rM.prototype.pause_session_recording=rM.prototype.pause_session_recording,rM.prototype.resume_session_recording=rM.prototype.resume_session_recording,rM.prototype.get_session_recording_properties=rM.prototype.get_session_recording_properties,rM.prototype.get_session_replay_url=rM.prototype.get_session_replay_url,rM.prototype.get_tab_id=rM.prototype.get_tab_id,rM.prototype.DEFAULT_API_ROUTES=eM,rM.prototype.__get_recorder=rM.prototype.__get_recorder,HO.prototype.properties=HO.prototype.properties,HO.prototype.update_search_keyword=HO.prototype.update_search_keyword,HO.prototype.update_referrer_info=HO.prototype.update_referrer_info,HO.prototype.get_cross_subdomain=HO.prototype.get_cross_subdomain,HO.prototype.clear=HO.prototype.clear;var sM={},lM=function(){WO.init=function(e,t,n){if(n)return WO[n]||(WO[n]=sM[n]=oM(e,t,n),WO[n]._loaded()),WO[n];var r=WO;sM[ZO]?r=sM[ZO]:e&&((r=oM(e,t,ZO))._loaded(),sM[ZO]=r),WO=r,1===TO&&(km[ZO]=WO),ZE.each(sM,function(e,t){t!==ZO&&(WO[t]=e)}),WO._=ZE}};qO=function(e,t){t()},TO=0,WO=new rM,lM(),WO.init(),function(){function e(){e.done||(e.done=!0,nM=!0,JO=!1,ZE.each(sM,function(e){e._dom_loaded()}))}if(zE.addEventListener)"complete"===zE.readyState?e():zE.addEventListener("DOMContentLoaded",e,!1);else if(zE.attachEvent){zE.attachEvent("onreadystatechange",e);var t=!1;try{t=null===km.frameElement}catch(rp){}zE.documentElement.doScroll&&t&&function t(){try{zE.documentElement.doScroll("left")}catch(rp){return void setTimeout(t,1)}e()}()}ZE.register_event(km,"load",e,!0)}();const cM=(e,t)=>{(()=>{if("undefined"==typeof window)return!1;const e=window.location.hostname,t=window.location.port;"localhost"===e||"127.0.0.1"===e||e.startsWith("192.168.")})()};function uM(){}function dM(){}const fM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pM={};function mM(e,t){return(pM.jsx?hM:fM).test(e)}const gM=/[ \t\n\f\r]/g;function vM(e){return""===e.replace(gM,"")}class yM{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function bM(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new yM(n,r,t)}function xM(e){return e.toLowerCase()}yM.prototype.normal={},yM.prototype.property={},yM.prototype.space=void 0;class wM{constructor(e,t){this.attribute=t,this.property=e}}wM.prototype.attribute="",wM.prototype.booleanish=!1,wM.prototype.boolean=!1,wM.prototype.commaOrSpaceSeparated=!1,wM.prototype.commaSeparated=!1,wM.prototype.defined=!1,wM.prototype.mustUseProperty=!1,wM.prototype.number=!1,wM.prototype.overloadedBoolean=!1,wM.prototype.property="",wM.prototype.spaceSeparated=!1,wM.prototype.space=void 0;let kM=0;const _M=MM(),SM=MM(),CM=MM(),EM=MM(),NM=MM(),IM=MM(),OM=MM();function MM(){return 2**++kM}const jM=Object.freeze(Object.defineProperty({__proto__:null,boolean:_M,booleanish:SM,commaOrSpaceSeparated:OM,commaSeparated:IM,number:EM,overloadedBoolean:CM,spaceSeparated:NM},Symbol.toStringTag,{value:"Module"})),TM=Object.keys(jM);class PM extends wM{constructor(e,t,n,r){let o=-1;if(super(e,t),AM(this,"space",r),"number"==typeof n)for(;++o<TM.length;){const e=TM[o];AM(this,TM[o],(n&jM[e])===jM[e])}}}function AM(e,t,n){n&&(e[t]=n)}function RM(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new PM(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[xM(r)]=r,n[xM(i.attribute)]=r}return new yM(t,n,e.space)}PM.prototype.defined=!0;const LM=RM({properties:{ariaActiveDescendant:null,ariaAtomic:SM,ariaAutoComplete:null,ariaBusy:SM,ariaChecked:SM,ariaColCount:EM,ariaColIndex:EM,ariaColSpan:EM,ariaControls:NM,ariaCurrent:null,ariaDescribedBy:NM,ariaDetails:null,ariaDisabled:SM,ariaDropEffect:NM,ariaErrorMessage:null,ariaExpanded:SM,ariaFlowTo:NM,ariaGrabbed:SM,ariaHasPopup:null,ariaHidden:SM,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:NM,ariaLevel:EM,ariaLive:null,ariaModal:SM,ariaMultiLine:SM,ariaMultiSelectable:SM,ariaOrientation:null,ariaOwns:NM,ariaPlaceholder:null,ariaPosInSet:EM,ariaPressed:SM,ariaReadOnly:SM,ariaRelevant:null,ariaRequired:SM,ariaRoleDescription:NM,ariaRowCount:EM,ariaRowIndex:EM,ariaRowSpan:EM,ariaSelected:SM,ariaSetSize:EM,ariaSort:null,ariaValueMax:EM,ariaValueMin:EM,ariaValueNow:EM,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function DM(e,t){return t in e?e[t]:t}function zM(e,t){return DM(e,t.toLowerCase())}const FM=RM({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:IM,acceptCharset:NM,accessKey:NM,action:null,allow:null,allowFullScreen:_M,allowPaymentRequest:_M,allowUserMedia:_M,alt:null,as:null,async:_M,autoCapitalize:null,autoComplete:NM,autoFocus:_M,autoPlay:_M,blocking:NM,capture:null,charSet:null,checked:_M,cite:null,className:NM,cols:EM,colSpan:null,content:null,contentEditable:SM,controls:_M,controlsList:NM,coords:EM|IM,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_M,defer:_M,dir:null,dirName:null,disabled:_M,download:CM,draggable:SM,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_M,formTarget:null,headers:NM,height:EM,hidden:CM,high:EM,href:null,hrefLang:null,htmlFor:NM,httpEquiv:NM,id:null,imageSizes:null,imageSrcSet:null,inert:_M,inputMode:null,integrity:null,is:null,isMap:_M,itemId:null,itemProp:NM,itemRef:NM,itemScope:_M,itemType:NM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_M,low:EM,manifest:null,max:null,maxLength:EM,media:null,method:null,min:null,minLength:EM,multiple:_M,muted:_M,name:null,nonce:null,noModule:_M,noValidate:_M,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_M,optimum:EM,pattern:null,ping:NM,placeholder:null,playsInline:_M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_M,referrerPolicy:null,rel:NM,required:_M,reversed:_M,rows:EM,rowSpan:EM,sandbox:NM,scope:null,scoped:_M,seamless:_M,selected:_M,shadowRootClonable:_M,shadowRootDelegatesFocus:_M,shadowRootMode:null,shape:null,size:EM,sizes:null,slot:null,span:EM,spellCheck:SM,src:null,srcDoc:null,srcLang:null,srcSet:null,start:EM,step:null,style:null,tabIndex:EM,target:null,title:null,translate:null,type:null,typeMustMatch:_M,useMap:null,value:SM,width:EM,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:NM,axis:null,background:null,bgColor:null,border:EM,borderColor:null,bottomMargin:EM,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_M,declare:_M,event:null,face:null,frame:null,frameBorder:null,hSpace:EM,leftMargin:EM,link:null,longDesc:null,lowSrc:null,marginHeight:EM,marginWidth:EM,noResize:_M,noHref:_M,noShade:_M,noWrap:_M,object:null,profile:null,prompt:null,rev:null,rightMargin:EM,rules:null,scheme:null,scrolling:SM,standby:null,summary:null,text:null,topMargin:EM,valueType:null,version:null,vAlign:null,vLink:null,vSpace:EM,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_M,disableRemotePlayback:_M,prefix:null,property:null,results:EM,security:null,unselectable:null},space:"html",transform:zM}),UM=RM({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:OM,accentHeight:EM,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:EM,amplitude:EM,arabicForm:null,ascent:EM,attributeName:null,attributeType:null,azimuth:EM,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:EM,by:null,calcMode:null,capHeight:EM,className:NM,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:EM,diffuseConstant:EM,direction:null,display:null,dur:null,divisor:EM,dominantBaseline:null,download:_M,dx:null,dy:null,edgeMode:null,editable:null,elevation:EM,enableBackground:null,end:null,event:null,exponent:EM,externalResourcesRequired:null,fill:null,fillOpacity:EM,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:IM,g2:IM,glyphName:IM,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:EM,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:EM,horizOriginX:EM,horizOriginY:EM,id:null,ideographic:EM,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:EM,k:EM,k1:EM,k2:EM,k3:EM,k4:EM,kernelMatrix:OM,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:EM,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:EM,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:EM,overlineThickness:EM,paintOrder:null,panose1:null,path:null,pathLength:EM,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:NM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:EM,pointsAtY:EM,pointsAtZ:EM,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:OM,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:OM,rev:OM,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:OM,requiredFeatures:OM,requiredFonts:OM,requiredFormats:OM,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:EM,specularExponent:EM,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:EM,strikethroughThickness:EM,string:null,stroke:null,strokeDashArray:OM,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:EM,strokeOpacity:EM,strokeWidth:null,style:null,surfaceScale:EM,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:OM,tabIndex:EM,tableValues:null,target:null,targetX:EM,targetY:EM,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:OM,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:EM,underlineThickness:EM,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:EM,values:null,vAlphabetic:EM,vMathematical:EM,vectorEffect:null,vHanging:EM,vIdeographic:EM,version:null,vertAdvY:EM,vertOriginX:EM,vertOriginY:EM,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:EM,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:DM}),BM=RM({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),$M=RM({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zM}),VM=RM({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),HM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},WM=/[A-Z]/g,qM=/-[a-z]/g,KM=/^data[-\w.:]+$/i;function ZM(e){return"-"+e.toLowerCase()}function YM(e){return e.charAt(1).toUpperCase()}const XM=bM([LM,FM,BM,$M,VM],"html"),GM=bM([LM,UM,BM,$M,VM],"svg");var JM={},QM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ej=/\n/g,tj=/^\s*/,nj=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,rj=/^:\s*/,oj=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ij=/^[;\s]*/,aj=/^\s+|\s+$/g,sj="";function lj(e){return e?e.replace(aj,sj):sj}var cj=function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(e){var t=e.match(ej);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){var e={line:n,column:r};return function(t){return t.position=new a(e),c(),t}}function a(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i}function l(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function c(){l(tj)}function u(e){var t;for(e=e||[];t=d();)!1!==t&&e.push(t);return e}function d(){var t=i();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;sj!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,sj===e.charAt(n-1))return s("End of comment missing");var a=e.slice(2,n-2);return r+=2,o(a),e=e.slice(n),r+=2,t({type:"comment",comment:a})}}function f(){var e=i(),t=l(nj);if(t){if(d(),!l(rj))return s("property missing ':'");var n=l(oj),r=e({type:"declaration",property:lj(t[0].replace(QM,sj)),value:n?lj(n[0].replace(QM,sj)):sj});return l(ij),r}}return a.prototype.content=e,c(),function(){var e,t=[];for(u(t);e=f();)!1!==e&&(t.push(e),u(t));return t}()},uj=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JM,"__esModule",{value:!0}),JM.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,dj.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:i}=e;o?t(r,i,e):i&&(n=n||{},n[r]=i)}),n};const dj=uj(cj);var fj={};Object.defineProperty(fj,"__esModule",{value:!0}),fj.camelCase=void 0;var hj=/^--[a-zA-Z0-9_-]+$/,pj=/-([a-z])/g,mj=/^[^-]+$/,gj=/^-(webkit|moz|ms|o|khtml)-/,vj=/^-(ms)-/,yj=function(e,t){return t.toUpperCase()},bj=function(e,t){return"".concat(t,"-")};fj.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||mj.test(e)||hj.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(vj,bj):e.replace(gj,bj)).replace(pj,yj))};var xj=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(JM),wj=fj;function kj(e,t){var n={};return e&&"string"==typeof e?((0,xj.default)(e,function(e,r){e&&r&&(n[(0,wj.camelCase)(e,t)]=r)}),n):n}kj.default=kj;const _j=r(kj),Sj=Ej("end"),Cj=Ej("start");function Ej(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Nj(e){return e&&"object"==typeof e?"position"in e||"type"in e?Oj(e.position):"start"in e||"end"in e?Oj(e):"line"in e||"column"in e?Ij(e):"":""}function Ij(e){return Mj(e&&e.line)+":"+Mj(e&&e.column)}function Oj(e){return Ij(e&&e.start)+"-"+Ij(e&&e.end)}function Mj(e){return e&&"number"==typeof e?e:1}class jj extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=Nj(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}jj.prototype.file="",jj.prototype.name="",jj.prototype.reason="",jj.prototype.message="",jj.prototype.stack="",jj.prototype.column=void 0,jj.prototype.line=void 0,jj.prototype.ancestors=void 0,jj.prototype.cause=void 0,jj.prototype.fatal=void 0,jj.prototype.place=void 0,jj.prototype.ruleId=void 0,jj.prototype.source=void 0;const Tj={}.hasOwnProperty,Pj=new Map,Aj=/[A-Z]/g,Rj=new Set(["table","tbody","thead","tfoot","tr"]),Lj=new Set(["td","th"]),Dj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zj(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=Cj(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?GM:XM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Fj(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Fj(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=GM,e.schema=o);e.ancestors.push(t);const i=Hj(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Tj.call(t.properties,o)){const i=Vj(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&Lj.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=$j(e,t);Rj.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&vM(t.value):vM(t));var t}));return Uj(e,a,i,t),Bj(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Wj(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=GM,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:Hj(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];uM(t.type);const o=t.expression;uM(o.type);const i=o.properties[0];uM(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Wj(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];uM(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Wj(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=$j(e,t);return Uj(e,a,i,t),Bj(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wj(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Bj(r,$j(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Uj(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Bj(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $j(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Pj;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=Fj(e,i,a);void 0!==s&&n.push(s)}return n}function Vj(e,t,n){const r=function(e,t){const n=xM(t);let r=t,o=wM;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&KM.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(qM,YM);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!qM.test(e)){let n=e.replace(WM,ZM);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=PM}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return _j(t,{reactCompat:!0})}catch(kE){if(e.ignoreInvalidStyle)return{};const n=kE,r=new jj("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Dj+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Tj.call(e,n)&&(t[qj(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?HM[r.property]||r.property:r.attribute,n]}}function Hj(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=mM(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=mM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Tj.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Wj(e)}function Wj(e,t){const n=new jj("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Dj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function qj(e){let t=e.replace(Aj,Kj);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Kj(e){return"-"+e.toLowerCase()}const Zj={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Yj={};function Xj(e,t){return Gj(e,"boolean"!=typeof Yj.includeImageAlt||Yj.includeImageAlt,"boolean"!=typeof Yj.includeHtml||Yj.includeHtml)}function Gj(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Jj(e.children,t,n)}return Array.isArray(e)?Jj(e,t,n):""}function Jj(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Gj(e[o],t,n);return r.join("")}const Qj=document.createElement("i");function eT(e){const t="&"+e+";";Qj.innerHTML=t;const n=Qj.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function tT(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function nT(e,t){return e.length>0?(tT(e,e.length,0,t),e):t}const rT={}.hasOwnProperty;function oT(e){const t={};let n=-1;for(;++n<e.length;)iT(t,e[n]);return t}function iT(e,t){let n;for(n in t){const r=(rT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){rT.call(r,i)||(r[i]=[]);const e=o[i];aT(r[i],Array.isArray(e)?e:e?[e]:[])}}}function aT(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);tT(e,0,0,r)}function sT(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function lT(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cT=wT(/[A-Za-z]/),uT=wT(/[\dA-Za-z]/),dT=wT(/[#-'*+\--9=?A-Z^-~]/);function fT(e){return null!==e&&(e<32||127===e)}const hT=wT(/\d/),pT=wT(/[\dA-Fa-f]/),mT=wT(/[!-/:-@[-`{-~]/);function gT(e){return null!==e&&e<-2}function vT(e){return null!==e&&(e<0||32===e)}function yT(e){return-2===e||-1===e||32===e}const bT=wT(new RegExp("\\p{P}|\\p{S}","u")),xT=wT(/\s/);function wT(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function kT(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&uT(e.charCodeAt(n+1))&&uT(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function _T(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(yT(r))return e.enter(n),a(r);return t(r)};function a(r){return yT(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const ST={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),_T(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):gT(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const CT={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&y();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}v(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return tT(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return f(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ET,u,d)(o)}function u(e){return r&&y(),v(a),f(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,p(e)}function f(n){return t.containerState={},e.attempt(ET,h,p)(n)}function h(e){return a++,n.push([t.currentConstruct,t.containerState]),f(e)}function p(n){return null===n?(r&&y(),v(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),v(0),void e.consume(n)):gT(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(v(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;tT(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function v(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function y(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},ET={tokenize:function(e,t,n){return _T(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function NT(e){return null===e||vT(e)||xT(e)?1:bT(e)?2:void 0}function IT(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const OT={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},f={...e[u][1].start};MT(d,-s),MT(f,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:f},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=nT(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=nT(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=nT(l,IT(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=nT(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=nT(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,tT(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=NT(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=NT(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}};function MT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jT={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return cT(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||uT(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||uT(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||fT(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):dT(t)?(e.consume(t),l):n(t)}function c(e){return uT(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||uT(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const TT={partial:!0,tokenize:function(e,t,n){return function(t){return yT(t)?_T(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||gT(e)?t(e):n(e)}}};const PT={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(yT(t))return _T(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(PT,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return yT(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const AT={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return mT(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const RT={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=uT,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=pT,c):(e.enter("characterReferenceValue"),o=7,i=hT,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==uT||eT(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}};const LT={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},DT={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),yT(t)?_T(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===i?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===i?(o++,e.consume(t),u):o>=s?(e.exit("codeFencedFenceSequence"),yT(t)?_T(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||gT(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),yT(t)?_T(e,c,"whitespace")(t):c(t))}function c(n){return null===n||gT(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(LT,h,y)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||gT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):yT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_T(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||gT(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||gT(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),f)}function h(t){return e.attempt(o,y,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&yT(t)?_T(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||gT(t)?e.check(LT,h,y)(t):(e.enter("codeFlowValue"),v(t))}function v(t){return null===t||gT(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),v)}function y(n){return e.exit("codeFenced"),t(n)}}};const zT={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),_T(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):gT(t)?e.attempt(FT,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||gT(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},FT={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):gT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):_T(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):gT(e)?o(e):n(e)}}};const UT={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):gT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||gT(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class BT{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&$T(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),$T(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),$T(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);$T(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);$T(this.left,t.reverse())}}}function $T(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function VT(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new BT(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,HT(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return tT(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function HT(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const s=a.events,l=[],c={};let u,d,f=-1,h=n,p=0,m=0;const g=[m];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++f<s.length;)"exit"===s[f][0]&&"enter"===s[f-1][0]&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(m=f+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){const t=s.slice(g[f],g[f+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),f=-1;++f<l.length;)c[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return c}const WT={resolve:function(e){return VT(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):gT(t)?e.check(qT,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},qT={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),_T(e,o,"linePrefix")};function o(o){if(null===o||gT(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function KT(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||fT(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||gT(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(o){return u||null!==o&&41!==o&&!vT(o)?u<c&&40===o?(e.consume(o),u++,p):41===o?(e.consume(o),u--,p):null===o||32===o||40===o||fT(o)?n(o):(e.consume(o),92===o?m:p):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function ZT(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):gT(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||gT(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!yT(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function YT(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):gT(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),_T(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||gT(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function XT(e,t){let n;return function r(o){if(gT(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(yT(o))return _T(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const GT={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return ZT.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=lT(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return vT(t)?XT(e,s)(t):s(t)}function s(t){return KT(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(JT,c,c)(t)}function c(t){return yT(t)?_T(e,u,"whitespace")(t):u(t)}function u(i){return null===i||gT(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},JT={partial:!0,tokenize:function(e,t,n){return function(t){return vT(t)?XT(e,r)(t):n(t)};function r(t){return YT(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return yT(t)?_T(e,i,"whitespace")(t):i(t)}function i(e){return null===e||gT(e)?t(e):n(e)}}};const QT={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return gT(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const eP={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},tT(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||vT(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||gT(n)?(e.exit("atxHeading"),t(n)):yT(n)?_T(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||vT(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const tP=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nP=["pre","script","style","textarea"],rP={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,h):63===s?(e.consume(s),o=3,r.interrupt?t:A):cT(s)?(e.consume(s),a=String.fromCharCode(s),p):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,f):cT(i)?(e.consume(i),o=4,r.interrupt?t:A):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:A):n(o)}function f(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:E:f):n(o)}function h(t){return cT(t)?(e.consume(t),a=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||vT(s)){const l=47===s,c=a.toLowerCase();return l||i||!nP.includes(c)?tP.includes(a.toLowerCase())?(o=6,l?(e.consume(s),m):r.interrupt?t(s):E(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):v(s)):(o=1,r.interrupt?t(s):E(s))}return 45===s||uT(s)?(e.consume(s),a+=String.fromCharCode(s),p):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:E):n(o)}function g(t){return yT(t)?(e.consume(t),g):S(t)}function v(t){return 47===t?(e.consume(t),S):58===t||95===t||cT(t)?(e.consume(t),y):yT(t)?(e.consume(t),v):S(t)}function y(t){return 45===t||46===t||58===t||95===t||uT(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),x):yT(t)?(e.consume(t),b):v(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):yT(t)?(e.consume(t),x):k(t)}function w(t){return t===l?(e.consume(t),l=null,_):null===t||gT(t)?n(t):(e.consume(t),w)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||vT(t)?b(t):(e.consume(t),k)}function _(e){return 47===e||62===e||yT(e)?v(e):n(e)}function S(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||gT(t)?E(t):yT(t)?(e.consume(t),C):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),M):60===t&&1===o?(e.consume(t),j):62===t&&4===o?(e.consume(t),R):63===t&&3===o?(e.consume(t),A):93===t&&5===o?(e.consume(t),P):!gT(t)||6!==o&&7!==o?null===t||gT(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),E):(e.exit("htmlFlowData"),e.check(oP,L,N)(t))}function N(t){return e.check(iP,I,L)(t)}function I(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return null===t||gT(t)?N(t):(e.enter("htmlFlowData"),E(t))}function M(t){return 45===t?(e.consume(t),A):E(t)}function j(t){return 47===t?(e.consume(t),a="",T):E(t)}function T(t){if(62===t){const n=a.toLowerCase();return nP.includes(n)?(e.consume(t),R):E(t)}return cT(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),T):E(t)}function P(t){return 93===t?(e.consume(t),A):E(t)}function A(t){return 62===t?(e.consume(t),R):45===t&&2===o?(e.consume(t),A):E(t)}function R(t){return null===t||gT(t)?(e.exit("htmlFlowData"),L(t)):(e.consume(t),R)}function L(n){return e.exit("htmlFlow"),t(n)}}},oP={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(TT,t,n)}}},iP={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(gT(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const aP={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),x):63===t?(e.consume(t),y):cT(t)?(e.consume(t),_):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,h):cT(t)?(e.consume(t),v):n(t)}function c(t){return 45===t?(e.consume(t),f):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):gT(t)?(a=u,T(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),f):u(t)}function f(e){return 62===e?j(e):45===e?d(e):u(e)}function h(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):gT(t)?(a=p,T(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?j(t):93===t?(e.consume(t),g):p(t)}function v(t){return null===t||62===t?j(t):gT(t)?(a=v,T(t)):(e.consume(t),v)}function y(t){return null===t?n(t):63===t?(e.consume(t),b):gT(t)?(a=y,T(t)):(e.consume(t),y)}function b(e){return 62===e?j(e):y(e)}function x(t){return cT(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||uT(t)?(e.consume(t),w):k(t)}function k(t){return gT(t)?(a=k,T(t)):yT(t)?(e.consume(t),k):j(t)}function _(t){return 45===t||uT(t)?(e.consume(t),_):47===t||62===t||vT(t)?S(t):n(t)}function S(t){return 47===t?(e.consume(t),j):58===t||95===t||cT(t)?(e.consume(t),C):gT(t)?(a=S,T(t)):yT(t)?(e.consume(t),S):j(t)}function C(t){return 45===t||46===t||58===t||95===t||uT(t)?(e.consume(t),C):E(t)}function E(t){return 61===t?(e.consume(t),N):gT(t)?(a=E,T(t)):yT(t)?(e.consume(t),E):S(t)}function N(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,I):gT(t)?(a=N,T(t)):yT(t)?(e.consume(t),N):(e.consume(t),O)}function I(t){return t===o?(e.consume(t),o=void 0,M):null===t?n(t):gT(t)?(a=I,T(t)):(e.consume(t),I)}function O(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||vT(t)?S(t):(e.consume(t),O)}function M(e){return 47===e||62===e||vT(e)?S(e):n(e)}function j(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function T(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),P}function P(t){return yT(t)?_T(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return e.enter("htmlTextData"),a(t)}}};const sP={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&tT(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=nT(i,e.slice(r+1,r+s+3)),i=nT(i,[["enter",u,t]]),i=nT(i,IT(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=nT(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=nT(i,e.slice(o+1)),i=nT(i,[["exit",l,t]]),tT(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(lT(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(lP,c,i?c:u)(t):91===t?e.attempt(cP,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(uP,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},lP={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return vT(t)?XT(e,o)(t):o(t)}function o(t){return 41===t?c(t):KT(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return vT(t)?XT(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?YT(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return vT(t)?XT(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},cP={tokenize:function(e,t,n){const r=this;return function(t){return ZT.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(lT(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},uP={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const dP={name:"labelStartImage",resolveAll:sP.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const fP={name:"labelStartLink",resolveAll:sP.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const hP={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),_T(e,t,"linePrefix")}}};const pP={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||gT(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),yT(t)?_T(e,i,"whitespace")(t):i(t))}}};const mP={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(TT,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_T(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){if(r.containerState.furtherBlankLines||!yT(n))return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n);return r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vP,t,o)(n)});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_T(e,e.attempt(mP,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:hT(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(pP,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return hT(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(TT,r.interrupt?n:c,e.attempt(gP,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return yT(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},gP={partial:!0,tokenize:function(e,t,n){const r=this;return _T(e,function(e){const o=r.events[r.events.length-1];return!yT(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},vP={partial:!0,tokenize:function(e,t,n){const r=this;return _T(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const yP={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),yT(t)?_T(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||gT(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const bP={tokenize:function(e){const t=this,n=e.attempt(TT,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,_T(e,e.attempt(this.parser.constructs.flow,r,e.attempt(WT,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const xP={resolveAll:SP()},wP=_P("string"),kP=_P("text");function _P(e){return{resolveAll:SP("text"===e?CP:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function SP(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function CP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const EP={42:mP,43:mP,45:mP,48:mP,49:mP,50:mP,51:mP,52:mP,53:mP,54:mP,55:mP,56:mP,57:mP,62:PT},NP={91:GT},IP={[-2]:zT,[-1]:zT,32:zT},OP={35:eP,42:pP,45:[yP,pP],60:rP,61:yP,95:pP,96:DT,126:DT},MP={38:RT,92:AT},jP={[-5]:hP,[-4]:hP,[-3]:hP,33:dP,38:RT,42:OT,60:[jT,aP],91:fP,92:[QT,AT],93:sP,95:OT,96:UT},TP={null:[OT,xP]},PP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:NP,disable:{null:[]},document:EP,flow:OP,flowInitial:IP,insideSpan:TP,string:MP,text:jP},Symbol.toStringTag,{value:"Module"}));function AP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:g(function(e,t){v(e,t.from)}),check:g(m),consume:function(e){gT(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,y()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=f(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=f(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,y()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=nT(a,e),h(),null!==a[a.length-1])return[];return v(t,0),c.events=IT(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function f(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function h(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}function p(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,h;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){h=function(){const e=f(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,y()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return v();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,v)(n)}}function g(t){return e(d,h),o}function v(e){return h.restore(),++u<a.length?m(a[u]):i}}}function v(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&tT(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function y(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const RP=/[\0\t\n\r]/g;const LP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DP(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return sT(n.slice(t?2:1),t?16:10)}return eT(n)||e}const zP={}.hasOwnProperty;function FP(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(G),blockQuote:i(q),characterEscape:C,characterReference:C,codeFenced:i(K),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(K,a),codeText:i(Z,a),codeTextData:C,data:C,codeFlowValue:C,definition:i(Y),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(X),hardBreakEscape:i(J),hardBreakTrailing:i(J),htmlFlow:i(Q,a),htmlFlowData:C,htmlText:i(Q,a),htmlTextData:C,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:f,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:F,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(G),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:w,autolink:l(),autolinkEmail:W,autolinkProtocol:H,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:B,characterReferenceMarkerNumeric:B,characterReferenceValue:$,characterReference:V,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:E,codeIndented:l(v),codeText:l(j),codeTextData:E,data:E,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(O),htmlFlowData:E,htmlText:l(M),htmlTextData:E,image:l(P),label:R,labelText:A,lineEnding:N,link:l(T),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:U,resourceDestinationString:L,resourceTitleString:D,resource:z,setextHeading:l(S),setextHeadingLineSequence:_,setextHeadingText:k,strong:l(),thematicBreak:l()}};BP(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];zP.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||VP).call(i,void 0,e[0])}for(r.position={start:UP(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:UP(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:UP(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Nj({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||VP).call(this,e,r[0])}n.position.end=UP(e.end)}function u(){return Xj(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function h(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function y(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=lT(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function x(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function _(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function S(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:UP(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=UP(e.end)}function N(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=UP(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),E.call(this,e))}function I(){this.data.atHardBreak=!0}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function M(){const e=this.resume();this.stack[this.stack.length-1].value=e}function j(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(LP,DP)}(t),n.identifier=lT(t).toLowerCase()}function R(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function L(){const e=this.resume();this.stack[this.stack.length-1].url=e}function D(){const e=this.resume();this.stack[this.stack.length-1].title=e}function z(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function U(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=lT(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function B(e){this.data.characterReferenceType=e.type}function $(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=sT(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=eT(t)}this.stack[this.stack.length-1].value+=r}function V(e){this.stack.pop().position.end=UP(e.end)}function H(e){E.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function W(e){E.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function q(){return{type:"blockquote",children:[]}}function K(){return{type:"code",lang:null,meta:null,value:""}}function Z(){return{type:"inlineCode",value:""}}function Y(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function X(){return{type:"emphasis",children:[]}}function G(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function Q(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!VT(e););return e}(function(e){const t={constructs:oT([PP,...(e||{}).extensions||[]]),content:n(ST),defined:[],document:n(CT),flow:n(bP),lazy:{},string:n(wP),text:n(kP)};return t;function n(e){return function(n){return AP(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,f;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(RP.lastIndex=u,l=RP.exec(o),d=l&&void 0!==l.index?l.index:o.length,f=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===f&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),f){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function UP(e){return{line:e.line,column:e.column,offset:e.offset}}function BP(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?BP(e,r):$P(e,r)}}function $P(e,t){let n;for(n in t)if(zP.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function VP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Nj({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Nj({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Nj({start:t.start,end:t.end})+") is still open")}function HP(e){const t=this;t.parser=function(n){return FP(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function WP(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function qP(e){const t=e.spread;return null==t?e.children.length>1:t}function KP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(ZP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(ZP(t.slice(o),o>0,!1)),i.join("")}function ZP(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const YP={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=kT(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WP(e,t);const o={src:kT(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:kT(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WP(e,t);const o={href:kT(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:kT(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=qP(n[r])}return t}(n):qP(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=Cj(t.children[1]),a=Sj(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:KP(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:XP,yaml:XP,definition:XP,footnoteDefinition:XP};function XP(){}const GP="object"==typeof self?self:globalThis,JP=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new GP[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new GP[i](a),o)};return r})(new Map,e)(0),QP="",{toString:eA}={},{keys:tA}=Object,nA=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=eA.call(e).slice(8,-1);switch(n){case"Array":return[1,QP];case"Object":return[2,QP];case"Date":return[3,QP];case"RegExp":return[4,QP];case"Map":return[5,QP];case"Set":return[6,QP];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},rA=([e,t])=>0===e&&("function"===t||"symbol"===t),oA=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=nA(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const n of r)e.push(i(n));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of tA(r))!e&&rA(nA(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[o,a]of r)(e||!rA(nA(o))&&!rA(nA(a)))&&t.push([i(o),i(a)]);return n}case 6:{const t=[],n=o([a,t],r);for(const o of r)!e&&rA(nA(o))||t.push(i(o));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},iA="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?JP(oA(e,t)):structuredClone(e):(e,t)=>JP(oA(e,t));function aA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function sA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const lA=function(e){if(null==e)return uA;if("function"==typeof e)return cA(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=lA(e[n]);return cA(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return cA(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return cA(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function cA(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function uA(){return!0}const dA=[],fA=!0,hA=!1;function pA(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=lA(o),a=r?-1:1;!function e(o,s,l){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,f=dA;if((!t||i(o,s,l[l.length-1]||void 0))&&(f=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[fA,e];return null==e?dA:[e]}(n(o,l)),f[0]===hA))return f;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==f[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===hA)return c;u="number"==typeof c[1]?c[1]:u+a}}return f}}(e,void 0,[])()}function mA(e,t,n,r){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=r),pA(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}const gA={}.hasOwnProperty,vA={};function yA(e,t){e.position&&(t.position=function(e){const t=Cj(e),n=Sj(e);if(t&&n)return{start:t,end:n}}(e))}function bA(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,iA(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function xA(e,t){const n=t.data||{},r=!("value"in t)||gA.call(n,"hProperties")||gA.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function wA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function kA(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function _A(e,t){const n=function(e,t){const n=t||vA,r=new Map,o=new Map,i=new Map,a={...YP,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=kA(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=kA(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:bA,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(gA.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=iA(n);return r.children=s.all(e),r}return iA(e)}return(s.options.unknownHandler||xA)(s,e,t)},options:n,patch:yA,wrap:wA};return mA(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||aA,r=e.options.footnoteBackLabel||sA,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),c=kT(a.toLowerCase());let u=0;const d=[],f=e.footnoteCounts.get(a);for(;void 0!==f&&++u<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){const e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...iA(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function SA(e,t){return e&&"run"in e?async function(n,r){const o=_A(n,{file:r,...t});await e.run(o,r)}:function(n,r){return _A(n,{file:r,...e||t})}}function CA(e){if(e)throw e}var EA=Object.prototype.hasOwnProperty,NA=Object.prototype.toString,IA=Object.defineProperty,OA=Object.getOwnPropertyDescriptor,MA=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===NA.call(e)},jA=function(e){if(!e||"[object Object]"!==NA.call(e))return!1;var t,n=EA.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&EA.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||EA.call(e,t)},TA=function(e,t){IA&&"__proto__"===t.name?IA(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},PA=function(e,t){if("__proto__"===t){if(!EA.call(e,t))return;if(OA)return OA(e,t).value}return e[t]};const AA=r(function e(){var t,n,r,o,i,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=PA(s,n),s!==(o=PA(t,n))&&(u&&o&&(jA(o)||(i=MA(o)))?(i?(i=!1,a=r&&MA(r)?r:[]):a=r&&jA(r)?r:{},TA(s,{name:n,newValue:e(u,a,o)})):void 0!==o&&TA(s,{name:n,newValue:o}));return s});function RA(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function LA(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let s;r&&t.push(o);try{s=e.apply(this,t)}catch(i){if(r&&n)throw i;return o(i)}r||(s&&s.then&&"function"==typeof s.then?s.then(a,o):s instanceof Error?o(s):a(s))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const DA={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');zA(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(zA(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){zA(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)zA(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){zA(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function zA(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const FA={cwd:function(){return"/"}};function UA(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function BA(e){if("string"==typeof e)e=new URL(e);else if(!UA(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const $A=["history","path","basename","stem","extname","dirname"];class VA{constructor(e){let t;t=e?UA(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":FA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<$A.length;){const e=$A[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)$A.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?DA.basename(this.path):void 0}set basename(e){WA(e,"basename"),HA(e,"basename"),this.path=DA.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?DA.dirname(this.path):void 0}set dirname(e){qA(this.basename,"dirname"),this.path=DA.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?DA.extname(this.path):void 0}set extname(e){if(HA(e,"extname"),qA(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=DA.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){UA(e)&&(e=BA(e)),WA(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?DA.basename(this.path,this.extname):void 0}set stem(e){WA(e,"stem"),HA(e,"stem"),this.path=DA.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new jj(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function HA(e,t){if(e&&e.includes(DA.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+DA.sep+"`")}function WA(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qA(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const KA=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},ZA={}.hasOwnProperty;class YA extends KA{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=LA()}copy(){const e=new YA;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(AA(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(QA("data",this.frozen),this.namespace[e]=t,this):ZA.call(this.namespace,e)&&this.namespace[e]||void 0:e?(QA("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=nR(e),n=this.parser||this.Parser;return GA("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),GA("process",this.parser||this.Parser),JA("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=nR(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);!function(e){return"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)}(i)?r.result=i:r.value=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),GA("processSync",this.parser||this.Parser),JA("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,CA(e),t=r}),tR("processSync","process",n),t}run(e,t,n){eR(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=nR(t);r.run(e,a,function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){CA(e),n=t,r=!0}),tR("runSync","run",r),n}stringify(e,t){this.freeze();const n=nR(t),r=this.compiler||this.Compiler;return JA("stringify",r),eR(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(QA("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=AA(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];RA(a)&&RA(r)&&(r=AA(!0,a,r)),n[o]=[e,r,...i]}}}}const XA=(new YA).freeze();function GA(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function JA(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function QA(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function eR(e){if(!RA(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function tR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nR(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new VA(e)}const rR=[],oR={allowDangerousHtml:!0},iR=/^(https?|ircs?|mailto|xmpp)$/i,aR=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function sR(e){const t=function(e){const t=e.rehypePlugins||rR,n=e.remarkPlugins||rR,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...oR}:oR,o=XA().use(HP).use(n).use(SA,r).use(t);return o}(e),n=function(e){const t=e.children||"",n=new VA;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||lR;for(const u of aR)Object.hasOwn(t,u.from)&&dM((u.from,u.to&&u.to,u.id));return mA(e,c),zj(e,{Fragment:G.Fragment,components:o,ignoreInvalidStyle:!0,jsx:G.jsx,jsxs:G.jsxs,passKeys:!0,passNode:!0});function c(e,t,o){if("raw"===e.type&&o&&"number"==typeof t)return a?o.children.splice(t,1):o.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Zj)if(Object.hasOwn(Zj,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Zj[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let a=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&r&&"number"==typeof t&&(a=!r(e,t,o)),a&&o&&"number"==typeof t)return s&&e.children?o.children.splice(t,1,...e.children):o.children.splice(t,1),t}}}(t.runSync(t.parse(n),n),e)}function lR(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||iR.test(e.slice(0,t))?e:""}function cR(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function uR(e,t,n){const r=lA((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([dR(e[0]),fR(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)pA(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],a=o[i][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,o={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function dR(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function fR(e){return"function"==typeof e?e:function(){return e}}const hR="phrasing",pR=["autolink","link","image","label"];function mR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gR(e){this.config.enter.autolinkProtocol.call(this,e)}function vR(e){this.config.exit.autolinkProtocol.call(this,e)}function yR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function bR(e){this.config.exit.autolinkEmail.call(this,e)}function xR(e){this.exit(e)}function wR(e){uR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_R]],{ignore:["link","linkReference"]})}function kR(e,t,n,r,o){let i="";if(!SR(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=cR(e,"(");let i=cR(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function _R(e,t,n,r){return!(!SR(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function SR(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||xT(n)||bT(n))&&(!t||47!==n)}function CR(){this.buffer()}function ER(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function NR(){this.buffer()}function IR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function OR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function MR(e){this.exit(e)}function jR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=lT(this.sliceSerialize(e)).toLowerCase(),n.label=t}function TR(e){this.exit(e)}function PR(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function AR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let a=i.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?LR:RR)));return s(),a},footnoteReference:PR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function RR(e,t,n){return 0===t?e:LR(e,t,n)}function LR(e,t,n){return(n?"":" ")+e}PR.peek=function(){return"["};const DR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function zR(e){this.enter({type:"delete",children:[]},e)}function FR(e){this.exit(e)}function UR(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function BR(e){return e.length}function $R(e){return null==e?"":String(e)}function VR(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function HR(e,t,n){return">"+(n?"":" ")+e}function WR(e,t){return qR(e,t.inConstruct,!0)&&!qR(e,t.notInConstruct,!1)}function qR(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function KR(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&WR(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function ZR(e,t,n){return(n?"":" ")+e}function YR(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XR(e){return"&#x"+e.toString(16).toUpperCase()+";"}function GR(e,t,n){const r=NT(e),o=NT(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function JR(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=GR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=XR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=GR(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+XR(d));const h=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+h}function QR(e){return e.value||""}function eL(e,t,n,r){const o=YR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function tL(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function nL(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function rL(e,t){const n=Xj(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function oL(e,t,n,r){const o=YR(n),i='"'===o?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(rL(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function iL(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function aL(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function sL(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}UR.peek=function(){return"~"},JR.peek=function(e,t,n){return n.options.emphasis||"*"},QR.peek=function(){return"<"},eL.peek=function(){return"!"},tL.peek=function(){return"!"},nL.peek=function(){return"`"},oL.peek=function(e,t,n){return rL(e,n)?"<":"["},iL.peek=function(){return"["};const lL=lA(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cL(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=GR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=XR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=GR(r.after.charCodeAt(0),d,o);f.inside&&(l=l.slice(0,-1)+XR(d));const h=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+l+h}cL.peek=function(e,t,n){return n.options.strong||"*"};const uL={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),HR);return o(),a},break:KR,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,ZR);return e(),t}const s=n.createTracker(r),l=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),i&&(u+=s.move(i+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const o=YR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c},emphasis:JR,hardBreak:KR,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return mA(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,hA}),Boolean((!e.depth||e.depth<3)&&Xj(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===o?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=XR(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:QR,image:eL,imageReference:tL,inlineCode:nL,link:oL,linkReference:iL,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):aL(n);const s=e.ordered?"."===a?")":".":function(e){const t=aL(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),sL(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||aL(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?i:i+" ".repeat(a-i.length))+e});return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a},root:function(e,t,n,r){return(e.children.some(function(e){return lL(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:cL,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(sL(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function dL(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function fL(e){this.exit(e),this.data.inTable=void 0}function hL(e){this.enter({type:"tableRow",children:[]},e)}function pL(e){this.exit(e)}function mL(e){this.enter({type:"tableCell",children:[]},e)}function gL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vL));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vL(e,t){return"|"===t?t:e}function yL(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=uL.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const o=s([l(e,n,r)]);return o.slice(0,o.indexOf("\n"))}}};function a(e,t,n,r){const o=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return a(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||BR,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=$R(e[u][i]);if(!1!==n.alignDelimiters){const e=o(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)i[d]=VR(r[d]);else{const e=VR(r);for(;++d<c;)i[d]=e}d=-1;const f=[],h=[];for(;++d<c;){const e=i[d];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,l[d]-t.length-r.length);const a=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>l[d]&&(l[d]=o),h[d]=o),f[d]=a}a.splice(1,0,f),s.splice(1,0,h),u=-1;const p=[];for(;++u<a.length;){const e=a[u],t=s[u];d=-1;const r=[];for(;++d<c;){const o=e[d]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[d]-(t[d]||0),n=i[d];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!d||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&d===c-1||r.push("|")}p.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return p.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=a(r[o],0,t,n);return s(),i}}function bL(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function xL(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wL(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=uL.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+a})),l}const kL={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},_L={tokenize:function(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(CL,l,s)(t):null===t||vT(t)||xT(t)||45!==t&&bT(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},SL={tokenize:function(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(CL,t,i)(a):null===a||vT(a)||xT(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},CL={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||vT(a)||xT(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||vT(e)||xT(e)?t(e):r(e)}function i(e){return cT(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):cT(t)?(e.consume(t),a):n(t)}},partial:!0},EL={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return uT(e)?n(e):t(e)}},partial:!0},NL={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!TL.call(r,r.previous)||LL(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kL,e.attempt(_L,e.attempt(SL,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:TL},IL={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&PL.call(r,r.previous)&&!LL(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(cT(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||fT(t)||vT(t)||xT(t)||bT(t)?n(t):e.attempt(_L,e.attempt(SL,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:PL},OL={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!RL(t)||!AL.call(r,r.previous)||LL(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return RL(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(EL,c,l)(t):45===t||95===t||uT(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&cT(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:AL},ML={};let jL=48;for(;jL<123;)ML[jL]=OL,jL++,58===jL?jL=65:91===jL&&(jL=97);function TL(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||vT(e)}function PL(e){return!cT(e)}function AL(e){return!(47===e||RL(e))}function RL(e){return 43===e||45===e||46===e||95===e||uT(e)}function LL(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}ML[43]=OL,ML[45]=OL,ML[46]=OL,ML[95]=OL,ML[72]=[OL,IL],ML[104]=[OL,IL],ML[87]=[OL,NL],ML[119]=[OL,NL];const DL={tokenize:function(e,t,n){const r=this;return _T(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function zL(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=lT(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function FL(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function UL(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||vT(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(lT(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return vT(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function BL(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||vT(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=lT(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return vT(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),_T(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function $L(e,t,n){return e.check(TT,t,e.attempt(DL,t,n))}function VL(e){e.exit("gfmFootnoteDefinition")}function HL(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let a=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const l=NT(o);if(126===i)return a>1?r(i):(e.consume(i),a++,s);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=NT(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&tT(a,a.length,0,IT(s,e.slice(r+1,n),t)),tT(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),tT(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class WL{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function qL(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function KL(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?x:s;if(i===x&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):gT(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):yT(t)?_T(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||vT(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,yT(t)?_T(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t))}function f(t){return 45===t||58===t?p(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):b(t)}function h(t){return yT(t)?_T(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||gT(t)?y(t):b(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):b(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),v):(e.exit("tableDelimiterFiller"),v(t))}function v(t){return yT(t)?_T(e,y,"whitespace")(t):y(t)}function y(n){return 124===n?f(n):(null===n||gT(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):b(n)}function b(e){return n(e)}function x(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||gT(n)?(e.exit("tableRow"),t(n)):yT(n)?_T(e,w,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||vT(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?_:k)}function _(t){return 92===t||124===t?(e.consume(t),k):k(t)}}function ZL(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const f=new WL;for(;++i<e.length;){const h=e[i],p=h[1];"enter"===h[0]?"tableHead"===p.type?(u=!1,0!==d&&(XL(f,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(i,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===p.type?2:r?3:1):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type?"tableCellDivider"===p.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=YL(f,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=YL(f,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===p.type?(u=!0,d=i):"tableRow"===p.type||"tableDelimiterRow"===p.type?(d=i,0!==l[1]?(c[0]=c[1],o=YL(f,t,l,s,i,o)):0!==c[1]&&(o=YL(f,t,c,s,i,o)),s=0):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type||(c[3]=i)}for(0!==d&&XL(f,t,d,n,r),f.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=qL(t.events,i))}return e}function YL(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},GL(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=GL(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=GL(t.events,n[2]),i=GL(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},GL(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function XL(e,t,n,r,o){const i=[],a=GL(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function GL(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const JL={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return vT(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return gT(r)?t(r):yT(r)?e.check({tokenize:QL},t,n)(r):n(r)}}};function QL(e,t,n){return _T(e,function(e){return null===e?n(e):t(e)},"whitespace")}const eD={};function tD(e){const t=e||eD,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return oT([{text:ML},{document:{91:{name:"gfmFootnoteDefinition",tokenize:BL,continuation:{tokenize:$L},exit:VL}},text:{91:{name:"gfmFootnoteCall",tokenize:UL},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zL,resolveTo:FL}}},HL(e),{flow:{null:{name:"table",tokenize:KL,resolveAll:ZL}}},{text:{91:JL}}])}(t)),o.push([{transforms:[wR],enter:{literalAutolink:mR,literalAutolinkEmail:gR,literalAutolinkHttp:gR,literalAutolinkWww:gR},exit:{literalAutolink:xR,literalAutolinkEmail:bR,literalAutolinkHttp:vR,literalAutolinkWww:yR}},{enter:{gfmFootnoteCallString:CR,gfmFootnoteCall:ER,gfmFootnoteDefinitionLabelString:NR,gfmFootnoteDefinition:IR},exit:{gfmFootnoteCallString:OR,gfmFootnoteCall:MR,gfmFootnoteDefinitionLabelString:jR,gfmFootnoteDefinition:TR}},{canContainEols:["delete"],enter:{strikethrough:zR},exit:{strikethrough:FR}},{enter:{table:dL,tableData:mL,tableHeader:mL,tableRow:hL},exit:{codeText:gL,table:fL,tableData:pL,tableHeader:pL,tableRow:pL}},{exit:{taskListCheckValueChecked:bL,taskListCheckValueUnchecked:bL,paragraph:xL}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:hR,notInConstruct:pR},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:hR,notInConstruct:pR},{character:":",before:"[ps]",after:"\\/",inConstruct:hR,notInConstruct:pR}]},AR(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:DR}],handlers:{delete:UR}},yL(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wL}}]}}(t))}const nD={h1:({children:e})=>G.jsx("h1",{className:"mb-4 mt-6 text-xl font-bold tracking-tight first:mt-0 last:mb-0",children:e}),h2:({children:e})=>G.jsx("h2",{className:"mb-3 mt-5 text-lg font-semibold tracking-tight first:mt-0 last:mb-0",children:e}),h3:({children:e})=>G.jsx("h3",{className:"mb-2 mt-4 text-base font-semibold tracking-tight first:mt-0 last:mb-0",children:e}),p:({children:e})=>G.jsx("p",{className:"my-4 leading-relaxed text-inherit first:mt-0 last:mb-0",children:e}),ul:({children:e})=>G.jsx("ul",{className:"my-4 ml-5 list-disc space-y-2 first:mt-0 last:mb-0",children:e}),ol:({children:e})=>G.jsx("ol",{className:"my-4 ml-5 list-decimal space-y-2 first:mt-0 last:mb-0",children:e}),li:({children:e})=>G.jsx("li",{className:"leading-relaxed text-inherit",children:e}),blockquote:({children:e})=>G.jsx("blockquote",{className:"my-4 border-l-2 border-border-default pl-4 italic text-secondary first:mt-0 last:mb-0",children:e}),a:({href:e,children:t})=>G.jsx("a",{href:e,className:"font-medium text-blue-600 dark:text-blue-400 underline underline-offset-2 hover:text-blue-800 dark:text-blue-400",children:t}),code:({className:e,children:t})=>!e?G.jsx("code",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-sm font-medium text-primary",children:t}):G.jsx("code",{className:e,children:t}),pre:({children:e})=>G.jsx("pre",{className:"my-4 overflow-x-auto rounded-lg bg-primary p-3 text-sm text-gray-100 first:mt-0 last:mb-0",children:e}),strong:({children:e})=>G.jsx("strong",{className:"font-semibold",children:e}),em:({children:e})=>G.jsx("em",{className:"italic",children:e}),hr:()=>G.jsx("hr",{className:"my-4 border-border-default"}),table:({children:e})=>G.jsx("div",{className:"my-4 overflow-x-auto first:mt-0 last:mb-0",children:G.jsx("table",{className:"min-w-full divide-y divide-border-default text-sm",children:e})}),th:({children:e})=>G.jsx("th",{className:"bg-surface-subtle px-3 py-2 text-left font-semibold text-primary",children:e}),td:({children:e})=>G.jsx("td",{className:"border-b border-border-default px-3 py-2",children:e})},rD=({agent:e,initialIdentity:t="",onIdentityChange:n,onMessageSent:r,mode:o="portal",customEndpoint:i})=>{const a={trackDashboardView:()=>cM(),trackDashboardRefresh:()=>cM(),trackDashboardExport:()=>cM(),trackMetricCardClick:e=>cM(),trackAlertAction:(e,t)=>cM(),trackAgentListViewed:()=>cM(),trackAgentCreated:e=>cM(),trackAgentUpdated:(e,t)=>cM(),trackAgentDeleted:e=>cM(),trackAgentViewed:(e,t)=>cM(),trackAgentSearch:e=>cM(),trackAgentFilter:(e,t)=>cM(),trackAgentViewModeChanged:e=>cM(),trackAgentDetailTabChanged:(e,t)=>cM(),trackAgentTestStarted:(e,t)=>cM(),trackAgentTestMessageSent:(e,t)=>cM(),trackAgentTestCompleted:(e,t)=>cM(),trackAgentCodeEdited:e=>cM(),trackAgentTriggerCreated:(e,t)=>cM(),trackAgentMemoryAccessed:e=>cM(),trackAgentMetricsViewed:e=>cM(),trackAgentObservabilityViewed:e=>cM(),trackConnectorsListViewed:()=>cM(),trackConnectorTemplateViewed:(e,t)=>cM(),trackConnectorInstanceCreated:(e,t)=>cM(),trackConnectorInstanceDeleted:e=>cM(),trackConnectorDetailViewed:e=>cM(),trackConnectorTabChanged:(e,t)=>cM(),trackConnectorResourceCreated:(e,t)=>cM(),trackConnectorResourceUpdated:(e,t)=>cM(),trackConnectorResourceDeleted:(e,t)=>cM(),trackConnectorResourceTested:(e,t)=>cM(),trackConnectorSearch:e=>cM(),trackDataSourcesListViewed:()=>cM(),trackDataSourceCreated:(e,t)=>cM(),trackDataSourceUpdated:e=>cM(),trackDataSourceDeleted:(e,t)=>cM(),trackDataSourceViewed:e=>cM(),trackDataSourceConnectionTested:(e,t)=>cM(),trackDataSourceSynced:e=>cM(),trackCredentialsListViewed:()=>cM(),trackCredentialCreated:e=>cM(),trackCredentialUpdated:e=>cM(),trackCredentialDeleted:e=>cM(),trackCredentialViewed:e=>cM(),trackPromptsListViewed:()=>cM(),trackPromptCreated:e=>cM(),trackPromptUpdated:e=>cM(),trackPromptDeleted:e=>cM(),trackPromptViewed:e=>cM(),trackTriggersListViewed:()=>cM(),trackTriggerCreated:(e,t)=>cM(),trackTriggerUpdated:e=>cM(),trackTriggerDeleted:e=>cM(),trackTriggerViewed:e=>cM(),trackTriggerActivated:e=>cM(),trackTriggerDeactivated:e=>cM(),trackVectorSearchViewed:()=>cM(),trackVectorSearchPerformed:(e,t)=>cM(),trackKnowledgeBaseViewed:()=>cM(),trackAdminDashboardViewed:()=>cM(),trackTenantCreated:e=>cM(),trackTenantUpdated:e=>cM(),trackUserAccessGranted:(e,t)=>cM(),trackUserAccessRevoked:(e,t)=>cM(),trackProfileViewed:()=>cM(),trackProfileUpdated:()=>cM(),trackDocumentationViewed:()=>cM(),trackNavigationClick:(e,t)=>cM(),trackSidebarToggled:e=>cM()},[s,l]=$.useState([]),[c,u]=$.useState(""),[d,f]=$.useState(t),[h,p]=$.useState(!1),[m,g]=$.useState("disconnected"),[v,y]=$.useState(!1),[b,x]=$.useState(!1),[w,k]=$.useState(!1),[_,S]=$.useState("fields"),[C,E]=$.useState(null),[N,I]=$.useState([{key:"",value:""}]),[O,M]=$.useState('{\n "metadata": {\n "email": ""\n }\n}'),[j,T]=$.useState(null),[P,A]=$.useState(!1),R=$.useRef(null),L=$.useRef(null),D=$.useRef(null),z=$.useRef(null),F=$.useCallback(()=>{const e={};return N.forEach(({key:t,value:n})=>{t.trim()&&(e[t.trim()]=n)}),e},[N]),U=$.useCallback(e=>{try{if(!e.trim())return[{key:"",value:""}];const t=JSON.parse(e),n=t&&"object"==typeof t&&t.metadata&&"object"==typeof t.metadata?t.metadata:t;if(!n||"object"!=typeof n||Array.isArray(n))return[{key:"",value:""}];const r=Object.entries(n).map(([e,t])=>({key:e,value:"string"==typeof t?t:null==t?"":JSON.stringify(t)}));return r.length>0?r:[{key:"",value:""}]}catch{return N}},[N]),B=$.useCallback(e=>{if(e!==_){if("json"===e){const e=F();M(JSON.stringify({metadata:e},null,2))}else I(U(O));S(e)}},[_,F,U,O]);$.useEffect(()=>()=>{z.current&&clearInterval(z.current)},[]);const V=(e=!1)=>{var t;!e&&P||null==(t=R.current)||t.scrollIntoView({behavior:"smooth"})};$.useEffect(()=>{P||V()},[s,P]),$.useEffect(()=>{g("testing"),H()},[e.id,e.endpointUrl,i]);const H=async(e=3,t=2e3)=>{let n=0;for(;n<e;){n++,n>1&&(l([{id:"1",type:"system",content:`🔄 Connecting to agent... (Attempt ${n}/${e})\n\nWaiting for server to be ready...`,timestamp:(new Date).toISOString()}]),await new Promise(e=>setTimeout(e,t)));if(await W())return;if(n===e)return}};$.useEffect(()=>{n&&d!==t&&n(d)},[d,n,t]);const W=async()=>{let t;if(t=i?`${i}/api/v1/agents/execute`:e.endpointUrl,!t)return l([{id:"1",type:"error",content:`❌ **Configuration Error**\n\nAgent "${e.name}" doesn't have an endpoint URL configured.`,timestamp:(new Date).toISOString()}]),g("disconnected"),!1;try{return g("connected"),l([{id:"1",type:"system",content:"✅ Connected to agent. Ready to receive messages."+(i?`\n\n**Local Mode:** ${t}`:""),timestamp:(new Date).toISOString()}]),!0}catch(kE){return g("disconnected"),l([{id:"1",type:"error",content:`❌ **Connection Failed**\n\nCouldn't connect to agent "${e.name}".\n\n**Endpoint:** ${t}\n**Error:** ${kE instanceof Error?kE.message:"Unknown error"}`,timestamp:(new Date).toISOString()}]),!1}},q=(e,t)=>({memory_load:"carregando memória",memory_save:"salvando contexto",tool_call:t?`usando ${t}`:"usando ferramenta",tool_result:"processando",rag_search:"buscando informações"}[e]||"pensando"),K=async()=>{if(!c.trim()||h||"connected"!==m)return;z.current&&(clearInterval(z.current),z.current=null,T(null)),A(!1);const t={id:Date.now().toString(),type:"user",content:c,timestamp:(new Date).toISOString()};a.trackAgentTestMessageSent(e.id,c.length),l(e=>[...e,t]);const n=c;let o;if(u(""),p(!0),w){o=(Date.now()+1).toString();const e={id:o,type:"agent",content:"",timestamp:(new Date).toISOString(),thinkingStatus:null};l(t=>[...t,e])}try{if(w)await(async(t,n=null,r)=>{var o,a,s;let c;if(i)c=`${i}/api/v1/agents/execute/stream`;else{const t=new URL(e.endpointUrl);t.pathname=t.pathname.replace(/\/?$/,"/stream"),c=t.toString()}let u={};if("json"===_)try{O.trim()&&(u=JSON.parse(O))}catch(kE){throw new Error(`Invalid JSON in metadata: ${kE instanceof Error?kE.message:"Parse error"}`)}else u=F();const f={message:t,...u};D.current=new AbortController;const h={"Content-Type":"application/json",Accept:"text/event-stream"};n&&(h["X-Session-Id"]=n),d&&(h["X-Thread-Id"]=d);try{const e=await fetch(c,{method:"POST",headers:h,body:JSON.stringify(f),signal:D.current.signal});if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);const t=e.headers.get("x-session-id");t&&E(t);const n=null==(o=e.body)?void 0:o.getReader();if(!n)throw new Error("Response body is not readable");const i=new TextDecoder;let u="",d="";const m=r||(Date.now()+1).toString();if(r)l(e=>e.map(e=>e.id===m?{...e,rawRequest:f}:e));else{const e={id:m,type:"agent",content:"",timestamp:(new Date).toISOString(),rawRequest:f,thinkingStatus:null};l(t=>[...t,e])}for(;;){const{done:e,value:t}=await n.read();if(e)break;u+=i.decode(t,{stream:!0});const r=u.split("\n");u=r.pop()||"";for(const n of r)if(n.startsWith("data: ")){const e=n.slice(6);if("[DONE]"===e)continue;try{const t=JSON.parse(e);if("content"===t.type)d+=t.data.content,l(e=>e.map(e=>e.id===m?{...e,content:d}:e));else if("internal_process"===t.type){const e=t.data;if("started"===e.status){const t=q(e.processType,null==(a=e.process)?void 0:a.name);l(e=>e.map(e=>e.id===m?{...e,thinkingStatus:t}:e))}else"completed"===e.status&&l(e=>e.map(e=>e.id===m?{...e,thinkingStatus:null}:e))}else if("done"===t.type){l(e=>e.map(e=>e.id===m?{...e,content:t.data.message||d,metadata:t.data.metadata,rawResponse:t.data}:e));const e=t.data.sessionId||t.data.session_id||t.data["x-session-id"]||(null==(s=t.data.metadata)?void 0:s.sessionId);e&&E(e)}else if("error"===t.type)throw new Error(t.data.error)}catch(p){}}}}catch(kE){if(kE instanceof Error&&"AbortError"===kE.name)throw new Error("Request cancelled by user");throw kE}})(n,C,o);else{const t=await(async(t,n=null)=>{var r;let o;if(o=i?`${i}/api/v1/agents/execute`:e.newEngine?e.endpointUrl.replace("executions","executor"):e.endpointUrl,!o)return{content:"",error:"Endpoint URL not configured"};let a={};if("ping"!==t)if("json"===_)try{O.trim()&&(a=JSON.parse(O))}catch(kE){return{content:"",error:`Invalid JSON in metadata: ${kE instanceof Error?kE.message:"Parse error"}`,rawRequest:{message:t,metadata_error:O},rawResponse:null}}else a=F();const s="ping"===t?{message:t}:{message:t,...a};try{const e=Date.now(),i={"Content-Type":"application/json"};n&&"ping"!==t&&(i["X-Session-Id"]=n),d&&"ping"!==t&&(i["X-Thread-Id"]=d),D.current=new AbortController;const a=await fetch(o,{method:"POST",headers:i,body:JSON.stringify(s),signal:D.current.signal});if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const l="ping"!==t?a.headers.get("x-session-id"):void 0,c=await a.json(),u=c.processingTime||(null==(r=c.metadata)?void 0:r.processingTime)||Date.now()-e,f=c.sessionId||c.session_id||c["x-session-id"];let h="";return h="string"==typeof c?c:c.response?"string"==typeof c.response?c.response:JSON.stringify(c.response,null,2):c.message?"string"==typeof c.message?c.message:"object"==typeof c.message&&c.message.output?c.message.output:JSON.stringify(c.message,null,2):c.content?"string"==typeof c.content?c.content:JSON.stringify(c.content,null,2):JSON.stringify(c,null,2),{content:h,metadata:{processingTime:u,...c.metadata},rawRequest:s,rawResponse:c,sessionId:l||f||void 0}}catch(kE){return kE instanceof Error&&"AbortError"===kE.name?{content:"",error:"Request cancelled by user",rawRequest:s,rawResponse:null}:{content:"",error:kE instanceof Error?kE.message:"Error communicating with agent",rawRequest:s,rawResponse:null}}})(n,C);if(t.error){const e={id:(Date.now()+1).toString(),type:"error",content:`❌ **Communication Error**\n\n${t.error}`,timestamp:(new Date).toISOString(),rawRequest:t.rawRequest,rawResponse:t.rawResponse};l(t=>[...t,e])}else{t.sessionId&&E(t.sessionId);((e,t,n,r,o)=>{z.current&&clearInterval(z.current);const i=t.split(/(\s+)/);let a=0,s="";T(e);const c={id:e,type:"agent",content:"",timestamp:(new Date).toISOString(),thinkingStatus:"digitando"};l(e=>[...e,c]),z.current=setInterval(()=>{a<i.length?(s+=i[a],a++,l(t=>t.map(t=>t.id===e?{...t,content:s,thinkingStatus:(i.length,null)}:t))):(z.current&&(clearInterval(z.current),z.current=null),T(null),l(i=>i.map(i=>i.id===e?{...i,content:t,metadata:n,rawRequest:r,rawResponse:o,thinkingStatus:null}:i)))},25+15*Math.random())})((Date.now()+1).toString(),t.content,t.metadata,t.rawRequest,t.rawResponse)}}r&&r()}catch(kE){const t={id:(Date.now()+1).toString(),type:"error",content:`❌ **Unexpected Error**\n\n${kE instanceof Error?kE.message:"Unknown error"}`,timestamp:(new Date).toISOString()};l(e=>[...e,t])}finally{p(!1),D.current=null}},Z=(e,t,n)=>{const r=[...N];r[e][t]=n,I(r)},Y="connected"===m?[{label:"Hello, how can you help?",value:"Hello, how can you help?"},{label:"What's your purpose?",value:"What's your purpose?"},{label:"Give me an example",value:"Give me an example"}]:[];return G.jsxs("div",{className:"flex flex-col h-full bg-surface",children:[G.jsx("div",{className:"px-4 py-3 border-b border-border-default flex-shrink-0",children:G.jsxs("div",{className:"flex items-center justify-between mb-3",children:[G.jsx("h3",{className:"text-sm font-semibold text-primary",children:"Test Agent"}),G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx("button",{onClick:()=>k(!w),className:"p-1.5 rounded transition-colors "+(w?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-secondary hover:text-secondary hover:bg-surface-hover"),title:w?"Streaming Enabled":"Streaming Disabled",children:G.jsx(wm,{className:"h-3.5 w-3.5"})}),G.jsx("button",{onClick:()=>x(!b),className:"p-1.5 rounded transition-colors "+(b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-secondary hover:text-secondary hover:bg-surface-hover"),title:"Debug Mode",children:G.jsx(em,{className:"h-3.5 w-3.5"})}),G.jsx("button",{onClick:()=>y(!v),className:"p-1.5 rounded transition-colors "+(v?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-secondary hover:text-secondary hover:bg-surface-hover"),title:"Advanced Settings",children:G.jsx(gm,{className:"h-3.5 w-3.5"})})]})]})}),v&&G.jsxs("div",{className:"border-b border-border-default p-3 bg-surface-subtle flex-shrink-0 max-h-48 overflow-y-auto",children:[G.jsxs("div",{className:"flex items-center justify-between mb-2",children:[G.jsx("h4",{className:"text-xs font-medium text-primary",children:"Custom Metadata"}),G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx("button",{type:"button",onClick:()=>B("fields"),className:"px-2 py-0.5 text-xs rounded transition-colors "+("fields"===_?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 border border-blue-300":"bg-surface text-secondary border border-border-default hover:bg-surface-subtle"),children:"Fields"}),G.jsx("button",{type:"button",onClick:()=>B("json"),className:"px-2 py-0.5 text-xs rounded transition-colors "+("json"===_?"bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400 border border-blue-300":"bg-surface text-secondary border border-border-default hover:bg-surface-subtle"),children:"JSON"})]})]}),"fields"===_?G.jsxs("div",{className:"space-y-1.5",children:[N.map((e,t)=>G.jsxs("div",{className:"flex items-center space-x-2",children:[G.jsx("input",{type:"text",placeholder:"Key",value:e.key,onChange:e=>Z(t,"key",e.target.value),className:"flex-1 px-2 py-1 text-xs border bg-surface text-primary border-border-default rounded focus:outline-none focus:ring-1 focus:ring-blue-500"}),G.jsx("input",{type:"text",placeholder:"Value",value:e.value,onChange:e=>Z(t,"value",e.target.value),className:"flex-1 px-2 py-1 text-xs border bg-surface text-primary border-border-default rounded focus:outline-none focus:ring-1 focus:ring-blue-500"}),N.length>1&&G.jsx("button",{type:"button",onClick:()=>(e=>{N.length>1&&I(N.filter((t,n)=>n!==e))})(t),className:"text-red-500 hover:text-red-700 dark:text-red-400 p-1",children:G.jsx(vm,{className:"h-3 w-3"})})]},t)),G.jsxs("button",{type:"button",onClick:()=>{I([...N,{key:"",value:""}])},className:"inline-flex items-center text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:text-blue-400",children:[G.jsx(fm,{className:"h-3 w-3 mr-1"}),"Add field"]})]}):G.jsx("div",{className:"space-y-1.5",children:G.jsx("textarea",{value:O,onChange:e=>M(e.target.value),placeholder:'{\\n "metadata": {...}\\n}',className:"w-full px-2 py-1.5 text-xs font-mono border border-border-default bg-surface text-primary rounded focus:outline-none focus:ring-1 focus:ring-blue-500 resize-none",rows:3})})]}),G.jsxs("div",{ref:L,onScroll:()=>{const e=(()=>{const e=L.current;return!e||e.scrollHeight-e.scrollTop-e.clientHeight<100})();A(!e)},className:"flex-1 overflow-y-auto p-4 space-y-3 min-h-0",children:[s.map(e=>{return G.jsx("div",{className:"flex "+("user"===e.type?"justify-end":"justify-start"),children:G.jsx("div",{className:"max-w-[85%] px-3 py-2 rounded-lg "+("user"===e.type?"bg-active text-white":"system"===e.type?"bg-blue-50 dark:bg-blue-900/20 text-blue-800 dark:text-blue-400 border border-blue-200 dark:border-blue-800":"error"===e.type?"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-400 border border-red-200 dark:border-red-800":"bg-surface-hover text-primary"),children:G.jsxs("div",{className:"flex items-start space-x-2",children:["error"===e.type&&G.jsx(Yp,{className:"h-3.5 w-3.5 mt-0.5 text-red-600 flex-shrink-0"}),G.jsxs("div",{className:"flex-1",children:[e.content&&G.jsx("div",{className:"text-sm",children:"agent"===e.type?G.jsx("div",{className:"max-w-none text-primary",children:G.jsx(sR,{remarkPlugins:[tD],components:nD,children:e.content})}):G.jsx("div",{className:"whitespace-pre-line",children:e.content})}),e.thinkingStatus&&G.jsxs("div",{className:"flex items-center space-x-1 mt-1.5 text-xs text-secondary italic",children:[G.jsx(sm,{className:"h-2.5 w-2.5 animate-spin"}),G.jsxs("span",{children:[e.thinkingStatus,"..."]})]}),!e.content&&!e.thinkingStatus&&"agent"===e.type&&G.jsxs("div",{className:"flex items-center space-x-1 text-xs text-secondary italic",children:[G.jsx(sm,{className:"h-2.5 w-2.5 animate-spin"}),G.jsx("span",{children:"pensando..."})]}),G.jsx("div",{className:"text-xs opacity-70 mt-1",children:(t=e.timestamp,new Date(t).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}))}),b&&("agent"===e.type||"error"===e.type)&&G.jsxs("div",{className:"mt-2 space-y-1.5",children:[e.rawRequest&&G.jsxs("details",{className:"text-xs bg-blue-50 dark:bg-blue-900/20 border bg-surface text-primary border-blue-200 dark:border-blue-800 rounded",children:[G.jsxs("summary",{className:"cursor-pointer px-2 py-1.5 flex items-center space-x-1.5 text-blue-700 dark:text-blue-400 hover:bg-blue-100 dark:bg-blue-900/30 transition-colors",children:[G.jsx(Gp,{className:"h-3.5 w-3.5"}),G.jsx("span",{className:"font-medium",children:"Request Sent"})]}),G.jsx("pre",{className:"mt-1 mx-2 mb-2 p-2 bg-gray-900 text-green-400 rounded text-xs overflow-x-auto font-mono",children:JSON.stringify(e.rawRequest,null,2)})]}),e.rawResponse&&G.jsxs("details",{className:"text-xs bg-purple-50 dark:bg-purple-900/20 border bg-surface text-primary border-purple-200 rounded",children:[G.jsxs("summary",{className:"cursor-pointer px-2 py-1.5 flex items-center space-x-1.5 text-purple-700 dark:text-purple-400 hover:bg-purple-100 dark:bg-purple-900/30 transition-colors",children:[G.jsx(Xp,{className:"h-3.5 w-3.5"}),G.jsx("span",{className:"font-medium",children:"Response Received"})]}),G.jsx("pre",{className:"mt-1 mx-2 mb-2 p-2 bg-gray-900 text-cyan-400 rounded text-xs overflow-x-auto font-mono",children:JSON.stringify(e.rawResponse,null,2)})]})]})]})]})})},e.id);var t}),h&&!w&&G.jsx("div",{className:"flex justify-start",children:G.jsx("div",{className:"bg-surface-hover text-primary px-3 py-2 rounded-lg",children:G.jsxs("div",{className:"flex items-center space-x-2",children:[G.jsx(sm,{className:"h-3.5 w-3.5 animate-spin text-secondary"}),G.jsx("span",{className:"text-xs",children:"Processing..."})]})})}),G.jsx("div",{ref:R}),P&&G.jsxs("button",{onClick:()=>{A(!1),V(!0)},className:"sticky bottom-2 left-1/2 -translate-x-1/2 px-3 py-1.5 bg-active text-white text-xs rounded-full shadow-lg hover:opacity-80 transition-all flex items-center gap-1.5 opacity-90 hover:opacity-100",children:[G.jsx(Xp,{className:"h-3.5 w-3.5"}),"Novas mensagens"]})]}),s.length<=1&&"connected"===m&&Y.length>0&&G.jsxs("div",{className:"px-4 py-2 border-t border-border-default bg-surface text-primary flex-shrink-0",children:[G.jsx("div",{className:"text-xs text-secondary mb-1.5",children:"Quick start:"}),G.jsx("div",{className:"flex flex-wrap gap-1.5",children:Y.map((e,t)=>G.jsx("button",{onClick:()=>u(e.value),className:"text-xs px-2 py-1 bg-surface-hover text-primary rounded hover:bg-surface-hover transition-colors",children:e.label},t))})]}),G.jsxs("div",{className:"p-4 border-t border-border-default flex-shrink-0",children:[G.jsxs("div",{className:"flex space-x-2",children:[G.jsx("textarea",{value:c,onChange:e=>u(e.target.value),onKeyPress:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),K())},placeholder:"Type your message...",className:"flex-1 border bg-surface text-primary border-border-default rounded-lg px-2 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary focus:border-transparent resize-none",rows:2,disabled:"connected"!==m}),G.jsx("button",{onClick:h?()=>{D.current&&(D.current.abort(),D.current=null,p(!1))}:K,disabled:!c.trim()&&!h||"connected"!==m,className:"px-3 py-1.5 rounded-lg transition-colors flex items-center self-end "+(h?"bg-red-600 hover:bg-red-700 text-white":"bg-active hover:bg-active/90 text-white disabled:opacity-50 disabled:cursor-not-allowed"),children:h?G.jsxs(G.Fragment,{children:[G.jsx(xm,{className:"h-4 w-4 mr-1"}),G.jsx("span",{className:"text-xs font-medium",children:"Stop"})]}):G.jsx(mm,{className:"h-4 w-4"})})]}),G.jsx("div",{className:"mt-1.5 text-xs text-secondary",children:"connected"===m?G.jsx("span",{children:"🔗 Connected • Press Enter to send"}):"testing"===m?G.jsx("span",{children:"⏳ Testing connection..."}):G.jsx("span",{children:"❌ Disconnected"})})]})]})};const oD="runflow_token_cache";let iD=(()=>{try{const e=localStorage.getItem(oD);if(e){const t=JSON.parse(e);if(t.expiresAt>Date.now())return t;localStorage.removeItem(oD)}}catch(kE){}return{token:null,expiresAt:0}})();const aD=new class{constructor(e="https://api.runflow.ai/api/v1"){t(this,"baseURL"),t(this,"tenantId",null),this.baseURL=e}setTenantId(e){this.tenantId=e}async getAccessToken(){return null}async request(e,t={},n=!1){var r;const o=`${this.baseURL}${e}`,i={"Content-Type":"application/json",...t.headers};try{const e=await this.getAccessToken();e&&(i.Authorization=`Bearer ${e}`)}catch(kE){}this.tenantId&&(i["X-Tenant-ID"]=this.tenantId);const a={headers:i,...t};try{const e=await fetch(o,a);if(401===e.status)return this.clearLocalData(),{data:null,success:!1,message:"Sessão expirada. Você será redirecionado para o login."};if(!e.ok){let t=null;try{t=await e.json()}catch(rp){}const n=null==t?void 0:t.message,r=Array.isArray(n)?n.join(". "):n||(null==t?void 0:t.error),o=r&&e.status>=400&&e.status<500?r:`HTTP error! status: ${e.status} - ${e.statusText}`,i=new Error(o);throw i.response={data:t,status:e.status},i.data=t,i.status=e.status,i}if(204===e.status||"0"===e.headers.get("content-length"))return{data:null,success:!0};const t=await e.text();if(!t||""===t.trim())return{data:null,success:!0};try{return{data:JSON.parse(t),success:!0}}catch(s){return{data:null,success:!0}}}catch(kE){if(null==(r=null==kE?void 0:kE.response)?void 0:r.data)throw kE;return{data:null,success:!1,message:kE instanceof Error?kE.message:"Unknown error"}}}clearLocalData(){iD={token:null,expiresAt:0};try{localStorage.removeItem(oD),localStorage.removeItem("currentTenantId")}catch(kE){}this.tenantId=null}async get(e){return this.request(e,{method:"GET"})}async post(e,t){return this.request(e,{method:"POST",body:JSON.stringify(t)})}async put(e,t){return this.request(e,{method:"PUT",body:JSON.stringify(t)})}async patch(e,t){return this.request(e,{method:"PATCH",body:JSON.stringify(t)})}async delete(e){return this.request(e,{method:"DELETE"})}},sD=e=>{var t,n,r;return{id:e.id,name:e.name,description:e.description,category:{CUSTOMER_SUPPORT:"customer-support",SALES:"sales",VOICE:"voice",OPERATIONS:"operations",FINANCIAL_PREVENTION:"financial-prevention",FINANCIAL_RECOVERY:"financial-recovery",MARKETING:"marketing",ANALYTICS:"analytics"}[e.category]||(null==(t=e.category)?void 0:t.toLowerCase().replace("_","-"))||"other",subcategory:e.subcategory,status:(null==(n=e.status)?void 0:n.toLowerCase())||"inactive",lastDeploy:e.lastDeploy,updatedAt:e.updatedAt,logo:e.logo,repositoryUrl:e.repositoryUrl,dataSources:[],triggers:[],tags:e.tags||[],code:e.code||"",language:(null==(r=e.language)?void 0:r.toLowerCase())||"typescript",prompts:[],branch:e.branch||"main",commit:e.commit||"N/A",newEngine:e.newEngine,fileTree:e.fileTree&&Array.isArray(e.fileTree.data)?{data:e.fileTree.data,success:!0}:{data:[],success:!0},repositoryName:e.repositoryName||"N/A",endpointUrl:e.endpointUrl||"N/A",readme:e.readme||void 0}},lD=e=>{var t,n,r;return{name:e.name,description:e.description,category:{"customer-support":"CUSTOMER_SUPPORT",sales:"SALES",voice:"VOICE",operations:"OPERATIONS","financial-prevention":"FINANCIAL_PREVENTION","financial-recovery":"FINANCIAL_RECOVERY",marketing:"MARKETING",analytics:"ANALYTICS"}[e.category]||(null==(t=e.category)?void 0:t.toUpperCase()),subcategory:e.subcategory,newEngine:e.newEngine,status:{active:"ACTIVE",inactive:"INACTIVE",error:"ERROR",deploying:"DEPLOYING"}[e.status]||(null==(n=e.status)?void 0:n.toUpperCase())||"INACTIVE",code:e.code||"// Agent code",language:(null==(r=e.language)?void 0:r.toUpperCase())||"TYPESCRIPT",branch:e.branch||"main",tags:e.tags||[]}},cD={getAll:()=>aD.get("/agents").then(e=>{if(e.success&&e.data&&e.data.data){const t=e.data.data.map(sD);return{...e,data:{...e.data,data:t}}}return e}),getById:e=>aD.get(`/agents/${e}`).then(e=>{if(e.success&&e.data){const t=sD(e.data);return{...e,data:t}}return e}),create:e=>{const t=lD(e);return aD.post("/agents",t)},update:(e,t)=>{const n=lD(t);return aD.patch(`/agents/${e}`,n)},delete:e=>aD.delete(`/agents/${e}`),execute:(e,t)=>aD.post(`/agents/${e}/execute`,t),commitCode:(e,t)=>aD.patch(`/agents/${e}/code`,t),getFileTree:e=>aD.get(`/agents/${e}/tree`),getCategories:()=>aD.get("/agents/categories"),getMetrics:(e,t=30)=>aD.get(`/agents/${e}/business-metrics?days=${t}`),getExecutions:(e,t)=>{const n=new URLSearchParams;null!=(null==t?void 0:t.limit)&&n.set("limit",String(t.limit)),null!=(null==t?void 0:t.offset)&&n.set("offset",String(t.offset));const r=n.toString()?`?${n.toString()}`:"";return aD.get(`/agents/${e}/executions${r}`)},getCategoryMetrics:e=>aD.get(`/agents/category/${e}/metrics`),clearMetricsCache:e=>aD.delete(`/agents/${e}/metrics/cache`),clearCategoryMetricsCache:e=>aD.delete(`/agents/category/${e}/metrics/cache`),testEndpoint:async(e,t)=>{try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t}),signal:AbortSignal.timeout(3e4)});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);return{success:!0,data:await n.json(),error:null}}catch(kE){return{success:!1,data:null,error:kE instanceof Error?kE.message:"Erro desconhecido"}}},resetData:e=>aD.post("/agent-data/reset",e)},uD=Object.freeze(Object.defineProperty({__proto__:null,agentsApi:cD,apiClient:aD},Symbol.toStringTag,{value:"Module"})),dD=$.createContext(void 0);function fD(){const{getAccessTokenSilently:e}=(void 0===t&&(t=Sp),$.useContext(t));var t;const{currentTenant:n}=(()=>{const e=$.useContext(dD);if(void 0===e)throw new Error("useTenant must be used within a TenantProvider");return e})(),r=async(t,r={})=>{const{includeTenantId:o=!0,headers:i={},...a}=r;try{const r=await e(),s="https://api.runflow.ai/api/v1",l=t.startsWith("http")?t:`${s}${t}`,c={Authorization:`Bearer ${r}`,"Content-Type":"application/json",...i};o&&(null==n?void 0:n.id)&&(c["X-Tenant-ID"]=n.id);return await fetch(l,{...a,headers:c})}catch(kE){throw kE}},o=async(e,t={})=>{const n=await r(e,t);if(!n.ok){const e=await n.text();throw new Error(`API Error ${n.status}: ${e}`)}return 204===n.status?{success:!0,message:"Operation completed successfully"}:n.json()};return{apiCall:r,apiCallJson:o,get:(e,t={})=>o(e,{...t,method:"GET"}),post:(e,t,n={})=>o(e,{...n,method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t,n={})=>o(e,{...n,method:"PUT",body:t?JSON.stringify(t):void 0}),patch:(e,t,n={})=>o(e,{...n,method:"PATCH",body:t?JSON.stringify(t):void 0}),delete:(e,t={})=>o(e,{...t,method:"DELETE"}),currentTenantId:null==n?void 0:n.id,currentTenantDomain:null==n?void 0:n.domain}}const hD=({threadId:e,entityValue:t,executions:n,loading:r,onBack:o,onExecutionClick:i,onRefresh:a})=>{const s=e=>{switch(e){case"success":return G.jsx(Jp,{className:"h-4 w-4 text-green-600 dark:text-green-400"});case"error":return G.jsx(Yp,{className:"h-4 w-4 text-red-600"});default:return G.jsx(Qp,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"})}};n.reduce((e,t)=>e+t.totalDurationMs,0);const l=n.reduce((e,t)=>e+(t.totalTokens||0),0),c=n.filter(e=>"success"===e.status).length,u=n.filter(e=>"error"===e.status).length;return G.jsxs("div",{className:"flex flex-col h-full bg-surface",children:[G.jsxs("div",{className:"px-4 py-3 border-b border-border-default flex-shrink-0",children:[G.jsxs("div",{className:"flex items-center justify-between mb-2",children:[G.jsxs("div",{className:"flex items-center space-x-3",children:[G.jsx("button",{onClick:o,className:"p-1 text-secondary hover:text-primary hover:bg-surface-hover rounded transition-colors",title:"Back to threads",children:G.jsx(Hp,{className:"h-4 w-4"})}),G.jsx(cm,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"}),G.jsxs("div",{children:[G.jsx("h3",{className:"text-sm font-semibold text-primary",children:"Messages"}),G.jsxs("p",{className:"text-xs text-secondary",children:["Thread: ",G.jsx("span",{className:"font-mono",children:t})]})]})]}),a&&G.jsx("button",{onClick:a,className:"p-1.5 text-secondary hover:text-primary hover:bg-surface-hover rounded transition-colors",title:"Refresh",children:G.jsx(hm,{className:"h-3.5 w-3.5 "+(r?"animate-spin":"")})})]}),n.length>0&&G.jsxs("div",{className:"grid grid-cols-4 gap-2 mt-2 p-2 bg-surface-subtle rounded",children:[G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Mensagens"}),G.jsx("div",{className:"text-sm font-semibold text-primary",children:n.length})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Sucesso"}),G.jsx("div",{className:"text-sm font-semibold text-green-600 dark:text-green-400",children:c})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Erros"}),G.jsx("div",{className:"text-sm font-semibold text-red-600",children:u})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Tokens"}),G.jsx("div",{className:"text-sm font-semibold text-primary",children:l.toLocaleString()})]})]})]}),G.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 min-h-0",children:r&&0===n.length?G.jsx("div",{className:"space-y-3",children:[...Array(3)].map((e,t)=>G.jsx("div",{className:"bg-surface-subtle border border-border-default rounded-lg p-3 animate-pulse",children:G.jsxs("div",{className:"flex items-start space-x-3",children:[G.jsx("div",{className:"w-6 h-6 bg-surface-hover rounded-full"}),G.jsxs("div",{className:"flex-1 space-y-2",children:[G.jsx("div",{className:"h-3 bg-surface-hover rounded w-3/4"}),G.jsx("div",{className:"h-3 bg-surface-hover rounded w-1/2"})]})]})},t))}):0===n.length?G.jsx("div",{className:"flex items-center justify-center h-full",children:G.jsxs("div",{className:"text-center",children:[G.jsx(cm,{className:"h-10 w-10 text-secondary mx-auto mb-3"}),G.jsx("h3",{className:"text-sm font-medium text-primary mb-1",children:"Nenhuma mensagem ainda"}),G.jsx("p",{className:"text-xs text-secondary",children:"As mensagens aparecerão aqui quando disponíveis"})]})}):n.sort((e,t)=>new Date(e.completedAt||e.startedAt).getTime()-new Date(t.completedAt||t.startedAt).getTime()).map((e,t)=>{return G.jsx("div",{className:"bg-surface border border-border-default rounded-lg hover:shadow-sm transition-all",children:G.jsxs("div",{className:"p-3 space-y-2",children:[G.jsxs("div",{className:"flex items-center justify-between",children:[G.jsxs("div",{className:"flex items-center space-x-2",children:[s(e.status),G.jsx("span",{className:"text-xs text-secondary",children:(r=e.startedAt,new Date(r).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}))})]}),G.jsxs("div",{className:"flex items-center space-x-2 text-xs text-secondary",children:[G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx(Qp,{className:"h-3 w-3"}),G.jsx("span",{children:(n=e.totalDurationMs,n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`)})]}),e.totalTokens&&e.totalTokens>0&&G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx(wm,{className:"h-3 w-3"}),G.jsx("span",{children:e.totalTokens})]})]})]}),G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx(bm,{className:"h-4 w-4 text-secondary mt-0.5 flex-shrink-0"}),G.jsx("div",{className:"flex-1 bg-surface-subtle rounded-lg p-2",children:G.jsx("p",{className:"text-xs text-primary",children:e.inputMessage||"(no message)"})})]}),"error"===e.status?G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx(Yp,{className:"h-4 w-4 text-red-500 mt-0.5 flex-shrink-0"}),G.jsxs("div",{className:"flex-1 bg-red-50 dark:bg-red-900/20 border bg-surface text-primary border-red-200 dark:border-red-800 rounded-lg p-2",children:[G.jsx("p",{className:"text-xs text-red-700 dark:text-red-400 font-medium",children:"Error"}),G.jsx("p",{className:"text-xs text-red-600 mt-1",children:e.error||e.outputMessage||"Unknown error"})]})]}):G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx(Wp,{className:"h-4 w-4 text-blue-500 mt-0.5 flex-shrink-0"}),G.jsx("div",{className:"flex-1 bg-blue-50 dark:bg-blue-900/20 rounded-lg p-2",children:G.jsx("p",{className:"text-xs text-primary",children:e.outputMessage||"(processing...)"})})]}),G.jsx("div",{className:"flex justify-end",children:G.jsxs("button",{onClick:()=>i(e),className:"flex items-center space-x-1 px-2 py-1 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:text-blue-400 hover:bg-blue-50 dark:bg-blue-900/20 rounded transition-colors",children:[G.jsx(nm,{className:"h-3 w-3"}),G.jsx("span",{children:"View traces"})]})})]})},e.executionId);var n,r})})]})},pD={agent_execution:"bg-blue-500",llm_call:"bg-purple-500",tool_call:"bg-green-500",rag_search:"bg-orange-500",memory_operation:"bg-indigo-500",workflow_execution:"bg-pink-500",connector_call:"bg-teal-500"},mD=({traces:e,onTraceSelect:t,selectedTraceId:n})=>{const[r,o]=$.useState(new Set);$.useEffect(()=>{const t=e=>{const n=[];for(const r of e)r.children&&r.children.length>0&&(n.push(r.traceId),n.push(...t(r.children)));return n},n=t(e);n.length>0&&o(new Set(n))},[e]);const i=e=>{if("custom_event"===e.operation&&e.metadata&&"object"==typeof e.metadata){const t=e.metadata.operation;if(t)return t}return e.operation},a=(e,s=0)=>{const l=r.has(e.traceId),c=e.children&&e.children.length>0,u=(e=>"tool_call"!==e.type?null:e.metadata&&"object"==typeof e.metadata&&e.metadata.toolName||null)(e),d=n===e.traceId;return G.jsxs("div",{className:s>0?"ml-6 relative":"",children:[s>0&&G.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-px bg-surface-hover",style:{left:"-12px"}}),s>0&&G.jsx("div",{className:"absolute top-4 h-px bg-surface-hover",style:{left:"-12px",width:"12px"}}),G.jsx("div",{className:"border rounded-lg cursor-pointer transition-all mb-2 "+(d?"border-blue-400 bg-blue-50 dark:bg-blue-900/20":"error"===e.status?"border-red-300 bg-red-50 dark:bg-red-900/20 hover:border-red-400":"border-border-default bg-surface hover:border-border-default"),onClick:()=>null==t?void 0:t(e),children:G.jsx("div",{className:"px-2 py-2",children:G.jsxs("div",{className:"flex items-center gap-1.5",children:[c?G.jsx("button",{onClick:t=>{var n;t.stopPropagation(),n=e.traceId,o(e=>{const t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})},className:"hover:bg-surface-hover rounded transition-colors flex-shrink-0",children:l?G.jsx(Kp,{className:"h-3 w-3 text-secondary"}):G.jsx(Zp,{className:"h-3 w-3 text-secondary"})}):G.jsx("div",{className:"w-3 flex-shrink-0"}),G.jsx("div",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${pD[e.type]||"bg-gray-400"}`}),G.jsxs("div",{className:"flex-1 min-w-0",children:[G.jsx("span",{className:"font-medium text-primary text-xs",children:i(e)}),u&&G.jsx("span",{className:"text-[10px] text-secondary font-mono ml-2",children:u})]}),G.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:["llm_call"===e.type&&e.metadata&&e.metadata.totalTokens&&G.jsxs("span",{className:"text-[10px] text-secondary tabular-nums",children:[e.metadata.totalTokens.toLocaleString()," tokens"]}),"error"===e.status&&G.jsx("span",{className:"text-[10px] font-medium text-red-600",children:"erro"}),e.durationMs>0&&G.jsx("span",{className:"text-[10px] text-secondary tabular-nums",children:(f=e.durationMs,f<1e3?`${f}ms`:f<6e4?`${(f/1e3).toFixed(1)}s`:`${(f/6e4).toFixed(1)}m`)})]})]})})}),c&&l&&G.jsx("div",{className:"relative",children:e.children.map(e=>a(e,s+1))})]},e.traceId);var f};return 0===e.length?G.jsxs("div",{className:"text-center py-8 bg-surface border border-border-default rounded-lg",children:[G.jsx(Vp,{className:"h-6 w-6 text-secondary mx-auto mb-2"}),G.jsx("p",{className:"text-secondary text-sm",children:"Nenhum trace encontrado."})]}):G.jsx("div",{className:"space-y-2",children:e.map(e=>a(e))})},gD=$.createContext(null);function vD(){const{theme:e}=function(){const e=$.useContext(gD);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}();return"dark"===e?"vs-dark":"vs-light"}function yD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bD(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xD(Object(n),!0).forEach(function(t){bD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kD(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function SD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(t){kD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function CD(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return t.apply(n,[].concat(o,r))}}}function ED(e){return{}.toString.call(e).includes("Object")}function ND(e){return"function"==typeof e}var ID=CD(function(e,t){throw new Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),OD={changes:function(e,t){return ED(t)||ID("changeType"),Object.keys(t).some(function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r})&&ID("changeField"),t},selector:function(e){ND(e)||ID("selectorType")},handler:function(e){ND(e)||ED(e)||ID("handlerType"),ED(e)&&Object.values(e).some(function(e){return!ND(e)})&&ID("handlersType")},initial:function(e){var t;e||ID("initialIsRequired"),ED(e)||ID("initialType"),t=e,Object.keys(t).length||ID("initialContent")}};function MD(e,t){return ND(t)?t(e.current):t}function jD(e,t){return e.current=SD(SD({},e.current),t),t}function TD(e,t,n){return ND(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])}),n}var PD={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};OD.initial(e),OD.handler(t);var n={current:e},r=CD(TD)(n,t),o=CD(jD)(n),i=CD(OD.changes)(e),a=CD(MD)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return OD.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(r,o,i,a)(e)}]}};var AD,RD=(AD=function(e,t){throw new Error(e[t]||e.default)},function e(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return r.length>=AD.length?AD.apply(this,r):function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return e.apply(t,[].concat(r,o))}})({configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "}),LD={config:function(e){return e||RD("configIsRequired"),function(e){return{}.toString.call(e).includes("Object")}(e)||RD("configType"),e.urls?{paths:{vs:e.urls.monacoBase}}:e}};function DD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],DD(e[n],t[n]))}),wD(wD({},e),t)}var zD={type:"cancelation",msg:"operation is manually canceled"};function FD(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(zD):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var UD=["monaco"],BD=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return yD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(PD.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),2),$D=BD[0],VD=BD[1];function HD(e){return document.body.appendChild(e)}function WD(e){var t,n,r=$D(function(e){return{config:e.config,reject:e.reject}}),o=(t="".concat(r.config.paths.vs,"/loader.js"),n=document.createElement("script"),t&&(n.src=t),n);return o.onload=function(){return e()},o.onerror=r.reject,o}function qD(){var e=$D(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;KD(n),e.resolve(n)},function(t){e.reject(t)})}function KD(e){$D().monaco||VD({monaco:e})}var ZD=new Promise(function(e,t){return VD({resolve:e,reject:t})}),YD={config:function(e){var t=LD.config(e),n=t.monaco,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,UD);VD(function(e){return{config:DD(e.config,r),monaco:n}})},init:function(){var e=$D(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(VD({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),FD(ZD);if(window.monaco&&window.monaco.editor)return KD(window.monaco),e.resolve(window.monaco),FD(ZD);!function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}}(HD,WD)(qD)}return FD(ZD)},__getMonacoInstance:function(){return $D(function(e){return e.monaco})}},XD={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},GD={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}};var JD=function({children:e}){return V.createElement("div",{style:GD.container},e)},QD=JD;var ez=function({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:a}){return V.createElement("section",{style:{...XD.wrapper,width:e,height:t},...a},!n&&V.createElement(QD,null,r),V.createElement("div",{ref:o,style:{...XD.fullWidth,...!n&&XD.hide},className:i}))},tz=$.memo(ez);var nz=function(e){$.useEffect(e,[])};var rz=function(e,t,n=!0){let r=$.useRef(!0);$.useEffect(r.current||!n?()=>{r.current=!1}:e,t)};function oz(){}function iz(e,t,n,r){return function(e,t){return e.editor.getModel(az(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?az(e,r):void 0)}(e,t,n,r)}function az(e,t){return e.Uri.parse(t)}var sz=function({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:a,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:f="100%",width:h="100%",className:p,wrapperProps:m={},beforeMount:g=oz,onMount:v=oz}){let[y,b]=$.useState(!1),[x,w]=$.useState(!0),k=$.useRef(null),_=$.useRef(null),S=$.useRef(null),C=$.useRef(v),E=$.useRef(g),N=$.useRef(!1);nz(()=>{let e=YD.init();return e.then(e=>(_.current=e)&&w(!1)).catch(e=>"cancelation"!==(null==e?void 0:e.type)&&void 0),()=>k.current?function(){var e,t,n,r;let o=null==(e=k.current)?void 0:e.getModel();s||null==(t=null==o?void 0:o.original)||t.dispose(),l||null==(n=null==o?void 0:o.modified)||n.dispose(),null==(r=k.current)||r.dispose()}():e.cancel()}),rz(()=>{if(k.current&&_.current){let t=k.current.getOriginalEditor(),o=iz(_.current,e||"",r||n||"text",i||"");o!==t.getModel()&&t.setModel(o)}},[i],y),rz(()=>{if(k.current&&_.current){let e=k.current.getModifiedEditor(),r=iz(_.current,t||"",o||n||"text",a||"");r!==e.getModel()&&e.setModel(r)}},[a],y),rz(()=>{let e=k.current.getModifiedEditor();e.getOption(_.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),rz(()=>{var t,n;null==(n=null==(t=k.current)?void 0:t.getModel())||n.original.setValue(e||"")},[e],y),rz(()=>{let{original:e,modified:t}=k.current.getModel();_.current.editor.setModelLanguage(e,r||n||"text"),_.current.editor.setModelLanguage(t,o||n||"text")},[n,r,o],y),rz(()=>{var e;null==(e=_.current)||e.editor.setTheme(c)},[c],y),rz(()=>{var e;null==(e=k.current)||e.updateOptions(d)},[d],y);let I=$.useCallback(()=>{var s;if(!_.current)return;E.current(_.current);let l=iz(_.current,e||"",r||n||"text",i||""),c=iz(_.current,t||"",o||n||"text",a||"");null==(s=k.current)||s.setModel({original:l,modified:c})},[n,t,o,e,r,i,a]),O=$.useCallback(()=>{var e;!N.current&&S.current&&(k.current=_.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...d}),I(),null==(e=_.current)||e.editor.setTheme(c),b(!0),N.current=!0)},[d,c,I]);return $.useEffect(()=>{y&&C.current(k.current,_.current)},[y]),$.useEffect(()=>{!x&&!y&&O()},[x,y,O]),V.createElement(tz,{width:h,height:f,isEditorReady:y,loading:u,_ref:S,className:p,wrapperProps:m})};$.memo(sz);var lz=function(e){let t=$.useRef();return $.useEffect(()=>{t.current=e},[e]),t.current},cz=new Map;var uz=function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:a="light",line:s,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:h="100%",height:p="100%",className:m,wrapperProps:g={},beforeMount:v=oz,onMount:y=oz,onChange:b,onValidate:x=oz}){let[w,k]=$.useState(!1),[_,S]=$.useState(!0),C=$.useRef(null),E=$.useRef(null),N=$.useRef(null),I=$.useRef(y),O=$.useRef(v),M=$.useRef(),j=$.useRef(r),T=lz(i),P=$.useRef(!1),A=$.useRef(!1);nz(()=>{let e=YD.init();return e.then(e=>(C.current=e)&&S(!1)).catch(e=>"cancelation"!==(null==e?void 0:e.type)&&void 0),()=>{return E.current?(null==(t=M.current)||t.dispose(),f?d&&cz.set(i,E.current.saveViewState()):null==(n=E.current.getModel())||n.dispose(),void E.current.dispose()):e.cancel();var t,n}}),rz(()=>{var a,s,l,c;let u=iz(C.current,e||r||"",t||o||"",i||n||"");u!==(null==(a=E.current)?void 0:a.getModel())&&(d&&cz.set(T,null==(s=E.current)?void 0:s.saveViewState()),null==(l=E.current)||l.setModel(u),d&&(null==(c=E.current)||c.restoreViewState(cz.get(i))))},[i],w),rz(()=>{var e;null==(e=E.current)||e.updateOptions(c)},[c],w),rz(()=>{!E.current||void 0===r||(E.current.getOption(C.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(A.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),A.current=!1))},[r],w),rz(()=>{var e,t;let n=null==(e=E.current)?void 0:e.getModel();n&&o&&(null==(t=C.current)||t.editor.setModelLanguage(n,o))},[o],w),rz(()=>{var e;void 0!==s&&(null==(e=E.current)||e.revealLine(s))},[s],w),rz(()=>{var e;null==(e=C.current)||e.editor.setTheme(a)},[a],w);let R=$.useCallback(()=>{var l;if(N.current&&C.current&&!P.current){O.current(C.current);let f=i||n,h=iz(C.current,r||e||"",t||o||"",f||"");E.current=null==(l=C.current)?void 0:l.editor.create(N.current,{model:h,automaticLayout:!0,...c},u),d&&E.current.restoreViewState(cz.get(f)),C.current.editor.setTheme(a),void 0!==s&&E.current.revealLine(s),k(!0),P.current=!0}},[e,t,n,r,o,i,c,u,d,a,s]);return $.useEffect(()=>{w&&I.current(E.current,C.current)},[w]),$.useEffect(()=>{!_&&!w&&R()},[_,w,R]),j.current=r,$.useEffect(()=>{var e,t;w&&b&&(null==(e=M.current)||e.dispose(),M.current=null==(t=E.current)?void 0:t.onDidChangeModelContent(e=>{A.current||b(E.current.getValue(),e)}))},[w,b]),$.useEffect(()=>{if(w){let e=C.current.editor.onDidChangeMarkers(e=>{var t;let n=null==(t=E.current.getModel())?void 0:t.uri;if(n&&e.find(e=>e.path===n.path)){let e=C.current.editor.getModelMarkers({resource:n});null==x||x(e)}});return()=>{null==e||e.dispose()}}return()=>{}},[w,x]),V.createElement(tz,{width:h,height:p,isEditorReady:w,loading:l,_ref:N,className:m,wrapperProps:g})},dz=$.memo(uz);const fz=({data:e,title:t,maxHeight:n="300px",showLineNumbers:r=!1,isExpanded:o=!1,onToggleExpand:i})=>{const a=vD(),s=JSON.stringify(e,null,2);return i?G.jsxs("div",{className:"bg-surface border border-border-default rounded-lg overflow-hidden transition-all flex flex-col",children:[G.jsxs("button",{onClick:i,className:"w-full px-3 py-1.5 bg-surface-subtle border-b border-border-default flex items-center justify-between hover:bg-surface-hover transition-colors flex-shrink-0",children:[G.jsx("h4",{className:"text-xs font-medium text-primary",children:t}),o?G.jsx(um,{className:"h-3.5 w-3.5 text-secondary"}):G.jsx(lm,{className:"h-3.5 w-3.5 text-secondary"})]}),G.jsx("div",{style:{height:o?"calc(100vh - 200px)":n},children:G.jsx(dz,{height:"100%",language:"json",theme:a,value:s,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:11,lineNumbers:r?"on":"off",wordWrap:"on",automaticLayout:!0,selectOnLineNumbers:!0,roundedSelection:!1,cursorStyle:"line",scrollbar:{vertical:"auto",horizontal:"auto"}}})})]}):G.jsxs("div",{className:"bg-surface border border-border-default rounded-lg overflow-hidden flex flex-col",children:[t&&G.jsx("div",{className:"px-4 py-2 bg-surface-subtle border-b border-border-default flex-shrink-0",children:G.jsx("h4",{className:"text-sm font-medium text-primary",children:t})}),G.jsx("div",{style:{height:n},className:"overflow-hidden",children:G.jsx(dz,{height:"100%",language:"json",theme:a,value:s,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:11,lineNumbers:r?"on":"off",wordWrap:"on",automaticLayout:!0,selectOnLineNumbers:!0,roundedSelection:!1,cursorStyle:"line",scrollbar:{vertical:"auto",horizontal:"auto"}}})})]})},hz=({trace:e,onClose:t,isMaximized:n=!1,onToggleMaximize:r,onTraceSelect:o})=>{const[i,a]=$.useState(null),[s,l]=$.useState(!1),c=e=>e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`;return G.jsxs("div",{className:"h-full bg-surface border-l border-border-default flex flex-col overflow-hidden",children:[G.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 border-b border-border-default bg-surface-subtle flex-shrink-0",children:[G.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[G.jsx("h3",{className:"text-xs font-semibold text-primary truncate",children:e.operation}),G.jsx("span",{className:"px-1 py-0.5 bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-400 rounded text-[10px] flex-shrink-0",children:(d=e.type,{agent_execution:"Agent Execution",llm_call:"LLM Call",tool_call:"Tool Call",memory_operation:"Memory Operation",rag_search:"RAG Search",workflow_execution:"Workflow Execution",connector_call:"Connector Call"}[d]||d)}),G.jsx("span",{className:"px-1 py-0.5 rounded text-[10px] flex-shrink-0 "+("success"===e.status?"bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-400":"error"===e.status?"bg-red-100 dark:bg-red-900/30 text-red-800 dark:text-red-400":"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-800 dark:text-yellow-400"),children:e.status}),G.jsxs("span",{className:"text-[10px] text-secondary flex-shrink-0",children:[c(e.durationMs)," • ",(u=e.startedAt,new Date(u).toLocaleString("pt-BR"))]}),G.jsx("button",{onClick:()=>{navigator.clipboard.writeText(e.traceId),l(!0),setTimeout(()=>l(!1),2e3)},className:"text-[10px] font-mono flex-shrink-0 px-1 py-0.5 rounded transition-colors "+(s?"text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-900/20":"text-secondary hover:text-secondary hover:bg-surface-hover"),title:`Copiar ID: ${e.traceId}`,children:s?"✓ Copiado!":`ID: ${e.traceId.slice(-8)}`})]}),G.jsxs("div",{className:"flex items-center space-x-0.5 ml-2 flex-shrink-0",children:[G.jsx("button",{onClick:()=>{const t=JSON.stringify(e,null,2),n=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`trace-${e.traceId}-${(new Date).toISOString().split("T")[0]}.json`,o.click()},className:"p-1 text-secondary hover:text-primary hover:bg-surface-hover rounded",title:"Exportar",children:G.jsx(tm,{className:"h-3.5 w-3.5"})}),r&&G.jsx("button",{onClick:r,className:"p-1 text-secondary hover:text-primary hover:bg-surface-hover rounded",title:n?"Restaurar":"Maximizar",children:n?G.jsx(um,{className:"h-3.5 w-3.5"}):G.jsx(lm,{className:"h-3.5 w-3.5"})}),G.jsx("button",{onClick:t,className:"p-1 text-secondary hover:text-primary hover:bg-surface-hover rounded",title:"Fechar",children:G.jsx(xm,{className:"h-3.5 w-3.5"})})]})]}),G.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:["llm_call"===e.type&&e.metadata&&e.metadata.totalTokens&&!i&&G.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[10px]",children:[e.metadata.model&&G.jsx("span",{className:"bg-surface-hover text-secondary px-2 py-1 rounded",children:e.metadata.model}),G.jsxs("span",{className:"bg-surface-hover text-secondary px-2 py-1 rounded",children:[G.jsx("span",{className:"text-secondary",children:"input:"})," ",(e.metadata.promptTokens||0).toLocaleString()]}),G.jsxs("span",{className:"bg-surface-hover text-secondary px-2 py-1 rounded",children:[G.jsx("span",{className:"text-secondary",children:"output:"})," ",(e.metadata.completionTokens||0).toLocaleString()]}),G.jsxs("span",{className:"bg-active text-white px-2 py-1 rounded font-medium",children:[(e.metadata.totalTokens||0).toLocaleString()," tokens"]})]}),(()=>{const t=e.input&&Object.keys(e.input).length>0,n=e.output&&Object.keys(e.output).length>0,r=e.metadata&&Object.keys(e.metadata).length>0,o=[t,n,r].filter(Boolean).length,s=1===o?"400px":2===o?"280px":"200px";return G.jsxs("div",{className:"flex flex-col space-y-2 min-w-0",children:[t&&(!i||"input"===i)&&G.jsx(fz,{data:e.input,title:"Input",showLineNumbers:!0,maxHeight:s,isExpanded:"input"===i,onToggleExpand:()=>a("input"===i?null:"input")}),n&&(!i||"output"===i)&&G.jsx(fz,{data:e.output,title:"Output",showLineNumbers:!0,maxHeight:s,isExpanded:"output"===i,onToggleExpand:()=>a("output"===i?null:"output")}),r&&(!i||"metadata"===i)&&G.jsx(fz,{data:e.metadata,title:"Metadata",showLineNumbers:!0,maxHeight:s,isExpanded:"metadata"===i,onToggleExpand:()=>a("metadata"===i?null:"metadata")})]})})(),!i&&e.children&&e.children.length>0&&G.jsxs("div",{className:"bg-surface-subtle rounded-lg p-3",children:[G.jsxs("h4",{className:"text-xs font-medium text-primary mb-2",children:["Traces Filhos (",e.children.length,")"]}),G.jsx("div",{className:"space-y-1",children:e.children.map(e=>G.jsxs("button",{onClick:()=>null==o?void 0:o(e),className:"w-full flex items-center justify-between text-xs p-1.5 rounded hover:bg-surface-hover transition-colors text-left",children:[G.jsx("span",{className:"text-primary truncate",children:e.operation}),G.jsx("span",{className:"flex-shrink-0 ml-2 "+("success"===e.status?"text-green-600 dark:text-green-400":"error"===e.status?"text-red-600":"text-secondary"),children:c(e.durationMs)})]},e.traceId))})]})]})]});var u,d},pz=({execution:e,agentId:t,isOpen:n,onClose:r,mode:o="portal",customApiUrl:i})=>{const[a,s]=$.useState([]),[l,c]=$.useState(null),[u,d]=$.useState(!1),[f,h]=$.useState(null),[p,m]=$.useState(!1),[g,v]=$.useState(!1),[y,b]=$.useState(!1),x=fD();if(!n||!e)return null;$.useEffect(()=>{n&&(null==e?void 0:e.executionId)&&w()},[n,null==e?void 0:e.executionId]),$.useEffect(()=>{const e=e=>{"Escape"===e.key&&r()};if(n)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[n,r]);const w=async()=>{if(e&&t){d(!0),h(null);try{let n;if("local"===o||i){const r=`${i||"http://localhost:3030"}/api/v1/observability/executions/${e.executionId}?agentId=${t}`,o=await fetch(r,{headers:{"Content-Type":"application/json"}});if(!o.ok)throw new Error(`Failed to fetch traces: ${o.statusText}`);n=await o.json()}else{const r=`/observability/executions/${e.executionId}?agentId=${t}`;n=await x.get(r)}const r=n.traces||[];s(r),r.length>0&&c(r[0])}catch(v7){h(v7.message||"Erro ao carregar traces"),s([])}finally{d(!1)}}},k=e=>{c(e)};return G.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 flex justify-end",onClick:e=>{e.target===e.currentTarget&&r()},children:G.jsxs("div",{className:"bg-surface-elevated shadow-2xl w-[85%] h-full flex flex-col animate-slide-in-right overflow-hidden",children:[G.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-default bg-surface-subtle",children:[G.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[G.jsx("h2",{className:"text-sm font-semibold text-primary whitespace-nowrap",children:"Execução"}),G.jsxs("div",{className:"flex items-center gap-2 text-xs text-secondary flex-wrap",children:[G.jsxs("div",{className:"flex items-center gap-1",children:[(e=>{switch(e){case"success":return G.jsx(Jp,{className:"h-4 w-4 text-green-600 dark:text-green-400"});case"error":return G.jsx(Yp,{className:"h-4 w-4 text-red-600"});default:return G.jsx(Qp,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400"})}})(e.status),G.jsx("span",{className:"capitalize",children:e.status})]}),G.jsx("span",{className:"text-secondary",children:"•"}),G.jsx("span",{children:(S=e.totalDurationMs>0?e.totalDurationMs:a.reduce((e,t)=>e+(t.durationMs||0),0),S<1e3?`${S}ms`:S<6e4?`${(S/1e3).toFixed(1)}s`:`${(S/6e4).toFixed(1)}m`)}),G.jsx("span",{className:"text-secondary",children:"•"}),G.jsx("span",{children:(_=e.startedAt,new Date(_).toLocaleString("pt-BR"))}),G.jsx("span",{className:"text-secondary",children:"•"}),G.jsxs("span",{children:[a.length," traces"]}),G.jsx("button",{onClick:()=>{navigator.clipboard.writeText(e.executionId),b(!0),setTimeout(()=>b(!1),2e3)},className:"font-mono px-1.5 py-0.5 rounded transition-colors "+(y?"text-green-600 dark:text-green-400 bg-green-50 dark:bg-green-900/20":"text-secondary hover:text-secondary hover:bg-surface-hover"),title:`Copiar ID: ${e.executionId}`,children:y?"✓ Copiado!":`ID: ${e.executionId.slice(-8)}`})]})]}),G.jsxs("div",{className:"flex items-center space-x-1 flex-shrink-0",children:[G.jsx("button",{onClick:()=>{const t=JSON.stringify(e,null,2),n=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`execution-${e.executionId}-${(new Date).toISOString().split("T")[0]}.json`,o.click()},className:"p-1.5 text-secondary hover:text-primary hover:bg-surface-hover rounded",title:"Exportar execução",children:G.jsx(tm,{className:"h-4 w-4"})}),G.jsx("button",{onClick:r,className:"p-1.5 text-secondary hover:text-primary hover:bg-surface-hover rounded",title:"Fechar",children:G.jsx(xm,{className:"h-4 w-4"})})]})]}),G.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col p-4",children:[!p&&G.jsxs("div",{className:"mb-4 flex-shrink-0 border border-border-default rounded-lg bg-surface overflow-hidden",children:[G.jsxs("button",{onClick:()=>v(!g),className:"w-full flex items-center justify-between px-3 py-2 bg-surface-subtle hover:bg-surface-hover transition-colors",children:[G.jsx("h4",{className:"text-xs font-semibold text-primary",children:"Input & Output"}),g?G.jsx(um,{className:"h-3.5 w-3.5 text-secondary"}):G.jsx(lm,{className:"h-3.5 w-3.5 text-secondary"})]}),g&&G.jsxs("div",{className:"p-3 space-y-3 border-t border-border-default",children:[e.inputMessage&&""!==e.inputMessage.trim()&&G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx("div",{className:"w-6 h-6 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:G.jsx(bm,{className:"h-3 w-3 text-blue-600 dark:text-blue-400"})}),G.jsxs("div",{className:"flex-1 bg-blue-50 dark:bg-blue-900/20 border bg-surface text-primary border-blue-100 rounded-lg p-2",children:[G.jsx("p",{className:"text-[10px] font-semibold text-blue-900 mb-1 uppercase tracking-wide",children:"Input"}),G.jsx("p",{className:"text-xs text-primary leading-relaxed",children:e.inputMessage})]})]}),e.outputMessage&&G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx("div",{className:"w-6 h-6 bg-primary rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:G.jsx(Wp,{className:"h-3 w-3 text-white"})}),G.jsxs("div",{className:"flex-1 bg-surface-subtle border border-border-default rounded-lg p-2",children:[G.jsx("p",{className:"text-[10px] font-semibold text-primary mb-1 uppercase tracking-wide",children:"Output"}),G.jsx("p",{className:"text-xs text-primary leading-relaxed",children:e.outputMessage})]})]})]})]}),G.jsx("div",{className:"flex-1 overflow-hidden",children:u?G.jsx("div",{className:"flex items-center justify-center h-full",children:G.jsx("div",{className:"text-secondary text-sm",children:"Carregando traces..."})}):f?G.jsx("div",{className:"flex items-center justify-center h-full",children:G.jsxs("div",{className:"text-red-500 text-center",children:[G.jsx(Yp,{className:"h-6 w-6 mx-auto mb-2"}),G.jsx("p",{className:"font-medium text-sm",children:"Erro ao carregar traces"}),G.jsx("p",{className:"text-xs mt-1",children:f}),G.jsx("button",{onClick:w,className:"mt-3 px-3 py-1.5 text-xs bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:"Tentar novamente"})]})}):a.length>0?G.jsxs("div",{className:"flex h-full gap-3",children:[!p&&G.jsx("div",{className:"w-1/3 min-w-[280px] max-w-[400px] flex-shrink-0 overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",children:G.jsx(mD,{traces:a,onTraceSelect:k,selectedTraceId:null==l?void 0:l.traceId})}),l&&G.jsx("div",{className:(p?"w-full":"flex-1")+" border-l border-border-default",children:G.jsx(hz,{trace:l,onClose:()=>{c(null),m(!1)},isMaximized:p,onToggleMaximize:()=>m(!p),onTraceSelect:k})})]}):G.jsx("div",{className:"flex items-center justify-center h-full",children:G.jsxs("div",{className:"text-secondary text-center",children:[G.jsx(Qp,{className:"h-6 w-6 mx-auto mb-2"}),G.jsx("p",{className:"font-medium text-sm",children:"Nenhum trace encontrado"}),G.jsx("p",{className:"text-xs mt-1",children:"Esta execução não possui traces disponíveis"})]})})})]})]})});var _,S},mz=({traces:e,loading:t,onRefresh:n,selectedThreadId:r,onThreadSelect:o,agentId:i,mode:a="portal",customApiUrl:s})=>{const[l,c]=$.useState("threads"),[u,d]=$.useState(null),[f,h]=$.useState(null),[p,m]=$.useState(!1),{executions:g,loading:v,refetch:y}=(({threadId:e,agentId:t,mode:n="portal",enabled:r=!0,customApiUrl:o})=>{const[i,a]=$.useState([]),[s,l]=$.useState(!1),[c,u]=$.useState(null),[d,f]=$.useState(0),h=fD(),p=$.useCallback(async()=>{var i,s;if(!r||!e||!t)return a([]),void f(0);try{let r;if(l(!0),u(null),"local"===n||o){const n=`${o||"http://localhost:3030"}/api/v1/observability/threads/${e}/executions?agentId=${t}`,i=await fetch(n,{headers:{"Content-Type":"application/json"}});if(!i.ok)throw new Error(`Failed to fetch executions: ${i.statusText}`);r=await i.json()}else r=await h.get(`/observability/threads/${e}/executions?agentId=${t}`);const c=r.executions||(null==(i=r.data)?void 0:i.executions)||r.data||[];a(Array.isArray(c)?c:[]),f(r.total||(null==(s=r.data)?void 0:s.total)||c.length)}catch(v7){const t=v7 instanceof Error?v7.message:"Failed to fetch executions";u(t)}finally{l(!1)}},[e,t,r,n,o]);return $.useEffect(()=>{r&&e&&t&&p()},[e,t,r]),{executions:i,loading:s,error:c,refetch:p,total:d}})({threadId:null==u?void 0:u.threadId,agentId:i,mode:a,enabled:"executions"===l&&!!u,customApiUrl:s}),b=e=>{const t=new Date(e),n=new Date,r=n.getTime()-t.getTime();if(r<6e4)return"agora";if(r<36e5)return`${Math.floor(r/6e4)}m atrás`;const o=t.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"});if(t.toDateString()===n.toDateString())return`hoje às ${o}`;const i=new Date(n);i.setDate(i.getDate()-1);if(t.toDateString()===i.toDateString())return`ontem às ${o}`;if(r<6048e5){return`${t.toLocaleDateString("pt-BR",{weekday:"short"})} às ${o}`}const a=t.getFullYear()===n.getFullYear();return`${t.toLocaleDateString("pt-BR",{day:"2-digit",month:"short",...a?{}:{year:"numeric"}})} às ${o}`},x=e=>{const t={whatsapp:{label:"WhatsApp",bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-400"},email:{label:"Email",bg:"bg-blue-50 dark:bg-blue-900/20",text:"text-blue-700 dark:text-blue-400"},api:{label:"API",bg:"bg-purple-50 dark:bg-purple-900/20",text:"text-purple-700 dark:text-purple-400"},widget:{label:"Widget",bg:"bg-indigo-50 dark:bg-indigo-900/20",text:"text-indigo-700 dark:text-indigo-400"},sdk:{label:"SDK",bg:"bg-surface-subtle",text:"text-primary"}}[e]||{label:e,bg:"bg-surface-subtle",text:"text-primary"};return G.jsx("span",{className:`inline-flex px-2 py-0.5 rounded text-xs font-medium ${t.bg} ${t.text}`,children:t.label})},w=()=>{c("threads"),d(null)},k=e=>{h(e),m(!0)},_=()=>{m(!1),h(null)};e.reduce((e,t)=>e+t.totalDurationMs,0);const S=e.reduce((e,t)=>e+t.totalTokens,0),C=e.filter(e=>"success"===e.status).length,E=e.filter(e=>"error"===e.status).length;return"executions"===l&&u?G.jsxs(G.Fragment,{children:[G.jsx(hD,{threadId:u.threadId,entityValue:u.entityValue||u.threadId,executions:g,loading:v,onBack:w,onExecutionClick:k,onRefresh:y}),f&&i&&G.jsx(pz,{execution:f,agentId:i,isOpen:p,onClose:_,mode:a,customApiUrl:s})]}):G.jsxs("div",{className:"flex flex-col h-full bg-surface",children:[G.jsx("div",{className:"px-4 py-3 border-b border-border-default flex-shrink-0",children:G.jsxs("div",{className:"flex items-center justify-between",children:[G.jsxs("div",{className:"flex items-center space-x-3",children:[G.jsx(Vp,{className:"h-5 w-5 text-blue-600 dark:text-blue-400"}),G.jsxs("div",{children:[G.jsx("h3",{className:"text-sm font-semibold text-primary",children:"Real-time Monitoring"}),G.jsxs("p",{className:"text-xs text-secondary",children:[e.length," thread",1!==e.length?"s":""," found",r&&G.jsxs("span",{className:"ml-2",children:["• ",G.jsxs("span",{className:"font-mono text-blue-600 dark:text-blue-400",children:[r.slice(0,20),"..."]})," selected"]})]})]})]}),G.jsx("div",{className:"flex items-center space-x-2",children:n&&G.jsx("button",{onClick:n,className:"p-1.5 text-secondary hover:text-primary hover:bg-surface-hover rounded transition-colors",title:"Refresh",children:G.jsx(hm,{className:"h-3.5 w-3.5 "+(t?"animate-spin":"")})})})]})}),e.length>0&&G.jsx("div",{className:"px-4 py-2 bg-surface-subtle border-b border-border-default flex-shrink-0",children:G.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Traces"}),G.jsx("div",{className:"text-sm font-semibold text-primary",children:e.length})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Success"}),G.jsx("div",{className:"text-sm font-semibold text-green-600 dark:text-green-400",children:C})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Errors"}),G.jsx("div",{className:"text-sm font-semibold text-red-600",children:E})]}),G.jsxs("div",{className:"text-center",children:[G.jsx("div",{className:"text-xs text-secondary",children:"Tokens"}),G.jsx("div",{className:"text-sm font-semibold text-primary",children:S.toLocaleString()})]})]})}),G.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t&&0===e.length?G.jsx("div",{className:"p-4 space-y-3",children:[...Array(3)].map((e,t)=>G.jsx("div",{className:"bg-surface-subtle border border-border-default rounded-lg p-3 animate-pulse",children:G.jsxs("div",{className:"flex items-start space-x-3",children:[G.jsx("div",{className:"w-6 h-6 bg-surface-hover rounded"}),G.jsxs("div",{className:"flex-1 space-y-2",children:[G.jsx("div",{className:"h-3 bg-surface-hover rounded w-1/3"}),G.jsx("div",{className:"h-3 bg-surface-hover rounded w-1/2"})]})]})},t))}):0===e.length?G.jsx("div",{className:"flex items-center justify-center h-full p-8",children:G.jsxs("div",{className:"text-center",children:[G.jsx(cm,{className:"h-10 w-10 text-secondary mx-auto mb-3"}),G.jsx("h3",{className:"text-sm font-medium text-primary mb-1",children:"Nenhuma thread ainda"}),G.jsx("p",{className:"text-xs text-secondary",children:"Envie mensagens para ver as threads aparecerem aqui"})]})}):G.jsx("div",{className:"p-4 space-y-2",children:e.sort((e,t)=>{const n=new Date(e.completedAt||e.startedAt).getTime();return new Date(t.completedAt||t.startedAt).getTime()-n}).map(e=>{return G.jsx("div",{onClick:()=>{return d(t=e),c("executions"),void(null==o||o(t));var t},className:"bg-surface border rounded-lg hover:shadow-sm transition-all cursor-pointer "+(r===e.threadId?"border-blue-400 bg-blue-50 dark:bg-blue-900/20 shadow-sm":"border-border-default hover:border-border-default"),children:G.jsxs("div",{className:"p-3",children:[G.jsxs("div",{className:"flex items-start gap-3",children:[G.jsx("div",{className:"flex-shrink-0 mt-1 w-2 h-2 rounded-full "+("success"===e.status?"bg-green-500":"error"===e.status?"bg-red-500":"bg-yellow-500")}),G.jsxs("div",{className:"flex-1 min-w-0",children:[G.jsxs("div",{className:"flex items-center flex-wrap gap-2 mb-1",children:[r===e.threadId&&G.jsxs("div",{className:"flex items-center space-x-1 bg-blue-600 text-white px-2 py-0.5 rounded text-xs font-medium",children:[G.jsx(Jp,{className:"h-3 w-3"}),G.jsx("span",{children:"Selecionado"})]}),e.channel&&x(e.channel),G.jsx("span",{className:"text-xs text-secondary",children:b(e.completedAt||e.startedAt)})]}),G.jsx("p",{className:"text-xs text-primary truncate mb-1",children:e.outputMessage||e.inputMessage||"Sem mensagem"}),e.entityValue&&G.jsx("div",{className:"flex items-center space-x-1 mb-1",children:G.jsx("span",{className:"text-xs font-semibold text-primary",children:e.entityValue})}),G.jsxs("div",{className:"flex items-center space-x-3 text-xs text-secondary",children:[G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx(Qp,{className:"h-3 w-3"}),G.jsx("span",{children:(t=e.totalDurationMs,t<1e3?`${t}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`)})]}),G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx(cm,{className:"h-3 w-3"}),G.jsx("span",{children:e.totalTraces||0})]}),e.totalTokens>0&&G.jsxs("div",{className:"flex items-center space-x-1",children:[G.jsx(wm,{className:"h-3 w-3"}),G.jsx("span",{children:e.totalTokens.toLocaleString()})]})]})]})]}),"error"===e.status&&e.error&&G.jsx("div",{className:"mt-2 p-2 bg-red-50 dark:bg-red-900/20 border bg-surface text-primary border-red-200 dark:border-red-800 rounded",children:G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx(Yp,{className:"h-3.5 w-3.5 text-red-600 mt-0.5 flex-shrink-0"}),G.jsxs("div",{children:[G.jsx("p",{className:"text-xs font-medium text-red-800 dark:text-red-400",children:"Erro"}),G.jsx("p",{className:"text-xs text-red-700 dark:text-red-400 mt-0.5",children:e.error})]})]})})]})},e.id);var t})})}),t&&e.length>0&&G.jsx("div",{className:"px-4 py-2 border-t border-border-default bg-surface text-primary flex-shrink-0",children:G.jsxs("div",{className:"flex items-center justify-center space-x-2 text-xs text-secondary",children:[G.jsx(hm,{className:"h-3 w-3 animate-spin"}),G.jsx("span",{children:"Atualizando..."})]})})]})},gz=({isOpen:e,onClose:t,title:n,subtitle:r,icon:o,children:i,size:a="lg",showCloseButton:s=!0,footer:l})=>{if(!e)return null;return G.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:G.jsxs("div",{className:"flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[G.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:t}),G.jsxs("div",{className:`inline-block align-bottom bg-surface-elevated rounded-xl text-left overflow-hidden shadow-2xl ring-1 ring-black/10 dark:ring-white/10 transform transition-all sm:my-8 sm:align-middle ${{sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl","3xl":"sm:max-w-3xl","4xl":"sm:max-w-4xl"}[a]} sm:w-full`,children:[G.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border-default",children:[G.jsxs("div",{className:"flex items-center gap-3",children:[o,G.jsxs("div",{children:[G.jsx("h3",{className:"text-lg font-semibold text-primary",children:n}),r&&G.jsx("p",{className:"text-sm text-secondary",children:r})]})]}),s&&G.jsx("button",{onClick:t,className:"p-1.5 rounded-lg text-secondary hover:text-primary hover:bg-surface-hover transition-colors",children:G.jsx(xm,{className:"h-5 w-5"})})]}),G.jsx("div",{className:"px-6 py-6 max-h-[60vh] overflow-y-auto",children:i}),l&&G.jsx("div",{className:"px-6 py-4 border-t border-border-default bg-surface-elevated/80",children:l})]})]})})},vz=({status:e,successMessage:t="Operação realizada com sucesso!",errorMessage:n="Erro ao realizar operação",className:r=""})=>"success"===e?G.jsxs("div",{className:`flex items-center p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg ${r}`,children:[G.jsx(Jp,{className:"h-5 w-5 text-green-600 dark:text-green-400 mr-3"}),G.jsx("span",{className:"text-green-800 dark:text-green-400 font-medium",children:t})]}):"error"===e?G.jsxs("div",{className:`flex items-start p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg ${r}`,children:[G.jsx(Yp,{className:"h-5 w-5 text-red-600 mr-3 mt-0.5"}),G.jsxs("div",{children:[G.jsx("div",{className:"text-red-800 dark:text-red-400 font-medium",children:"Erro"}),n&&G.jsx("div",{className:"text-red-700 dark:text-red-400 text-sm mt-1",children:n})]})]}):null,yz=({isOpen:e,onClose:t,agent:n,onConfirm:r})=>{const[o,i]=$.useState("both"),[a,s]=$.useState(!1),[l,c]=$.useState(!1),[u,d]=$.useState("idle"),[f,h]=$.useState(""),[p,m]=$.useState({threadId:"",entityType:"",entityValue:"",sessionId:"",dateFrom:"",dateTo:""}),g=()=>{l||(d("idle"),h(""),m({threadId:"",entityType:"",entityValue:"",sessionId:"",dateFrom:"",dateTo:""}),s(!1),t())},v=Object.values(p).some(e=>""!==e.trim());return G.jsx(gz,{isOpen:e,onClose:g,title:"Resetar Dados do Agente",size:"lg",children:G.jsxs("div",{className:"space-y-6",children:[G.jsxs("div",{className:"flex items-start space-x-3 p-4 bg-red-50 dark:bg-red-900/20 border bg-surface text-primary border-red-200 dark:border-red-800 rounded-lg",children:[G.jsx(ym,{className:"h-5 w-5 text-red-600 mt-0.5 flex-shrink-0"}),G.jsxs("div",{children:[G.jsx("h4",{className:"text-red-800 dark:text-red-400 font-medium mb-1",children:"⚠️ Ação Irreversível"}),G.jsx("p",{className:"text-red-700 dark:text-red-400 text-sm",children:"Esta operação não pode ser desfeita. Os dados removidos serão perdidos permanentemente."})]})]}),G.jsx("div",{className:"bg-surface-subtle rounded-lg p-4",children:G.jsxs("div",{className:"flex items-center space-x-3",children:[G.jsx("div",{className:"w-10 h-10 bg-active text-white rounded-lg flex items-center justify-center font-semibold text-sm",children:n.name.substring(0,2).toUpperCase()}),G.jsxs("div",{children:[G.jsx("h3",{className:"font-medium text-primary",children:n.name}),G.jsxs("p",{className:"text-sm text-secondary",children:["ID: ",n.id]})]})]})}),G.jsxs("div",{className:"space-y-3",children:[G.jsx("label",{className:"block text-sm font-medium text-primary",children:"Tipo de Dados para Resetar"}),G.jsxs("div",{className:"space-y-2",children:[G.jsxs("label",{className:"flex items-start space-x-3 p-3 border border-border-default rounded-lg hover:bg-surface-subtle cursor-pointer",children:[G.jsx("input",{type:"radio",name:"target",value:"memory",checked:"memory"===o,onChange:e=>i(e.target.value),className:"mt-1"}),G.jsxs("div",{children:[G.jsx("div",{className:"font-medium text-primary",children:"Memória (Sessions)"}),G.jsx("div",{className:"text-sm text-secondary",children:"Conversas, mensagens e histórico de sessões"})]})]}),G.jsxs("label",{className:"flex items-start space-x-3 p-3 border border-border-default rounded-lg hover:bg-surface-subtle cursor-pointer",children:[G.jsx("input",{type:"radio",name:"target",value:"observability",checked:"observability"===o,onChange:e=>i(e.target.value),className:"mt-1"}),G.jsxs("div",{children:[G.jsx("div",{className:"font-medium text-primary",children:"Observabilidade (Traces)"}),G.jsx("div",{className:"text-sm text-secondary",children:"Traces de execução, logs e métricas"})]})]}),G.jsxs("label",{className:"flex items-start space-x-3 p-3 border border-border-default rounded-lg hover:bg-surface-subtle cursor-pointer",children:[G.jsx("input",{type:"radio",name:"target",value:"both",checked:"both"===o,onChange:e=>i(e.target.value),className:"mt-1"}),G.jsxs("div",{children:[G.jsx("div",{className:"font-medium text-primary",children:"Ambos (Completo)"}),G.jsx("div",{className:"text-sm text-secondary",children:"Todos os dados do agente serão removidos"})]})]})]}),G.jsxs("p",{className:"text-sm text-secondary bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg",children:["📝 ",(()=>{switch(o){case"memory":return"Apenas dados de memória (conversas e mensagens) serão removidos.";case"observability":return"Apenas dados de observabilidade (traces e execuções) serão removidos.";case"both":return"Todos os dados (memória e observabilidade) serão removidos.";default:return""}})()]})]}),G.jsxs("div",{className:"border-t pt-4",children:[G.jsxs("button",{type:"button",onClick:()=>s(!a),className:"flex items-center space-x-2 text-sm font-medium text-primary hover:text-primary",children:[G.jsx(rm,{className:"h-4 w-4"}),G.jsx("span",{children:"Filtros Avançados (Opcional)"}),a?G.jsx(xm,{className:"h-4 w-4"}):G.jsx("span",{className:"text-secondary",children:"+"})]}),a&&G.jsxs("div",{className:"mt-4 space-y-4 bg-surface-subtle p-4 rounded-lg",children:[G.jsx("p",{className:"text-sm text-secondary mb-4",children:"Use filtros para remover apenas dados específicos. Deixe em branco para remover todos os dados do tipo selecionado."}),G.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Thread ID"}),G.jsx("input",{type:"text",value:p.threadId,onChange:e=>m(t=>({...t,threadId:e.target.value})),placeholder:"ex: phone_acme_5511999999999",className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Session ID"}),G.jsx("input",{type:"text",value:p.sessionId,onChange:e=>m(t=>({...t,sessionId:e.target.value})),placeholder:"ID da sessão específica",className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Tipo de Entidade"}),G.jsx("input",{type:"text",value:p.entityType,onChange:e=>m(t=>({...t,entityType:e.target.value})),placeholder:"ex: phone, email, user",className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Valor da Entidade"}),G.jsx("input",{type:"text",value:p.entityValue,onChange:e=>m(t=>({...t,entityValue:e.target.value})),placeholder:"ex: +5511999999999",className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Data Inicial"}),G.jsx("input",{type:"datetime-local",value:p.dateFrom,onChange:e=>m(t=>({...t,dateFrom:e.target.value})),className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium text-primary mb-1",children:"Data Final"}),G.jsx("input",{type:"datetime-local",value:p.dateTo,onChange:e=>m(t=>({...t,dateTo:e.target.value})),className:"w-full px-3 py-2 border border-border-default bg-input-bg text-primary rounded-lg text-sm focus:outline-none focus:ring-1 focus:ring-[#1654A2]/40"})]})]}),v&&G.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border bg-surface text-primary border-blue-200 dark:border-blue-800 rounded-lg p-3",children:G.jsxs("div",{className:"flex items-start space-x-2",children:[G.jsx(qp,{className:"h-4 w-4 text-blue-600 dark:text-blue-400 mt-0.5"}),G.jsxs("div",{className:"text-sm text-blue-700 dark:text-blue-400",children:[G.jsx("strong",{children:"Filtros aplicados:"})," Apenas dados que correspondam aos filtros especificados serão removidos."]})]})})]})]}),"idle"!==u&&G.jsx(vz,{status:u,successMessage:"✅ Dados do agente resetados com sucesso!",errorMessage:f||"Erro ao resetar dados do agente"}),G.jsxs("div",{className:"flex justify-end space-x-3 pt-4 border-t",children:[G.jsx("button",{type:"button",onClick:g,disabled:l,className:"px-4 py-2 border border-border-default text-primary rounded-lg hover:bg-surface-subtle disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Cancelar"}),G.jsx("button",{type:"button",onClick:async()=>{if(!l){c(!0),d("idle"),h("");try{const e={target:o,filters:{agentId:n.id,...p.threadId&&{threadId:p.threadId},...p.entityType&&{entityType:p.entityType},...p.entityValue&&{entityValue:p.entityValue},...p.sessionId&&{sessionId:p.sessionId},...p.dateFrom&&{dateFrom:p.dateFrom},...p.dateTo&&{dateTo:p.dateTo}}};await r(e),d("success"),setTimeout(()=>{t()},2e3)}catch(kE){d("error"),h(kE instanceof Error?kE.message:"Erro desconhecido")}finally{c(!1)}}},disabled:l||"success"===u,className:"flex items-center px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?G.jsxs(G.Fragment,{children:[G.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Resetando..."]}):G.jsxs(G.Fragment,{children:[G.jsx(vm,{className:"h-4 w-4 mr-2"}),"Confirmar Reset"]})})]})]})})},bz=({mode:e="portal"})=>{const{agentId:t}=function(){let{matches:e}=$.useContext(qd),t=e[e.length-1];return t?t.params:{}}(),[n]=Ff(),r=Jd(),[o,i]=$.useState(null),[a,s]=$.useState(!0),[l,c]=$.useState(null),[u,d]=$.useState(n.get("threadId")||""),[f,h]=$.useState(n.get("threadId")||void 0),[p,m]=$.useState(!1),[g,v]=$.useState("both"),[y,b]=$.useState(!1),x=n.get("apiUrl")||void 0,w=x,{traces:k,loading:_,refreshTraces:S}=(({threadId:e,mode:t="portal",agentId:n,enabled:r=!0,pollingInterval:o=5e3,customApiUrl:i}={})=>{const[a,s]=$.useState([]),[l,c]=$.useState(!1),[u,d]=$.useState(null),[f,h]=$.useState(0),p=$.useRef(null),m=$.useRef(!0),g=fD();$.useEffect(()=>(m.current=!0,()=>{m.current=!1,p.current&&clearTimeout(p.current)}),[]);const v=$.useCallback(async()=>{var o,a;if(r){if(!n)return s([]),h(0),void c(!1);try{c(!0),d(null);const r=new URLSearchParams;let l;if(e&&r.append("threadId",e),n&&r.append("agentId",n),r.append("limit","50"),r.append("orderBy","created_at"),r.append("order","desc"),"local"===t||i){const e=`${i||"http://localhost:3030"}/api/v1/observability/threads?${r.toString()}`,t=await fetch(e,{headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error(`Failed to fetch traces: ${t.statusText}`);l=await t.json()}else l=await g.get(`/observability/threads?${r.toString()}`);const u=l.threads||(null==(o=l.data)?void 0:o.threads)||l.traces||l.data||[],f=l.total||(null==(a=l.data)?void 0:a.total)||u.length;m.current&&(s(Array.isArray(u)?u:[]),h(f))}catch(v7){if(m.current){const t=v7 instanceof Error?v7.message:"Failed to fetch traces";d(t)}}finally{m.current&&c(!1)}}},[e,n,r,t,i]);return $.useEffect(()=>{r&&n&&v()},[e,n,r]),{traces:a,loading:l,error:u,refreshTraces:v,totalTraces:f}})({threadId:void 0,agentId:t||void 0,mode:e,customApiUrl:x,enabled:!!t,pollingInterval:5e3});$.useEffect(()=>{(async()=>{if(!t)return c("No agent ID provided"),void s(!1);if("local"===e||x){const e={id:t,name:n.get("agentName")||"Local Agent Test",description:n.get("agentDescription")||"Testing agent in local mode",endpointUrl:n.get("agentEndpoint")||x||"http://localhost:3030",status:"active",category:"test",triggers:[],dataSources:[],createdAt:(new Date).toISOString(),updatedAt:(new Date).toISOString(),fileTree:{data:[],success:!0}};return i(e),void s(!1)}try{s(!0);const e=await cD.getById(t);i(e.data),c(null)}catch(v7){c(v7 instanceof Error?v7.message:"Failed to load agent")}finally{s(!1)}})()},[t,e,x,n]);const C=()=>{r(-1)},E="test"===g?{test:"w-full",monitoring:"hidden"}:"monitoring"===g?{test:"hidden",monitoring:"w-full"}:{test:"w-2/5",monitoring:"w-3/5"};return a?G.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-gray-900 bg-opacity-50",children:G.jsx("div",{className:"bg-surface rounded-lg p-8",children:G.jsxs("div",{className:"flex items-center space-x-3",children:[G.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-gray-900"}),G.jsx("span",{className:"text-primary",children:"Loading agent..."})]})})}):l||!o?G.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-gray-900 bg-opacity-50",children:G.jsxs("div",{className:"bg-surface rounded-lg p-8 max-w-md",children:[G.jsx("h3",{className:"text-lg font-semibold text-red-600 mb-2",children:"Error"}),G.jsx("p",{className:"text-primary mb-4",children:l||"Agent not found"}),G.jsx("button",{onClick:C,className:"px-4 py-2 bg-active text-white rounded hover:bg-active/90",children:"Close"})]})}):G.jsxs("div",{className:"fixed inset-0 z-50 bg-surface-hover "+(p?"":"p-4"),children:[G.jsxs("div",{className:`bg-surface-elevated ${p?"h-full":"h-full rounded-lg shadow-xl"} flex flex-col overflow-hidden`,children:[G.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-border-default bg-surface",children:[G.jsxs("div",{className:"flex items-center space-x-4",children:[G.jsxs("div",{className:"flex items-center space-x-3",children:[G.jsx("div",{className:"w-10 h-10 bg-active text-white rounded-lg flex items-center justify-center font-semibold text-sm flex-shrink-0",children:o.logo||o.name.substring(0,2).toUpperCase()}),G.jsxs("div",{className:"min-w-0",children:[G.jsxs("h2",{className:"text-lg font-semibold text-primary truncate",children:[o.name," - Test & Monitor"]}),G.jsx("p",{className:"text-sm text-secondary truncate max-w-xs",title:o.description,children:o.description})]})]}),G.jsxs("div",{className:"flex items-center space-x-1 ml-8 bg-surface-hover rounded-lg p-1",children:[G.jsx("button",{onClick:()=>v("test"),className:"px-3 py-1 text-xs rounded transition-colors "+("test"===g?"bg-surface text-primary shadow-sm":"text-secondary hover:text-primary"),children:"Test Only"}),G.jsx("button",{onClick:()=>v("both"),className:"px-3 py-1 text-xs rounded transition-colors "+("both"===g?"bg-surface text-primary shadow-sm":"text-secondary hover:text-primary"),children:"Split View"}),G.jsx("button",{onClick:()=>v("monitoring"),className:"px-3 py-1 text-xs rounded transition-colors "+("monitoring"===g?"bg-surface text-primary shadow-sm":"text-secondary hover:text-primary"),children:"Monitor Only"})]})]}),G.jsxs("div",{className:"flex items-center space-x-2",children:[k.length>0&&G.jsxs("div",{className:"flex items-center space-x-2 px-3 py-1 bg-blue-50 dark:bg-blue-900/20 border bg-surface text-primary border-blue-200 dark:border-blue-800 rounded-lg",children:[G.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse"}),G.jsxs("span",{className:"text-sm font-medium text-blue-700 dark:text-blue-400",children:[k.length," trace",1!==k.length?"s":""]})]}),G.jsx("button",{onClick:()=>{m(!p)},className:"p-2 text-secondary hover:text-primary hover:bg-surface-hover rounded transition-colors",title:p?"Exit fullscreen":"Fullscreen",children:p?G.jsx(um,{className:"h-5 w-5"}):G.jsx(lm,{className:"h-5 w-5"})}),G.jsx("button",{onClick:C,className:"p-2 text-secondary hover:text-primary hover:bg-surface-hover rounded transition-colors",title:"Close",children:G.jsx(xm,{className:"h-5 w-5"})})]})]}),G.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[G.jsx("div",{className:`${E.test} border-r border-border-default transition-all duration-300`,children:G.jsx(rD,{agent:o,initialIdentity:u,onIdentityChange:e=>{d(e)},onMessageSent:async()=>{const e=[...k];setTimeout(async()=>{await S();const t=(new Date).getTime(),n=k.find(n=>{const r=new Date(n.completedAt||n.startedAt).getTime(),o=t-r<1e4,i=e.find(e=>e.threadId===n.threadId);return o&&(!i||n.completedAt!==i.completedAt)});n&&(h(n.threadId),u||d(n.threadId))},3e3)},mode:e,customEndpoint:w})}),G.jsx("div",{className:`${E.monitoring} transition-all duration-300`,children:G.jsx(mz,{traces:k,loading:_,onRefresh:S,selectedThreadId:f,onThreadSelect:e=>{h(e.threadId),d(e.threadId)},agentId:t,mode:e,customApiUrl:x})})]})]}),o&&y&&G.jsx(yz,{agent:o,isOpen:y,onClose:()=>b(!1),onConfirm:async e=>{const{agentsApi:t}=await function(e,t){let n=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const e=document.querySelector("meta[property=csp-nonce]"),r=(null==e?void 0:e.nonce)||(null==e?void 0:e.getAttribute("nonce"));n=Promise.allSettled(t.map(e=>{if((e=function(e){return"/"+e}(e))in Lp)return;Lp[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":"modulepreload",t||(o.as="script"),o.crossOrigin="",o.href=e,r&&o.setAttribute("nonce",r),document.head.appendChild(o),t?new Promise((t,n)=>{o.addEventListener("load",t),o.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function r(e){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return n.then(t=>{for(const e of t||[])"rejected"===e.status&&r(e.reason);return e().catch(r)})}(async()=>{const{agentsApi:e}=await Promise.resolve().then(()=>uD);return{agentsApi:e}},[]);await t.resetData(e),await S()}})]})};function xz(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=xz(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var wz={value:()=>{}};function kz(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new _z(r)}function _z(e){this._=e}function Sz(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Cz(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=wz,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}_z.prototype=kz.prototype={constructor:_z,on:function(e,t){var n,r,o=this._,i=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=i[a]).type)o[n]=Cz(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Cz(o[n],e.name,null);return this}for(;++a<s;)if((n=(e=i[a]).type)&&(n=Sz(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _z(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var Ez="http://www.w3.org/1999/xhtml";const Nz={svg:"http://www.w3.org/2000/svg",xhtml:Ez,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Iz(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Nz.hasOwnProperty(t)?{space:Nz[t],local:e}:e}function Oz(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ez&&t.documentElement.namespaceURI===Ez?t.createElement(e):t.createElementNS(n,e)}}function Mz(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jz(e){var t=Iz(e);return(t.local?Mz:Oz)(t)}function Tz(){}function Pz(e){return null==e?Tz:function(){return this.querySelector(e)}}function Az(){return[]}function Rz(e){return null==e?Az:function(){return this.querySelectorAll(e)}}function Lz(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function Dz(e){return function(){return this.matches(e)}}function zz(e){return function(t){return t.matches(e)}}var Fz=Array.prototype.find;function Uz(){return this.firstElementChild}var Bz=Array.prototype.filter;function $z(){return Array.from(this.children)}function Vz(e){return new Array(e.length)}function Hz(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function Wz(e,t,n,r,o,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Hz(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function qz(e,t,n,r,o,i,a){var s,l,c,u=new Map,d=t.length,f=i.length,h=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(h[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(r[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new Hz(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(h[s])===l&&(o[s]=l)}function Kz(e){return e.__data__}function Zz(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Yz(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xz(e){return function(){this.removeAttribute(e)}}function Gz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Jz(e,t){return function(){this.setAttribute(e,t)}}function Qz(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function eF(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function tF(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function nF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function rF(e){return function(){this.style.removeProperty(e)}}function oF(e,t,n){return function(){this.style.setProperty(e,t,n)}}function iF(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function aF(e,t){return e.style.getPropertyValue(t)||nF(e).getComputedStyle(e,null).getPropertyValue(t)}function sF(e){return function(){delete this[e]}}function lF(e,t){return function(){this[e]=t}}function cF(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function uF(e){return e.trim().split(/^|\s+/)}function dF(e){return e.classList||new fF(e)}function fF(e){this._node=e,this._names=uF(e.getAttribute("class")||"")}function hF(e,t){for(var n=dF(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function pF(e,t){for(var n=dF(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function mF(e){return function(){hF(this,e)}}function gF(e){return function(){pF(this,e)}}function vF(e,t){return function(){(t.apply(this,arguments)?hF:pF)(this,e)}}function yF(){this.textContent=""}function bF(e){return function(){this.textContent=e}}function xF(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function wF(){this.innerHTML=""}function kF(e){return function(){this.innerHTML=e}}function _F(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function SF(){this.nextSibling&&this.parentNode.appendChild(this)}function CF(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function EF(){return null}function NF(){var e=this.parentNode;e&&e.removeChild(this)}function IF(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function OF(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function MF(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function jF(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function TF(e,t,n){var r=nF(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function PF(e,t){return function(){return TF(this,e,t)}}function AF(e,t){return function(){return TF(this,e,t.apply(this,arguments))}}Hz.prototype={constructor:Hz,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},fF.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var RF=[null];function LF(e,t){this._groups=e,this._parents=t}function DF(){return new LF([[document.documentElement]],RF)}function zF(e){return"string"==typeof e?new LF([[document.querySelector(e)]],[document.documentElement]):new LF([[e]],RF)}function FF(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}LF.prototype=DF.prototype={constructor:LF,select:function(e){"function"!=typeof e&&(e=Pz(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new LF(r,this._parents)},selectAll:function(e){e="function"==typeof e?Lz(e):Rz(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),o.push(a));return new LF(r,o)},selectChild:function(e){return this.select(null==e?Uz:function(e){return function(){return Fz.call(this.children,e)}}("function"==typeof e?e:zz(e)))},selectChildren:function(e){return this.selectAll(null==e?$z:function(e){return function(){return Bz.call(this.children,e)}}("function"==typeof e?e:zz(e)))},filter:function(e){"function"!=typeof e&&(e=Dz(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new LF(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,Kz);var n,r=t?qz:Wz,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],f=i[u],h=f.length,p=Zz(e.call(d,d&&d.__data__,u,o)),m=p.length,g=l[u]=new Array(m),v=s[u]=new Array(m);r(d,f,g,v,c[u]=new Array(h),p,t);for(var y,b,x=0,w=0;x<m;++x)if(y=g[x]){for(x>=w&&(w=x+1);!(b=v[w])&&++w<m;);y._next=b||null}}return(s=new LF(s,o))._enter=l,s._exit=c,s},enter:function(){return new LF(this._enter||this._groups.map(Vz),this._parents)},exit:function(){return new LF(this._exit||this._groups.map(Vz),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c,u=n[l],d=r[l],f=u.length,h=s[l]=new Array(f),p=0;p<f;++p)(c=u[p]||d[p])&&(h[p]=c);for(;l<o;++l)s[l]=n[l];return new LF(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Yz);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,c=o[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new LF(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=Iz(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Gz:Xz:"function"==typeof t?n.local?tF:eF:n.local?Qz:Jz)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?rF:"function"==typeof t?iF:oF)(e,t,null==n?"":n)):aF(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?sF:"function"==typeof t?cF:lF)(e,t)):this.node()[e]},classed:function(e,t){var n=uF(e+"");if(arguments.length<2){for(var r=dF(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?vF:t?mF:gF)(n,t))},text:function(e){return arguments.length?this.each(null==e?yF:("function"==typeof e?xF:bF)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?wF:("function"==typeof e?_F:kF)(e)):this.node().innerHTML},raise:function(){return this.each(SF)},lower:function(){return this.each(CF)},append:function(e){var t="function"==typeof e?e:jz(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:jz(e),r=null==t?EF:"function"==typeof t?t:Pz(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(NF)},clone:function(e){return this.select(e?OF:IF)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?jF:MF,r=0;r<a;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?AF:PF)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const UF={passive:!1},BF={capture:!0,passive:!1};function $F(e){e.stopImmediatePropagation()}function VF(e){e.preventDefault(),e.stopImmediatePropagation()}function HF(e){var t=e.document.documentElement,n=zF(e).on("dragstart.drag",VF,BF);"onselectstart"in t?n.on("selectstart.drag",VF,BF):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function WF(e,t){var n=e.document.documentElement,r=zF(e).on("dragstart.drag",null);t&&(r.on("click.drag",VF,BF),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const qF=e=>()=>e;function KF(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function ZF(e){return!e.ctrlKey&&!e.button}function YF(){return this.parentNode}function XF(e,t){return null==t?{x:e.x,y:e.y}:t}function GF(){return navigator.maxTouchPoints||"ontouchstart"in this}function JF(){var e,t,n,r,o=ZF,i=YF,a=XF,s=GF,l={},c=kz("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",h).filter(s).on("touchstart.drag",g).on("touchmove.drag",v,UF).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,s){if(!r&&o.call(this,a,s)){var l=b(this,i.call(this,a,s),a,s,"mouse");l&&(zF(a.view).on("mousemove.drag",p,BF).on("mouseup.drag",m,BF),HF(a.view),$F(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function p(r){if(VF(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}l.mouse("drag",r)}function m(e){zF(e.view).on("mousemove.drag mouseup.drag",null),WF(e.view,n),VF(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(r=b(this,s,e,t,a[n].identifier,a[n]))&&($F(e),r("start",e,a[n]))}}function v(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(VF(e),n("drag",e,r[t]))}function y(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=l[o[t].identifier])&&($F(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var s,d,h,p=c.copy(),m=FF(i||n,t);if(null!=(h=a.call(e,new KF("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:p}),r)))return s=h.x-m[0]||0,d=h.y-m[1]||0,function n(i,a,c){var g,v=m;switch(i){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=FF(c||a,t),g=u}p.call(i,e,new KF(i,{sourceEvent:a,subject:h,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-v[0],dy:m[1]-v[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:qF(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:qF(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:qF(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:qF(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function QF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function eU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function tU(){}KF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var nU=.7,rU=1/nU,oU="\\s*([+-]?\\d+)\\s*",iU="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",aU="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sU=/^#([0-9a-f]{3,8})$/,lU=new RegExp(`^rgb\\(${oU},${oU},${oU}\\)$`),cU=new RegExp(`^rgb\\(${aU},${aU},${aU}\\)$`),uU=new RegExp(`^rgba\\(${oU},${oU},${oU},${iU}\\)$`),dU=new RegExp(`^rgba\\(${aU},${aU},${aU},${iU}\\)$`),fU=new RegExp(`^hsl\\(${iU},${aU},${aU}\\)$`),hU=new RegExp(`^hsla\\(${iU},${aU},${aU},${iU}\\)$`),pU={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function mU(){return this.rgb().formatHex()}function gU(){return this.rgb().formatRgb()}function vU(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sU.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?yU(t):3===n?new wU(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?bU(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?bU(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=lU.exec(e))?new wU(t[1],t[2],t[3],1):(t=cU.exec(e))?new wU(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=uU.exec(e))?bU(t[1],t[2],t[3],t[4]):(t=dU.exec(e))?bU(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=fU.exec(e))?NU(t[1],t[2]/100,t[3]/100,1):(t=hU.exec(e))?NU(t[1],t[2]/100,t[3]/100,t[4]):pU.hasOwnProperty(e)?yU(pU[e]):"transparent"===e?new wU(NaN,NaN,NaN,0):null}function yU(e){return new wU(e>>16&255,e>>8&255,255&e,1)}function bU(e,t,n,r){return r<=0&&(e=t=n=NaN),new wU(e,t,n,r)}function xU(e,t,n,r){return 1===arguments.length?((o=e)instanceof tU||(o=vU(o)),o?new wU((o=o.rgb()).r,o.g,o.b,o.opacity):new wU):new wU(e,t,n,null==r?1:r);var o}function wU(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function kU(){return`#${EU(this.r)}${EU(this.g)}${EU(this.b)}`}function _U(){const e=SU(this.opacity);return`${1===e?"rgb(":"rgba("}${CU(this.r)}, ${CU(this.g)}, ${CU(this.b)}${1===e?")":`, ${e})`}`}function SU(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function CU(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function EU(e){return((e=CU(e))<16?"0":"")+e.toString(16)}function NU(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new OU(e,t,n,r)}function IU(e){if(e instanceof OU)return new OU(e.h,e.s,e.l,e.opacity);if(e instanceof tU||(e=vU(e)),!e)return new OU;if(e instanceof OU)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new OU(a,s,l,e.opacity)}function OU(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function MU(e){return(e=(e||0)%360)<0?e+360:e}function jU(e){return Math.max(0,Math.min(1,e||0))}function TU(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}QF(tU,vU,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mU,formatHex:mU,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return IU(this).formatHsl()},formatRgb:gU,toString:gU}),QF(wU,xU,eU(tU,{brighter(e){return e=null==e?rU:Math.pow(rU,e),new wU(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?nU:Math.pow(nU,e),new wU(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new wU(CU(this.r),CU(this.g),CU(this.b),SU(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kU,formatHex:kU,formatHex8:function(){return`#${EU(this.r)}${EU(this.g)}${EU(this.b)}${EU(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:_U,toString:_U})),QF(OU,function(e,t,n,r){return 1===arguments.length?IU(e):new OU(e,t,n,null==r?1:r)},eU(tU,{brighter(e){return e=null==e?rU:Math.pow(rU,e),new OU(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?nU:Math.pow(nU,e),new OU(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new wU(TU(e>=240?e-240:e+120,o,r),TU(e,o,r),TU(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new OU(MU(this.h),jU(this.s),jU(this.l),SU(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=SU(this.opacity);return`${1===e?"hsl(":"hsla("}${MU(this.h)}, ${100*jU(this.s)}%, ${100*jU(this.l)}%${1===e?")":`, ${e})`}`}}));const PU=e=>()=>e;function AU(e){return 1===(e=+e)?RU:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):PU(isNaN(t)?n:t)}}function RU(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):PU(isNaN(e)?t:e)}const LU=function e(t){var n=AU(t);function r(e,t){var r=n((e=xU(e)).r,(t=xU(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=RU(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function DU(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}}function zU(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=WU(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}function FU(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function UU(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function BU(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=WU(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}var $U=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,VU=new RegExp($U.source,"g");function HU(e,t){var n,r,o,i=$U.lastIndex=VU.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=$U.exec(e))&&(r=VU.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:UU(n,r)})),i=VU.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function WU(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?PU(t):("number"===o?UU:"string"===o?(n=vU(t))?(t=n,LU):HU:t instanceof vU?LU:t instanceof Date?FU:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?zU:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?BU:UU:DU))(e,t)}var qU,KU=180/Math.PI,ZU={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function YU(e,t,n,r,o,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*KU,skewX:Math.atan(l)*KU,scaleX:a,scaleY:s}}function XU(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,r,o,i,a,s){if(e!==o||r!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:UU(e,o)},{i:l-2,x:UU(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:UU(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:UU(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,s,l),function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:UU(e,n)},{i:s-2,x:UU(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var GU=XU(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ZU:YU(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),JU=XU(function(e){return null==e?ZU:(qU||(qU=document.createElementNS("http://www.w3.org/2000/svg","g")),qU.setAttribute("transform",e),(e=qU.transform.baseVal.consolidate())?YU((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ZU)},", ",")",")");function QU(e){return((e=Math.exp(e))+1/e)/2}const eB=function e(t,n,r){function o(e,o){var i,a,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],h=u-s,p=d-l,m=h*h+p*p;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[s+e*h,l+e*p,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),v=(f*f-c*c+r*m)/(2*c*n*g),y=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(v*v+1)-v),x=Math.log(Math.sqrt(y*y+1)-y);a=(x-b)/t,i=function(e){var r,o=e*a,i=QU(b),u=c/(n*g)*(i*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*h,l+u*p,c*i/QU(t*o+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4);var tB,nB,rB=0,oB=0,iB=0,aB=0,sB=0,lB=0,cB="object"==typeof performance&&performance.now?performance:Date,uB="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function dB(){return sB||(uB(fB),sB=cB.now()+lB)}function fB(){sB=0}function hB(){this._call=this._time=this._next=null}function pB(e,t,n){var r=new hB;return r.restart(e,t,n),r}function mB(){sB=(aB=cB.now())+lB,rB=oB=0;try{!function(){dB(),++rB;for(var e,t=tB;t;)(e=sB-t._time)>=0&&t._call.call(void 0,e),t=t._next;--rB}()}finally{rB=0,function(){var e,t,n=tB,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:tB=t);nB=e,vB(r)}(),sB=0}}function gB(){var e=cB.now(),t=e-aB;t>1e3&&(lB-=t,aB=e)}function vB(e){rB||(oB&&(oB=clearTimeout(oB)),e-sB>24?(e<1/0&&(oB=setTimeout(mB,e-cB.now()-lB)),iB&&(iB=clearInterval(iB))):(iB||(aB=cB.now(),iB=setInterval(gB,1e3)),rB=1,uB(mB)))}function yB(e,t,n){var r=new hB;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}hB.prototype=pB.prototype={constructor:hB,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?dB():+n)+(null==t?0:+t),this._next||nB===this||(nB?nB._next=this:tB=this,nB=this),this._call=e,this._time=n,vB()},stop:function(){this._call&&(this._call=null,this._time=1/0,vB())}};var bB=kz("start","end","cancel","interrupt"),xB=[];function wB(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return yB(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(yB(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=pB(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:bB,tween:xB,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function kB(e,t){var n=SB(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function _B(e,t){var n=SB(e,t);if(n.state>3)throw new Error("too late; already running");return n}function SB(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function CB(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function EB(e,t){var n,r;return function(){var o=_B(this,e),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function NB(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=_B(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function IB(e,t,n){var r=e._id;return e.each(function(){var e=_B(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return SB(e,r).value[t]}}function OB(e,t){var n;return("number"==typeof t?UU:t instanceof vU?LU:(n=vU(t))?(t=n,LU):HU)(e,t)}function MB(e){return function(){this.removeAttribute(e)}}function jB(e){return function(){this.removeAttributeNS(e.space,e.local)}}function TB(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function PB(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function AB(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttribute(e)}}function RB(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttributeNS(e.space,e.local)}}function LB(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function DB(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function zB(e,t){return function(){kB(this,e).delay=+t.apply(this,arguments)}}function FB(e,t){return t=+t,function(){kB(this,e).delay=t}}function UB(e,t){return function(){_B(this,e).duration=+t.apply(this,arguments)}}function BB(e,t){return t=+t,function(){_B(this,e).duration=t}}var $B=DF.prototype.constructor;function VB(e){return function(){this.style.removeProperty(e)}}var HB=0;function WB(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qB(){return++HB}var KB=DF.prototype;WB.prototype={constructor:WB,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Pz(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,c=r[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,wB(d[f],t,n,f,d,SB(s,n)));return new WB(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Rz(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,h=e.call(l,l.__data__,d,c),p=SB(l,n),m=0,g=h.length;m<g;++m)(f=h[m])&&wB(f,t,n,m,h,p);i.push(h),a.push(l)}return new WB(i,a,t,n)},selectChild:KB.selectChild,selectChildren:KB.selectChildren,filter:function(e){"function"!=typeof e&&(e=Dz(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new WB(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,f=a[s]=new Array(d),h=0;h<d;++h)(l=c[h]||u[h])&&(f[h]=l);for(;s<r;++s)a[s]=t[s];return new WB(a,this._parents,this._name,this._id)},selection:function(){return new $B(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=qB(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=SB(a,t);wB(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new WB(r,this._parents,e,n)},call:KB.call,nodes:KB.nodes,node:KB.node,size:KB.size,empty:KB.empty,each:KB.each,on:function(e,t){var n=this._id;return arguments.length<2?SB(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?kB:_B;return function(){var a=i(this,e),s=a.on;s!==r&&(o=(r=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=Iz(e),r="transform"===n?JU:OB;return this.attrTween(e,"function"==typeof t?(n.local?RB:AB)(n,r,IB(this,"attr."+e,t)):null==t?(n.local?jB:MB)(n):(n.local?PB:TB)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=Iz(e);return this.tween(n,(r.local?LB:DB)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?GU:OB;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=aF(this,e),a=(this.style.removeProperty(e),aF(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,VB(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=aF(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=aF(this,e)),a===l?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}(e,r,IB(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,s="end."+a;return function(){var l=_B(this,e),c=l.on,u=null==l.value[a]?i||(i=VB(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=aF(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(IB(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}));var e},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=SB(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?EB:NB)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?zB:FB)(t,e)):SB(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?UB:BB)(t,e)):SB(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){_B(this,e).ease=t}}(t,e)):SB(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;_B(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){0===--o&&i()}};n.each(function(){var n=_B(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&i()})},[Symbol.iterator]:KB[Symbol.iterator]};var ZB={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function YB(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}DF.prototype.interrupt=function(e){return this.each(function(){CB(this,e)})},DF.prototype.transition=function(e){var t,n;e instanceof WB?(t=e._id,e=e._name):(t=qB(),(n=ZB).time=dB(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)(a=s[c])&&wB(a,e,t,c,s,n||YB(a,t));return new WB(r,this._parents,e,t)};const XB=e=>()=>e;function GB(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function JB(e,t,n){this.k=e,this.x=t,this.y=n}JB.prototype={constructor:JB,scale:function(e){return 1===e?this:new JB(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new JB(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var QB=new JB(1,0,0);function e$(e){for(;!e.__zoom;)if(!(e=e.parentNode))return QB;return e.__zoom}function t$(e){e.stopImmediatePropagation()}function n$(e){e.preventDefault(),e.stopImmediatePropagation()}function r$(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function o$(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function i$(){return this.__zoom||QB}function a$(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function s$(){return navigator.maxTouchPoints||"ontouchstart"in this}function l$(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function c$(){var e,t,n,r=r$,o=o$,i=l$,a=a$,s=s$,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=eB,f=kz("start","zoom","end"),h=0,p=10;function m(e){e.property("__zoom",i$).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",_).on("dblclick.zoom",S).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new JB(t,e.x,e.y)}function v(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new JB(e.k,r,o)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){x(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,i=arguments,a=x(e,i).event(r),s=o.apply(e,i),l=null==n?y(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,h=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=h(e),n=c/t[2];e=new JB(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function x(e,t,n){return!n&&e.__zooming||new w(e,t)}function w(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function k(e,...t){if(r.apply(this,arguments)){var n=x(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=FF(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],CB(this),n.start()}n$(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(v(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function _(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=x(this,t,!0).event(e),s=zF(e.view).on("mousemove.zoom",function(e){if(n$(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(v(a.that.__zoom,a.mouse[0]=FF(e,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),WF(e.view,a.moved),n$(e),a.event(e).end()},!0),l=FF(e,o),u=e.clientX,d=e.clientY;HF(e.view),t$(e),a.mouse=[l,this.__zoom.invert(l)],CB(this),a.start()}}function S(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=FF(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(v(g(n,l),a,s),o.apply(this,t),c);n$(e),u>0?zF(this).transition().duration(u).call(b,d,a,e):zF(this).call(m.transform,d,a,e)}}function C(n,...o){if(r.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=x(this,o,n.changedTouches.length===u).event(n);for(t$(n),a=0;a<u;++a)l=[l=FF(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),CB(this),d.start())}}function E(e,...t){if(this.__zooming){var n,r,o,a,s=x(this,t).event(e),l=e.changedTouches,u=l.length;for(n$(e),n=0;n<u;++n)o=FF(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],h=s.touch1[0],p=s.touch1[1],m=(m=h[0]-d[0])*m+(m=h[1]-d[1])*m,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;r=g(r,Math.sqrt(m/y)),o=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(v(r,o,a),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,i,a=x(this,r).event(e),s=e.changedTouches,l=s.length;for(t$(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=FF(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var c=zF(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",i$),e!==o?b(e,t,n,r):o.interrupt().each(function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(v(g(r,l),a,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return i(QB.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,a)},w.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=zF(this.that).datum();f.call(e,this.that,new GB(e,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:XB(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:XB(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:XB(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:XB([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,m):Math.sqrt(h)},m.tapDistance=function(e){return arguments.length?(p=+e,m):p},m}e$.prototype=JB.prototype;const u$=()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",d$=e=>`Node type "${e}" not found. Using fallback type "default".`,f$=()=>"The React Flow parent container needs a width and a height to render the graph.",h$=()=>"Only child nodes can use a parent extent.",p$=e=>`Marker type "${e}" doesn't exist.`,m$=(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`,g$=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",v$=e=>`Edge type "${e}" not found. Using fallback type "default".`,y$=e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,b$=()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",x$=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],w$=["Enter"," ","Escape"],k$={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var _$,S$,C$,E$,N$,I$;(S$=_$||(_$={})).Strict="strict",S$.Loose="loose",(E$=C$||(C$={})).Free="free",E$.Vertical="vertical",E$.Horizontal="horizontal",(I$=N$||(N$={})).Partial="partial",I$.Full="full";const O$={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var M$,j$,T$,P$,A$,R$;(j$=M$||(M$={})).Bezier="default",j$.Straight="straight",j$.Step="step",j$.SmoothStep="smoothstep",j$.SimpleBezier="simplebezier",(P$=T$||(T$={})).Arrow="arrow",P$.ArrowClosed="arrowclosed",(R$=A$||(A$={})).Left="left",R$.Top="top",R$.Right="right",R$.Bottom="bottom";const L$={[A$.Left]:A$.Right,[A$.Right]:A$.Left,[A$.Top]:A$.Bottom,[A$.Bottom]:A$.Top};function D$(e){return null===e?null:e?"valid":"invalid"}const z$=e=>"id"in e&&"source"in e&&"target"in e,F$=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),U$=(e,t=[0,0])=>{const{width:n,height:r}=pV(e),o=e.origin??t,i=n*o[0],a=r*o[1];return{x:e.position.x-i,y:e.position.y-a}},B$=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=G$(n,tV(e)),r=!0)}),r?Q$(n):{x:0,y:0,width:0,height:0}},$$=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1)=>{const s={...lV(t,[n,r,o]),width:t.width/o,height:t.height/o},l=[];for(const c of e.values()){const{measured:e,selectable:t=!0,hidden:n=!1}=c;if(a&&!t||n)continue;const r=e.width??c.width??c.initialWidth??null,o=e.height??c.height??c.initialHeight??null,u=rV(s,eV(c)),d=(r??0)*(o??0),f=i&&u>0;(!c.internals.handleBounds||f||u>=d||c.dragging)&&l.push(c)}return l};async function V$({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,r=(null==t?void 0:t.nodes)?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!(null==t?void 0:t.includeHiddenNodes)&&e.hidden||r&&!r.has(e.id)||n.set(e.id,e)}),n}(e,a),l=B$(s),c=dV(l,t,n,(null==a?void 0:a.minZoom)??o,(null==a?void 0:a.maxZoom)??i,(null==a?void 0:a.padding)??.1);return await r.setViewport(c,{duration:null==a?void 0:a.duration,ease:null==a?void 0:a.ease,interpolate:null==a?void 0:a.interpolate}),Promise.resolve(!0)}function H$({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const a=n.get(e),s=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=a.origin??r;let d=a.extent||o;if("parent"!==a.extent||a.expandParent)s&&hV(a.extent)&&(d=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else null==i||i("005",h$());const f=hV(d)?K$(t,d,a.measured):t;return void 0!==a.measured.width&&void 0!==a.measured.height||null==i||i("015",b$()),{position:{x:f.x-l+(a.measured.width??0)*u[0],y:f.y-c+(a.measured.height??0)*u[1]},positionAbsolute:f}}async function W$({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(e=>e.id)),a=[];for(const f of n){if(!1===f.deletable)continue;const e=i.has(f.id),t=!e&&f.parentId&&a.find(e=>e.id===f.parentId);(e||t)&&a.push(f)}const s=new Set(t.map(e=>e.id)),l=r.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(a,l),u=c;for(const f of l){s.has(f.id)&&!u.find(e=>e.id===f.id)&&u.push(f)}if(!o)return{edges:u,nodes:a};const d=await o({nodes:a,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:a}:{edges:[],nodes:[]}:d}const q$=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),K$=(e={x:0,y:0},t,n)=>({x:q$(e.x,t[0][0],t[1][0]-((null==n?void 0:n.width)??0)),y:q$(e.y,t[0][1],t[1][1]-((null==n?void 0:n.height)??0))});function Z$(e,t,n){const{width:r,height:o}=pV(n),{x:i,y:a}=n.internals.positionAbsolute;return K$(e,[[i,a],[i+r,a+o]],t)}const Y$=(e,t,n)=>e<t?q$(Math.abs(e-t),1,t)/t:e>n?-q$(Math.abs(e-n),1,t)/t:0,X$=(e,t,n=15,r=40)=>[Y$(e.x,r,t.width-r)*n,Y$(e.y,r,t.height-r)*n],G$=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),J$=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Q$=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),eV=(e,t=[0,0])=>{var n,r;const{x:o,y:i}=F$(e)?e.internals.positionAbsolute:U$(e,t);return{x:o,y:i,width:(null==(n=e.measured)?void 0:n.width)??e.width??e.initialWidth??0,height:(null==(r=e.measured)?void 0:r.height)??e.height??e.initialHeight??0}},tV=(e,t=[0,0])=>{var n,r;const{x:o,y:i}=F$(e)?e.internals.positionAbsolute:U$(e,t);return{x:o,y:i,x2:o+((null==(n=e.measured)?void 0:n.width)??e.width??e.initialWidth??0),y2:i+((null==(r=e.measured)?void 0:r.height)??e.height??e.initialHeight??0)}},nV=(e,t)=>Q$(G$(J$(e),J$(t))),rV=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},oV=e=>iV(e.width)&&iV(e.height)&&iV(e.x)&&iV(e.y),iV=e=>!isNaN(e)&&isFinite(e),aV=(e,t)=>{},sV=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),lV=({x:e,y:t},[n,r,o],i=!1,a=[1,1])=>{const s={x:(e-n)/o,y:(t-r)/o};return i?sV(s,a):s},cV=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function uV(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return 0}const dV=(e,t,n,r,o,i)=>{const a=function(e,t,n){if("string"==typeof e||"number"==typeof e){const r=uV(e,n),o=uV(e,t);return{top:r,right:o,bottom:r,left:o,x:2*o,y:2*r}}if("object"==typeof e){const r=uV(e.top??e.y??0,n),o=uV(e.bottom??e.y??0,n),i=uV(e.left??e.x??0,t),a=uV(e.right??e.x??0,t);return{top:r,right:a,bottom:o,left:i,x:i+a,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),s=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(s,l),u=q$(c,r,o),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,h=function(e,t,n,r,o,i){const{x:a,y:s}=cV(e,[t,n,r]),{x:l,y:c}=cV({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=o-l,d=i-c;return{left:Math.floor(a),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),p=Math.min(h.left-a.left,0),m=Math.min(h.top-a.top,0);return{x:d-p+Math.min(h.right-a.right,0),y:f-m+Math.min(h.bottom-a.bottom,0),zoom:u}},fV=()=>{var e;return"undefined"!=typeof navigator&&(null==(e=null==navigator?void 0:navigator.userAgent)?void 0:e.indexOf("Mac"))>=0};function hV(e){return null!=e&&"parent"!==e}function pV(e){var t,n;return{width:(null==(t=e.measured)?void 0:t.width)??e.width??e.initialWidth??0,height:(null==(n=e.measured)?void 0:n.height)??e.height??e.initialHeight??0}}function mV(e){var t,n;return void 0!==((null==(t=e.measured)?void 0:t.width)??e.width??e.initialWidth)&&void 0!==((null==(n=e.measured)?void 0:n.height)??e.height??e.initialHeight)}function gV(e,t={width:0,height:0},n,r,o){const i={...e},a=r.get(n);if(a){const e=a.origin||o;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function vV(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yV(e){return{...k$,...e||{}}}function bV(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:a}=CV(e),s=lV({x:i-((null==o?void 0:o.left)??0),y:a-((null==o?void 0:o.top)??0)},r),{x:l,y:c}=n?sV(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const xV=e=>({width:e.offsetWidth,height:e.offsetHeight}),wV=e=>{var t;return(null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))||(null==window?void 0:window.document)},kV=["INPUT","SELECT","TEXTAREA"];function _V(e){var t,n;const r=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target;if(1!==(null==r?void 0:r.nodeType))return!1;return kV.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const SV=e=>"clientX"in e,CV=(e,t)=>{var n,r;const o=SV(e),i=o?e.clientX:null==(n=e.touches)?void 0:n[0].clientX,a=o?e.clientY:null==(r=e.touches)?void 0:r[0].clientY;return{x:i-((null==t?void 0:t.left)??0),y:a-((null==t?void 0:t.top)??0)}},EV=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{const i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:o,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/r,y:(i.top-n.top)/r,...xV(t)}}):null};function NV({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function IV(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function OV({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case A$.Left:return[t-IV(t-r,i),n];case A$.Right:return[t+IV(r-t,i),n];case A$.Top:return[t,n-IV(n-o,i)];case A$.Bottom:return[t,n+IV(o-n,i)]}}function MV({sourceX:e,sourceY:t,sourcePosition:n=A$.Bottom,targetX:r,targetY:o,targetPosition:i=A$.Top,curvature:a=.25}){const[s,l]=OV({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=OV({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,h,p]=NV({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,h,p]}function jV({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function TV({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=G$(tV(e),tV(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const a={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return rV(a,Q$(i))>0}const PV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`;function AV({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,s]=jV({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}const RV={[A$.Left]:{x:-1,y:0},[A$.Right]:{x:1,y:0},[A$.Top]:{x:0,y:-1},[A$.Bottom]:{x:0,y:1}},LV=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function DV({source:e,sourcePosition:t=A$.Bottom,target:n,targetPosition:r=A$.Top,center:o,offset:i,stepPosition:a}){const s=RV[t],l=RV[r],c={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+l.x*i,y:n.y+l.y*i},d=(({source:e,sourcePosition:t=A$.Bottom,target:n})=>t===A$.Left||t===A$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:u}),f=0!==d.x?"x":"y",h=d[f];let p,m,g=[];const v={x:0,y:0},y={x:0,y:0},[,,b,x]=jV({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){"x"===f?(p=o.x??c.x+(u.x-c.x)*a,m=o.y??(c.y+u.y)/2):(p=o.x??(c.x+u.x)/2,m=o.y??c.y+(u.y-c.y)*a);const e=[{x:p,y:c.y},{x:p,y:u.y}],t=[{x:c.x,y:m},{x:u.x,y:m}];g=s[f]===h?"x"===f?e:t:"x"===f?t:e}else{const o=[{x:c.x,y:u.y}],a=[{x:u.x,y:c.y}];if(g="x"===f?s.x===h?a:o:s.y===h?o:a,t===r){const t=Math.abs(e[f]-n[f]);if(t<=i){const r=Math.min(i-1,i-t);s[f]===h?v[f]=(c[f]>e[f]?-1:1)*r:y[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){const e="x"===f?"y":"x",t=s[f]===l[e],n=c[e]>u[e],r=c[e]<u[e];(1===s[f]&&(!t&&n||t&&r)||1!==s[f]&&(!t&&r||t&&n))&&(g="x"===f?o:a)}const d={x:c.x+v.x,y:c.y+v.y},b={x:u.x+y.x,y:u.y+y.y};Math.max(Math.abs(d.x-g[0].x),Math.abs(b.x-g[0].x))>=Math.max(Math.abs(d.y-g[0].y),Math.abs(b.y-g[0].y))?(p=(d.x+b.x)/2,m=g[0].y):(p=g[0].x,m=(d.y+b.y)/2)}return[[e,{x:c.x+v.x,y:c.y+v.y},...g,{x:u.x+y.x,y:u.y+y.y},n],p,m,b,x]}function zV({sourceX:e,sourceY:t,sourcePosition:n=A$.Bottom,targetX:r,targetY:o,targetPosition:i=A$.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,h,p,m]=DV({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:l},offset:c,stepPosition:u}),g=d.reduce((e,t,n)=>{let r="";return r=n>0&&n<d.length-1?function(e,t,n,r){const o=Math.min(LV(e,t)/2,LV(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*s},${a}`}(d[n-1],t,d[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[g,f,h,p,m]}function FV(e){var t;return e&&!(!e.internals.handleBounds&&!(null==(t=e.handles)?void 0:t.length))&&!!(e.measured.width||e.width||e.initialWidth)}function UV(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function BV(e,t,n=A$.Left,r=!1){const o=((null==t?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((null==t?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:a,height:s}=t??pV(e);if(r)return{x:o+a/2,y:i+s/2};switch((null==t?void 0:t.position)??n){case A$.Top:return{x:o+a/2,y:i};case A$.Right:return{x:o+a,y:i+s/2};case A$.Bottom:return{x:o+a/2,y:i+s};case A$.Left:return{x:o,y:i+s/2}}}function $V(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function VV(e,t){if(!e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}const HV={nodeOrigin:[0,0],nodeExtent:x$,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},WV={...HV,checkEquality:!0};function qV(e,t){const n={...e};for(const r in t)void 0!==t[r]&&(n[r]=t[r]);return n}function KV(e,t){if(!e.handles)return e.measured?null==t?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const t={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};"source"===o.type?n.push(t):"target"===o.type&&r.push(t)}return{source:n,target:r}}function ZV(e){return"manual"===e}function YV(e,t,n,r={}){var o,i;const a=qV(WV,r),s={i:0},l=new Map(t),c=(null==a?void 0:a.elevateNodesOnSelect)&&!ZV(a.zIndexMode)?1e3:0;let u=e.length>0;t.clear(),n.clear();for(const d of e){let e=l.get(d.id);if(a.checkEquality&&d===(null==e?void 0:e.internals.userNode))t.set(d.id,e);else{const n=U$(d,a.nodeOrigin),r=hV(d.extent)?d.extent:a.nodeExtent,s=K$(n,r,pV(d));e={...a.defaults,...d,measured:{width:null==(o=d.measured)?void 0:o.width,height:null==(i=d.measured)?void 0:i.height},internals:{positionAbsolute:s,handleBounds:KV(d,e),z:GV(d,c,a.zIndexMode),userNode:d}},t.set(d.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(u=!1),d.parentId&&XV(e,t,n,r,s)}return u}function XV(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:s,zIndexMode:l}=qV(HV,r),c=e.parentId,u=t.get(c);if(!u)return;!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),o&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===l&&(u.internals.rootParentIndex=++o.i,u.internals.z=u.internals.z+10*o.i),o&&void 0!==u.internals.rootParentIndex&&(o.i=u.internals.rootParentIndex);const d=i&&!ZV(l)?1e3:0,{x:f,y:h,z:p}=function(e,t,n,r,o,i){const{x:a,y:s}=t.internals.positionAbsolute,l=pV(e),c=U$(e,n),u=hV(e.extent)?K$(c,e.extent,l):c;let d=K$({x:a+u.x,y:s+u.y},r,l);"parent"===e.extent&&(d=Z$(d,l,t));const f=GV(e,o,i),h=t.internals.z??0;return{x:d.x,y:d.y,z:h>=f?h+1:f}}(e,u,a,s,d,l),{positionAbsolute:m}=e.internals,g=f!==m.x||h!==m.y;(g||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:f,y:h}:m,z:p}})}function GV(e,t,n){const r=iV(e.zIndex)?e.zIndex:0;return ZV(n)?r:r+(e.selected?t:0)}function JV(e,t,n,r=[0,0]){var o;const i=[],a=new Map;for(const s of e){const e=t.get(s.parentId);if(!e)continue;const n=(null==(o=a.get(s.parentId))?void 0:o.expandedRect)??eV(e),r=nV(n,s.rect);a.set(s.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:o},a)=>{var s;const l=o.internals.positionAbsolute,c=pV(o),u=o.origin??r,d=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,f=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,h=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(h-c.width)*u[0],g=(p-c.height)*u[1];(d>0||f>0||m||g)&&(i.push({id:a,type:"position",position:{x:o.position.x-d+m,y:o.position.y-f+g}}),null==(s=n.get(a))||s.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:"position",position:{x:t.position.x+d,y:t.position.y+f}})})),(c.width<t.width||c.height<t.height||d||f)&&i.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:h+(d?u[0]*d-m:0),height:p+(f?u[1]*f-g:0)}})}),i}function QV(e,t,n,r,o,i){let a=o;const s=r.get(a)||new Map;r.set(a,s.set(n,t)),a=`${o}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),i){a=`${o}-${e}-${i}`;const s=r.get(a)||new Map;r.set(a,s.set(n,t))}}function eH(e,t,n){e.clear(),t.clear();for(const r of n){const{source:n,target:o,sourceHandle:i=null,targetHandle:a=null}=r,s={edgeId:r.id,source:n,target:o,sourceHandle:i,targetHandle:a},l=`${n}-${i}--${o}-${a}`;QV("source",s,`${o}-${a}--${n}-${i}`,e,n,i),QV("target",s,l,e,o,a),t.set(r.id,r)}}function tH(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||tH(n,t))}function nH(e,t,n){var r;let o=e;do{if(null==(r=null==o?void 0:o.matches)?void 0:r.call(o,t))return!0;if(o===n)return!1;o=null==o?void 0:o.parentElement}while(o);return!1}function rH({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,i,a;const s=[];for(const[c,u]of t){const e=null==(o=n.get(c))?void 0:o.internals.userNode;e&&s.push({...e,position:u.position,dragging:r})}if(!e)return[s[0],s];const l=null==(i=n.get(e))?void 0:i.internals.userNode;return[l?{...l,position:(null==(a=t.get(e))?void 0:a.position)||l.position,dragging:r}:s[0],s]}function oH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},a=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,h=!1,p=!1,m=null;return{update:function({noDragClassName:g,handleSelector:v,domNode:y,isSelectable:b,nodeId:x,nodeClickDistance:w=0}){function k({x:e,y:n}){const{nodeLookup:o,nodeExtent:a,snapGrid:l,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:h,updateNodePositions:g}=t();i={x:e,y:n};let v=!1;const y=s.size>1,b=y&&a?J$(B$(s)):null,w=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},a=sV(i,t);return{x:a.x-i.x,y:a.y-i.y}}({dragItems:s,snapGrid:l,x:e,y:n}):null;for(const[t,r]of s){if(!o.has(t))continue;let i={x:e-r.distance.x,y:n-r.distance.y};c&&(i=w?{x:Math.round(i.x+w.x),y:Math.round(i.y+w.y)}:sV(i,l));let s=null;if(y&&a&&!r.extent&&b){const{positionAbsolute:e}=r.internals,t=e.x-b.x+a[0][0],n=e.x+r.measured.width-b.x2+a[1][0];s=[[t,e.y-b.y+a[0][1]],[n,e.y+r.measured.height-b.y2+a[1][1]]]}const{position:d,positionAbsolute:f}=H$({nodeId:t,nextPosition:i,nodeLookup:o,nodeExtent:s||a,nodeOrigin:u,onError:h});v=v||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(p=p||v,v&&(g(s,!0),m&&(r||d||!x&&f))){const[e,t]=rH({nodeId:x,dragItems:s,nodeLookup:o});null==r||r(m,s,e,t),null==d||d(m,e,t),x||null==f||f(m,t)}}async function _(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:o}=t();if(!o)return l=!1,void cancelAnimationFrame(a);const[s,d]=X$(c,u,r);0===s&&0===d||(i.x=(i.x??0)-s/e[2],i.y=(i.y??0)-d/e[2],await n({x:s,y:d})&&k(i)),a=requestAnimationFrame(_)}function S(r){var o;const{nodeLookup:a,multiSelectionActive:l,nodesDraggable:c,transform:f,snapGrid:h,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:g,onSelectionDragStart:v,unselectNodesAndEdges:y}=t();d=!0,m&&b||l||!x||(null==(o=a.get(x))?void 0:o.selected)||y(),b&&m&&x&&(null==e||e(x));const w=bV(r.sourceEvent,{transform:f,snapGrid:h,snapToGrid:p,containerBounds:u});if(i=w,s=function(e,t,n,r){const o=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!tH(a,e))&&(a.draggable||t&&void 0===a.draggable)){const t=e.get(i);t&&o.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return o}(a,c,w,x),s.size>0&&(n||g||!x&&v)){const[e,t]=rH({nodeId:x,dragItems:s,nodeLookup:a});null==n||n(r.sourceEvent,s,e,t),null==g||g(r.sourceEvent,e,t),x||null==v||v(r.sourceEvent,t)}}f=zF(y);const C=JF().clickDistance(w).on("start",e=>{const{domNode:n,nodeDragThreshold:r,transform:o,snapGrid:a,snapToGrid:s}=t();u=(null==n?void 0:n.getBoundingClientRect())||null,h=!1,p=!1,m=e.sourceEvent,0===r&&S(e);const l=bV(e.sourceEvent,{transform:o,snapGrid:a,snapToGrid:s,containerBounds:u});i=l,c=CV(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:r,snapGrid:o,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=t(),g=bV(e.sourceEvent,{transform:r,snapGrid:o,snapToGrid:a,containerBounds:u});if(m=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||x&&!p.has(x))&&(h=!0),!h){if(!l&&n&&d&&(l=!0,_()),!d){const t=CV(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&S(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&s&&d&&(c=CV(e.sourceEvent,u),k(g))}}).on("end",e=>{if(d&&!h&&(l=!1,d=!1,cancelAnimationFrame(a),s.size>0)){const{nodeLookup:n,updateNodePositions:r,onNodeDragStop:i,onSelectionDragStop:a}=t();if(p&&(r(s,!1),p=!1),o||i||!x&&a){const[t,r]=rH({nodeId:x,dragItems:s,nodeLookup:n,dragging:!1});null==o||o(e.sourceEvent,s,t,r),null==i||i(e.sourceEvent,t,r),x||null==a||a(e.sourceEvent,r)}}}).filter(e=>{const t=e.target;return!e.button&&(!g||!nH(t,`.${g}`,y))&&(!v||nH(t,v,y))});f.call(C)},destroy:function(){null==f||f.on(".drag",null)}}}function iH(e,t,n,r){var o,i;let a=[],s=1/0;const l=function(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const i of t.values())rV(o,eV(i))>0&&r.push(i);return r}(e,n,t+250);for(const c of l){const n=[...(null==(o=c.internals.handleBounds)?void 0:o.source)??[],...(null==(i=c.internals.handleBounds)?void 0:i.target)??[]];for(const o of n){if(r.nodeId===o.nodeId&&r.type===o.type&&r.id===o.id)continue;const{x:n,y:i}=BV(c,o,o.position,!0),l=Math.sqrt(Math.pow(n-e.x,2)+Math.pow(i-e.y,2));l>t||(l<s?(a=[{...o,x:n,y:i}],s=l):l===s&&a.push({...o,x:n,y:i}))}}if(!a.length)return null;if(a.length>1){const e="source"===r.type?"target":"source";return a.find(t=>t.type===e)??a[0]}return a[0]}function aH(e,t,n,r,o,i=!1){var a,s,l;const c=r.get(e);if(!c)return null;const u="strict"===o?null==(a=c.internals.handleBounds)?void 0:a[t]:[...(null==(s=c.internals.handleBounds)?void 0:s.source)??[],...(null==(l=c.internals.handleBounds)?void 0:l.target)??[]],d=(n?null==u?void 0:u.find(e=>e.id===n):null==u?void 0:u[0])??null;return d&&i?{...d,...BV(c,d,d.position,!0)}:d}function sH(e,t){return e||((null==t?void 0:t.classList.contains("target"))?"target":(null==t?void 0:t.classList.contains("source"))?"source":null)}const lH=()=>!0;function cH(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:a,lib:s,flowId:l,isValidConnection:c=lH,nodeLookup:u}){const d="target"===i,f=t?a.querySelector(`.${s}-flow__handle[data-id="${l}-${null==t?void 0:t.nodeId}-${null==t?void 0:t.id}-${null==t?void 0:t.type}"]`):null,{x:h,y:p}=CV(e),m=a.elementFromPoint(h,p),g=(null==m?void 0:m.classList.contains(`${s}-flow__handle`))?m:f,v={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const e=sH(void 0,g),t=g.getAttribute("data-nodeid"),i=g.getAttribute("data-handleid"),a=g.classList.contains("connectable"),s=g.classList.contains("connectableend");if(!t||!e)return v;const l={source:d?t:r,sourceHandle:d?i:o,target:d?r:t,targetHandle:d?o:i};v.connection=l;const f=a&&s&&(n===_$.Strict?d&&"source"===e||!d&&"target"===e:t!==r||i!==o);v.isValid=f&&c(l),v.toHandle=aH(t,e,i,u,n,!0)}return v}const uH={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:a,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:m,onConnectEnd:g,isValidConnection:v=lH,onReconnectEnd:y,updateConnection:b,getTransform:x,getFromHandle:w,autoPanSpeed:k,dragThreshold:_=1,handleDomNode:S}){const C=wV(e.target);let E,N=0;const{x:I,y:O}=CV(e),M=sH(i,S),j=null==s?void 0:s.getBoundingClientRect();let T=!1;if(!j||!M)return;const P=aH(o,M,r,l,t);if(!P)return;let A=CV(e,j),R=!1,L=null,D=!1,z=null;function F(){if(!u||!j)return;const[e,t]=X$(A,j,k);f({x:e,y:t}),N=requestAnimationFrame(F)}const U={...P,nodeId:o,type:M,position:P.position},B=l.get(o);let $={inProgress:!0,isValid:null,from:BV(B,U,A$.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:B,to:A,toHandle:null,toPosition:L$[U.position],toNode:null,pointer:A};function V(){T=!0,b($),null==p||p(e,{nodeId:o,handleId:r,handleType:M})}function H(e){if(!T){const{x:t,y:n}=CV(e),r=t-I,o=n-O;if(!(r*r+o*o>_*_))return;V()}if(!w()||!U)return void W(e);const i=x();A=CV(e,j),E=iH(lV(A,i,!1,[1,1]),n,l,U),R||(F(),R=!0);const s=cH(e,{handle:E,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:a?"target":"source",isValidConnection:v,doc:C,lib:c,flowId:d,nodeLookup:l});z=s.handleDomNode,L=s.connection,D=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!E,s.isValid);const u=l.get(o),f=u?BV(u,U,A$.Left,!0):$.from,h={...$,from:f,isValid:D,to:s.toHandle&&D?cV({x:s.toHandle.x,y:s.toHandle.y},i):A,toHandle:s.toHandle,toPosition:D&&s.toHandle?s.toHandle.position:L$[U.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null,pointer:A};b(h),$=h}function W(e){if(!("touches"in e&&e.touches.length>0)){if(T){(E||z)&&L&&D&&(null==m||m(L));const{inProgress:t,...n}=$,r={...n,toPosition:$.toHandle?$.toPosition:null};null==g||g(e,r),i&&(null==y||y(e,r))}h(),cancelAnimationFrame(N),R=!1,D=!1,L=null,z=null,C.removeEventListener("mousemove",H),C.removeEventListener("mouseup",W),C.removeEventListener("touchmove",H),C.removeEventListener("touchend",W)}}0===_&&V(),C.addEventListener("mousemove",H),C.addEventListener("mouseup",W),C.addEventListener("touchmove",H),C.addEventListener("touchend",W)},isValid:cH};const dH=e=>({x:e.x,y:e.y,zoom:e.k}),fH=({x:e,y:t,zoom:n})=>QB.translate(e,t).scale(n),hH=(e,t)=>e.target.closest(`.${t}`),pH=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),mH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gH=(e,t=0,n=mH,r=()=>{})=>{const o="number"==typeof t&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},vH=e=>{const t=e.ctrlKey&&fV()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function yH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:s,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=c$().scaleExtent([t,n]).translateExtent(r),f=zF(e).call(d);v({x:o.x,y:o.y,zoom:q$(o.zoom,t,n)},[[0,0],[u.width,u.height]],r);const h=f.on("wheel.zoom"),p=f.on("dblclick.zoom");function m(e,t){return f?new Promise(n=>{null==d||d.interpolate("linear"===(null==t?void 0:t.interpolate)?WU:eB).transform(gH(f,null==t?void 0:t.duration,null==t?void 0:t.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g(){d.on("zoom",null)}async function v(e,t,n){const r=fH(e),o=null==d?void 0:d.constrain()(r,t,n);return o&&await m(o),new Promise(e=>e(o))}return d.wheelDelta(vH),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:o,panOnDrag:u,panOnScrollMode:m,panOnScrollSpeed:v,preventScrolling:y,zoomOnPinch:b,zoomOnScroll:x,zoomOnDoubleClick:w,zoomActivationKeyPressed:k,lib:_,onTransformChange:S,connectionInProgress:C,paneClickDistance:E,selectionOnDrag:N}){r&&!c.isZoomingOrPanning&&g();const I=o&&!k&&!r;d.clickDistance(N?1/0:!iV(E)||E<0?0:E);const O=I?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(hH(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&a){const e=FF(u),t=vH(u),o=d*Math.pow(2,t);return void r.scaleTo(n,o,e,u)}const f=1===u.deltaMode?20:1;let h=o===C$.Vertical?0:u.deltaX*f,p=o===C$.Horizontal?0:u.deltaY*f;!fV()&&u.shiftKey&&o!==C$.Vertical&&(h=u.deltaY*f,p=0),r.translateBy(n,-h/d*i,-p/d*i,{internal:!0});const m=dH(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(null==l||l(u,m),e.panScrollTimeout=setTimeout(()=>{null==c||c(u,m),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,null==s||s(u,m))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:m,panOnScrollSpeed:v,zoomOnPinch:b,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:s}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i="wheel"===r.type,a=!t&&i&&!r.ctrlKey,s=hH(r,e);if(r.ctrlKey&&i&&s&&r.preventDefault(),a||s)return null;r.preventDefault(),n.call(this,r,o)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:h});if(f.on("wheel.zoom",O,{passive:!1}),!r){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,i,a;if(null==(o=r.sourceEvent)?void 0:o.internal)return;const s=dH(r.transform);e.mouseButton=(null==(i=r.sourceEvent)?void 0:i.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,"mousedown"===(null==(a=r.sourceEvent)?void 0:a.type)&&t(!0),n&&(null==n||n(r.sourceEvent,s))}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:a});d.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var a,s;e.usedRightMouseButton=!(!n||!pH(t,e.mouseButton??0)),(null==(a=i.sourceEvent)?void 0:a.sync)||r([i.transform.x,i.transform.y,i.transform.k]),o&&!(null==(s=i.sourceEvent)?void 0:s.internal)&&(null==o||o(i.sourceEvent,dH(i.transform)))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:i,onTransformChange:S});d.on("zoom",t);const r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return a=>{var s;if(!(null==(s=a.sourceEvent)?void 0:s.internal)&&(e.isZoomingOrPanning=!1,i&&pH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const t=dH(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{null==o||o(a.sourceEvent,t)},n?150:0)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:o,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:l});d.on("end",r)}const M=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:s,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{var f;const h=e||t,p=n&&d.ctrlKey,m="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(hH(d,`${c}-flow__node`)||hH(d,`${c}-flow__edge`)))return!0;if(!(r||h||o||i||n))return!1;if(a)return!1;if(u&&!m)return!1;if(hH(d,s)&&m)return!1;if(hH(d,l)&&(!m||o&&m&&!e))return!1;if(!n&&d.ctrlKey&&m)return!1;if(!n&&"touchstart"===d.type&&(null==(f=d.touches)?void 0:f.length)>1)return d.preventDefault(),!1;if(!h&&!o&&!p&&m)return!1;if(!r&&("mousedown"===d.type||"touchstart"===d.type))return!1;if(Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;const g=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&g}}({zoomActivationKeyPressed:k,panOnDrag:u,zoomOnScroll:x,panOnScroll:o,zoomOnDoubleClick:w,zoomOnPinch:b,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:_,connectionInProgress:C});d.filter(M),w?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)},destroy:g,setViewport:async function(e,t){const n=fH(e);return await m(n,t),new Promise(e=>e(n))},setViewportConstrained:v,getViewport:function(){const e=f?e$(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{null==d||d.interpolate("linear"===(null==t?void 0:t.interpolate)?WU:eB).scaleTo(gH(f,null==t?void 0:t.duration,null==t?void 0:t.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{null==d||d.interpolate("linear"===(null==t?void 0:t.interpolate)?WU:eB).scaleBy(gH(f,null==t?void 0:t.duration,null==t?void 0:t.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){null==d||d.scaleExtent(e)},setTranslateExtent:function(e){null==d||d.translateExtent(e)},syncViewport:function(e){if(f){const t=fH(e),n=f.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||null==d||d.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){const t=!iV(e)||e<0?0:e;null==d||d.clickDistance(t)}}}var bH,xH;function wH(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}function kH(e,t){return Math.max(0,t-e)}function _H(e,t){return Math.max(0,e-t)}function SH(e,t,n){return Math.max(0,t-e,e-n)}function CH(e,t){return e?!t:t}(xH=bH||(bH={})).Line="line",xH.Handle="handle";const EH={width:0,height:0,x:0,y:0},NH={...EH,pointerX:0,pointerY:0,aspectRatio:1};function IH(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,s=n[0]*i,l=n[1]*a;return[[r-s,o-l],[r+i-s,o+a-l]]}function OH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=zF(e);let a={controlDirection:wH("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:s,keepAspectRatio:l,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:h}){let p,m={...EH},g={...NH};a={boundaries:s,resizeDirection:c,keepAspectRatio:l,controlDirection:wH(e)};let v,y,b,x=null,w=[],k=!1;const _=JF().on("start",e=>{const{nodeLookup:r,transform:o,snapGrid:i,snapToGrid:a,nodeOrigin:s,paneDomNode:l}=n();if(p=r.get(t),!p)return;x=(null==l?void 0:l.getBoundingClientRect())??null;const{xSnapped:c,ySnapped:d}=bV(e.sourceEvent,{transform:o,snapGrid:i,snapToGrid:a,containerBounds:x});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},g={...m,pointerX:c,pointerY:d,aspectRatio:m.width/m.height},v=void 0,p.parentId&&("parent"===p.extent||p.expandParent)&&(v=r.get(p.parentId),y=v&&"parent"===p.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(v):void 0),w=[],b=void 0;for(const[n,u]of r)if(u.parentId===t&&(w.push({id:n,position:{...u.position},extent:u.extent}),"parent"===u.extent||u.expandParent)){const e=IH(u,p,u.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}null==u||u(e,{...m})}).on("drag",e=>{const{transform:t,snapGrid:o,snapToGrid:i,nodeOrigin:s}=n(),l=bV(e.sourceEvent,{transform:t,snapGrid:o,snapToGrid:i,containerBounds:x}),c=[];if(!p)return;const{x:u,y:f,width:_,height:S}=m,C={},E=p.origin??s,{width:N,height:I,x:O,y:M}=function(e,t,n,r,o,i,a,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:h,ySnapped:p}=n,{minWidth:m,maxWidth:g,minHeight:v,maxHeight:y}=r,{x:b,y:x,width:w,height:k,aspectRatio:_}=e;let S=Math.floor(u?h-e.pointerX:0),C=Math.floor(d?p-e.pointerY:0);const E=w+(l?-S:S),N=k+(c?-C:C),I=-i[0]*w,O=-i[1]*k;let M=SH(E,m,g),j=SH(N,v,y);if(a){let e=0,t=0;l&&S<0?e=kH(b+S+I,a[0][0]):!l&&S>0&&(e=_H(b+E+I,a[1][0])),c&&C<0?t=kH(x+C+O,a[0][1]):!c&&C>0&&(t=_H(x+N+O,a[1][1])),M=Math.max(M,e),j=Math.max(j,t)}if(s){let e=0,t=0;l&&S>0?e=_H(b+S,s[0][0]):!l&&S<0&&(e=kH(b+E,s[1][0])),c&&C>0?t=_H(x+C,s[0][1]):!c&&C<0&&(t=kH(x+N,s[1][1])),M=Math.max(M,e),j=Math.max(j,t)}if(o){if(u){const e=SH(E/_,v,y)*_;if(M=Math.max(M,e),a){let e=0;e=!l&&!c||l&&!c&&f?_H(x+O+E/_,a[1][1])*_:kH(x+O+(l?S:-S)/_,a[0][1])*_,M=Math.max(M,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?kH(x+E/_,s[1][1])*_:_H(x+(l?S:-S)/_,s[0][1])*_,M=Math.max(M,e)}}if(d){const e=SH(N*_,m,g)/_;if(j=Math.max(j,e),a){let e=0;e=!l&&!c||c&&!l&&f?_H(b+N*_+I,a[1][0])/_:kH(b+(c?C:-C)*_+I,a[0][0])/_,j=Math.max(j,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?kH(b+N*_,s[1][0])/_:_H(b+(c?C:-C)*_,s[0][0])/_,j=Math.max(j,e)}}}C+=C<0?j:-j,S+=S<0?M:-M,o&&(f?E>N*_?C=(CH(l,c)?-S:S)/_:S=(CH(l,c)?-C:C)*_:u?(C=S/_,c=l):(S=C*_,l=c));const T=l?b+S:b,P=c?x+C:x;return{width:w+(l?-S:S),height:k+(c?-C:C),x:i[0]*S*(l?-1:1)+T,y:i[1]*C*(c?-1:1)+P}}(g,a.controlDirection,l,a.boundaries,a.keepAspectRatio,E,y,b),j=N!==_,T=I!==S,P=O!==u&&j,A=M!==f&&T;if(!(P||A||j||T))return;if((P||A||1===E[0]||1===E[1])&&(C.x=P?O:m.x,C.y=A?M:m.y,m.x=C.x,m.y=C.y,w.length>0)){const e=O-u,t=M-f;for(const n of w)n.position={x:n.position.x-e+E[0]*(N-_),y:n.position.y-t+E[1]*(I-S)},c.push(n)}if((j||T)&&(C.width=!j||a.resizeDirection&&"horizontal"!==a.resizeDirection?m.width:N,C.height=!T||a.resizeDirection&&"vertical"!==a.resizeDirection?m.height:I,m.width=C.width,m.height=C.height),v&&p.expandParent){const e=E[0]*(C.width??0);C.x&&C.x<e&&(m.x=e,g.x=g.x-(C.x-e));const t=E[1]*(C.height??0);C.y&&C.y<t&&(m.y=t,g.y=g.y-(C.y-t))}const R=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const a=e-t,s=n-r,l=[a>0?1:a<0?-1:0,s>0?1:s<0?-1:0];return a&&o&&(l[0]=-1*l[0]),s&&i&&(l[1]=-1*l[1]),l}({width:m.width,prevWidth:_,height:m.height,prevHeight:S,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),L={...m,direction:R};!1!==(null==h?void 0:h(e,L))&&(k=!0,null==d||d(e,L),r(C,c))}).on("end",e=>{k&&(null==f||f(e,{...m}),null==o||o({...m}),k=!1)});i.call(_)},destroy:function(){i.on(".drag",null)}}}var MH={exports:{}},jH={},TH={exports:{}},PH={},AH=$;var RH="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},LH=AH.useState,DH=AH.useEffect,zH=AH.useLayoutEffect,FH=AH.useDebugValue;function UH(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!RH(e,n)}catch(kE){return!0}}var BH="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=LH({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return zH(function(){o.value=n,o.getSnapshot=t,UH(o)&&i({inst:o})},[e,n,t]),DH(function(){return UH(o)&&i({inst:o}),e(function(){UH(o)&&i({inst:o})})},[e]),FH(n),n};PH.useSyncExternalStore=void 0!==AH.useSyncExternalStore?AH.useSyncExternalStore:BH,TH.exports=PH;var $H=TH.exports,VH=$,HH=$H;
|
|
60
|
+
/**
|
|
61
|
+
* @license React
|
|
62
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the MIT license found in the
|
|
67
|
+
* LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/var WH="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},qH=HH.useSyncExternalStore,KH=VH.useRef,ZH=VH.useEffect,YH=VH.useMemo,XH=VH.useDebugValue;jH.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=KH(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=YH(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,WH(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]);var s=qH(e,i[0],i[1]);return ZH(function(){a.hasValue=!0,a.value=s},[s]),XH(s),s},MH.exports=jH;const GH=r(MH.exports),JH=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,o,i);return i},{useDebugValue:QH}=V,{useSyncExternalStoreWithSelector:eW}=GH,tW=e=>e;function nW(e,t=tW,n){const r=eW(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return QH(r),r}const rW=(e,t)=>{const n=(e=>e?JH(e):JH)(e),r=(e,r=t)=>nW(n,e,r);return Object.assign(r,n),r};function oW(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const iW=$.createContext(null),aW=iW.Provider,sW=u$();function lW(e,t){const n=$.useContext(iW);if(null===n)throw new Error(sW);return nW(n,e,t)}function cW(){const e=$.useContext(iW);if(null===e)throw new Error(sW);return $.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const uW={display:"none"},dW={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},fW="react-flow__node-desc",hW="react-flow__edge-desc",pW=e=>e.ariaLiveMessage,mW=e=>e.ariaLabelConfig;function gW({rfId:e}){const t=lW(pW);return G.jsx("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:dW,children:t})}function vW({rfId:e,disableKeyboardA11y:t}){const n=lW(mW);return G.jsxs(G.Fragment,{children:[G.jsx("div",{id:`${fW}-${e}`,style:uW,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),G.jsx("div",{id:`${hW}-${e}`,style:uW,children:n["edge.a11yDescription.default"]}),!t&&G.jsx(gW,{rfId:e})]})}const yW=$.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const a=`${e}`.split("-");return G.jsx("div",{className:xz(["react-flow__panel",n,...a]),style:r,ref:i,...o,children:t})});function bW({proOptions:e,position:t="bottom-right"}){return(null==e?void 0:e.hideAttribution)?null:G.jsx(yW,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:G.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}yW.displayName="Panel";const xW=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},wW=e=>e.id;function kW(e,t){return oW(e.selectedNodes.map(wW),t.selectedNodes.map(wW))&&oW(e.selectedEdges.map(wW),t.selectedEdges.map(wW))}function _W({onSelectionChange:e}){const t=cW(),{selectedNodes:n,selectedEdges:r}=lW(xW,kW);return $.useEffect(()=>{const o={nodes:n,edges:r};null==e||e(o),t.getState().onSelectionChangeHandlers.forEach(e=>e(o))},[n,r,e]),null}const SW=e=>!!e.onSelectionChangeHandlers;function CW({onSelectionChange:e}){const t=lW(SW);return e||t?G.jsx(_W,{onSelectionChange:e}):null}const EW=[0,0],NW={x:0,y:0,zoom:1},IW=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],OW=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),MW={translateExtent:x$,nodeOrigin:EW,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jW(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:a,reset:s,setDefaultNodesAndEdges:l}=lW(OW,oW),c=cW();$.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{u.current=MW,s()}),[]);const u=$.useRef(MW);return $.useEffect(()=>{for(const s of IW){const l=e[s];l!==u.current[s]&&(void 0!==e[s]&&("nodes"===s?t(l):"edges"===s?n(l):"minZoom"===s?r(l):"maxZoom"===s?o(l):"translateExtent"===s?i(l):"nodeExtent"===s?a(l):"ariaLabelConfig"===s?c.setState({ariaLabelConfig:yV(l)}):"fitView"===s?c.setState({fitViewQueued:l}):"fitViewOptions"===s?c.setState({fitViewOptions:l}):c.setState({[s]:l})))}u.current=e},IW.map(t=>e[t])),null}function TW(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const PW="undefined"!=typeof document?document:null;function AW(e=null,t={target:PW,actInsideInputWithModifier:!0}){const[n,r]=$.useState(!1),o=$.useRef(!1),i=$.useRef(new Set([])),[a,s]=$.useMemo(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return $.useEffect(()=>{const n=(null==t?void 0:t.target)??PW,l=(null==t?void 0:t.actInsideInputWithModifier)??!0;if(null!==e){const e=e=>{var n,c;o.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey;if((!o.current||o.current&&!l)&&_V(e))return!1;const u=LW(e.code,s);if(i.current.add(e[u]),RW(a,i.current,!1)){const i=(null==(c=null==(n=e.composedPath)?void 0:n.call(e))?void 0:c[0])||e.target,a="BUTTON"===(null==i?void 0:i.nodeName)||"A"===(null==i?void 0:i.nodeName);!1===t.preventDefault||!o.current&&a||e.preventDefault(),r(!0)}},c=e=>{const t=LW(e.code,s);RW(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),o.current=!1},u=()=>{i.current.clear(),r(!1)};return null==n||n.addEventListener("keydown",e),null==n||n.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{null==n||n.removeEventListener("keydown",e),null==n||n.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function RW(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function LW(e,t){return t.includes(e)?"code":"key"}function DW(e,t){const n=[],r=new Map,o=[];for(const i of e)if("add"!==i.type)if("remove"===i.type||"replace"===i.type)r.set(i.id,[i]);else{const e=r.get(i.id);e?e.push(i):r.set(i.id,[i])}else o.push(i);for(const i of t){const e=r.get(i.id);if(!e){n.push(i);continue}if("remove"===e[0].type)continue;if("replace"===e[0].type){n.push({...e[0].item});continue}const t={...i};for(const n of e)zW(n,t);n.push(t)}return o.length&&o.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function zW(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured={...e.dimensions},e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function FW(e,t){return{id:e,type:"select",selected:t}}function UW(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const e=t.has(o);void 0===i.selected&&!e||i.selected===e||(n&&(i.selected=e),r.push(FW(i.id,e)))}return r}function BW({items:e=[],lookup:t}){var n;const r=[],o=new Map(e.map(e=>[e.id,e]));for(const[i,a]of e.entries()){const e=t.get(a.id),o=(null==(n=null==e?void 0:e.internals)?void 0:n.userNode)??e;void 0!==o&&o!==a&&r.push({id:a.id,item:a,type:"replace"}),void 0===o&&r.push({item:a,type:"add",index:i})}for(const[i]of t){void 0===o.get(i)&&r.push({id:i,type:"remove"})}return r}function $W(e){return{id:e.id,type:"remove"}}const VW=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function HW(e){return $.forwardRef(e)}const WW="undefined"!=typeof window?$.useLayoutEffect:$.useEffect;function qW(e){const[t,n]=$.useState(BigInt(0)),[r]=$.useState(()=>function(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}(()=>n(e=>e+BigInt(1))));return WW(()=>{const t=r.get();t.length&&(e(t),r.reset())},[t]),r}const KW=$.createContext(null);function ZW({children:e}){const t=cW(),n=$.useCallback(e=>{const{nodes:n=[],setNodes:r,hasDefaultNodes:o,onNodesChange:i,nodeLookup:a,fitViewQueued:s,onNodesChangeMiddlewareMap:l}=t.getState();let c=n;for(const t of e)c="function"==typeof t?t(c):t;let u=BW({items:c,lookup:a});for(const t of l.values())u=t(u);o&&r(c),u.length>0?null==i||i(u):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[]),r=qW(n),o=$.useCallback(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i,edgeLookup:a}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;o?r(s):i&&i(BW({items:s,lookup:a}))},[]),i=qW(o),a=$.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return G.jsx(KW.Provider,{value:a,children:e})}const YW=e=>!!e.panZoom;function XW(){const e=(()=>{const e=cW();return $.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:null==t?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:null==n?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:a,panZoom:s}=e.getState(),l=dV(t,r,o,i,a,(null==n?void 0:n.padding)??.1);return s?(await s.setViewport(l,{duration:null==n?void 0:n.duration,ease:null==n?void 0:n.ease,interpolate:null==n?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??o,d=n.snapToGrid??i;return lV(c,r,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),a=cV(t,n);return{x:a.x+o,y:a.y+i}}}),[])})(),t=cW(),n=function(){const e=$.useContext(KW);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),r=lW(YW),o=$.useMemo(()=>{const e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},o=e=>{n.edgeQueue.push(e)},i=e=>{var n,r;const{nodeLookup:o,nodeOrigin:i}=t.getState(),a=VW(e)?e:o.get(e.id),s=a.parentId?gV(a.position,a.measured,a.parentId,o,i):a.position,l={...a,position:s,width:(null==(n=a.measured)?void 0:n.width)??a.width,height:(null==(r=a.measured)?void 0:r.height)??a.height};return eV(l)},a=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&VW(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{o(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&z$(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>{var n;return null==(n=e(t))?void 0:n.internals.userNode},getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:o,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:r,edges:o,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await W$({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:o,onBeforeDelete:u}),h=f.length>0,p=d.length>0;if(h){const e=f.map($W);null==a||a(f),l(e)}if(p){const e=d.map($W);null==i||i(d),s(e)}return(p||h)&&(null==c||c({nodes:d,edges:f})),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{const o=oV(e),a=o?e:i(e),s=void 0!==r;return a?(r||t.getState().nodes).filter(r=>{const i=t.getState().nodeLookup.get(r.id);if(i&&!o&&(r.id===e.id||!i.internals.positionAbsolute))return!1;const l=eV(s?r:i),c=rV(l,a);return n&&c>0||c>=l.width*l.height||c>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const r=oV(e)?e:i(e);if(!r)return!1;const o=rV(r,t);return n&&o>0||o>=t.width*t.height||o>=r.width*r.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const r="string"==typeof n;let o=t.nodeLookup||r?void 0:n;t.nodeLookup&&(o=r?t.nodeLookup.get(n):F$(n)?n:t.nodeLookup.get(n.id));const i=o?tV(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return G$(e,i)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Q$(n)})(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>{var o;return Array.from((null==(o=t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:""}`))?void 0:o.values())??[])},getNodeConnections:({type:e,handleId:n,nodeId:r})=>{var o;return Array.from((null==(o=t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:""}`))?void 0:o.values())??[])},fitView:async e=>{const r=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return $.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const GW=e=>e.selected,JW="undefined"!=typeof window?window:void 0;const QW={position:"absolute",width:"100%",height:"100%",top:0,left:0},eq=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function tq({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=C$.Free,zoomOnDoubleClick:a=!0,panOnDrag:s=!0,defaultViewport:l,translateExtent:c,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:h=!0,children:p,noWheelClassName:m,noPanClassName:g,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){const w=cW(),k=$.useRef(null),{userSelectionActive:_,lib:S,connectionInProgress:C}=lW(eq,oW),E=AW(f),N=$.useRef();!function(e){const t=cW();$.useEffect(()=>{const n=()=>{var n,r,o,i;if(!e.current||!((null==(r=(n=e.current).checkVisibility)?void 0:r.call(n))??1))return!1;const a=xV(e.current);0!==a.height&&0!==a.width||null==(i=(o=t.getState()).onError)||i.call(o,"004",f$()),t.setState({width:a.width||500,height:a.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(k);const I=$.useCallback(e=>{null==v||v({x:e[0],y:e[1],zoom:e[2]}),y||w.setState({transform:e})},[v,y]);return $.useEffect(()=>{if(k.current){N.current=yH({domNode:k.current,minZoom:u,maxZoom:d,translateExtent:c,viewport:l,onDraggingChange:e=>w.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:r}=w.getState();null==r||r(e,t),null==n||n(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:r}=w.getState();null==r||r(e,t),null==n||n(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:r}=w.getState();null==r||r(e,t),null==n||n(t)}});const{x:e,y:t,zoom:n}=N.current.getViewport();return w.setState({panZoom:N.current,transform:[e,t,n],domNode:k.current.closest(".react-flow")}),()=>{var e;null==(e=N.current)||e.destroy()}}},[]),$.useEffect(()=>{var l;null==(l=N.current)||l.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:h,noPanClassName:g,userSelectionActive:_,noWheelClassName:m,lib:S,onTransformChange:I,connectionInProgress:C,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,o,i,a,s,E,h,g,_,m,S,I,C,x,b]),G.jsx("div",{className:"react-flow__renderer",ref:k,style:QW,children:p})}const nq=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function rq(){const{userSelectionActive:e,userSelectionRect:t}=lW(nq,oW);return e&&t?G.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const oq=(e,t)=>n=>{n.target===t.current&&(null==e||e(n))},iq=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function aq({isSelecting:e,selectionKeyPressed:t,selectionMode:n=N$.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:a,onSelectionEnd:s,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:h,children:p}){const m=cW(),{userSelectionActive:g,elementsSelectable:v,dragging:y,connectionInProgress:b}=lW(iq,oW),x=v&&(e||g),w=$.useRef(null),k=$.useRef(),_=$.useRef(new Set),S=$.useRef(new Set),C=$.useRef(!1),E=e=>{C.current||b?C.current=!1:(null==l||l(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1}))},N=u?e=>u(e):void 0,I=!0===r||Array.isArray(r)&&r.includes(0);return G.jsxs("div",{className:xz(["react-flow__pane",{draggable:I,dragging:y,selection:e}]),onClick:x?void 0:oq(E,w),onContextMenu:oq(e=>{Array.isArray(r)&&(null==r?void 0:r.includes(2))?e.preventDefault():null==c||c(e)},w),onWheel:oq(N,w),onPointerEnter:x?void 0:d,onPointerMove:x?e=>{const{userSelectionRect:r,transform:i,nodeLookup:s,edgeLookup:l,connectionLookup:c,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:h}=m.getState();if(!k.current||!r)return;const{x:p,y:g}=CV(e.nativeEvent,k.current),{startX:v,startY:y}=r;if(!C.current){const n=t?0:o;if(Math.hypot(p-v,g-y)<=n)return;h(),null==a||a(e)}C.current=!0;const b={startX:v,startY:y,x:p<v?p:v,y:g<y?g:y,width:Math.abs(p-v),height:Math.abs(g-y)},x=_.current,w=S.current;_.current=new Set($$(s,b,i,n===N$.Partial,!0).map(e=>e.id)),S.current=new Set;const E=(null==f?void 0:f.selectable)??!0;for(const t of _.current){const e=c.get(t);if(e)for(const{edgeId:t}of e.values()){const e=l.get(t);e&&(e.selectable??E)&&S.current.add(t)}}if(!vV(x,_.current)){u(UW(s,_.current,!0))}if(!vV(w,S.current)){d(UW(l,S.current))}m.setState({userSelectionRect:b,userSelectionActive:!0,nodesSelectionActive:!1})}:f,onPointerUp:x?e=>{var t,n;0===e.button&&(null==(n=null==(t=e.target)?void 0:t.releasePointerCapture)||n.call(t,e.pointerId),!g&&e.target===w.current&&m.getState().userSelectionRect&&(null==E||E(e)),m.setState({userSelectionActive:!1,userSelectionRect:null}),C.current&&(null==s||s(e),m.setState({nodesSelectionActive:_.current.size>0})))}:void 0,onPointerDownCapture:x?n=>{var r,o;const{domNode:a}=m.getState();if(k.current=null==a?void 0:a.getBoundingClientRect(),!k.current)return;const s=n.target===w.current;if(!s&&!!n.target.closest(".nokey")||!e||!(i&&s||t)||0!==n.button||!n.isPrimary)return;null==(o=null==(r=n.target)?void 0:r.setPointerCapture)||o.call(r,n.pointerId),C.current=!1;const{x:l,y:c}=CV(n.nativeEvent,k.current);m.setState({userSelectionRect:{width:0,height:0,startX:l,startY:c,x:l,y:c}}),s||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:x?e=>{C.current&&(e.stopPropagation(),C.current=!1)}:void 0,onPointerLeave:h,ref:w,style:QW,children:[p,G.jsx(rq,{})]})}function sq({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var e;return null==(e=null==r?void 0:r.current)?void 0:e.blur()})):o([e])):null==l||l("012",y$(e))}function lq({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:a}){const s=cW(),[l,c]=$.useState(!1),u=$.useRef();return $.useEffect(()=>{u.current=oH({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{sq({id:t,store:s,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),$.useEffect(()=>{if(!t&&e.current&&u.current)return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:a}),()=>{var e;null==(e=u.current)||e.destroy()}},[n,r,t,i,e,o,a]),l}function cq(){const e=cW();return $.useCallback(t=>{const{nodeExtent:n,snapToGrid:r,snapGrid:o,nodesDraggable:i,onError:a,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(i),f=r?o[0]:5,h=r?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*h*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+m};r&&(t=sV(t,o));const{position:i,positionAbsolute:s}=H$({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:a});e.position=i,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}const uq=$.createContext(null),dq=uq.Provider;uq.Consumer;const fq=()=>$.useContext(uq),hq=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId});const pq=$.memo(HW(function({type:e="source",position:t=A$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:a,onConnect:s,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},h){var p,m;const g=a||null,v="target"===e,y=cW(),b=fq(),{connectOnClick:x,noPanClassName:w,rfId:k}=lW(hq,oW),{connectingFrom:_,connectingTo:S,clickConnecting:C,isPossibleEndHandle:E,connectionInProcess:N,clickConnectionInProcess:I,valid:O}=lW(((e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:a}=r,{fromHandle:s,toHandle:l,isValid:c}=a,u=(null==l?void 0:l.nodeId)===e&&(null==l?void 0:l.id)===t&&(null==l?void 0:l.type)===n;return{connectingFrom:(null==s?void 0:s.nodeId)===e&&(null==s?void 0:s.id)===t&&(null==s?void 0:s.type)===n,connectingTo:u,clickConnecting:(null==o?void 0:o.nodeId)===e&&(null==o?void 0:o.id)===t&&(null==o?void 0:o.type)===n,isPossibleEndHandle:i===_$.Strict?(null==s?void 0:s.type)!==n:e!==(null==s?void 0:s.nodeId)||t!==(null==s?void 0:s.id),connectionInProcess:!!s,clickConnectionInProcess:!!o,valid:u&&c}})(b,g,e),oW);b||null==(m=(p=y.getState()).onError)||m.call(p,"010",g$());const M=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=y.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=y.getState();t(((e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||PV;let o;return o=z$(e)?{...e}:{...e,id:r(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(o,t)?t:(null===o.sourceHandle&&delete o.sourceHandle,null===o.targetHandle&&delete o.targetHandle,t.concat(o))})(o,e))}null==n||n(o),null==s||s(o)},j=e=>{if(!b)return;const t=SV(e.nativeEvent);if(o&&(t&&0===e.button||!t)){const t=y.getState();uH.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:v,handleId:g,nodeId:b,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>{var t,n;return null==(n=(t=y.getState()).onConnectEnd)?void 0:n.call(t,...e)},updateConnection:t.updateConnection,onConnect:M,isValidConnection:n||((...e)=>{var t,n;return(null==(n=(t=y.getState()).isValidConnection)?void 0:n.call(t,...e))??!0}),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?null==u||u(e):null==d||d(e)};return G.jsx("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":t,"data-id":`${k}-${b}-${g}-${e}`,className:xz(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,c,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:C,connectingfrom:_,connectingto:S,valid:O,connectionindicator:r&&(!N||E)&&(N||I?i:o)}]),onMouseDown:j,onTouchStart:j,onClick:x?t=>{const{onClickConnectStart:r,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=y.getState();if(!b||!a&&!o)return;if(!a)return null==r||r(t.nativeEvent,{nodeId:b,handleId:g,handleType:e}),void y.setState({connectionClickStartHandle:{nodeId:b,type:e,id:g}});const h=wV(t.target),p=n||l,{connection:m,isValid:v}=uH.isValid(t.nativeEvent,{handle:{nodeId:b,id:g,type:e},connectionMode:s,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:p,flowId:u,doc:h,lib:c,nodeLookup:d});v&&m&&M(m);const x=structuredClone(f);delete x.inProgress,x.toPosition=x.toHandle?x.toHandle.position:null,null==i||i(t,x),y.setState({connectionClickStartHandle:null})}:void 0,ref:h,...f,children:l})}));const mq={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},gq={input:function({data:e,isConnectable:t,sourcePosition:n=A$.Bottom}){return G.jsxs(G.Fragment,{children:[null==e?void 0:e.label,G.jsx(pq,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=A$.Top,sourcePosition:r=A$.Bottom}){return G.jsxs(G.Fragment,{children:[G.jsx(pq,{type:"target",position:n,isConnectable:t}),null==e?void 0:e.label,G.jsx(pq,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=A$.Top}){return G.jsxs(G.Fragment,{children:[G.jsx(pq,{type:"target",position:n,isConnectable:t}),null==e?void 0:e.label]})},group:function(){return null}};const vq=e=>{const{width:t,height:n,x:r,y:o}=B$(e.nodeLookup,{filter:e=>!!e.selected});return{width:iV(t)?t:null,height:iV(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function yq({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=cW(),{width:o,height:i,transformString:a,userSelectionActive:s}=lW(vq,oW),l=cq(),c=$.useRef(null);$.useEffect(()=>{var e;n||null==(e=c.current)||e.focus({preventScroll:!0})},[n]);const u=!s&&null!==o&&null!==i;if(lq({nodeRef:c,disabled:!u}),!u)return null;const d=e?t=>{const n=r.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return G.jsx("div",{className:xz(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:G.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(mq,e.key)&&(e.preventDefault(),l({direction:mq[e.key],factor:e.shiftKey?4:1}))},style:{width:o,height:i}})})}const bq="undefined"!=typeof window?window:void 0,xq=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function wq({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:s,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:w,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:S,defaultViewport:C,translateExtent:E,minZoom:N,maxZoom:I,preventScrolling:O,onSelectionContextMenu:M,noWheelClassName:j,noPanClassName:T,disableKeyboardA11y:P,onViewportChange:A,isControlledViewport:R}){const{nodesSelectionActive:L,userSelectionActive:D}=lW(xq,oW),z=AW(c,{target:bq}),F=AW(m,{target:bq}),U=F||S,B=F||x,V=u&&!0!==U,H=z||D||V;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=cW(),{deleteElements:r}=XW(),o=AW(e,{actInsideInputWithModifier:!1}),i=AW(t,{target:JW});$.useEffect(()=>{if(o){const{edges:e,nodes:t}=n.getState();r({nodes:t.filter(GW),edges:e.filter(GW)}),n.setState({nodesSelectionActive:!1})}},[o]),$.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:l,multiSelectionKeyCode:p}),G.jsx(tq,{onPaneContextMenu:i,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:B,panOnScrollSpeed:w,panOnScrollMode:k,zoomOnDoubleClick:_,panOnDrag:!z&&U,defaultViewport:C,translateExtent:E,minZoom:N,maxZoom:I,zoomActivationKeyCode:g,preventScrolling:O,noWheelClassName:j,noPanClassName:T,onViewportChange:A,isControlledViewport:R,paneClickDistance:s,selectionOnDrag:V,children:G.jsxs(aq,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:U,isSelecting:!!H,selectionMode:d,selectionKeyPressed:z,paneClickDistance:s,selectionOnDrag:V,children:[e,L&&G.jsx(yq,{onSelectionContextMenu:M,noPanClassName:T,disableKeyboardA11y:P})]})})}wq.displayName="FlowRenderer";const kq=$.memo(wq);function _q(e){return lW($.useCallback((e=>t=>e?$$(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),oW)}const Sq=e=>e.updateNodeInternals;var Cq=$.memo(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:a,nodesDraggable:s,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:p,rfId:m,nodeTypes:g,nodeClickDistance:v,onError:y}){const{node:b,internals:x,isParent:w}=lW(t=>{const n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},oW);let k=b.type||"default",_=(null==g?void 0:g[k])||gq[k];void 0===_&&(null==y||y("003",d$(k)),k="default",_=(null==g?void 0:g.default)||gq.default);const S=!!(b.draggable||s&&void 0===b.draggable),C=!!(b.selectable||l&&void 0===b.selectable),E=!!(b.connectable||c&&void 0===b.connectable),N=!!(b.focusable||u&&void 0===b.focusable),I=cW(),O=mV(b),M=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=cW(),i=$.useRef(null),a=$.useRef(null),s=$.useRef(e.sourcePosition),l=$.useRef(e.targetPosition),c=$.useRef(t),u=n&&!!e.internals.handleBounds;return $.useEffect(()=>{!i.current||e.hidden||u&&a.current===i.current||(a.current&&(null==r||r.unobserve(a.current)),null==r||r.observe(i.current),a.current=i.current)},[u,e.hidden]),$.useEffect(()=>()=>{a.current&&(null==r||r.unobserve(a.current),a.current=null)},[]),$.useEffect(()=>{if(i.current){const n=c.current!==t,r=s.current!==e.sourcePosition,a=l.current!==e.targetPosition;(n||r||a)&&(c.current=t,s.current=e.sourcePosition,l.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}({node:b,nodeType:k,hasDimensions:O,resizeObserver:d}),j=lq({nodeRef:M,disabled:b.hidden||!S,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:C,nodeClickDistance:v}),T=cq();if(b.hidden)return null;const P=pV(b),A=function(e){var t,n,r,o;return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??(null==(t=e.style)?void 0:t.width),height:e.height??e.initialHeight??(null==(n=e.style)?void 0:n.height)}:{width:e.width??(null==(r=e.style)?void 0:r.width),height:e.height??(null==(o=e.style)?void 0:o.height)}}(b),R=C||S||t||n||r||o,L=n?e=>n(e,{...x.userNode}):void 0,D=r?e=>r(e,{...x.userNode}):void 0,z=o?e=>o(e,{...x.userNode}):void 0,F=i?e=>i(e,{...x.userNode}):void 0,U=a?e=>a(e,{...x.userNode}):void 0;return G.jsx("div",{className:xz(["react-flow__node",`react-flow__node-${k}`,{[h]:S},b.className,{selected:b.selected,selectable:C,parent:w,draggable:S,dragging:j}]),ref:M,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:O?"visible":"hidden",...b.style,...A},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:D,onMouseLeave:z,onContextMenu:F,onClick:n=>{const{selectNodesOnDrag:r,nodeDragThreshold:o}=I.getState();C&&(!r||!S||o>0)&&sq({id:e,store:I,nodeRef:M}),t&&t(n,{...x.userNode})},onDoubleClick:U,onKeyDown:N?t=>{if(!_V(t.nativeEvent)&&!p)if(w$.includes(t.key)&&C){const n="Escape"===t.key;sq({id:e,store:I,unselect:n,nodeRef:M})}else if(S&&b.selected&&Object.prototype.hasOwnProperty.call(mq,t.key)){t.preventDefault();const{ariaLabelConfig:e}=I.getState();I.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),T({direction:mq[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:N?0:void 0,onFocus:N?()=>{var t;if(p||!(null==(t=M.current)?void 0:t.matches(":focus-visible")))return;const{transform:n,width:r,height:o,autoPanOnNodeFocus:i,setCenter:a}=I.getState();if(!i)return;$$(new Map([[e,b]]),{x:0,y:0,width:r,height:o},n,!0).length>0||a(b.position.x+P.width/2,b.position.y+P.height/2,{zoom:n[2]})}:void 0,role:b.ariaRole??(N?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${fW}-${m}`,"aria-label":b.ariaLabel,...b.domAttributes,children:G.jsx(dq,{value:e,children:G.jsx(_,{id:e,data:b.data,type:k,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected??!1,selectable:C,draggable:S,deletable:b.deletable??!0,isConnectable:E,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:j,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...P})})})});const Eq=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Nq(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=lW(Eq,oW),a=_q(e.onlyRenderVisibleElements),s=function(){const e=lW(Sq),[t]=$.useState(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return $.useEffect(()=>()=>{null==t||t.disconnect()},[t]),t}();return G.jsx("div",{className:"react-flow__nodes",style:QW,children:a.map(a=>G.jsx(Cq,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}Nq.displayName="NodeRenderer";const Iq=$.memo(Nq);const Oq={[T$.Arrow]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return G.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[T$.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return G.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}};const Mq=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:s="auto-start-reverse"})=>{const l=function(e){const t=cW();return $.useMemo(()=>{var n,r;return Object.prototype.hasOwnProperty.call(Oq,e)?Oq[e]:(null==(r=(n=t.getState()).onError)||r.call(n,"009",p$(e)),null)},[e])}(t);return l?G.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:s,refX:"0",refY:"0",children:G.jsx(l,{color:n,strokeWidth:a})}):null},jq=({defaultColor:e,rfId:t})=>{const n=lW(e=>e.edges),r=lW(e=>e.defaultEdgeOptions),o=$.useMemo(()=>{const o=function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((e,a)=>([a.markerStart||r,a.markerEnd||o].forEach(r=>{if(r&&"object"==typeof r){const o=VV(r,t);i.has(o)||(e.push({id:o,color:r.color||n,...r}),i.add(o))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:null==r?void 0:r.markerStart,defaultMarkerEnd:null==r?void 0:r.markerEnd});return o},[n,r,t,e]);return o.length?G.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:G.jsx("defs",{children:o.map(e=>G.jsx(Mq,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};jq.displayName="MarkerDefinitions";var Tq=$.memo(jq);function Pq({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:s=2,children:l,className:c,...u}){const[d,f]=$.useState({x:1,y:0,width:0,height:0}),h=xz(["react-flow__edge-textwrapper",c]),p=$.useRef(null);return $.useEffect(()=>{if(p.current){const e=p.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?G.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...u,children:[o&&G.jsx("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:s,ry:s}),G.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:p,style:r,children:n}),l]}):null}Pq.displayName="EdgeText";const Aq=$.memo(Pq);function Rq({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:s,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return G.jsxs(G.Fragment,{children:[G.jsx("path",{...u,d:e,fill:"none",className:xz(["react-flow__edge-path",u.className])}),c?G.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&iV(t)&&iV(n)?G.jsx(Aq,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:a,labelBgPadding:s,labelBgBorderRadius:l}):null]})}function Lq({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===A$.Left||e===A$.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Dq({sourceX:e,sourceY:t,sourcePosition:n=A$.Bottom,targetX:r,targetY:o,targetPosition:i=A$.Top}){const[a,s]=Lq({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=Lq({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,h]=NV({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${r},${o}`,u,d,f,h]}function zq(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a,targetPosition:s,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,interactionWidth:v})=>{const[y,b,x]=Dq({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:s}),w=e.isInternal?void 0:t;return G.jsx(Rq,{id:w,path:y,labelX:b,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,interactionWidth:v})})}const Fq=zq({isInternal:!1}),Uq=zq({isInternal:!0});function Bq(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:h=A$.Bottom,targetPosition:p=A$.Top,markerEnd:m,markerStart:g,pathOptions:v,interactionWidth:y})=>{const[b,x,w]=zV({sourceX:n,sourceY:r,sourcePosition:h,targetX:o,targetY:i,targetPosition:p,borderRadius:null==v?void 0:v.borderRadius,offset:null==v?void 0:v.offset,stepPosition:null==v?void 0:v.stepPosition}),k=e.isInternal?void 0:t;return G.jsx(Rq,{id:k,path:b,labelX:x,labelY:w,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:g,interactionWidth:y})})}Fq.displayName="SimpleBezierEdge",Uq.displayName="SimpleBezierEdgeInternal";const $q=Bq({isInternal:!1}),Vq=Bq({isInternal:!0});function Hq(e){return $.memo(({id:t,...n})=>{var r;const o=e.isInternal?void 0:t;return G.jsx($q,{...n,id:o,pathOptions:$.useMemo(()=>{var e;return{borderRadius:0,offset:null==(e=n.pathOptions)?void 0:e.offset}},[null==(r=n.pathOptions)?void 0:r.offset])})})}$q.displayName="SmoothStepEdge",Vq.displayName="SmoothStepEdgeInternal";const Wq=Hq({isInternal:!1}),qq=Hq({isInternal:!0});function Kq(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[g,v,y]=AV({sourceX:n,sourceY:r,targetX:o,targetY:i}),b=e.isInternal?void 0:t;return G.jsx(Rq,{id:b,path:g,labelX:v,labelY:y,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})})}Wq.displayName="StepEdge",qq.displayName="StepEdgeInternal";const Zq=Kq({isInternal:!1}),Yq=Kq({isInternal:!0});function Xq(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:a=A$.Bottom,targetPosition:s=A$.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,pathOptions:v,interactionWidth:y})=>{const[b,x,w]=MV({sourceX:n,sourceY:r,sourcePosition:a,targetX:o,targetY:i,targetPosition:s,curvature:null==v?void 0:v.curvature}),k=e.isInternal?void 0:t;return G.jsx(Rq,{id:k,path:b,labelX:x,labelY:w,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:g,interactionWidth:y})})}Zq.displayName="StraightEdge",Yq.displayName="StraightEdgeInternal";const Gq=Xq({isInternal:!1}),Jq=Xq({isInternal:!0});Gq.displayName="BezierEdge",Jq.displayName="BezierEdgeInternal";const Qq={default:Jq,straight:Yq,step:qq,smoothstep:Vq,simplebezier:Uq},eK={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},tK=(e,t,n)=>n===A$.Left?e-t:n===A$.Right?e+t:e,nK=(e,t,n)=>n===A$.Top?e-t:n===A$.Bottom?e+t:e,rK="react-flow__edgeupdater";function oK({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:a,type:s}){return G.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:a,className:xz([rK,`${rK}-${s}`]),cx:tK(t,r,e),cy:nK(n,r,e),r:r,stroke:"transparent",fill:"transparent"})}function iK({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){const p=cW(),m=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:r,domNode:o,connectionMode:i,connectionRadius:a,lib:s,onConnectStart:l,cancelConnection:h,nodeLookup:m,rfId:g,panBy:v,updateConnection:y}=p.getState(),b="target"===t.type;uH.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:i,connectionRadius:a,domNode:o,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:b,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:h,panBy:v,isValidConnection:(...e)=>{var t,n;return(null==(n=(t=p.getState()).isValidConnection)?void 0:n.call(t,...e))??!0},onConnect:e=>null==c?void 0:c(n,e),onConnectStart:(r,o)=>{f(!0),null==u||u(e,n,t.type),null==l||l(r,o)},onConnectEnd:(...e)=>{var t,n;return null==(n=(t=p.getState()).onConnectEnd)?void 0:n.call(t,...e)},onReconnectEnd:(e,r)=>{f(!1),null==d||d(e,n,t.type,r)},updateConnection:y,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>h(!0),v=()=>h(!1);return G.jsxs(G.Fragment,{children:[(!0===e||"source"===e)&&G.jsx(oK,{position:s,centerX:r,centerY:o,radius:t,onMouseDown:e=>m(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:v,type:"source"}),(!0===e||"target"===e)&&G.jsx(oK,{position:l,centerX:i,centerY:a,radius:t,onMouseDown:e=>m(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:v,type:"target"})]})}var aK=$.memo(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,rfId:p,edgeTypes:m,noPanClassName:g,onError:v,disableKeyboardA11y:y}){let b=lW(t=>t.edgeLookup.get(e));const x=lW(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let w=b.type||"default",k=(null==m?void 0:m[w])||Qq[w];void 0===k&&(null==v||v("011",v$(w)),w="default",k=(null==m?void 0:m.default)||Qq.default);const _=!!(b.focusable||t&&void 0===b.focusable),S=void 0!==d&&(b.reconnectable||n&&void 0===b.reconnectable),C=!!(b.selectable||r&&void 0===b.selectable),E=$.useRef(null),[N,I]=$.useState(!1),[O,M]=$.useState(!1),j=cW(),{zIndex:T,sourceX:P,sourceY:A,targetX:R,targetY:L,sourcePosition:D,targetPosition:z}=lW($.useCallback(t=>{const n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return{zIndex:b.zIndex,...eK};const o=function(e){var t;const{sourceNode:n,targetNode:r}=e;if(!FV(n)||!FV(r))return null;const o=n.internals.handleBounds||UV(n.handles),i=r.internals.handleBounds||UV(r.handles),a=$V((null==o?void 0:o.source)??[],e.sourceHandle),s=$V(e.connectionMode===_$.Strict?(null==i?void 0:i.target)??[]:((null==i?void 0:i.target)??[]).concat((null==i?void 0:i.source)??[]),e.targetHandle);if(!a||!s)return null==(t=e.onError)||t.call(e,"008",m$(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(null==a?void 0:a.position)||A$.Bottom,c=(null==s?void 0:s.position)||A$.Top,u=BV(n,a,l),d=BV(r,s,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),i=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){return"manual"===i?r:(o&&n?r+1e3:r)+Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0)}({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{zIndex:i,...o||eK}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),oW),F=$.useMemo(()=>b.markerStart?`url('#${VV(b.markerStart,p)}')`:void 0,[b.markerStart,p]),U=$.useMemo(()=>b.markerEnd?`url('#${VV(b.markerEnd,p)}')`:void 0,[b.markerEnd,p]);if(b.hidden||null===P||null===A||null===R||null===L)return null;const B=i?e=>{i(e,{...b})}:void 0,V=a?e=>{a(e,{...b})}:void 0,H=s?e=>{s(e,{...b})}:void 0,W=l?e=>{l(e,{...b})}:void 0,q=c?e=>{c(e,{...b})}:void 0;return G.jsx("svg",{style:{zIndex:T},children:G.jsxs("g",{className:xz(["react-flow__edge",`react-flow__edge-${w}`,b.className,g,{selected:b.selected,animated:b.animated,inactive:!C&&!o,updating:N,selectable:C}]),onClick:t=>{var n;const{addSelectedEdges:r,unselectNodesAndEdges:i,multiSelectionActive:a}=j.getState();C&&(j.setState({nodesSelectionActive:!1}),b.selected&&a?(i({nodes:[],edges:[b]}),null==(n=E.current)||n.blur()):r([e])),o&&o(t,b)},onDoubleClick:B,onContextMenu:V,onMouseEnter:H,onMouseMove:W,onMouseLeave:q,onKeyDown:_?t=>{var n;if(!y&&w$.includes(t.key)&&C){const{unselectNodesAndEdges:r,addSelectedEdges:o}=j.getState();"Escape"===t.key?(null==(n=E.current)||n.blur(),r({edges:[b]})):o([e])}}:void 0,tabIndex:_?0:void 0,role:b.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===b.ariaLabel?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":_?`${hW}-${p}`:void 0,ref:E,...b.domAttributes,children:[!O&&G.jsx(k,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:C,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:P,sourceY:A,targetX:R,targetY:L,sourcePosition:D,targetPosition:z,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:F,markerEnd:U,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),S&&G.jsx(iK,{edge:b,isReconnectable:S,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:h,sourceX:P,sourceY:A,targetX:R,targetY:L,sourcePosition:D,targetPosition:z,setUpdateHover:I,setReconnecting:M})]})})});const sK=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function lK({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:s,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:m}){const{edgesFocusable:g,edgesReconnectable:v,elementsSelectable:y,onError:b}=lW(sK,oW),x=(w=t,lW($.useCallback(e=>{if(!w)return e.edges.map(e=>e.id);const t=[];if(e.width&&e.height)for(const n of e.edges){const r=e.nodeLookup.get(n.source),o=e.nodeLookup.get(n.target);r&&o&&TV({sourceNode:r,targetNode:o,width:e.width,height:e.height,transform:e.transform})&&t.push(n.id)}return t},[w]),oW));var w;return G.jsxs("div",{className:"react-flow__edges",children:[G.jsx(Tq,{defaultColor:e,rfId:n}),x.map(e=>G.jsx(aK,{id:e,edgesFocusable:g,edgesReconnectable:v,elementsSelectable:y,noPanClassName:o,onReconnect:i,onContextMenu:a,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:m},e))]})}lK.displayName="EdgeRenderer";const cK=$.memo(lK),uK=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function dK({children:e}){const t=lW(uK);return G.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const fK=e=>{var t;return null==(t=e.panZoom)?void 0:t.syncViewport};function hK(e){return e.connection.inProgress?{...e.connection,to:lV(e.connection.to,e.transform)}:{...e.connection}}function pK(e){return lW(hK,oW)}const mK=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function gK({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:a,isValid:s,inProgress:l}=lW(mK,oW);return!!(i&&o&&l)?G.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:G.jsx("g",{className:xz(["react-flow__connection",D$(s)]),children:G.jsx(vK,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}const vK=({style:e,type:t=M$.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:a,fromHandle:s,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:h}=pK();if(!o)return;if(n)return G.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:s,fromX:i.x,fromY:i.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:D$(r),toNode:u,toHandle:d,pointer:h});let p="";const m={sourceX:i.x,sourceY:i.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case M$.Bezier:[p]=MV(m);break;case M$.SimpleBezier:[p]=Dq(m);break;case M$.Step:[p]=zV({...m,borderRadius:0});break;case M$.SmoothStep:[p]=zV(m);break;default:[p]=AV(m)}return G.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};vK.displayName="ConnectionLine";const yK={};function bK(e=yK){$.useRef(e),cW(),$.useEffect(()=>{},[e])}function xK({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:m,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:_,deleteKeyCode:S,onlyRenderVisibleElements:C,elementsSelectable:E,defaultViewport:N,translateExtent:I,minZoom:O,maxZoom:M,preventScrolling:j,defaultMarkerColor:T,zoomOnScroll:P,zoomOnPinch:A,panOnScroll:R,panOnScrollSpeed:L,panOnScrollMode:D,zoomOnDoubleClick:z,panOnDrag:F,onPaneClick:U,onPaneMouseEnter:B,onPaneMouseMove:V,onPaneMouseLeave:H,onPaneScroll:W,onPaneContextMenu:q,paneClickDistance:K,nodeClickDistance:Z,onEdgeContextMenu:Y,onEdgeMouseEnter:X,onEdgeMouseMove:J,onEdgeMouseLeave:Q,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,noDragClassName:oe,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return bK(e),bK(t),cW(),$.useRef(!1),$.useEffect(()=>{},[]),function(e){const t=XW(),n=$.useRef(!1);$.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=lW(fK),n=cW();$.useEffect(()=>{e&&(null==t||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),G.jsx(kq,{onPaneClick:U,onPaneMouseEnter:B,onPaneMouseMove:V,onPaneMouseLeave:H,onPaneContextMenu:q,onPaneScroll:W,paneClickDistance:K,deleteKeyCode:S,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:w,panActivationKeyCode:k,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:P,zoomOnPinch:A,zoomOnDoubleClick:z,panOnScroll:R,panOnScrollSpeed:L,panOnScrollMode:D,panOnDrag:F,defaultViewport:N,translateExtent:I,minZoom:O,maxZoom:M,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:oe,noWheelClassName:ie,noPanClassName:ae,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:G.jsxs(dK,{children:[G.jsx(cK,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:a,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,onlyRenderVisibleElements:C,onEdgeContextMenu:Y,onEdgeMouseEnter:X,onEdgeMouseMove:J,onEdgeMouseLeave:Q,reconnectRadius:ee,defaultMarkerColor:T,noPanClassName:ae,disableKeyboardA11y:se,rfId:ce}),G.jsx(gK,{style:m,type:p,component:g,containerStyle:v}),G.jsx("div",{className:"react-flow__edgelabel-renderer"}),G.jsx(Iq,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:s,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:C,noPanClassName:ae,noDragClassName:oe,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),G.jsx("div",{className:"react-flow__viewport-portal"})]})})}xK.displayName="GraphView";const wK=$.memo(xK),kK=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const h=new Map,p=new Map,m=new Map,g=new Map,v=r??t??[],y=n??e??[],b=u??[0,0],x=d??x$;eH(m,g,v);const w=YV(y,h,p,{nodeOrigin:b,nodeExtent:x,zIndexMode:f});let k=[0,0,1];if(a&&o&&i){const e=B$(h,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:r}=dV(e,o,i,l,c,(null==s?void 0:s.padding)??.1);k=[t,n,r]}return{rfId:"1",width:o??0,height:i??0,transform:k,nodes:y,nodesInitialized:w,nodeLookup:h,parentLookup:p,edges:v,edgeLookup:g,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:l,maxZoom:c,translateExtent:x$,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:_$.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:s,fitViewResolver:null,connection:{...O$},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:aV,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:k$,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},_K=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>{return h=(h,p)=>{async function m(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:o,height:i,minZoom:a,maxZoom:s}=p();t&&(await V$({nodes:e,width:o,height:i,panZoom:t,minZoom:a,maxZoom:s},n),null==r||r.resolve(!0),h({fitViewResolver:null}))}return{...kK({nodes:e,edges:t,width:o,height:i,fitView:a,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:o,fitViewQueued:i,zIndexMode:a}=p(),s=YV(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:o,checkEquality:!0,zIndexMode:a});i&&s?(m(),h({nodes:e,nodesInitialized:s,fitViewQueued:!1,fitViewOptions:void 0})):h({nodes:e,nodesInitialized:s})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=p();eH(t,n,e),h({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=p();t(e),h({hasDefaultNodes:!0})}if(t){const{setEdges:e}=p();e(t),h({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:o,nodeOrigin:i,nodeExtent:a,debug:s,fitViewQueued:l,zIndexMode:c}=p(),{changes:u,updatedInternals:d}=function(e,t,n,r,o,i,a){const s=null==r?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const h of e.values()){const e=t.get(h.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}const r=xV(h.nodeElement),s=e.measured.width!==r.width||e.measured.height!==r.height;if(r.width&&r.height&&(s||!e.internals.handleBounds||h.force)){const u=h.nodeElement.getBoundingClientRect(),p=hV(e.extent)?e.extent:i;let{positionAbsolute:m}=e.internals;e.parentId&&"parent"===e.extent?m=Z$(m,r,t.get(e.parentId)):p&&(m=K$(m,p,r));const g={...e,measured:r,internals:{...e.internals,positionAbsolute:m,handleBounds:{source:EV("source",h.nodeElement,u,d,e.id),target:EV("target",h.nodeElement,u,d,e.id)}}};t.set(e.id,g),e.parentId&&XV(g,t,n,{nodeOrigin:o,zIndexMode:a}),l=!0,s&&(c.push({id:e.id,type:"dimensions",dimensions:r}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:eV(g,o)}))}}if(f.length>0){const e=JV(f,t,n,o);c.push(...e)}return{changes:c,updatedInternals:l}}(e,n,r,o,i,a,c);d&&(function(e,t,n){const r=qV(HV,n);for(const o of e.values())if(o.parentId)XV(o,e,t,r);else{const e=U$(o,r.nodeOrigin),t=hV(o.extent)?o.extent:r.nodeExtent,n=K$(e,t,pV(o));o.internals.positionAbsolute=n}}(n,r,{nodeOrigin:i,nodeExtent:a,zIndexMode:c}),l?(m(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(null==u?void 0:u.length)>0&&(null==t||t(u)))},updateNodePositions:(e,t=!1)=>{const n=[];let r=[];const{nodeLookup:o,triggerNodeChanges:i,connection:a,updateConnection:s,onNodesChangeMiddlewareMap:l}=p();for(const[c,u]of e){const e=o.get(c),i=!!((null==e?void 0:e.expandParent)&&(null==e?void 0:e.parentId)&&(null==u?void 0:u.position)),l={id:c,type:"position",position:i?{x:Math.max(0,u.position.x),y:Math.max(0,u.position.y)}:u.position,dragging:t};if(e&&a.inProgress&&a.fromNode.id===e.id){const t=BV(e,a.fromHandle,A$.Left,!0);s({...a,from:t})}i&&e.parentId&&n.push({id:c,parentId:e.parentId,rect:{...u.internals.positionAbsolute,width:u.measured.width??0,height:u.measured.height??0}}),r.push(l)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=p(),i=JV(n,o,e,t);r.push(...i)}for(const c of l.values())r=c(r);i(r)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:o,debug:i}=p();if(null==e?void 0:e.length){if(o){const t=function(e,t){return DW(e,t)}(e,r);n(t)}null==t||t(e)}},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:o,debug:i}=p();if(null==e?void 0:e.length){if(o){const t=function(e,t){return DW(e,t)}(e,r);n(t)}null==t||t(e)}},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=p();t?o(e.map(e=>FW(e,!0))):(o(UW(r,new Set([...e]),!0)),i(UW(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:o,triggerEdgeChanges:i}=p();t?i(e.map(e=>FW(e,!0))):(i(UW(n,new Set([...e]))),o(UW(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:r,nodeLookup:o,triggerNodeChanges:i,triggerEdgeChanges:a}=p(),s=e||r,l=t||n,c=[];for(const d of s){if(!d.selected)continue;const e=o.get(d.id);e&&(e.selected=!1),c.push(FW(d.id,!1))}const u=[];for(const d of l)d.selected&&u.push(FW(d.id,!1));i(c),a(u)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=p();null==t||t.setScaleExtent([e,n]),h({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=p();null==t||t.setScaleExtent([n,e]),h({maxZoom:e})},setTranslateExtent:e=>{var t;null==(t=p().panZoom)||t.setTranslateExtent(e),h({translateExtent:e})},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:o}=p();if(!o)return;const i=t.reduce((e,t)=>t.selected?[...e,FW(t.id,!1)]:e,[]),a=e.reduce((e,t)=>t.selected?[...e,FW(t.id,!1)]:e,[]);n(i),r(a)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:o,elevateNodesOnSelect:i,nodeExtent:a,zIndexMode:s}=p();e[0][0]===a[0][0]&&e[0][1]===a[0][1]&&e[1][0]===a[1][0]&&e[1][1]===a[1][1]||(YV(t,n,r,{nodeOrigin:o,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1,zIndexMode:s}),h({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:r,panZoom:o,translateExtent:i}=p();return async function({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),s=!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:o,transform:t,translateExtent:i,width:n,height:r})},setCenter:async(e,t,n)=>{const{width:r,height:o,maxZoom:i,panZoom:a}=p();if(!a)return Promise.resolve(!1);const s=void 0!==(null==n?void 0:n.zoom)?n.zoom:i;return await a.setViewport({x:r/2-e*s,y:o/2-t*s,zoom:s},{duration:null==n?void 0:n.duration,ease:null==n?void 0:n.ease,interpolate:null==n?void 0:n.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...O$}})},updateConnection:e=>{h({connection:e})},reset:()=>h({...kK()})}},p=Object.is,h?rW(h,p):rW;var h,p};function SK({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:a,initialMaxZoom:s,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:h}){const[p]=$.useState(()=>_K({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:c,minZoom:a,maxZoom:s,fitViewOptions:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return G.jsx(aW,{value:p,children:G.jsx(ZW,{children:h})})}function CK({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:a,fitView:s,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h}){return $.useContext(iW)?G.jsx(G.Fragment,{children:e}):G.jsx(SK,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:a,fitView:s,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:e})}const EK={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var NK,IK,OK=HW(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:a,onNodeClick:s,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:w,onNodeDoubleClick:k,onNodeDragStart:_,onNodeDrag:S,onNodeDragStop:C,onNodesDelete:E,onEdgesDelete:N,onDelete:I,onSelectionChange:O,onSelectionDragStart:M,onSelectionDrag:j,onSelectionDragStop:T,onSelectionContextMenu:P,onSelectionStart:A,onSelectionEnd:R,onBeforeDelete:L,connectionMode:D,connectionLineType:z=M$.Bezier,connectionLineStyle:F,connectionLineComponent:U,connectionLineContainerStyle:B,deleteKeyCode:V="Backspace",selectionKeyCode:H="Shift",selectionOnDrag:W=!1,selectionMode:q=N$.Full,panActivationKeyCode:K="Space",multiSelectionKeyCode:Z=(fV()?"Meta":"Control"),zoomActivationKeyCode:Y=(fV()?"Meta":"Control"),snapToGrid:X,snapGrid:J,onlyRenderVisibleElements:Q=!1,selectNodesOnDrag:ee,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,nodeOrigin:ie=EW,edgesFocusable:ae,edgesReconnectable:se,elementsSelectable:le=!0,defaultViewport:ce=NW,minZoom:ue=.5,maxZoom:de=2,translateExtent:fe=x$,preventScrolling:he=!0,nodeExtent:pe,defaultMarkerColor:me="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:ve=!0,panOnScroll:ye=!1,panOnScrollSpeed:be=.5,panOnScrollMode:xe=C$.Free,zoomOnDoubleClick:we=!0,panOnDrag:ke=!0,onPaneClick:_e,onPaneMouseEnter:Se,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:Ne,onPaneContextMenu:Ie,paneClickDistance:Oe=1,nodeClickDistance:Me=0,children:je,onReconnect:Te,onReconnectStart:Pe,onReconnectEnd:Ae,onEdgeContextMenu:Re,onEdgeDoubleClick:Le,onEdgeMouseEnter:De,onEdgeMouseMove:ze,onEdgeMouseLeave:Fe,reconnectRadius:Ue=10,onNodesChange:Be,onEdgesChange:$e,noDragClassName:Ve="nodrag",noWheelClassName:He="nowheel",noPanClassName:We="nopan",fitView:qe,fitViewOptions:Ke,connectOnClick:Ze,attributionPosition:Ye,proOptions:Xe,defaultEdgeOptions:Ge,elevateNodesOnSelect:Je=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:et=!1,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,connectionRadius:ot,isValidConnection:it,onError:at,style:st,id:lt,nodeDragThreshold:ct,connectionDragThreshold:ut,viewport:dt,onViewportChange:ft,width:ht,height:pt,colorMode:mt="light",debug:gt,onScroll:vt,ariaLabelConfig:yt,zIndexMode:bt="basic",...xt},wt){const kt=lt||"1",_t=function(e){var t;const[n,r]=$.useState("system"===e?null:e);return $.useEffect(()=>{if("system"!==e)return void r(e);const t=TW(),n=()=>r((null==t?void 0:t.matches)?"dark":"light");return n(),null==t||t.addEventListener("change",n),()=>{null==t||t.removeEventListener("change",n)}},[e]),null!==n?n:(null==(t=TW())?void 0:t.matches)?"dark":"light"}(mt),St=$.useCallback(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),null==vt||vt(e)},[vt]);return G.jsx("div",{"data-testid":"rf__wrapper",...xt,onScroll:St,style:{...st,...EK},ref:wt,className:xz(["react-flow",o,_t]),id:lt,role:"application",children:G.jsxs(CK,{nodes:e,edges:t,width:ht,height:pt,fitView:qe,fitViewOptions:Ke,minZoom:ue,maxZoom:de,nodeOrigin:ie,nodeExtent:pe,zIndexMode:bt,children:[G.jsx(wK,{onInit:c,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:w,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:a,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:U,connectionLineContainerStyle:B,selectionKeyCode:H,selectionOnDrag:W,selectionMode:q,deleteKeyCode:V,multiSelectionKeyCode:Z,panActivationKeyCode:K,zoomActivationKeyCode:Y,onlyRenderVisibleElements:Q,defaultViewport:ce,translateExtent:fe,minZoom:ue,maxZoom:de,preventScrolling:he,zoomOnScroll:ge,zoomOnPinch:ve,zoomOnDoubleClick:we,panOnScroll:ye,panOnScrollSpeed:be,panOnScrollMode:xe,panOnDrag:ke,onPaneClick:_e,onPaneMouseEnter:Se,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:Ne,onPaneContextMenu:Ie,paneClickDistance:Oe,nodeClickDistance:Me,onSelectionContextMenu:P,onSelectionStart:A,onSelectionEnd:R,onReconnect:Te,onReconnectStart:Pe,onReconnectEnd:Ae,onEdgeContextMenu:Re,onEdgeDoubleClick:Le,onEdgeMouseEnter:De,onEdgeMouseMove:ze,onEdgeMouseLeave:Fe,reconnectRadius:Ue,defaultMarkerColor:me,noDragClassName:Ve,noWheelClassName:He,noPanClassName:We,rfId:kt,disableKeyboardA11y:et,nodeExtent:pe,viewport:dt,onViewportChange:ft}),G.jsx(jW,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:g,onClickConnectEnd:v,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:oe,edgesFocusable:ae,edgesReconnectable:se,elementsSelectable:le,elevateNodesOnSelect:Je,elevateEdgesOnSelect:Qe,minZoom:ue,maxZoom:de,nodeExtent:pe,onNodesChange:Be,onEdgesChange:$e,snapToGrid:X,snapGrid:J,connectionMode:D,translateExtent:fe,connectOnClick:Ze,defaultEdgeOptions:Ge,fitView:qe,fitViewOptions:Ke,onNodesDelete:E,onEdgesDelete:N,onDelete:I,onNodeDragStart:_,onNodeDrag:S,onNodeDragStop:C,onSelectionDrag:j,onSelectionDragStart:M,onSelectionDragStop:T,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:We,nodeOrigin:ie,rfId:kt,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,onError:at,connectionRadius:ot,isValidConnection:it,selectNodesOnDrag:ee,nodeDragThreshold:ct,connectionDragThreshold:ut,onBeforeDelete:L,debug:gt,ariaLabelConfig:yt,zIndexMode:bt}),G.jsx(CW,{onSelectionChange:O}),je,G.jsx(bW,{proOptions:Xe,position:Ye}),G.jsx(vW,{rfId:kt,disableKeyboardA11y:et})]})})});function MK({dimensions:e,lineWidth:t,variant:n,className:r}){return G.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xz(["react-flow__background-pattern",n,r])})}function jK({radius:e,className:t}){return G.jsx("circle",{cx:e,cy:e,r:e,className:xz(["react-flow__background-pattern","dots",t])})}(IK=NK||(NK={})).Lines="lines",IK.Dots="dots",IK.Cross="cross";const TK={[NK.Dots]:1,[NK.Lines]:1,[NK.Cross]:6},PK=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function AK({id:e,variant:t=NK.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:a,bgColor:s,style:l,className:c,patternClassName:u}){const d=$.useRef(null),{transform:f,patternId:h}=lW(PK,oW),p=r||TK[t],m=t===NK.Dots,g=t===NK.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],b=p*f[2],x=Array.isArray(i)?i:[i,i],w=g?[b,b]:y,k=[x[0]*f[2]||1+w[0]/2,x[1]*f[2]||1+w[1]/2],_=`${h}${e||""}`;return G.jsxs("svg",{className:xz(["react-flow__background",c]),style:{...l,...QW,"--xy-background-color-props":s,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[G.jsx("pattern",{id:_,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:m?G.jsx(jK,{radius:b/2,className:u}):G.jsx(MK,{dimensions:w,lineWidth:o,variant:t,className:u})}),G.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}AK.displayName="Background";const RK=$.memo(AK);function LK(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:G.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function DK(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:G.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zK(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:G.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function FK(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function UK(){return G.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:G.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function BK({children:e,className:t,...n}){return G.jsx("button",{type:"button",className:xz(["react-flow__controls-button",t]),...n,children:e})}const $K=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function VK({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:a,onFitView:s,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":h}){const p=cW(),{isInteractive:m,minZoomReached:g,maxZoomReached:v,ariaLabelConfig:y}=lW($K,oW),{zoomIn:b,zoomOut:x,fitView:w}=XW(),k="horizontal"===f?"horizontal":"vertical";return G.jsxs(yW,{className:xz(["react-flow__controls",k,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":h??y["controls.ariaLabel"],children:[t&&G.jsxs(G.Fragment,{children:[G.jsx(BK,{onClick:()=>{b(),null==i||i()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:v,children:G.jsx(LK,{})}),G.jsx(BK,{onClick:()=>{x(),null==a||a()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:g,children:G.jsx(DK,{})})]}),n&&G.jsx(BK,{className:"react-flow__controls-fitview",onClick:()=>{w(o),null==s||s()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:G.jsx(zK,{})}),r&&G.jsx(BK,{className:"react-flow__controls-interactive",onClick:()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),null==l||l(!m)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:m?G.jsx(UK,{}):G.jsx(FK,{})}),u]})}VK.displayName="Controls";const HK=$.memo(VK);const WK=$.memo(function({id:e,x:t,y:n,width:r,height:o,style:i,color:a,strokeColor:s,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:h}){const{background:p,backgroundColor:m}=i||{},g=a||p||m;return G.jsx("rect",{className:xz(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:o,style:{fill:g,stroke:s,strokeWidth:l},shapeRendering:d,onClick:h?t=>h(t,e):void 0})}),qK=e=>e.nodes.map(e=>e.id),KK=e=>e instanceof Function?e:()=>e;const ZK=$.memo(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:s,onClick:l}){const{node:c,x:u,y:d,width:f,height:h}=lW(t=>{const n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};const r=n.internals.userNode,{x:o,y:i}=n.internals.positionAbsolute,{width:a,height:s}=pV(r);return{node:r,x:o,y:i,width:a,height:s}},oW);return c&&!c.hidden&&mV(c)?G.jsx(s,{x:u,y:d,width:f,height:h,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:o,strokeColor:n(c),strokeWidth:i,shapeRendering:a,onClick:l,id:c.id}):null});var YK=$.memo(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=WK,onClick:a}){const s=lW(qK,oW),l=KK(t),c=KK(e),u=KK(n),d="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return G.jsx(G.Fragment,{children:s.map(e=>G.jsx(ZK,{id:e,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:a,shapeRendering:d},e))})});const XK=e=>!e.hidden,GK=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nV(B$(e.nodeLookup,{filter:XK}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function JK({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:s,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:m=!1,zoomable:g=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:x=5}){const w=cW(),k=$.useRef(null),{boundingRect:_,viewBB:S,rfId:C,panZoom:E,translateExtent:N,flowWidth:I,flowHeight:O,ariaLabelConfig:M}=lW(GK,oW),j=(null==e?void 0:e.width)??200,T=(null==e?void 0:e.height)??150,P=_.width/j,A=_.height/T,R=Math.max(P,A),L=R*j,D=R*T,z=x*R,F=_.x-(L-_.width)/2-z,U=_.y-(D-_.height)/2-z,B=L+2*z,V=D+2*z,H=`react-flow__minimap-desc-${C}`,W=$.useRef(0),q=$.useRef();W.current=R,$.useEffect(()=>{if(k.current&&E)return q.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=zF(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:s=1,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=c$().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?o=>{const s=n();if("mousemove"!==o.sourceEvent.type&&"touchmove"!==o.sourceEvent.type||!t)return;const l=[o.sourceEvent.clientX??o.sourceEvent.touches[0].clientX,o.sourceEvent.clientY??o.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),h={x:s[0]-c[0]*f,y:s[1]-c[1]*f},p=[[0,0],[i,a]];t.setViewportConstrained({x:h.x,y:h.y,zoom:s[2]},p,e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;const r=n(),o=e.sourceEvent.ctrlKey&&fV()?10:1,i=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,a=r[2]*Math.pow(2,i*o);t.scaleTo(a)}:null);o.call(f,{})},destroy:function(){o.on("zoom",null)},pointer:FF}}({domNode:k.current,panZoom:E,getTransform:()=>w.getState().transform,getViewScale:()=>W.current}),()=>{var e;null==(e=q.current)||e.destroy()}},[E]),$.useEffect(()=>{var e;null==(e=q.current)||e.update({translateExtent:N,width:I,height:O,inversePan:y,pannable:m,zoomStep:b,zoomable:g})},[m,g,y,b,N,I,O]);const K=h?e=>{var t;const[n,r]=(null==(t=q.current)?void 0:t.pointer(e))||[0,0];h(e,{x:n,y:r})}:void 0,Z=p?$.useCallback((e,t)=>{const n=w.getState().nodeLookup.get(t).internals.userNode;p(e,n)},[]):void 0,Y=v??M["minimap.ariaLabel"];return G.jsx(yW,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof l?l:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*R:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof a?a:void 0},className:xz(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:G.jsxs("svg",{width:j,height:T,viewBox:`${F} ${U} ${B} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":H,ref:k,onClick:K,children:[Y&&G.jsx("title",{id:H,children:Y}),G.jsx(YK,{onClick:Z,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:s}),G.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${U-z}h${B+2*z}v${V+2*z}h${-B-2*z}z\n M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}JK.displayName="MiniMap";const QK=$.memo(JK),eZ={[bH.Line]:"right",[bH.Handle]:"bottom-right"};$.memo(function({nodeId:e,position:t,variant:n=bH.Handle,className:r,style:o,children:i,color:a,minWidth:s=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:h=!0,shouldResize:p,onResizeStart:m,onResize:g,onResizeEnd:v}){const y=fq(),b="string"==typeof e?e:y,x=cW(),w=$.useRef(null),k=n===bH.Handle,_=lW($.useCallback((S=k&&h,e=>S?`${Math.max(1/e.transform[2],1)}`:void 0),[k,h]),oW);var S;const C=$.useRef(null),E=t??eZ[n];$.useEffect(()=>{if(w.current&&b)return C.current||(C.current=OH({domNode:w.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,domNode:i}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:o,paneDomNode:i}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:r,parentLookup:o,nodeOrigin:i}=x.getState(),a=[],s={x:e.x,y:e.y},l=r.get(b);if(l&&l.expandParent&&l.parentId){const t=l.origin??i,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=JV([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...gV({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,r,t)}}],r,o,i);a.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:b,type:"position",position:{...s}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:b,type:"dimensions",resizing:!0,setAttributes:!f||("horizontal"===f?"width":"height"),dimensions:{width:e.width,height:e.height}};a.push(t)}for(const c of t){const e={...c,type:"position"};a.push(e)}n(a)},onEnd:({width:e,height:t})=>{const n={id:b,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}})),C.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:m,onResize:g,onResizeEnd:v,shouldResize:p}),()=>{var e;null==(e=C.current)||e.destroy()}},[E,s,l,c,u,d,m,g,v,p]);const N=E.split("-");return G.jsx("div",{className:xz(["react-flow__resize-control","nodrag",...N,n,r]),ref:w,style:{...o,scale:_,...a&&{[k?"backgroundColor":"borderColor"]:a}},children:i})});const tZ={idle:"border-zinc-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},nZ=({data:e,selected:t})=>{const n=e,r=n.status||"idle",o=tZ[r];return G.jsxs("div",{className:`px-4 py-2 rounded-lg border-2 bg-surface ${o} ${t?"ring-2 ring-blue-400":""} min-w-[140px] text-center`,children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-zinc-500 !w-2 !h-2"}),G.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[G.jsx(wm,{className:"h-3.5 w-3.5 text-secondary flex-shrink-0"}),G.jsx("span",{className:"text-xs font-medium text-primary truncate",children:n.label})]}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-zinc-500 !w-2 !h-2"})]})},rZ={idle:"border-purple-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},oZ={idle:"border-zinc-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},iZ={idle:"border-blue-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},aZ={idle:"border-zinc-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},sZ={idle:"border-orange-600",running:"border-blue-500 animate-pulse",completed:"border-green-500",failed:"border-red-500",skipped:"border-zinc-700 opacity-50"},lZ={step:nZ,agent:({data:e,selected:t})=>{const n=e,r=n.status||"idle",o=rZ[r];return G.jsxs("div",{className:`px-4 py-2 rounded-lg border-2 bg-surface ${o} ${t?"ring-2 ring-purple-400":""} min-w-[140px] text-center`,children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-purple-500 !w-2 !h-2"}),G.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[G.jsx(Wp,{className:"h-3.5 w-3.5 text-purple-400 flex-shrink-0"}),G.jsx("span",{className:"text-xs font-medium text-primary truncate",children:n.label})]}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-purple-500 !w-2 !h-2"})]})},condition:({data:e,selected:t})=>{const n=e.status||"idle",r=oZ[n];return G.jsxs("div",{className:"relative",style:{width:60,height:60},children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-zinc-500 !w-2 !h-2"}),G.jsx("div",{className:`absolute inset-0 border-2 bg-surface ${r} ${t?"ring-2 ring-blue-400":""}`,style:{transform:"rotate(45deg)",borderRadius:4},children:G.jsx("div",{className:"flex items-center justify-center w-full h-full",style:{transform:"rotate(-45deg)"},children:G.jsx(om,{className:"h-4 w-4 text-secondary"})})}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-zinc-500 !w-2 !h-2"})]})},switch:({data:e,selected:t})=>{const n=e.status||"idle",r=iZ[n];return G.jsxs("div",{className:"relative",style:{width:60,height:60},children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-blue-500 !w-2 !h-2"}),G.jsx("div",{className:`absolute inset-0 border-2 bg-surface ${r} ${t?"ring-2 ring-blue-400":""}`,style:{transform:"rotate(45deg)",borderRadius:4},children:G.jsx("div",{className:"flex items-center justify-center w-full h-full",style:{transform:"rotate(-45deg)"},children:G.jsx(im,{className:"h-4 w-4 text-blue-400"})})}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-blue-500 !w-2 !h-2"})]})},parallel:({data:e,selected:t})=>{const n=e,r=n.status||"idle",o=aZ[r];return G.jsxs("div",{className:`px-4 py-2 rounded-lg border-2 border-dashed bg-surface ${o} ${t?"ring-2 ring-blue-400":""} min-w-[140px] text-center`,children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-zinc-500 !w-2 !h-2"}),G.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[G.jsx(am,{className:"h-3.5 w-3.5 text-secondary flex-shrink-0"}),G.jsx("span",{className:"text-xs font-medium text-primary truncate",children:n.label})]}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-zinc-500 !w-2 !h-2"})]})},foreach:({data:e,selected:t})=>{const n=e,r=n.status||"idle",o=sZ[r];return G.jsxs("div",{className:`px-4 py-2 rounded-lg border-2 bg-surface ${o} ${t?"ring-2 ring-orange-400":""} min-w-[140px] text-center`,children:[G.jsx(pq,{type:"target",position:A$.Top,className:"!bg-orange-500 !w-2 !h-2"}),G.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[G.jsx(pm,{className:"h-3.5 w-3.5 text-orange-400 flex-shrink-0"}),G.jsx("span",{className:"text-xs font-medium text-primary truncate",children:n.label})]}),G.jsx(pq,{type:"source",position:A$.Bottom,className:"!bg-orange-500 !w-2 !h-2"})]})},connector:nZ};var cZ,uZ,dZ,fZ,hZ,pZ,mZ,gZ,vZ,yZ,bZ,xZ,wZ,kZ,_Z,SZ,CZ,EZ,NZ,IZ,OZ,MZ,jZ,TZ,PZ,AZ,RZ,LZ,DZ,zZ,FZ,UZ,BZ,$Z,VZ,HZ,WZ,qZ,KZ,ZZ,YZ,XZ,GZ,JZ,QZ,eY,tY,nY,rY,oY,iY,aY,sY,lY,cY,uY,dY,fY,hY,pY,mY,gY,vY,yY,bY,xY,wY,kY,_Y,SY,CY,EY,NY,IY,OY,MY,jY,TY,PY,AY,RY,LY,DY,zY,FY,UY,BY,$Y,VY,HY,WY,qY,KY,ZY,YY,XY,GY,JY,QY,eX,tX,nX,rX,oX,iX,aX,sX,lX;function cX(){if(fZ)return dZ;return fZ=1,dZ=function(e,t){return e===t||e!=e&&t!=t},dZ}function uX(){if(pZ)return hZ;pZ=1;var e=cX();return hZ=function(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}}function dX(){if(SZ)return _Z;SZ=1;var e=uZ?cZ:(uZ=1,cZ=function(){this.__data__=[],this.size=0}),t=function(){if(gZ)return mZ;gZ=1;var e=uX(),t=Array.prototype.splice;return mZ=function(n){var r=this.__data__,o=e(r,n);return!(o<0||(o==r.length-1?r.pop():t.call(r,o,1),--this.size,0))}}(),n=function(){if(yZ)return vZ;yZ=1;var e=uX();return vZ=function(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}}(),r=function(){if(xZ)return bZ;xZ=1;var e=uX();return bZ=function(t){return e(this.__data__,t)>-1}}(),o=function(){if(kZ)return wZ;kZ=1;var e=uX();return wZ=function(t,n){var r=this.__data__,o=e(r,t);return o<0?(++this.size,r.push([t,n])):r[o][1]=n,this},wZ}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,_Z=i}function fX(){if(AZ)return PZ;AZ=1;var e="object"==typeof n&&n&&n.Object===Object&&n;return PZ=e}function hX(){if(LZ)return RZ;LZ=1;var e=fX(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return RZ=n}function pX(){if(zZ)return DZ;zZ=1;var e=hX().Symbol;return DZ=e}function mX(){if(HZ)return VZ;HZ=1;var e=pX(),t=function(){if(UZ)return FZ;UZ=1;var e=pX(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return FZ=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(rp){}var s=r.call(e);return a&&(t?e[o]=i:delete e[o]),s},FZ}(),n=function(){if($Z)return BZ;$Z=1;var e=Object.prototype.toString;return BZ=function(t){return e.call(t)},BZ}(),r=e?e.toStringTag:void 0;return VZ=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)},VZ}function gX(){if(qZ)return WZ;return qZ=1,WZ=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},WZ}function vX(){if(ZZ)return KZ;ZZ=1;var e=mX(),t=gX();return KZ=function(n){if(!t(n))return!1;var r=e(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},KZ}function yX(){if(JZ)return GZ;JZ=1;var e,t=function(){if(XZ)return YZ;XZ=1;var e=hX()["__core-js_shared__"];return YZ=e}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return GZ=function(e){return!!n&&n in e}}function bX(){if(eY)return QZ;eY=1;var e=Function.prototype.toString;return QZ=function(t){if(null!=t){try{return e.call(t)}catch(rp){}try{return t+""}catch(rp){}}return""}}function xX(){if(aY)return iY;aY=1;var e=function(){if(nY)return tY;nY=1;var e=vX(),t=yX(),n=gX(),r=bX(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,s=i.toString,l=a.hasOwnProperty,c=RegExp("^"+s.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return tY=function(i){return!(!n(i)||t(i))&&(e(i)?c:o).test(r(i))},tY}(),t=oY?rY:(oY=1,rY=function(e,t){return null==e?void 0:e[t]});return iY=function(n,r){var o=t(n,r);return e(o)?o:void 0},iY}function wX(){if(lY)return sY;lY=1;var e=xX()(hX(),"Map");return sY=e}function kX(){if(uY)return cY;uY=1;var e=xX()(Object,"create");return cY=e}function _X(){if(kY)return wY;kY=1;var e=function(){if(fY)return dY;fY=1;var e=kX();return dY=function(){this.__data__=e?e(null):{},this.size=0}}(),t=pY?hY:(pY=1,hY=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}),n=function(){if(gY)return mY;gY=1;var e=kX(),t=Object.prototype.hasOwnProperty;return mY=function(n){var r=this.__data__;if(e){var o=r[n];return"__lodash_hash_undefined__"===o?void 0:o}return t.call(r,n)?r[n]:void 0}}(),r=function(){if(yY)return vY;yY=1;var e=kX(),t=Object.prototype.hasOwnProperty;return vY=function(n){var r=this.__data__;return e?void 0!==r[n]:t.call(r,n)}}(),o=function(){if(xY)return bY;xY=1;var e=kX();return bY=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=e&&void 0===n?"__lodash_hash_undefined__":n,this},bY}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,wY=i}function SX(){if(IY)return NY;IY=1;var e=(EY||(EY=1,CY=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}),CY);return NY=function(t,n){var r=t.__data__;return e(n)?r["string"==typeof n?"string":"hash"]:r.map}}function CX(){if(zY)return DY;zY=1;var e=function(){if(SY)return _Y;SY=1;var e=_X(),t=dX(),n=wX();return _Y=function(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}}(),t=function(){if(MY)return OY;MY=1;var e=SX();return OY=function(t){var n=e(this,t).delete(t);return this.size-=n?1:0,n}}(),n=function(){if(TY)return jY;TY=1;var e=SX();return jY=function(t){return e(this,t).get(t)}}(),r=function(){if(AY)return PY;AY=1;var e=SX();return PY=function(t){return e(this,t).has(t)}}(),o=function(){if(LY)return RY;LY=1;var e=SX();return RY=function(t,n){var r=e(this,t),o=r.size;return r.set(t,n),this.size+=r.size==o?0:1,this},RY}();function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=o,DY=i}function EX(){if($Y)return BY;$Y=1;var e=dX(),t=function(){if(EZ)return CZ;EZ=1;var e=dX();return CZ=function(){this.__data__=new e,this.size=0}}(),n=IZ?NZ:(IZ=1,NZ=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}),r=MZ?OZ:(MZ=1,OZ=function(e){return this.__data__.get(e)}),o=TZ?jZ:(TZ=1,jZ=function(e){return this.__data__.has(e)}),i=function(){if(UY)return FY;UY=1;var e=dX(),t=wX(),n=CX();return FY=function(r,o){var i=this.__data__;if(i instanceof e){var a=i.__data__;if(!t||a.length<199)return a.push([r,o]),this.size=++i.size,this;i=this.__data__=new n(a)}return i.set(r,o),this.size=i.size,this},FY}();function a(t){var n=this.__data__=new e(t);this.size=n.size}return a.prototype.clear=t,a.prototype.delete=n,a.prototype.get=r,a.prototype.has=o,a.prototype.set=i,BY=a}function NX(){if(HY)return VY;return HY=1,VY=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}}function IX(){if(qY)return WY;qY=1;var e=xX(),t=function(){try{var t=e(Object,"defineProperty");return t({},"",{}),t}catch(rp){}}();return WY=t}function OX(){if(ZY)return KY;ZY=1;var e=IX();return KY=function(t,n,r){"__proto__"==n&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r},KY}function MX(){if(XY)return YY;XY=1;var e=OX(),t=cX(),n=Object.prototype.hasOwnProperty;return YY=function(r,o,i){var a=r[o];n.call(r,o)&&t(a,i)&&(void 0!==i||o in r)||e(r,o,i)},YY}function jX(){if(JY)return GY;JY=1;var e=MX(),t=OX();return GY=function(n,r,o,i){var a=!o;o||(o={});for(var s=-1,l=r.length;++s<l;){var c=r[s],u=i?i(o[c],n[c],c,o,n):void 0;void 0===u&&(u=n[c]),a?t(o,c,u):e(o,c,u)}return o}}function TX(){if(nX)return tX;return nX=1,tX=function(e){return null!=e&&"object"==typeof e},tX}function PX(){if(aX)return iX;aX=1;var e=function(){if(oX)return rX;oX=1;var e=mX(),t=TX();return rX=function(n){return t(n)&&"[object Arguments]"==e(n)},rX}(),t=TX(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return t(e)&&r.call(e,"callee")&&!o.call(e,"callee")};return iX=i}function AX(){if(lX)return sX;lX=1;var e=Array.isArray;return sX=e}var RX,LX,DX,zX,FX,UX,BX,$X,VX,HX,WX,qX={exports:{}};function KX(){return DX||(DX=1,e=qX,t=qX.exports,n=hX(),r=LX?RX:(LX=1,RX=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,s=(a?a.isBuffer:void 0)||r,e.exports=s),qX.exports;var e,t,n,r,o,i,a,s}function ZX(){if(FX)return zX;FX=1;var e=/^(?:0|[1-9]\d*)$/;return zX=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n},zX}function YX(){if(BX)return UX;BX=1;return UX=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},UX}function XX(){if(WX)return HX;return WX=1,HX=function(e){return function(t){return e(t)}},HX}var GX,JX,QX,eG,tG,nG,rG,oG,iG,aG,sG,lG,cG,uG,dG,fG,hG,pG,mG,gG,vG,yG,bG,xG,wG,kG,_G,SG={exports:{}};function CG(){return GX||(GX=1,e=SG,t=SG.exports,n=fX(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(rp){}}(),e.exports=a),SG.exports;var e,t,n,r,o,i,a}function EG(){if(QX)return JX;QX=1;var e=function(){if(VX)return $X;VX=1;var e=mX(),t=YX(),n=TX(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,$X=function(o){return n(o)&&t(o.length)&&!!r[e(o)]},$X}(),t=XX(),n=CG(),r=n&&n.isTypedArray,o=r?t(r):e;return JX=o}function NG(){if(tG)return eG;tG=1;var e=eX?QY:(eX=1,QY=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}),t=PX(),n=AX(),r=KX(),o=ZX(),i=EG(),a=Object.prototype.hasOwnProperty;return eG=function(s,l){var c=n(s),u=!c&&t(s),d=!c&&!u&&r(s),f=!c&&!u&&!d&&i(s),h=c||u||d||f,p=h?e(s.length,String):[],m=p.length;for(var g in s)!l&&!a.call(s,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||o(g,m))||p.push(g);return p},eG}function IG(){if(rG)return nG;rG=1;var e=Object.prototype;return nG=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)},nG}function OG(){if(iG)return oG;return iG=1,oG=function(e,t){return function(n){return e(t(n))}}}function MG(){if(cG)return lG;cG=1;var e=IG(),t=function(){if(sG)return aG;sG=1;var e=OG()(Object.keys,Object);return aG=e}(),n=Object.prototype.hasOwnProperty;return lG=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&"constructor"!=i&&o.push(i);return o}}function jG(){if(dG)return uG;dG=1;var e=vX(),t=YX();return uG=function(n){return null!=n&&t(n.length)&&!e(n)},uG}function TG(){if(hG)return fG;hG=1;var e=NG(),t=MG(),n=jG();return fG=function(r){return n(r)?e(r):t(r)}}function PG(){if(bG)return yG;bG=1;var e=gX(),t=IG(),n=vG?gG:(vG=1,gG=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}),r=Object.prototype.hasOwnProperty;return yG=function(o){if(!e(o))return n(o);var i=t(o),a=[];for(var s in o)("constructor"!=s||!i&&r.call(o,s))&&a.push(s);return a}}function AG(){if(wG)return xG;wG=1;var e=NG(),t=PG(),n=jG();return xG=function(r){return n(r)?e(r,!0):t(r)}}var RG,LG,DG,zG,FG,UG,BG,$G,VG,HG,WG,qG,KG,ZG,YG,XG,GG,JG,QG,eJ,tJ,nJ,rJ,oJ,iJ,aJ,sJ,lJ,cJ,uJ,dJ,fJ,hJ,pJ,mJ,gJ,vJ,yJ,bJ,xJ,wJ,kJ,_J,SJ,CJ,EJ,NJ,IJ,OJ,MJ,jJ,TJ,PJ,AJ,RJ,LJ,DJ,zJ,FJ,UJ,BJ,$J,VJ,HJ,WJ,qJ,KJ,ZJ,YJ,XJ,GJ,JJ,QJ,eQ,tQ,nQ,rQ,oQ,iQ,aQ,sQ,lQ,cQ,uQ,dQ,fQ,hQ,pQ,mQ,gQ,vQ,yQ,bQ,xQ,wQ,kQ,_Q,SQ,CQ,EQ,NQ,IQ,OQ,MQ,jQ,TQ,PQ,AQ,RQ,LQ,DQ,zQ,FQ,UQ,BQ,$Q,VQ,HQ,WQ,qQ,KQ,ZQ,YQ,XQ,GQ,JQ,QQ,e0,t0,n0,r0,o0,i0,a0,s0,l0,c0,u0,d0,f0,h0,p0,m0,g0,v0,y0,b0,x0,w0,k0,_0,S0,C0,E0,N0,I0,O0,M0,j0,T0,P0,A0,R0,L0,D0,z0,F0,U0,B0,$0,V0,H0,W0,q0,K0,Z0,Y0,X0,G0,J0,Q0,e1,t1,n1,r1,o1,i1,a1,s1,l1,c1,u1,d1,f1,h1,p1,m1,g1,v1,y1,b1,x1,w1,k1,_1,S1,C1,E1,N1,I1,O1,M1,j1,T1,P1,A1,R1,L1,D1,z1,F1,U1,B1,$1,V1,H1,W1,q1,K1,Z1,Y1,X1,G1,J1,Q1,e2,t2,n2,r2,o2,i2,a2,s2,l2,c2,u2,d2,f2,h2,p2,m2,g2,v2,y2,b2,x2,w2,k2,_2,S2,C2,E2,N2,I2,O2,M2,j2,T2,P2,A2,R2,L2,D2,z2,F2,U2,B2,$2,V2,H2,W2={exports:{}};function q2(){return RG||(RG=1,e=W2,t=W2.exports,n=hX(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0,e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}),W2.exports;var e,t,n,r,o,i,a}function K2(){if(DG)return LG;return DG=1,LG=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}}function Z2(){if(FG)return zG;return FG=1,zG=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i},zG}function Y2(){if(BG)return UG;return BG=1,UG=function(){return[]}}function X2(){if(VG)return $G;VG=1;var e=Z2(),t=Y2(),n=Object.prototype.propertyIsEnumerable,r=Object.getOwnPropertySymbols;return $G=r?function(t){return null==t?[]:(t=Object(t),e(r(t),function(e){return n.call(t,e)}))}:t}function G2(){if(KG)return qG;return KG=1,qG=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}}function J2(){if(YG)return ZG;YG=1;var e=OG()(Object.getPrototypeOf,Object);return ZG=e}function Q2(){if(GG)return XG;GG=1;var e=G2(),t=J2(),n=X2(),r=Y2(),o=Object.getOwnPropertySymbols;return XG=o?function(r){for(var o=[];r;)e(o,n(r)),r=t(r);return o}:r}function e3(){if(tJ)return eJ;tJ=1;var e=G2(),t=AX();return eJ=function(n,r,o){var i=r(n);return t(n)?i:e(i,o(n))}}function t3(){if(rJ)return nJ;rJ=1;var e=e3(),t=X2(),n=TG();return nJ=function(r){return e(r,n,t)}}function n3(){if(dJ)return uJ;dJ=1;var e=xX()(hX(),"Set");return uJ=e}function r3(){if(mJ)return pJ;mJ=1;var e=function(){if(sJ)return aJ;sJ=1;var e=xX()(hX(),"DataView");return aJ=e}(),t=wX(),n=function(){if(cJ)return lJ;cJ=1;var e=xX()(hX(),"Promise");return lJ=e}(),r=n3(),o=function(){if(hJ)return fJ;hJ=1;var e=xX()(hX(),"WeakMap");return fJ=e}(),i=mX(),a=bX(),s="[object Map]",l="[object Promise]",c="[object Set]",u="[object WeakMap]",d="[object DataView]",f=a(e),h=a(t),p=a(n),m=a(r),g=a(o),v=i;return(e&&v(new e(new ArrayBuffer(1)))!=d||t&&v(new t)!=s||n&&v(n.resolve())!=l||r&&v(new r)!=c||o&&v(new o)!=u)&&(v=function(e){var t=i(e),n="[object Object]"==t?e.constructor:void 0,r=n?a(n):"";if(r)switch(r){case f:return d;case h:return s;case p:return l;case m:return c;case g:return u}return t}),pJ=v}function o3(){if(bJ)return yJ;bJ=1;var e=hX().Uint8Array;return yJ=e}function i3(){if(wJ)return xJ;wJ=1;var e=o3();return xJ=function(t){var n=new t.constructor(t.byteLength);return new e(n).set(new e(t)),n}}function a3(){if(OJ)return IJ;OJ=1;var e=i3();return IJ=function(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}}function s3(){if(jJ)return MJ;jJ=1;var e=i3(),t=function(){if(_J)return kJ;_J=1;var e=i3();return kJ=function(t,n){var r=n?e(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}}(),n=function(){if(CJ)return SJ;CJ=1;var e=/\w*$/;return SJ=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}}(),r=function(){if(NJ)return EJ;NJ=1;var e=pX(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;return EJ=function(e){return n?Object(n.call(e)):{}}}(),o=a3();return MJ=function(i,a,s){var l=i.constructor;switch(a){case"[object ArrayBuffer]":return e(i);case"[object Boolean]":case"[object Date]":return new l(+i);case"[object DataView]":return t(i,s);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return o(i,s);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(i);case"[object RegExp]":return n(i);case"[object Symbol]":return r(i)}}}function l3(){if(PJ)return TJ;PJ=1;var e=gX(),t=Object.create;return TJ=function(){function n(){}return function(r){if(!e(r))return{};if(t)return t(r);n.prototype=r;var o=new n;return n.prototype=void 0,o}}()}function c3(){if(RJ)return AJ;RJ=1;var e=l3(),t=J2(),n=IG();return AJ=function(r){return"function"!=typeof r.constructor||n(r)?{}:e(t(r))}}function u3(){if(FJ)return zJ;FJ=1;var e=function(){if(DJ)return LJ;DJ=1;var e=r3(),t=TX();return LJ=function(n){return t(n)&&"[object Map]"==e(n)},LJ}(),t=XX(),n=CG(),r=n&&n.isMap,o=r?t(r):e;return zJ=o}function d3(){if(VJ)return $J;VJ=1;var e=function(){if(BJ)return UJ;BJ=1;var e=r3(),t=TX();return UJ=function(n){return t(n)&&"[object Set]"==e(n)},UJ}(),t=XX(),n=CG(),r=n&&n.isSet,o=r?t(r):e;return $J=o}function f3(){if(WJ)return HJ;WJ=1;var e=EX(),t=NX(),n=MX(),r=function(){if(mG)return pG;mG=1;var e=jX(),t=TG();return pG=function(n,r){return n&&e(r,t(r),n)}}(),o=function(){if(_G)return kG;_G=1;var e=jX(),t=AG();return kG=function(n,r){return n&&e(r,t(r),n)}}(),i=q2(),a=K2(),s=function(){if(WG)return HG;WG=1;var e=jX(),t=X2();return HG=function(n,r){return e(n,t(n),r)}}(),l=function(){if(QG)return JG;QG=1;var e=jX(),t=Q2();return JG=function(n,r){return e(n,t(n),r)}}(),c=t3(),u=function(){if(iJ)return oJ;iJ=1;var e=e3(),t=Q2(),n=AG();return oJ=function(r){return e(r,n,t)}}(),d=r3(),f=function(){if(vJ)return gJ;vJ=1;var e=Object.prototype.hasOwnProperty;return gJ=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}}(),h=s3(),p=c3(),m=AX(),g=KX(),v=u3(),y=gX(),b=d3(),x=TG(),w=AG(),k="[object Arguments]",_="[object Function]",S="[object Object]",C={};return C[k]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[S]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[_]=C["[object WeakMap]"]=!1,HJ=function E(N,I,O,M,j,T){var P,A=1&I,R=2&I,L=4&I;if(O&&(P=j?O(N,M,j,T):O(N)),void 0!==P)return P;if(!y(N))return N;var D=m(N);if(D){if(P=f(N),!A)return a(N,P)}else{var z=d(N),F=z==_||"[object GeneratorFunction]"==z;if(g(N))return i(N,A);if(z==S||z==k||F&&!j){if(P=R||F?{}:p(N),!A)return R?l(N,o(P,N)):s(N,r(P,N))}else{if(!C[z])return j?N:{};P=h(N,z,A)}}T||(T=new e);var U=T.get(N);if(U)return U;T.set(N,P),b(N)?N.forEach(function(e){P.add(E(e,I,O,e,N,T))}):v(N)&&N.forEach(function(e,t){P.set(t,E(e,I,O,t,N,T))});var B=D?void 0:(L?R?u:c:R?w:x)(N);return t(B||N,function(e,t){B&&(e=N[t=e]),n(P,t,E(e,I,O,t,N,T))}),P},HJ}function h3(){if(KJ)return qJ;KJ=1;var e=f3();return qJ=function(t){return e(t,4)},qJ}function p3(){if(YJ)return ZJ;return YJ=1,ZJ=function(e){return function(){return e}},ZJ}function m3(){if(QJ)return JJ;QJ=1;var e=(GJ?XJ:(GJ=1,XJ=function(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(!1===n(i[l],l,i))break}return t}}))();return JJ=e}function g3(){if(tQ)return eQ;tQ=1;var e=m3(),t=TG();return eQ=function(n,r){return n&&e(n,r,t)}}function v3(){if(iQ)return oQ;iQ=1;var e=g3(),t=function(){if(rQ)return nQ;rQ=1;var e=jG();return nQ=function(t,n){return function(r,o){if(null==r)return r;if(!e(r))return t(r,o);for(var i=r.length,a=n?i:-1,s=Object(r);(n?a--:++a<i)&&!1!==o(s[a],a,s););return r}}}()(e);return oQ=t}function y3(){if(sQ)return aQ;return sQ=1,aQ=function(e){return e},aQ}function b3(){if(cQ)return lQ;cQ=1;var e=y3();return lQ=function(t){return"function"==typeof t?t:e},lQ}function x3(){if(dQ)return uQ;dQ=1;var e=NX(),t=v3(),n=b3(),r=AX();return uQ=function(o,i){return(r(o)?e:t)(o,n(i))}}function w3(){return hQ?fQ:(hQ=1,fQ=x3())}function k3(){if(wQ)return xQ;wQ=1;var e=CX(),t=(vQ||(vQ=1,gQ=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}),gQ),n=(bQ||(bQ=1,yQ=function(e){return this.__data__.has(e)}),yQ);function r(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new e;++n<r;)this.add(t[n])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,xQ=r}function _3(){if(CQ)return SQ;return CQ=1,SQ=function(e,t){return e.has(t)}}function S3(){if(NQ)return EQ;NQ=1;var e=k3(),t=_Q?kQ:(_Q=1,kQ=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}),n=_3();return EQ=function(r,o,i,a,s,l){var c=1&i,u=r.length,d=o.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(r),h=l.get(o);if(f&&h)return f==o&&h==r;var p=-1,m=!0,g=2&i?new e:void 0;for(l.set(r,o),l.set(o,r);++p<u;){var v=r[p],y=o[p];if(a)var b=c?a(y,v,p,o,r,l):a(v,y,p,r,o,l);if(void 0!==b){if(b)continue;m=!1;break}if(g){if(!t(o,function(e,t){if(!n(g,t)&&(v===e||s(v,e,i,a,l)))return g.push(t)})){m=!1;break}}else if(v!==y&&!s(v,y,i,a,l)){m=!1;break}}return l.delete(r),l.delete(o),m}}function C3(){if(jQ)return MQ;return jQ=1,MQ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},MQ}function E3(){if(PQ)return TQ;PQ=1;var e=pX(),t=o3(),n=cX(),r=S3(),o=(OQ||(OQ=1,IQ=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}),IQ),i=C3(),a=e?e.prototype:void 0,s=a?a.valueOf:void 0;return TQ=function(e,a,l,c,u,d,f){switch(l){case"[object DataView]":if(e.byteLength!=a.byteLength||e.byteOffset!=a.byteOffset)return!1;e=e.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=a.byteLength||!d(new t(e),new t(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+e,+a);case"[object Error]":return e.name==a.name&&e.message==a.message;case"[object RegExp]":case"[object String]":return e==a+"";case"[object Map]":var h=o;case"[object Set]":var p=1&c;if(h||(h=i),e.size!=a.size&&!p)return!1;var m=f.get(e);if(m)return m==a;c|=2,f.set(e,a);var g=r(h(e),h(a),c,u,d,f);return f.delete(e),g;case"[object Symbol]":if(s)return s.call(e)==s.call(a)}return!1}}function N3(){if(DQ)return LQ;DQ=1;var e=EX(),t=S3(),n=E3(),r=function(){if(RQ)return AQ;RQ=1;var e=t3(),t=Object.prototype.hasOwnProperty;return AQ=function(n,r,o,i,a,s){var l=1&o,c=e(n),u=c.length;if(u!=e(r).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in r:t.call(r,f)))return!1}var h=s.get(n),p=s.get(r);if(h&&p)return h==r&&p==n;var m=!0;s.set(n,r),s.set(r,n);for(var g=l;++d<u;){var v=n[f=c[d]],y=r[f];if(i)var b=l?i(y,v,f,r,n,s):i(v,y,f,n,r,s);if(!(void 0===b?v===y||a(v,y,o,i,s):b)){m=!1;break}g||(g="constructor"==f)}if(m&&!g){var x=n.constructor,w=r.constructor;x==w||!("constructor"in n)||!("constructor"in r)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(m=!1)}return s.delete(n),s.delete(r),m}}(),o=r3(),i=AX(),a=KX(),s=EG(),l="[object Arguments]",c="[object Array]",u="[object Object]",d=Object.prototype.hasOwnProperty;return LQ=function(f,h,p,m,g,v){var y=i(f),b=i(h),x=y?c:o(f),w=b?c:o(h),k=(x=x==l?u:x)==u,_=(w=w==l?u:w)==u,S=x==w;if(S&&a(f)){if(!a(h))return!1;y=!0,k=!1}if(S&&!k)return v||(v=new e),y||s(f)?t(f,h,p,m,g,v):n(f,h,x,p,m,g,v);if(!(1&p)){var C=k&&d.call(f,"__wrapped__"),E=_&&d.call(h,"__wrapped__");if(C||E){var N=C?f.value():f,I=E?h.value():h;return v||(v=new e),g(N,I,p,m,v)}}return!!S&&(v||(v=new e),r(f,h,p,m,g,v))}}function I3(){if(FQ)return zQ;FQ=1;var e=N3(),t=TX();return zQ=function n(r,o,i,a,s){return r===o||(null==r||null==o||!t(r)&&!t(o)?r!=r&&o!=o:e(r,o,i,a,n,s))},zQ}function O3(){if(VQ)return $Q;VQ=1;var e=gX();return $Q=function(t){return t==t&&!e(t)},$Q}function M3(){if(KQ)return qQ;return KQ=1,qQ=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}}function j3(){if(YQ)return ZQ;YQ=1;var e=function(){if(BQ)return UQ;BQ=1;var e=EX(),t=I3();return UQ=function(n,r,o,i){var a=o.length,s=a,l=!i;if(null==n)return!s;for(n=Object(n);a--;){var c=o[a];if(l&&c[2]?c[1]!==n[c[0]]:!(c[0]in n))return!1}for(;++a<s;){var u=(c=o[a])[0],d=n[u],f=c[1];if(l&&c[2]){if(void 0===d&&!(u in n))return!1}else{var h=new e;if(i)var p=i(d,f,u,n,r,h);if(!(void 0===p?t(f,d,3,i,h):p))return!1}}return!0}}(),t=function(){if(WQ)return HQ;WQ=1;var e=O3(),t=TG();return HQ=function(n){for(var r=t(n),o=r.length;o--;){var i=r[o],a=n[i];r[o]=[i,a,e(a)]}return r},HQ}(),n=M3();return ZQ=function(r){var o=t(r);return 1==o.length&&o[0][2]?n(o[0][0],o[0][1]):function(t){return t===r||e(t,r,o)}}}function T3(){if(GQ)return XQ;GQ=1;var e=mX(),t=TX();return XQ=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)},XQ}function P3(){if(QQ)return JQ;QQ=1;var e=AX(),t=T3(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return JQ=function(o,i){if(e(o))return!1;var a=typeof o;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=o&&!t(o))||(r.test(o)||!n.test(o)||null!=i&&o in Object(i))},JQ}function A3(){if(r0)return n0;r0=1;var e=function(){if(t0)return e0;t0=1;var e=CX();function t(n,r){if("function"!=typeof n||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var o=function(){var e=arguments,t=r?r.apply(this,e):e[0],i=o.cache;if(i.has(t))return i.get(t);var a=n.apply(this,e);return o.cache=i.set(t,a)||i,a};return o.cache=new(t.Cache||e),o}return t.Cache=e,e0=t}();return n0=function(t){var n=e(t,function(e){return 500===r.size&&r.clear(),e}),r=n.cache;return n}}function R3(){if(s0)return a0;return s0=1,a0=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}}function L3(){if(d0)return u0;d0=1;var e=function(){if(c0)return l0;c0=1;var e=pX(),t=R3(),n=AX(),r=T3(),o=e?e.prototype:void 0,i=o?o.toString:void 0;return l0=function e(o){if("string"==typeof o)return o;if(n(o))return t(o,e)+"";if(r(o))return i?i.call(o):"";var a=o+"";return"0"==a&&1/o==-1/0?"-0":a},l0}();return u0=function(t){return null==t?"":e(t)},u0}function D3(){if(h0)return f0;h0=1;var e=AX(),t=P3(),n=function(){if(i0)return o0;i0=1;var e=A3(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(e){var r=[];return 46===e.charCodeAt(0)&&r.push(""),e.replace(t,function(e,t,o,i){r.push(o?i.replace(n,"$1"):t||e)}),r});return o0=r}(),r=L3();return f0=function(o,i){return e(o)?o:t(o,i)?[o]:n(r(o))},f0}function z3(){if(m0)return p0;m0=1;var e=T3();return p0=function(t){if("string"==typeof t||e(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},p0}function F3(){if(v0)return g0;v0=1;var e=D3(),t=z3();return g0=function(n,r){for(var o=0,i=(r=e(r,n)).length;null!=n&&o<i;)n=n[t(r[o++])];return o&&o==i?n:void 0}}function U3(){if(_0)return k0;_0=1;var e=D3(),t=PX(),n=AX(),r=ZX(),o=YX(),i=z3();return k0=function(a,s,l){for(var c=-1,u=(s=e(s,a)).length,d=!1;++c<u;){var f=i(s[c]);if(!(d=null!=a&&l(a,f)))break;a=a[f]}return d||++c!=u?d:!!(u=null==a?0:a.length)&&o(u)&&r(f,u)&&(n(a)||t(a))}}function B3(){if(C0)return S0;C0=1;var e=w0?x0:(w0=1,x0=function(e,t){return null!=e&&t in Object(e)}),t=U3();return S0=function(n,r){return null!=n&&t(n,r,e)}}function $3(){if(N0)return E0;N0=1;var e=I3(),t=function(){if(b0)return y0;b0=1;var e=F3();return y0=function(t,n,r){var o=null==t?void 0:e(t,n);return void 0===o?r:o}}(),n=B3(),r=P3(),o=O3(),i=M3(),a=z3();return E0=function(s,l){return r(s)&&o(l)?i(a(s),l):function(r){var o=t(r,s);return void 0===o&&o===l?n(r,s):e(l,o,3)}}}function V3(){if(O0)return I0;return O0=1,I0=function(e){return function(t){return null==t?void 0:t[e]}}}function H3(){if(P0)return T0;P0=1;var e=V3(),t=function(){if(j0)return M0;j0=1;var e=F3();return M0=function(t){return function(n){return e(n,t)}}}(),n=P3(),r=z3();return T0=function(o){return n(o)?e(r(o)):t(o)}}function W3(){if(R0)return A0;R0=1;var e=j3(),t=$3(),n=y3(),r=AX(),o=H3();return A0=function(i){return"function"==typeof i?i:null==i?n:"object"==typeof i?r(i)?t(i[0],i[1]):e(i):o(i)},A0}function q3(){if(D0)return L0;D0=1;var e=Z2(),t=function(){if(mQ)return pQ;mQ=1;var e=v3();return pQ=function(t,n){var r=[];return e(t,function(e,t,o){n(e,t,o)&&r.push(e)}),r},pQ}(),n=W3(),r=AX();return L0=function(o,i){return(r(o)?e:t)(o,n(i,3))}}function K3(){if(B0)return U0;B0=1;var e=function(){if(F0)return z0;F0=1;var e=Object.prototype.hasOwnProperty;return z0=function(t,n){return null!=t&&e.call(t,n)}}(),t=U3();return U0=function(n,r){return null!=n&&t(n,r,e)}}function Z3(){if(V0)return $0;V0=1;var e=MG(),t=r3(),n=PX(),r=AX(),o=jG(),i=KX(),a=IG(),s=EG(),l=Object.prototype.hasOwnProperty;return $0=function(c){if(null==c)return!0;if(o(c)&&(r(c)||"string"==typeof c||"function"==typeof c.splice||i(c)||s(c)||n(c)))return!c.length;var u=t(c);if("[object Map]"==u||"[object Set]"==u)return!c.size;if(a(c))return!e(c).length;for(var d in c)if(l.call(c,d))return!1;return!0},$0}function Y3(){if(W0)return H0;return W0=1,H0=function(e){return void 0===e},H0}function X3(){if(K0)return q0;K0=1;var e=v3(),t=jG();return q0=function(n,r){var o=-1,i=t(n)?Array(n.length):[];return e(n,function(e,t,n){i[++o]=r(e,t,n)}),i},q0}function G3(){if(Y0)return Z0;Y0=1;var e=R3(),t=W3(),n=X3(),r=AX();return Z0=function(o,i){return(r(o)?e:n)(o,t(i,3))}}function J3(){if(t1)return e1;t1=1;var e=G0?X0:(G0=1,X0=function(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}),t=v3(),n=W3(),r=(Q0||(Q0=1,J0=function(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}),J0),o=AX();return e1=function(i,a,s){var l=o(i)?e:r,c=arguments.length<3;return l(i,n(a,4),s,c,t)},e1}function Q3(){if(d1)return u1;d1=1;var e=function(){if(i1)return o1;i1=1;var e=V3()("length");return o1=e}(),t=function(){if(s1)return a1;s1=1;var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");return a1=function(t){return e.test(t)},a1}(),n=function(){if(c1)return l1;c1=1;var e="\\ud800-\\udfff",t="["+e+"]",n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")?",l="[\\ufe0e\\ufe0f]?",c=l+s+"(?:\\u200d(?:"+[o,i,a].join("|")+")"+l+s+")*",u="(?:"+[o+n+"?",n,i,a,t].join("|")+")",d=RegExp(r+"(?="+r+")|"+u+c,"g");return l1=function(e){for(var t=d.lastIndex=0;d.test(e);)++t;return t},l1}();return u1=function(r){return t(r)?n(r):e(r)},u1}function e4(){if(h1)return f1;h1=1;var e=MG(),t=r3(),n=jG(),r=function(){if(r1)return n1;r1=1;var e=mX(),t=AX(),n=TX();return n1=function(r){return"string"==typeof r||!t(r)&&n(r)&&"[object String]"==e(r)},n1}(),o=Q3();return f1=function(i){if(null==i)return 0;if(n(i))return r(i)?o(i):i.length;var a=t(i);return"[object Map]"==a||"[object Set]"==a?i.size:e(i).length}}function t4(){if(m1)return p1;m1=1;var e=NX(),t=l3(),n=g3(),r=W3(),o=J2(),i=AX(),a=KX(),s=vX(),l=gX(),c=EG();return p1=function(u,d,f){var h=i(u),p=h||a(u)||c(u);if(d=r(d,4),null==f){var m=u&&u.constructor;f=p?h?new m:[]:l(u)&&s(m)?t(o(u)):{}}return(p?e:n)(u,function(e,t,n){return d(f,e,t,n)}),f},p1}function n4(){if(b1)return y1;b1=1;var e=G2(),t=function(){if(v1)return g1;v1=1;var e=pX(),t=PX(),n=AX(),r=e?e.isConcatSpreadable:void 0;return g1=function(e){return n(e)||t(e)||!!(r&&e&&e[r])},g1}();return y1=function n(r,o,i,a,s){var l=-1,c=r.length;for(i||(i=t),s||(s=[]);++l<c;){var u=r[l];o>0&&i(u)?o>1?n(u,o-1,i,a,s):e(s,u):a||(s[s.length]=u)}return s},y1}function r4(){if(_1)return k1;_1=1;var e=w1?x1:(w1=1,x1=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}),t=Math.max;return k1=function(n,r,o){return r=t(void 0===r?n.length-1:r,0),function(){for(var i=arguments,a=-1,s=t(i.length-r,0),l=Array(s);++a<s;)l[a]=i[r+a];a=-1;for(var c=Array(r+1);++a<r;)c[a]=i[a];return c[r]=o(l),e(n,this,c)}},k1}function o4(){if(O1)return I1;O1=1;var e=function(){if(C1)return S1;C1=1;var e=p3(),t=IX(),n=y3(),r=t?function(n,r){return t(n,"toString",{configurable:!0,enumerable:!1,value:e(r),writable:!0})}:n;return S1=r}(),t=function(){if(N1)return E1;N1=1;var e=Date.now;return E1=function(t){var n=0,r=0;return function(){var o=e(),i=16-(o-r);if(r=o,i>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(void 0,arguments)}},E1}(),n=t(e);return I1=n}function i4(){if(j1)return M1;j1=1;var e=y3(),t=r4(),n=o4();return M1=function(r,o){return n(t(r,o,e),r+"")}}function a4(){if(P1)return T1;return P1=1,T1=function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}}function s4(){if(F1)return z1;F1=1;var e=a4(),t=(R1||(R1=1,A1=function(e){return e!=e}),A1),n=(D1||(D1=1,L1=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}),L1);return z1=function(r,o,i){return o==o?n(r,o,i):e(r,t,i)},z1}function l4(){if(K1)return q1;K1=1;var e=n3(),t=W1?H1:(W1=1,H1=function(){}),n=C3(),r=e&&1/n(new e([,-0]))[1]==1/0?function(t){return new e(t)}:t;return q1=r}function c4(){if(Y1)return Z1;Y1=1;var e=k3(),t=function(){if(B1)return U1;B1=1;var e=s4();return U1=function(t,n){return!(null==t||!t.length)&&e(t,n,0)>-1},U1}(),n=(V1||(V1=1,$1=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}),$1),r=_3(),o=l4(),i=C3();return Z1=function(a,s,l){var c=-1,u=t,d=a.length,f=!0,h=[],p=h;if(l)f=!1,u=n;else if(d>=200){var m=s?null:o(a);if(m)return i(m);f=!1,u=r,p=new e}else p=s?[]:h;e:for(;++c<d;){var g=a[c],v=s?s(g):g;if(g=l||0!==g?g:0,f&&v==v){for(var y=p.length;y--;)if(p[y]===v)continue e;s&&p.push(v),h.push(g)}else u(p,v,l)||(p!==h&&p.push(v),h.push(g))}return h},Z1}function u4(){if(G1)return X1;G1=1;var e=jG(),t=TX();return X1=function(n){return t(n)&&e(n)},X1}function d4(){if(Q1)return J1;Q1=1;var e=n4(),t=i4(),n=c4(),r=u4(),o=t(function(t){return n(e(t,1,r,!0))});return J1=o}function f4(){if(r2)return n2;r2=1;var e=function(){if(t2)return e2;t2=1;var e=R3();return e2=function(t,n){return e(n,function(e){return t[e]})}}(),t=TG();return n2=function(n){return null==n?[]:e(n,t(n))}}function h4(){if(i2)return o2;var e;i2=1;try{e={clone:h3(),constant:p3(),each:w3(),filter:q3(),has:K3(),isArray:AX(),isEmpty:Z3(),isFunction:vX(),isUndefined:Y3(),keys:TG(),map:G3(),reduce:J3(),size:e4(),transform:t4(),union:d4(),values:f4()}}catch(rp){}return e||(e=window._),o2=e}function p4(){if(s2)return a2;s2=1;var e=h4();a2=n;var t="\0";function n(n){this._isDirected=!e.has(n,"directed")||n.directed,this._isMultigraph=!!e.has(n,"multigraph")&&n.multigraph,this._isCompound=!!e.has(n,"compound")&&n.compound,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function r(e,t){e[t]?e[t]++:e[t]=1}function o(e,t){--e[t]||delete e[t]}function i(t,n,r,o){var i=""+n,a=""+r;if(!t&&i>a){var s=i;i=a,a=s}return i+""+a+""+(e.isUndefined(o)?"\0":o)}function a(e,t){return i(e,t.v,t.w,t.name)}return n.prototype._nodeCount=0,n.prototype._edgeCount=0,n.prototype.isDirected=function(){return this._isDirected},n.prototype.isMultigraph=function(){return this._isMultigraph},n.prototype.isCompound=function(){return this._isCompound},n.prototype.setGraph=function(e){return this._label=e,this},n.prototype.graph=function(){return this._label},n.prototype.setDefaultNodeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultNodeLabelFn=t,this},n.prototype.nodeCount=function(){return this._nodeCount},n.prototype.nodes=function(){return e.keys(this._nodes)},n.prototype.sources=function(){var t=this;return e.filter(this.nodes(),function(n){return e.isEmpty(t._in[n])})},n.prototype.sinks=function(){var t=this;return e.filter(this.nodes(),function(n){return e.isEmpty(t._out[n])})},n.prototype.setNodes=function(t,n){var r=arguments,o=this;return e.each(t,function(e){r.length>1?o.setNode(e,n):o.setNode(e)}),this},n.prototype.setNode=function(n,r){return e.has(this._nodes,n)?(arguments.length>1&&(this._nodes[n]=r),this):(this._nodes[n]=arguments.length>1?r:this._defaultNodeLabelFn(n),this._isCompound&&(this._parent[n]=t,this._children[n]={},this._children[t][n]=!0),this._in[n]={},this._preds[n]={},this._out[n]={},this._sucs[n]={},++this._nodeCount,this)},n.prototype.node=function(e){return this._nodes[e]},n.prototype.hasNode=function(t){return e.has(this._nodes,t)},n.prototype.removeNode=function(t){var n=this;if(e.has(this._nodes,t)){var r=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],e.each(this.children(t),function(e){n.setParent(e)}),delete this._children[t]),e.each(e.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],e.each(e.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},n.prototype.setParent=function(n,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(r))r=t;else{for(var o=r+="";!e.isUndefined(o);o=this.parent(o))if(o===n)throw new Error("Setting "+r+" as parent of "+n+" would create a cycle");this.setNode(r)}return this.setNode(n),this._removeFromParentsChildList(n),this._parent[n]=r,this._children[r][n]=!0,this},n.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},n.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(n!==t)return n}},n.prototype.children=function(n){if(e.isUndefined(n)&&(n=t),this._isCompound){var r=this._children[n];if(r)return e.keys(r)}else{if(n===t)return this.nodes();if(this.hasNode(n))return[]}},n.prototype.predecessors=function(t){var n=this._preds[t];if(n)return e.keys(n)},n.prototype.successors=function(t){var n=this._sucs[t];if(n)return e.keys(n)},n.prototype.neighbors=function(t){var n=this.predecessors(t);if(n)return e.union(n,this.successors(t))},n.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},n.prototype.filterNodes=function(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;e.each(this._nodes,function(e,r){t(r)&&n.setNode(r,e)}),e.each(this._edgeObjs,function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,r.edge(e))});var o={};function i(e){var t=r.parent(e);return void 0===t||n.hasNode(t)?(o[e]=t,t):t in o?o[t]:i(t)}return this._isCompound&&e.each(n.nodes(),function(e){n.setParent(e,i(e))}),n},n.prototype.setDefaultEdgeLabel=function(t){return e.isFunction(t)||(t=e.constant(t)),this._defaultEdgeLabelFn=t,this},n.prototype.edgeCount=function(){return this._edgeCount},n.prototype.edges=function(){return e.values(this._edgeObjs)},n.prototype.setPath=function(t,n){var r=this,o=arguments;return e.reduce(t,function(e,t){return o.length>1?r.setEdge(e,t,n):r.setEdge(e,t),t}),this},n.prototype.setEdge=function(){var t,n,o,a,s=!1,l=arguments[0];"object"==typeof l&&null!==l&&"v"in l?(t=l.v,n=l.w,o=l.name,2===arguments.length&&(a=arguments[1],s=!0)):(t=l,n=arguments[1],o=arguments[3],arguments.length>2&&(a=arguments[2],s=!0)),t=""+t,n=""+n,e.isUndefined(o)||(o=""+o);var c=i(this._isDirected,t,n,o);if(e.has(this._edgeLabels,c))return s&&(this._edgeLabels[c]=a),this;if(!e.isUndefined(o)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[c]=s?a:this._defaultEdgeLabelFn(t,n,o);var u=function(e,t,n,r){var o=""+t,i=""+n;if(!e&&o>i){var a=o;o=i,i=a}var s={v:o,w:i};r&&(s.name=r);return s}(this._isDirected,t,n,o);return t=u.v,n=u.w,Object.freeze(u),this._edgeObjs[c]=u,r(this._preds[n],t),r(this._sucs[t],n),this._in[n][c]=u,this._out[t][c]=u,this._edgeCount++,this},n.prototype.edge=function(e,t,n){var r=1===arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n);return this._edgeLabels[r]},n.prototype.hasEdge=function(t,n,r){var o=1===arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,t,n,r);return e.has(this._edgeLabels,o)},n.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?a(this._isDirected,arguments[0]):i(this._isDirected,e,t,n),s=this._edgeObjs[r];return s&&(e=s.v,t=s.w,delete this._edgeLabels[r],delete this._edgeObjs[r],o(this._preds[t],e),o(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},n.prototype.inEdges=function(t,n){var r=this._in[t];if(r){var o=e.values(r);return n?e.filter(o,function(e){return e.v===n}):o}},n.prototype.outEdges=function(t,n){var r=this._out[t];if(r){var o=e.values(r);return n?e.filter(o,function(e){return e.w===n}):o}},n.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))},a2}function m4(){if(h2)return f2;h2=1;var e=h4(),t=p4();function n(t){return e.map(t.nodes(),function(n){var r=t.node(n),o=t.parent(n),i={v:n};return e.isUndefined(r)||(i.value=r),e.isUndefined(o)||(i.parent=o),i})}function r(t){return e.map(t.edges(),function(n){var r=t.edge(n),o={v:n.v,w:n.w};return e.isUndefined(n.name)||(o.name=n.name),e.isUndefined(r)||(o.value=r),o})}return f2={write:function(t){var o={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:n(t),edges:r(t)};e.isUndefined(t.graph())||(o.value=e.clone(t.graph()));return o},read:function(n){var r=new t(n.options).setGraph(n.value);return e.each(n.nodes,function(e){r.setNode(e.v,e.value),e.parent&&r.setParent(e.v,e.parent)}),e.each(n.edges,function(e){r.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),r}}}function g4(){if(m2)return p2;m2=1;var e=h4();return p2=function(t){var n,r={},o=[];function i(o){e.has(r,o)||(r[o]=!0,n.push(o),e.each(t.successors(o),i),e.each(t.predecessors(o),i))}return e.each(t.nodes(),function(e){n=[],i(e),n.length&&o.push(n)}),o}}function v4(){if(v2)return g2;v2=1;var e=h4();function t(){this._arr=[],this._keyIndices={}}return g2=t,t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(e){return e.key})},t.prototype.has=function(t){return e.has(this._keyIndices,t)},t.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},t.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(t,n){var r=this._keyIndices;if(t=String(t),!e.has(r,t)){var o=this._arr,i=o.length;return r[t]=i,o.push({key:t,priority:n}),this._decrease(i),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},t.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},t.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))},t.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},t.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t},g2}function y4(){if(b2)return y2;b2=1;var e=h4(),t=v4();y2=function(e,r,o,i){return function(e,n,r,o){var i,a,s={},l=new t,c=function(e){var t=e.v!==i?e.v:e.w,n=s[t],o=r(e),c=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<n.distance&&(n.distance=c,n.predecessor=i,l.decrease(t,c))};e.nodes().forEach(function(e){var t=e===n?0:Number.POSITIVE_INFINITY;s[e]={distance:t},l.add(e,t)});for(;l.size()>0&&(i=l.removeMin(),(a=s[i]).distance!==Number.POSITIVE_INFINITY);)o(i).forEach(c);return s}(e,String(r),o||n,i||function(t){return e.outEdges(t)})};var n=e.constant(1);return y2}function b4(){if(w2)return x2;w2=1;var e=y4(),t=h4();return x2=function(n,r,o){return t.transform(n.nodes(),function(t,i){t[i]=e(n,i,r,o)},{})}}function x4(){if(_2)return k2;_2=1;var e=h4();return k2=function(t){var n=0,r=[],o={},i=[];function a(s){var l=o[s]={onStack:!0,lowlink:n,index:n++};if(r.push(s),t.successors(s).forEach(function(t){e.has(o,t)?o[t].onStack&&(l.lowlink=Math.min(l.lowlink,o[t].index)):(a(t),l.lowlink=Math.min(l.lowlink,o[t].lowlink))}),l.lowlink===l.index){var c,u=[];do{c=r.pop(),o[c].onStack=!1,u.push(c)}while(s!==c);i.push(u)}}return t.nodes().forEach(function(t){e.has(o,t)||a(t)}),i}}function w4(){if(C2)return S2;C2=1;var e=h4(),t=x4();return S2=function(n){return e.filter(t(n),function(e){return e.length>1||1===e.length&&n.hasEdge(e[0],e[0])})}}function k4(){if(N2)return E2;N2=1;var e=h4();E2=function(e,n,r){return function(e,t,n){var r={},o=e.nodes();return o.forEach(function(e){r[e]={},r[e][e]={distance:0},o.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var o=n.v===e?n.w:n.v,i=t(n);r[e][o]={distance:i,predecessor:e}})}),o.forEach(function(e){var t=r[e];o.forEach(function(n){var i=r[n];o.forEach(function(n){var r=i[e],o=t[n],a=i[n],s=r.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)})})}),r}(e,n||t,r||function(t){return e.outEdges(t)})};var t=e.constant(1);return E2}function _4(){if(O2)return I2;O2=1;var e=h4();function t(t){var r={},o={},i=[];if(e.each(t.sinks(),function a(s){if(e.has(o,s))throw new n;e.has(r,s)||(o[s]=!0,r[s]=!0,e.each(t.predecessors(s),a),delete o[s],i.push(s))}),e.size(r)!==t.nodeCount())throw new n;return i}function n(){}return I2=t,t.CycleException=n,n.prototype=new Error,I2}function S4(){if(j2)return M2;j2=1;var e=_4();return M2=function(t){try{e(t)}catch(rp){if(rp instanceof e.CycleException)return!1;throw rp}return!0},M2}function C4(){if(P2)return T2;P2=1;var e=h4();function t(n,r,o,i,a,s){e.has(i,r)||(i[r]=!0,o||s.push(r),e.each(a(r),function(e){t(n,e,o,i,a,s)}),o&&s.push(r))}return T2=function(n,r,o){e.isArray(r)||(r=[r]);var i=(n.isDirected()?n.successors:n.neighbors).bind(n),a=[],s={};return e.each(r,function(e){if(!n.hasNode(e))throw new Error("Graph does not have node: "+e);t(n,e,"post"===o,s,i,a)}),a}}function E4(){if(R2)return A2;R2=1;var e=C4();return A2=function(t,n){return e(t,n,"post")}}function N4(){if(D2)return L2;D2=1;var e=C4();return L2=function(t,n){return e(t,n,"pre")}}function I4(){if(F2)return z2;F2=1;var e=h4(),t=p4(),n=v4();return z2=function(r,o){var i,a=new t,s={},l=new n;function c(e){var t=e.v===i?e.w:e.v,n=l.priority(t);if(void 0!==n){var r=o(e);r<n&&(s[t]=i,l.decrease(t,r))}}if(0===r.nodeCount())return a;e.each(r.nodes(),function(e){l.add(e,Number.POSITIVE_INFINITY),a.setNode(e)}),l.decrease(r.nodes()[0],0);var u=!1;for(;l.size()>0;){if(i=l.removeMin(),e.has(s,i))a.setEdge(i,s[i]);else{if(u)throw new Error("Input graph is not connected: "+r);u=!0}r.nodeEdges(i).forEach(c)}return a}}try{H2=function(){if(V2)return $2;V2=1;var e=d2?u2:(d2=1,u2={Graph:p4(),version:c2?l2:(c2=1,l2="2.1.8")});return $2={Graph:e.Graph,json:m4(),alg:B2?U2:(B2=1,U2={components:g4(),dijkstra:y4(),dijkstraAll:b4(),findCycles:w4(),floydWarshall:k4(),isAcyclic:S4(),postorder:E4(),preorder:N4(),prim:I4(),tarjan:x4(),topsort:_4()}),version:e.version}}()}catch(rp){}H2||(H2=window.graphlib);var O4,M4,j4,T4,P4,A4,R4,L4,D4,z4,F4,U4,B4,$4,V4,H4,W4,q4,K4,Z4,Y4,X4,G4,J4,Q4,e5,t5,n5,r5,o5,i5,a5,s5,l5,c5,u5,d5,f5,h5,p5,m5,g5,v5,y5,b5,x5,w5,k5,_5,S5,C5,E5,N5,I5,O5,M5,j5,T5,P5,A5,R5,L5,D5,z5,F5,U5,B5,$5,V5,H5,W5,q5,K5,Z5,Y5,X5,G5,J5,Q5,e6,t6,n6,r6,o6,i6,a6,s6,l6,c6,u6,d6,f6,h6,p6=H2;function m6(){if(T4)return j4;T4=1;var e=cX(),t=jG(),n=ZX(),r=gX();return j4=function(o,i,a){if(!r(a))return!1;var s=typeof i;return!!("number"==s?t(a)&&n(i,a.length):"string"==s&&i in a)&&e(a[i],o)},j4}function g6(){if(U4)return F4;U4=1;var e=function(){if(z4)return D4;z4=1;var e=/\s/;return D4=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},D4}(),t=/^\s+/;return F4=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},F4}function v6(){if(H4)return V4;H4=1;var e=function(){if($4)return B4;$4=1;var e=g6(),t=gX(),n=T3(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return B4=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var c=o.test(s);return c||i.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s},B4}(),t=1/0;return V4=function(n){return n?(n=e(n))===t||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0},V4}function y6(){if(Z4)return K4;Z4=1;var e=a4(),t=W3(),n=function(){if(q4)return W4;q4=1;var e=v6();return W4=function(t){var n=e(t),r=n%1;return n==n?r?n-r:n:0},W4}(),r=Math.max;return K4=function(o,i,a){var s=null==o?0:o.length;if(!s)return-1;var l=null==a?0:n(a);return l<0&&(l=r(s+l,0)),e(o,t(i,3),l)}}function b6(){if(J4)return G4;J4=1;var e=n4();return G4=function(t){return(null==t?0:t.length)?e(t,1):[]}}function x6(){if(a5)return i5;a5=1;var e=T3();return i5=function(t,n,r){for(var o=-1,i=t.length;++o<i;){var a=t[o],s=n(a);if(null!=s&&(void 0===l?s==s&&!e(s):r(s,l)))var l=s,c=a}return c},i5}function w6(){if(f5)return d5;f5=1;var e=OX(),t=cX();return d5=function(n,r,o){(void 0!==o&&!t(n[r],o)||void 0===o&&!(r in n))&&e(n,r,o)},d5}function k6(){if(g5)return m5;return g5=1,m5=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}}function _6(){if(x5)return b5;x5=1;var e=w6(),t=q2(),n=a3(),r=K2(),o=c3(),i=PX(),a=AX(),s=u4(),l=KX(),c=vX(),u=gX(),d=function(){if(p5)return h5;p5=1;var e=mX(),t=J2(),n=TX(),r=Function.prototype,o=Object.prototype,i=r.toString,a=o.hasOwnProperty,s=i.call(Object);return h5=function(r){if(!n(r)||"[object Object]"!=e(r))return!1;var o=t(r);if(null===o)return!0;var l=a.call(o,"constructor")&&o.constructor;return"function"==typeof l&&l instanceof l&&i.call(l)==s},h5}(),f=EG(),h=k6(),p=function(){if(y5)return v5;y5=1;var e=jX(),t=AG();return v5=function(n){return e(n,t(n))},v5}();return b5=function(m,g,v,y,b,x,w){var k=h(m,v),_=h(g,v),S=w.get(_);if(S)e(m,v,S);else{var C=x?x(k,_,v+"",m,g,w):void 0,E=void 0===C;if(E){var N=a(_),I=!N&&l(_),O=!N&&!I&&f(_);C=_,N||I||O?a(k)?C=k:s(k)?C=r(k):I?(E=!1,C=t(_,!0)):O?(E=!1,C=n(_,!0)):C=[]:d(_)||i(_)?(C=k,i(k)?C=p(k):u(k)&&!c(k)||(C=o(_))):E=!1}E&&(w.set(_,C),b(C,_,y,x,w),w.delete(_)),e(m,v,C)}}}function S6(){if(I5)return N5;return I5=1,N5=function(e,t){return e<t},N5}function C6(){if(z5)return D5;z5=1;var e=F3(),t=function(){if(L5)return R5;L5=1;var e=MX(),t=D3(),n=ZX(),r=gX(),o=z3();return R5=function(i,a,s,l){if(!r(i))return i;for(var c=-1,u=(a=t(a,i)).length,d=u-1,f=i;null!=f&&++c<u;){var h=o(a[c]),p=s;if("__proto__"===h||"constructor"===h||"prototype"===h)return i;if(c!=d){var m=f[h];void 0===(p=l?l(m,h,f):void 0)&&(p=r(m)?m:n(a[c+1])?[]:{})}e(f,h,p),f=f[h]}return i},R5}(),n=D3();return D5=function(r,o,i){for(var a=-1,s=o.length,l={};++a<s;){var c=o[a],u=e(r,c);i(u,c)&&t(l,n(c,r),u)}return l},D5}function E6(){if(Z5)return K5;Z5=1;var e=function(){if(q5)return W5;q5=1;var e=Math.ceil,t=Math.max;return W5=function(n,r,o,i){for(var a=-1,s=t(e((r-n)/(o||1)),0),l=Array(s);s--;)l[i?s:++a]=n,n+=o;return l}}(),t=m6(),n=v6();return K5=function(r){return function(o,i,a){return a&&"number"!=typeof a&&t(o,i,a)&&(i=a=void 0),o=n(o),void 0===i?(i=o,o=0):i=n(i),a=void 0===a?o<i?1:-1:n(a),e(o,i,a,r)}}}function N6(){if(n6)return t6;n6=1;var e=function(){if(e6)return Q5;e6=1;var e=T3();return Q5=function(t,n){if(t!==n){var r=void 0!==t,o=null===t,i=t==t,a=e(t),s=void 0!==n,l=null===n,c=n==n,u=e(n);if(!l&&!u&&!a&&t>n||a&&s&&c&&!l&&!u||o&&s&&c||!r&&c||!i)return 1;if(!o&&!a&&!u&&t<n||u&&r&&i&&!o&&!a||l&&r&&i||!s&&i||!c)return-1}return 0},Q5}();return t6=function(t,n,r){for(var o=-1,i=t.criteria,a=n.criteria,s=i.length,l=r.length;++o<s;){var c=e(i[o],a[o]);if(c)return o>=l?c:c*("desc"==r[o]?-1:1)}return t.index-n.index}}function I6(){if(o6)return r6;o6=1;var e=R3(),t=F3(),n=W3(),r=X3(),o=J5?G5:(J5=1,G5=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}),i=XX(),a=N6(),s=y3(),l=AX();return r6=function(c,u,d){u=u.length?e(u,function(e){return l(e)?function(n){return t(n,1===e.length?e[0]:e)}:e}):[s];var f=-1;u=e(u,i(n));var h=r(c,function(t,n,r){return{criteria:e(u,function(e){return e(t)}),index:++f,value:t}});return o(h,function(e,t){return a(e,t,d)})},r6}try{h6={cloneDeep:function(){if(M4)return O4;M4=1;var e=f3();return O4=function(t){return e(t,5)},O4}(),constant:p3(),defaults:function(){if(A4)return P4;A4=1;var e=i4(),t=cX(),n=m6(),r=AG(),o=Object.prototype,i=o.hasOwnProperty,a=e(function(e,a){e=Object(e);var s=-1,l=a.length,c=l>2?a[2]:void 0;for(c&&n(a[0],a[1],c)&&(l=1);++s<l;)for(var u=a[s],d=r(u),f=-1,h=d.length;++f<h;){var p=d[f],m=e[p];(void 0===m||t(m,o[p])&&!i.call(e,p))&&(e[p]=u[p])}return e});return P4=a}(),each:w3(),filter:q3(),find:function(){if(X4)return Y4;X4=1;var e=function(){if(L4)return R4;L4=1;var e=W3(),t=jG(),n=TG();return R4=function(r){return function(o,i,a){var s=Object(o);if(!t(o)){var l=e(i,3);o=n(o),i=function(e){return l(s[e],e,s)}}var c=r(o,i,a);return c>-1?s[l?o[c]:c]:void 0}}}()(y6());return Y4=e}(),flatten:b6(),forEach:x3(),forIn:function(){if(e5)return Q4;e5=1;var e=m3(),t=b3(),n=AG();return Q4=function(r,o){return null==r?r:e(r,t(o),n)}}(),has:K3(),isUndefined:Y3(),last:n5?t5:(n5=1,t5=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}),map:G3(),mapValues:function(){if(o5)return r5;o5=1;var e=OX(),t=g3(),n=W3();return r5=function(r,o){var i={};return o=n(o,3),t(r,function(t,n,r){e(i,n,o(t,n,r))}),i},r5}(),max:function(){if(u5)return c5;u5=1;var e=x6(),t=(l5||(l5=1,s5=function(e,t){return e>t}),s5),n=y3();return c5=function(r){return r&&r.length?e(r,n,t):void 0}}(),merge:function(){if(E5)return C5;E5=1;var e=function(){if(k5)return w5;k5=1;var e=EX(),t=w6(),n=m3(),r=_6(),o=gX(),i=AG(),a=k6();return w5=function s(l,c,u,d,f){l!==c&&n(c,function(n,i){if(f||(f=new e),o(n))r(l,c,i,u,s,d,f);else{var h=d?d(a(l,i),n,i+"",l,c,f):void 0;void 0===h&&(h=n),t(l,i,h)}},i)},w5}(),t=function(){if(S5)return _5;S5=1;var e=i4(),t=m6();return _5=function(n){return e(function(e,r){var o=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=n.length>3&&"function"==typeof a?(i--,a):void 0,s&&t(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++o<i;){var l=r[o];l&&n(e,l,o,a)}return e})}}()(function(t,n,r){e(t,n,r)});return C5=t}(),min:function(){if(M5)return O5;M5=1;var e=x6(),t=S6(),n=y3();return O5=function(r){return r&&r.length?e(r,n,t):void 0}}(),minBy:function(){if(T5)return j5;T5=1;var e=x6(),t=W3(),n=S6();return j5=function(r,o){return r&&r.length?e(r,t(o,2),n):void 0}}(),now:function(){if(A5)return P5;A5=1;var e=hX();return P5=function(){return e.Date.now()}}(),pick:function(){if(H5)return V5;H5=1;var e=function(){if(U5)return F5;U5=1;var e=C6(),t=B3();return F5=function(n,r){return e(n,r,function(e,r){return t(n,r)})}}(),t=function(){if($5)return B5;$5=1;var e=b6(),t=r4(),n=o4();return B5=function(r){return n(t(r,void 0,e),r+"")}}()(function(t,n){return null==t?{}:e(t,n)});return V5=t}(),range:function(){if(X5)return Y5;X5=1;var e=E6()();return Y5=e}(),reduce:J3(),sortBy:function(){if(a6)return i6;a6=1;var e=n4(),t=I6(),n=i4(),r=m6(),o=n(function(n,o){if(null==n)return[];var i=o.length;return i>1&&r(n,o[0],o[1])?o=[]:i>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(n,e(o,1),[])});return i6=o}(),uniqueId:function(){if(l6)return s6;l6=1;var e=L3(),t=0;return s6=function(n){var r=++t;return e(n)+r}}(),values:f4(),zipObject:function(){if(f6)return d6;f6=1;var e=MX(),t=(u6||(u6=1,c6=function(e,t,n){for(var r=-1,o=e.length,i=t.length,a={};++r<o;){var s=r<i?t[r]:void 0;n(a,e[r],s)}return a}),c6);return d6=function(n,r){return t(n||[],r||[],e)}}()}}catch(rp){}h6||(h6=window._);var O6=h6,M6=j6;function j6(){var e={};e._next=e._prev=e,this._sentinel=e}function T6(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function P6(e,t){if("_next"!==e&&"_prev"!==e)return t}j6.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return T6(t),t},j6.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&T6(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},j6.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,P6)),n=n._prev;return"["+e.join(", ")+"]"};var A6=O6,R6=p6.Graph,L6=M6,D6=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new R6,r=0,o=0;A6.forEach(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),A6.forEach(e.edges(),function(e){var i=n.edge(e.v,e.w)||0,a=t(e),s=i+a;n.setEdge(e.v,e.w,s),o=Math.max(o,n.node(e.v).out+=a),r=Math.max(r,n.node(e.w).in+=a)});var i=A6.range(o+r+3).map(function(){return new L6}),a=r+1;return A6.forEach(n.nodes(),function(e){U6(i,a,n.node(e))}),{graph:n,buckets:i,zeroIdx:a}}(e,t||z6),r=function(e,t,n){var r,o=[],i=t[t.length-1],a=t[0];for(;e.nodeCount();){for(;r=a.dequeue();)F6(e,t,n,r);for(;r=i.dequeue();)F6(e,t,n,r);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(r=t[s].dequeue()){o=o.concat(F6(e,t,n,r,!0));break}}return o}(n.graph,n.buckets,n.zeroIdx);return A6.flatten(A6.map(r,function(t){return e.outEdges(t.v,t.w)}),!0)},z6=A6.constant(1);function F6(e,t,n,r,o){var i=o?[]:void 0;return A6.forEach(e.inEdges(r.v),function(r){var a=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=a,U6(t,n,s)}),A6.forEach(e.outEdges(r.v),function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,U6(t,n,a)}),e.removeNode(r.v),i}function U6(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}var B6=O6,$6=D6,V6={run:function(e){var t="greedy"===e.graph().acyclicer?$6(e,(n=e,function(e){return n.edge(e).weight})):function(e){var t=[],n={},r={};function o(i){B6.has(r,i)||(r[i]=!0,n[i]=!0,B6.forEach(e.outEdges(i),function(e){B6.has(n,e.w)?t.push(e):o(e.w)}),delete n[i])}return B6.forEach(e.nodes(),o),t}(e);var n;B6.forEach(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,B6.uniqueId("rev"))})},undo:function(e){B6.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}};var H6=O6,W6=p6.Graph,q6={addDummyNode:K6,simplify:function(e){var t=(new W6).setGraph(e.graph());return H6.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),H6.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t},asNonCompoundGraph:function(e){var t=new W6({multigraph:e.isMultigraph()}).setGraph(e.graph());return H6.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),H6.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=H6.map(e.nodes(),function(t){var n={};return H6.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return H6.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=H6.map(e.nodes(),function(t){var n={};return H6.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return H6.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,o=e.x,i=e.y,a=t.x-o,s=t.y-i,l=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(l=-l),n=l,r=l*s/a);return{x:o+n,y:i+r}},buildLayerMatrix:function(e){var t=H6.map(H6.range(Z6(e)+1),function(){return[]});return H6.forEach(e.nodes(),function(n){var r=e.node(n),o=r.rank;H6.isUndefined(o)||(t[o][r.order]=n)}),t},normalizeRanks:function(e){var t=H6.min(H6.map(e.nodes(),function(t){return e.node(t).rank}));H6.forEach(e.nodes(),function(n){var r=e.node(n);H6.has(r,"rank")&&(r.rank-=t)})},removeEmptyRanks:function(e){var t=H6.min(H6.map(e.nodes(),function(t){return e.node(t).rank})),n=[];H6.forEach(e.nodes(),function(r){var o=e.node(r).rank-t;n[o]||(n[o]=[]),n[o].push(r)});var r=0,o=e.graph().nodeRankFactor;H6.forEach(n,function(t,n){H6.isUndefined(t)&&n%o!==0?--r:r&&H6.forEach(t,function(t){e.node(t).rank+=r})})},addBorderNode:function(e,t,n,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=n,o.order=r);return K6(e,"border",o,t)},maxRank:Z6,partition:function(e,t){var n={lhs:[],rhs:[]};return H6.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){H6.now();try{return t()}finally{}},notime:function(e,t){return t()}};function K6(e,t,n,r){var o;do{o=H6.uniqueId(r)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function Z6(e){return H6.max(H6.map(e.nodes(),function(t){var n=e.node(t).rank;if(!H6.isUndefined(n))return n}))}var Y6=O6,X6=q6,G6={run:function(e){e.graph().dummyChains=[],Y6.forEach(e.edges(),function(t){!function(e,t){var n,r,o,i=t.v,a=e.node(i).rank,s=t.w,l=e.node(s).rank,c=t.name,u=e.edge(t),d=u.labelRank;if(l===a+1)return;for(e.removeEdge(t),o=0,++a;a<l;++o,++a)u.points=[],r={width:0,height:0,edgeLabel:u,edgeObj:t,rank:a},n=X6.addDummyNode(e,"edge",r,"_d"),a===d&&(r.width=u.width,r.height=u.height,r.dummy="edge-label",r.labelpos=u.labelpos),e.setEdge(i,n,{weight:u.weight},c),0===o&&e.graph().dummyChains.push(n),i=n;e.setEdge(i,s,{weight:u.weight},c)}(e,t)})},undo:function(e){Y6.forEach(e.graph().dummyChains,function(t){var n,r=e.node(t),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),t=n,r=e.node(t)})}};var J6=O6,Q6={longestPath:function(e){var t={};J6.forEach(e.sources(),function n(r){var o=e.node(r);if(J6.has(t,r))return o.rank;t[r]=!0;var i=J6.min(J6.map(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}};var e9=O6,t9=p6.Graph,n9=Q6.slack,r9=function(e){var t,n,r=new t9({directed:!1}),o=e.nodes()[0],i=e.nodeCount();r.setNode(o,{});for(;o9(r,e)<i;)t=i9(r,e),n=r.hasNode(t.v)?n9(e,t):-n9(e,t),a9(r,e,n);return r};function o9(e,t){return e9.forEach(e.nodes(),function n(r){e9.forEach(t.nodeEdges(r),function(o){var i=o.v,a=r===i?o.w:i;e.hasNode(a)||n9(t,o)||(e.setNode(a,{}),e.setEdge(r,a,{}),n(a))})}),e.nodeCount()}function i9(e,t){return e9.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return n9(t,n)})}function a9(e,t,n){e9.forEach(e.nodes(),function(e){t.node(e).rank+=n})}var s9=O6,l9=r9,c9=Q6.slack,u9=Q6.longestPath,d9=p6.alg.preorder,f9=p6.alg.postorder,h9=q6.simplify,p9=m9;function m9(e){e=h9(e),u9(e);var t,n=l9(e);for(y9(n),g9(n,e);t=x9(n);)k9(n,e,t,w9(n,e,t))}function g9(e,t){var n=f9(e,e.nodes());n=n.slice(0,n.length-1),s9.forEach(n,function(n){!function(e,t,n){var r=e.node(n),o=r.parent;e.edge(n,o).cutvalue=v9(e,t,n)}(e,t,n)})}function v9(e,t,n){var r=e.node(n).parent,o=!0,i=t.edge(n,r),a=0;return i||(o=!1,i=t.edge(r,n)),a=i.weight,s9.forEach(t.nodeEdges(n),function(i){var s,l,c=i.v===n,u=c?i.w:i.v;if(u!==r){var d=c===o,f=t.edge(i).weight;if(a+=d?f:-f,s=n,l=u,e.hasEdge(s,l)){var h=e.edge(n,u).cutvalue;a+=d?-h:h}}}),a}function y9(e,t){arguments.length<2&&(t=e.nodes()[0]),b9(e,{},1,t)}function b9(e,t,n,r,o){var i=n,a=e.node(r);return t[r]=!0,s9.forEach(e.neighbors(r),function(o){s9.has(t,o)||(n=b9(e,t,n,o,r))}),a.low=i,a.lim=n++,o?a.parent=o:delete a.parent,n}function x9(e){return s9.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function w9(e,t,n){var r=n.v,o=n.w;t.hasEdge(r,o)||(r=n.w,o=n.v);var i=e.node(r),a=e.node(o),s=i,l=!1;i.lim>a.lim&&(s=a,l=!0);var c=s9.filter(t.edges(),function(t){return l===_9(e,e.node(t.v),s)&&l!==_9(e,e.node(t.w),s)});return s9.minBy(c,function(e){return c9(t,e)})}function k9(e,t,n,r){var o=n.v,i=n.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),y9(e),g9(e,t),function(e,t){var n=s9.find(e.nodes(),function(e){return!t.node(e).parent}),r=d9(e,n);r=r.slice(1),s9.forEach(r,function(n){var r=e.node(n).parent,o=t.edge(n,r),i=!1;o||(o=t.edge(r,n),i=!0),t.node(n).rank=t.node(r).rank+(i?o.minlen:-o.minlen)})}(e,t)}function _9(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}m9.initLowLimValues=y9,m9.initCutValues=g9,m9.calcCutValue=v9,m9.leaveEdge=x9,m9.enterEdge=w9,m9.exchangeEdges=k9;var S9=Q6.longestPath,C9=r9,E9=p9,N9=function(e){switch(e.graph().ranker){case"network-simplex":default:O9(e);break;case"tight-tree":!function(e){S9(e),C9(e)}(e);break;case"longest-path":I9(e)}};var I9=S9;function O9(e){E9(e)}var M9=O6,j9=function(e){var t=function(e){var t={},n=0;function r(o){var i=n;M9.forEach(e.children(o),r),t[o]={low:i,lim:n++}}return M9.forEach(e.children(),r),t}(e);M9.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),o=r.edgeObj,i=function(e,t,n,r){var o,i,a=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);o=n;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>l||c>t[o].lim));i=o,o=r;for(;(o=e.parent(o))!==i;)s.push(o);return{path:a.concat(s.reverse()),lca:i}}(e,t,o.v,o.w),a=i.path,s=i.lca,l=0,c=a[l],u=!0;n!==o.w;){if(r=e.node(n),u){for(;(c=a[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<a.length-1&&e.node(c=a[l+1]).minRank<=r.rank;)l++;c=a[l]}e.setParent(n,c),n=e.successors(n)[0]}})};var T9=O6,P9=q6,A9={run:function(e){var t=P9.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(r,o){var i=e.children(r);i&&i.length&&T9.forEach(i,function(e){n(e,o+1)}),t[r]=o}return T9.forEach(e.children(),function(e){n(e,1)}),t}(e),r=T9.max(T9.values(n))-1,o=2*r+1;e.graph().nestingRoot=t,T9.forEach(e.edges(),function(t){e.edge(t).minlen*=o});var i=function(e){return T9.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;T9.forEach(e.children(),function(a){R9(e,t,o,i,r,n,a)}),e.graph().nodeRankFactor=o},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,T9.forEach(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}};function R9(e,t,n,r,o,i,a){var s=e.children(a);if(s.length){var l=P9.addBorderNode(e,"_bt"),c=P9.addBorderNode(e,"_bb"),u=e.node(a);e.setParent(l,a),u.borderTop=l,e.setParent(c,a),u.borderBottom=c,T9.forEach(s,function(s){R9(e,t,n,r,o,i,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,h=u.borderTop?r:2*r,p=d!==f?1:o-i[a]+1;e.setEdge(l,d,{weight:h,minlen:p,nestingEdge:!0}),e.setEdge(f,c,{weight:h,minlen:p,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,l,{weight:0,minlen:o+i[a]})}else a!==t&&e.setEdge(t,a,{weight:0,minlen:n})}var L9=O6,D9=q6,z9=function(e){L9.forEach(e.children(),function t(n){var r=e.children(n),o=e.node(n);if(r.length&&L9.forEach(r,t),L9.has(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var i=o.minRank,a=o.maxRank+1;i<a;++i)F9(e,"borderLeft","_bl",n,o,i),F9(e,"borderRight","_br",n,o,i)}})};function F9(e,t,n,r,o,i){var a={width:0,height:0,rank:i,borderType:t},s=o[t][i-1],l=D9.addDummyNode(e,"border",a,n);o[t][i]=l,e.setParent(l,r),s&&e.setEdge(s,l,{weight:1})}var U9=O6,B9={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||$9(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){U9.forEach(e.nodes(),function(t){H9(e.node(t))}),U9.forEach(e.edges(),function(t){var n=e.edge(t);U9.forEach(n.points,H9),U9.has(n,"y")&&H9(n)})}(e);"lr"!==t&&"rl"!==t||(!function(e){U9.forEach(e.nodes(),function(t){W9(e.node(t))}),U9.forEach(e.edges(),function(t){var n=e.edge(t);U9.forEach(n.points,W9),U9.has(n,"x")&&W9(n)})}(e),$9(e))}};function $9(e){U9.forEach(e.nodes(),function(t){V9(e.node(t))}),U9.forEach(e.edges(),function(t){V9(e.edge(t))})}function V9(e){var t=e.width;e.width=e.height,e.height=t}function H9(e){e.y=-e.y}function W9(e){var t=e.x;e.x=e.y,e.y=t}var q9=O6,K9=function(e){var t={},n=q9.filter(e.nodes(),function(t){return!e.children(t).length}),r=q9.max(q9.map(n,function(t){return e.node(t).rank})),o=q9.map(q9.range(r+1),function(){return[]});var i=q9.sortBy(n,function(t){return e.node(t).rank});return q9.forEach(i,function n(r){if(q9.has(t,r))return;t[r]=!0;var i=e.node(r);o[i.rank].push(r),q9.forEach(e.successors(r),n)}),o};var Z9=O6,Y9=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=X9(e,t[r-1],t[r]);return n};function X9(e,t,n){for(var r=Z9.zipObject(n,Z9.map(n,function(e,t){return t})),o=Z9.flatten(Z9.map(t,function(t){return Z9.sortBy(Z9.map(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<n.length;)i<<=1;var a=2*i-1;i-=1;var s=Z9.map(new Array(a),function(){return 0}),l=0;return Z9.forEach(o.forEach(function(e){var t=e.pos+i;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),s[t=t-1>>1]+=e.weight;l+=e.weight*n})),l}var G9=O6,J9=function(e,t){return G9.map(t,function(t){var n=e.inEdges(t);if(n.length){var r=G9.reduce(n,function(t,n){var r=e.edge(n),o=e.node(n.v);return{sum:t.sum+r.weight*o.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})};var Q9=O6,e8=function(e,t){var n={};return Q9.forEach(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};Q9.isUndefined(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),Q9.forEach(t.edges(),function(e){var t=n[e.v],r=n[e.w];Q9.isUndefined(t)||Q9.isUndefined(r)||(r.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){t.merged||(Q9.isUndefined(t.barycenter)||Q9.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function r(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),Q9.forEach(o.in.reverse(),n(o)),Q9.forEach(o.out,r(o))}return Q9.map(Q9.filter(t,function(e){return!e.merged}),function(e){return Q9.pick(e,["vs","i","barycenter","weight"])})}(Q9.filter(n,function(e){return!e.indegree}))};var t8=O6,n8=q6;function r8(e,t,n){for(var r;t.length&&(r=t8.last(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}var o8=O6,i8=J9,a8=e8,s8=function(e,t){var n=n8.partition(e,function(e){return t8.has(e,"barycenter")}),r=n.lhs,o=t8.sortBy(n.rhs,function(e){return-e.i}),i=[],a=0,s=0,l=0;r.sort((c=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:c?t.i-e.i:e.i-t.i})),l=r8(i,o,l),t8.forEach(r,function(e){l+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,s+=e.weight,l=r8(i,o,l)});var c;var u={vs:t8.flatten(i,!0)};s&&(u.barycenter=a/s,u.weight=s);return u},l8=function e(t,n,r,o){var i=t.children(n),a=t.node(n),s=a?a.borderLeft:void 0,l=a?a.borderRight:void 0,c={};s&&(i=o8.filter(i,function(e){return e!==s&&e!==l}));var u=i8(t,i);o8.forEach(u,function(n){if(t.children(n.v).length){var i=e(t,n.v,r,o);c[n.v]=i,o8.has(i,"barycenter")&&(a=n,s=i,o8.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var d=a8(u,r);!function(e,t){o8.forEach(e,function(e){e.vs=o8.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(d,c);var f=s8(d,o);if(s&&(f.vs=o8.flatten([s,f.vs,l],!0),t.predecessors(s).length)){var h=t.node(t.predecessors(s)[0]),p=t.node(t.predecessors(l)[0]);o8.has(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+h.order+p.order)/(f.weight+2),f.weight+=2}return f};var c8=O6,u8=p6.Graph,d8=function(e,t,n){var r=function(e){var t;for(;e.hasNode(t=c8.uniqueId("_root")););return t}(e),o=new u8({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return c8.forEach(e.nodes(),function(i){var a=e.node(i),s=e.parent(i);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(i),o.setParent(i,s||r),c8.forEach(e[n](i),function(t){var n=t.v===i?t.w:t.v,r=o.edge(n,i),a=c8.isUndefined(r)?0:r.weight;o.setEdge(n,i,{weight:e.edge(t).weight+a})}),c8.has(a,"minRank")&&o.setNode(i,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))}),o};var f8=O6;var h8=O6,p8=K9,m8=Y9,g8=l8,v8=d8,y8=function(e,t,n){var r,o={};f8.forEach(n,function(n){for(var i,a,s=e.parent(n);s;){if((i=e.parent(s))?(a=o[i],o[i]=s):(a=r,r=s),a&&a!==s)return void t.setEdge(a,s);s=i}})},b8=p6.Graph,x8=q6,w8=function(e){var t=x8.maxRank(e),n=k8(e,h8.range(1,t+1),"inEdges"),r=k8(e,h8.range(t-1,-1,-1),"outEdges"),o=p8(e);S8(e,o);for(var i,a=Number.POSITIVE_INFINITY,s=0,l=0;l<4;++s,++l){_8(s%2?n:r,s%4>=2),o=x8.buildLayerMatrix(e);var c=m8(e,o);c<a&&(l=0,i=h8.cloneDeep(o),a=c)}S8(e,i)};function k8(e,t,n){return h8.map(t,function(t){return v8(e,t,n)})}function _8(e,t){var n=new b8;h8.forEach(e,function(e){var r=e.graph().root,o=g8(e,r,n,t);h8.forEach(o.vs,function(t,n){e.node(t).order=n}),y8(e,n,o.vs)})}function S8(e,t){h8.forEach(t,function(t){h8.forEach(t,function(t,n){e.node(t).order=n})})}var C8=O6,E8=p6.Graph,N8=q6,I8=function(e){var t,n=N8.buildLayerMatrix(e),r=C8.merge(function(e,t){var n={};function r(t,r){var o=0,i=0,a=t.length,s=C8.last(r);return C8.forEach(r,function(t,l){var c=function(e,t){if(e.node(t).dummy)return C8.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),u=c?e.node(c).order:a;(c||t===s)&&(C8.forEach(r.slice(i,l+1),function(t){C8.forEach(e.predecessors(t),function(r){var i=e.node(r),a=i.order;!(a<o||u<a)||i.dummy&&e.node(t).dummy||O8(n,r,t)})}),i=l+1,o=u)}),r}return C8.reduce(t,r),n}(e,n),function(e,t){var n={};function r(t,r,o,i,a){var s;C8.forEach(C8.range(r,o),function(r){s=t[r],e.node(s).dummy&&C8.forEach(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<i||r.order>a)&&O8(n,t,s)})})}function o(t,n){var o,i=-1,a=0;return C8.forEach(n,function(s,l){if("border"===e.node(s).dummy){var c=e.predecessors(s);c.length&&(o=e.node(c[0]).order,r(n,a,l,i,o),a=l,i=o)}r(n,a,n.length,o,t.length)}),n}return C8.reduce(t,o),n}(e,n)),o={};C8.forEach(["u","d"],function(i){t="u"===i?n:C8.values(n).reverse(),C8.forEach(["l","r"],function(n){"r"===n&&(t=C8.map(t,function(e){return C8.values(e).reverse()}));var a=("u"===i?e.predecessors:e.successors).bind(e),s=function(e,t,n,r){var o={},i={},a={};return C8.forEach(t,function(e){C8.forEach(e,function(e,t){o[e]=e,i[e]=e,a[e]=t})}),C8.forEach(t,function(e){var t=-1;C8.forEach(e,function(e){var s=r(e);if(s.length)for(var l=((s=C8.sortBy(s,function(e){return a[e]})).length-1)/2,c=Math.floor(l),u=Math.ceil(l);c<=u;++c){var d=s[c];i[e]===e&&t<a[d]&&!M8(n,e,d)&&(i[d]=e,i[e]=o[e]=o[d],t=a[d])}})}),{root:o,align:i}}(0,t,r,a),l=function(e,t,n,r,o){var i={},a=function(e,t,n,r){var o=new E8,i=e.graph(),a=function(e,t,n){return function(r,o,i){var a,s=r.node(o),l=r.node(i),c=0;if(c+=s.width/2,C8.has(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2}if(a&&(c+=n?a:-a),a=0,c+=(s.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,C8.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":a=l.width/2;break;case"r":a=-l.width/2}return a&&(c+=n?a:-a),a=0,c}}(i.nodesep,i.edgesep,r);return C8.forEach(t,function(t){var r;C8.forEach(t,function(t){var i=n[t];if(o.setNode(i),r){var s=n[r],l=o.edge(s,i);o.setEdge(s,i,Math.max(a(e,t,r),l||0))}r=t})}),o}(e,t,n,o),s=o?"borderLeft":"borderRight";function l(e,t){for(var n=a.nodes(),r=n.pop(),o={};r;)o[r]?e(r):(o[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function c(e){i[e]=a.inEdges(e).reduce(function(e,t){return Math.max(e,i[t.v]+a.edge(t))},0)}function u(t){var n=a.outEdges(t).reduce(function(e,t){return Math.min(e,i[t.w]-a.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==s&&(i[t]=Math.max(i[t],n))}return l(c,a.predecessors.bind(a)),l(u,a.successors.bind(a)),C8.forEach(r,function(e){i[e]=i[n[e]]}),i}(e,t,s.root,s.align,"r"===n);"r"===n&&(l=C8.mapValues(l,function(e){return-e})),o[i+n]=l})});var i=function(e,t){return C8.minBy(C8.values(t),function(t){var n=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return C8.forIn(t,function(t,o){var i=function(e,t){return e.node(t).width}(e,o)/2;n=Math.max(t+i,n),r=Math.min(t-i,r)}),n-r})}(e,o);return function(e,t){var n=C8.values(t),r=C8.min(n),o=C8.max(n);C8.forEach(["u","d"],function(n){C8.forEach(["l","r"],function(i){var a,s=n+i,l=e[s];if(l!==t){var c=C8.values(l);(a="l"===i?r-C8.min(c):o-C8.max(c))&&(e[s]=C8.mapValues(l,function(e){return e+a}))}})})}(o,i),function(e,t){return C8.mapValues(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var o=C8.sortBy(C8.map(e,r));return(o[1]+o[2])/2})}(o,e.graph().align)};function O8(e,t,n){if(t>n){var r=t;t=n,n=r}var o=e[t];o||(e[t]=o={}),o[n]=!0}function M8(e,t,n){if(t>n){var r=t;t=n,n=r}return C8.has(e[t],n)}var j8=O6,T8=q6,P8=I8;var A8=O6,R8=V6,L8=G6,D8=N9,z8=q6.normalizeRanks,F8=j9,U8=q6.removeEmptyRanks,B8=A9,$8=z9,V8=B9,H8=w8,W8=function(e){(function(e){var t=T8.buildLayerMatrix(e),n=e.graph().ranksep,r=0;j8.forEach(t,function(t){var o=j8.max(j8.map(t,function(t){return e.node(t).height}));j8.forEach(t,function(t){e.node(t).y=r+o/2}),r+=o+n})})(e=T8.asNonCompoundGraph(e)),j8.forEach(P8(e),function(t,n){e.node(n).x=t})},q8=q6,K8=p6.Graph,Z8=function(e,t){var n=t&&t.debugTiming?q8.time:q8.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){return function(e){var t=new K8({multigraph:!0,compound:!0}),n=o7(e.graph());return t.setGraph(A8.merge({},X8,r7(n,Y8),A8.pick(n,G8))),A8.forEach(e.nodes(),function(n){var r=o7(e.node(n));t.setNode(n,A8.defaults(r7(r,J8),Q8)),t.setParent(n,e.parent(n))}),A8.forEach(e.edges(),function(n){var r=o7(e.edge(n));t.setEdge(n,A8.merge({},t7,r7(r,e7),A8.pick(r,n7)))}),t}(e)});n(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,A8.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){A8.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){R8.run(e)}),t(" nestingGraph.run",function(){B8.run(e)}),t(" rank",function(){D8(q8.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){A8.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};q8.addDummyNode(e,"edge-proxy",o,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){U8(e)}),t(" nestingGraph.cleanup",function(){B8.cleanup(e)}),t(" normalizeRanks",function(){z8(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;A8.forEach(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=A8.max(t,r.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){A8.forEach(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){L8.run(e)}),t(" parentDummyChains",function(){F8(e)}),t(" addBorderSegments",function(){$8(e)}),t(" order",function(){H8(e)}),t(" insertSelfEdges",function(){!function(e){var t=q8.buildLayerMatrix(e);A8.forEach(t,function(t){var n=0;A8.forEach(t,function(t,r){var o=e.node(t);o.order=r+n,A8.forEach(o.selfEdges,function(t){q8.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:r+ ++n,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){V8.adjust(e)}),t(" position",function(){W8(e)}),t(" positionSelfEdges",function(){!function(e){A8.forEach(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),o=r.x+r.width/2,i=r.y,a=n.x-o,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*a/3,y:i-s},{x:o+5*a/6,y:i-s},{x:o+a,y:i},{x:o+5*a/6,y:i+s},{x:o+2*a/3,y:i+s}],n.label.x=n.x,n.label.y=n.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){A8.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),o=e.node(n.borderBottom),i=e.node(A8.last(n.borderLeft)),a=e.node(A8.last(n.borderRight));n.width=Math.abs(a.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),A8.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){L8.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){A8.forEach(e.edges(),function(t){var n=e.edge(t);if(A8.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){V8.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,i=e.graph(),a=i.marginx||0,s=i.marginy||0;function l(e){var i=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),r=Math.min(r,a-l/2),o=Math.max(o,a+l/2)}A8.forEach(e.nodes(),function(t){l(e.node(t))}),A8.forEach(e.edges(),function(t){var n=e.edge(t);A8.has(n,"x")&&l(n)}),t-=a,r-=s,A8.forEach(e.nodes(),function(n){var o=e.node(n);o.x-=t,o.y-=r}),A8.forEach(e.edges(),function(n){var o=e.edge(n);A8.forEach(o.points,function(e){e.x-=t,e.y-=r}),A8.has(o,"x")&&(o.x-=t),A8.has(o,"y")&&(o.y-=r)}),i.width=n-t+a,i.height=o-r+s}(e)}),t(" assignNodeIntersects",function(){!function(e){A8.forEach(e.edges(),function(t){var n,r,o=e.edge(t),i=e.node(t.v),a=e.node(t.w);o.points?(n=o.points[0],r=o.points[o.points.length-1]):(o.points=[],n=a,r=i),o.points.unshift(q8.intersectRect(i,n)),o.points.push(q8.intersectRect(a,r))})}(e)}),t(" reversePoints",function(){!function(e){A8.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)}),t(" acyclic.undo",function(){R8.undo(e)})}(t,n)}),n(" updateInputGraph",function(){!function(e,t){A8.forEach(e.nodes(),function(n){var r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,t.children(n).length&&(r.width=o.width,r.height=o.height))}),A8.forEach(e.edges(),function(n){var r=e.edge(n),o=t.edge(n);r.points=o.points,A8.has(o,"x")&&(r.x=o.x,r.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var Y8=["nodesep","edgesep","ranksep","marginx","marginy"],X8={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},G8=["acyclicer","ranker","rankdir","align"],J8=["width","height"],Q8={width:0,height:0},e7=["minlen","weight","width","height","labeloffset"],t7={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},n7=["labelpos"];function r7(e,t){return A8.mapValues(A8.pick(e,t),Number)}function o7(e){var t={};return A8.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}var i7=O6,a7=q6,s7=p6.Graph,l7={debugOrdering:function(e){var t=a7.buildLayerMatrix(e),n=new s7({compound:!0,multigraph:!0}).setGraph({});return i7.forEach(e.nodes(),function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),i7.forEach(e.edges(),function(e){n.setEdge(e.v,e.w,{},e.name)}),i7.forEach(t,function(e,t){var r="layer"+t;n.setNode(r,{rank:"same"}),i7.reduce(e,function(e,t){return n.setEdge(e,t,{style:"invis"}),t})}),n}};const c7=r({graphlib:p6,layout:Z8,debug:l7,util:{time:q6.time,notime:q6.notime},version:"0.8.5"});const u7=({graph:e,stepStatuses:t,onNodeClick:n,className:r})=>{const{nodes:o,edges:i}=$.useMemo(()=>function(e,t){const n=new c7.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",nodesep:60,ranksep:80});for(const r of e.nodes){const e="condition"===r.type||"switch"===r.type;n.setNode(r.id,{width:e?60:180,height:e?60:50})}for(const r of e.edges)n.setEdge(r.source,r.target);return c7.layout(n),{nodes:e.nodes.map(e=>{const r=n.node(e.id);return{id:e.id,type:e.type,position:{x:r.x-r.width/2,y:r.y-r.height/2},data:{label:e.label,status:(null==t?void 0:t[e.id])||"idle",metadata:e.metadata}}}),edges:e.edges.map((e,n)=>({id:`e-${e.source}-${e.target}-${n}`,source:e.source,target:e.target,label:e.label,animated:"running"===(null==t?void 0:t[e.source]),style:{stroke:"#525252"},labelStyle:{fill:"#a1a1aa",fontSize:11}}))}}(e,t),[e,t]),a=$.useCallback((e,t)=>{null==n||n(t.id)},[n]);return G.jsx("div",{className:`w-full h-full ${r||""}`,children:G.jsxs(OK,{nodes:o,edges:i,nodeTypes:lZ,onNodeClick:a,fitView:!0,fitViewOptions:{padding:.2},proOptions:{hideAttribution:!0},minZoom:.3,maxZoom:2,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,children:[G.jsx(RK,{variant:NK.Dots,gap:16,size:1,color:"#27272a"}),G.jsx(HK,{showInteractive:!1,className:"!bg-surface !border-border-default !rounded-lg [&>button]:!bg-surface [&>button]:!border-border-default [&>button]:!text-secondary [&>button:hover]:!bg-surface-hover"}),G.jsx(QK,{nodeColor:"#3f3f46",maskColor:"rgba(0, 0, 0, 0.6)",className:"!bg-surface !border-border-default !rounded-lg"})]})})},d7=({label:e,value:t})=>null==t?null:G.jsxs("div",{children:[G.jsx("p",{className:"text-xs font-medium text-secondary mb-1",children:e}),G.jsx("pre",{className:"text-xs text-primary bg-surface rounded-lg border border-border-default p-3 overflow-auto max-h-48 whitespace-pre-wrap break-words font-mono",children:"string"==typeof t?t:JSON.stringify(t,null,2)})]}),f7={step:"bg-zinc-700 text-zinc-300",agent:"bg-purple-900/50 text-purple-300",condition:"bg-zinc-700 text-zinc-300",switch:"bg-blue-900/50 text-blue-300",parallel:"bg-zinc-700 text-zinc-300",foreach:"bg-orange-900/50 text-orange-300",connector:"bg-zinc-700 text-zinc-300"},h7=({nodeId:e,graph:t,stepResult:n,onClose:r})=>{var o,i,a;if(!e)return null;const s=t.nodes.find(t=>t.id===e);if(!s)return null;const l=f7[s.type]||"bg-zinc-700 text-zinc-300";return G.jsxs("div",{className:"w-80 border-l border-border-default bg-surface-elevated h-full overflow-y-auto",children:[G.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border-default",children:[G.jsx("h3",{className:"text-sm font-semibold text-primary truncate",children:s.label}),G.jsx("button",{onClick:r,className:"p-1 rounded-lg text-secondary hover:text-primary hover:bg-surface-hover transition-colors",children:G.jsx(xm,{className:"h-4 w-4"})})]}),G.jsxs("div",{className:"px-4 py-4 space-y-4",children:[G.jsxs("div",{className:"space-y-2",children:[G.jsx("div",{className:"flex items-center gap-2",children:G.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${l}`,children:s.type})}),G.jsx("p",{className:"text-xs text-secondary font-mono",children:s.id})]}),(null==(o=s.metadata)?void 0:o.description)&&G.jsxs("div",{children:[G.jsx("p",{className:"text-xs font-medium text-secondary mb-1",children:"Descricao"}),G.jsx("p",{className:"text-xs text-primary",children:s.metadata.description})]}),n&&G.jsxs(G.Fragment,{children:[void 0!==n.durationMs&&G.jsxs("div",{className:"flex items-center gap-2 text-xs text-secondary",children:[G.jsx(Qp,{className:"h-3.5 w-3.5"}),G.jsx("span",{children:(c=n.durationMs,c<1e3?`${c}ms`:c<6e4?`${(c/1e3).toFixed(1)}s`:`${(c/6e4).toFixed(1)}m`)})]}),n.error&&G.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-red-900/20 border border-red-800",children:[G.jsx(ym,{className:"h-3.5 w-3.5 text-red-400 flex-shrink-0 mt-0.5"}),G.jsx("p",{className:"text-xs text-red-300",children:n.error})]}),G.jsx(d7,{label:"Input",value:n.input}),G.jsx(d7,{label:"Output",value:n.output})]}),!n&&G.jsxs(G.Fragment,{children:[G.jsx(d7,{label:"Input Schema",value:null==(i=s.metadata)?void 0:i.inputSchema}),G.jsx(d7,{label:"Output Schema",value:null==(a=s.metadata)?void 0:a.outputSchema})]})]})]});var c},p7=()=>{const[e]=Ff(),t=e.get("apiUrl")||`${window.location.protocol}//${window.location.host}`,[n,r]=$.useState(null),[o,i]=$.useState(!0),[a,s]=$.useState(null),[l,c]=$.useState("{\n \n}"),[u,d]=$.useState(!1),[f,h]=$.useState(null),[p,m]=$.useState(null),[g,v]=$.useState({}),[y,b]=$.useState({}),[x,w]=$.useState(null),[k,_]=$.useState(null);$.useEffect(()=>{(async()=>{try{i(!0);const e=await fetch(`${t}/api/v1/workflows/graph`);if(!e.ok)throw new Error(`HTTP ${e.status}`);const n=await e.json();r(n),s(null)}catch(v7){s(v7 instanceof Error?v7.message:"Failed to load workflow graph")}finally{i(!1)}})()},[t]);const S=$.useMemo(()=>{if(x)return y[x]},[x,y]);if(o)return G.jsx("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:G.jsxs("div",{className:"flex flex-col items-center gap-3",children:[G.jsx(sm,{className:"h-8 w-8 animate-spin text-blue-500"}),G.jsx("p",{className:"text-sm text-zinc-400",children:"Loading workflow graph..."})]})});if(a||!n)return G.jsx("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:G.jsxs("div",{className:"flex flex-col items-center gap-3 max-w-md text-center",children:[G.jsx(Yp,{className:"h-8 w-8 text-red-400"}),G.jsx("p",{className:"text-sm text-red-400",children:a||"No workflow found"}),G.jsx("p",{className:"text-xs text-zinc-500",children:"Make sure your main.ts exports a Workflow with .toGraph() method."})]})});return 0===n.nodes.length?G.jsx("div",{className:"flex items-center justify-center h-screen bg-zinc-950",children:G.jsxs("div",{className:"flex flex-col items-center gap-3 max-w-md text-center",children:[G.jsx(om,{className:"h-8 w-8 text-zinc-500"}),G.jsx("p",{className:"text-sm text-zinc-400",children:"No workflow graph found"}),G.jsx("p",{className:"text-xs text-zinc-500",children:"Your main.ts should export a Workflow built with flow() or createWorkflow(). Make sure the exported object has a .toGraph() method."})]})}):G.jsxs("div",{className:"flex flex-col h-screen bg-zinc-950",children:[G.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zinc-800 bg-zinc-900",children:[G.jsx(om,{className:"h-5 w-5 text-blue-400"}),G.jsxs("h1",{className:"text-base font-semibold text-zinc-100",children:["Workflow Test: ",n.name||n.id]}),G.jsxs("span",{className:"text-xs text-zinc-500",children:[n.nodes.length," steps"]}),null!==k&&G.jsxs("span",{className:"ml-auto text-xs text-zinc-400",children:[k,"ms"]})]}),G.jsxs("div",{className:"flex flex-1 min-h-0",children:[G.jsxs("div",{className:"w-[360px] border-r border-zinc-800 flex flex-col bg-zinc-900",children:[G.jsx("div",{className:"px-4 py-3 border-b border-zinc-800",children:G.jsx("p",{className:"text-sm font-medium text-zinc-300",children:"Input JSON"})}),G.jsx("div",{className:"flex-1 p-3",children:G.jsx("textarea",{value:l,onChange:e=>c(e.target.value),spellCheck:!1,className:"w-full h-full resize-none rounded-lg border border-zinc-700 bg-zinc-950 text-zinc-200 text-sm font-mono p-3 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:'{ "key": "value" }'})}),G.jsxs("div",{className:"px-3 py-3 border-t border-zinc-800 space-y-2",children:[f&&G.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-red-950/50 border border-red-900",children:[G.jsx(Yp,{className:"h-3.5 w-3.5 text-red-400 mt-0.5 shrink-0"}),G.jsx("p",{className:"text-xs text-red-300",children:f})]}),G.jsx("button",{onClick:async()=>{let e;try{e=JSON.parse(l)}catch{return void h("JSON invalido. Verifique a sintaxe.")}if(d(!0),h(null),m(null),v({}),b({}),w(null),_(null),n){const e={};n.nodes.forEach(t=>{e[t.id]="running"}),v(e)}const r=Date.now();try{const o=await fetch(`${t}/api/v1/agents/execute`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:JSON.stringify(e)})}),i=await o.json(),a=Date.now()-r;if(_(a),i.success){if(m(i),n){const e={};n.nodes.forEach(t=>{e[t.id]="completed"}),v(e)}}else if(h(i.error||i.message||"Workflow execution failed"),n){const e={};n.nodes.forEach(t=>{e[t.id]="failed"}),v(e)}}catch(v7){if(h(v7.message||"Falha ao executar workflow"),_(Date.now()-r),n){const e={};n.nodes.forEach(t=>{e[t.id]="failed"}),v(e)}}finally{d(!1)}},disabled:u,className:"w-full inline-flex items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:u?G.jsxs(G.Fragment,{children:[G.jsx(sm,{className:"h-4 w-4 animate-spin"}),"Executando..."]}):G.jsxs(G.Fragment,{children:[G.jsx(dm,{className:"h-4 w-4"}),"Executar Workflow"]})})]}),p&&G.jsxs("div",{className:"border-t border-zinc-800 max-h-[200px] overflow-auto",children:[G.jsx("div",{className:"px-4 py-2 border-b border-zinc-800",children:G.jsx("p",{className:"text-xs font-medium text-zinc-400",children:"Output"})}),G.jsx("pre",{className:"p-3 text-xs text-zinc-300 font-mono whitespace-pre-wrap",children:JSON.stringify(p.message||p,null,2)})]})]}),G.jsxs("div",{className:"flex-1 flex min-h-0",children:[G.jsx("div",{className:"flex-1",children:G.jsx(u7,{graph:n,stepStatuses:g,onNodeClick:e=>w(e)})}),x&&G.jsx(h7,{nodeId:x,graph:n,stepResult:S,onClose:()=>w(null)})]})]})]})};function m7({children:e}){const t={id:"local-test",domain:"local.test",role:"ADMIN"},n={currentTenant:t,availableTenants:[t],isSuperAdmin:!1,switchTenant:()=>{},isLoading:!1,error:null};return G.jsx(dD.Provider,{value:n,children:e})}function g7(){return G.jsx(Rp,{domain:"dummy.auth0.com",clientId:"dummy-client-id",authorizationParams:{redirect_uri:window.location.origin},skipRedirectCallback:!0,children:G.jsx(Rf,{children:G.jsx(m7,{children:G.jsxs(ff,{children:[G.jsx(uf,{path:"/agents/:agentId/test-monitor",element:G.jsx(bz,{mode:"local"})}),G.jsx(uf,{path:"/workflows/test",element:G.jsx(p7,{})}),G.jsx(uf,{path:"*",element:G.jsx("div",{className:"flex items-center justify-center h-screen bg-gray-50",children:G.jsxs("div",{className:"text-center max-w-md",children:[G.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-3",children:"Runflow Local Test"}),G.jsx("p",{className:"text-gray-600 mb-4",children:"This is a minimal build for local agent testing."}),G.jsxs("div",{className:"bg-blue-50 border bg-surface text-primary border-blue-200 rounded-lg p-4 text-left",children:[G.jsx("p",{className:"text-sm text-blue-800 font-medium mb-2",children:"Navigate to:"}),G.jsx("code",{className:"text-xs bg-blue-100 px-2 py-1 rounded text-blue-900 block",children:"/agents/YOUR_AGENT_ID/test-monitor?mode=local"})]})]})})})]})})})})}J.createRoot(document.getElementById("root")).render(G.jsx(V.StrictMode,{children:G.jsx(g7,{})}));
|