@signalwire/cfb 0.0.1 → 0.0.3
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/main.js +19 -19
- package/dist/style.css +1 -1
- package/dist/voices.json +1 -0
- package/package.json +2 -7
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* Visual Builder v0.0.
|
|
1
|
+
(function(Ur,$o){typeof exports=="object"&&typeof module<"u"?$o(exports):typeof define=="function"&&define.amd?define(["exports"],$o):(Ur=typeof globalThis<"u"?globalThis:Ur||self,$o(Ur.CFB={}))})(this,function(Ur){"use strict";/**
|
|
2
|
+
* Visual Builder v0.0.3 [60c0817] (https://signalwire.com)
|
|
3
3
|
* Copyright 2018-2023 SignalWire.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
function $o(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function hf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gf={exports:{}},ms={},mf={exports:{}},ee={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
10
10
|
*
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/var
|
|
13
|
+
*/var zo=Symbol.for("react.element"),sE=Symbol.for("react.portal"),lE=Symbol.for("react.fragment"),aE=Symbol.for("react.strict_mode"),uE=Symbol.for("react.profiler"),cE=Symbol.for("react.provider"),dE=Symbol.for("react.context"),fE=Symbol.for("react.forward_ref"),pE=Symbol.for("react.suspense"),hE=Symbol.for("react.memo"),gE=Symbol.for("react.lazy"),vf=Symbol.iterator;function mE(e){return e===null||typeof e!="object"?null:(e=vf&&e[vf]||e["@@iterator"],typeof e=="function"?e:null)}var yf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ef=Object.assign,Sf={};function Fr(e,t,n){this.props=e,this.context=t,this.refs=Sf,this.updater=n||yf}Fr.prototype.isReactComponent={},Fr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},Fr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _f(){}_f.prototype=Fr.prototype;function Na(e,t,n){this.props=e,this.context=t,this.refs=Sf,this.updater=n||yf}var Oa=Na.prototype=new _f;Oa.constructor=Na,Ef(Oa,Fr.prototype),Oa.isPureReactComponent=!0;var wf=Array.isArray,Rf=Object.prototype.hasOwnProperty,xa={current:null},Nf={key:!0,ref:!0,__self:!0,__source:!0};function Of(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Rf.call(t,r)&&!Nf.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:zo,type:e,key:i,ref:s,props:o,_owner:xa.current}}function vE(e,t){return{$$typeof:zo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ta(e){return typeof e=="object"&&e!==null&&e.$$typeof===zo}function yE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var xf=/\/+/g;function Ca(e,t){return typeof e=="object"&&e!==null&&e.key!=null?yE(""+e.key):t.toString(36)}function vs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case zo:case sE:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ca(s,0):r,wf(o)?(n="",e!=null&&(n=e.replace(xf,"$&/")+"/"),vs(o,t,n,"",function(u){return u})):o!=null&&(Ta(o)&&(o=vE(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(xf,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",wf(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Ca(i,l);s+=vs(i,t,n,a,o)}else if(a=mE(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Ca(i,l++),s+=vs(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ys(e,t,n){if(e==null)return e;var r=[],o=0;return vs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function EE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $e={current:null},Es={transition:null},SE={ReactCurrentDispatcher:$e,ReactCurrentBatchConfig:Es,ReactCurrentOwner:xa};ee.Children={map:ys,forEach:function(e,t,n){ys(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ys(e,function(){t++}),t},toArray:function(e){return ys(e,function(t){return t})||[]},only:function(e){if(!Ta(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ee.Component=Fr,ee.Fragment=lE,ee.Profiler=uE,ee.PureComponent=Na,ee.StrictMode=aE,ee.Suspense=pE,ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SE,ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ef({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=xa.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Rf.call(t,a)&&!Nf.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:zo,type:e.type,key:o,ref:i,props:r,_owner:s}},ee.createContext=function(e){return e={$$typeof:dE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:cE,_context:e},e.Consumer=e},ee.createElement=Of,ee.createFactory=function(e){var t=Of.bind(null,e);return t.type=e,t},ee.createRef=function(){return{current:null}},ee.forwardRef=function(e){return{$$typeof:fE,render:e}},ee.isValidElement=Ta,ee.lazy=function(e){return{$$typeof:gE,_payload:{_status:-1,_result:e},_init:EE}},ee.memo=function(e,t){return{$$typeof:hE,type:e,compare:t===void 0?null:t}},ee.startTransition=function(e){var t=Es.transition;Es.transition={};try{e()}finally{Es.transition=t}},ee.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},ee.useCallback=function(e,t){return $e.current.useCallback(e,t)},ee.useContext=function(e){return $e.current.useContext(e)},ee.useDebugValue=function(){},ee.useDeferredValue=function(e){return $e.current.useDeferredValue(e)},ee.useEffect=function(e,t){return $e.current.useEffect(e,t)},ee.useId=function(){return $e.current.useId()},ee.useImperativeHandle=function(e,t,n){return $e.current.useImperativeHandle(e,t,n)},ee.useInsertionEffect=function(e,t){return $e.current.useInsertionEffect(e,t)},ee.useLayoutEffect=function(e,t){return $e.current.useLayoutEffect(e,t)},ee.useMemo=function(e,t){return $e.current.useMemo(e,t)},ee.useReducer=function(e,t,n){return $e.current.useReducer(e,t,n)},ee.useRef=function(e){return $e.current.useRef(e)},ee.useState=function(e){return $e.current.useState(e)},ee.useSyncExternalStore=function(e,t,n){return $e.current.useSyncExternalStore(e,t,n)},ee.useTransition=function(){return $e.current.useTransition()},ee.version="18.2.0",mf.exports=ee;var R=mf.exports;const mt=hf(R),Tf=$o({__proto__:null,default:mt},[R]);/**
|
|
14
14
|
* @license React
|
|
15
15
|
* react-jsx-runtime.production.min.js
|
|
16
16
|
*
|
|
@@ -18,7 +18,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the MIT license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/var
|
|
21
|
+
*/var _E=R,wE=Symbol.for("react.element"),RE=Symbol.for("react.fragment"),NE=Object.prototype.hasOwnProperty,OE=_E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xE={key:!0,ref:!0,__self:!0,__source:!0};function Cf(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)NE.call(t,r)&&!xE.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:wE,type:e,key:i,ref:s,props:o,_owner:OE.current}}ms.Fragment=RE,ms.jsx=Cf,ms.jsxs=Cf,gf.exports=ms;var ba=gf.exports;const Ee=ba.Fragment,y=ba.jsx,k=ba.jsxs;var Ia={},bf={exports:{}},ot={},If={exports:{}},Af={};/**
|
|
22
22
|
* @license React
|
|
23
23
|
* scheduler.production.min.js
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
26
26
|
*
|
|
27
27
|
* This source code is licensed under the MIT license found in the
|
|
28
28
|
* LICENSE file in the root directory of this source tree.
|
|
29
|
-
*/(function(e){function t(T,
|
|
29
|
+
*/(function(e){function t(T,P){var U=T.length;T.push(P);e:for(;0<U;){var z=U-1>>>1,j=T[z];if(0<o(j,P))T[z]=P,T[U]=j,U=z;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var P=T[0],U=T.pop();if(U!==P){T[0]=U;e:for(var z=0,j=T.length,K=j>>>1;z<K;){var W=2*(z+1)-1,J=T[W],X=W+1,te=T[X];if(0>o(J,U))X<j&&0>o(te,J)?(T[z]=te,T[X]=U,z=X):(T[z]=J,T[W]=U,z=W);else if(X<j&&0>o(te,U))T[z]=te,T[X]=U,z=X;else break e}}return P}function o(T,P){var U=T.sortIndex-P.sortIndex;return U!==0?U:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,p=!1,m=!1,v=!1,E=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(T){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=T)r(u),P.sortIndex=P.expirationTime,t(a,P);else break;P=n(u)}}function _(T){if(v=!1,S(T),!m)if(n(a)!==null)m=!0,D(w);else{var P=n(u);P!==null&&A(_,P.startTime-T)}}function w(T,P){m=!1,v&&(v=!1,h(L),L=-1),p=!0;var U=f;try{for(S(P),d=n(a);d!==null&&(!(d.expirationTime>P)||T&&!V());){var z=d.callback;if(typeof z=="function"){d.callback=null,f=d.priorityLevel;var j=z(d.expirationTime<=P);P=e.unstable_now(),typeof j=="function"?d.callback=j:d===n(a)&&r(a),S(P)}else r(a);d=n(a)}if(d!==null)var K=!0;else{var W=n(u);W!==null&&A(_,W.startTime-P),K=!1}return K}finally{d=null,f=U,p=!1}}var N=!1,C=null,L=-1,B=5,I=-1;function V(){return!(e.unstable_now()-I<B)}function $(){if(C!==null){var T=e.unstable_now();I=T;var P=!0;try{P=C(!0,T)}finally{P?F():(N=!1,C=null)}}else N=!1}var F;if(typeof g=="function")F=function(){g($)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,M=O.port2;O.port1.onmessage=$,F=function(){M.postMessage(null)}}else F=function(){E($,0)};function D(T){C=T,N||(N=!0,F())}function A(T,P){L=E(function(){T(e.unstable_now())},P)}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(T){T.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,D(w))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(T){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var U=f;f=P;try{return T()}finally{f=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,P){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var U=f;f=T;try{return P()}finally{f=U}},e.unstable_scheduleCallback=function(T,P,U){var z=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?z+U:z):U=z,T){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=U+j,T={id:c++,callback:P,priorityLevel:T,startTime:U,expirationTime:j,sortIndex:-1},U>z?(T.sortIndex=U,t(u,T),n(a)===null&&T===n(u)&&(v?(h(L),L=-1):v=!0,A(_,U-z))):(T.sortIndex=j,t(a,T),m||p||(m=!0,D(w))),T},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(T){var P=f;return function(){var U=f;f=P;try{return T.apply(this,arguments)}finally{f=U}}}})(Af),If.exports=Af;var TE=If.exports;/**
|
|
30
30
|
* @license React
|
|
31
31
|
* react-dom.production.min.js
|
|
32
32
|
*
|
|
@@ -34,14 +34,14 @@ function Uo(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
|
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var
|
|
38
|
-
|
|
37
|
+
*/var Lf=R,it=TE;function H(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 Df=new Set,Ho={};function ir(e,t){Vr(e,t),Vr(e+"Capture",t)}function Vr(e,t){for(Ho[e]=t,e=0;e<t.length;e++)Df.add(t[e])}var on=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Aa=Object.prototype.hasOwnProperty,CE=/^[: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]*$/,kf={},Pf={};function bE(e){return Aa.call(Pf,e)?!0:Aa.call(kf,e)?!1:CE.test(e)?Pf[e]=!0:(kf[e]=!0,!1)}function IE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function AE(e,t,n,r){if(t===null||typeof t>"u"||IE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ze(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var De={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){De[e]=new ze(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];De[t]=new ze(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){De[e]=new ze(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){De[e]=new ze(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){De[e]=new ze(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){De[e]=new ze(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){De[e]=new ze(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){De[e]=new ze(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){De[e]=new ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var La=/[\-:]([a-z])/g;function Da(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(La,Da);De[t]=new ze(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(La,Da);De[t]=new ze(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(La,Da);De[t]=new ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){De[e]=new ze(e,1,!1,e.toLowerCase(),null,!1,!1)}),De.xlinkHref=new ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){De[e]=new ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function ka(e,t,n,r){var o=De.hasOwnProperty(t)?De[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AE(t,n,o,r)&&(n=null),r||o===null?bE(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var sn=Lf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ss=Symbol.for("react.element"),Br=Symbol.for("react.portal"),$r=Symbol.for("react.fragment"),Pa=Symbol.for("react.strict_mode"),Ma=Symbol.for("react.profiler"),Mf=Symbol.for("react.provider"),Uf=Symbol.for("react.context"),Ua=Symbol.for("react.forward_ref"),Fa=Symbol.for("react.suspense"),Va=Symbol.for("react.suspense_list"),Ba=Symbol.for("react.memo"),Rn=Symbol.for("react.lazy"),Ff=Symbol.for("react.offscreen"),Vf=Symbol.iterator;function jo(e){return e===null||typeof e!="object"?null:(e=Vf&&e[Vf]||e["@@iterator"],typeof e=="function"?e:null)}var he=Object.assign,$a;function Go(e){if($a===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$a=t&&t[1]||""}return`
|
|
38
|
+
`+$a+e}var za=!1;function Ha(e,t){if(!e||za)return"";za=!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()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
39
39
|
`),i=r.stack.split(`
|
|
40
|
-
`),s=o.length-1,
|
|
41
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ul=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zo(e):""}function TE(e){switch(e.tag){case 5:return zo(e.type);case 16:return zo("Lazy");case 13:return zo("Suspense");case 19:return zo("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function Vl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Vr:return"Portal";case Al:return"Profiler";case Il:return"StrictMode";case Dl:return"Suspense";case kl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case kf:return(e.displayName||"Context")+".Consumer";case Df:return(e._context.displayName||"Context")+".Provider";case Ll:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pl:return t=e.displayName||null,t!==null?t:Vl(e.type)||"Memo";case vn:t=e._payload,e=e._init;try{return Vl(e(t))}catch{}}return null}function CE(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=t.render,e=e.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 Vl(t);case 8:return t===Il?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function yn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bE(e){var t=Uf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ms(e){e._valueTracker||(e._valueTracker=bE(e))}function Ff(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Uf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Bl(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Bf(e,t){t=t.checked,t!=null&&bl(e,"checked",t,!1)}function $l(e,t){Bf(e,t);var n=yn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zl(e,t.type,n):t.hasOwnProperty("defaultValue")&&zl(e,t.type,yn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $f(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function zl(e,t,n){(t!=="number"||vs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ho=Array.isArray;function $r(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=""+yn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Hl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Ho(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yn(n)}}function Hf(e,t){var n=yn(t.value),r=yn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function jf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Yf(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 jl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Yf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ys,Gf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ys=ys||document.createElement("div"),ys.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ys.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function jo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yo={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},IE=["Webkit","ms","Moz","O"];Object.keys(Yo).forEach(function(e){IE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yo[t]=Yo[e]})});function Wf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yo.hasOwnProperty(e)&&Yo[e]?(""+t).trim():t+"px"}function Kf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Wf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var AE=fe({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 Yl(e,t){if(t){if(AE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Gl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Wl=null;function Kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,zr=null,Hr=null;function Qf(e){if(e=pi(e)){if(typeof Ql!="function")throw Error(H(280));var t=e.stateNode;t&&(t=$s(t),Ql(e.stateNode,e.type,t))}}function Xf(e){zr?Hr?Hr.push(e):Hr=[e]:zr=e}function qf(){if(zr){var e=zr,t=Hr;if(Hr=zr=null,Qf(e),t)for(e=0;e<t.length;e++)Qf(t[e])}}function Zf(e,t){return e(t)}function Jf(){}var Xl=!1;function ep(e,t,n){if(Xl)return e(t,n);Xl=!0;try{return Zf(e,t,n)}finally{Xl=!1,(zr!==null||Hr!==null)&&(Jf(),qf())}}function Go(e,t){var n=e.stateNode;if(n===null)return null;var r=$s(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var ql=!1;if(Jt)try{var Wo={};Object.defineProperty(Wo,"passive",{get:function(){ql=!0}}),window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{ql=!1}function LE(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ko=!1,Es=null,Ss=!1,Zl=null,DE={onError:function(e){Ko=!0,Es=e}};function kE(e,t,n,r,o,i,s,a,l){Ko=!1,Es=null,LE.apply(DE,arguments)}function PE(e,t,n,r,o,i,s,a,l){if(kE.apply(this,arguments),Ko){if(Ko){var u=Es;Ko=!1,Es=null}else throw Error(H(198));Ss||(Ss=!0,Zl=u)}}function rr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function tp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function np(e){if(rr(e)!==e)throw Error(H(188))}function ME(e){var t=e.alternate;if(!t){if(t=rr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return np(o),e;if(i===r)return np(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function rp(e){return e=ME(e),e!==null?op(e):null}function op(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=op(e);if(t!==null)return t;e=e.sibling}return null}var ip=ot.unstable_scheduleCallback,sp=ot.unstable_cancelCallback,UE=ot.unstable_shouldYield,FE=ot.unstable_requestPaint,ye=ot.unstable_now,VE=ot.unstable_getCurrentPriorityLevel,Jl=ot.unstable_ImmediatePriority,ap=ot.unstable_UserBlockingPriority,_s=ot.unstable_NormalPriority,BE=ot.unstable_LowPriority,lp=ot.unstable_IdlePriority,ws=null,Ft=null;function $E(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(ws,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:jE,zE=Math.log,HE=Math.LN2;function jE(e){return e>>>=0,e===0?32:31-(zE(e)/HE|0)|0}var Rs=64,Ns=4194304;function Qo(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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Os(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Qo(a):(i&=s,i!==0&&(r=Qo(i)))}else s=n&~o,s!==0?r=Qo(s):i!==0&&(r=Qo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Nt(t),o=1<<n,r|=e[n],t&=~o;return r}function YE(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;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function GE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Nt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=YE(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function eu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function up(){var e=Rs;return Rs<<=1,!(Rs&4194240)&&(Rs=64),e}function tu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Nt(t),e[t]=n}function WE(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-Nt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function nu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Nt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function cp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dp,ru,fp,pp,hp,ou=!1,xs=[],En=null,Sn=null,_n=null,qo=new Map,Zo=new Map,wn=[],KE="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 gp(e,t){switch(e){case"focusin":case"focusout":En=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zo.delete(t.pointerId)}}function Jo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=pi(t),t!==null&&ru(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function QE(e,t,n,r,o){switch(t){case"focusin":return En=Jo(En,e,t,n,r,o),!0;case"dragenter":return Sn=Jo(Sn,e,t,n,r,o),!0;case"mouseover":return _n=Jo(_n,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return qo.set(i,Jo(qo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Zo.set(i,Jo(Zo.get(i)||null,e,t,n,r,o)),!0}return!1}function mp(e){var t=or(e.target);if(t!==null){var n=rr(t);if(n!==null){if(t=n.tag,t===13){if(t=tp(n),t!==null){e.blockedOn=t,hp(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ts(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=su(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wl=r,n.target.dispatchEvent(r),Wl=null}else return t=pi(n),t!==null&&ru(t),e.blockedOn=n,!1;t.shift()}return!0}function vp(e,t,n){Ts(e)&&n.delete(t)}function XE(){ou=!1,En!==null&&Ts(En)&&(En=null),Sn!==null&&Ts(Sn)&&(Sn=null),_n!==null&&Ts(_n)&&(_n=null),qo.forEach(vp),Zo.forEach(vp)}function ei(e,t){e.blockedOn===t&&(e.blockedOn=null,ou||(ou=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,XE)))}function ti(e){function t(o){return ei(o,e)}if(0<xs.length){ei(xs[0],e);for(var n=1;n<xs.length;n++){var r=xs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(En!==null&&ei(En,e),Sn!==null&&ei(Sn,e),_n!==null&&ei(_n,e),qo.forEach(t),Zo.forEach(t),n=0;n<wn.length;n++)r=wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wn.length&&(n=wn[0],n.blockedOn===null);)mp(n),n.blockedOn===null&&wn.shift()}var jr=en.ReactCurrentBatchConfig,Cs=!0;function qE(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=1,iu(e,t,n,r)}finally{re=o,jr.transition=i}}function ZE(e,t,n,r){var o=re,i=jr.transition;jr.transition=null;try{re=4,iu(e,t,n,r)}finally{re=o,jr.transition=i}}function iu(e,t,n,r){if(Cs){var o=su(e,t,n,r);if(o===null)Ru(e,t,r,bs,n),gp(e,r);else if(QE(o,e,t,n,r))r.stopPropagation();else if(gp(e,r),t&4&&-1<KE.indexOf(e)){for(;o!==null;){var i=pi(o);if(i!==null&&dp(i),i=su(e,t,n,r),i===null&&Ru(e,t,r,bs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ru(e,t,r,null,n)}}var bs=null;function su(e,t,n,r){if(bs=null,e=Kl(r),e=or(e),e!==null)if(t=rr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=tp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bs=e,null}function yp(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(VE()){case Jl:return 1;case ap:return 4;case _s:case BE:return 16;case lp:return 536870912;default:return 16}default:return 16}}var Rn=null,au=null,Is=null;function Ep(){if(Is)return Is;var e,t=au,n=t.length,r,o="value"in Rn?Rn.value:Rn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Is=o.slice(e,1<r?1-r:void 0)}function As(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ls(){return!0}function Sp(){return!1}function it(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ls:Sp,this.isPropagationStopped=Sp,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ls)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ls)},persist:function(){},isPersistent:Ls}),t}var Yr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lu=it(Yr),ni=fe({},Yr,{view:0,detail:0}),JE=it(ni),uu,cu,ri,Ds=fe({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ri&&(ri&&e.type==="mousemove"?(uu=e.screenX-ri.screenX,cu=e.screenY-ri.screenY):cu=uu=0,ri=e),uu)},movementY:function(e){return"movementY"in e?e.movementY:cu}}),_p=it(Ds),eS=fe({},Ds,{dataTransfer:0}),tS=it(eS),nS=fe({},ni,{relatedTarget:0}),du=it(nS),rS=fe({},Yr,{animationName:0,elapsedTime:0,pseudoElement:0}),oS=it(rS),iS=fe({},Yr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sS=it(iS),aS=fe({},Yr,{data:0}),wp=it(aS),lS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uS={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"},cS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=cS[e])?!!t[e]:!1}function fu(){return dS}var fS=fe({},ni,{key:function(e){if(e.key){var t=lS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=As(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fu,charCode:function(e){return e.type==="keypress"?As(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?As(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),pS=it(fS),hS=fe({},Ds,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=it(hS),gS=fe({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fu}),mS=it(gS),vS=fe({},Yr,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=it(vS),ES=fe({},Ds,{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}),SS=it(ES),_S=[9,13,27,32],pu=Jt&&"CompositionEvent"in window,oi=null;Jt&&"documentMode"in document&&(oi=document.documentMode);var wS=Jt&&"TextEvent"in window&&!oi,Np=Jt&&(!pu||oi&&8<oi&&11>=oi),Op=String.fromCharCode(32),xp=!1;function Tp(e,t){switch(e){case"keyup":return _S.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Gr=!1;function RS(e,t){switch(e){case"compositionend":return Cp(t);case"keypress":return t.which!==32?null:(xp=!0,Op);case"textInput":return e=t.data,e===Op&&xp?null:e;default:return null}}function NS(e,t){if(Gr)return e==="compositionend"||!pu&&Tp(e,t)?(e=Ep(),Is=au=Rn=null,Gr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Np&&t.locale!=="ko"?null:t.data;default:return null}}var OS={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 bp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!OS[e.type]:t==="textarea"}function Ip(e,t,n,r){Xf(r),t=Fs(t,"onChange"),0<t.length&&(n=new lu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ii=null,si=null;function xS(e){Kp(e,0)}function ks(e){var t=qr(e);if(Ff(t))return e}function TS(e,t){if(e==="change")return t}var Ap=!1;if(Jt){var hu;if(Jt){var gu="oninput"in document;if(!gu){var Lp=document.createElement("div");Lp.setAttribute("oninput","return;"),gu=typeof Lp.oninput=="function"}hu=gu}else hu=!1;Ap=hu&&(!document.documentMode||9<document.documentMode)}function Dp(){ii&&(ii.detachEvent("onpropertychange",kp),si=ii=null)}function kp(e){if(e.propertyName==="value"&&ks(si)){var t=[];Ip(t,si,e,Kl(e)),ep(xS,t)}}function CS(e,t,n){e==="focusin"?(Dp(),ii=t,si=n,ii.attachEvent("onpropertychange",kp)):e==="focusout"&&Dp()}function bS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ks(si)}function IS(e,t){if(e==="click")return ks(t)}function AS(e,t){if(e==="input"||e==="change")return ks(t)}function LS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:LS;function ai(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!xl.call(t,o)||!Ot(e[o],t[o]))return!1}return!0}function Pp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mp(e,t){var n=Pp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Pp(n)}}function Up(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Up(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fp(){for(var e=window,t=vs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vs(e.document)}return t}function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DS(e){var t=Fp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Up(n.ownerDocument.documentElement,n)){if(r!==null&&mu(n)){if(t=r.start,e=r.end,e===void 0&&(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,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Mp(n,i);var s=Mp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kS=Jt&&"documentMode"in document&&11>=document.documentMode,Wr=null,vu=null,li=null,yu=!1;function Vp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;yu||Wr==null||Wr!==vs(r)||(r=Wr,"selectionStart"in r&&mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),li&&ai(li,r)||(li=r,r=Fs(vu,"onSelect"),0<r.length&&(t=new lu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Wr)))}function Ps(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Kr={animationend:Ps("Animation","AnimationEnd"),animationiteration:Ps("Animation","AnimationIteration"),animationstart:Ps("Animation","AnimationStart"),transitionend:Ps("Transition","TransitionEnd")},Eu={},Bp={};Jt&&(Bp=document.createElement("div").style,"AnimationEvent"in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),"TransitionEvent"in window||delete Kr.transitionend.transition);function Ms(e){if(Eu[e])return Eu[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bp)return Eu[e]=t[n];return e}var $p=Ms("animationend"),zp=Ms("animationiteration"),Hp=Ms("animationstart"),jp=Ms("transitionend"),Yp=new Map,Gp="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 Nn(e,t){Yp.set(e,t),nr(t,[e])}for(var Su=0;Su<Gp.length;Su++){var _u=Gp[Su],PS=_u.toLowerCase(),MS=_u[0].toUpperCase()+_u.slice(1);Nn(PS,"on"+MS)}Nn($p,"onAnimationEnd"),Nn(zp,"onAnimationIteration"),Nn(Hp,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(jp,"onTransitionEnd"),Fr("onMouseEnter",["mouseout","mouseover"]),Fr("onMouseLeave",["mouseout","mouseover"]),Fr("onPointerEnter",["pointerout","pointerover"]),Fr("onPointerLeave",["pointerout","pointerover"]),nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),nr("onBeforeInput",["compositionend","keypress","textInput","paste"]),nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ui="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(" "),US=new Set("cancel close invalid load scroll toggle".split(" ").concat(ui));function Wp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,PE(r,t,void 0,e),e.currentTarget=null}function Kp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Wp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Wp(o,a,u),i=l}}}if(Ss)throw e=Zl,Ss=!1,Zl=null,e}function se(e,t){var n=t[bu];n===void 0&&(n=t[bu]=new Set);var r=e+"__bubble";n.has(r)||(Qp(t,e,2,!1),n.add(r))}function wu(e,t,n){var r=0;t&&(r|=4),Qp(n,e,r,t)}var Us="_reactListening"+Math.random().toString(36).slice(2);function ci(e){if(!e[Us]){e[Us]=!0,If.forEach(function(n){n!=="selectionchange"&&(US.has(n)||wu(n,!1,e),wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Us]||(t[Us]=!0,wu("selectionchange",!1,t))}}function Qp(e,t,n,r){switch(yp(t)){case 1:var o=qE;break;case 4:o=ZE;break;default:o=iu}n=o.bind(null,t,n,e),o=void 0,!ql||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ru(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=or(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}ep(function(){var u=i,c=Kl(n),d=[];e:{var f=Yp.get(e);if(f!==void 0){var h=lu,m=e;switch(e){case"keypress":if(As(n)===0)break e;case"keydown":case"keyup":h=pS;break;case"focusin":m="focus",h=du;break;case"focusout":m="blur",h=du;break;case"beforeblur":case"afterblur":h=du;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=_p;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=tS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=mS;break;case $p:case zp:case Hp:h=oS;break;case jp:h=yS;break;case"scroll":h=JE;break;case"wheel":h=SS;break;case"copy":case"cut":case"paste":h=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Rp}var v=(t&4)!==0,E=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,S;g!==null;){S=g;var _=S.stateNode;if(S.tag===5&&_!==null&&(S=_,p!==null&&(_=Go(g,p),_!=null&&v.push(di(g,_,S)))),E)break;g=g.return}0<v.length&&(f=new h(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==Wl&&(m=n.relatedTarget||n.fromElement)&&(or(m)||m[tn]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(m=n.relatedTarget||n.toElement,h=u,m=m?or(m):null,m!==null&&(E=rr(m),m!==E||m.tag!==5&&m.tag!==6)&&(m=null)):(h=null,m=u),h!==m)){if(v=_p,_="onMouseLeave",p="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rp,_="onPointerLeave",p="onPointerEnter",g="pointer"),E=h==null?f:qr(h),S=m==null?f:qr(m),f=new v(_,g+"leave",h,n,c),f.target=E,f.relatedTarget=S,_=null,or(c)===u&&(v=new v(p,g+"enter",m,n,c),v.target=S,v.relatedTarget=E,_=v),E=_,h&&m)t:{for(v=h,p=m,g=0,S=v;S;S=Qr(S))g++;for(S=0,_=p;_;_=Qr(_))S++;for(;0<g-S;)v=Qr(v),g--;for(;0<S-g;)p=Qr(p),S--;for(;g--;){if(v===p||p!==null&&v===p.alternate)break t;v=Qr(v),p=Qr(p)}v=null}else v=null;h!==null&&Xp(d,f,h,v,!1),m!==null&&E!==null&&Xp(d,E,m,v,!0)}}e:{if(f=u?qr(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var w=TS;else if(bp(f))if(Ap)w=AS;else{w=bS;var R=CS}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=IS);if(w&&(w=w(e,u))){Ip(d,w,n,c);break e}R&&R(e,f,u),e==="focusout"&&(R=f._wrapperState)&&R.controlled&&f.type==="number"&&zl(f,"number",f.value)}switch(R=u?qr(u):window,e){case"focusin":(bp(R)||R.contentEditable==="true")&&(Wr=R,vu=u,li=null);break;case"focusout":li=vu=Wr=null;break;case"mousedown":yu=!0;break;case"contextmenu":case"mouseup":case"dragend":yu=!1,Vp(d,n,c);break;case"selectionchange":if(kS)break;case"keydown":case"keyup":Vp(d,n,c)}var C;if(pu)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Gr?Tp(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Np&&n.locale!=="ko"&&(Gr||A!=="onCompositionStart"?A==="onCompositionEnd"&&Gr&&(C=Ep()):(Rn=c,au="value"in Rn?Rn.value:Rn.textContent,Gr=!0)),R=Fs(u,A),0<R.length&&(A=new wp(A,e,null,n,c),d.push({event:A,listeners:R}),C?A.data=C:(C=Cp(n),C!==null&&(A.data=C)))),(C=wS?RS(e,n):NS(e,n))&&(u=Fs(u,"onBeforeInput"),0<u.length&&(c=new wp("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}Kp(d,t)})}function di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Go(e,n),i!=null&&r.unshift(di(e,i,o)),i=Go(e,t),i!=null&&r.push(di(e,i,o))),e=e.return}return r}function Qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=Go(n,i),l!=null&&s.unshift(di(n,l,a))):o||(l=Go(n,i),l!=null&&s.push(di(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var FS=/\r\n?/g,VS=/\u0000|\uFFFD/g;function qp(e){return(typeof e=="string"?e:""+e).replace(FS,`
|
|
42
|
-
`).replace(VS,"")}function Vs(e,t,n){if(t=qp(t),qp(e)!==t&&n)throw Error(H(425))}function Bs(){}var Nu=null,Ou=null;function xu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tu=typeof setTimeout=="function"?setTimeout:void 0,BS=typeof clearTimeout=="function"?clearTimeout:void 0,Zp=typeof Promise=="function"?Promise:void 0,$S=typeof queueMicrotask=="function"?queueMicrotask:typeof Zp<"u"?function(e){return Zp.resolve(null).then(e).catch(zS)}:Tu;function zS(e){setTimeout(function(){throw e})}function Cu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ti(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ti(t)}function On(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Xr=Math.random().toString(36).slice(2),Vt="__reactFiber$"+Xr,fi="__reactProps$"+Xr,tn="__reactContainer$"+Xr,bu="__reactEvents$"+Xr,HS="__reactListeners$"+Xr,jS="__reactHandles$"+Xr;function or(e){var t=e[Vt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tn]||n[Vt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jp(e);e!==null;){if(n=e[Vt])return n;e=Jp(e)}return t}e=n,n=e.parentNode}return null}function pi(e){return e=e[Vt]||e[tn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function qr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function $s(e){return e[fi]||null}var Iu=[],Zr=-1;function xn(e){return{current:e}}function ae(e){0>Zr||(e.current=Iu[Zr],Iu[Zr]=null,Zr--)}function ie(e,t){Zr++,Iu[Zr]=e.current,e.current=t}var Tn={},ke=xn(Tn),Ge=xn(!1),ir=Tn;function Jr(e,t){var n=e.type.contextTypes;if(!n)return Tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function We(e){return e=e.childContextTypes,e!=null}function zs(){ae(Ge),ae(ke)}function eh(e,t,n){if(ke.current!==Tn)throw Error(H(168));ie(ke,t),ie(Ge,n)}function th(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,CE(e)||"Unknown",o));return fe({},n,r)}function Hs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Tn,ir=ke.current,ie(ke,e),ie(Ge,Ge.current),!0}function nh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=th(e,t,ir),r.__reactInternalMemoizedMergedChildContext=e,ae(Ge),ae(ke),ie(ke,e)):ae(Ge),ie(Ge,n)}var nn=null,js=!1,Au=!1;function rh(e){nn===null?nn=[e]:nn.push(e)}function YS(e){js=!0,rh(e)}function Cn(){if(!Au&&nn!==null){Au=!0;var e=0,t=re;try{var n=nn;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}nn=null,js=!1}catch(o){throw nn!==null&&(nn=nn.slice(e+1)),ip(Jl,Cn),o}finally{re=t,Au=!1}}return null}var eo=[],to=0,Ys=null,Gs=0,ht=[],gt=0,sr=null,rn=1,on="";function ar(e,t){eo[to++]=Gs,eo[to++]=Ys,Ys=e,Gs=t}function oh(e,t,n){ht[gt++]=rn,ht[gt++]=on,ht[gt++]=sr,sr=e;var r=rn;e=on;var o=32-Nt(r)-1;r&=~(1<<o),n+=1;var i=32-Nt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,rn=1<<32-Nt(t)+o|n<<o|r,on=i+e}else rn=1<<i|n<<o|r,on=e}function Lu(e){e.return!==null&&(ar(e,1),oh(e,1,0))}function Du(e){for(;e===Ys;)Ys=eo[--to],eo[to]=null,Gs=eo[--to],eo[to]=null;for(;e===sr;)sr=ht[--gt],ht[gt]=null,on=ht[--gt],ht[gt]=null,rn=ht[--gt],ht[gt]=null}var st=null,at=null,ce=!1,xt=null;function ih(e,t){var n=Et(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,st=e,at=On(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,st=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sr!==null?{id:rn,overflow:on}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Et(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,st=e,at=null,!0):!1;default:return!1}}function ku(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Pu(e){if(ce){var t=at;if(t){var n=t;if(!sh(e,t)){if(ku(e))throw Error(H(418));t=On(n.nextSibling);var r=st;t&&sh(e,t)?ih(r,n):(e.flags=e.flags&-4097|2,ce=!1,st=e)}}else{if(ku(e))throw Error(H(418));e.flags=e.flags&-4097|2,ce=!1,st=e}}}function ah(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;st=e}function Ws(e){if(e!==st)return!1;if(!ce)return ah(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!xu(e.type,e.memoizedProps)),t&&(t=at)){if(ku(e))throw lh(),Error(H(418));for(;t;)ih(e,t),t=On(t.nextSibling)}if(ah(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=On(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=st?On(e.stateNode.nextSibling):null;return!0}function lh(){for(var e=at;e;)e=On(e.nextSibling)}function no(){at=st=null,ce=!1}function Mu(e){xt===null?xt=[e]:xt.push(e)}var GS=en.ReactCurrentBatchConfig;function Tt(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Ks=xn(null),Qs=null,ro=null,Uu=null;function Fu(){Uu=ro=Qs=null}function Vu(e){var t=Ks.current;ae(Ks),e._currentValue=t}function Bu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function oo(e,t){Qs=e,Uu=ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function mt(e){var t=e._currentValue;if(Uu!==e)if(e={context:e,memoizedValue:t,next:null},ro===null){if(Qs===null)throw Error(H(308));ro=e,Qs.dependencies={lanes:0,firstContext:e}}else ro=ro.next=e;return t}var lr=null;function $u(e){lr===null?lr=[e]:lr.push(e)}function uh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,$u(t)):(n.next=o.next,o.next=n),t.interleaved=n,sn(e,r)}function sn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bn=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ch(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 an(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function In(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,sn(e,n)}return o=r.interleaved,o===null?(t.next=t,$u(r)):(t.next=o.next,o.next=t),r.interleaved=t,sn(e,n)}function Xs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}function dh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qs(e,t,n,r){var o=e.updateQueue;bn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==s&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(f=t,h=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(h,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(h,d,f):m,f==null)break e;d=fe({},d,f);break e;case 2:bn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(1);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);dr|=s,e.lanes=s,e.memoizedState=d}}function fh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var ph=new bf.Component().refs;function Hu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zs={isMounted:function(e){return(e=e._reactInternals)?rr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ze(),o=kn(e),i=an(r,o);i.payload=t,n!=null&&(i.callback=n),t=In(e,i,o),t!==null&&(It(t,e,o,r),Xs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ze(),o=kn(e),i=an(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=In(e,i,o),t!==null&&(It(t,e,o,r),Xs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ze(),r=kn(e),o=an(n,r);o.tag=2,t!=null&&(o.callback=t),t=In(e,o,r),t!==null&&(It(t,e,r,n),Xs(t,e,r))}};function hh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ai(n,r)||!ai(o,i):!0}function gh(e,t,n){var r=!1,o=Tn,i=t.contextType;return typeof i=="object"&&i!==null?i=mt(i):(o=We(t)?ir:ke.current,r=t.contextTypes,i=(r=r!=null)?Jr(e,o):Tn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function mh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zs.enqueueReplaceState(t,t.state,null)}function ju(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=ph,zu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=mt(i):(i=We(t)?ir:ke.current,o.context=Jr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Hu(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Zs.enqueueReplaceState(o,o.state,null),qs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;a===ph&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function Js(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function vh(e){var t=e._init;return t(e._payload)}function yh(e){function t(p,g){if(e){var S=p.deletions;S===null?(p.deletions=[g],p.flags|=16):S.push(g)}}function n(p,g){if(!e)return null;for(;g!==null;)t(p,g),g=g.sibling;return null}function r(p,g){for(p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function o(p,g){return p=Mn(p,g),p.index=0,p.sibling=null,p}function i(p,g,S){return p.index=S,e?(S=p.alternate,S!==null?(S=S.index,S<g?(p.flags|=2,g):S):(p.flags|=2,g)):(p.flags|=1048576,g)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,g,S,_){return g===null||g.tag!==6?(g=Tc(S,p.mode,_),g.return=p,g):(g=o(g,S),g.return=p,g)}function l(p,g,S,_){var w=S.type;return w===Br?c(p,g,S.props.children,_,S.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===vn&&vh(w)===g.type)?(_=o(g,S.props),_.ref=hi(p,g,S),_.return=p,_):(_=ya(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,_)}function u(p,g,S,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==S.containerInfo||g.stateNode.implementation!==S.implementation?(g=Cc(S,p.mode,_),g.return=p,g):(g=o(g,S.children||[]),g.return=p,g)}function c(p,g,S,_,w){return g===null||g.tag!==7?(g=gr(S,p.mode,_,w),g.return=p,g):(g=o(g,S),g.return=p,g)}function d(p,g,S){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Tc(""+g,p.mode,S),g.return=p,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case gs:return S=ya(g.type,g.key,g.props,null,p.mode,S),S.ref=hi(p,null,g),S.return=p,S;case Vr:return g=Cc(g,p.mode,S),g.return=p,g;case vn:var _=g._init;return d(p,_(g._payload),S)}if(Ho(g)||$o(g))return g=gr(g,p.mode,S,null),g.return=p,g;Js(p,g)}return null}function f(p,g,S,_){var w=g!==null?g.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:a(p,g,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case gs:return S.key===w?l(p,g,S,_):null;case Vr:return S.key===w?u(p,g,S,_):null;case vn:return w=S._init,f(p,g,w(S._payload),_)}if(Ho(S)||$o(S))return w!==null?null:c(p,g,S,_,null);Js(p,S)}return null}function h(p,g,S,_,w){if(typeof _=="string"&&_!==""||typeof _=="number")return p=p.get(S)||null,a(g,p,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case gs:return p=p.get(_.key===null?S:_.key)||null,l(g,p,_,w);case Vr:return p=p.get(_.key===null?S:_.key)||null,u(g,p,_,w);case vn:var R=_._init;return h(p,g,S,R(_._payload),w)}if(Ho(_)||$o(_))return p=p.get(S)||null,c(g,p,_,w,null);Js(g,_)}return null}function m(p,g,S,_){for(var w=null,R=null,C=g,A=g=0,B=null;C!==null&&A<S.length;A++){C.index>A?(B=C,C=null):B=C.sibling;var b=f(p,C,S[A],_);if(b===null){C===null&&(C=B);break}e&&C&&b.alternate===null&&t(p,C),g=i(b,g,A),R===null?w=b:R.sibling=b,R=b,C=B}if(A===S.length)return n(p,C),ce&&ar(p,A),w;if(C===null){for(;A<S.length;A++)C=d(p,S[A],_),C!==null&&(g=i(C,g,A),R===null?w=C:R.sibling=C,R=C);return ce&&ar(p,A),w}for(C=r(p,C);A<S.length;A++)B=h(C,p,A,S[A],_),B!==null&&(e&&B.alternate!==null&&C.delete(B.key===null?A:B.key),g=i(B,g,A),R===null?w=B:R.sibling=B,R=B);return e&&C.forEach(function(V){return t(p,V)}),ce&&ar(p,A),w}function v(p,g,S,_){var w=$o(S);if(typeof w!="function")throw Error(H(150));if(S=w.call(S),S==null)throw Error(H(151));for(var R=w=null,C=g,A=g=0,B=null,b=S.next();C!==null&&!b.done;A++,b=S.next()){C.index>A?(B=C,C=null):B=C.sibling;var V=f(p,C,b.value,_);if(V===null){C===null&&(C=B);break}e&&C&&V.alternate===null&&t(p,C),g=i(V,g,A),R===null?w=V:R.sibling=V,R=V,C=B}if(b.done)return n(p,C),ce&&ar(p,A),w;if(C===null){for(;!b.done;A++,b=S.next())b=d(p,b.value,_),b!==null&&(g=i(b,g,A),R===null?w=b:R.sibling=b,R=b);return ce&&ar(p,A),w}for(C=r(p,C);!b.done;A++,b=S.next())b=h(C,p,A,b.value,_),b!==null&&(e&&b.alternate!==null&&C.delete(b.key===null?A:b.key),g=i(b,g,A),R===null?w=b:R.sibling=b,R=b);return e&&C.forEach(function($){return t(p,$)}),ce&&ar(p,A),w}function E(p,g,S,_){if(typeof S=="object"&&S!==null&&S.type===Br&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case gs:e:{for(var w=S.key,R=g;R!==null;){if(R.key===w){if(w=S.type,w===Br){if(R.tag===7){n(p,R.sibling),g=o(R,S.props.children),g.return=p,p=g;break e}}else if(R.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===vn&&vh(w)===R.type){n(p,R.sibling),g=o(R,S.props),g.ref=hi(p,R,S),g.return=p,p=g;break e}n(p,R);break}else t(p,R);R=R.sibling}S.type===Br?(g=gr(S.props.children,p.mode,_,S.key),g.return=p,p=g):(_=ya(S.type,S.key,S.props,null,p.mode,_),_.ref=hi(p,g,S),_.return=p,p=_)}return s(p);case Vr:e:{for(R=S.key;g!==null;){if(g.key===R)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){n(p,g.sibling),g=o(g,S.children||[]),g.return=p,p=g;break e}else{n(p,g);break}else t(p,g);g=g.sibling}g=Cc(S,p.mode,_),g.return=p,p=g}return s(p);case vn:return R=S._init,E(p,g,R(S._payload),_)}if(Ho(S))return m(p,g,S,_);if($o(S))return v(p,g,S,_);Js(p,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,g!==null&&g.tag===6?(n(p,g.sibling),g=o(g,S),g.return=p,p=g):(n(p,g),g=Tc(S,p.mode,_),g.return=p,p=g),s(p)):n(p,g)}return E}var io=yh(!0),Eh=yh(!1),gi={},Bt=xn(gi),mi=xn(gi),vi=xn(gi);function ur(e){if(e===gi)throw Error(H(174));return e}function Yu(e,t){switch(ie(vi,t),ie(mi,e),ie(Bt,gi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jl(t,e)}ae(Bt),ie(Bt,t)}function so(){ae(Bt),ae(mi),ae(vi)}function Sh(e){ur(vi.current);var t=ur(Bt.current),n=jl(t,e.type);t!==n&&(ie(mi,e),ie(Bt,n))}function Gu(e){mi.current===e&&(ae(Bt),ae(mi))}var pe=xn(0);function ea(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wu=[];function Ku(){for(var e=0;e<Wu.length;e++)Wu[e]._workInProgressVersionPrimary=null;Wu.length=0}var ta=en.ReactCurrentDispatcher,Qu=en.ReactCurrentBatchConfig,cr=0,he=null,Re=null,Te=null,na=!1,yi=!1,Ei=0,WS=0;function Pe(){throw Error(H(321))}function Xu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ot(e[n],t[n]))return!1;return!0}function qu(e,t,n,r,o,i){if(cr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ta.current=e===null||e.memoizedState===null?qS:ZS,e=n(r,o),yi){i=0;do{if(yi=!1,Ei=0,25<=i)throw Error(H(301));i+=1,Te=Re=null,t.updateQueue=null,ta.current=JS,e=n(r,o)}while(yi)}if(ta.current=ia,t=Re!==null&&Re.next!==null,cr=0,Te=Re=he=null,na=!1,t)throw Error(H(300));return e}function Zu(){var e=Ei!==0;return Ei=0,e}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?he.memoizedState=Te=e:Te=Te.next=e,Te}function vt(){if(Re===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Te===null?he.memoizedState:Te.next;if(t!==null)Te=t,Re=e;else{if(e===null)throw Error(H(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Te===null?he.memoizedState=Te=e:Te=Te.next=e}return Te}function Si(e,t){return typeof t=="function"?t(e):t}function Ju(e){var t=vt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Re,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var c=u.lane;if((cr&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,he.lanes|=c,dr|=c}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,Ot(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,he.lanes|=i,dr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ec(e){var t=vt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Ot(i,t.memoizedState)||(Ke=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function _h(){}function wh(e,t){var n=he,r=vt(),o=t(),i=!Ot(r.memoizedState,o);if(i&&(r.memoizedState=o,Ke=!0),r=r.queue,tc(Oh.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Te!==null&&Te.memoizedState.tag&1){if(n.flags|=2048,_i(9,Nh.bind(null,n,r,o,t),void 0,null),Ce===null)throw Error(H(349));cr&30||Rh(n,t,o)}return o}function Rh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Nh(e,t,n,r){t.value=n,t.getSnapshot=r,xh(t)&&Th(e)}function Oh(e,t,n){return n(function(){xh(t)&&Th(e)})}function xh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ot(e,n)}catch{return!0}}function Th(e){var t=sn(e,1);t!==null&&It(t,e,1,-1)}function Ch(e){var t=$t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=XS.bind(null,he,e),[t.memoizedState,e]}function _i(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function bh(){return vt().memoizedState}function ra(e,t,n,r){var o=$t();he.flags|=e,o.memoizedState=_i(1|t,n,void 0,r===void 0?null:r)}function oa(e,t,n,r){var o=vt();r=r===void 0?null:r;var i=void 0;if(Re!==null){var s=Re.memoizedState;if(i=s.destroy,r!==null&&Xu(r,s.deps)){o.memoizedState=_i(t,n,i,r);return}}he.flags|=e,o.memoizedState=_i(1|t,n,i,r)}function Ih(e,t){return ra(8390656,8,e,t)}function tc(e,t){return oa(2048,8,e,t)}function Ah(e,t){return oa(4,2,e,t)}function Lh(e,t){return oa(4,4,e,t)}function Dh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function kh(e,t,n){return n=n!=null?n.concat([e]):null,oa(4,4,Dh.bind(null,t,e),n)}function nc(){}function Ph(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Mh(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Xu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Uh(e,t,n){return cr&21?(Ot(n,t)||(n=up(),he.lanes|=n,dr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function KS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=Qu.transition;Qu.transition={};try{e(!1),t()}finally{re=n,Qu.transition=r}}function Fh(){return vt().memoizedState}function QS(e,t,n){var r=kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Vh(e))Bh(t,n);else if(n=uh(e,t,n,r),n!==null){var o=ze();It(n,e,r,o),$h(n,t,r)}}function XS(e,t,n){var r=kn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vh(e))Bh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Ot(a,s)){var l=t.interleaved;l===null?(o.next=o,$u(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=uh(e,t,o,r),n!==null&&(o=ze(),It(n,e,r,o),$h(n,t,r))}}function Vh(e){var t=e.alternate;return e===he||t!==null&&t===he}function Bh(e,t){yi=na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $h(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nu(e,n)}}var ia={readContext:mt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},qS={readContext:mt,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Ih,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ra(4194308,4,Dh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ra(4194308,4,e,t)},useInsertionEffect:function(e,t){return ra(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();return t=n!==void 0?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=QS.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Ch,useDebugValue:nc,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Ch(!1),t=e[0];return e=KS.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,o=$t();if(ce){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ce===null)throw Error(H(349));cr&30||Rh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Ih(Oh.bind(null,r,i,e),[e]),r.flags|=2048,_i(9,Nh.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=$t(),t=Ce.identifierPrefix;if(ce){var n=on,r=rn;n=(r&~(1<<32-Nt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ei++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=WS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},ZS={readContext:mt,useCallback:Ph,useContext:mt,useEffect:tc,useImperativeHandle:kh,useInsertionEffect:Ah,useLayoutEffect:Lh,useMemo:Mh,useReducer:Ju,useRef:bh,useState:function(){return Ju(Si)},useDebugValue:nc,useDeferredValue:function(e){var t=vt();return Uh(t,Re.memoizedState,e)},useTransition:function(){var e=Ju(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:_h,useSyncExternalStore:wh,useId:Fh,unstable_isNewReconciler:!1},JS={readContext:mt,useCallback:Ph,useContext:mt,useEffect:tc,useImperativeHandle:kh,useInsertionEffect:Ah,useLayoutEffect:Lh,useMemo:Mh,useReducer:ec,useRef:bh,useState:function(){return ec(Si)},useDebugValue:nc,useDeferredValue:function(e){var t=vt();return Re===null?t.memoizedState=e:Uh(t,Re.memoizedState,e)},useTransition:function(){var e=ec(Si)[0],t=vt().memoizedState;return[e,t]},useMutableSource:_h,useSyncExternalStore:wh,useId:Fh,unstable_isNewReconciler:!1};function ao(e,t){try{var n="",r=t;do n+=TE(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
40
|
+
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
|
|
41
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{za=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Go(e):""}function LE(e){switch(e.tag){case 5:return Go(e.type);case 16:return Go("Lazy");case 13:return Go("Suspense");case 19:return Go("SuspenseList");case 0:case 2:case 15:return e=Ha(e.type,!1),e;case 11:return e=Ha(e.type.render,!1),e;case 1:return e=Ha(e.type,!0),e;default:return""}}function ja(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $r:return"Fragment";case Br:return"Portal";case Ma:return"Profiler";case Pa:return"StrictMode";case Fa:return"Suspense";case Va:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Uf:return(e.displayName||"Context")+".Consumer";case Mf:return(e._context.displayName||"Context")+".Provider";case Ua:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ba:return t=e.displayName||null,t!==null?t:ja(e.type)||"Memo";case Rn:t=e._payload,e=e._init;try{return ja(e(t))}catch{}}return null}function DE(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=t.render,e=e.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 ja(t);case 8:return t===Pa?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Nn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kE(e){var t=Bf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){e._valueTracker||(e._valueTracker=kE(e))}function $f(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Bf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ws(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ga(e,t){var n=t.checked;return he({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Nn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Hf(e,t){t=t.checked,t!=null&&ka(e,"checked",t,!1)}function Ya(e,t){Hf(e,t);var n=Nn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Wa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Wa(e,t.type,Nn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Wa(e,t,n){(t!=="number"||ws(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yo=Array.isArray;function zr(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=""+Nn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ka(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return he({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Gf(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Yo(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Nn(n)}}function Yf(e,t){var n=Nn(t.value),r=Nn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Wf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kf(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 Qa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kf(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Rs,Qf=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Rs=Rs||document.createElement("div"),Rs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Rs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ko={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},PE=["Webkit","ms","Moz","O"];Object.keys(Ko).forEach(function(e){PE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ko[t]=Ko[e]})});function Xf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ko.hasOwnProperty(e)&&Ko[e]?(""+t).trim():t+"px"}function qf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Xf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ME=he({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 Xa(e,t){if(t){if(ME[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function qa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Za=null;function Ja(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var eu=null,Hr=null,jr=null;function Zf(e){if(e=mi(e)){if(typeof eu!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Ys(t),eu(e.stateNode,e.type,t))}}function Jf(e){Hr?jr?jr.push(e):jr=[e]:Hr=e}function ep(){if(Hr){var e=Hr,t=jr;if(jr=Hr=null,Zf(e),t)for(e=0;e<t.length;e++)Zf(t[e])}}function tp(e,t){return e(t)}function np(){}var tu=!1;function rp(e,t,n){if(tu)return e(t,n);tu=!0;try{return tp(e,t,n)}finally{tu=!1,(Hr!==null||jr!==null)&&(np(),ep())}}function Qo(e,t){var n=e.stateNode;if(n===null)return null;var r=Ys(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var nu=!1;if(on)try{var Xo={};Object.defineProperty(Xo,"passive",{get:function(){nu=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch{nu=!1}function UE(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var qo=!1,Ns=null,Os=!1,ru=null,FE={onError:function(e){qo=!0,Ns=e}};function VE(e,t,n,r,o,i,s,l,a){qo=!1,Ns=null,UE.apply(FE,arguments)}function BE(e,t,n,r,o,i,s,l,a){if(VE.apply(this,arguments),qo){if(qo){var u=Ns;qo=!1,Ns=null}else throw Error(H(198));Os||(Os=!0,ru=u)}}function sr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function op(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ip(e){if(sr(e)!==e)throw Error(H(188))}function $E(e){var t=e.alternate;if(!t){if(t=sr(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return ip(o),e;if(i===r)return ip(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function sp(e){return e=$E(e),e!==null?lp(e):null}function lp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=lp(e);if(t!==null)return t;e=e.sibling}return null}var ap=it.unstable_scheduleCallback,up=it.unstable_cancelCallback,zE=it.unstable_shouldYield,HE=it.unstable_requestPaint,we=it.unstable_now,jE=it.unstable_getCurrentPriorityLevel,ou=it.unstable_ImmediatePriority,cp=it.unstable_UserBlockingPriority,xs=it.unstable_NormalPriority,GE=it.unstable_LowPriority,dp=it.unstable_IdlePriority,Ts=null,Ht=null;function YE(e){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Ts,e,void 0,(e.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:QE,WE=Math.log,KE=Math.LN2;function QE(e){return e>>>=0,e===0?32:31-(WE(e)/KE|0)|0}var Cs=64,bs=4194304;function Zo(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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Is(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Zo(l):(i&=s,i!==0&&(r=Zo(i)))}else s=n&~o,s!==0?r=Zo(s):i!==0&&(r=Zo(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ct(t),o=1<<n,r|=e[n],t&=~o;return r}function XE(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;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Ct(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=XE(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function iu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function fp(){var e=Cs;return Cs<<=1,!(Cs&4194240)&&(Cs=64),e}function su(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=n}function ZE(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-Ct(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function lu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ct(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var re=0;function pp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var hp,au,gp,mp,vp,uu=!1,As=[],On=null,xn=null,Tn=null,ei=new Map,ti=new Map,Cn=[],JE="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 yp(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":xn=null;break;case"mouseover":case"mouseout":Tn=null;break;case"pointerover":case"pointerout":ei.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ti.delete(t.pointerId)}}function ni(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=mi(t),t!==null&&au(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function eS(e,t,n,r,o){switch(t){case"focusin":return On=ni(On,e,t,n,r,o),!0;case"dragenter":return xn=ni(xn,e,t,n,r,o),!0;case"mouseover":return Tn=ni(Tn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ei.set(i,ni(ei.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ti.set(i,ni(ti.get(i)||null,e,t,n,r,o)),!0}return!1}function Ep(e){var t=lr(e.target);if(t!==null){var n=sr(t);if(n!==null){if(t=n.tag,t===13){if(t=op(n),t!==null){e.blockedOn=t,vp(e.priority,function(){gp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ls(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=du(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Za=r,n.target.dispatchEvent(r),Za=null}else return t=mi(n),t!==null&&au(t),e.blockedOn=n,!1;t.shift()}return!0}function Sp(e,t,n){Ls(e)&&n.delete(t)}function tS(){uu=!1,On!==null&&Ls(On)&&(On=null),xn!==null&&Ls(xn)&&(xn=null),Tn!==null&&Ls(Tn)&&(Tn=null),ei.forEach(Sp),ti.forEach(Sp)}function ri(e,t){e.blockedOn===t&&(e.blockedOn=null,uu||(uu=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,tS)))}function oi(e){function t(o){return ri(o,e)}if(0<As.length){ri(As[0],e);for(var n=1;n<As.length;n++){var r=As[n];r.blockedOn===e&&(r.blockedOn=null)}}for(On!==null&&ri(On,e),xn!==null&&ri(xn,e),Tn!==null&&ri(Tn,e),ei.forEach(t),ti.forEach(t),n=0;n<Cn.length;n++)r=Cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cn.length&&(n=Cn[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&Cn.shift()}var Gr=sn.ReactCurrentBatchConfig,Ds=!0;function nS(e,t,n,r){var o=re,i=Gr.transition;Gr.transition=null;try{re=1,cu(e,t,n,r)}finally{re=o,Gr.transition=i}}function rS(e,t,n,r){var o=re,i=Gr.transition;Gr.transition=null;try{re=4,cu(e,t,n,r)}finally{re=o,Gr.transition=i}}function cu(e,t,n,r){if(Ds){var o=du(e,t,n,r);if(o===null)Cu(e,t,r,ks,n),yp(e,r);else if(eS(o,e,t,n,r))r.stopPropagation();else if(yp(e,r),t&4&&-1<JE.indexOf(e)){for(;o!==null;){var i=mi(o);if(i!==null&&hp(i),i=du(e,t,n,r),i===null&&Cu(e,t,r,ks,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Cu(e,t,r,null,n)}}var ks=null;function du(e,t,n,r){if(ks=null,e=Ja(r),e=lr(e),e!==null)if(t=sr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=op(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ks=e,null}function _p(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(jE()){case ou:return 1;case cp:return 4;case xs:case GE:return 16;case dp:return 536870912;default:return 16}default:return 16}}var bn=null,fu=null,Ps=null;function wp(){if(Ps)return Ps;var e,t=fu,n=t.length,r,o="value"in bn?bn.value:bn.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ps=o.slice(e,1<r?1-r:void 0)}function Ms(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Us(){return!0}function Rp(){return!1}function st(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Us:Rp,this.isPropagationStopped=Rp,this}return he(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Us)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Us)},persist:function(){},isPersistent:Us}),t}var Yr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pu=st(Yr),ii=he({},Yr,{view:0,detail:0}),oS=st(ii),hu,gu,si,Fs=he({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==si&&(si&&e.type==="mousemove"?(hu=e.screenX-si.screenX,gu=e.screenY-si.screenY):gu=hu=0,si=e),hu)},movementY:function(e){return"movementY"in e?e.movementY:gu}}),Np=st(Fs),iS=he({},Fs,{dataTransfer:0}),sS=st(iS),lS=he({},ii,{relatedTarget:0}),mu=st(lS),aS=he({},Yr,{animationName:0,elapsedTime:0,pseudoElement:0}),uS=st(aS),cS=he({},Yr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dS=st(cS),fS=he({},Yr,{data:0}),Op=st(fS),pS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hS={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"},gS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gS[e])?!!t[e]:!1}function vu(){return mS}var vS=he({},ii,{key:function(e){if(e.key){var t=pS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(e){return e.type==="keypress"?Ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),yS=st(vS),ES=he({},Fs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xp=st(ES),SS=he({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),_S=st(SS),wS=he({},Yr,{propertyName:0,elapsedTime:0,pseudoElement:0}),RS=st(wS),NS=he({},Fs,{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}),OS=st(NS),xS=[9,13,27,32],yu=on&&"CompositionEvent"in window,li=null;on&&"documentMode"in document&&(li=document.documentMode);var TS=on&&"TextEvent"in window&&!li,Tp=on&&(!yu||li&&8<li&&11>=li),Cp=String.fromCharCode(32),bp=!1;function Ip(e,t){switch(e){case"keyup":return xS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ap(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function CS(e,t){switch(e){case"compositionend":return Ap(t);case"keypress":return t.which!==32?null:(bp=!0,Cp);case"textInput":return e=t.data,e===Cp&&bp?null:e;default:return null}}function bS(e,t){if(Wr)return e==="compositionend"||!yu&&Ip(e,t)?(e=wp(),Ps=fu=bn=null,Wr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Tp&&t.locale!=="ko"?null:t.data;default:return null}}var IS={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 Lp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IS[e.type]:t==="textarea"}function Dp(e,t,n,r){Jf(r),t=Hs(t,"onChange"),0<t.length&&(n=new pu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ai=null,ui=null;function AS(e){qp(e,0)}function Vs(e){var t=Zr(e);if($f(t))return e}function LS(e,t){if(e==="change")return t}var kp=!1;if(on){var Eu;if(on){var Su="oninput"in document;if(!Su){var Pp=document.createElement("div");Pp.setAttribute("oninput","return;"),Su=typeof Pp.oninput=="function"}Eu=Su}else Eu=!1;kp=Eu&&(!document.documentMode||9<document.documentMode)}function Mp(){ai&&(ai.detachEvent("onpropertychange",Up),ui=ai=null)}function Up(e){if(e.propertyName==="value"&&Vs(ui)){var t=[];Dp(t,ui,e,Ja(e)),rp(AS,t)}}function DS(e,t,n){e==="focusin"?(Mp(),ai=t,ui=n,ai.attachEvent("onpropertychange",Up)):e==="focusout"&&Mp()}function kS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vs(ui)}function PS(e,t){if(e==="click")return Vs(t)}function MS(e,t){if(e==="input"||e==="change")return Vs(t)}function US(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:US;function ci(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Aa.call(t,o)||!bt(e[o],t[o]))return!1}return!0}function Fp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vp(e,t){var n=Fp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Fp(n)}}function Bp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $p(){for(var e=window,t=ws();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ws(e.document)}return t}function _u(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function FS(e){var t=$p(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Bp(n.ownerDocument.documentElement,n)){if(r!==null&&_u(n)){if(t=r.start,e=r.end,e===void 0&&(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,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Vp(n,i);var s=Vp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var VS=on&&"documentMode"in document&&11>=document.documentMode,Kr=null,wu=null,di=null,Ru=!1;function zp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ru||Kr==null||Kr!==ws(r)||(r=Kr,"selectionStart"in r&&_u(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),di&&ci(di,r)||(di=r,r=Hs(wu,"onSelect"),0<r.length&&(t=new pu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Bs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qr={animationend:Bs("Animation","AnimationEnd"),animationiteration:Bs("Animation","AnimationIteration"),animationstart:Bs("Animation","AnimationStart"),transitionend:Bs("Transition","TransitionEnd")},Nu={},Hp={};on&&(Hp=document.createElement("div").style,"AnimationEvent"in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),"TransitionEvent"in window||delete Qr.transitionend.transition);function $s(e){if(Nu[e])return Nu[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hp)return Nu[e]=t[n];return e}var jp=$s("animationend"),Gp=$s("animationiteration"),Yp=$s("animationstart"),Wp=$s("transitionend"),Kp=new Map,Qp="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 In(e,t){Kp.set(e,t),ir(t,[e])}for(var Ou=0;Ou<Qp.length;Ou++){var xu=Qp[Ou],BS=xu.toLowerCase(),$S=xu[0].toUpperCase()+xu.slice(1);In(BS,"on"+$S)}In(jp,"onAnimationEnd"),In(Gp,"onAnimationIteration"),In(Yp,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Wp,"onTransitionEnd"),Vr("onMouseEnter",["mouseout","mouseover"]),Vr("onMouseLeave",["mouseout","mouseover"]),Vr("onPointerEnter",["pointerout","pointerover"]),Vr("onPointerLeave",["pointerout","pointerover"]),ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fi="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(" "),zS=new Set("cancel close invalid load scroll toggle".split(" ").concat(fi));function Xp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,BE(r,t,void 0,e),e.currentTarget=null}function qp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;Xp(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;Xp(o,l,u),i=a}}}if(Os)throw e=ru,Os=!1,ru=null,e}function ae(e,t){var n=t[ku];n===void 0&&(n=t[ku]=new Set);var r=e+"__bubble";n.has(r)||(Zp(t,e,2,!1),n.add(r))}function Tu(e,t,n){var r=0;t&&(r|=4),Zp(n,e,r,t)}var zs="_reactListening"+Math.random().toString(36).slice(2);function pi(e){if(!e[zs]){e[zs]=!0,Df.forEach(function(n){n!=="selectionchange"&&(zS.has(n)||Tu(n,!1,e),Tu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zs]||(t[zs]=!0,Tu("selectionchange",!1,t))}}function Zp(e,t,n,r){switch(_p(t)){case 1:var o=nS;break;case 4:o=rS;break;default:o=cu}n=o.bind(null,t,n,e),o=void 0,!nu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Cu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=lr(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}rp(function(){var u=i,c=Ja(n),d=[];e:{var f=Kp.get(e);if(f!==void 0){var p=pu,m=e;switch(e){case"keypress":if(Ms(n)===0)break e;case"keydown":case"keyup":p=yS;break;case"focusin":m="focus",p=mu;break;case"focusout":m="blur",p=mu;break;case"beforeblur":case"afterblur":p=mu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Np;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=sS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=_S;break;case jp:case Gp:case Yp:p=uS;break;case Wp:p=RS;break;case"scroll":p=oS;break;case"wheel":p=OS;break;case"copy":case"cut":case"paste":p=dS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=xp}var v=(t&4)!==0,E=!v&&e==="scroll",h=v?f!==null?f+"Capture":null:f;v=[];for(var g=u,S;g!==null;){S=g;var _=S.stateNode;if(S.tag===5&&_!==null&&(S=_,h!==null&&(_=Qo(g,h),_!=null&&v.push(hi(g,_,S)))),E)break;g=g.return}0<v.length&&(f=new p(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==Za&&(m=n.relatedTarget||n.fromElement)&&(lr(m)||m[ln]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?lr(m):null,m!==null&&(E=sr(m),m!==E||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(v=Np,_="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=xp,_="onPointerLeave",h="onPointerEnter",g="pointer"),E=p==null?f:Zr(p),S=m==null?f:Zr(m),f=new v(_,g+"leave",p,n,c),f.target=E,f.relatedTarget=S,_=null,lr(c)===u&&(v=new v(h,g+"enter",m,n,c),v.target=S,v.relatedTarget=E,_=v),E=_,p&&m)t:{for(v=p,h=m,g=0,S=v;S;S=Xr(S))g++;for(S=0,_=h;_;_=Xr(_))S++;for(;0<g-S;)v=Xr(v),g--;for(;0<S-g;)h=Xr(h),S--;for(;g--;){if(v===h||h!==null&&v===h.alternate)break t;v=Xr(v),h=Xr(h)}v=null}else v=null;p!==null&&Jp(d,f,p,v,!1),m!==null&&E!==null&&Jp(d,E,m,v,!0)}}e:{if(f=u?Zr(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var w=LS;else if(Lp(f))if(kp)w=MS;else{w=kS;var N=DS}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(w=PS);if(w&&(w=w(e,u))){Dp(d,w,n,c);break e}N&&N(e,f,u),e==="focusout"&&(N=f._wrapperState)&&N.controlled&&f.type==="number"&&Wa(f,"number",f.value)}switch(N=u?Zr(u):window,e){case"focusin":(Lp(N)||N.contentEditable==="true")&&(Kr=N,wu=u,di=null);break;case"focusout":di=wu=Kr=null;break;case"mousedown":Ru=!0;break;case"contextmenu":case"mouseup":case"dragend":Ru=!1,zp(d,n,c);break;case"selectionchange":if(VS)break;case"keydown":case"keyup":zp(d,n,c)}var C;if(yu)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Wr?Ip(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(Tp&&n.locale!=="ko"&&(Wr||L!=="onCompositionStart"?L==="onCompositionEnd"&&Wr&&(C=wp()):(bn=c,fu="value"in bn?bn.value:bn.textContent,Wr=!0)),N=Hs(u,L),0<N.length&&(L=new Op(L,e,null,n,c),d.push({event:L,listeners:N}),C?L.data=C:(C=Ap(n),C!==null&&(L.data=C)))),(C=TS?CS(e,n):bS(e,n))&&(u=Hs(u,"onBeforeInput"),0<u.length&&(c=new Op("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=C))}qp(d,t)})}function hi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Qo(e,n),i!=null&&r.unshift(hi(e,i,o)),i=Qo(e,t),i!=null&&r.push(hi(e,i,o))),e=e.return}return r}function Xr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Qo(n,i),a!=null&&s.unshift(hi(n,a,l))):o||(a=Qo(n,i),a!=null&&s.push(hi(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var HS=/\r\n?/g,jS=/\u0000|\uFFFD/g;function eh(e){return(typeof e=="string"?e:""+e).replace(HS,`
|
|
42
|
+
`).replace(jS,"")}function js(e,t,n){if(t=eh(t),eh(e)!==t&&n)throw Error(H(425))}function Gs(){}var bu=null,Iu=null;function Au(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Lu=typeof setTimeout=="function"?setTimeout:void 0,GS=typeof clearTimeout=="function"?clearTimeout:void 0,th=typeof Promise=="function"?Promise:void 0,YS=typeof queueMicrotask=="function"?queueMicrotask:typeof th<"u"?function(e){return th.resolve(null).then(e).catch(WS)}:Lu;function WS(e){setTimeout(function(){throw e})}function Du(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),oi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);oi(t)}function An(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function nh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var qr=Math.random().toString(36).slice(2),jt="__reactFiber$"+qr,gi="__reactProps$"+qr,ln="__reactContainer$"+qr,ku="__reactEvents$"+qr,KS="__reactListeners$"+qr,QS="__reactHandles$"+qr;function lr(e){var t=e[jt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ln]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=nh(e);e!==null;){if(n=e[jt])return n;e=nh(e)}return t}e=n,n=e.parentNode}return null}function mi(e){return e=e[jt]||e[ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Zr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Ys(e){return e[gi]||null}var Pu=[],Jr=-1;function Ln(e){return{current:e}}function ue(e){0>Jr||(e.current=Pu[Jr],Pu[Jr]=null,Jr--)}function le(e,t){Jr++,Pu[Jr]=e.current,e.current=t}var Dn={},Me=Ln(Dn),Qe=Ln(!1),ar=Dn;function eo(e,t){var n=e.type.contextTypes;if(!n)return Dn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Xe(e){return e=e.childContextTypes,e!=null}function Ws(){ue(Qe),ue(Me)}function rh(e,t,n){if(Me.current!==Dn)throw Error(H(168));le(Me,t),le(Qe,n)}function oh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,DE(e)||"Unknown",o));return he({},n,r)}function Ks(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Dn,ar=Me.current,le(Me,e),le(Qe,Qe.current),!0}function ih(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=oh(e,t,ar),r.__reactInternalMemoizedMergedChildContext=e,ue(Qe),ue(Me),le(Me,e)):ue(Qe),le(Qe,n)}var an=null,Qs=!1,Mu=!1;function sh(e){an===null?an=[e]:an.push(e)}function XS(e){Qs=!0,sh(e)}function kn(){if(!Mu&&an!==null){Mu=!0;var e=0,t=re;try{var n=an;for(re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}an=null,Qs=!1}catch(o){throw an!==null&&(an=an.slice(e+1)),ap(ou,kn),o}finally{re=t,Mu=!1}}return null}var to=[],no=0,Xs=null,qs=0,vt=[],yt=0,ur=null,un=1,cn="";function cr(e,t){to[no++]=qs,to[no++]=Xs,Xs=e,qs=t}function lh(e,t,n){vt[yt++]=un,vt[yt++]=cn,vt[yt++]=ur,ur=e;var r=un;e=cn;var o=32-Ct(r)-1;r&=~(1<<o),n+=1;var i=32-Ct(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,un=1<<32-Ct(t)+o|n<<o|r,cn=i+e}else un=1<<i|n<<o|r,cn=e}function Uu(e){e.return!==null&&(cr(e,1),lh(e,1,0))}function Fu(e){for(;e===Xs;)Xs=to[--no],to[no]=null,qs=to[--no],to[no]=null;for(;e===ur;)ur=vt[--yt],vt[yt]=null,cn=vt[--yt],vt[yt]=null,un=vt[--yt],vt[yt]=null}var lt=null,at=null,fe=!1,It=null;function ah(e,t){var n=wt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function uh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,lt=e,at=An(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ur!==null?{id:un,overflow:cn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=wt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,lt=e,at=null,!0):!1;default:return!1}}function Vu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Bu(e){if(fe){var t=at;if(t){var n=t;if(!uh(e,t)){if(Vu(e))throw Error(H(418));t=An(n.nextSibling);var r=lt;t&&uh(e,t)?ah(r,n):(e.flags=e.flags&-4097|2,fe=!1,lt=e)}}else{if(Vu(e))throw Error(H(418));e.flags=e.flags&-4097|2,fe=!1,lt=e}}}function ch(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function Zs(e){if(e!==lt)return!1;if(!fe)return ch(e),fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Au(e.type,e.memoizedProps)),t&&(t=at)){if(Vu(e))throw dh(),Error(H(418));for(;t;)ah(e,t),t=An(t.nextSibling)}if(ch(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=An(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=lt?An(e.stateNode.nextSibling):null;return!0}function dh(){for(var e=at;e;)e=An(e.nextSibling)}function ro(){at=lt=null,fe=!1}function $u(e){It===null?It=[e]:It.push(e)}var qS=sn.ReactCurrentBatchConfig;function At(e,t){if(e&&e.defaultProps){t=he({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Js=Ln(null),el=null,oo=null,zu=null;function Hu(){zu=oo=el=null}function ju(e){var t=Js.current;ue(Js),e._currentValue=t}function Gu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function io(e,t){el=e,zu=oo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qe=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(zu!==e)if(e={context:e,memoizedValue:t,next:null},oo===null){if(el===null)throw Error(H(308));oo=e,el.dependencies={lanes:0,firstContext:e}}else oo=oo.next=e;return t}var dr=null;function Yu(e){dr===null?dr=[e]:dr.push(e)}function fh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yu(t)):(n.next=o.next,o.next=n),t.interleaved=n,dn(e,r)}function dn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Pn=!1;function Wu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ph(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 fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,dn(e,n)}return o=r.interleaved,o===null?(t.next=t,Yu(r)):(t.next=o.next,o.next=t),r.interleaved=t,dn(e,n)}function tl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lu(e,n)}}function hh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nl(e,t,n,r){var o=e.updateQueue;Pn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,p=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,v=l;switch(f=t,p=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=he({},d,f);break e;case 2:Pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=d):c=c.next=p,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(1);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);hr|=s,e.lanes=s,e.memoizedState=d}}function gh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var mh=new Lf.Component().refs;function Ku(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:he({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rl={isMounted:function(e){return(e=e._reactInternals)?sr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=je(),o=Bn(e),i=fn(r,o);i.payload=t,n!=null&&(i.callback=n),t=Mn(e,i,o),t!==null&&(kt(t,e,o,r),tl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=je(),o=Bn(e),i=fn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Mn(e,i,o),t!==null&&(kt(t,e,o,r),tl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=je(),r=Bn(e),o=fn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Mn(e,o,r),t!==null&&(kt(t,e,r,n),tl(t,e,r))}};function vh(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!ci(n,r)||!ci(o,i):!0}function yh(e,t,n){var r=!1,o=Dn,i=t.contextType;return typeof i=="object"&&i!==null?i=Et(i):(o=Xe(t)?ar:Me.current,r=t.contextTypes,i=(r=r!=null)?eo(e,o):Dn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Eh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&rl.enqueueReplaceState(t,t.state,null)}function Qu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=mh,Wu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Et(i):(i=Xe(t)?ar:Me.current,o.context=eo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ku(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&rl.enqueueReplaceState(o,o.state,null),nl(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function vi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===mh&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function ol(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sh(e){var t=e._init;return t(e._payload)}function _h(e){function t(h,g){if(e){var S=h.deletions;S===null?(h.deletions=[g],h.flags|=16):S.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function o(h,g){return h=zn(h,g),h.index=0,h.sibling=null,h}function i(h,g,S){return h.index=S,e?(S=h.alternate,S!==null?(S=S.index,S<g?(h.flags|=2,g):S):(h.flags|=2,g)):(h.flags|=1048576,g)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function l(h,g,S,_){return g===null||g.tag!==6?(g=Lc(S,h.mode,_),g.return=h,g):(g=o(g,S),g.return=h,g)}function a(h,g,S,_){var w=S.type;return w===$r?c(h,g,S.props.children,_,S.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Rn&&Sh(w)===g.type)?(_=o(g,S.props),_.ref=vi(h,g,S),_.return=h,_):(_=Rl(S.type,S.key,S.props,null,h.mode,_),_.ref=vi(h,g,S),_.return=h,_)}function u(h,g,S,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==S.containerInfo||g.stateNode.implementation!==S.implementation?(g=Dc(S,h.mode,_),g.return=h,g):(g=o(g,S.children||[]),g.return=h,g)}function c(h,g,S,_,w){return g===null||g.tag!==7?(g=yr(S,h.mode,_,w),g.return=h,g):(g=o(g,S),g.return=h,g)}function d(h,g,S){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Lc(""+g,h.mode,S),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Ss:return S=Rl(g.type,g.key,g.props,null,h.mode,S),S.ref=vi(h,null,g),S.return=h,S;case Br:return g=Dc(g,h.mode,S),g.return=h,g;case Rn:var _=g._init;return d(h,_(g._payload),S)}if(Yo(g)||jo(g))return g=yr(g,h.mode,S,null),g.return=h,g;ol(h,g)}return null}function f(h,g,S,_){var w=g!==null?g.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return w!==null?null:l(h,g,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ss:return S.key===w?a(h,g,S,_):null;case Br:return S.key===w?u(h,g,S,_):null;case Rn:return w=S._init,f(h,g,w(S._payload),_)}if(Yo(S)||jo(S))return w!==null?null:c(h,g,S,_,null);ol(h,S)}return null}function p(h,g,S,_,w){if(typeof _=="string"&&_!==""||typeof _=="number")return h=h.get(S)||null,l(g,h,""+_,w);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ss:return h=h.get(_.key===null?S:_.key)||null,a(g,h,_,w);case Br:return h=h.get(_.key===null?S:_.key)||null,u(g,h,_,w);case Rn:var N=_._init;return p(h,g,S,N(_._payload),w)}if(Yo(_)||jo(_))return h=h.get(S)||null,c(g,h,_,w,null);ol(g,_)}return null}function m(h,g,S,_){for(var w=null,N=null,C=g,L=g=0,B=null;C!==null&&L<S.length;L++){C.index>L?(B=C,C=null):B=C.sibling;var I=f(h,C,S[L],_);if(I===null){C===null&&(C=B);break}e&&C&&I.alternate===null&&t(h,C),g=i(I,g,L),N===null?w=I:N.sibling=I,N=I,C=B}if(L===S.length)return n(h,C),fe&&cr(h,L),w;if(C===null){for(;L<S.length;L++)C=d(h,S[L],_),C!==null&&(g=i(C,g,L),N===null?w=C:N.sibling=C,N=C);return fe&&cr(h,L),w}for(C=r(h,C);L<S.length;L++)B=p(C,h,L,S[L],_),B!==null&&(e&&B.alternate!==null&&C.delete(B.key===null?L:B.key),g=i(B,g,L),N===null?w=B:N.sibling=B,N=B);return e&&C.forEach(function(V){return t(h,V)}),fe&&cr(h,L),w}function v(h,g,S,_){var w=jo(S);if(typeof w!="function")throw Error(H(150));if(S=w.call(S),S==null)throw Error(H(151));for(var N=w=null,C=g,L=g=0,B=null,I=S.next();C!==null&&!I.done;L++,I=S.next()){C.index>L?(B=C,C=null):B=C.sibling;var V=f(h,C,I.value,_);if(V===null){C===null&&(C=B);break}e&&C&&V.alternate===null&&t(h,C),g=i(V,g,L),N===null?w=V:N.sibling=V,N=V,C=B}if(I.done)return n(h,C),fe&&cr(h,L),w;if(C===null){for(;!I.done;L++,I=S.next())I=d(h,I.value,_),I!==null&&(g=i(I,g,L),N===null?w=I:N.sibling=I,N=I);return fe&&cr(h,L),w}for(C=r(h,C);!I.done;L++,I=S.next())I=p(C,h,L,I.value,_),I!==null&&(e&&I.alternate!==null&&C.delete(I.key===null?L:I.key),g=i(I,g,L),N===null?w=I:N.sibling=I,N=I);return e&&C.forEach(function($){return t(h,$)}),fe&&cr(h,L),w}function E(h,g,S,_){if(typeof S=="object"&&S!==null&&S.type===$r&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Ss:e:{for(var w=S.key,N=g;N!==null;){if(N.key===w){if(w=S.type,w===$r){if(N.tag===7){n(h,N.sibling),g=o(N,S.props.children),g.return=h,h=g;break e}}else if(N.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Rn&&Sh(w)===N.type){n(h,N.sibling),g=o(N,S.props),g.ref=vi(h,N,S),g.return=h,h=g;break e}n(h,N);break}else t(h,N);N=N.sibling}S.type===$r?(g=yr(S.props.children,h.mode,_,S.key),g.return=h,h=g):(_=Rl(S.type,S.key,S.props,null,h.mode,_),_.ref=vi(h,g,S),_.return=h,h=_)}return s(h);case Br:e:{for(N=S.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){n(h,g.sibling),g=o(g,S.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=Dc(S,h.mode,_),g.return=h,h=g}return s(h);case Rn:return N=S._init,E(h,g,N(S._payload),_)}if(Yo(S))return m(h,g,S,_);if(jo(S))return v(h,g,S,_);ol(h,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,g!==null&&g.tag===6?(n(h,g.sibling),g=o(g,S),g.return=h,h=g):(n(h,g),g=Lc(S,h.mode,_),g.return=h,h=g),s(h)):n(h,g)}return E}var so=_h(!0),wh=_h(!1),yi={},Gt=Ln(yi),Ei=Ln(yi),Si=Ln(yi);function fr(e){if(e===yi)throw Error(H(174));return e}function Xu(e,t){switch(le(Si,t),le(Ei,e),le(Gt,yi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qa(t,e)}ue(Gt),le(Gt,t)}function lo(){ue(Gt),ue(Ei),ue(Si)}function Rh(e){fr(Si.current);var t=fr(Gt.current),n=Qa(t,e.type);t!==n&&(le(Ei,e),le(Gt,n))}function qu(e){Ei.current===e&&(ue(Gt),ue(Ei))}var ge=Ln(0);function il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zu=[];function Ju(){for(var e=0;e<Zu.length;e++)Zu[e]._workInProgressVersionPrimary=null;Zu.length=0}var sl=sn.ReactCurrentDispatcher,ec=sn.ReactCurrentBatchConfig,pr=0,me=null,xe=null,Ie=null,ll=!1,_i=!1,wi=0,ZS=0;function Ue(){throw Error(H(321))}function tc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function nc(e,t,n,r,o,i){if(pr=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,sl.current=e===null||e.memoizedState===null?n_:r_,e=n(r,o),_i){i=0;do{if(_i=!1,wi=0,25<=i)throw Error(H(301));i+=1,Ie=xe=null,t.updateQueue=null,sl.current=o_,e=n(r,o)}while(_i)}if(sl.current=cl,t=xe!==null&&xe.next!==null,pr=0,Ie=xe=me=null,ll=!1,t)throw Error(H(300));return e}function rc(){var e=wi!==0;return wi=0,e}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?me.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function St(){if(xe===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=xe.next;var t=Ie===null?me.memoizedState:Ie.next;if(t!==null)Ie=t,xe=e;else{if(e===null)throw Error(H(310));xe=e,e={memoizedState:xe.memoizedState,baseState:xe.baseState,baseQueue:xe.baseQueue,queue:xe.queue,next:null},Ie===null?me.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Ri(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=St(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=xe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((pr&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,me.lanes|=c,hr|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,bt(r,t.memoizedState)||(qe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,me.lanes|=i,hr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ic(e){var t=St(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);bt(i,t.memoizedState)||(qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Nh(){}function Oh(e,t){var n=me,r=St(),o=t(),i=!bt(r.memoizedState,o);if(i&&(r.memoizedState=o,qe=!0),r=r.queue,sc(Ch.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ie!==null&&Ie.memoizedState.tag&1){if(n.flags|=2048,Ni(9,Th.bind(null,n,r,o,t),void 0,null),Ae===null)throw Error(H(349));pr&30||xh(n,t,o)}return o}function xh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Th(e,t,n,r){t.value=n,t.getSnapshot=r,bh(t)&&Ih(e)}function Ch(e,t,n){return n(function(){bh(t)&&Ih(e)})}function bh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function Ih(e){var t=dn(e,1);t!==null&&kt(t,e,1,-1)}function Ah(e){var t=Yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},t.queue=e,e=e.dispatch=t_.bind(null,me,e),[t.memoizedState,e]}function Ni(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Lh(){return St().memoizedState}function al(e,t,n,r){var o=Yt();me.flags|=e,o.memoizedState=Ni(1|t,n,void 0,r===void 0?null:r)}function ul(e,t,n,r){var o=St();r=r===void 0?null:r;var i=void 0;if(xe!==null){var s=xe.memoizedState;if(i=s.destroy,r!==null&&tc(r,s.deps)){o.memoizedState=Ni(t,n,i,r);return}}me.flags|=e,o.memoizedState=Ni(1|t,n,i,r)}function Dh(e,t){return al(8390656,8,e,t)}function sc(e,t){return ul(2048,8,e,t)}function kh(e,t){return ul(4,2,e,t)}function Ph(e,t){return ul(4,4,e,t)}function Mh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Uh(e,t,n){return n=n!=null?n.concat([e]):null,ul(4,4,Mh.bind(null,t,e),n)}function lc(){}function Fh(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vh(e,t){var n=St();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Bh(e,t,n){return pr&21?(bt(n,t)||(n=fp(),me.lanes|=n,hr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qe=!0),e.memoizedState=n)}function JS(e,t){var n=re;re=n!==0&&4>n?n:4,e(!0);var r=ec.transition;ec.transition={};try{e(!1),t()}finally{re=n,ec.transition=r}}function $h(){return St().memoizedState}function e_(e,t,n){var r=Bn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},zh(e))Hh(t,n);else if(n=fh(e,t,n,r),n!==null){var o=je();kt(n,e,r,o),jh(n,t,r)}}function t_(e,t,n){var r=Bn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(zh(e))Hh(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,bt(l,s)){var a=t.interleaved;a===null?(o.next=o,Yu(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=fh(e,t,o,r),n!==null&&(o=je(),kt(n,e,r,o),jh(n,t,r))}}function zh(e){var t=e.alternate;return e===me||t!==null&&t===me}function Hh(e,t){_i=ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function jh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lu(e,n)}}var cl={readContext:Et,useCallback:Ue,useContext:Ue,useEffect:Ue,useImperativeHandle:Ue,useInsertionEffect:Ue,useLayoutEffect:Ue,useMemo:Ue,useReducer:Ue,useRef:Ue,useState:Ue,useDebugValue:Ue,useDeferredValue:Ue,useTransition:Ue,useMutableSource:Ue,useSyncExternalStore:Ue,useId:Ue,unstable_isNewReconciler:!1},n_={readContext:Et,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Dh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,al(4194308,4,Mh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return al(4194308,4,e,t)},useInsertionEffect:function(e,t){return al(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();return t=n!==void 0?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=e_.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:Ah,useDebugValue:lc,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=Ah(!1),t=e[0];return e=JS.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=Yt();if(fe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Ae===null)throw Error(H(349));pr&30||xh(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Dh(Ch.bind(null,r,i,e),[e]),r.flags|=2048,Ni(9,Th.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Yt(),t=Ae.identifierPrefix;if(fe){var n=cn,r=un;n=(r&~(1<<32-Ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ZS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},r_={readContext:Et,useCallback:Fh,useContext:Et,useEffect:sc,useImperativeHandle:Uh,useInsertionEffect:kh,useLayoutEffect:Ph,useMemo:Vh,useReducer:oc,useRef:Lh,useState:function(){return oc(Ri)},useDebugValue:lc,useDeferredValue:function(e){var t=St();return Bh(t,xe.memoizedState,e)},useTransition:function(){var e=oc(Ri)[0],t=St().memoizedState;return[e,t]},useMutableSource:Nh,useSyncExternalStore:Oh,useId:$h,unstable_isNewReconciler:!1},o_={readContext:Et,useCallback:Fh,useContext:Et,useEffect:sc,useImperativeHandle:Uh,useInsertionEffect:kh,useLayoutEffect:Ph,useMemo:Vh,useReducer:ic,useRef:Lh,useState:function(){return ic(Ri)},useDebugValue:lc,useDeferredValue:function(e){var t=St();return xe===null?t.memoizedState=e:Bh(t,xe.memoizedState,e)},useTransition:function(){var e=ic(Ri)[0],t=St().memoizedState;return[e,t]},useMutableSource:Nh,useSyncExternalStore:Oh,useId:$h,unstable_isNewReconciler:!1};function ao(e,t){try{var n="",r=t;do n+=LE(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
43
43
|
Error generating stack: `+i.message+`
|
|
44
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function oc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var e_=typeof WeakMap=="function"?WeakMap:Map;function zh(e,t,n){n=an(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fa||(fa=!0,Ec=r),oc(e,t)},n}function Hh(e,t,n){n=an(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){oc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){oc(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function jh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new e_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=h_.bind(null,e,t,n),t.then(e,e))}function Yh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Gh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=an(-1,1),t.tag=2,In(n,t,1))),n.lanes|=1),e)}var t_=en.ReactCurrentOwner,Ke=!1;function $e(e,t,n,r){t.child=e===null?Eh(t,null,n,r):io(t,e.child,n,r)}function Wh(e,t,n,r,o){n=n.render;var i=t.ref;return oo(t,o),r=qu(e,t,n,r,i,o),n=Zu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ce&&n&&Lu(t),t.flags|=1,$e(e,t,r,o),t.child)}function Kh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!xc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Qh(e,t,i,r,o)):(e=ya(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(s,r)&&e.ref===t.ref)return ln(e,t,o)}return t.flags|=1,e=Mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Qh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ai(i,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,ln(e,t,o)}return ic(e,t,n,r,o)}function Xh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ie(uo,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ie(uo,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ie(uo,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ie(uo,lt),lt|=r;return $e(e,t,o,n),t.child}function qh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ic(e,t,n,r,o){var i=We(n)?ir:ke.current;return i=Jr(t,i),oo(t,o),n=qu(e,t,n,r,i,o),r=Zu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,ln(e,t,o)):(ce&&r&&Lu(t),t.flags|=1,$e(e,t,n,o),t.child)}function Zh(e,t,n,r,o){if(We(n)){var i=!0;Hs(t)}else i=!1;if(oo(t,o),t.stateNode===null)aa(e,t),gh(t,n,r),ju(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=mt(u):(u=We(n)?ir:ke.current,u=Jr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&mh(t,s,r,u),bn=!1;var f=t.memoizedState;s.state=f,qs(t,r,s,o),l=t.memoizedState,a!==r||f!==l||Ge.current||bn?(typeof c=="function"&&(Hu(t,n,c,r),l=t.memoizedState),(a=bn||hh(t,n,a,r,f,l,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ch(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Tt(t.type,a),s.props=u,d=t.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=mt(l):(l=We(n)?ir:ke.current,l=Jr(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&mh(t,s,r,l),bn=!1,f=t.memoizedState,s.state=f,qs(t,r,s,o);var m=t.memoizedState;a!==d||f!==m||Ge.current||bn?(typeof h=="function"&&(Hu(t,n,h,r),m=t.memoizedState),(u=bn||hh(t,n,u,r,f,m,l)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return sc(e,t,n,r,i,o)}function sc(e,t,n,r,o,i){qh(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&nh(t,n,!1),ln(e,t,i);r=t.stateNode,t_.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=io(t,e.child,null,i),t.child=io(t,null,a,i)):$e(e,t,a,i),t.memoizedState=r.state,o&&nh(t,n,!0),t.child}function Jh(e){var t=e.stateNode;t.pendingContext?eh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&eh(e,t.context,!1),Yu(e,t.containerInfo)}function eg(e,t,n,r,o){return no(),Mu(o),t.flags|=256,$e(e,t,n,r),t.child}var ac={dehydrated:null,treeContext:null,retryLane:0};function lc(e){return{baseLanes:e,cachePool:null,transitions:null}}function tg(e,t,n){var r=t.pendingProps,o=pe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ie(pe,o&1),e===null)return Pu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Ea(s,r,0,null),e=gr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=lc(n),t.memoizedState=ac,e):uc(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return n_(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Mn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Mn(a,i):(i=gr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?lc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=ac,r}return i=e.child,e=i.sibling,r=Mn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function uc(e,t){return t=Ea({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function sa(e,t,n,r){return r!==null&&Mu(r),io(t,e.child,null,n),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function n_(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=rc(Error(H(422))),sa(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Ea({mode:"visible",children:r.children},o,0,null),i=gr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&io(t,e.child,null,s),t.child.memoizedState=lc(s),t.memoizedState=ac,i);if(!(t.mode&1))return sa(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=rc(i,r,void 0),sa(e,t,s,r)}if(a=(s&e.childLanes)!==0,Ke||a){if(r=Ce,r!==null){switch(s&-s){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}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,sn(e,o),It(r,e,o,-1))}return Oc(),r=rc(Error(H(421))),sa(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=g_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,at=On(o.nextSibling),st=t,ce=!0,xt=null,e!==null&&(ht[gt++]=rn,ht[gt++]=on,ht[gt++]=sr,rn=e.id,on=e.overflow,sr=t),t=uc(t,r.children),t.flags|=4096,t)}function ng(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,n)}function cc(e,t,n,r,o){var i=e.memoizedState;i===null?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 rg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if($e(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ng(e,n,t);else if(e.tag===19)ng(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ie(pe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&ea(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),cc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ea(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}cc(t,!0,n,null,i);break;case"together":cc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function aa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=Mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function r_(e,t,n){switch(t.tag){case 3:Jh(t),no();break;case 5:Sh(t);break;case 1:We(t.type)&&Hs(t);break;case 4:Yu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ie(Ks,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ie(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?tg(e,t,n):(ie(pe,pe.current&1),e=ln(e,t,n),e!==null?e.sibling:null);ie(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return rg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ie(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Xh(e,t,n)}return ln(e,t,n)}var og,dc,ig,sg;og=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},dc=function(){},ig=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ur(Bt.current);var i=null;switch(n){case"input":o=Bl(e,o),r=Bl(e,r),i=[];break;case"select":o=fe({},o,{value:void 0}),r=fe({},r,{value:void 0}),i=[];break;case"textarea":o=Hl(e,o),r=Hl(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Bs)}Yl(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Bo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Bo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&se("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},sg=function(e,t,n,r){n!==r&&(t.flags|=4)};function wi(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Me(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function o_(e,t,n){var r=t.pendingProps;switch(Du(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Me(t),null;case 1:return We(t.type)&&zs(),Me(t),null;case 3:return r=t.stateNode,so(),ae(Ge),ae(ke),Ku(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ws(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xt!==null&&(wc(xt),xt=null))),dc(e,t),Me(t),null;case 5:Gu(t);var o=ur(vi.current);if(n=t.type,e!==null&&t.stateNode!=null)ig(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Me(t),null}if(e=ur(Bt.current),Ws(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Vt]=t,r[fi]=i,e=(t.mode&1)!==0,n){case"dialog":se("cancel",r),se("close",r);break;case"iframe":case"object":case"embed":se("load",r);break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],r);break;case"source":se("error",r);break;case"img":case"image":case"link":se("error",r),se("load",r);break;case"details":se("toggle",r);break;case"input":Vf(r,i),se("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},se("invalid",r);break;case"textarea":zf(r,i),se("invalid",r)}Yl(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Vs(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Vs(r.textContent,a,e),o=["children",""+a]):Bo.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&se("scroll",r)}switch(n){case"input":ms(r),$f(r,i,!0);break;case"textarea":ms(r),jf(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Bs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Yf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Vt]=t,e[fi]=r,og(e,t,!1,!1),t.stateNode=e;e:{switch(s=Gl(n,r),n){case"dialog":se("cancel",e),se("close",e),o=r;break;case"iframe":case"object":case"embed":se("load",e),o=r;break;case"video":case"audio":for(o=0;o<ui.length;o++)se(ui[o],e);o=r;break;case"source":se("error",e),o=r;break;case"img":case"image":case"link":se("error",e),se("load",e),o=r;break;case"details":se("toggle",e),o=r;break;case"input":Vf(e,r),o=Bl(e,r),se("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=fe({},r,{value:void 0}),se("invalid",e);break;case"textarea":zf(e,r),o=Hl(e,r),se("invalid",e);break;default:o=r}Yl(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Kf(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Gf(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&jo(e,l):typeof l=="number"&&jo(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Bo.hasOwnProperty(i)?l!=null&&i==="onScroll"&&se("scroll",e):l!=null&&bl(e,i,l,s))}switch(n){case"input":ms(e),$f(e,r,!1);break;case"textarea":ms(e),jf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+yn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$r(e,!!r.multiple,i,!1):r.defaultValue!=null&&$r(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Bs)}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)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Me(t),null;case 6:if(e&&t.stateNode!=null)sg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=ur(vi.current),ur(Bt.current),Ws(t)){if(r=t.stateNode,n=t.memoizedProps,r[Vt]=t,(i=r.nodeValue!==n)&&(e=st,e!==null))switch(e.tag){case 3:Vs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Vs(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Vt]=t,t.stateNode=r}return Me(t),null;case 13:if(ae(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&at!==null&&t.mode&1&&!(t.flags&128))lh(),no(),t.flags|=98560,i=!1;else if(i=Ws(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Vt]=t}else no(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Me(t),i=!1}else xt!==null&&(wc(xt),xt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||pe.current&1?Ne===0&&(Ne=3):Oc())),t.updateQueue!==null&&(t.flags|=4),Me(t),null);case 4:return so(),dc(e,t),e===null&&ci(t.stateNode.containerInfo),Me(t),null;case 10:return Vu(t.type._context),Me(t),null;case 17:return We(t.type)&&zs(),Me(t),null;case 19:if(ae(pe),i=t.memoizedState,i===null)return Me(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)wi(i,!1);else{if(Ne!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ea(e),s!==null){for(t.flags|=128,wi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(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=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ie(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&ye()>co&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304)}else{if(!r)if(e=ea(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ce)return Me(t),null}else 2*ye()-i.renderingStartTime>co&&n!==1073741824&&(t.flags|=128,r=!0,wi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ye(),t.sibling=null,n=pe.current,ie(pe,r?n&1|2:n&1),t):(Me(t),null);case 22:case 23:return Nc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Me(t),t.subtreeFlags&6&&(t.flags|=8192)):Me(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function i_(e,t){switch(Du(t),t.tag){case 1:return We(t.type)&&zs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return so(),ae(Ge),ae(ke),Ku(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gu(t),null;case 13:if(ae(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(pe),null;case 4:return so(),null;case 10:return Vu(t.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var la=!1,Ue=!1,s_=typeof WeakSet=="function"?WeakSet:Set,Y=null;function lo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ve(e,t,r)}else n.current=null}function fc(e,t,n){try{n()}catch(r){ve(e,t,r)}}var ag=!1;function a_(e,t){if(Nu=Cs,e=Fp(),mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ou={focusedElem:e,selectionRange:n},Cs=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,E=m.memoizedState,p=t.stateNode,g=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:Tt(t.type,v),E);p.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){ve(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return m=ag,ag=!1,m}function Ri(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&fc(t,n,i)}o=o.next}while(o!==r)}}function ua(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==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 pc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lg(e){var t=e.alternate;t!==null&&(e.alternate=null,lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Vt],delete t[fi],delete t[bu],delete t[HS],delete t[jS])),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 ug(e){return e.tag===5||e.tag===3||e.tag===4}function cg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ug(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bs));else if(r!==4&&(e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}var Le=null,Ct=!1;function An(e,t,n){for(n=n.child;n!==null;)dg(e,t,n),n=n.sibling}function dg(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(ws,n)}catch{}switch(n.tag){case 5:Ue||lo(n,t);case 6:var r=Le,o=Ct;Le=null,An(e,t,n),Le=r,Ct=o,Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Le.removeChild(n.stateNode));break;case 18:Le!==null&&(Ct?(e=Le,n=n.stateNode,e.nodeType===8?Cu(e.parentNode,n):e.nodeType===1&&Cu(e,n),ti(e)):Cu(Le,n.stateNode));break;case 4:r=Le,o=Ct,Le=n.stateNode.containerInfo,Ct=!0,An(e,t,n),Le=r,Ct=o;break;case 0:case 11:case 14:case 15:if(!Ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&fc(n,t,s),o=o.next}while(o!==r)}An(e,t,n);break;case 1:if(!Ue&&(lo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ve(n,t,a)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(Ue=(r=Ue)||n.memoizedState!==null,An(e,t,n),Ue=r):An(e,t,n);break;default:An(e,t,n)}}function fg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new s_),t.forEach(function(r){var o=m_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function bt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Le=a.stateNode,Ct=!1;break e;case 3:Le=a.stateNode.containerInfo,Ct=!0;break e;case 4:Le=a.stateNode.containerInfo,Ct=!0;break e}a=a.return}if(Le===null)throw Error(H(160));dg(i,s,o),Le=null,Ct=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){ve(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)pg(t,e),t=t.sibling}function pg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(bt(t,e),zt(e),r&4){try{Ri(3,e,e.return),ua(3,e)}catch(v){ve(e,e.return,v)}try{Ri(5,e,e.return)}catch(v){ve(e,e.return,v)}}break;case 1:bt(t,e),zt(e),r&512&&n!==null&&lo(n,n.return);break;case 5:if(bt(t,e),zt(e),r&512&&n!==null&&lo(n,n.return),e.flags&32){var o=e.stateNode;try{jo(o,"")}catch(v){ve(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Bf(o,i),Gl(a,s);var u=Gl(a,i);for(s=0;s<l.length;s+=2){var c=l[s],d=l[s+1];c==="style"?Kf(o,d):c==="dangerouslySetInnerHTML"?Gf(o,d):c==="children"?jo(o,d):bl(o,c,d,u)}switch(a){case"input":$l(o,i);break;case"textarea":Hf(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$r(o,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?$r(o,!!i.multiple,i.defaultValue,!0):$r(o,!!i.multiple,i.multiple?[]:"",!1))}o[fi]=i}catch(v){ve(e,e.return,v)}}break;case 6:if(bt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){ve(e,e.return,v)}}break;case 3:if(bt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ti(t.containerInfo)}catch(v){ve(e,e.return,v)}break;case 4:bt(t,e),zt(e);break;case 13:bt(t,e),zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(yc=ye())),r&4&&fg(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ue=(u=Ue)||c,bt(t,e),Ue=u):bt(t,e),zt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Y=e,c=e.child;c!==null;){for(d=Y=c;Y!==null;){switch(f=Y,h=f.child,f.tag){case 0:case 11:case 14:case 15:Ri(4,f,f.return);break;case 1:lo(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){ve(r,n,v)}}break;case 5:lo(f,f.return);break;case 22:if(f.memoizedState!==null){mg(d);continue}}h!==null?(h.return=f,Y=h):mg(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Wf("display",s))}catch(v){ve(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){ve(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:bt(t,e),zt(e),r&4&&fg(e);break;case 21:break;default:bt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ug(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(jo(o,""),r.flags&=-33);var i=cg(e);gc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=cg(e);hc(e,a,s);break;default:throw Error(H(161))}}catch(l){ve(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function l_(e,t,n){Y=e,hg(e)}function hg(e,t,n){for(var r=(e.mode&1)!==0;Y!==null;){var o=Y,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||la;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Ue;a=la;var u=Ue;if(la=s,(Ue=l)&&!u)for(Y=o;Y!==null;)s=Y,l=s.child,s.tag===22&&s.memoizedState!==null?vg(o):l!==null?(l.return=s,Y=l):vg(o);for(;i!==null;)Y=i,hg(i),i=i.sibling;Y=o,la=a,Ue=u}gg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Y=i):gg(e)}}function gg(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ue||ua(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ue)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Tt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&fh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}fh(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&ti(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ue||t.flags&512&&pc(t)}catch(f){ve(t,t.return,f)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function mg(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function vg(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ua(4,t)}catch(l){ve(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){ve(t,o,l)}}var i=t.return;try{pc(t)}catch(l){ve(t,i,l)}break;case 5:var s=t.return;try{pc(t)}catch(l){ve(t,s,l)}}}catch(l){ve(t,t.return,l)}if(t===e){Y=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Y=a;break}Y=t.return}}var u_=Math.ceil,ca=en.ReactCurrentDispatcher,mc=en.ReactCurrentOwner,yt=en.ReactCurrentBatchConfig,ne=0,Ce=null,Se=null,De=0,lt=0,uo=xn(0),Ne=0,Ni=null,dr=0,da=0,vc=0,Oi=null,Qe=null,yc=0,co=1/0,un=null,fa=!1,Ec=null,Ln=null,pa=!1,Dn=null,ha=0,xi=0,Sc=null,ga=-1,ma=0;function ze(){return ne&6?ye():ga!==-1?ga:ga=ye()}function kn(e){return e.mode&1?ne&2&&De!==0?De&-De:GS.transition!==null?(ma===0&&(ma=up()),ma):(e=re,e!==0||(e=window.event,e=e===void 0?16:yp(e.type)),e):1}function It(e,t,n,r){if(50<xi)throw xi=0,Sc=null,Error(H(185));Xo(e,n,r),(!(ne&2)||e!==Ce)&&(e===Ce&&(!(ne&2)&&(da|=n),Ne===4&&Pn(e,De)),Xe(e,r),n===1&&ne===0&&!(t.mode&1)&&(co=ye()+500,js&&Cn()))}function Xe(e,t){var n=e.callbackNode;GE(e,t);var r=Os(e,e===Ce?De:0);if(r===0)n!==null&&sp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sp(n),t===1)e.tag===0?YS(Eg.bind(null,e)):rh(Eg.bind(null,e)),$S(function(){!(ne&6)&&Cn()}),n=null;else{switch(cp(r)){case 1:n=Jl;break;case 4:n=ap;break;case 16:n=_s;break;case 536870912:n=lp;break;default:n=_s}n=Tg(n,yg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yg(e,t){if(ga=-1,ma=0,ne&6)throw Error(H(327));var n=e.callbackNode;if(fo()&&e.callbackNode!==n)return null;var r=Os(e,e===Ce?De:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=va(e,r);else{t=r;var o=ne;ne|=2;var i=_g();(Ce!==e||De!==t)&&(un=null,co=ye()+500,pr(e,t));do try{f_();break}catch(a){Sg(e,a)}while(1);Fu(),ca.current=i,ne=o,Se!==null?t=0:(Ce=null,De=0,t=Ne)}if(t!==0){if(t===2&&(o=eu(e),o!==0&&(r=o,t=_c(e,o))),t===1)throw n=Ni,pr(e,0),Pn(e,r),Xe(e,ye()),n;if(t===6)Pn(e,r);else{if(o=e.current.alternate,!(r&30)&&!c_(o)&&(t=va(e,r),t===2&&(i=eu(e),i!==0&&(r=i,t=_c(e,i))),t===1))throw n=Ni,pr(e,0),Pn(e,r),Xe(e,ye()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:hr(e,Qe,un);break;case 3:if(Pn(e,r),(r&130023424)===r&&(t=yc+500-ye(),10<t)){if(Os(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){ze(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Tu(hr.bind(null,e,Qe,un),t);break}hr(e,Qe,un);break;case 4:if(Pn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Nt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*u_(r/1960))-r,10<r){e.timeoutHandle=Tu(hr.bind(null,e,Qe,un),r);break}hr(e,Qe,un);break;case 5:hr(e,Qe,un);break;default:throw Error(H(329))}}}return Xe(e,ye()),e.callbackNode===n?yg.bind(null,e):null}function _c(e,t){var n=Oi;return e.current.memoizedState.isDehydrated&&(pr(e,t).flags|=256),e=va(e,t),e!==2&&(t=Qe,Qe=n,t!==null&&wc(t)),e}function wc(e){Qe===null?Qe=e:Qe.push.apply(Qe,e)}function c_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Ot(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Pn(e,t){for(t&=~vc,t&=~da,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Nt(t),r=1<<n;e[n]=-1,t&=~r}}function Eg(e){if(ne&6)throw Error(H(327));fo();var t=Os(e,0);if(!(t&1))return Xe(e,ye()),null;var n=va(e,t);if(e.tag!==0&&n===2){var r=eu(e);r!==0&&(t=r,n=_c(e,r))}if(n===1)throw n=Ni,pr(e,0),Pn(e,t),Xe(e,ye()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hr(e,Qe,un),Xe(e,ye()),null}function Rc(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(co=ye()+500,js&&Cn())}}function fr(e){Dn!==null&&Dn.tag===0&&!(ne&6)&&fo();var t=ne;ne|=1;var n=yt.transition,r=re;try{if(yt.transition=null,re=1,e)return e()}finally{re=r,yt.transition=n,ne=t,!(ne&6)&&Cn()}}function Nc(){lt=uo.current,ae(uo)}function pr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,BS(n)),Se!==null)for(n=Se.return;n!==null;){var r=n;switch(Du(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zs();break;case 3:so(),ae(Ge),ae(ke),Ku();break;case 5:Gu(r);break;case 4:so();break;case 13:ae(pe);break;case 19:ae(pe);break;case 10:Vu(r.type._context);break;case 22:case 23:Nc()}n=n.return}if(Ce=e,Se=e=Mn(e.current,null),De=lt=t,Ne=0,Ni=null,vc=da=dr=0,Qe=Oi=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}lr=null}return e}function Sg(e,t){do{var n=Se;try{if(Fu(),ta.current=ia,na){for(var r=he.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}na=!1}if(cr=0,Te=Re=he=null,yi=!1,Ei=0,mc.current=null,n===null||n.return===null){Ne=1,Ni=t,Se=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=De,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Yh(s);if(h!==null){h.flags&=-257,Gh(h,s,a,i,t),h.mode&1&&jh(i,u,t),t=h,l=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){jh(i,u,t),Oc();break e}l=Error(H(426))}}else if(ce&&a.mode&1){var E=Yh(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),Gh(E,s,a,i,t),Mu(ao(l,a));break e}}i=l=ao(l,a),Ne!==4&&(Ne=2),Oi===null?Oi=[i]:Oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=zh(i,l,t);dh(i,p);break e;case 1:a=l;var g=i.type,S=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ln===null||!Ln.has(S)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=Hh(i,a,t);dh(i,_);break e}}i=i.return}while(i!==null)}Rg(n)}catch(w){t=w,Se===n&&n!==null&&(Se=n=n.return);continue}break}while(1)}function _g(){var e=ca.current;return ca.current=ia,e===null?ia:e}function Oc(){(Ne===0||Ne===3||Ne===2)&&(Ne=4),Ce===null||!(dr&268435455)&&!(da&268435455)||Pn(Ce,De)}function va(e,t){var n=ne;ne|=2;var r=_g();(Ce!==e||De!==t)&&(un=null,pr(e,t));do try{d_();break}catch(o){Sg(e,o)}while(1);if(Fu(),ne=n,ca.current=r,Se!==null)throw Error(H(261));return Ce=null,De=0,Ne}function d_(){for(;Se!==null;)wg(Se)}function f_(){for(;Se!==null&&!UE();)wg(Se)}function wg(e){var t=xg(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?Rg(e):Se=t,mc.current=null}function Rg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=i_(n,t),n!==null){n.flags&=32767,Se=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ne=6,Se=null;return}}else if(n=o_(n,t,lt),n!==null){Se=n;return}if(t=t.sibling,t!==null){Se=t;return}Se=t=e}while(t!==null);Ne===0&&(Ne=5)}function hr(e,t,n){var r=re,o=yt.transition;try{yt.transition=null,re=1,p_(e,t,n,r)}finally{yt.transition=o,re=r}return null}function p_(e,t,n,r){do fo();while(Dn!==null);if(ne&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(WE(e,i),e===Ce&&(Se=Ce=null,De=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pa||(pa=!0,Tg(_s,function(){return fo(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=yt.transition,yt.transition=null;var s=re;re=1;var a=ne;ne|=4,mc.current=null,a_(e,n),pg(n,e),DS(Ou),Cs=!!Nu,Ou=Nu=null,e.current=n,l_(n),FE(),ne=a,re=s,yt.transition=i}else e.current=n;if(pa&&(pa=!1,Dn=e,ha=o),i=e.pendingLanes,i===0&&(Ln=null),$E(n.stateNode),Xe(e,ye()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(fa)throw fa=!1,e=Ec,Ec=null,e;return ha&1&&e.tag!==0&&fo(),i=e.pendingLanes,i&1?e===Sc?xi++:(xi=0,Sc=e):xi=0,Cn(),null}function fo(){if(Dn!==null){var e=cp(ha),t=yt.transition,n=re;try{if(yt.transition=null,re=16>e?16:e,Dn===null)var r=!1;else{if(e=Dn,Dn=null,ha=0,ne&6)throw Error(H(331));var o=ne;for(ne|=4,Y=e.current;Y!==null;){var i=Y,s=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Y=u;Y!==null;){var c=Y;switch(c.tag){case 0:case 11:case 15:Ri(8,c,i)}var d=c.child;if(d!==null)d.return=c,Y=d;else for(;Y!==null;){c=Y;var f=c.sibling,h=c.return;if(lg(c),c===u){Y=null;break}if(f!==null){f.return=h,Y=f;break}Y=h}}}var m=i.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var E=v.sibling;v.sibling=null,v=E}while(v!==null)}}Y=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Y=s;else e:for(;Y!==null;){if(i=Y,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ri(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,Y=p;break e}Y=i.return}}var g=e.current;for(Y=g;Y!==null;){s=Y;var S=s.child;if(s.subtreeFlags&2064&&S!==null)S.return=s,Y=S;else e:for(s=g;Y!==null;){if(a=Y,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ua(9,a)}}catch(w){ve(a,a.return,w)}if(a===s){Y=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,Y=_;break e}Y=a.return}}if(ne=o,Cn(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(ws,e)}catch{}r=!0}return r}finally{re=n,yt.transition=t}}return!1}function Ng(e,t,n){t=ao(n,t),t=zh(e,t,1),e=In(e,t,1),t=ze(),e!==null&&(Xo(e,1,t),Xe(e,t))}function ve(e,t,n){if(e.tag===3)Ng(e,e,n);else for(;t!==null;){if(t.tag===3){Ng(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=ao(n,e),e=Hh(t,e,1),t=In(t,e,1),e=ze(),t!==null&&(Xo(t,1,e),Xe(t,e));break}}t=t.return}}function h_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ze(),e.pingedLanes|=e.suspendedLanes&n,Ce===e&&(De&n)===n&&(Ne===4||Ne===3&&(De&130023424)===De&&500>ye()-yc?pr(e,0):vc|=n),Xe(e,t)}function Og(e,t){t===0&&(e.mode&1?(t=Ns,Ns<<=1,!(Ns&130023424)&&(Ns=4194304)):t=1);var n=ze();e=sn(e,t),e!==null&&(Xo(e,t,n),Xe(e,n))}function g_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Og(e,n)}function m_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),Og(e,n)}var xg;xg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,r_(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,ce&&t.flags&1048576&&oh(t,Gs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;aa(e,t),e=t.pendingProps;var o=Jr(t,ke.current);oo(t,n),o=qu(null,t,r,e,o,n);var i=Zu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,We(r)?(i=!0,Hs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zu(t),o.updater=Zs,t.stateNode=o,o._reactInternals=t,ju(t,r,e,n),t=sc(null,t,r,!0,i,n)):(t.tag=0,ce&&i&&Lu(t),$e(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(aa(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=y_(r),e=Tt(r,e),o){case 0:t=ic(null,t,r,e,n);break e;case 1:t=Zh(null,t,r,e,n);break e;case 11:t=Wh(null,t,r,e,n);break e;case 14:t=Kh(null,t,r,Tt(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),ic(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Zh(e,t,r,o,n);case 3:e:{if(Jh(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ch(e,t),qs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ao(Error(H(423)),t),t=eg(e,t,r,n,o);break e}else if(r!==o){o=ao(Error(H(424)),t),t=eg(e,t,r,n,o);break e}else for(at=On(t.stateNode.containerInfo.firstChild),st=t,ce=!0,xt=null,n=Eh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(no(),r===o){t=ln(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return Sh(t),e===null&&Pu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,xu(r,o)?s=null:i!==null&&xu(r,i)&&(t.flags|=32),qh(e,t),$e(e,t,s,n),t.child;case 6:return e===null&&Pu(t),null;case 13:return tg(e,t,n);case 4:return Yu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=io(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),Wh(e,t,r,o,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ie(Ks,r._currentValue),r._currentValue=s,i!==null)if(Ot(i.value,s)){if(i.children===o.children&&!Ge.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=an(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Bu(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Bu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}$e(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,oo(t,n),o=mt(o),r=r(o),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,o=Tt(r,t.pendingProps),o=Tt(r.type,o),Kh(e,t,r,o,n);case 15:return Qh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tt(r,o),aa(e,t),t.tag=1,We(r)?(e=!0,Hs(t)):e=!1,oo(t,n),gh(t,r,o),ju(t,r,o,n),sc(null,t,r,!0,e,n);case 19:return rg(e,t,n);case 22:return Xh(e,t,n)}throw Error(H(156,t.tag))};function Tg(e,t){return ip(e,t)}function v_(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 Et(e,t,n,r){return new v_(e,t,n,r)}function xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function y_(e){if(typeof e=="function")return xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ll)return 11;if(e===Pl)return 14}return 2}function Mn(e,t){var n=e.alternate;return n===null?(n=Et(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ya(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")xc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Br:return gr(n.children,o,i,t);case Il:s=8,o|=8;break;case Al:return e=Et(12,n,t,o|2),e.elementType=Al,e.lanes=i,e;case Dl:return e=Et(13,n,t,o),e.elementType=Dl,e.lanes=i,e;case kl:return e=Et(19,n,t,o),e.elementType=kl,e.lanes=i,e;case Pf:return Ea(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Df:s=10;break e;case kf:s=9;break e;case Ll:s=11;break e;case Pl:s=14;break e;case vn:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Et(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function gr(e,t,n,r){return e=Et(7,e,r,t),e.lanes=n,e}function Ea(e,t,n,r){return e=Et(22,e,r,t),e.elementType=Pf,e.lanes=n,e.stateNode={isHidden:!1},e}function Tc(e,t,n){return e=Et(6,e,null,t),e.lanes=n,e}function Cc(e,t,n){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function E_(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=tu(0),this.expirationTimes=tu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function bc(e,t,n,r,o,i,s,a,l){return e=new E_(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Et(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(i),e}function S_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Vr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Cg(e){if(!e)return Tn;e=e._reactInternals;e:{if(rr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(We(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(We(n))return th(e,n,t)}return t}function bg(e,t,n,r,o,i,s,a,l){return e=bc(n,r,!0,e,o,i,s,a,l),e.context=Cg(null),n=e.current,r=ze(),o=kn(n),i=an(r,o),i.callback=t??null,In(n,i,o),e.current.lanes=o,Xo(e,o,r),Xe(e,r),e}function Sa(e,t,n,r){var o=t.current,i=ze(),s=kn(o);return n=Cg(n),t.context===null?t.context=n:t.pendingContext=n,t=an(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=In(o,t,s),e!==null&&(It(e,o,s,i),Xs(e,o,s)),s}function _a(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ig(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ic(e,t){Ig(e,t),(e=e.alternate)&&Ig(e,t)}function __(){return null}var Ag=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ac(e){this._internalRoot=e}wa.prototype.render=Ac.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Sa(e,t,null,null)},wa.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fr(function(){Sa(null,e,null,null)}),t[tn]=null}};function wa(e){this._internalRoot=e}wa.prototype.unstable_scheduleHydration=function(e){if(e){var t=pp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wn.length&&t!==0&&t<wn[n].priority;n++);wn.splice(n,0,e),n===0&&mp(e)}};function Lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ra(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Lg(){}function w_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=_a(s);i.call(u)}}var s=bg(t,r,e,0,null,!1,!1,"",Lg);return e._reactRootContainer=s,e[tn]=s.current,ci(e.nodeType===8?e.parentNode:e),fr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=_a(l);a.call(u)}}var l=bc(e,0,!1,null,null,!1,!1,"",Lg);return e._reactRootContainer=l,e[tn]=l.current,ci(e.nodeType===8?e.parentNode:e),fr(function(){Sa(t,l,n,r)}),l}function Na(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=_a(s);a.call(l)}}Sa(t,s,e,o)}else s=w_(n,t,e,o,r);return _a(s)}dp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qo(t.pendingLanes);n!==0&&(nu(t,n|1),Xe(t,ye()),!(ne&6)&&(co=ye()+500,Cn()))}break;case 13:fr(function(){var r=sn(e,1);if(r!==null){var o=ze();It(r,e,1,o)}}),Ic(e,1)}},ru=function(e){if(e.tag===13){var t=sn(e,134217728);if(t!==null){var n=ze();It(t,e,134217728,n)}Ic(e,134217728)}},fp=function(e){if(e.tag===13){var t=kn(e),n=sn(e,t);if(n!==null){var r=ze();It(n,e,t,r)}Ic(e,t)}},pp=function(){return re},hp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},Ql=function(e,t,n){switch(t){case"input":if($l(e,n),t=n.name,n.type==="radio"&&t!=null){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=$s(r);if(!o)throw Error(H(90));Ff(r),$l(r,o)}}}break;case"textarea":Hf(e,n);break;case"select":t=n.value,t!=null&&$r(e,!!n.multiple,t,!1)}},Zf=Rc,Jf=fr;var R_={usingClientEntryPoint:!1,Events:[pi,qr,$s,Xf,qf,Rc]},Ti={findFiberByHostInstance:or,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},N_={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:en.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rp(e),e===null?null:e.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||__,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oa.isDisabled&&Oa.supportsFiber)try{ws=Oa.inject(N_),Ft=Oa}catch{}}rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R_,rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lc(t))throw Error(H(200));return S_(e,t,null,n)},rt.createRoot=function(e,t){if(!Lc(e))throw Error(H(299));var n=!1,r="",o=Ag;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=bc(e,1,!1,null,null,n,!1,r,o),e[tn]=t.current,ci(e.nodeType===8?e.parentNode:e),new Ac(t)},rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=rp(t),e=e===null?null:e.stateNode,e},rt.flushSync=function(e){return fr(e)},rt.hydrate=function(e,t,n){if(!Ra(t))throw Error(H(200));return Na(null,e,t,!0,n)},rt.hydrateRoot=function(e,t,n){if(!Lc(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Ag;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=bg(t,null,e,1,n??null,o,!1,i,s),e[tn]=t.current,ci(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new wa(t)},rt.render=function(e,t,n){if(!Ra(t))throw Error(H(200));return Na(null,e,t,!1,n)},rt.unmountComponentAtNode=function(e){if(!Ra(e))throw Error(H(40));return e._reactRootContainer?(fr(function(){Na(null,null,e,!1,function(){e._reactRootContainer=null,e[tn]=null})}),!0):!1},rt.unstable_batchedUpdates=Rc,rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ra(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Na(e,t,n,!1,r)},rt.version="18.2.0-next-9e3b772b8-20220608",function(e){function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=rt}(_E);var Dg=Ur;Nl.createRoot=Dg.createRoot,Nl.hydrateRoot=Dg.hydrateRoot;var O_=Object.create,Dc=Object.defineProperty,x_=Object.getOwnPropertyDescriptor,T_=Object.getOwnPropertyNames,C_=Object.getPrototypeOf,b_=Object.prototype.hasOwnProperty,I_=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),L_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T_(t))!b_.call(e,o)&&o!==n&&Dc(e,o,{get:()=>t[o],enumerable:!(r=x_(t,o))||r.enumerable});return e},D_=(e,t,n)=>(n=e!=null?O_(C_(e)):{},L_(t||!e||!e.__esModule?Dc(n,"default",{value:e,enumerable:!0}):n,e)),kg=(e,t,n)=>(I_(e,typeof t!="symbol"?t+"":t,n),n),k_=A_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(E,p){var g=E[p];if(typeof g.bind=="function")return g.bind(E);try{return Function.prototype.bind.call(g,E)}catch{return function(){return Function.prototype.apply.apply(g,[E,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(E){return E==="debug"&&(E="log"),typeof console===r?!1:E==="trace"&&o?a:console[E]!==void 0?s(console,E):console.log!==void 0?s(console,"log"):n}function u(E,p){for(var g=0;g<i.length;g++){var S=i[g];this[S]=g<E?n:this.methodFactory(S,E,p)}this.log=this.debug}function c(E,p,g){return function(){typeof console!==r&&(u.call(this,p,g),this[E].apply(this,arguments))}}function d(E,p,g){return l(E)||c.apply(this,arguments)}function f(E,p,g){var S=this,_;p=p??"WARN";var w="loglevel";typeof E=="string"?w+=":"+E:typeof E=="symbol"&&(w=void 0);function R(b){var V=(i[b]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=V;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+V+";"}catch{}}}function C(){var b;if(!(typeof window===r||!w)){try{b=window.localStorage[w]}catch{}if(typeof b===r)try{var V=window.document.cookie,$=V.indexOf(encodeURIComponent(w)+"=");$!==-1&&(b=/^([^;]+)/.exec(V.slice($))[1])}catch{}return S.levels[b]===void 0&&(b=void 0),b}}function A(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}S.name=E,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=g||d,S.getLevel=function(){return _},S.setLevel=function(b,V){if(typeof b=="string"&&S.levels[b.toUpperCase()]!==void 0&&(b=S.levels[b.toUpperCase()]),typeof b=="number"&&b>=0&&b<=S.levels.SILENT){if(_=b,V!==!1&&R(b),u.call(S,b,E),typeof console===r&&b<S.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+b},S.setDefaultLevel=function(b){p=b,C()||S.setLevel(b,!1)},S.resetLevel=function(){S.setLevel(p,!1),A()},S.enableAll=function(b){S.setLevel(S.levels.TRACE,b)},S.disableAll=function(b){S.setLevel(S.levels.SILENT,b)};var B=C();B==null&&(B=p),S.setLevel(B,!1)}var h=new f,m={};h.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var p=m[E];return p||(p=m[E]=new f(E,h.getLevel(),h.methodFactory)),p};var v=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=v),h},h.getLoggers=function(){return m},h.default=h,h})}),P_=D_(k_(),1),M_=()=>new Date().toISOString(),Ci=P_.default.getLogger("signalwire"),U_=Ci.methodFactory;Ci.methodFactory=(e,t,n)=>{let r=U_(e,t,n);return function(...o){o.unshift(M_(),"-"),r(...o)}};var F_=Ci.getLevel();Ci.setLevel(F_);var qe=()=>Ci,V_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),B_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),Pg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},xa=e=>e.replace(/\s/g,""),$_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:{text:e,url:t,volume:n}})=>{let r=t||`say:${e||"Unknown TTS"}`;return n?{play:{volume:n,url:r}}:{play:{url:r}}},forwardAddress:({data:e})=>kc(e),forwardPhone:({data:e})=>kc(e),forwardResource:({data:e})=>kc(e),promptPlay:({data:e})=>{let t={play:"say:Unknown value"};e.text&&(t.play=`say:${e.text}`),e.url&&(t.play=e.url);let n=e.options.reduce((r,o)=>{let i=Pg(o.command);i&&r.speechHints.push(i);let s=xa(o.digit);return s&&(r.maxDigits=Math.max(r.maxDigits,s.length)),r},{speechHints:[],maxDigits:0});return n.speechHints.length&&(t.speech_hints=n.speechHints,t.speech_language="en-US"),n.maxDigits>1&&(t.max_digits=n.maxDigits),[{prompt:t},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>[{record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'%{record_result}' == 'success'",then:[],else:[]}}],recordCallStart:({data:e})=>[{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:e.terminators}},{if:{condition:"'%{record_result}' == 'success'",then:[],else:[]}}],recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:xa(t),to_number:xa(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{if:{condition:"'%{request_result}' === 'success'",then:[],else:[]}}],cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:e.headers&&Object.keys(e.headers).length?e.headers:void 0,body:e.body?e.body:void 0}},{switch:{variable:"request_result",case:{success:[]},default:[]}}]},po=e=>{try{return $_[e.__type](e.node)}catch(t){throw qe().error("Unknown Verb",e),t}},kc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t&&t>0?t:void 0,o=e.map(s=>({from:"%{call.from}",to:xa(s),session_timeout:r}));o.length||o.push({from:"%{call.from}",to:"",session_timeout:r});let i={if:{condition:"'%{connect_result}' == 'connected'",then:[],else:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:o[0]},i];case"serial":return[{connect:{serial:o}},i];case"parallel":return[{connect:{parallel:o}},i];default:return qe().warn(`The type '${n}' is not supported yet.`),[{connect:o[0]},i]}},z_="1.0.0",H_=e=>{let t=qe(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=_=>i.has(_),u=_=>o.has(_),c=_=>o.add(_);e.nodes.forEach(_=>{r.set(_.id,{node:_,children:[]}),_.type==="handleCall"&&(a=_.id)}),e.edges.forEach(_=>{let w=r.get(_.source),R=r.get(_.target);if(!w||!R)return t.warn("Invalid edge:",_);w.children.push(_.target),_.sourceHandle&&s.set(_.sourceHandle,R),n.has(_.target)&&i.set(_.target,[]),n.add(_.target)});let d=[...i.keys()],f=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),w.digit&&(_[w.digit]=C);let A=Pg(w.command);A&&(_[A]=C);let B=l(R.node.id);if(B){let b={transfer:R.node.id};w.digit&&_[w.digit].push(b),A&&!_[A].includes(b)&&_[A].push(b)}p({sectionName:B?R.node.id:w.id,current:R})}return _},h=(_,w)=>{let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_[w.result]=C;let A=l(R.node.id);A&&_[w.result].push({transfer:R.node.id}),p({sectionName:A?R.node.id:w.id,current:R})}return _},m={then:(_,w)=>{if(w.result!=="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let A=l(R.node.id);A&&_.push({transfer:R.node.id}),p({sectionName:A?R.node.id:w.id,current:R})}return _},else:(_,w)=>{if(w.result==="success")return _;let R=s.get(w.id);if(R){let C=[];i.set(w.id,C),_=C;let A=l(R.node.id);A&&_.push({transfer:R.node.id}),p({sectionName:A?R.node.id:w.id,current:R})}return _}},v={options:(_,w)=>{let R=s.get(w.id),C={when:w.value,then:[]};if(R){let A=[];i.set(w.id,A),C.then=A;let B=l(R.node.id);B&&C.then.push({transfer:R.node.id}),_.push(C),p({sectionName:B?R.node.id:w.id,current:R})}return _},fallback:_=>{let w=s.get(_),R={else:[]};if(w){let C=[];i.set(_,C),R.else=C;let A=l(w.node.id);A&&R.else.push({transfer:w.node.id}),p({sectionName:A?w.node.id:_,current:w})}return R}},E=_=>{let w=s.get(_),R=[];if(w){let C=[];i.set(_,C),R=C;let A=l(w.node.id);A&&R.push({transfer:w.node.id}),p({sectionName:A?w.node.id:_,current:w})}return R},p=({sectionName:_,current:w})=>{var C,A,B;if(u(w.node.id))return;c(w.node.id);let R=i.get(_);if(!R){t.warn("Unknown section name:",_);return}switch(w.node.type){case"promptPlay":{let b=po({__type:w.node.type,node:w.node});if(!Array.isArray(b)){t.warn("Invalid gather node",b);return}(A=(C=w.node.data)==null?void 0:C.results)!=null&&A.length&&(b[1].switch.case={...b[1].switch.case,...w.node.data.results.reduce(h,{})}),b[1].switch.default[0].switch.case=w.node.data.options.reduce(f,{}),(B=b[1].switch.case)!=null&&B.no_match&&(b[1].switch.default[0].switch.default=b[1].switch.case.no_match),R.push(...b);return}case"cond":{let b=po({__type:w.node.type,node:w.node});b.cond=w.node.data.options.reduce(v.options,[]),b.cond.push(v.fallback(w.node.data.fallback)),R.push(b);return}case"condRequest":{let b=po({__type:w.node.type,node:w.node}),V=w.node.data.options.reduce(v.options,[]),$=v.fallback(w.node.data.fallback),F={cond:[...V,$]};b[1].switch.case.success=[F],b[1].switch.default=E(w.node.data.error),R.push(b);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let b=po({__type:w.node.type,node:w.node});if(!Array.isArray(b)){t.warn("Invalid connect node",b);return}w.node.data.options.length&&(b[1].if.then=w.node.data.options.reduce(m.then,[]),b[1].if.else[0].switch.case=w.node.data.options.reduce(h,{})),R.push(...b);return}case"request":{let b=po({__type:w.node.type,node:w.node});if(!Array.isArray(b)){t.warn("Invalid record node",b);return}b[1].if.then=w.node.data.options.reduce(m.then,[]),b[1].if.else=w.node.data.options.reduce(m.else,[]),R.push(...b);return}default:{let b=po({__type:w.node.type,node:w.node});w.node.type!=="handleCall"&&R.push(b),w.children.forEach(V=>{let $=r.get(V);if(!$)return t.warn("Invalid Child Node",V);let F=l(V);F&&R.push({transfer:V}),p({sectionName:F?V:_,current:$})});break}}},g=r.get(a);g&&p({sectionName:"main",current:g});let S={};return d.forEach(_=>{let w=i.get(_);w&&(S[_]=w)}),t.debug("sections",JSON.stringify(S)),{version:z_,sections:S}},Mg=class extends Error{constructor(t,n){super(n),this.code=t,this.message=n,kg(this,"name","AuthError"),Object.setPrototypeOf(this,Mg.prototype)}},Ug=class extends Error{constructor(e,t,n){super(t),this.code=e,this.message=t,this.response=n,kg(this,"name","HttpError"),Object.setPrototypeOf(this,Ug.prototype)}};async function j_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Mg(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new Ug(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var Y_=({timeout:e=3e4,...t},n=j_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=W_({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,u=l.signal;s.signal=u,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(K_({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{a&&clearTimeout(a)}},G_=e=>typeof e=="string"?e:JSON.stringify(e),W_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:G_(r)}:r!=null?{...t,[n]:r}:t,{}),K_=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},Q_=e=>{let t=qe(),n=Y_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){default:return o}}catch(o){if(t.error("Could not load flow. URL:",e.getFlowURL),o instanceof Error)throw o;return{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(V_),edges:r.edges.map(B_)},relayml:H_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body},deployFlow:async r=>{let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{method:"POST",body:o});return t.info("deployFlow",i),i.body}}};function Ze(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ze(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const Fg=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{var l;((l={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:l.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},Vg=e=>e?Fg(e):Fg;var Pc={},X_={get exports(){return Pc},set exports(e){Pc=e}},Bg={},Mc={},q_={get exports(){return Mc},set exports(e){Mc=e}},$g={};/**
|
|
44
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function ac(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function uc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var i_=typeof WeakMap=="function"?WeakMap:Map;function Gh(e,t,n){n=fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){vl||(vl=!0,Nc=r),uc(e,t)},n}function Yh(e,t,n){n=fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){uc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){uc(e,t),typeof r!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Wh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new i_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=E_.bind(null,e,t,n),t.then(e,e))}function Kh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Qh(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fn(-1,1),t.tag=2,Mn(n,t,1))),n.lanes|=1),e)}var s_=sn.ReactCurrentOwner,qe=!1;function He(e,t,n,r){t.child=e===null?wh(t,null,n,r):so(t,e.child,n,r)}function Xh(e,t,n,r,o){n=n.render;var i=t.ref;return io(t,o),r=nc(e,t,n,r,i,o),n=rc(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pn(e,t,o)):(fe&&n&&Uu(t),t.flags|=1,He(e,t,r,o),t.child)}function qh(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Ac(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Zh(e,t,i,r,o)):(e=Rl(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:ci,n(s,r)&&e.ref===t.ref)return pn(e,t,o)}return t.flags|=1,e=zn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Zh(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(ci(i,r)&&e.ref===t.ref)if(qe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(qe=!0);else return t.lanes=e.lanes,pn(e,t,o)}return cc(e,t,n,r,o)}function Jh(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},le(co,ut),ut|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,le(co,ut),ut|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,le(co,ut),ut|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,le(co,ut),ut|=r;return He(e,t,o,n),t.child}function eg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cc(e,t,n,r,o){var i=Xe(n)?ar:Me.current;return i=eo(t,i),io(t,o),n=nc(e,t,n,r,i,o),r=rc(),e!==null&&!qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,pn(e,t,o)):(fe&&r&&Uu(t),t.flags|=1,He(e,t,n,o),t.child)}function tg(e,t,n,r,o){if(Xe(n)){var i=!0;Ks(t)}else i=!1;if(io(t,o),t.stateNode===null)fl(e,t),yh(t,n,r),Qu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Et(u):(u=Xe(n)?ar:Me.current,u=eo(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Eh(t,s,r,u),Pn=!1;var f=t.memoizedState;s.state=f,nl(t,r,s,o),a=t.memoizedState,l!==r||f!==a||Qe.current||Pn?(typeof c=="function"&&(Ku(t,n,c,r),a=t.memoizedState),(l=Pn||vh(t,n,l,r,f,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,ph(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:At(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Et(a):(a=Xe(n)?ar:Me.current,a=eo(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&Eh(t,s,r,a),Pn=!1,f=t.memoizedState,s.state=f,nl(t,r,s,o);var m=t.memoizedState;l!==d||f!==m||Qe.current||Pn?(typeof p=="function"&&(Ku(t,n,p,r),m=t.memoizedState),(u=Pn||vh(t,n,u,r,f,m,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return dc(e,t,n,r,i,o)}function dc(e,t,n,r,o,i){eg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&ih(t,n,!1),pn(e,t,i);r=t.stateNode,s_.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=so(t,e.child,null,i),t.child=so(t,null,l,i)):He(e,t,l,i),t.memoizedState=r.state,o&&ih(t,n,!0),t.child}function ng(e){var t=e.stateNode;t.pendingContext?rh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rh(e,t.context,!1),Xu(e,t.containerInfo)}function rg(e,t,n,r,o){return ro(),$u(o),t.flags|=256,He(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function pc(e){return{baseLanes:e,cachePool:null,transitions:null}}function og(e,t,n){var r=t.pendingProps,o=ge.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),le(ge,o&1),e===null)return Bu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Nl(s,r,0,null),e=yr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=pc(n),t.memoizedState=fc,e):hc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return l_(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=zn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=zn(l,i):(i=yr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?pc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=fc,r}return i=e.child,e=i.sibling,r=zn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function hc(e,t){return t=Nl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dl(e,t,n,r){return r!==null&&$u(r),so(t,e.child,null,n),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function l_(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ac(Error(H(422))),dl(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Nl({mode:"visible",children:r.children},o,0,null),i=yr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&so(t,e.child,null,s),t.child.memoizedState=pc(s),t.memoizedState=fc,i);if(!(t.mode&1))return dl(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(H(419)),r=ac(i,r,void 0),dl(e,t,s,r)}if(l=(s&e.childLanes)!==0,qe||l){if(r=Ae,r!==null){switch(s&-s){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}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,dn(e,o),kt(r,e,o,-1))}return Ic(),r=ac(Error(H(421))),dl(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=S_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,at=An(o.nextSibling),lt=t,fe=!0,It=null,e!==null&&(vt[yt++]=un,vt[yt++]=cn,vt[yt++]=ur,un=e.id,cn=e.overflow,ur=t),t=hc(t,r.children),t.flags|=4096,t)}function ig(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gu(e.return,t,n)}function gc(e,t,n,r,o){var i=e.memoizedState;i===null?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 sg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(He(e,t,r.children,n),r=ge.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ig(e,n,t);else if(e.tag===19)ig(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(le(ge,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&il(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),gc(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&il(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}gc(t,!0,n,null,i);break;case"together":gc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function fl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=zn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function a_(e,t,n){switch(t.tag){case 3:ng(t),ro();break;case 5:Rh(t);break;case 1:Xe(t.type)&&Ks(t);break;case 4:Xu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;le(Js,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(le(ge,ge.current&1),t.flags|=128,null):n&t.child.childLanes?og(e,t,n):(le(ge,ge.current&1),e=pn(e,t,n),e!==null?e.sibling:null);le(ge,ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return sg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),le(ge,ge.current),r)break;return null;case 22:case 23:return t.lanes=0,Jh(e,t,n)}return pn(e,t,n)}var lg,mc,ag,ug;lg=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},mc=function(){},ag=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,fr(Gt.current);var i=null;switch(n){case"input":o=Ga(e,o),r=Ga(e,r),i=[];break;case"select":o=he({},o,{value:void 0}),r=he({},r,{value:void 0}),i=[];break;case"textarea":o=Ka(e,o),r=Ka(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Gs)}Xa(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ho.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ho.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&ae("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}},ug=function(e,t,n,r){n!==r&&(t.flags|=4)};function Oi(e,t){if(!fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function u_(e,t,n){var r=t.pendingProps;switch(Fu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(t),null;case 1:return Xe(t.type)&&Ws(),Fe(t),null;case 3:return r=t.stateNode,lo(),ue(Qe),ue(Me),Ju(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Zs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,It!==null&&(Tc(It),It=null))),mc(e,t),Fe(t),null;case 5:qu(t);var o=fr(Si.current);if(n=t.type,e!==null&&t.stateNode!=null)ag(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Fe(t),null}if(e=fr(Gt.current),Zs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jt]=t,r[gi]=i,e=(t.mode&1)!==0,n){case"dialog":ae("cancel",r),ae("close",r);break;case"iframe":case"object":case"embed":ae("load",r);break;case"video":case"audio":for(o=0;o<fi.length;o++)ae(fi[o],r);break;case"source":ae("error",r);break;case"img":case"image":case"link":ae("error",r),ae("load",r);break;case"details":ae("toggle",r);break;case"input":zf(r,i),ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ae("invalid",r);break;case"textarea":Gf(r,i),ae("invalid",r)}Xa(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&js(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&js(r.textContent,l,e),o=["children",""+l]):Ho.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ae("scroll",r)}switch(n){case"input":_s(r),jf(r,i,!0);break;case"textarea":_s(r),Wf(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Gs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kf(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[jt]=t,e[gi]=r,lg(e,t,!1,!1),t.stateNode=e;e:{switch(s=qa(n,r),n){case"dialog":ae("cancel",e),ae("close",e),o=r;break;case"iframe":case"object":case"embed":ae("load",e),o=r;break;case"video":case"audio":for(o=0;o<fi.length;o++)ae(fi[o],e);o=r;break;case"source":ae("error",e),o=r;break;case"img":case"image":case"link":ae("error",e),ae("load",e),o=r;break;case"details":ae("toggle",e),o=r;break;case"input":zf(e,r),o=Ga(e,r),ae("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=he({},r,{value:void 0}),ae("invalid",e);break;case"textarea":Gf(e,r),o=Ka(e,r),ae("invalid",e);break;default:o=r}Xa(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?qf(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Qf(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Wo(e,a):typeof a=="number"&&Wo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ho.hasOwnProperty(i)?a!=null&&i==="onScroll"&&ae("scroll",e):a!=null&&ka(e,i,a,s))}switch(n){case"input":_s(e),jf(e,r,!1);break;case"textarea":_s(e),Wf(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Nn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?zr(e,!!r.multiple,i,!1):r.defaultValue!=null&&zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Gs)}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)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Fe(t),null;case 6:if(e&&t.stateNode!=null)ug(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=fr(Si.current),fr(Gt.current),Zs(t)){if(r=t.stateNode,n=t.memoizedProps,r[jt]=t,(i=r.nodeValue!==n)&&(e=lt,e!==null))switch(e.tag){case 3:js(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&js(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jt]=t,t.stateNode=r}return Fe(t),null;case 13:if(ue(ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(fe&&at!==null&&t.mode&1&&!(t.flags&128))dh(),ro(),t.flags|=98560,i=!1;else if(i=Zs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[jt]=t}else ro(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fe(t),i=!1}else It!==null&&(Tc(It),It=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ge.current&1?Te===0&&(Te=3):Ic())),t.updateQueue!==null&&(t.flags|=4),Fe(t),null);case 4:return lo(),mc(e,t),e===null&&pi(t.stateNode.containerInfo),Fe(t),null;case 10:return ju(t.type._context),Fe(t),null;case 17:return Xe(t.type)&&Ws(),Fe(t),null;case 19:if(ue(ge),i=t.memoizedState,i===null)return Fe(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Oi(i,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=il(e),s!==null){for(t.flags|=128,Oi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(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=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return le(ge,ge.current&1|2),t.child}e=e.sibling}i.tail!==null&&we()>fo&&(t.flags|=128,r=!0,Oi(i,!1),t.lanes=4194304)}else{if(!r)if(e=il(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!fe)return Fe(t),null}else 2*we()-i.renderingStartTime>fo&&n!==1073741824&&(t.flags|=128,r=!0,Oi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=we(),t.sibling=null,n=ge.current,le(ge,r?n&1|2:n&1),t):(Fe(t),null);case 22:case 23:return bc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ut&1073741824&&(Fe(t),t.subtreeFlags&6&&(t.flags|=8192)):Fe(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function c_(e,t){switch(Fu(t),t.tag){case 1:return Xe(t.type)&&Ws(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return lo(),ue(Qe),ue(Me),Ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qu(t),null;case 13:if(ue(ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));ro()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(ge),null;case 4:return lo(),null;case 10:return ju(t.type._context),null;case 22:case 23:return bc(),null;case 24:return null;default:return null}}var pl=!1,Ve=!1,d_=typeof WeakSet=="function"?WeakSet:Set,G=null;function uo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function vc(e,t,n){try{n()}catch(r){Se(e,t,r)}}var cg=!1;function f_(e,t){if(bu=Ds,e=$p(),_u(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Iu={focusedElem:e,selectionRange:n},Ds=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,E=m.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:At(t.type,v),E);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(_){Se(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=cg,cg=!1,m}function xi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&vc(t,n,i)}o=o.next}while(o!==r)}}function hl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==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 yc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function dg(e){var t=e.alternate;t!==null&&(e.alternate=null,dg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jt],delete t[gi],delete t[ku],delete t[KS],delete t[QS])),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 fg(e){return e.tag===5||e.tag===3||e.tag===4}function pg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gs));else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}function Sc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Sc(e,t,n),e=e.sibling;e!==null;)Sc(e,t,n),e=e.sibling}var ke=null,Lt=!1;function Un(e,t,n){for(n=n.child;n!==null;)hg(e,t,n),n=n.sibling}function hg(e,t,n){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Ts,n)}catch{}switch(n.tag){case 5:Ve||uo(n,t);case 6:var r=ke,o=Lt;ke=null,Un(e,t,n),ke=r,Lt=o,ke!==null&&(Lt?(e=ke,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ke.removeChild(n.stateNode));break;case 18:ke!==null&&(Lt?(e=ke,n=n.stateNode,e.nodeType===8?Du(e.parentNode,n):e.nodeType===1&&Du(e,n),oi(e)):Du(ke,n.stateNode));break;case 4:r=ke,o=Lt,ke=n.stateNode.containerInfo,Lt=!0,Un(e,t,n),ke=r,Lt=o;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&vc(n,t,s),o=o.next}while(o!==r)}Un(e,t,n);break;case 1:if(!Ve&&(uo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}Un(e,t,n);break;case 21:Un(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,Un(e,t,n),Ve=r):Un(e,t,n);break;default:Un(e,t,n)}}function gg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new d_),t.forEach(function(r){var o=__.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Dt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:ke=l.stateNode,Lt=!1;break e;case 3:ke=l.stateNode.containerInfo,Lt=!0;break e;case 4:ke=l.stateNode.containerInfo,Lt=!0;break e}l=l.return}if(ke===null)throw Error(H(160));hg(i,s,o),ke=null,Lt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Se(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mg(t,e),t=t.sibling}function mg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dt(t,e),Wt(e),r&4){try{xi(3,e,e.return),hl(3,e)}catch(v){Se(e,e.return,v)}try{xi(5,e,e.return)}catch(v){Se(e,e.return,v)}}break;case 1:Dt(t,e),Wt(e),r&512&&n!==null&&uo(n,n.return);break;case 5:if(Dt(t,e),Wt(e),r&512&&n!==null&&uo(n,n.return),e.flags&32){var o=e.stateNode;try{Wo(o,"")}catch(v){Se(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Hf(o,i),qa(l,s);var u=qa(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?qf(o,d):c==="dangerouslySetInnerHTML"?Qf(o,d):c==="children"?Wo(o,d):ka(o,c,d,u)}switch(l){case"input":Ya(o,i);break;case"textarea":Yf(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?zr(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?zr(o,!!i.multiple,i.defaultValue,!0):zr(o,!!i.multiple,i.multiple?[]:"",!1))}o[gi]=i}catch(v){Se(e,e.return,v)}}break;case 6:if(Dt(t,e),Wt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Se(e,e.return,v)}}break;case 3:if(Dt(t,e),Wt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{oi(t.containerInfo)}catch(v){Se(e,e.return,v)}break;case 4:Dt(t,e),Wt(e);break;case 13:Dt(t,e),Wt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Rc=we())),r&4&&gg(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ve=(u=Ve)||c,Dt(t,e),Ve=u):Dt(t,e),Wt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(G=e,c=e.child;c!==null;){for(d=G=c;G!==null;){switch(f=G,p=f.child,f.tag){case 0:case 11:case 14:case 15:xi(4,f,f.return);break;case 1:uo(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:uo(f,f.return);break;case 22:if(f.memoizedState!==null){Eg(d);continue}}p!==null?(p.return=f,G=p):Eg(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Xf("display",s))}catch(v){Se(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Se(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Dt(t,e),Wt(e),r&4&&gg(e);break;case 21:break;default:Dt(t,e),Wt(e)}}function Wt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fg(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Wo(o,""),r.flags&=-33);var i=pg(e);Sc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=pg(e);Ec(e,l,s);break;default:throw Error(H(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function p_(e,t,n){G=e,vg(e)}function vg(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var o=G,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||pl;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Ve;l=pl;var u=Ve;if(pl=s,(Ve=a)&&!u)for(G=o;G!==null;)s=G,a=s.child,s.tag===22&&s.memoizedState!==null?Sg(o):a!==null?(a.return=s,G=a):Sg(o);for(;i!==null;)G=i,vg(i),i=i.sibling;G=o,pl=l,Ve=u}yg(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):yg(e)}}function yg(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ve||hl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ve)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:At(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&gh(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}gh(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&oi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ve||t.flags&512&&yc(t)}catch(f){Se(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function Eg(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function Sg(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{hl(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Se(t,o,a)}}var i=t.return;try{yc(t)}catch(a){Se(t,i,a)}break;case 5:var s=t.return;try{yc(t)}catch(a){Se(t,s,a)}}}catch(a){Se(t,t.return,a)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var h_=Math.ceil,gl=sn.ReactCurrentDispatcher,_c=sn.ReactCurrentOwner,_t=sn.ReactCurrentBatchConfig,ne=0,Ae=null,Ne=null,Pe=0,ut=0,co=Ln(0),Te=0,Ti=null,hr=0,ml=0,wc=0,Ci=null,Ze=null,Rc=0,fo=1/0,hn=null,vl=!1,Nc=null,Fn=null,yl=!1,Vn=null,El=0,bi=0,Oc=null,Sl=-1,_l=0;function je(){return ne&6?we():Sl!==-1?Sl:Sl=we()}function Bn(e){return e.mode&1?ne&2&&Pe!==0?Pe&-Pe:qS.transition!==null?(_l===0&&(_l=fp()),_l):(e=re,e!==0||(e=window.event,e=e===void 0?16:_p(e.type)),e):1}function kt(e,t,n,r){if(50<bi)throw bi=0,Oc=null,Error(H(185));Jo(e,n,r),(!(ne&2)||e!==Ae)&&(e===Ae&&(!(ne&2)&&(ml|=n),Te===4&&$n(e,Pe)),Je(e,r),n===1&&ne===0&&!(t.mode&1)&&(fo=we()+500,Qs&&kn()))}function Je(e,t){var n=e.callbackNode;qE(e,t);var r=Is(e,e===Ae?Pe:0);if(r===0)n!==null&&up(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&up(n),t===1)e.tag===0?XS(wg.bind(null,e)):sh(wg.bind(null,e)),YS(function(){!(ne&6)&&kn()}),n=null;else{switch(pp(r)){case 1:n=ou;break;case 4:n=cp;break;case 16:n=xs;break;case 536870912:n=dp;break;default:n=xs}n=Ig(n,_g.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _g(e,t){if(Sl=-1,_l=0,ne&6)throw Error(H(327));var n=e.callbackNode;if(po()&&e.callbackNode!==n)return null;var r=Is(e,e===Ae?Pe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=wl(e,r);else{t=r;var o=ne;ne|=2;var i=Ng();(Ae!==e||Pe!==t)&&(hn=null,fo=we()+500,mr(e,t));do try{v_();break}catch(l){Rg(e,l)}while(1);Hu(),gl.current=i,ne=o,Ne!==null?t=0:(Ae=null,Pe=0,t=Te)}if(t!==0){if(t===2&&(o=iu(e),o!==0&&(r=o,t=xc(e,o))),t===1)throw n=Ti,mr(e,0),$n(e,r),Je(e,we()),n;if(t===6)$n(e,r);else{if(o=e.current.alternate,!(r&30)&&!g_(o)&&(t=wl(e,r),t===2&&(i=iu(e),i!==0&&(r=i,t=xc(e,i))),t===1))throw n=Ti,mr(e,0),$n(e,r),Je(e,we()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:vr(e,Ze,hn);break;case 3:if($n(e,r),(r&130023424)===r&&(t=Rc+500-we(),10<t)){if(Is(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){je(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Lu(vr.bind(null,e,Ze,hn),t);break}vr(e,Ze,hn);break;case 4:if($n(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Ct(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=we()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*h_(r/1960))-r,10<r){e.timeoutHandle=Lu(vr.bind(null,e,Ze,hn),r);break}vr(e,Ze,hn);break;case 5:vr(e,Ze,hn);break;default:throw Error(H(329))}}}return Je(e,we()),e.callbackNode===n?_g.bind(null,e):null}function xc(e,t){var n=Ci;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=wl(e,t),e!==2&&(t=Ze,Ze=n,t!==null&&Tc(t)),e}function Tc(e){Ze===null?Ze=e:Ze.push.apply(Ze,e)}function g_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!bt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $n(e,t){for(t&=~wc,t&=~ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ct(t),r=1<<n;e[n]=-1,t&=~r}}function wg(e){if(ne&6)throw Error(H(327));po();var t=Is(e,0);if(!(t&1))return Je(e,we()),null;var n=wl(e,t);if(e.tag!==0&&n===2){var r=iu(e);r!==0&&(t=r,n=xc(e,r))}if(n===1)throw n=Ti,mr(e,0),$n(e,t),Je(e,we()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,vr(e,Ze,hn),Je(e,we()),null}function Cc(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(fo=we()+500,Qs&&kn())}}function gr(e){Vn!==null&&Vn.tag===0&&!(ne&6)&&po();var t=ne;ne|=1;var n=_t.transition,r=re;try{if(_t.transition=null,re=1,e)return e()}finally{re=r,_t.transition=n,ne=t,!(ne&6)&&kn()}}function bc(){ut=co.current,ue(co)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,GS(n)),Ne!==null)for(n=Ne.return;n!==null;){var r=n;switch(Fu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ws();break;case 3:lo(),ue(Qe),ue(Me),Ju();break;case 5:qu(r);break;case 4:lo();break;case 13:ue(ge);break;case 19:ue(ge);break;case 10:ju(r.type._context);break;case 22:case 23:bc()}n=n.return}if(Ae=e,Ne=e=zn(e.current,null),Pe=ut=t,Te=0,Ti=null,wc=ml=hr=0,Ze=Ci=null,dr!==null){for(t=0;t<dr.length;t++)if(n=dr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}dr=null}return e}function Rg(e,t){do{var n=Ne;try{if(Hu(),sl.current=cl,ll){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ll=!1}if(pr=0,Ie=xe=me=null,_i=!1,wi=0,_c.current=null,n===null||n.return===null){Te=1,Ti=t,Ne=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Pe,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Kh(s);if(p!==null){p.flags&=-257,Qh(p,s,l,i,t),p.mode&1&&Wh(i,u,t),t=p,a=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(a),t.updateQueue=v}else m.add(a);break e}else{if(!(t&1)){Wh(i,u,t),Ic();break e}a=Error(H(426))}}else if(fe&&l.mode&1){var E=Kh(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),Qh(E,s,l,i,t),$u(ao(a,l));break e}}i=a=ao(a,l),Te!==4&&(Te=2),Ci===null?Ci=[i]:Ci.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=Gh(i,a,t);hh(i,h);break e;case 1:l=a;var g=i.type,S=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Fn===null||!Fn.has(S)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=Yh(i,l,t);hh(i,_);break e}}i=i.return}while(i!==null)}xg(n)}catch(w){t=w,Ne===n&&n!==null&&(Ne=n=n.return);continue}break}while(1)}function Ng(){var e=gl.current;return gl.current=cl,e===null?cl:e}function Ic(){(Te===0||Te===3||Te===2)&&(Te=4),Ae===null||!(hr&268435455)&&!(ml&268435455)||$n(Ae,Pe)}function wl(e,t){var n=ne;ne|=2;var r=Ng();(Ae!==e||Pe!==t)&&(hn=null,mr(e,t));do try{m_();break}catch(o){Rg(e,o)}while(1);if(Hu(),ne=n,gl.current=r,Ne!==null)throw Error(H(261));return Ae=null,Pe=0,Te}function m_(){for(;Ne!==null;)Og(Ne)}function v_(){for(;Ne!==null&&!zE();)Og(Ne)}function Og(e){var t=bg(e.alternate,e,ut);e.memoizedProps=e.pendingProps,t===null?xg(e):Ne=t,_c.current=null}function xg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=c_(n,t),n!==null){n.flags&=32767,Ne=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,Ne=null;return}}else if(n=u_(n,t,ut),n!==null){Ne=n;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Te===0&&(Te=5)}function vr(e,t,n){var r=re,o=_t.transition;try{_t.transition=null,re=1,y_(e,t,n,r)}finally{_t.transition=o,re=r}return null}function y_(e,t,n,r){do po();while(Vn!==null);if(ne&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(ZE(e,i),e===Ae&&(Ne=Ae=null,Pe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||yl||(yl=!0,Ig(xs,function(){return po(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=_t.transition,_t.transition=null;var s=re;re=1;var l=ne;ne|=4,_c.current=null,f_(e,n),mg(n,e),FS(Iu),Ds=!!bu,Iu=bu=null,e.current=n,p_(n),HE(),ne=l,re=s,_t.transition=i}else e.current=n;if(yl&&(yl=!1,Vn=e,El=o),i=e.pendingLanes,i===0&&(Fn=null),YE(n.stateNode),Je(e,we()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(vl)throw vl=!1,e=Nc,Nc=null,e;return El&1&&e.tag!==0&&po(),i=e.pendingLanes,i&1?e===Oc?bi++:(bi=0,Oc=e):bi=0,kn(),null}function po(){if(Vn!==null){var e=pp(El),t=_t.transition,n=re;try{if(_t.transition=null,re=16>e?16:e,Vn===null)var r=!1;else{if(e=Vn,Vn=null,El=0,ne&6)throw Error(H(331));var o=ne;for(ne|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(G=u;G!==null;){var c=G;switch(c.tag){case 0:case 11:case 15:xi(8,c,i)}var d=c.child;if(d!==null)d.return=c,G=d;else for(;G!==null;){c=G;var f=c.sibling,p=c.return;if(dg(c),c===u){G=null;break}if(f!==null){f.return=p,G=f;break}G=p}}}var m=i.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var E=v.sibling;v.sibling=null,v=E}while(v!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:xi(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,G=h;break e}G=i.return}}var g=e.current;for(G=g;G!==null;){s=G;var S=s.child;if(s.subtreeFlags&2064&&S!==null)S.return=s,G=S;else e:for(s=g;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:hl(9,l)}}catch(w){Se(l,l.return,w)}if(l===s){G=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,G=_;break e}G=l.return}}if(ne=o,kn(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Ts,e)}catch{}r=!0}return r}finally{re=n,_t.transition=t}}return!1}function Tg(e,t,n){t=ao(n,t),t=Gh(e,t,1),e=Mn(e,t,1),t=je(),e!==null&&(Jo(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)Tg(e,e,n);else for(;t!==null;){if(t.tag===3){Tg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Fn===null||!Fn.has(r))){e=ao(n,e),e=Yh(t,e,1),t=Mn(t,e,1),e=je(),t!==null&&(Jo(t,1,e),Je(t,e));break}}t=t.return}}function E_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=je(),e.pingedLanes|=e.suspendedLanes&n,Ae===e&&(Pe&n)===n&&(Te===4||Te===3&&(Pe&130023424)===Pe&&500>we()-Rc?mr(e,0):wc|=n),Je(e,t)}function Cg(e,t){t===0&&(e.mode&1?(t=bs,bs<<=1,!(bs&130023424)&&(bs=4194304)):t=1);var n=je();e=dn(e,t),e!==null&&(Jo(e,t,n),Je(e,n))}function S_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Cg(e,n)}function __(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),Cg(e,n)}var bg;bg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qe.current)qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qe=!1,a_(e,t,n);qe=!!(e.flags&131072)}else qe=!1,fe&&t.flags&1048576&&lh(t,qs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;fl(e,t),e=t.pendingProps;var o=eo(t,Me.current);io(t,n),o=nc(null,t,r,e,o,n);var i=rc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xe(r)?(i=!0,Ks(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Wu(t),o.updater=rl,t.stateNode=o,o._reactInternals=t,Qu(t,r,e,n),t=dc(null,t,r,!0,i,n)):(t.tag=0,fe&&i&&Uu(t),He(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(fl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=R_(r),e=At(r,e),o){case 0:t=cc(null,t,r,e,n);break e;case 1:t=tg(null,t,r,e,n);break e;case 11:t=Xh(null,t,r,e,n);break e;case 14:t=qh(null,t,r,At(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),cc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),tg(e,t,r,o,n);case 3:e:{if(ng(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,ph(e,t),nl(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ao(Error(H(423)),t),t=rg(e,t,r,n,o);break e}else if(r!==o){o=ao(Error(H(424)),t),t=rg(e,t,r,n,o);break e}else for(at=An(t.stateNode.containerInfo.firstChild),lt=t,fe=!0,It=null,n=wh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ro(),r===o){t=pn(e,t,n);break e}He(e,t,r,n)}t=t.child}return t;case 5:return Rh(t),e===null&&Bu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Au(r,o)?s=null:i!==null&&Au(r,i)&&(t.flags|=32),eg(e,t),He(e,t,s,n),t.child;case 6:return e===null&&Bu(t),null;case 13:return og(e,t,n);case 4:return Xu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=so(t,null,r,n):He(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),Xh(e,t,r,o,n);case 7:return He(e,t,t.pendingProps,n),t.child;case 8:return He(e,t,t.pendingProps.children,n),t.child;case 12:return He(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,le(Js,r._currentValue),r._currentValue=s,i!==null)if(bt(i.value,s)){if(i.children===o.children&&!Qe.current){t=pn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=fn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Gu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Gu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}He(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,io(t,n),o=Et(o),r=r(o),t.flags|=1,He(e,t,r,n),t.child;case 14:return r=t.type,o=At(r,t.pendingProps),o=At(r.type,o),qh(e,t,r,o,n);case 15:return Zh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:At(r,o),fl(e,t),t.tag=1,Xe(r)?(e=!0,Ks(t)):e=!1,io(t,n),yh(t,r,o),Qu(t,r,o,n),dc(null,t,r,!0,e,n);case 19:return sg(e,t,n);case 22:return Jh(e,t,n)}throw Error(H(156,t.tag))};function Ig(e,t){return ap(e,t)}function w_(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 wt(e,t,n,r){return new w_(e,t,n,r)}function Ac(e){return e=e.prototype,!(!e||!e.isReactComponent)}function R_(e){if(typeof e=="function")return Ac(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ua)return 11;if(e===Ba)return 14}return 2}function zn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Rl(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Ac(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case $r:return yr(n.children,o,i,t);case Pa:s=8,o|=8;break;case Ma:return e=wt(12,n,t,o|2),e.elementType=Ma,e.lanes=i,e;case Fa:return e=wt(13,n,t,o),e.elementType=Fa,e.lanes=i,e;case Va:return e=wt(19,n,t,o),e.elementType=Va,e.lanes=i,e;case Ff:return Nl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mf:s=10;break e;case Uf:s=9;break e;case Ua:s=11;break e;case Ba:s=14;break e;case Rn:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=wt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function yr(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function Nl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=Ff,e.lanes=n,e.stateNode={isHidden:!1},e}function Lc(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function Dc(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function N_(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=su(0),this.expirationTimes=su(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=su(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function kc(e,t,n,r,o,i,s,l,a){return e=new N_(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=wt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wu(i),e}function O_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Br,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Ag(e){if(!e)return Dn;e=e._reactInternals;e:{if(sr(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(Xe(n))return oh(e,n,t)}return t}function Lg(e,t,n,r,o,i,s,l,a){return e=kc(n,r,!0,e,o,i,s,l,a),e.context=Ag(null),n=e.current,r=je(),o=Bn(n),i=fn(r,o),i.callback=t??null,Mn(n,i,o),e.current.lanes=o,Jo(e,o,r),Je(e,r),e}function Ol(e,t,n,r){var o=t.current,i=je(),s=Bn(o);return n=Ag(n),t.context===null?t.context=n:t.pendingContext=n,t=fn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Mn(o,t,s),e!==null&&(kt(e,o,s,i),tl(e,o,s)),s}function xl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Dg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Pc(e,t){Dg(e,t),(e=e.alternate)&&Dg(e,t)}function x_(){return null}var kg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Mc(e){this._internalRoot=e}Tl.prototype.render=Mc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Ol(e,t,null,null)},Tl.prototype.unmount=Mc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gr(function(){Ol(null,e,null,null)}),t[ln]=null}};function Tl(e){this._internalRoot=e}Tl.prototype.unstable_scheduleHydration=function(e){if(e){var t=mp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cn.length&&t!==0&&t<Cn[n].priority;n++);Cn.splice(n,0,e),n===0&&Ep(e)}};function Uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Cl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pg(){}function T_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=xl(s);i.call(u)}}var s=Lg(t,r,e,0,null,!1,!1,"",Pg);return e._reactRootContainer=s,e[ln]=s.current,pi(e.nodeType===8?e.parentNode:e),gr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=xl(a);l.call(u)}}var a=kc(e,0,!1,null,null,!1,!1,"",Pg);return e._reactRootContainer=a,e[ln]=a.current,pi(e.nodeType===8?e.parentNode:e),gr(function(){Ol(t,a,n,r)}),a}function bl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=xl(s);l.call(a)}}Ol(t,s,e,o)}else s=T_(n,t,e,o,r);return xl(s)}hp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zo(t.pendingLanes);n!==0&&(lu(t,n|1),Je(t,we()),!(ne&6)&&(fo=we()+500,kn()))}break;case 13:gr(function(){var r=dn(e,1);if(r!==null){var o=je();kt(r,e,1,o)}}),Pc(e,1)}},au=function(e){if(e.tag===13){var t=dn(e,134217728);if(t!==null){var n=je();kt(t,e,134217728,n)}Pc(e,134217728)}},gp=function(e){if(e.tag===13){var t=Bn(e),n=dn(e,t);if(n!==null){var r=je();kt(n,e,t,r)}Pc(e,t)}},mp=function(){return re},vp=function(e,t){var n=re;try{return re=e,t()}finally{re=n}},eu=function(e,t,n){switch(t){case"input":if(Ya(e,n),t=n.name,n.type==="radio"&&t!=null){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=Ys(r);if(!o)throw Error(H(90));$f(r),Ya(r,o)}}}break;case"textarea":Yf(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}},tp=Cc,np=gr;var C_={usingClientEntryPoint:!1,Events:[mi,Zr,Ys,Jf,ep,Cc]},Ii={findFiberByHostInstance:lr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},b_={bundleType:Ii.bundleType,version:Ii.version,rendererPackageName:Ii.rendererPackageName,rendererConfig:Ii.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=sp(e),e===null?null:e.stateNode},findFiberByHostInstance:Ii.findFiberByHostInstance||x_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Il.isDisabled&&Il.supportsFiber)try{Ts=Il.inject(b_),Ht=Il}catch{}}ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C_,ot.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Uc(t))throw Error(H(200));return O_(e,t,null,n)},ot.createRoot=function(e,t){if(!Uc(e))throw Error(H(299));var n=!1,r="",o=kg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=kc(e,1,!1,null,null,n,!1,r,o),e[ln]=t.current,pi(e.nodeType===8?e.parentNode:e),new Mc(t)},ot.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=sp(t),e=e===null?null:e.stateNode,e},ot.flushSync=function(e){return gr(e)},ot.hydrate=function(e,t,n){if(!Cl(t))throw Error(H(200));return bl(null,e,t,!0,n)},ot.hydrateRoot=function(e,t,n){if(!Uc(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=kg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Lg(t,null,e,1,n??null,o,!1,i,s),e[ln]=t.current,pi(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Tl(t)},ot.render=function(e,t,n){if(!Cl(t))throw Error(H(200));return bl(null,e,t,!1,n)},ot.unmountComponentAtNode=function(e){if(!Cl(e))throw Error(H(40));return e._reactRootContainer?(gr(function(){bl(null,null,e,!1,function(){e._reactRootContainer=null,e[ln]=null})}),!0):!1},ot.unstable_batchedUpdates=Cc,ot.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Cl(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return bl(e,t,n,!1,r)},ot.version="18.2.0-next-9e3b772b8-20220608";function Mg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mg)}catch(e){console.error(e)}}Mg(),bf.exports=ot;var Al=bf.exports,Ug=Al;Ia.createRoot=Ug.createRoot,Ia.hydrateRoot=Ug.hydrateRoot;var I_=Object.create,Fc=Object.defineProperty,A_=Object.getOwnPropertyDescriptor,L_=Object.getOwnPropertyNames,D_=Object.getPrototypeOf,k_=Object.prototype.hasOwnProperty,P_=(e,t,n)=>t in e?Fc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),U_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of L_(t))!k_.call(e,o)&&o!==n&&Fc(e,o,{get:()=>t[o],enumerable:!(r=A_(t,o))||r.enumerable});return e},F_=(e,t,n)=>(n=e!=null?I_(D_(e)):{},U_(t||!e||!e.__esModule?Fc(n,"default",{value:e,enumerable:!0}):n,e)),Fg=(e,t,n)=>(P_(e,typeof t!="symbol"?t+"":t,n),n),V_=M_((e,t)=>{(function(n,r){typeof define=="function"&&define.amd?define(r):typeof t=="object"&&t.exports?t.exports=r():n.log=r()})(e,function(){var n=function(){},r="undefined",o=typeof window!==r&&typeof window.navigator!==r&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(E,h){var g=E[h];if(typeof g.bind=="function")return g.bind(E);try{return Function.prototype.bind.call(g,E)}catch{return function(){return Function.prototype.apply.apply(g,[E,arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(E){return E==="debug"&&(E="log"),typeof console===r?!1:E==="trace"&&o?l:console[E]!==void 0?s(console,E):console.log!==void 0?s(console,"log"):n}function u(E,h){for(var g=0;g<i.length;g++){var S=i[g];this[S]=g<E?n:this.methodFactory(S,E,h)}this.log=this.debug}function c(E,h,g){return function(){typeof console!==r&&(u.call(this,h,g),this[E].apply(this,arguments))}}function d(E,h,g){return a(E)||c.apply(this,arguments)}function f(E,h,g){var S=this,_;h=h??"WARN";var w="loglevel";typeof E=="string"?w+=":"+E:typeof E=="symbol"&&(w=void 0);function N(I){var V=(i[I]||"silent").toUpperCase();if(!(typeof window===r||!w)){try{window.localStorage[w]=V;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+V+";"}catch{}}}function C(){var I;if(!(typeof window===r||!w)){try{I=window.localStorage[w]}catch{}if(typeof I===r)try{var V=window.document.cookie,$=V.indexOf(encodeURIComponent(w)+"=");$!==-1&&(I=/^([^;]+)/.exec(V.slice($))[1])}catch{}return S.levels[I]===void 0&&(I=void 0),I}}function L(){if(!(typeof window===r||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}S.name=E,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=g||d,S.getLevel=function(){return _},S.setLevel=function(I,V){if(typeof I=="string"&&S.levels[I.toUpperCase()]!==void 0&&(I=S.levels[I.toUpperCase()]),typeof I=="number"&&I>=0&&I<=S.levels.SILENT){if(_=I,V!==!1&&N(I),u.call(S,I,E),typeof console===r&&I<S.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+I},S.setDefaultLevel=function(I){h=I,C()||S.setLevel(I,!1)},S.resetLevel=function(){S.setLevel(h,!1),L()},S.enableAll=function(I){S.setLevel(S.levels.TRACE,I)},S.disableAll=function(I){S.setLevel(S.levels.SILENT,I)};var B=C();B==null&&(B=h),S.setLevel(B,!1)}var p=new f,m={};p.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var h=m[E];return h||(h=m[E]=new f(E,p.getLevel(),p.methodFactory)),h};var v=typeof window!==r?window.log:void 0;return p.noConflict=function(){return typeof window!==r&&window.log===p&&(window.log=v),p},p.getLoggers=function(){return m},p.default=p,p})}),B_=F_(V_(),1),$_=()=>new Date().toISOString(),Ai=B_.default.getLogger("signalwire"),z_=Ai.methodFactory;Ai.methodFactory=(e,t,n)=>{let r=z_(e,t,n);return function(...o){o.unshift($_(),"-"),r(...o)}};var H_=Ai.getLevel();Ai.setLevel(H_);var ct=()=>Ai,j_=e=>({id:e.id,type:e.type,data:e.data,position:e.position}),G_=e=>({id:e.id,source:e.source,sourceHandle:e.sourceHandle,target:e.target,targetHandle:e.targetHandle}),Vg=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Ll=e=>e.replace(/\s/g,""),Dl=e=>{if(!(!e||typeof e=="string"&&e.trim().length===0))try{return JSON.parse(e)}catch{return typeof e=="string"?e.trim():e}},Bg=e=>typeof e=="string"?e.trim():typeof e=="number"&&isNaN(e)||e==null||typeof e=="object"||typeof e=="function"||typeof e=="symbol"?"":String(e),Vc=({destinations:e,sessionTimeout:t,type:n})=>{let r=t===void 0?void 0:parseInt(t,10),o=r===void 0||Number.isNaN(r)||r<=0?void 0:r,i=e.map(l=>({from:"%{call.from}",to:Ll(l),session_timeout:o}));i.length||i.push({from:"%{call.from}",to:"",session_timeout:o});let s={switch:{variable:"connect_result",case:{connected:[]},default:[{switch:{variable:"connect_failed_reason",case:{busy:[],noAnswer:[],decline:[],error:[]},default:["hangup"]}}]}};switch(n){case"single":return[{connect:i[0]},s];case"serial":return[{connect:{serial:i}},s];case"parallel":return[{connect:{parallel:i}},s];default:return ct().warn(`The type '${n}' is not supported yet.`),[{connect:i[0]},s]}},Y_=/\bmale\b/i,W_=/\bfemale\b/i,K_=e=>{if(e){if(W_.test(e))return"female";if(Y_.test(e))return"male"}},$g=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=K_(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},zg=(e,t)=>{var n,r;if(typeof e=="object"&&!Array.isArray(e)){let o="url"in e?e.url:e.play,i,s=(n=t.text)==null?void 0:n.trim();if(Array.isArray(t.url)){let l=t.url.map(a=>a==null?void 0:a.trim()).filter(Boolean);i=(l==null?void 0:l.length)===1?l[0]:l}else i=(r=t.url)==null?void 0:r.trim();(!t.selected||t.selected==="url")&&i?o=i:(!t.selected||t.selected==="text")&&s&&(o=`say:${s}`),"url"in e?e.url=o:e.play=o}return e},Q_={answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",forwardAddress:({data:e})=>Vc(e),forwardPhone:({data:e})=>Vc(e),forwardResource:({data:e})=>Vc(e),hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let{volume:t}=e,n=$g(zg({url:"say:Unknown TTS"},e),e);return t&&(n.volume=t),{play:n}},promptPlay:({data:e})=>{let{initialTimeout:t,options:n,volume:r}=e,o=$g(zg({play:"say:Unknown value"},e),e);r&&(o.volume=r),t&&(o.initial_timeout=parseInt(t,10));let i=n.reduce((s,l)=>{let a=Vg(l.command);a&&s.speechHints.push(a);let u=Ll(l.digit);return u&&(s.maxDigits=Math.max(s.maxDigits,u.length)),s},{speechHints:[],maxDigits:-1});return i.speechHints.length&&(o.speech_hints=i.speechHints,o.speech_language="en-US"),i.maxDigits>0&&(o.max_digits=i.maxDigits),[{prompt:o},{switch:{variable:"prompt_result",case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{variable:"prompt_value",case:{},default:[]}}]}}]},handleCall:()=>"start",record:({data:e})=>{var t;return{record:{beep:e.beep,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStart:({data:e})=>{var t;return{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,end_silence_timeout:e.endSilenceTimeout,format:e.format,initial_timeout:e.initialTimeout,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStop:({data:e})=>({stop_record_call:e.controlId}),sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{from_number:Ll(t),to_number:Ll(n),body:r}}},set:({data:{variables:e}})=>{let t={};return e.forEach(({key:n,value:r})=>{t[n]=r}),{set:t}},unset:({data:{variables:e}})=>({unset:e.map(({key:t})=>t)}),request:({data:e})=>{let t=Dl(e.headers);return[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:typeof t=="object"&&Object.keys(t).length?t:void 0,body:Dl(e.body)}},{switch:{variable:"request_result",case:{success:[]},default:[]}}]},cond:()=>({cond:[]}),condRequest:({data:e})=>{let t=Dl(e.headers);return[{request:{url:e.url,method:e.method,timeout:e.timeout,connect_timeout:e.connectTimeout,save_variables:e.saveVariables,headers:typeof t=="object"&&Object.keys(t).length?t:void 0,body:Dl(e.body)}},{switch:{variable:"request_result",case:{success:[]},default:[]}}]}},ho=e=>{try{return Q_[e.__type](e.node)}catch(t){throw ct().error("Unknown Verb",e),t}},X_="1.0.0",q_=e=>{let t=ct(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,l="",a=_=>i.has(_),u=_=>o.has(_),c=_=>o.add(_);e.nodes.forEach(_=>{r.set(_.id,{node:_,children:[]}),_.type==="handleCall"&&(l=_.id)}),e.edges.forEach(_=>{let w=r.get(_.source),N=r.get(_.target);if(!w||!N)return t.warn("Invalid edge:",_);w.children.push(_.target),_.sourceHandle&&s.set(_.sourceHandle,N),n.has(_.target)&&i.set(_.target,[]),n.add(_.target)});let d=[...i.keys()],f=(_,w)=>{let N=s.get(w.id);if(N){let C=[];i.set(w.id,C),w.digit&&(_[w.digit]=C);let L=Vg(w.command);L&&(_[L]=C);let B=a(N.node.id);if(B){let I={transfer:N.node.id};w.digit&&_[w.digit].push(I),L&&!_[L].includes(I)&&_[L].push(I)}h({sectionName:B?N.node.id:w.id,current:N})}return _},p=(_,w)=>{let N=s.get(w.id);if(N){let C=[];i.set(w.id,C),_[w.result]=C;let L=a(N.node.id);L&&_[w.result].push({transfer:N.node.id}),h({sectionName:L?N.node.id:w.id,current:N})}return _},m={then:(_,w)=>{if(w.result!=="success")return _;let N=s.get(w.id);if(N){let C=[];i.set(w.id,C),_=C;let L=a(N.node.id);L&&_.push({transfer:N.node.id}),h({sectionName:L?N.node.id:w.id,current:N})}return _},else:(_,w)=>{if(w.result==="success")return _;let N=s.get(w.id);if(N){let C=[];i.set(w.id,C),_=C;let L=a(N.node.id);L&&_.push({transfer:N.node.id}),h({sectionName:L?N.node.id:w.id,current:N})}return _}},v={options:(_,w)=>{let N=s.get(w.id),C={when:w.value,then:[]};if(N){let L=[];i.set(w.id,L),C.then=L;let B=a(N.node.id);B&&C.then.push({transfer:N.node.id}),_.push(C),h({sectionName:B?N.node.id:w.id,current:N})}return _},fallback:_=>{let w=s.get(_),N={else:[]};if(w){let C=[];i.set(_,C),N.else=C;let L=a(w.node.id);L&&N.else.push({transfer:w.node.id}),h({sectionName:L?w.node.id:_,current:w})}return N}},E=_=>{let w=s.get(_),N=[];if(w){let C=[];i.set(_,C),N=C;let L=a(w.node.id);L&&N.push({transfer:w.node.id}),h({sectionName:L?w.node.id:_,current:w})}return N},h=({sectionName:_,current:w})=>{var C,L,B;if(u(w.node.id))return;c(w.node.id);let N=i.get(_);if(!N){t.warn("Unknown section name:",_);return}switch(w.node.type){case"promptPlay":{let I=ho({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid gather node",I);return}(L=(C=w.node.data)==null?void 0:C.results)!=null&&L.length&&(I[1].switch.case={...I[1].switch.case,...w.node.data.results.reduce(p,{})}),I[1].switch.default[0].switch.case=w.node.data.options.reduce(f,{}),(B=I[1].switch.case)!=null&&B.no_match&&(I[1].switch.default[0].switch.default=I[1].switch.case.no_match),N.push(...I);return}case"cond":{let I=ho({__type:w.node.type,node:w.node});I.cond=w.node.data.options.reduce(v.options,[]),I.cond.push(v.fallback(w.node.data.fallback)),N.push(I);return}case"condRequest":{let I=ho({__type:w.node.type,node:w.node}),V=w.node.data.options.reduce(v.options,[]),$=v.fallback(w.node.data.fallback),F={cond:[...V,$]};I[1].switch.case.success=[F],I[1].switch.default=E(w.node.data.error),N.push(...I);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let I=ho({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid connect node",I);return}w.node.data.options.length&&(I[1].switch.case.connected=w.node.data.options.reduce(m.then,[]),I[1].switch.default[0].switch.case=w.node.data.options.filter(V=>V.result!=="success").reduce(p,{})),N.push(...I);return}case"request":{let I=ho({__type:w.node.type,node:w.node});if(!Array.isArray(I)){t.warn("Invalid request node",I);return}I[1].switch.case.success=w.node.data.options.reduce(m.then,[]),I[1].switch.default=w.node.data.options.reduce(m.else,[]),N.push(...I);return}default:{let I=ho({__type:w.node.type,node:w.node});w.node.type!=="handleCall"&&N.push(I),w.children.forEach(V=>{let $=r.get(V);if(!$)return t.warn("Invalid Child Node",V);let F=a(V);F&&N.push({transfer:V}),h({sectionName:F?V:_,current:$})});break}}},g=r.get(l);g&&h({sectionName:"main",current:g});let S={};return d.forEach(_=>{let w=i.get(_);w&&(S[_]=w)}),t.debug("sections",JSON.stringify(S)),{version:X_,sections:S}},Hg=class extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Fg(this,"name","AuthError"),Object.setPrototypeOf(this,Hg.prototype)}},jg=class extends Error{constructor(e,t,n){super(t),this.code=e,this.message=t,this.response=n,Fg(this,"name","HttpError"),Object.setPrototypeOf(this,jg.prototype)}};async function Z_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new Hg(n.status,"Unauthorized");let r;try{r=await n.json()}catch{}let o=r!=null&&r.errors?JSON.stringify(r.errors):`Error Code: ${n.status}`;throw new jg(n.status,o,r)}try{n.parsedBody=await n.json()}catch{}return n}var J_=({timeout:e=3e4,...t},n=Z_)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=tw({...t,...o,headers:i});s.credentials="same-origin";let l;if(e){let a=new AbortController,u=a.signal;s.signal=u,l=setTimeout(()=>{a.abort()},e)}try{return{body:(await n(nw({url:r,searchParams:o==null?void 0:o.searchParams}),s)).parsedBody}}finally{l&&clearTimeout(l)}},ew=e=>typeof e=="string"?e:JSON.stringify(e),tw=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:ew(r)}:r!=null?{...t,[n]:r}:t,{}),nw=({url:e,searchParams:t})=>{let n=new URL(e);return t&&Object.entries(t).forEach(([r,o])=>{o!=null&&n.searchParams.append(r,o)}),n.toString()},rw=e=>{let t=ct(),n=J_(e);return{getFlow:async()=>{var r;try{let{body:o}=await n(e.getFlowURL);switch(t.info("getFlow",o),(r=o==null?void 0:o.flow_data)==null?void 0:r.builderVersion){case"0.0.0":return o.flow_data.nodes=o.flow_data.nodes.map(i=>{var s;return delete i.data.missingRequiredParams,i.data.initial=!1,(s=i==null?void 0:i.data)!=null&&s.initialTimeout&&(i.data.initialTimeout=Bg(i.data.initialTimeout)),(i.type==="play"||i.type==="promptPlay")&&!i.data.selected&&(i.data.url?i.data.selected="url":i.data.text&&(i.data.selected="text")),i}),o.flow_data.builderVersion="0.0.1",o;default:return o}}catch(o){if(t.error("Could not load flow. URL:",e.getFlowURL),o instanceof Error)throw o;return{}}},putFlow:async r=>{let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{builderVersion:r.builderVersion,nodes:r.nodes.map(j_),edges:r.edges.map(G_)},relayml:q_({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{method:"PUT",body:o});return t.info("putFlow",i.body),i.body},deployFlow:async r=>{let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{method:"POST",body:o});return t.info("deployFlow",i.body),i.body},getFlowVersions:async(r={})=>{let{pageNumber:o,pageSize:i}=r,s=new URLSearchParams;o&&s.append("page_number",String(o)),i&&s.append("page_size",String(i));let l=s.toString(),a=e.deployFlowURL+(l?`?${l}`:"");try{let{body:u}=await n(a);return t.info("getFlowVersions",u),u.data}catch(u){throw t.error("Could not load flow versions. URL:",a),u}}}};function et(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=et(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const Gg=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},o=()=>t,l={setState:r,getState:o,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{var a;((a={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:a.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,l),l},Yg=e=>e?Gg(e):Gg;var Wg={exports:{}},Kg={},Qg={exports:{}},Xg={};/**
|
|
45
45
|
* @license React
|
|
46
46
|
* use-sync-external-store-shim.production.min.js
|
|
47
47
|
*
|
|
@@ -49,7 +49,7 @@ Error generating stack: `+i.message+`
|
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/var
|
|
52
|
+
*/var go=R;function ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var iw=typeof Object.is=="function"?Object.is:ow,sw=go.useState,lw=go.useEffect,aw=go.useLayoutEffect,uw=go.useDebugValue;function cw(e,t){var n=t(),r=sw({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return aw(function(){o.value=n,o.getSnapshot=t,Bc(o)&&i({inst:o})},[e,n,t]),lw(function(){return Bc(o)&&i({inst:o}),e(function(){Bc(o)&&i({inst:o})})},[e]),uw(n),n}function Bc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!iw(e,n)}catch{return!0}}function dw(e,t){return t()}var fw=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?dw:cw;Xg.useSyncExternalStore=go.useSyncExternalStore!==void 0?go.useSyncExternalStore:fw,Qg.exports=Xg;var pw=Qg.exports;/**
|
|
53
53
|
* @license React
|
|
54
54
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
55
55
|
*
|
|
@@ -57,13 +57,13 @@ Error generating stack: `+i.message+`
|
|
|
57
57
|
*
|
|
58
58
|
* This source code is licensed under the MIT license found in the
|
|
59
59
|
* LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/var Ta=N,aw=Mc;function lw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uw=typeof Object.is=="function"?Object.is:lw,cw=aw.useSyncExternalStore,dw=Ta.useRef,fw=Ta.useEffect,pw=Ta.useMemo,hw=Ta.useDebugValue;Bg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=dw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=pw(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),o!==void 0&&s.hasValue){var m=s.value;if(o(m,h))return d=m}return d=h}if(m=d,uw(c,h))return m;var v=r(h);return o!==void 0&&o(m,v)?m:(c=h,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,o]);var a=cw(e,i[0],i[1]);return fw(function(){s.hasValue=!0,s.value=a},[a]),hw(a),a},function(e){e.exports=Bg}(X_);const gw=gf(Pc),{useSyncExternalStoreWithSelector:mw}=gw;function zg(e,t=e.getState,n){const r=mw(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return N.useDebugValue(r),r}const Hg=e=>{var t;((t={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Vg(e):e,r=(o,i)=>zg(n,o,i);return Object.assign(r,n),r},Ca=e=>e?Hg(e):Hg;function Je(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var vw={value:()=>{}};function ba(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ia(n)}function Ia(e){this._=e}function yw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ia.prototype=ba.prototype={constructor:Ia,on:function(e,t){var n=this._,r=yw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Ew(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=jg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=jg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ia(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},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)}};function Ew(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function jg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=vw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Fc="http://www.w3.org/1999/xhtml";const Yg={svg:"http://www.w3.org/2000/svg",xhtml:Fc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Aa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Yg.hasOwnProperty(t)?{space:Yg[t],local:e}:e}function Sw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Fc&&t.documentElement.namespaceURI===Fc?t.createElement(e):t.createElementNS(n,e)}}function _w(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Gg(e){var t=Aa(e);return(t.local?_w:Sw)(t)}function ww(){}function Vc(e){return e==null?ww:function(){return this.querySelector(e)}}function Rw(e){typeof e!="function"&&(e=Vc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ut(r,this._parents)}function Nw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ow(){return[]}function Wg(e){return e==null?Ow:function(){return this.querySelectorAll(e)}}function xw(e){return function(){return Nw(e.apply(this,arguments))}}function Tw(e){typeof e=="function"?e=xw(e):e=Wg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ut(r,o)}function Kg(e){return function(){return this.matches(e)}}function Qg(e){return function(t){return t.matches(e)}}var Cw=Array.prototype.find;function bw(e){return function(){return Cw.call(this.children,e)}}function Iw(){return this.firstElementChild}function Aw(e){return this.select(e==null?Iw:bw(typeof e=="function"?e:Qg(e)))}var Lw=Array.prototype.filter;function Dw(){return Array.from(this.children)}function kw(e){return function(){return Lw.call(this.children,e)}}function Pw(e){return this.selectAll(e==null?Dw:kw(typeof e=="function"?e:Qg(e)))}function Mw(e){typeof e!="function"&&(e=Kg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ut(r,this._parents)}function Xg(e){return new Array(e.length)}function Uw(){return new ut(this._enter||this._groups.map(Xg),this._parents)}function La(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}La.prototype={constructor:La,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)}};function Fw(e){return function(){return e}}function Vw(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new La(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function Bw(e,t,n,r,o,i,s){var a,l,u=new Map,c=t.length,d=i.length,f=new Array(c),h;for(a=0;a<c;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?o[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,i[a],a,i)+"",(l=u.get(h))?(r[a]=l,l.__data__=i[a],u.delete(h)):n[a]=new La(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function $w(e){return e.__data__}function zw(e,t){if(!arguments.length)return Array.from(this,$w);var n=t?Bw:Vw,r=this._parents,o=this._groups;typeof e!="function"&&(e=Fw(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h=Hw(e.call(c,c&&c.__data__,u,r)),m=h.length,v=a[u]=new Array(m),E=s[u]=new Array(m),p=l[u]=new Array(f);n(c,d,v,E,p,h,t);for(var g=0,S=0,_,w;g<m;++g)if(_=v[g]){for(g>=S&&(S=g+1);!(w=E[S])&&++S<m;);_._next=w||null}}return s=new ut(s,r),s._enter=a,s._exit=l,s}function Hw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jw(){return new ut(this._exit||this._groups.map(Xg),this._parents)}function Yw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Gw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),h,m=0;m<d;++m)(h=u[m]||c[m])&&(f[m]=h);for(;l<o;++l)a[l]=n[l];return new ut(a,this._parents)}function Ww(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Kw(e){e||(e=Qw);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new ut(o,this._parents).order()}function Qw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Xw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qw(){return Array.from(this)}function Zw(){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 s=r[o];if(s)return s}return null}function Jw(){let e=0;for(const t of this)++e;return e}function e1(){return!this.node()}function t1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function n1(e){return function(){this.removeAttribute(e)}}function r1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function o1(e,t){return function(){this.setAttribute(e,t)}}function i1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function s1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function a1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function l1(e,t){var n=Aa(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?r1:n1:typeof t=="function"?n.local?a1:s1:n.local?i1:o1)(n,t))}function qg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function u1(e){return function(){this.style.removeProperty(e)}}function c1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function d1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function f1(e,t,n){return arguments.length>1?this.each((t==null?u1:typeof t=="function"?d1:c1)(e,t,n??"")):go(this.node(),e)}function go(e,t){return e.style.getPropertyValue(t)||qg(e).getComputedStyle(e,null).getPropertyValue(t)}function p1(e){return function(){delete this[e]}}function h1(e,t){return function(){this[e]=t}}function g1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function m1(e,t){return arguments.length>1?this.each((t==null?p1:typeof t=="function"?g1:h1)(e,t)):this.node()[e]}function Zg(e){return e.trim().split(/^|\s+/)}function Bc(e){return e.classList||new Jg(e)}function Jg(e){this._node=e,this._names=Zg(e.getAttribute("class")||"")}Jg.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function em(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function tm(e,t){for(var n=Bc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function v1(e){return function(){em(this,e)}}function y1(e){return function(){tm(this,e)}}function E1(e,t){return function(){(t.apply(this,arguments)?em:tm)(this,e)}}function S1(e,t){var n=Zg(e+"");if(arguments.length<2){for(var r=Bc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?E1:t?v1:y1)(n,t))}function _1(){this.textContent=""}function w1(e){return function(){this.textContent=e}}function R1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function N1(e){return arguments.length?this.each(e==null?_1:(typeof e=="function"?R1:w1)(e)):this.node().textContent}function O1(){this.innerHTML=""}function x1(e){return function(){this.innerHTML=e}}function T1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function C1(e){return arguments.length?this.each(e==null?O1:(typeof e=="function"?T1:x1)(e)):this.node().innerHTML}function b1(){this.nextSibling&&this.parentNode.appendChild(this)}function I1(){return this.each(b1)}function A1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L1(){return this.each(A1)}function D1(e){var t=typeof e=="function"?e:Gg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function k1(){return null}function P1(e,t){var n=typeof e=="function"?e:Gg(e),r=t==null?k1:typeof t=="function"?t:Vc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function M1(){var e=this.parentNode;e&&e.removeChild(this)}function U1(){return this.each(M1)}function F1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function V1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function B1(e){return this.select(e?V1:F1)}function $1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function z1(e){return function(t){e.call(this,t,this.__data__)}}function H1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function j1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function Y1(e,t,n){return function(){var r=this.__on,o,i=z1(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function G1(e,t,n){var r=H1(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(o=0,c=a[l];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?Y1:j1,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function nm(e,t,n){var r=qg(e),o=r.CustomEvent;typeof o=="function"?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 W1(e,t){return function(){return nm(this,e,t)}}function K1(e,t){return function(){return nm(this,e,t.apply(this,arguments))}}function Q1(e,t){return this.each((typeof t=="function"?K1:W1)(e,t))}function*X1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var rm=[null];function ut(e,t){this._groups=e,this._parents=t}function bi(){return new ut([[document.documentElement]],rm)}function q1(){return this}ut.prototype=bi.prototype={constructor:ut,select:Rw,selectAll:Tw,selectChild:Aw,selectChildren:Pw,filter:Mw,data:zw,enter:Uw,exit:jw,join:Yw,merge:Gw,selection:q1,order:Ww,sort:Kw,call:Xw,nodes:qw,node:Zw,size:Jw,empty:e1,each:t1,attr:l1,style:f1,property:m1,classed:S1,text:N1,html:C1,raise:I1,lower:L1,append:D1,insert:P1,remove:U1,clone:B1,datum:$1,on:G1,dispatch:Q1,[Symbol.iterator]:X1};function At(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],rm)}function Z1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ht(e,t){if(e=Z1(e),t===void 0&&(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()),[r.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]}const J1={passive:!1},Ii={capture:!0,passive:!1};function $c(e){e.stopImmediatePropagation()}function mo(e){e.preventDefault(),e.stopImmediatePropagation()}function om(e){var t=e.document.documentElement,n=At(e).on("dragstart.drag",mo,Ii);"onselectstart"in t?n.on("selectstart.drag",mo,Ii):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function im(e,t){var n=e.document.documentElement,r=At(e).on("dragstart.drag",null);t&&(r.on("click.drag",mo,Ii),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 Da=e=>()=>e;function zc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}zc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function eR(e){return!e.ctrlKey&&!e.button}function tR(){return this.parentNode}function nR(e,t){return t??{x:e.x,y:e.y}}function rR(){return navigator.maxTouchPoints||"ontouchstart"in this}function oR(){var e=eR,t=tR,n=nR,r=rR,o={},i=ba("start","drag","end"),s=0,a,l,u,c,d=0;function f(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",E).on("touchmove.drag",p,J1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,w){if(!(c||!e.call(this,_,w))){var R=S(this,t.call(this,_,w),_,w,"mouse");R&&(At(_.view).on("mousemove.drag",m,Ii).on("mouseup.drag",v,Ii),om(_.view),$c(_),u=!1,a=_.clientX,l=_.clientY,R("start",_))}}function m(_){if(mo(_),!u){var w=_.clientX-a,R=_.clientY-l;u=w*w+R*R>d}o.mouse("drag",_)}function v(_){At(_.view).on("mousemove.drag mouseup.drag",null),im(_.view,u),mo(_),o.mouse("end",_)}function E(_,w){if(e.call(this,_,w)){var R=_.changedTouches,C=t.call(this,_,w),A=R.length,B,b;for(B=0;B<A;++B)(b=S(this,C,_,w,R[B].identifier,R[B]))&&($c(_),b("start",_,R[B]))}}function p(_){var w=_.changedTouches,R=w.length,C,A;for(C=0;C<R;++C)(A=o[w[C].identifier])&&(mo(_),A("drag",_,w[C]))}function g(_){var w=_.changedTouches,R=w.length,C,A;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<R;++C)(A=o[w[C].identifier])&&($c(_),A("end",_,w[C]))}function S(_,w,R,C,A,B){var b=i.copy(),V=Ht(B||R,w),$,F,O;if((O=n.call(_,new zc("beforestart",{sourceEvent:R,target:f,identifier:A,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:b}),C))!=null)return $=O.x-V[0]||0,F=O.y-V[1]||0,function P(D,I,T){var k=V,U;switch(D){case"start":o[A]=P,U=s++;break;case"end":delete o[A],--s;case"drag":V=Ht(T||I,w),U=s;break}b.call(D,_,new zc(D,{sourceEvent:I,subject:O,target:f,identifier:A,active:U,x:V[0]+$,y:V[1]+F,dx:V[0]-k[0],dy:V[1]-k[1],dispatch:b}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Da(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:Da(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Da(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Da(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Hc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ai(){}var Li=.7,ka=1/Li,vo="\\s*([+-]?\\d+)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iR=/^#([0-9a-f]{3,8})$/,sR=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),aR=new RegExp(`^rgb\\(${jt},${jt},${jt}\\)$`),lR=new RegExp(`^rgba\\(${vo},${vo},${vo},${Di}\\)$`),uR=new RegExp(`^rgba\\(${jt},${jt},${jt},${Di}\\)$`),cR=new RegExp(`^hsl\\(${Di},${jt},${jt}\\)$`),dR=new RegExp(`^hsla\\(${Di},${jt},${jt},${Di}\\)$`),am={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};Hc(Ai,ki,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:lm,formatHex:lm,formatHex8:fR,formatHsl:pR,formatRgb:um,toString:um});function lm(){return this.rgb().formatHex()}function fR(){return this.rgb().formatHex8()}function pR(){return hm(this).formatHsl()}function um(){return this.rgb().formatRgb()}function ki(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iR.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?cm(t):n===3?new et(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=sR.exec(e))?new et(t[1],t[2],t[3],1):(t=aR.exec(e))?new et(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lR.exec(e))?Pa(t[1],t[2],t[3],t[4]):(t=uR.exec(e))?Pa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cR.exec(e))?pm(t[1],t[2]/100,t[3]/100,1):(t=dR.exec(e))?pm(t[1],t[2]/100,t[3]/100,t[4]):am.hasOwnProperty(e)?cm(am[e]):e==="transparent"?new et(NaN,NaN,NaN,0):null}function cm(e){return new et(e>>16&255,e>>8&255,e&255,1)}function Pa(e,t,n,r){return r<=0&&(e=t=n=NaN),new et(e,t,n,r)}function hR(e){return e instanceof Ai||(e=ki(e)),e?(e=e.rgb(),new et(e.r,e.g,e.b,e.opacity)):new et}function jc(e,t,n,r){return arguments.length===1?hR(e):new et(e,t,n,r??1)}function et(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hc(et,jc,sm(Ai,{brighter(e){return e=e==null?ka:Math.pow(ka,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Li:Math.pow(Li,e),new et(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new et(mr(this.r),mr(this.g),mr(this.b),Ma(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:dm,formatHex:dm,formatHex8:gR,formatRgb:fm,toString:fm}));function dm(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function gR(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function fm(){const e=Ma(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Ma(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function pm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lt(e,t,n,r)}function hm(e){if(e instanceof Lt)return new Lt(e.h,e.s,e.l,e.opacity);if(e instanceof Ai||(e=ki(e)),!e)return new Lt;if(e instanceof Lt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new Lt(s,a,l,e.opacity)}function mR(e,t,n,r){return arguments.length===1?hm(e):new Lt(e,t,n,r??1)}function Lt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hc(Lt,mR,sm(Ai,{brighter(e){return e=e==null?ka:Math.pow(ka,e),new Lt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Li:Math.pow(Li,e),new Lt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,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 et(Yc(e>=240?e-240:e+120,o,r),Yc(e,o,r),Yc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Lt(gm(this.h),Ua(this.s),Ua(this.l),Ma(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=Ma(this.opacity);return`${e===1?"hsl(":"hsla("}${gm(this.h)}, ${Ua(this.s)*100}%, ${Ua(this.l)*100}%${e===1?")":`, ${e})`}`}}));function gm(e){return e=(e||0)%360,e<0?e+360:e}function Ua(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const mm=e=>()=>e;function vR(e,t){return function(n){return e+n*t}}function yR(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)}}function ER(e){return(e=+e)==1?vm:function(t,n){return n-t?yR(t,n,e):mm(isNaN(t)?n:t)}}function vm(e,t){var n=t-e;return n?vR(e,n):mm(isNaN(e)?t:e)}const ym=function e(t){var n=ER(t);function r(o,i){var s=n((o=jc(o)).r,(i=jc(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=vm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=a(c),o.b=l(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Un(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wc=new RegExp(Gc.source,"g");function SR(e){return function(){return e}}function _R(e){return function(t){return e(t)+""}}function wR(e,t){var n=Gc.lastIndex=Wc.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Gc.exec(e))&&(o=Wc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Un(r,o)})),n=Wc.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?_R(l[0].x):SR(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}var Em=180/Math.PI,Kc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Sm(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Em,skewX:Math.atan(l)*Em,scaleX:s,scaleY:a}}var Fa;function RR(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Kc:Sm(t.a,t.b,t.c,t.d,t.e,t.f)}function NR(e){return e==null||(Fa||(Fa=document.createElementNS("http://www.w3.org/2000/svg","g")),Fa.setAttribute("transform",e),!(e=Fa.transform.baseVal.consolidate()))?Kc:(e=e.matrix,Sm(e.a,e.b,e.c,e.d,e.e,e.f))}function _m(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:Un(u,d)},{i:v-2,x:Un(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Un(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Un(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function l(u,c,d,f,h,m){if(u!==d||c!==f){var v=h.push(o(h)+"scale(",null,",",null,")");m.push({i:v-4,x:Un(u,d)},{i:v-2,x:Un(c,f)})}else(d!==1||f!==1)&&h.push(o(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var m=-1,v=f.length,E;++m<v;)d[(E=f[m]).i]=E.x(h);return d.join("")}}}var OR=_m(RR,"px, ","px)","deg)"),xR=_m(NR,", ",")",")"),TR=1e-12;function wm(e){return((e=Math.exp(e))+1/e)/2}function CR(e){return((e=Math.exp(e))-1/e)/2}function bR(e){return((e=Math.exp(2*e))-1)/(e+1)}const IR=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],f=s[2],h=c-a,m=d-l,v=h*h+m*m,E,p;if(v<TR)p=Math.log(f/u)/t,E=function(C){return[a+C*h,l+C*m,u*Math.exp(t*C*p)]};else{var g=Math.sqrt(v),S=(f*f-u*u+r*v)/(2*u*n*g),_=(f*f-u*u-r*v)/(2*f*n*g),w=Math.log(Math.sqrt(S*S+1)-S),R=Math.log(Math.sqrt(_*_+1)-_);p=(R-w)/t,E=function(C){var A=C*p,B=wm(w),b=u/(n*g)*(B*bR(t*A+w)-CR(w));return[a+b*h,l+b*m,u*B/wm(t*A+w)]}}return E.duration=p*1e3*t/Math.SQRT2,E}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var yo=0,Pi=0,Mi=0,Rm=1e3,Va,Ui,Ba=0,yr=0,$a=0,Fi=typeof performance=="object"&&performance.now?performance:Date,Nm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qc(){return yr||(Nm(AR),yr=Fi.now()+$a)}function AR(){yr=0}function za(){this._call=this._time=this._next=null}za.prototype=Om.prototype={constructor:za,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Qc():+n)+(t==null?0:+t),!this._next&&Ui!==this&&(Ui?Ui._next=this:Va=this,Ui=this),this._call=e,this._time=n,Xc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xc())}};function Om(e,t,n){var r=new za;return r.restart(e,t,n),r}function LR(){Qc(),++yo;for(var e=Va,t;e;)(t=yr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yo}function xm(){yr=(Ba=Fi.now())+$a,yo=Pi=0;try{LR()}finally{yo=0,kR(),yr=0}}function DR(){var e=Fi.now(),t=e-Ba;t>Rm&&($a-=t,Ba=e)}function kR(){for(var e,t=Va,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Va=n);Ui=e,Xc(r)}function Xc(e){if(!yo){Pi&&(Pi=clearTimeout(Pi));var t=e-yr;t>24?(e<1/0&&(Pi=setTimeout(xm,e-Fi.now()-$a)),Mi&&(Mi=clearInterval(Mi))):(Mi||(Ba=Fi.now(),Mi=setInterval(DR,Rm)),yo=1,Nm(xm))}}function Tm(e,t,n){var r=new za;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var PR=ba("start","end","cancel","interrupt"),MR=[],Cm=0,bm=1,qc=2,Ha=3,Im=4,Zc=5,ja=6;function Ya(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;UR(e,n,{name:t,index:r,group:o,on:PR,tween:MR,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Cm})}function Jc(e,t){var n=Dt(e,t);if(n.state>Cm)throw new Error("too late; already scheduled");return n}function Yt(e,t){var n=Dt(e,t);if(n.state>Ha)throw new Error("too late; already running");return n}function Dt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function UR(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Om(i,0,n.time);function i(u){n.state=bm,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==bm)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Ha)return Tm(s);h.state===Im?(h.state=ja,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=ja,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Tm(function(){n.state===Ha&&(n.state=Im,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=qc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===qc){for(n.state=Ha,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Zc,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Zc&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ja,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Ga(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>qc&&r.state<Zc,r.state=ja,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function FR(e){return this.each(function(){Ga(this,e)})}function VR(e,t){var n,r;return function(){var o=Yt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function BR(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Yt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function $R(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Dt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?VR:BR)(n,e,t))}function ed(e,t,n){var r=e._id;return e.each(function(){var o=Yt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Dt(o,r).value[t]}}function Am(e,t){var n;return(typeof t=="number"?Un:t instanceof ki?ym:(n=ki(t))?(t=n,ym):wR)(e,t)}function zR(e){return function(){this.removeAttribute(e)}}function HR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function YR(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function GR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function WR(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function KR(e,t){var n=Aa(e),r=n==="transform"?xR:Am;return this.attrTween(e,typeof t=="function"?(n.local?WR:GR)(n,r,ed(this,"attr."+e,t)):t==null?(n.local?HR:zR)(n):(n.local?YR:jR)(n,r,t))}function QR(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function XR(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function qR(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&XR(e,i)),n}return o._value=t,o}function ZR(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&QR(e,i)),n}return o._value=t,o}function JR(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Aa(e);return this.tween(n,(r.local?qR:ZR)(r,t))}function eN(e,t){return function(){Jc(this,e).delay=+t.apply(this,arguments)}}function tN(e,t){return t=+t,function(){Jc(this,e).delay=t}}function nN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?eN:tN)(t,e)):Dt(this.node(),t).delay}function rN(e,t){return function(){Yt(this,e).duration=+t.apply(this,arguments)}}function oN(e,t){return t=+t,function(){Yt(this,e).duration=t}}function iN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?rN:oN)(t,e)):Dt(this.node(),t).duration}function sN(e,t){if(typeof t!="function")throw new Error;return function(){Yt(this,e).ease=t}}function aN(e){var t=this._id;return arguments.length?this.each(sN(t,e)):Dt(this.node(),t).ease}function lN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Yt(this,e).ease=n}}function uN(e){if(typeof e!="function")throw new Error;return this.each(lN(this._id,e))}function cN(e){typeof e!="function"&&(e=Kg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new cn(r,this._parents,this._name,this._id)}function dN(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),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new cn(s,this._parents,this._name,this._id)}function fN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function pN(e,t,n){var r,o,i=fN(t)?Jc:Yt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function hN(e,t){var n=this._id;return arguments.length<2?Dt(this.node(),n).on.on(e):this.each(pN(n,e,t))}function gN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function mN(){return this.on("end.remove",gN(this._id))}function vN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ya(u[f],t,n,f,u,Dt(c,n)));return new cn(i,this._parents,t,n)}function yN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wg(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,m=Dt(c,n),v=0,E=f.length;v<E;++v)(h=f[v])&&Ya(h,t,n,v,f,m);i.push(f),s.push(c)}return new cn(i,s,t,n)}var EN=bi.prototype.constructor;function SN(){return new EN(this._groups,this._parents)}function _N(e,t){var n,r,o;return function(){var i=go(this,e),s=(this.style.removeProperty(e),go(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Lm(e){return function(){this.style.removeProperty(e)}}function wN(e,t,n){var r,o=n+"",i;return function(){var s=go(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function RN(e,t,n){var r,o,i;return function(){var s=go(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),go(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function NN(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Yt(this,e),u=l.on,c=l.value[i]==null?a||(a=Lm(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),l.on=r}}function ON(e,t,n){var r=(e+="")=="transform"?OR:Am;return t==null?this.styleTween(e,_N(e,r)).on("end.style."+e,Lm(e)):typeof t=="function"?this.styleTween(e,RN(e,r,ed(this,"style."+e,t))).each(NN(this._id,e)):this.styleTween(e,wN(e,r,t),n).on("end.style."+e,null)}function xN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function TN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&xN(e,s,n)),r}return i._value=t,i}function CN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,TN(e,t,n??""))}function bN(e){return function(){this.textContent=e}}function IN(e){return function(){var t=e(this);this.textContent=t??""}}function AN(e){return this.tween("text",typeof e=="function"?IN(ed(this,"text",e)):bN(e==null?"":e+""))}function LN(e){return function(t){this.textContent=e.call(this,t)}}function DN(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&LN(o)),t}return r._value=e,r}function kN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,DN(e))}function PN(){for(var e=this._name,t=this._id,n=Dm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Dt(l,t);Ya(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new cn(r,this._parents,e,n)}function MN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Yt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var UN=0;function cn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Dm(){return++UN}var dn=bi.prototype;cn.prototype={constructor:cn,select:vN,selectAll:yN,selectChild:dn.selectChild,selectChildren:dn.selectChildren,filter:cN,merge:dN,selection:SN,transition:PN,call:dn.call,nodes:dn.nodes,node:dn.node,size:dn.size,empty:dn.empty,each:dn.each,on:hN,attr:KR,attrTween:JR,style:ON,styleTween:CN,text:AN,textTween:kN,remove:mN,tween:$R,delay:nN,duration:iN,ease:aN,easeVarying:uN,end:MN,[Symbol.iterator]:dn[Symbol.iterator]};function FN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var VN={time:null,delay:0,duration:250,ease:FN};function BN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function $N(e){var t,n;e instanceof cn?(t=e._id,e=e._name):(t=Dm(),(n=VN).time=Qc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Ya(l,e,t,u,s,n||BN(l,t));return new cn(r,this._parents,e,t)}bi.prototype.interrupt=FR,bi.prototype.transition=$N;const Wa=e=>()=>e;function zN(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 fn(e,t,n){this.k=e,this.x=t,this.y=n}fn.prototype={constructor:fn,scale:function(e){return e===1?this:new fn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fn(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 Fn=new fn(1,0,0);fn.prototype;function td(e){e.stopImmediatePropagation()}function Vi(e){e.preventDefault(),e.stopImmediatePropagation()}function HN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.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 km(){return this.__zoom||Fn}function YN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function GN(){return navigator.maxTouchPoints||"ontouchstart"in this}function WN(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function KN(){var e=HN,t=jN,n=WN,r=YN,o=GN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=IR,u=ba("start","zoom","end"),c,d,f,h=500,m=150,v=0,E=10;function p(O){O.property("__zoom",km).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",b).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(O,P,D,I){var T=O.selection?O.selection():O;T.property("__zoom",km),O!==T?w(O,P,D,I):T.interrupt().each(function(){R(this,arguments).event(I).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},p.scaleBy=function(O,P,D,I){p.scaleTo(O,function(){var T=this.__zoom.k,k=typeof P=="function"?P.apply(this,arguments):P;return T*k},D,I)},p.scaleTo=function(O,P,D,I){p.transform(O,function(){var T=t.apply(this,arguments),k=this.__zoom,U=D==null?_(T):typeof D=="function"?D.apply(this,arguments):D,z=k.invert(U),j=typeof P=="function"?P.apply(this,arguments):P;return n(S(g(k,j),U,z),T,s)},D,I)},p.translateBy=function(O,P,D,I){p.transform(O,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,I)},p.translateTo=function(O,P,D,I,T){p.transform(O,function(){var k=t.apply(this,arguments),U=this.__zoom,z=I==null?_(k):typeof I=="function"?I.apply(this,arguments):I;return n(Fn.translate(z[0],z[1]).scale(U.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof D=="function"?-D.apply(this,arguments):-D),k,s)},I,T)};function g(O,P){return P=Math.max(i[0],Math.min(i[1],P)),P===O.k?O:new fn(P,O.x,O.y)}function S(O,P,D){var I=P[0]-D[0]*O.k,T=P[1]-D[1]*O.k;return I===O.x&&T===O.y?O:new fn(O.k,I,T)}function _(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function w(O,P,D,I){O.on("start.zoom",function(){R(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(I).end()}).tween("zoom",function(){var T=this,k=arguments,U=R(T,k).event(I),z=t.apply(T,k),j=D==null?_(z):typeof D=="function"?D.apply(T,k):D,K=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),W=T.__zoom,J=typeof P=="function"?P.apply(T,k):P,X=l(W.invert(j).concat(K/W.k),J.invert(j).concat(K/J.k));return function(te){if(te===1)te=J;else{var oe=X(te),ge=K/oe[2];te=new fn(ge,j[0]-oe[0]*ge,j[1]-oe[1]*ge)}U.zoom(null,te)}})}function R(O,P,D){return!D&&O.__zooming||new C(O,P)}function C(O,P){this.that=O,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,P),this.taps=0}C.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,P){return this.mouse&&O!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var P=At(this.that).datum();u.call(O,this.that,new zN(O,{sourceEvent:this.sourceEvent,target:p,type:O,transform:this.that.__zoom,dispatch:u}),P)}};function A(O,...P){if(!e.apply(this,arguments))return;var D=R(this,P).event(O),I=this.__zoom,T=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,r.apply(this,arguments)))),k=Ht(O);if(D.wheel)(D.mouse[0][0]!==k[0]||D.mouse[0][1]!==k[1])&&(D.mouse[1]=I.invert(D.mouse[0]=k)),clearTimeout(D.wheel);else{if(I.k===T)return;D.mouse=[k,I.invert(k)],Ga(this),D.start()}Vi(O),D.wheel=setTimeout(U,m),D.zoom("mouse",n(S(g(I,T),D.mouse[0],D.mouse[1]),D.extent,s));function U(){D.wheel=null,D.end()}}function B(O,...P){if(f||!e.apply(this,arguments))return;var D=O.currentTarget,I=R(this,P,!0).event(O),T=At(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",K,!0),k=Ht(O,D),U=O.clientX,z=O.clientY;om(O.view),td(O),I.mouse=[k,this.__zoom.invert(k)],Ga(this),I.start();function j(W){if(Vi(W),!I.moved){var J=W.clientX-U,X=W.clientY-z;I.moved=J*J+X*X>v}I.event(W).zoom("mouse",n(S(I.that.__zoom,I.mouse[0]=Ht(W,D),I.mouse[1]),I.extent,s))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),im(W.view,I.moved),Vi(W),I.event(W).end()}}function b(O,...P){if(e.apply(this,arguments)){var D=this.__zoom,I=Ht(O.changedTouches?O.changedTouches[0]:O,this),T=D.invert(I),k=D.k*(O.shiftKey?.5:2),U=n(S(g(D,k),I,T),t.apply(this,P),s);Vi(O),a>0?At(this).transition().duration(a).call(w,U,I,O):At(this).call(p.transform,U,I,O)}}function V(O,...P){if(e.apply(this,arguments)){var D=O.touches,I=D.length,T=R(this,P,O.changedTouches.length===I).event(O),k,U,z,j;for(td(O),U=0;U<I;++U)z=D[U],j=Ht(z,this),j=[j,this.__zoom.invert(j),z.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,k=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),k&&(T.taps<2&&(d=j[0],c=setTimeout(function(){c=null},h)),Ga(this),T.start())}}function $(O,...P){if(this.__zooming){var D=R(this,P).event(O),I=O.changedTouches,T=I.length,k,U,z,j;for(Vi(O),k=0;k<T;++k)U=I[k],z=Ht(U,this),D.touch0&&D.touch0[2]===U.identifier?D.touch0[0]=z:D.touch1&&D.touch1[2]===U.identifier&&(D.touch1[0]=z);if(U=D.that.__zoom,D.touch1){var K=D.touch0[0],W=D.touch0[1],J=D.touch1[0],X=D.touch1[1],te=(te=J[0]-K[0])*te+(te=J[1]-K[1])*te,oe=(oe=X[0]-W[0])*oe+(oe=X[1]-W[1])*oe;U=g(U,Math.sqrt(te/oe)),z=[(K[0]+J[0])/2,(K[1]+J[1])/2],j=[(W[0]+X[0])/2,(W[1]+X[1])/2]}else if(D.touch0)z=D.touch0[0],j=D.touch0[1];else return;D.zoom("touch",n(S(U,z,j),D.extent,s))}}function F(O,...P){if(this.__zooming){var D=R(this,P).event(O),I=O.changedTouches,T=I.length,k,U;for(td(O),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),k=0;k<T;++k)U=I[k],D.touch0&&D.touch0[2]===U.identifier?delete D.touch0:D.touch1&&D.touch1[2]===U.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(U=Ht(U,this),Math.hypot(d[0]-U[0],d[1]-U[1])<E)){var z=At(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return p.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:Wa(+O),p):r},p.filter=function(O){return arguments.length?(e=typeof O=="function"?O:Wa(!!O),p):e},p.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:Wa(!!O),p):o},p.extent=function(O){return arguments.length?(t=typeof O=="function"?O:Wa([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),p):t},p.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],p):[i[0],i[1]]},p.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(O){return arguments.length?(n=O,p):n},p.duration=function(O){return arguments.length?(a=+O,p):a},p.interpolate=function(O){return arguments.length?(l=O,p):l},p.on=function(){var O=u.on.apply(u,arguments);return O===u?p:O},p.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,p):Math.sqrt(v)},p.tapDistance=function(O){return arguments.length?(E=+O,p):E},p}const Ka=N.createContext(null),QN=Ka.Provider,Vn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`},Pm=Vn.error001();function le(e,t){const n=N.useContext(Ka);if(n===null)throw new Error(Pm);return zg(n,e,t)}const Oe=()=>{const e=N.useContext(Ka);if(e===null)throw new Error(Pm);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},XN=e=>e.userSelectionActive?"none":"all";function nd({position:e,children:t,className:n,style:r,...o}){const i=le(XN),s=`${e}`.split("-");return y("div",{className:Ze(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function qN({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:y(nd,{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:y("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ZN=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c})=>{const d=N.useRef(null),[f,h]=N.useState({x:0,y:0,width:0,height:0}),m=Ze(["react-flow__edge-textwrapper",u]);return N.useEffect(()=>{if(d.current){const v=d.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:M("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...c,children:[o&&y("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),y("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var JN=N.memo(ZN);const rd=e=>({width:e.offsetWidth,height:e.offsetHeight}),Eo=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),od=(e={x:0,y:0},t)=>({x:Eo(e.x,t[0][0],t[1][0]),y:Eo(e.y,t[0][1],t[1][1])}),Mm=(e,t,n)=>e<t?Eo(Math.abs(e-t),1,50)/50:e>n?-Eo(Math.abs(e-n),1,50)/50:0,Um=(e,t)=>{const n=Mm(e.x,35,t.width-35)*20,r=Mm(e.y,35,t.height-35)*20;return[n,r]},Fm=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},eO=(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)}),Vm=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),tO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Bm=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),id=(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)},nO=e=>St(e.width)&&St(e.height)&&St(e.x)&&St(e.y),St=e=>!isNaN(e)&&isFinite(e),_e=Symbol.for("internals"),$m=["Enter"," ","Escape"],rO=(e,t)=>{},oO=e=>"nativeEvent"in e;function sd(e){var o,i;const t=oO(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const zm=e=>"clientX"in e,Bn=(e,t)=>{var i,s;const n=zm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},So=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l,style:u,markerEnd:c,markerStart:d,interactionWidth:f=20})=>M(Ee,{children:[y("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:d}),f&&y("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&St(t)&&St(n)?y(JN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:l}):null]});So.displayName="BaseEdge";function Bi(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Hm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function jm({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var $n;(function(e){e.Strict="strict",e.Loose="loose"})($n||($n={}));var _o;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(_o||(_o={}));var $i;(function(e){e.Partial="partial",e.Full="full"})($i||($i={}));var zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zn||(zn={}));var zi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zi||(zi={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));function Ym({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===G.Left||e===G.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Gm({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top}){const[s,a]=Ym({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=Ym({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,h]=jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,c,d,f,h]}const ad=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})=>{const[E,p,g]=Gm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return y(So,{path:E,labelX:p,labelY:g,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:v})});ad.displayName="SimpleBezierEdge";const Wm={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},iO=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.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},Km=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function sO({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:r=G.Top,center:o,offset:i}){const s=Wm[t],a=Wm[r],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=iO({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],m,v;const[E,p,g,S]=Hm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){m=o.x||E,v=o.y||p;const w=[{x:m,y:l.y},{x:m,y:u.y}],R=[{x:l.x,y:v},{x:u.x,y:v}];s[d]===f?h=d==="x"?w:R:h=d==="x"?R:w}else{const w=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(d==="x"?h=s.x===f?R:w:h=s.y===f?w:R,t!==r){const C=d==="x"?"y":"x",A=s[d]===a[C],B=l[C]>u[C],b=l[C]<u[C];(s[d]===1&&(!A&&B||A&&b)||s[d]!==1&&(!A&&b||A&&B))&&(h=d==="x"?w:R)}m=h[0].x,v=h[0].y}return[[e,l,...h,u,n],m,v,g,S]}function aO(e,t,n,r){const o=Math.min(Km(e,t)/2,Km(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function Hi({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,d,f,h,m]=sO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u});return[c.reduce((E,p,g)=>{let S="";return g>0&&g<c.length-1?S=aO(c[g-1],p,c[g+1],s):S=`${g===0?"M":"L"}${p.x} ${p.y}`,E+=S,E},""),d,f,h,m]}const Qa=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=G.Bottom,targetPosition:f=G.Top,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:E})=>{const[p,g,S]=Hi({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return y(So,{path:p,labelX:g,labelY:S,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:m,interactionWidth:E})});Qa.displayName="SmoothStepEdge";const ld=N.memo(e=>{var t;return y(Qa,{...e,pathOptions:N.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});ld.displayName="StepEdge";function lO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Hm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const ud=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[m,v,E]=lO({sourceX:e,sourceY:t,targetX:n,targetY:r});return y(So,{path:m,labelX:v,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});ud.displayName="StraightEdge";function Xa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qm({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case G.Left:return[t-Xa(t-r,i),n];case G.Right:return[t+Xa(r-t,i),n];case G.Top:return[t,n-Xa(n-o,i)];case G.Bottom:return[t,n+Xa(o-n,i)]}}function Xm({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,curvature:s=.25}){const[a,l]=Qm({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Qm({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,h,m]=jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${o}`,d,f,h,m]}const qa=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=G.Bottom,targetPosition:i=G.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,pathOptions:v,interactionWidth:E})=>{const[p,g,S]=Xm({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return y(So,{path:p,labelX:g,labelY:S,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:m,interactionWidth:E})});qa.displayName="BezierEdge";const cd=N.createContext(null),uO=cd.Provider;cd.Consumer;const cO=()=>N.useContext(cd),dO=e=>"id"in e&&"source"in e&&"target"in e,qm=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,dd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,fO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Zm=(e,t)=>{if(!e.source||!e.target)return t;let n;return dO(e)?n={...e}:n={...e,id:qm(e)},fO(n,t)?t:t.concat(n)},pO=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...i}=e;if(!t.source||!t.target||!n.find(l=>l.id===o))return n;const a={...i,id:r.shouldReplaceId?qm(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},Jm=({x:e,y:t},[n,r,o],i,[s,a])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},hO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),wo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},ev=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=wo(o,t).positionAbsolute;return eO(r,Vm({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tO(n)},tv=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:m=!1}=c;if(s&&!h||m)return!1;const{positionAbsolute:v}=wo(c,a),E={x:v.x,y:v.y,width:d||0,height:f||0},p=id(l,E),g=typeof d>"u"||typeof f>"u"||d===null||f===null,S=i&&p>0,_=(d||0)*(f||0);(g||S||p>=_||c.dragging)&&u.push(c)}),u},nv=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},rv=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),u=Eo(l,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},Er=(e,t=0)=>e.transition().duration(t);function ov(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function gO(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const mO={source:null,target:null,sourceHandle:null,targetHandle:null};function iv(e,t,n,r,o,i,s,a){const l=i==="target",u=a.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:d}=Bn(e),f=a.elementFromPoint(c,d),h=f!=null&&f.classList.contains("react-flow__handle")?f:u,m={handleDomNode:h,isValid:!1,connection:mO,endHandle:null};if(h){const v=sv(void 0,h),E=h.getAttribute("data-nodeid"),p=h.getAttribute("data-handleid"),g=h.classList.contains("connectable"),S=h.classList.contains("connectableend"),_={source:l?E:r,sourceHandle:l?p:o,target:l?r:E,targetHandle:l?o:p};m.connection=_,g&&S&&(n===$n.Strict?l&&v==="source"||!l&&v==="target":E!==r||p!==o)&&(m.endHandle={nodeId:E,handleId:p,type:v},m.isValid=s(_))}return m}function vO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[_e]){const{handleBounds:s}=i[_e];let a=[],l=[];s&&(a=ov(i,s,"source",`${t}-${n}-${r}`),l=ov(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function sv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function fd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function yO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function av({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=Fm(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:m,onConnectStart:v,panBy:E,getNodes:p,cancelConnection:g}=i();let S=0,_;const{x:w,y:R}=Bn(e),C=c==null?void 0:c.elementFromPoint(w,R),A=sv(l,C),B=f==null?void 0:f.getBoundingClientRect();if(!B||!A)return;let b,V=Bn(e,B),$=!1,F=null,O=!1,P=null;const D=vO({nodes:p(),nodeId:n,handleId:t,handleType:A}),I=()=>{if(!h)return;const[U,z]=Um(V,B);E({x:U,y:z}),S=requestAnimationFrame(I)};s({connectionPosition:V,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:A,connectionStartHandle:{nodeId:n,handleId:t,type:A},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:A});function T(U){const{transform:z}=i();V=Bn(U,B),_=gO(Jm(V,z,!1,[1,1]),m,D),$||(I(),$=!0);const j=iv(U,_,d,n,t,o?"target":"source",a,c);if(P=j.handleDomNode,F=j.connection,O=j.isValid,s({connectionPosition:_&&O?hO({x:_.x,y:_.y},z):V,connectionStatus:yO(!!_,O),connectionEndHandle:j.endHandle}),!_&&!O&&!P)return fd(b);F.source!==F.target&&P&&(fd(b),b=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",O),P.classList.toggle("react-flow__handle-valid",O))}function k(U){var z,j;(_||P)&&F&&O&&(r==null||r(F)),(j=(z=i()).onConnectEnd)==null||j.call(z,U),l&&(u==null||u(U)),fd(b),g(),cancelAnimationFrame(S),$=!1,O=!1,F=null,P=null,c.removeEventListener("mousemove",T),c.removeEventListener("mouseup",k),c.removeEventListener("touchmove",T),c.removeEventListener("touchend",k)}c.addEventListener("mousemove",T),c.addEventListener("mouseup",k),c.addEventListener("touchmove",T),c.addEventListener("touchend",k)}const lv=()=>!0,EO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),SO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},uv=N.forwardRef(({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var B,b;const m=s||null,v=e==="target",E=Oe(),p=cO(),{connectOnClick:g,noPanClassName:S}=le(EO,Je),{connecting:_,clickConnecting:w}=le(SO(p,m,e));p||(b=(B=E.getState()).onError)==null||b.call(B,"010",Vn.error010());const R=V=>{const{defaultEdgeOptions:$,onConnect:F,hasDefaultEdges:O}=E.getState(),P={...$,...V};if(O){const{edges:D,setEdges:I}=E.getState();I(Zm(P,D))}F==null||F(P),a==null||a(P)},C=V=>{if(!p)return;const $=zm(V);o&&($&&V.button===0||!$)&&av({event:V,handleId:m,nodeId:p,onConnect:R,isTarget:v,getState:E.getState,setState:E.setState,isValidConnection:n||E.getState().isValidConnection||lv}),$?c==null||c(V):d==null||d(V)},A=V=>{const{onClickConnectStart:$,onClickConnectEnd:F,connectionClickStartHandle:O,connectionMode:P,isValidConnection:D}=E.getState();if(!p||!O&&!o)return;if(!O){$==null||$(V,{nodeId:p,handleId:m,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:p,type:e,handleId:m}});return}const I=Fm(V.target),T=n||D||lv,{connection:k,isValid:U}=iv(V,{nodeId:p,id:m,type:e},P,O.nodeId,O.handleId||null,O.type,T,I);U&&R(k),F==null||F(V),E.setState({connectionClickStartHandle:null})};return y("div",{"data-handleid":m,"data-nodeid":p,"data-handlepos":t,"data-id":`${p}-${m}-${e}`,className:Ze(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:w,connectionindicator:r&&(o&&!_||i&&_)}]),onMouseDown:C,onTouchStart:C,onClick:g?A:void 0,ref:h,...f,children:l})});uv.displayName="Handle";var Ro=N.memo(uv);const cv=({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:r=G.Bottom})=>M(Ee,{children:[y(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,y(Ro,{type:"source",position:r,isConnectable:t})]});cv.displayName="DefaultNode";var pd=N.memo(cv);const dv=({data:e,isConnectable:t,sourcePosition:n=G.Bottom})=>M(Ee,{children:[e==null?void 0:e.label,y(Ro,{type:"source",position:n,isConnectable:t})]});dv.displayName="InputNode";var fv=N.memo(dv);const pv=({data:e,isConnectable:t,targetPosition:n=G.Top})=>M(Ee,{children:[y(Ro,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});pv.displayName="OutputNode";var hv=N.memo(pv);const hd=()=>null;hd.displayName="GroupNode";const _O=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Za=e=>e.id;function wO(e,t){return Je(e.selectedNodes.map(Za),t.selectedNodes.map(Za))&&Je(e.selectedEdges.map(Za),t.selectedEdges.map(Za))}const gv=N.memo(({onSelectionChange:e})=>{const t=Oe(),{selectedNodes:n,selectedEdges:r}=le(_O,wO);return N.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});gv.displayName="SelectionListener";const RO=e=>!!e.onSelectionChange;function NO({onSelectionChange:e}){const t=le(RO);return e||t?y(gv,{onSelectionChange:e}):null}const OO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function No(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Z(e,t,n){N.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const xO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:v,maxZoom:E,nodeExtent:p,onNodesChange:g,onEdgesChange:S,elementsSelectable:_,connectionMode:w,snapGrid:R,snapToGrid:C,translateExtent:A,connectOnClick:B,defaultEdgeOptions:b,fitView:V,fitViewOptions:$,onNodesDelete:F,onEdgesDelete:O,onNodeDrag:P,onNodeDragStart:D,onNodeDragStop:I,onSelectionDrag:T,onSelectionDragStart:k,onSelectionDragStop:U,noPanClassName:z,nodeOrigin:j,rfId:K,autoPanOnConnect:W,autoPanOnNodeDrag:J,onError:X,connectionRadius:te,isValidConnection:oe})=>{const{setNodes:ge,setEdges:ue,setDefaultNodesAndEdges:xe,setMinZoom:Ye,setMaxZoom:ft,setTranslateExtent:me,setNodeExtent:de,reset:tt}=le(OO,Je),Q=Oe();return N.useEffect(()=>{const Jn=r==null?void 0:r.map(Tr=>({...Tr,...b}));return xe(n,Jn),()=>{tt()}},[]),Z("defaultEdgeOptions",b,Q.setState),Z("connectionMode",w,Q.setState),Z("onConnect",o,Q.setState),Z("onConnectStart",i,Q.setState),Z("onConnectEnd",s,Q.setState),Z("onClickConnectStart",a,Q.setState),Z("onClickConnectEnd",l,Q.setState),Z("nodesDraggable",u,Q.setState),Z("nodesConnectable",c,Q.setState),Z("nodesFocusable",d,Q.setState),Z("edgesFocusable",f,Q.setState),Z("edgesUpdatable",h,Q.setState),Z("elementsSelectable",_,Q.setState),Z("elevateNodesOnSelect",m,Q.setState),Z("snapToGrid",C,Q.setState),Z("snapGrid",R,Q.setState),Z("onNodesChange",g,Q.setState),Z("onEdgesChange",S,Q.setState),Z("connectOnClick",B,Q.setState),Z("fitViewOnInit",V,Q.setState),Z("fitViewOnInitOptions",$,Q.setState),Z("onNodesDelete",F,Q.setState),Z("onEdgesDelete",O,Q.setState),Z("onNodeDrag",P,Q.setState),Z("onNodeDragStart",D,Q.setState),Z("onNodeDragStop",I,Q.setState),Z("onSelectionDrag",T,Q.setState),Z("onSelectionDragStart",k,Q.setState),Z("onSelectionDragStop",U,Q.setState),Z("noPanClassName",z,Q.setState),Z("nodeOrigin",j,Q.setState),Z("rfId",K,Q.setState),Z("autoPanOnConnect",W,Q.setState),Z("autoPanOnNodeDrag",J,Q.setState),Z("onError",X,Q.setState),Z("connectionRadius",te,Q.setState),Z("isValidConnection",oe,Q.setState),No(e,ge),No(t,ue),No(v,Ye),No(E,ft),No(A,me),No(p,de),null},mv={display:"none"},TO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},vv="react-flow__node-desc",yv="react-flow__edge-desc",CO="react-flow__aria-live",bO=e=>e.ariaLiveMessage;function IO({rfId:e}){const t=le(bO);return y("div",{id:`${CO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:TO,children:t})}function AO({rfId:e,disableKeyboardA11y:t}){return M(Ee,{children:[M("div",{id:`${vv}-${e}`,style:mv,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),y("div",{id:`${yv}-${e}`,style:mv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&y(IO,{rfId:e})]})}const LO=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,DO=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,Ev="react-flow__edgeupdater",Sv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>y("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Ze([Ev,`${Ev}-${a}`]),cx:LO(t,r,e),cy:DO(n,r,e),r,stroke:"transparent",fill:"transparent"}),kO=()=>!0;var Oo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,style:E,source:p,target:g,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:A,elementsSelectable:B,hidden:b,sourceHandleId:V,targetHandleId:$,onContextMenu:F,onMouseEnter:O,onMouseMove:P,onMouseLeave:D,edgeUpdaterRadius:I,onEdgeUpdate:T,onEdgeUpdateStart:k,onEdgeUpdateEnd:U,markerEnd:z,markerStart:j,rfId:K,ariaLabel:W,isFocusable:J,isUpdatable:X,pathOptions:te,interactionWidth:oe})=>{const ge=N.useRef(null),[ue,xe]=N.useState(!1),[Ye,ft]=N.useState(!1),me=Oe(),de=N.useMemo(()=>`url(#${dd(j,K)})`,[j,K]),tt=N.useMemo(()=>`url(#${dd(z,K)})`,[z,K]);if(b)return null;const Q=nt=>{const{edges:Ut,addSelectedEdges:Ir}=me.getState();if(B&&(me.setState({nodesSelectionActive:!1}),Ir([n])),s){const Ar=Ut.find(Lr=>Lr.id===n);s(nt,Ar)}},Jn=Bi(n,me.getState,a),Tr=Bi(n,me.getState,F),as=Bi(n,me.getState,O),ls=Bi(n,me.getState,P),ko=Bi(n,me.getState,D),Cr=(nt,Ut)=>{if(nt.button!==0)return;const{edges:Ir,isValidConnection:Ar}=me.getState(),Lr=Ut?g:p,yl=(Ut?$:V)||null,Dr=Ut?"target":"source",df=Ar||kO,ff=Ut,cs=Ir.find(kr=>kr.id===n);ft(!0),k==null||k(nt,cs,Dr);const pf=kr=>{ft(!1),U==null||U(kr,cs,Dr)};av({event:nt,handleId:yl,nodeId:Lr,onConnect:kr=>T==null?void 0:T(cs,kr),isTarget:ff,getState:me.getState,setState:me.setState,isValidConnection:df,edgeUpdaterType:Dr,onEdgeUpdateEnd:pf})},er=nt=>Cr(nt,!0),Po=nt=>Cr(nt,!1),tr=()=>xe(!0),br=()=>xe(!1),us=!B&&!s,Mo=nt=>{var Ut;if($m.includes(nt.key)&&B){const{unselectNodesAndEdges:Ir,addSelectedEdges:Ar,edges:Lr}=me.getState();nt.key==="Escape"?((Ut=ge.current)==null||Ut.blur(),Ir({edges:[Lr.find(Dr=>Dr.id===n)]})):Ar([n])}};return M("g",{className:Ze(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:u,inactive:us,updating:ue}]),onClick:Q,onDoubleClick:Jn,onContextMenu:Tr,onMouseEnter:as,onMouseMove:ls,onMouseLeave:ko,onKeyDown:J?Mo:void 0,tabIndex:J?0:void 0,role:J?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${p} to ${g}`,"aria-describedby":J?`${yv}-${K}`:void 0,ref:ge,children:[!Ye&&y(e,{id:n,source:p,target:g,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:v,data:i,style:E,sourceX:S,sourceY:_,targetX:w,targetY:R,sourcePosition:C,targetPosition:A,sourceHandleId:V,targetHandleId:$,markerStart:de,markerEnd:tt,pathOptions:te,interactionWidth:oe}),X&&M(Ee,{children:[(X==="source"||X===!0)&&y(Sv,{position:C,centerX:S,centerY:_,radius:I,onMouseDown:er,onMouseEnter:tr,onMouseOut:br,type:"source"}),(X==="target"||X===!0)&&y(Sv,{position:A,centerX:w,centerY:R,radius:I,onMouseDown:Po,onMouseEnter:tr,onMouseOut:br,type:"target"})]})]})};return t.displayName="EdgeWrapper",N.memo(t)};function PO(e){const t={default:Oo(e.default||qa),straight:Oo(e.bezier||ud),step:Oo(e.step||ld),smoothstep:Oo(e.step||Qa),simplebezier:Oo(e.simplebezier||ad)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Oo(e[i]||qa),o),n);return{...t,...r}}function _v(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case G.Top:return{x:r+i/2,y:o};case G.Right:return{x:r+i,y:o+s/2};case G.Bottom:return{x:r+i/2,y:o+s};case G.Left:return{x:r,y:o+s/2}}}function wv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const MO=(e,t,n,r,o,i)=>{const s=_v(n,e,t),a=_v(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function UO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Vm({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Rv(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[_e])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Nv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Nv(n,t):!1}function Ov(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function FO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Nv(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function xv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=u&&St(c)&&St(d)&&St(u.width)&&St(u.height)?[[c+e.width*o[0],d+e.height*o[1]],[c+u.width-e.width+e.width*o[0],d+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",Vn.error005()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:d}=wo(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+d],[e.extent[1][0]+c,e.extent[1][1]+d]]}let a={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);a=wo(u,o).positionAbsolute}const l=s?od(t,s):t;return{position:{x:l.x-a.x,y:l.y-a.y},positionAbsolute:l}}function gd({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Tv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...rd(l)}})};function ji(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function md({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a}=t.getState(),l=a.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function VO(){const e=Oe();return N.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:i?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function vd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Cv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=Oe(),[l,u]=N.useState(!1),c=N.useRef([]),d=N.useRef({x:null,y:null}),f=N.useRef(0),h=N.useRef(null),m=N.useRef({x:0,y:0}),v=N.useRef(null),E=N.useRef(!1),p=VO();return N.useEffect(()=>{if(e!=null&&e.current){const g=At(e.current),S=({x:w,y:R})=>{const{nodeInternals:C,onNodeDrag:A,onSelectionDrag:B,updateNodePositions:b,nodeExtent:V,snapGrid:$,snapToGrid:F,nodeOrigin:O,onError:P}=a.getState();d.current={x:w,y:R};let D=!1;if(c.current=c.current.map(T=>{const k={x:w-T.distance.x,y:R-T.distance.y};F&&(k.x=$[0]*Math.round(k.x/$[0]),k.y=$[1]*Math.round(k.y/$[1]));const U=xv(T,k,C,V,O,P);return D=D||T.position.x!==U.position.x||T.position.y!==U.position.y,T.position=U.position,T.positionAbsolute=U.positionAbsolute,T}),!D)return;b(c.current,!0,!0),u(!0);const I=o?A:vd(B);if(I&&v.current){const[T,k]=gd({nodeId:o,dragItems:c.current,nodeInternals:C});I(v.current,T,k)}},_=()=>{if(!h.current)return;const[w,R]=Um(m.current,h.current);if(w!==0||R!==0){const{transform:C,panBy:A}=a.getState();d.current.x=(d.current.x??0)-w/C[2],d.current.y=(d.current.y??0)-R/C[2],S(d.current),A({x:w,y:R})}f.current=requestAnimationFrame(_)};if(t)g.on(".drag",null);else{const w=oR().on("start",R=>{var D;const{nodeInternals:C,multiSelectionActive:A,domNode:B,nodesDraggable:b,unselectNodesAndEdges:V,onNodeDragStart:$,onSelectionDragStart:F}=a.getState(),O=o?$:vd(F);!s&&!A&&o&&((D=C.get(o))!=null&&D.selected||V()),o&&i&&s&&md({id:o,store:a,nodeRef:e});const P=p(R);if(d.current=P,c.current=FO(C,b,P,o),O&&c.current){const[I,T]=gd({nodeId:o,dragItems:c.current,nodeInternals:C});O(R.sourceEvent,I,T)}h.current=(B==null?void 0:B.getBoundingClientRect())||null,m.current=Bn(R.sourceEvent,h.current)}).on("drag",R=>{const C=p(R),{autoPanOnNodeDrag:A}=a.getState();!E.current&&A&&(E.current=!0,_()),(d.current.x!==C.xSnapped||d.current.y!==C.ySnapped)&&c.current&&(v.current=R.sourceEvent,m.current=Bn(R.sourceEvent,h.current),S(C))}).on("end",R=>{if(u(!1),E.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:C,nodeInternals:A,onNodeDragStop:B,onSelectionDragStop:b}=a.getState(),V=o?B:vd(b);if(C(c.current,!1,!1),V){const[$,F]=gd({nodeId:o,dragItems:c.current,nodeInternals:A});V(R.sourceEvent,$,F)}}}).filter(R=>{const C=R.target;return!R.button&&(!n||!Ov(C,`.${n}`,e))&&(!r||Ov(C,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,p]),l}function bv(){const e=Oe();return N.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),f=a?l[0]:5,h=a?l[1]:5,m=n.isShiftPressed?4:1,v=n.x*f*m,E=n.y*h*m,p=d.map(g=>{if(g.positionAbsolute){const S={x:g.positionAbsolute.x+v,y:g.positionAbsolute.y+E};a&&(S.x=l[0]*Math.round(S.x/l[0]),S.y=l[1]*Math.round(S.y/l[1]));const{positionAbsolute:_,position:w}=xv(g,S,r,o,void 0,u);g.position=w,g.positionAbsolute=_}return g});i(p,!0,!1)},[])}const xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Yi=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:m,onDoubleClick:v,style:E,className:p,isDraggable:g,isSelectable:S,isConnectable:_,isFocusable:w,selectNodesOnDrag:R,sourcePosition:C,targetPosition:A,hidden:B,resizeObserver:b,dragHandle:V,zIndex:$,isParent:F,noDragClassName:O,noPanClassName:P,initialized:D,disableKeyboardA11y:I,ariaLabel:T,rfId:k})=>{const U=Oe(),z=N.useRef(null),j=N.useRef(C),K=N.useRef(A),W=N.useRef(r),J=S||g||c||d||f||h,X=bv(),te=ji(n,U.getState,d),oe=ji(n,U.getState,f),ge=ji(n,U.getState,h),ue=ji(n,U.getState,m),xe=ji(n,U.getState,v),Ye=de=>{if(S&&(!R||!g)&&md({id:n,store:U,nodeRef:z}),c){const tt=U.getState().nodeInternals.get(n);c(de,{...tt})}},ft=de=>{if(!sd(de))if($m.includes(de.key)&&S){const tt=de.key==="Escape";md({id:n,store:U,unselect:tt,nodeRef:z})}else!I&&g&&u&&Object.prototype.hasOwnProperty.call(xo,de.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${de.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),X({x:xo[de.key].x,y:xo[de.key].y,isShiftPressed:de.shiftKey}))};N.useEffect(()=>{if(z.current&&!B){const de=z.current;return b==null||b.observe(de),()=>b==null?void 0:b.unobserve(de)}},[B]),N.useEffect(()=>{const de=W.current!==r,tt=j.current!==C,Q=K.current!==A;z.current&&(de||tt||Q)&&(de&&(W.current=r),tt&&(j.current=C),Q&&(K.current=A),U.getState().updateNodeDimensions([{id:n,nodeElement:z.current,forceUpdate:!0}]))},[n,r,C,A]);const me=Cv({nodeRef:z,disabled:B||!g,noDragClassName:O,handleSelector:V,nodeId:n,isSelectable:S,selectNodesOnDrag:R});return B?null:y("div",{className:Ze(["react-flow__node",`react-flow__node-${r}`,{[P]:g},p,{selected:u,selectable:S,parent:F,dragging:me}]),ref:z,style:{zIndex:$,transform:`translate(${a}px,${l}px)`,pointerEvents:J?"all":"none",visibility:D?"visible":"hidden",...E},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:te,onMouseMove:oe,onMouseLeave:ge,onContextMenu:ue,onClick:Ye,onDoubleClick:xe,onKeyDown:w?ft:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":I?void 0:`${vv}-${k}`,"aria-label":T,children:y(uO,{value:n,children:y(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:_,sourcePosition:C,targetPosition:A,dragging:me,dragHandle:V,zIndex:$})})})};return t.displayName="NodeWrapper",N.memo(t)};function BO(e){const t={input:Yi(e.input||fv),default:Yi(e.default||pd),output:Yi(e.output||hv),group:Yi(e.group||hd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Yi(e[i]||pd),o),n);return{...t,...r}}const $O=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},zO=typeof document<"u"?document:null;var Gi=(e=null,t={target:zO})=>{const[n,r]=N.useState(!1),o=N.useRef(!1),i=N.useRef(new Set([])),[s,a]=N.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return N.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&sd(h))return!1;const m=Av(h.code,a);i.current.add(h[m]),Iv(s,i.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!o.current&&sd(h))return!1;const m=Av(h.code,a);Iv(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[m]),o.current=!1},f=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,m;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(m=t==null?void 0:t.target)==null||m.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function Iv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Av(e,t){return t.includes(e)?"code":"key"}function Lv(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=wo(o,r);return Lv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[_e])==null?void 0:s.z)??0)>(n.z??0)?((a=o[_e])==null?void 0:a.z)??0:n.z??0},r)}function Dv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:a}=Lv(r,e,{...r.position,z:((o=r[_e])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[_e].z=a,n!=null&&n[r.id]&&(r[_e].isParent=!0)}})}function yd(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var d;const l=(St(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(c.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(c,_e,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[_e])==null?void 0:d.handleBounds,z:l}}),o.set(a.id,c)}),Dv(o,n,i),o}function kv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(a&&l&&(f||!t.initial)){const m=n().filter(E=>{var g;const p=t.includeHiddenNodes?E.width&&E.height:!E.hidden;return(g=t.nodes)!=null&&g.length?p&&t.nodes.some(S=>S.id===E.id):p}),v=m.every(E=>E.width&&E.height);if(m.length>0&&v){const E=ev(m,d),[p,g,S]=rv(E,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),_=Fn.translate(p,g).scale(S);return typeof t.duration=="number"&&t.duration>0?a.transform(Er(l,t.duration),_):a.transform(l,_),!0}}return!1}function HO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[_e]:r[_e],selected:n.selected})}),new Map(t)}function jO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function Ja({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:HO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:jO(t,i)}),a==null||a(t))}const To=()=>{},YO={zoomIn:To,zoomOut:To,zoomTo:To,getZoom:()=>1,setViewport:To,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:To,fitBounds:To,project:e=>e,viewportInitialized:!1},GO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),WO=()=>{const e=Oe(),{d3Zoom:t,d3Selection:n}=le(GO,Je);return N.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(Er(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(Er(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(Er(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,u=Fn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(Er(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>kv(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,d=a/2-o*c,f=l/2-i*c,h=Fn.translate(d,f).scale(c);t.transform(Er(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=rv(o,s,a,l,u,(i==null?void 0:i.padding)??.1),h=Fn.translate(c,d).scale(f);t.transform(Er(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return Jm(o,i,s,a)},viewportInitialized:!0}:YO,[t,n])};function Ed(){const e=WO(),t=Oe(),n=N.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=N.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=N.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(E=>({...E}))},[]),i=N.useCallback(v=>{const{edges:E=[]}=t.getState();return E.find(p=>p.id===v)},[]),s=N.useCallback(v=>{const{getNodes:E,setNodes:p,hasDefaultNodes:g,onNodesChange:S}=t.getState(),_=E(),w=typeof v=="function"?v(_):v;if(g)p(w);else if(S){const R=w.length===0?_.map(C=>({type:"remove",id:C.id})):w.map(C=>({item:C,type:"reset"}));S(R)}},[]),a=N.useCallback(v=>{const{edges:E=[],setEdges:p,hasDefaultEdges:g,onEdgesChange:S}=t.getState(),_=typeof v=="function"?v(E):v;if(g)p(_);else if(S){const w=_.length===0?E.map(R=>({type:"remove",id:R.id})):_.map(R=>({item:R,type:"reset"}));S(w)}},[]),l=N.useCallback(v=>{const E=Array.isArray(v)?v:[v],{getNodes:p,setNodes:g,hasDefaultNodes:S,onNodesChange:_}=t.getState();if(S){const R=[...p(),...E];g(R)}else if(_){const w=E.map(R=>({item:R,type:"add"}));_(w)}},[]),u=N.useCallback(v=>{const E=Array.isArray(v)?v:[v],{edges:p=[],setEdges:g,hasDefaultEdges:S,onEdgesChange:_}=t.getState();if(S)g([...p,...E]);else if(_){const w=E.map(R=>({item:R,type:"add"}));_(w)}},[]),c=N.useCallback(()=>{const{getNodes:v,edges:E=[],transform:p}=t.getState(),[g,S,_]=p;return{nodes:v().map(w=>({...w})),edges:E.map(w=>({...w})),viewport:{x:g,y:S,zoom:_}}},[]),d=N.useCallback(({nodes:v,edges:E})=>{const{nodeInternals:p,getNodes:g,edges:S,hasDefaultNodes:_,hasDefaultEdges:w,onNodesDelete:R,onEdgesDelete:C,onNodesChange:A,onEdgesChange:B}=t.getState(),b=(v||[]).map(P=>P.id),V=(E||[]).map(P=>P.id),$=g().reduce((P,D)=>{const I=!b.includes(D.id)&&D.parentNode&&P.find(k=>k.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(b.includes(D.id)||I)&&P.push(D),P},[]),F=S.filter(P=>typeof P.deletable=="boolean"?P.deletable:!0),O=F.filter(P=>V.includes(P.id));if($||O){const P=nv($,F),D=[...O,...P],I=D.reduce((T,k)=>(T.includes(k.id)||T.push(k.id),T),[]);if((w||_)&&(w&&t.setState({edges:S.filter(T=>!I.includes(T.id))}),_&&($.forEach(T=>{p.delete(T.id)}),t.setState({nodeInternals:new Map(p)}))),I.length>0&&(C==null||C(D),B&&B(I.map(T=>({id:T,type:"remove"})))),$.length>0&&(R==null||R($),A)){const T=$.map(k=>({id:k.id,type:"remove"}));A(T)}}},[]),f=N.useCallback(v=>{const E=nO(v),p=E?null:t.getState().nodeInternals.get(v.id);return[E?v:Bm(p),p,E]},[]),h=N.useCallback((v,E=!0,p)=>{const[g,S,_]=f(v);return g?(p||t.getState().getNodes()).filter(w=>{if(!_&&(w.id===S.id||!w.positionAbsolute))return!1;const R=Bm(w),C=id(R,g);return E&&C>0||C>=v.width*v.height}):[]},[]),m=N.useCallback((v,E,p=!0)=>{const[g]=f(v);if(!g)return!1;const S=id(g,E);return p&&S>0||S>=v.width*v.height},[]);return N.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:m}),[e,n,r,o,i,s,a,l,u,c,d,h,m])}var KO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Oe(),{deleteElements:r}=Ed(),o=Gi(e),i=Gi(t);N.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function QO(e){const t=Oe();N.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=rd(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Vn.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Sd={position:"absolute",width:"100%",height:"100%",top:0,left:0},XO=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,_d=e=>({x:e.x,y:e.y,zoom:e.k}),Co=(e,t)=>e.target.closest(`.${t}`),Pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ZO=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=_o.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:v,zoomActivationKeyCode:E,preventScrolling:p=!0,children:g,noWheelClassName:S,noPanClassName:_})=>{const w=N.useRef(),R=Oe(),C=N.useRef(!1),A=N.useRef(!1),B=N.useRef(null),b=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:V,d3Selection:$,d3ZoomHandler:F,userSelectionActive:O}=le(qO,Je),P=Gi(E),D=N.useRef(0);return QO(B),N.useEffect(()=>{if(B.current){const I=B.current.getBoundingClientRect(),T=KN().scaleExtent([m,v]).translateExtent(h),k=At(B.current).call(T),U=Fn.translate(f.x,f.y).scale(Eo(f.zoom,m,v)),z=[[0,0],[I.width,I.height]],j=T.constrain()(U,z,h);T.transform(k,j),R.setState({d3Zoom:T,d3Selection:k,d3ZoomHandler:k.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:B.current.closest(".react-flow")})}},[]),N.useEffect(()=>{$&&V&&(s&&!P&&!O?$.on("wheel.zoom",I=>{if(Co(I,S))return!1;I.preventDefault(),I.stopImmediatePropagation();const T=$.property("__zoom").k||1;if(I.ctrlKey&&i){const j=Ht(I),K=-I.deltaY*(I.deltaMode===1?.05:I.deltaMode?1:.002)*10,W=T*Math.pow(2,K);V.scaleTo($,W,j);return}const k=I.deltaMode===1?20:1,U=l===_o.Vertical?0:I.deltaX*k,z=l===_o.Horizontal?0:I.deltaY*k;V.translateBy($,-(U/T)*a,-(z/T)*a)},{passive:!1}):typeof F<"u"&&$.on("wheel.zoom",function(I,T){if(!p||Co(I,S))return null;I.preventDefault(),F.call(this,I,T)},{passive:!1}))},[O,s,l,$,V,F,P,i,p,S]),N.useEffect(()=>{V&&V.on("start",I=>{var k;if(!I.sourceEvent)return null;D.current=I.sourceEvent.button;const{onViewportChangeStart:T}=R.getState();if(C.current=!0,((k=I.sourceEvent)==null?void 0:k.type)==="mousedown"&&R.setState({paneDragging:!0}),t||T){const U=_d(I.transform);b.current=U,T==null||T(U),t==null||t(I.sourceEvent,U)}})},[V,t]),N.useEffect(()=>{V&&(O&&!C.current?V.on("zoom",null):O||V.on("zoom",I=>{const{onViewportChange:T}=R.getState();if(R.setState({transform:[I.transform.x,I.transform.y,I.transform.k]}),A.current=!!(r&&Pv(d,D.current??0)),e||T){const k=_d(I.transform);T==null||T(k),e==null||e(I.sourceEvent,k)}}))},[O,V,e,d,r]),N.useEffect(()=>{V&&V.on("end",I=>{if(!I.sourceEvent)return null;const{onViewportChangeEnd:T}=R.getState();if(C.current=!1,R.setState({paneDragging:!1}),r&&Pv(d,D.current??0)&&!A.current&&r(I.sourceEvent),A.current=!1,(n||T)&&XO(b.current,I.transform)){const k=_d(I.transform);b.current=k,clearTimeout(w.current),w.current=setTimeout(()=>{T==null||T(k),n==null||n(I.sourceEvent,k)},s?150:0)}})},[V,s,d,n,r]),N.useEffect(()=>{V&&V.filter(I=>{const T=P||o,k=i&&I.ctrlKey;if(I.button===1&&I.type==="mousedown"&&(Co(I,"react-flow__node")||Co(I,"react-flow__edge")))return!0;if(!d&&!T&&!s&&!u&&!i||O||!u&&I.type==="dblclick"||Co(I,S)&&I.type==="wheel"||Co(I,_)&&I.type!=="wheel"||!i&&I.ctrlKey&&I.type==="wheel"||!T&&!s&&!k&&I.type==="wheel"||!d&&(I.type==="mousedown"||I.type==="touchstart")||Array.isArray(d)&&!d.includes(I.button)&&(I.type==="mousedown"||I.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(I.button)||!I.button||I.button<=1;return(!I.ctrlKey||I.type==="wheel")&&U})},[O,V,o,i,s,u,d,c,P]),y("div",{className:"react-flow__renderer",ref:B,style:Sd,children:g})},JO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ex(){const{userSelectionActive:e,userSelectionRect:t}=le(JO,Je);return e&&t?y("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Mv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Uv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&Mv(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Mv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Fv(e,t){return Uv(e,t)}function tx(e,t){return Uv(e,t)}const Hn=(e,t)=>({id:e,type:"select",selected:t});function bo(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Hn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Hn(r.id,!1))),n},[])}const wd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},nx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Vv=N.memo(({isSelecting:e,selectionMode:t=$i.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=N.useRef(null),h=Oe(),m=N.useRef(0),v=N.useRef(0),E=N.useRef(),{userSelectionActive:p,elementsSelectable:g,dragging:S}=le(nx,Je),_=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,v.current=0},w=F=>{i==null||i(F),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=F=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){F.preventDefault();return}s==null||s(F)},C=a?F=>a(F):void 0,A=F=>{const{resetSelectedElements:O,domNode:P}=h.getState();if(E.current=P==null?void 0:P.getBoundingClientRect(),!g||!e||F.button!==0||F.target!==f.current||!E.current)return;const{x:D,y:I}=Bn(F,E.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:I,x:D,y:I}}),r==null||r(F)},B=F=>{const{userSelectionRect:O,nodeInternals:P,edges:D,transform:I,onNodesChange:T,onEdgesChange:k,nodeOrigin:U,getNodes:z}=h.getState();if(!e||!E.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=Bn(F,E.current),K=O.startX??0,W=O.startY??0,J={...O,x:j.x<K?j.x:K,y:j.y<W?j.y:W,width:Math.abs(j.x-K),height:Math.abs(j.y-W)},X=z(),te=tv(P,J,I,t===$i.Partial,!0,U),oe=nv(te,D).map(ue=>ue.id),ge=te.map(ue=>ue.id);if(m.current!==ge.length){m.current=ge.length;const ue=bo(X,ge);ue.length&&(T==null||T(ue))}if(v.current!==oe.length){v.current=oe.length;const ue=bo(D,oe);ue.length&&(k==null||k(ue))}h.setState({userSelectionRect:J})},b=F=>{if(F.button!==0)return;const{userSelectionRect:O}=h.getState();!p&&O&&F.target===f.current&&(w==null||w(F)),h.setState({nodesSelectionActive:m.current>0}),_(),o==null||o(F)},V=F=>{p&&(h.setState({nodesSelectionActive:m.current>0}),o==null||o(F)),_()},$=g&&(e||p);return M("div",{className:Ze(["react-flow__pane",{dragging:S,selection:e}]),onClick:$?void 0:wd(w,f),onContextMenu:wd(R,f),onWheel:wd(C,f),onMouseEnter:$?void 0:l,onMouseDown:$?A:void 0,onMouseMove:$?B:u,onMouseUp:$?b:void 0,onMouseLeave:$?V:c,ref:f,style:Sd,children:[d,y(ex,{})]})});Vv.displayName="Pane";const rx=e=>{const t=e.getNodes().filter(n=>n.selected);return{...ev(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function ox({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Oe(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:u}=le(rx,Je),c=bv(),d=N.useRef(null);if(N.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),Cv({nodeRef:d}),u||!o||!i)return null;const f=e?m=>{const v=r.getState().getNodes().filter(E=>E.selected);e(m,v)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(xo,m.key)&&c({x:xo[m.key].x,y:xo[m.key].y,isShiftPressed:m.shiftKey})};return y("div",{className:Ze(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:y("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}})})}var ix=N.memo(ox);const sx=e=>e.nodesSelectionActive,Bv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:m,onSelectionEnd:v,multiSelectionKeyCode:E,panActivationKeyCode:p,zoomActivationKeyCode:g,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:A,zoomOnDoubleClick:B,panOnDrag:b,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,preventScrolling:P,onSelectionContextMenu:D,noWheelClassName:I,noPanClassName:T,disableKeyboardA11y:k})=>{const U=le(sx),z=Gi(d),K=Gi(p)||b,W=z||f&&K!==!0;return KO({deleteKeyCode:a,multiSelectionKeyCode:E}),y(ZO,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:R,panOnScrollSpeed:C,panOnScrollMode:A,zoomOnDoubleClick:B,panOnDrag:!z&&K,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:P,noWheelClassName:I,noPanClassName:T,children:M(Vv,{onSelectionStart:m,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:K,isSelecting:!!W,selectionMode:h,children:[e,U&&y(ix,{onSelectionContextMenu:D,noPanClassName:T,disableKeyboardA11y:k})]})})};Bv.displayName="FlowRenderer";var ax=N.memo(Bv);function lx(e){return le(N.useCallback(n=>e?tv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const ux=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),$v=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=le(ux,Je),a=lx(e.onlyRenderVisibleElements),l=N.useRef(),u=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(f)});return l.current=c,c},[]);return N.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),y("div",{className:"react-flow__nodes",style:Sd,children:a.map(c=>{var w,R;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",Vn.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),m=!!(c.selectable||o&&typeof c.selectable>"u"),v=!!(c.connectable||n&&typeof c.connectable>"u"),E=!!(c.focusable||r&&typeof c.focusable>"u"),p=e.nodeExtent?od(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(p==null?void 0:p.x)??0,S=(p==null?void 0:p.y)??0,_=$O({x:g,y:S,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return y(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||G.Bottom,targetPosition:c.targetPosition||G.Top,hidden:c.hidden,xPos:g,yPos:S,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:m,isConnectable:v,isFocusable:E,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[_e])==null?void 0:w.z)??0,isParent:!!((R=c[_e])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};$v.displayName="NodeRenderer";var cx=N.memo($v);const dx=[{level:0,isMaxLevel:!0,edges:[]}];function fx(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var c,d,f,h;const l=St(a.zIndex);let u=l?a.zIndex:0;return n&&(u=l?a.zIndex:Math.max(((d=(c=t.get(a.source))==null?void 0:c[_e])==null?void 0:d.z)||0,((h=(f=t.get(a.target))==null?void 0:f[_e])==null?void 0:h.z)||0)),s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?dx:i}function px(e,t,n){const r=le(N.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&UO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return fx(r,t,n)}const hx=({color:e="none",strokeWidth:t=1})=>y("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),gx=({color:e="none",strokeWidth:t=1})=>y("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),zv={[zi.Arrow]:hx,[zi.ArrowClosed]:gx};function mx(e){const t=Oe();return N.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(zv,e)?zv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Vn.error009(e)),null)},[e])}const vx=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=mx(t);return l?y("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:y(l,{color:n,strokeWidth:s})}):null},yx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=dd(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Hv=({defaultColor:e,rfId:t})=>{const n=le(N.useCallback(yx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return y("defs",{children:n.map(r=>y(vx,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};Hv.displayName="MarkerDefinitions";var Ex=N.memo(Hv);const Sx=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),jv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,children:E})=>{const{edgesFocusable:p,edgesUpdatable:g,elementsSelectable:S,width:_,height:w,connectionMode:R,nodeInternals:C,onError:A}=le(Sx,Je),B=px(t,C,n);return _?M(Ee,{children:[B.map(({level:b,edges:V,isMaxLevel:$})=>M("svg",{style:{zIndex:b},width:_,height:w,className:"react-flow__edges react-flow__container",children:[$&&y(Ex,{defaultColor:e,rfId:r}),y("g",{children:V.map(F=>{const[O,P,D]=Rv(C.get(F.source)),[I,T,k]=Rv(C.get(F.target));if(!D||!k)return null;let U=F.type||"default";o[U]||(A==null||A("011",Vn.error011(U)),U="default");const z=o[U]||o.default,j=R===$n.Strict?T.target:(T.target??[]).concat(T.source??[]),K=wv(P.source,F.sourceHandle),W=wv(j,F.targetHandle),J=(K==null?void 0:K.position)||G.Bottom,X=(W==null?void 0:W.position)||G.Top,te=!!(F.focusable||p&&typeof F.focusable>"u"),oe=typeof s<"u"&&(F.updatable||g&&typeof F.updatable>"u");if(!K||!W)return A==null||A("008",Vn.error008(K,F)),null;const{sourceX:ge,sourceY:ue,targetX:xe,targetY:Ye}=MO(O,K,J,I,W,X);return y(z,{id:F.id,className:Ze([F.className,i]),type:U,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:ge,sourceY:ue,targetX:xe,targetY:Ye,sourcePosition:J,targetPosition:X,elementsSelectable:S,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,rfId:r,ariaLabel:F.ariaLabel,isFocusable:te,isUpdatable:oe,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},b)),E]}):null};jv.displayName="EdgeRenderer";var _x=N.memo(jv);const wx=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Rx({children:e}){const t=le(wx);return y("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function Nx(e){const t=Ed(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ox={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top},Yv=({nodeId:e,handleType:t,style:n,type:r=zn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,C,A;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=le(N.useCallback(B=>({fromNode:B.nodeInternals.get(e),handleId:B.connectionHandleId,toX:(B.connectionPosition.x-B.transform[0])/B.transform[2],toY:(B.connectionPosition.y-B.transform[1])/B.transform[2],connectionMode:B.connectionMode}),[e]),Je),d=(R=s==null?void 0:s[_e])==null?void 0:R.handleBounds;let f=d==null?void 0:d[t];if(c===$n.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const h=a?f.find(B=>B.id===a):f[0],m=h?h.x+h.width/2:(s.width??0)/2,v=h?h.y+h.height/2:s.height??0,E=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+m,p=(((A=s.positionAbsolute)==null?void 0:A.y)??0)+v,g=h==null?void 0:h.position,S=g?Ox[g]:null;if(!g||!S)return null;if(o)return y(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:E,fromY:p,toX:l,toY:u,fromPosition:g,toPosition:S,connectionStatus:i});let _="";const w={sourceX:E,sourceY:p,sourcePosition:g,targetX:l,targetY:u,targetPosition:S};return r===zn.Bezier?[_]=Xm(w):r===zn.Step?[_]=Hi({...w,borderRadius:0}):r===zn.SmoothStep?[_]=Hi(w):r===zn.SimpleBezier?[_]=Gm(w):_=`M${E},${p} ${l},${u}`,y("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};Yv.displayName="ConnectionLine";const xx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Tx({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:u}=le(xx,Je);return!(o&&i&&a&&s)?null:y("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:y("g",{className:Ze(["react-flow__connection",u]),children:y(Yv,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const Gv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:E,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:S,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,multiSelectionKeyCode:A,panActivationKeyCode:B,zoomActivationKeyCode:b,deleteKeyCode:V,onlyRenderVisibleElements:$,elementsSelectable:F,selectNodesOnDrag:O,defaultViewport:P,translateExtent:D,minZoom:I,maxZoom:T,preventScrolling:k,defaultMarkerColor:U,zoomOnScroll:z,zoomOnPinch:j,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:J,zoomOnDoubleClick:X,panOnDrag:te,onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:xe,onPaneScroll:Ye,onPaneContextMenu:ft,onEdgeUpdate:me,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Jn,edgeUpdaterRadius:Tr,onEdgeUpdateStart:as,onEdgeUpdateEnd:ls,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:er,elevateEdgesOnSelect:Po,disableKeyboardA11y:tr,nodeOrigin:br,nodeExtent:us,rfId:Mo})=>(Nx(i),y(ax,{onPaneClick:oe,onPaneMouseEnter:ge,onPaneMouseMove:ue,onPaneMouseLeave:xe,onPaneContextMenu:ft,onPaneScroll:Ye,deleteKeyCode:V,selectionKeyCode:w,selectionOnDrag:R,selectionMode:C,onSelectionStart:v,onSelectionEnd:E,multiSelectionKeyCode:A,panActivationKeyCode:B,zoomActivationKeyCode:b,elementsSelectable:F,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:z,zoomOnPinch:j,zoomOnDoubleClick:X,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:J,panOnDrag:te,defaultViewport:P,translateExtent:D,minZoom:I,maxZoom:T,onSelectionContextMenu:m,preventScrolling:k,noDragClassName:ko,noWheelClassName:Cr,noPanClassName:er,disableKeyboardA11y:tr,children:M(Rx,{children:[y(_x,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:me,onlyRenderVisibleElements:$,onEdgeContextMenu:de,onEdgeMouseEnter:tt,onEdgeMouseMove:Q,onEdgeMouseLeave:Jn,onEdgeUpdateStart:as,onEdgeUpdateEnd:ls,edgeUpdaterRadius:Tr,defaultMarkerColor:U,noPanClassName:er,elevateEdgesOnSelect:!!Po,disableKeyboardA11y:tr,rfId:Mo,children:y(Tx,{style:g,type:p,component:S,containerStyle:_})}),y("div",{className:"react-flow__edgelabel-renderer"}),y(cx,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:$,noPanClassName:er,noDragClassName:ko,disableKeyboardA11y:tr,nodeOrigin:br,nodeExtent:us,rfId:Mo})]})}));Gv.displayName="GraphView";var Cx=N.memo(Gv);const Rd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],jn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Rd,nodeExtent:Rd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:$n.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:rO,isValidConnection:void 0},bx=()=>Vg((e,t)=>({...jn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:yd(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?yd(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((v,E)=>{const p=o.get(E.id);if(p){const g=rd(E.nodeElement);!!(g.width&&g.height&&(p.width!==g.width||p.height!==g.height||E.forceUpdate))&&(o.set(p.id,{...p,[_e]:{...p[_e],handleBounds:{source:Tv(".source",E.nodeElement,f,u),target:Tv(".target",E.nodeElement,f,u)}},...g}),v.push({id:p.id,type:"dimensions",dimensions:g}))}return v},[]);Dv(o,u);const m=s||i&&!s&&kv(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:m}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:o};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(i){const u=Fv(n,a()),c=yd(u,o,s,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Hn(l,!0)):(s=bo(i(),n),a=bo(o,[])),Ja({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Hn(l,!0)):(s=bo(o,n),a=bo(i(),[])),Ja({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,l=s.map(c=>(c.selected=!1,Hn(c.id,!1))),u=a.map(c=>Hn(c.id,!1));Ja({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>Hn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Hn(a.id,!1));Ja({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=od(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return;const u=Fn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],d=s==null?void 0:s.constrain()(u,c,l);s.transform(a,d)},cancelConnection:()=>e({connectionNodeId:jn.connectionNodeId,connectionHandleId:jn.connectionHandleId,connectionHandleType:jn.connectionHandleType,connectionStatus:jn.connectionStatus,connectionStartHandle:jn.connectionStartHandle,connectionEndHandle:jn.connectionEndHandle}),reset:()=>e({...jn})})),Wv=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=bx()),y(QN,{value:t.current,children:e})};Wv.displayName="ReactFlowProvider";const Kv=({children:e})=>N.useContext(Ka)?y(Ee,{children:e}):y(Wv,{children:e});Kv.displayName="ReactFlowWrapper";function Qv(e,t){return N.useRef(null),N.useMemo(()=>t(e),[e])}const Ix={input:fv,default:pd,output:hv,group:hd},Ax={default:qa,straight:ud,step:ld,smoothstep:Qa,simplebezier:ad},Lx=[0,0],Dx=[15,15],kx={x:0,y:0,zoom:1},Px={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Xv=N.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Ix,edgeTypes:s=Ax,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:E,onClickConnectEnd:p,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,onNodeDragStart:C,onNodeDrag:A,onNodeDragStop:B,onNodesDelete:b,onEdgesDelete:V,onSelectionChange:$,onSelectionDragStart:F,onSelectionDrag:O,onSelectionDragStop:P,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:T,connectionMode:k=$n.Strict,connectionLineType:U=zn.Bezier,connectionLineStyle:z,connectionLineComponent:j,connectionLineContainerStyle:K,deleteKeyCode:W="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:X=!1,selectionMode:te=$i.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:ge="Meta",zoomActivationKeyCode:ue="Meta",snapToGrid:xe=!1,snapGrid:Ye=Dx,onlyRenderVisibleElements:ft=!1,selectNodesOnDrag:me=!0,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,nodeOrigin:Jn=Lx,edgesFocusable:Tr,edgesUpdatable:as,elementsSelectable:ls,defaultViewport:ko=kx,minZoom:Cr=.5,maxZoom:er=2,translateExtent:Po=Rd,preventScrolling:tr=!0,nodeExtent:br,defaultMarkerColor:us="#b1b1b7",zoomOnScroll:Mo=!0,zoomOnPinch:nt=!0,panOnScroll:Ut=!1,panOnScrollSpeed:Ir=.5,panOnScrollMode:Ar=_o.Free,zoomOnDoubleClick:Lr=!0,panOnDrag:yl=!0,onPaneClick:Dr,onPaneMouseEnter:df,onPaneMouseMove:ff,onPaneMouseLeave:cs,onPaneScroll:pf,onPaneContextMenu:K0,children:kr,onEdgeUpdate:BA,onEdgeContextMenu:$A,onEdgeDoubleClick:zA,onEdgeMouseEnter:HA,onEdgeMouseMove:jA,onEdgeMouseLeave:YA,onEdgeUpdateStart:GA,onEdgeUpdateEnd:WA,edgeUpdaterRadius:KA=10,onNodesChange:QA,onEdgesChange:XA,noDragClassName:qA="nodrag",noWheelClassName:ZA="nowheel",noPanClassName:Q0="nopan",fitView:JA=!1,fitViewOptions:eL,connectOnClick:tL=!0,attributionPosition:nL,proOptions:rL,defaultEdgeOptions:oL,elevateNodesOnSelect:iL=!0,elevateEdgesOnSelect:sL=!1,disableKeyboardA11y:X0=!1,autoPanOnConnect:aL=!0,autoPanOnNodeDrag:lL=!0,connectionRadius:uL=20,isValidConnection:cL,onError:dL,style:fL,id:q0,...pL},hL)=>{const gL=Qv(i,BO),mL=Qv(s,PO),hf=q0||"1";return y("div",{...pL,style:{...fL,...Px},ref:hL,className:Ze(["react-flow",o]),"data-testid":"rf__wrapper",id:q0,children:M(Kv,{children:[y(Cx,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:R,nodeTypes:gL,edgeTypes:mL,connectionLineType:U,connectionLineStyle:z,connectionLineComponent:j,connectionLineContainerStyle:K,selectionKeyCode:J,selectionOnDrag:X,selectionMode:te,deleteKeyCode:W,multiSelectionKeyCode:ge,panActivationKeyCode:oe,zoomActivationKeyCode:ue,onlyRenderVisibleElements:ft,selectNodesOnDrag:me,defaultViewport:ko,translateExtent:Po,minZoom:Cr,maxZoom:er,preventScrolling:tr,zoomOnScroll:Mo,zoomOnPinch:nt,zoomOnDoubleClick:Lr,panOnScroll:Ut,panOnScrollSpeed:Ir,panOnScrollMode:Ar,panOnDrag:yl,onPaneClick:Dr,onPaneMouseEnter:df,onPaneMouseMove:ff,onPaneMouseLeave:cs,onPaneScroll:pf,onPaneContextMenu:K0,onSelectionContextMenu:D,onSelectionStart:I,onSelectionEnd:T,onEdgeUpdate:BA,onEdgeContextMenu:$A,onEdgeDoubleClick:zA,onEdgeMouseEnter:HA,onEdgeMouseMove:jA,onEdgeMouseLeave:YA,onEdgeUpdateStart:GA,onEdgeUpdateEnd:WA,edgeUpdaterRadius:KA,defaultMarkerColor:us,noDragClassName:qA,noWheelClassName:ZA,noPanClassName:Q0,elevateEdgesOnSelect:sL,rfId:hf,disableKeyboardA11y:X0,nodeOrigin:Jn,nodeExtent:br}),y(xO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:m,onConnectEnd:v,onClickConnectStart:E,onClickConnectEnd:p,nodesDraggable:de,nodesConnectable:tt,nodesFocusable:Q,edgesFocusable:Tr,edgesUpdatable:as,elementsSelectable:ls,elevateNodesOnSelect:iL,minZoom:Cr,maxZoom:er,nodeExtent:br,onNodesChange:QA,onEdgesChange:XA,snapToGrid:xe,snapGrid:Ye,connectionMode:k,translateExtent:Po,connectOnClick:tL,defaultEdgeOptions:oL,fitView:JA,fitViewOptions:eL,onNodesDelete:b,onEdgesDelete:V,onNodeDragStart:C,onNodeDrag:A,onNodeDragStop:B,onSelectionDrag:O,onSelectionDragStart:F,onSelectionDragStop:P,noPanClassName:Q0,nodeOrigin:Jn,rfId:hf,autoPanOnConnect:aL,autoPanOnNodeDrag:lL,onError:dL,connectionRadius:uL,isValidConnection:cL}),y(NO,{onSelectionChange:$}),kr,y(qN,{proOptions:rL,position:nL}),y(AO,{rfId:hf,disableKeyboardA11y:X0})]})})});Xv.displayName="ReactFlow";function Mx(){const e=Oe();return N.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${t}"]`);o&&requestAnimationFrame(()=>r([{id:t,nodeElement:o,forceUpdate:!0}]))},[])}const Ux=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[_e])==null?void 0:r.handleBounds)!==void 0}),Fx={includeHiddenNodes:!1};function Vx(e=Fx){return le(Ux(e))}function Bx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $x(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y("path",{d:"M0 0h32v4.2H0z"})})}function zx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y("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 Hx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y("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 jx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y("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"})})}const Io=({children:e,className:t,...n})=>y("button",{type:"button",className:Ze(["react-flow__controls-button",t]),...n,children:e});Io.displayName="ControlButton";const Yx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,qv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:c,position:d="bottom-left"})=>{const f=Oe(),[h,m]=N.useState(!1),v=le(Yx),{zoomIn:E,zoomOut:p,fitView:g}=Ed();if(N.useEffect(()=>{m(!0)},[]),!h)return null;const S=()=>{E(),i==null||i()},_=()=>{p(),s==null||s()},w=()=>{g(o),a==null||a()},R=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)};return M(nd,{className:Ze(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls",children:[t&&M(Ee,{children:[y(Io,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:y(Bx,{})}),y(Io,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:y($x,{})})]}),n&&y(Io,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:y(zx,{})}),r&&y(Io,{className:"react-flow__controls-interactive",onClick:R,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?y(jx,{}):y(Hx,{})}),c]})};qv.displayName="Controls";var Gx=N.memo(qv);const Wx=!1,Zv="0.0.0",Jv="0.0.0",ey="sw/nodeType",ty=640,ny={type:"floating",markerEnd:{type:zi.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},Kx="422",Qx="404";let Xx=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const we=()=>Xx(),qx=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},Zx=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},Jx=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),Nd=e=>e.split(",").map(t=>t.trim()).filter(Boolean),eT=e=>({...e,...ny}),tT=e=>e.type==="handleCall"?{...e,deletable:!1}:e,ry=e=>e==="success"?"positive":"negative",nT=e=>e.toLowerCase().replace(/ /g,"-"),Od=()=>[{result:"success",id:we()},{result:"noAnswer",id:we()},{result:"busy",id:we()},{result:"decline",id:we()},{result:"error",id:we()}],oy={answer:()=>({}),forwardAddress:()=>({destinations:[],destinationType:"address",options:Od(),sessionTimeout:void 0,type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:Od(),sessionTimeout:void 0,type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:Od(),sessionTimeout:void 0,type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:5,options:[],results:[{id:we(),result:"no_match"},{id:we(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:we(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[]}),unset:()=>({variables:[]}),request:()=>({url:"",method:"POST",headers:{},body:"",options:[{id:we(),result:"success"},{id:we(),result:"failed"}]}),cond:()=>({options:[],fallback:we()}),condRequest:()=>({body:"",error:we(),fallback:we(),headers:{},method:"POST",options:[],url:""})};function kt(e){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function _t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rT(e,t){if(kt(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iy(e){var t=rT(e,"string");return kt(t)==="symbol"?t:String(t)}function sy(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,iy(r.key),r)}}function wt(e,t,n){return t&&sy(e.prototype,t),n&&sy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xd(e,t){return xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},xd(e,t)}function el(e,t){if(typeof t!="function"&&t!==null)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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xd(e,t)}function Wi(e,t){if(t&&(kt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yn(e)}function Gt(e){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gt(e)}function pn(e,t,n){return t=iy(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oT(e){if(Array.isArray(e))return e}function iT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ay(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sT(e,t){if(e){if(typeof e=="string")return ay(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ay(e,t)}}function aT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lT(e){return oT(e)||iT(e)||sT(e)||aT()}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ly(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var uT={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},cT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||uT,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,uy(uy({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Wt=new cT,Gn=function(){function e(){_t(this,e),this.observers={}}return wt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,o)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(o))})}}}]),e}();function Ki(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function cy(e){return e==null?"":""+e}function dT(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function Td(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function dy(e,t,n){var r=Td(e,t,Object),o=r.obj,i=r.k;o[i]=n}function fT(e,t,n,r){var o=Td(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function tl(e,t){var n=Td(e,t),r=n.obj,o=n.k;if(r)return r[o]}function fy(e,t,n){var r=tl(e,n);return r!==void 0?r:tl(t,n)}function py(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):py(e[r],t[r],n):e[r]=t[r]);return e}function Ao(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var pT={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function hT(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return pT[t]}):e}var nl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gT=[" ",",","?","!",";"];function mT(e,t,n){t=t||"",n=n||"";var r=gT.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vT(e){var t=yT();return function(){var r=Gt(e),o;if(t){var i=Gt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Wi(this,o)}}function yT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,a=r.slice(i,i+s).join(n),l=o[a];l===void 0&&r.length>i+s;)s++,a=r.slice(i,i+s).join(n),l=o[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var u=r.slice(i+s).join(n);return u?gy(l,u,n):void 0}o=o[r[i]]}return o}}var ET=function(e){el(n,e);var t=vT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return _t(this,n),o=t.call(this),nl&&Gn.call(Yn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return wt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(c=o.split("."));var d=tl(this.data,c);return d||!u||typeof s!="string"?d:gy(this.data&&this.data[o]&&this.data[o][i],s,l)}},{key:"addResource",value:function(o,i,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),a=i,i=c[1]),this.addNamespaces(i),dy(this.data,c,a),l.silent||this.emit("added",o,i,s,a)}},{key:"addResources",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(o,i,l,s[l],{silent:!0});a.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),a=s,s=i,i=c[1]),this.addNamespaces(i);var d=tl(this.data,c)||{};a?py(d,s,l):d=rl(rl({},d),s),dy(this.data,c,d),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?rl(rl({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(a){return i[a]&&Object.keys(i[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Gn),my={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,o,i))}),n}};function vy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function He(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ST(e){var t=_T();return function(){var r=Gt(e),o;if(t){var i=Gt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Wi(this,o)}}function _T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yy={},Ey=function(e){el(n,e);var t=ST(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _t(this,n),o=t.call(this),nl&&Gn.call(Yn(o)),dT(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Yn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Wt.create("translator"),o}return wt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!mT(o,s,a);if(u&&!c){var d=o.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:o,namespaces:l};var f=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),o=f.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(kt(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),d=c.key,f=c.namespaces,h=f[f.length-1],m=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(v){var E=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(E).concat(d),usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:"".concat(h).concat(E).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:h}:d}var p=this.resolve(o,i),g=p&&p.res,S=p&&p.usedKey||d,_=p&&p.exactUsedKey||d,w=Object.prototype.toString.apply(g),R=["[object Number]","[object Function]","[object RegExp]"],C=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,B=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(A&&g&&B&&R.indexOf(w)<0&&!(typeof C=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var b=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,He(He({},i),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(p.res=b,p):b}if(u){var V=w==="[object Array]",$=V?[]:{},F=V?_:S;for(var O in g)if(Object.prototype.hasOwnProperty.call(g,O)){var P="".concat(F).concat(u).concat(O);$[O]=this.translate(P,He(He({},i),{joinArrays:!1,ns:f})),$[O]===P&&($[O]=g[O])}g=$}}else if(A&&typeof C=="string"&&w==="[object Array]")g=g.join(C),g&&(g=this.extendTranslation(g,o,i,s));else{var D=!1,I=!1,T=i.count!==void 0&&typeof i.count!="string",k=n.hasDefaultValue(i),U=T?this.pluralResolver.getSuffix(m,i.count,i):"",z=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&k&&(D=!0,g=z),this.isValidLookup(g)||(I=!0,g=d);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,K=j&&I?void 0:g,W=k&&z!==g&&this.options.updateMissing;if(I||D||W){if(this.logger.log(W?"updateKey":"missingKey",m,h,d,W?z:g),u){var J=this.resolve(d,He(He({},i),{},{keySeparator:!1}));J&&J.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var X=[],te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(var oe=0;oe<te.length;oe++)X.push(te[oe]);else this.options.saveMissingTo==="all"?X=this.languageUtils.toResolveHierarchy(i.lng||this.language):X.push(i.lng||this.language);var ge=function(xe,Ye,ft){var me=k&&ft!==g?ft:K;a.options.missingKeyHandler?a.options.missingKeyHandler(xe,h,Ye,me,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(xe,h,Ye,me,W,i),a.emit("missingKey",xe,h,Ye,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?X.forEach(function(ue){a.pluralResolver.getSuffixes(ue,i).forEach(function(xe){ge([ue],d+xe,i["defaultValue".concat(xe)]||z)})}):ge(X,d,z))}g=this.extendTranslation(g,o,i,p,s),I&&g===d&&this.options.appendNamespaceToMissingKey&&(g="".concat(h,":").concat(d)),(I||D)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(d):d,D?g:void 0):g=this.options.parseMissingKeyHandler(g))}return l?(p.res=g,p):g}},{key:"extendTranslation",value:function(o,i,s,a,l){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,He(He({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(He(He({},s),{interpolation:He(He({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){var f=o.match(this.interpolator.nestingRegexp);d=f&&f.length}var h=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(h=He(He({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),c){var m=o.match(this.interpolator.nestingRegexp),v=m&&m.length;d<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,S=new Array(g),_=0;_<g;_++)S[_]=arguments[_];return l&&l[0]===S[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(i[0])),null):u.translate.apply(u,S.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var E=s.postProcess||this.options.postProcess,p=typeof E=="string"?[E]:E;return o!=null&&p&&p.length&&s.applyPostProcessor!==!1&&(o=my.handle(p,o,i,this.options&&this.options.postProcessPassResolved?He({i18nResolved:a},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,u,c,d;return typeof o=="string"&&(o=[o]),o.forEach(function(f){if(!i.isValidLookup(a)){var h=i.extractFromKey(f,s),m=h.key;l=m;var v=h.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var E=s.count!==void 0&&typeof s.count!="string",p=E&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",S=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(_){i.isValidLookup(a)||(d=_,!yy["".concat(S[0],"-").concat(_)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(d)&&(yy["".concat(S[0],"-").concat(_)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(S.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(function(w){if(!i.isValidLookup(a)){c=w;var R=[m];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,m,w,_,s);else{var C;E&&(C=i.pluralResolver.getSuffix(w,s.count,s));var A="".concat(i.options.pluralSeparator,"zero");if(E&&(R.push(m+C),p&&R.push(m+A)),g){var B="".concat(m).concat(i.options.contextSeparator).concat(s.context);R.push(B),E&&(R.push(B+C),p&&R.push(B+A))}}for(var b;b=R.pop();)i.isValidLookup(a)||(u=b,a=i.getResource(w,_,b,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:d}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,a):this.resourceStore.getResource(o,i,s,a)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Gn);function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Sy=function(){function e(t){_t(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wt.create("languageUtils")}return wt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cd(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Cd(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Cd(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),i.forEach(function(l){s.indexOf(l)<0&&a(o.formatLanguageCode(l))}),s}}]),e}(),wT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],RT={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},NT=["v1","v2","v3"],_y={zero:0,one:1,two:2,few:3,many:4,other:5};function OT(){var e={};return wT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:RT[t.fc]}})}),e}var xT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.languageUtils=t,this.options=n,this.logger=Wt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=OT()}return wt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,a){return _y[s]-_y[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!NT.includes(this.options.compatibilityJSON)}}]),e}();function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var TT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Wt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return wt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:hT,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ao(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ao(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ao(r.nestingPrefix):r.nestingPrefixEscaped||Ao("$t("),this.nestingSuffix=r.nestingSuffix?Ao(r.nestingSuffix):r.nestingSuffixEscaped||Ao(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,a,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(E){return E.replace(/\$/g,"$$$$")}var f=function(p){if(p.indexOf(s.formatSeparator)<0){var g=fy(r,c,p);return s.alwaysFormat?s.format(g,void 0,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:p})):g}var S=p.split(s.formatSeparator),_=S.shift().trim(),w=S.join(s.formatSeparator).trim();return s.format(fy(r,c,_),w,o,Pt(Pt(Pt({},i),r),{},{interpolationkey:_}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,m=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(p){return d(p)}},{regex:this.regexp,safeValue:function(p){return s.escapeValue?d(s.escape(p)):d(p)}}];return v.forEach(function(E){for(u=0;a=E.regex.exec(n);){var p=a[1].trim();if(l=f(p),l===void 0)if(typeof h=="function"){var g=h(n,a,i);l=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))l="";else if(m){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(p," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=cy(l));var S=E.safeValue(l);if(n=n.replace(a[0],S),m?(E.regex.lastIndex+=l.length,E.regex.lastIndex-=a[0].length):E.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function u(h,m){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var E=h.split(new RegExp("".concat(v,"[ ]*{"))),p="{".concat(E[1]);h=E[0],p=this.interpolate(p,l);var g=p.match(/'/g),S=p.match(/"/g);(g&&g.length%2===0&&!S||S.length%2!==0)&&(p=p.replace(/'/g,'"'));try{l=JSON.parse(p),m&&(l=Pt(Pt({},m),l))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),_),"".concat(h).concat(v).concat(p)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var c=[];l=Pt({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(h){return h.trim()});s[1]=f.shift(),c=f,d=!0}if(a=r(u.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=cy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),d&&(a=c.reduce(function(h,m){return o.format(h,m,i.lng,Pt(Pt({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ry(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ry(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ry(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var a=s.split(":"),l=lT(a),u=l[0],c=l.slice(1),d=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=d),d==="false"&&(n[u.trim()]=!1),d==="true"&&(n[u.trim()]=!0),isNaN(d)||(n[u.trim()]=parseInt(d,10))}})}}return{formatName:t,formatOptions:n}}function Lo(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),a=t[s];return a||(a=e(o,i),t[s]=a),a(r)}}var bT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_t(this,e),this.logger=Wt.create("formatter"),this.options=t,this.formats={number:Lo(function(n,r){var o=new Intl.NumberFormat(n,hn({},r));return function(i){return o.format(i)}}),currency:Lo(function(n,r){var o=new Intl.NumberFormat(n,hn(hn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:Lo(function(n,r){var o=new Intl.DateTimeFormat(n,hn({},r));return function(i){return o.format(i)}}),relativetime:Lo(function(n,r){var o=new Intl.RelativeTimeFormat(n,hn({},r));return function(i){return o.format(i,r.range||"day")}}),list:Lo(function(n,r){var o=new Intl.ListFormat(n,hn({},r));return function(i){return o.format(i)}})},this.init(t)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Lo(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=r.split(this.formatSeparator),l=a.reduce(function(u,c){var d=CT(c),f=d.formatName,h=d.formatOptions;if(i.formats[f]){var m=u;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},E=v.locale||v.lng||s.locale||s.lng||o;m=i.formats[f](u,E,hn(hn(hn({},h),s),v))}catch(p){i.logger.warn(p)}return m}else i.logger.warn("there was no format function for ".concat(f));return u},n);return l}}]),e}();function Ny(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ny(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ny(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IT(e){var t=AT();return function(){var r=Gt(e),o;if(t){var i=Gt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Wi(this,o)}}function AT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function LT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var DT=function(e){el(n,e);var t=IT(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return _t(this,n),s=t.call(this),nl&&Gn.call(Yn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=Wt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,a.backend,a),s}return wt(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,u={},c={},d={},f={};return o.forEach(function(h){var m=!0;i.forEach(function(v){var E="".concat(h,"|").concat(v);!s.reload&&l.store.hasResourceBundle(h,v)?l.state[E]=2:l.state[E]<0||(l.state[E]===1?c[E]===void 0&&(c[E]=!0):(l.state[E]=1,m=!1,c[E]===void 0&&(c[E]=!0),u[E]===void 0&&(u[E]=!0),f[v]===void 0&&(f[v]=!0)))}),m||(d[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],u=a[1];i&&this.emit("failedLoading",l,u,i),s&&this.store.addResourceBundle(l,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(d){fT(d.loaded,[l],u),LT(d,o),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){c[f]||(c[f]={});var h=d.loaded[f];h.length&&h.forEach(function(m){c[f][m]===void 0&&(c[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:u,callback:c});return}this.readingCalls++;var d=function(v,E){if(a.readingCalls--,a.waitingReads.length>0){var p=a.waitingReads.shift();a.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(v&&E&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,u*2,c)},u);return}c(v,E)},f=this.backend[s].bind(this.backend);if(f.length===2){try{var h=f(o,i);h&&typeof h.then=="function"?h.then(function(m){return d(null,m)}).catch(d):d(null,h)}catch(m){d(m)}return}return f(o,i,d)}},{key:"prepareLoading",value:function(o,i){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,a,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=o.split("|"),l=a[0],u=a[1];this.read(l,u,"read",void 0,void 0,function(c,d){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&d&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(l),d),i.loaded(o,c,d)})}},{key:"saveMissing",value:function(o,i,s,a,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=Oy(Oy({},u),{},{isUpdate:l}),f=this.backend.create.bind(this.backend);if(f.length<6)try{var h;f.length===5?h=f(o,i,s,a,d):h=f(o,i,s,a),h&&typeof h.then=="function"?h.then(function(m){return c(null,m)}).catch(c):c(null,h)}catch(m){c(m)}else f(o,i,s,a,c,d)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(Gn);function xy(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(kt(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),kt(t[2])==="object"||kt(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ty(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cy(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kT(e){var t=PT();return function(){var r=Gt(e),o;if(t){var i=Gt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Wi(this,o)}}function PT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ol(){}function MT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var il=function(e){el(n,e);var t=kT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(_t(this,n),r=t.call(this),nl&&Gn.call(Yn(r)),r.options=Ty(o),r.services={},r.logger=Wt,r.modules={external:[]},MT(Yn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Wi(r,Yn(r));setTimeout(function(){r.init(o,i)},0)}return r}return wt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var a=xy();this.options=Kt(Kt(Kt({},a),this.options),Ty(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Kt(Kt({},a.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(p){return p?typeof p=="function"?new p:p:null}if(!this.options.isClone){this.modules.logger?Wt.init(l(this.modules.logger),this.options):Wt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=bT);var c=new Sy(this.options);this.store=new ET(this.options.resources,this.options);var d=this.services;d.logger=Wt,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new xT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(u),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new TT(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new DT(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Ey(this.services,this.options),this.translator.on("*",function(p){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[p].concat(S))}),this.modules.external.forEach(function(p){p.init&&p.init(o)})}if(this.format=this.options.interpolation.format,s||(s=ol),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(p){o[p]=function(){var g;return(g=o.store)[p].apply(g,arguments),o}});var v=Ki(),E=function(){var g=function(_,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),v.resolve(w),s(_,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),v}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ol,a=s,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(a=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var u=[],c=function(h){if(h){var m=i.services.languageUtils.toResolveHierarchy(h);m.forEach(function(v){u.indexOf(v)<0&&u.push(v)})}};if(l)c(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return c(f)})}this.options.preload&&this.options.preload.forEach(function(f){return c(f)}),this.services.backendConnector.load(u,this.options.ns,function(f){!f&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=Ki();return o||(o=this.languages),i||(i=this.options.ns),s||(s=ol),this.services.backendConnector.reload(o,i,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&my.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var a=Ki();this.emit("languageChanging",o);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},u=function(f,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),i&&i(f,function(){return s.t.apply(s,arguments)})},c=function(f){!o&&!f&&s.services.languageDetector&&(f=[]);var h=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(m){u(m,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function u(c,d){var f;if(kt(d)!=="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),v=2;v<h;v++)m[v-2]=arguments[v];f=a.options.overloadTranslationOptionHandler([c,d].concat(m))}else f=Kt({},d);f.lng=f.lng||u.lng,f.lngs=f.lngs||u.lngs,f.ns=f.ns||u.ns,f.keyPrefix=f.keyPrefix||s||u.keyPrefix;var E=a.options.keySeparator||".",p;return f.keyPrefix&&Array.isArray(c)?p=c.map(function(g){return"".concat(f.keyPrefix).concat(E).concat(g)}):p=f.keyPrefix?"".concat(f.keyPrefix).concat(E).concat(c):c,a.t(p,f)};return typeof o=="string"?l.lng=o:l.lngs=o,l.ns=i,l.keyPrefix=s,l}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var c=function(h,m){var v=i.services.backendConnector.state["".concat(h,"|").concat(m)];return v===-1||v===2};if(s.precheck){var d=s.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=Ki();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),i&&i(l)}),a):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=Ki();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(u){return a.indexOf(u)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new Sy(xy());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ol,a=Kt(Kt(Kt({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=Kt({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Ey(l.services,l.options),l.translator.on("*",function(c){for(var d=arguments.length,f=new Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];l.emit.apply(l,[c].concat(f))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Gn);pn(il,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new il(e,t)});var be=il.createInstance();be.createInstance=il.createInstance,be.createInstance,be.dir,be.init,be.loadResources,be.reloadResources,be.use,be.changeLanguage,be.getFixedT,be.t,be.exists,be.setDefaultNamespace,be.hasLoadedNamespace,be.loadNamespaces,be.loadLanguages;var by=[],UT=by.forEach,FT=by.slice;function VT(e){return UT.call(FT.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Iy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,BT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var a=o.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(o.domain){if(!Iy.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Iy.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ay={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=BT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},$T={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Ay.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Ay.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},zT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var a=i[s].indexOf("=");if(a>0){var l=i[s].substring(0,a);l===t.lookupQuerystring&&(n=i[s].substring(a+1))}}}return n}},Qi=null,Ly=function(){if(Qi!==null)return Qi;try{Qi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Qi=!1}return Qi},HT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Ly()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Ly()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Xi=null,Dy=function(){if(Xi!==null)return Xi;try{Xi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Xi=!1}return Xi},jT={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Dy()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Dy()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},YT={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},GT={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},WT={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},KT={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function QT(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ky=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_t(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return wt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=VT(r,this.options||{},QT()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector($T),this.addDetector(zT),this.addDetector(HT),this.addDetector(jT),this.addDetector(YT),this.addDetector(GT),this.addDetector(WT),this.addDetector(KT)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();ky.type="languageDetector";var XT=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qT={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ZT=function(t){return qT[t]},JT=function(t){return t.replace(XT,ZT)};function Py(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function My(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Py(Object(n),!0).forEach(function(r){pn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Py(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Uy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:JT};function eC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Uy=My(My({},Uy),e)}var tC={type:"3rdParty",init:function(t){eC(t.options.react)}};N.createContext(),function(){function e(){_t(this,e),this.usedNamespaces={}}return wt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const nC={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",APP_VERSION:"App Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",DECISION:"Decision",DECLINE:"Decline",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FORMAT:"Format",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FORWARD:"Forward",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_NODE_COND:"Sets branching (when, then, else) based on the specified JavaScript condition.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_REQUEST:"Makes an HTTP request (GET/POST/PUT/DELETE HTTP) to the specified URL. Responses can be parsed and stored as variables for further use in your flow.",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"Sets script variables by accepting an object which maps variable names to values.",INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INPUT:"Input",KEY:"Key",METHOD:"Method",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"SWML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",RESYNC:"Resync",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOY:"Deploy",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",TOAST_DOCUMENT_OUT_OF_SYNC:'Updates have been made to this Call Flow by another user and your recent changes have not been saved. Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},x={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",APP_VERSION:"APP_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITION_NUMBER:"CONDITION_NUMBER",CONDITIONS:"CONDITIONS",DECISION:"DECISION",DECLINE:"DECLINE",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FORMAT:"FORMAT",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FORWARD:"FORWARD",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INPUT:"INPUT",KEY:"KEY",METHOD:"METHOD",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",RESYNC:"RESYNC",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},rC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},oC={"en-US":{translation:nC}},iC=()=>{be.use(ky).use(tC).init({debug:Wx,detection:rC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:oC})};function L(e,t){return t?be.t(e,t):be.t(e)}const sC={entries:[],nextLabelIndex:0},Wn=Ca((e,t)=>({...sC,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=L(x.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=t().entries.reduce((i,s)=>{const{label:a,controlId:l}=s;return a!==""&&a===n&&(!r||l!==r)?[...i,s]:i},[]);return Boolean(o.length)},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=Boolean(n.label.trim());return(r.isKeyDuplicate(n.controlId)||!i)&&(o=o.filter(s=>s.controlId!==n.controlId)),i&&o.push({...n}),{entries:o}})}})),aC=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Wn.setState({entries:t,nextLabelIndex:t.length})},lC=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Wn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:"",missingRequiredParams:!0}}]:r,[]):[]},Fy={recordCallStart:e=>{const t=Wn.getState().getGeneratedLabel();return Wn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},uC=e=>oy[e]!==void 0,cC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,dC=e=>Fy[e.type]!==void 0,Vy=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:we(),type:e,position:r,deletable:n,data:{missingRequiredParams:!1},selected:o}),s=(l,u)=>({...l,data:{...l.data,...u,missingRequiredParams:!0}});let a=i();if(uC(e)){const l=oy[e]();cC(l)&&(a=s(a,l))}return dC(a)&&(a=Fy[a.type](a)),a},sl={apiVersion:void 0,builderVersion:Jv,cfbAppVersion:Zv,relayMLVersion:void 0},fC=e=>{const t={...sl,...e};sl.apiVersion=t.apiVersion,sl.builderVersion=t.builderVersion,sl.relayMLVersion=t.relayMLVersion},bd=()=>({apiVersion:void 0,builderVersion:Jv,cfbAppVersion:Zv,relayMLVersion:void 0}),By=1e3,Id=qe(),pC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:u,documentVersion:c}=n(),{builderVersion:d}=bd();Id.debug("Saving data to server"),t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const h={documentVersion:(await a.putFlow({documentVersion:c,builderVersion:d,nodes:l,edges:u})).document_version};switch(n().dataHandlingStatus){case"saving":t({...h,dataHandlingStatus:"queueing",saveFlowStatus:"saved"});break;case"holding":t({...h,saveFlowStatus:"awaiting-save"}),Id.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},By);break;default:Id.debug("Saving data to server - invalid state")}}catch(f){console.error("Put Flow",f),f instanceof Error&&f.message.includes(Kx)?t({dataHandlingStatus:"holding",flowInteractive:!1,httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...u)=>{const{dataHandlingStatus:c,initializing:d}=n(),f=typeof a=="function"?a(n()):a;!d&&(f.nodes||f.edges)?c==="queueing"?(f.saveFlowStatus="awaiting-save",t(f,l,...u),clearTimeout(o),o=setTimeout(()=>{s()},By)):(f.dataHandlingStatus="holding",t(f,l,...u)):"initializing"in f&&f.initializing!==d?(f.dataHandlingStatus="queueing",f.saveFlowStatus="saved",t(f,l,...u)):t(f,l,...u)},e(r.setState,n,r)},hC={variables:new Map,keyToIdMap:new Map},Sr=Ca((e,t)=>({...hC,_dedupeKey(n,r){const o=Array.from(r.values()).find(i=>i.key===n);o&&r.delete(o.id)},isKeyDuplicate(n,r){const o=t().keyToIdMap.get(n);return o?o!==r:!1},removeVariable(n){e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n);return s&&(o.delete(n),i.delete(s.key)),{keyToIdMap:i,variables:o}})},setVariables:n=>{e(()=>{const r=new Map,o=new Map;return n.forEach(i=>{const s=o.get(i.key);s&&r.delete(s),r.set(i.id,i),o.set(i.key,i.id)}),{keyToIdMap:o,variables:r}})},upsertVariable:n=>{e(r=>{const o=new Map(r.variables),i=new Map(r.keyToIdMap),s=o.get(n.id),a=i.get(n.key);return a&&o.delete(a),s&&i.delete(s.key),o.set(n.id,n),i.set(n.key,n.id),{keyToIdMap:i,variables:o}})}})),gC=e=>{const t=[];e.forEach(n=>{n.type==="set"&&n.data.variables&&t.push(...n.data.variables)}),Sr.getState().setVariables(t)},mC=e=>{if(e!=null&&e.length){const{removeVariable:t}=Sr.getState();e.forEach(n=>{n.type==="set"&&n.data.variables&&n.data.variables.forEach(o=>t(o.id))})}},Ie=qe(),vC=Vy("handleCall",{position:{x:300,y:100},deletable:!1}),qi={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowURL:"",documentVersion:0,edges:[],flowId:"",flowInteractive:!0,flowTitle:"",getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,updateFlowURL:"",updatingSourceHandleId:void 0},yC=(e,t)=>({...qi,reset:()=>{Ie.debug("Reset!"),e({nodes:[...qi.nodes],edges:[...qi.edges]})},exportStoreData:()=>{const{nodes:n,edges:r}=t();Zx(n,r)},addNode:({nodeType:n,x:r=150,y:o=150})=>{Ie.debug("Add Node",n);const{nodes:i,reactFlowInstance:s,flowInteractive:a}=t();if(!a){Ie.debug("Flow is not interactive, not adding node");return}if(!s)throw new Error("ReactFlowInstance not found");const l=Vy(n,{position:s.project({x:r,y:o})}),u=i.map(c=>({...c,selected:!1}));u.push(l),e({nodes:u,selectedNode:l})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),partialUpdateNodeData:(n,r)=>{var s;if(Ie.debug("partialUpdateNodeData",n,r),!t().flowInteractive){Ie.debug("Flow is not interactive, not updating node data");return}const o=[],i=t().nodes.map(a=>{if(a.id===n){if("options"in r&&"options"in a.data){const l=a.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...l.filter(c=>!u.includes(c)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Ie.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:a}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},removeNode:n=>{Ie.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{Ie.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o,deployFlowURL:i}=t();Ie.log("onInit",{getFlowURL:r,updateFlowURL:o});try{const s=Q_({getFlowURL:r,deployFlowURL:i,updateFlowURL:o,headers:qx()}),a=bd(),{id:l,title:u,document_version:c,flow_data:d}=await s.getFlow();let f=d;f||(f={apiVersion:a.apiVersion,builderVersion:a.builderVersion,relayMLVersion:a.relayMLVersion,edges:qi.edges,nodes:qi.nodes.concat([vC])}),e({httpService:s,reactFlowInstance:n,flowId:l,flowTitle:u,documentVersion:c,nodes:f.nodes.map(tT),edges:f.edges.map(eT)}),fC({apiVersion:f.apiVersion,builderVersion:f.builderVersion,relayMLVersion:f.relayMLVersion}),gC(f.nodes),aC(f.nodes)}catch(s){Ie.error("Could not load flow. URL:",r);let a="unknown";s instanceof Error&&s.message.includes(Qx)&&(a="not-found"),e({httpError:a})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{e({nodes:Fv(n,t().nodes)})},onNodesDelete:n=>{Ie.debug("onNodesDelete"),mC(n),lC(t().nodes,n).forEach(o=>{q.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:tx(n,t().edges)})},onEdgesDelete:n=>{Ie.debug("onEdgesDelete [noop]",n)},onConnect:n=>{Ie.debug("onConnect"),e({edges:Zm(n,t().edges)})},onConnectStart:()=>{Ie.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{Ie.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:(n,r)=>{Ie.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgeUpdate:(n,r)=>{Ie.debug("onEdgeUpdate"),e({edges:pO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Ie.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}}),q=Ca()(pC(yC));window.__useRFStore=q;const EC={"not-found":{title:"Call Flow not found",message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404"},unknown:{title:"Unknown error",message:"An unknown error occurred. Please try again or go back.",status:""}},SC=({errorType:e})=>{const t=q(i=>i.backButtonHref),{title:n,message:r,status:o}=EC[e];return y("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:M("div",{className:"text-center",children:[o&&y("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),y("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),y("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&y("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:y("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:L(x.GO_BACK)})})]})})},mk="";function _C({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=Hi({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:G.Top,targetX:o,targetY:i});return M("g",{children:[y("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),y("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}const Zi=40;function wC(e,t,n,r=0,o=!1){const{width:i,height:s,position:a}=n,l=i??0,u=s??0,c=l/2,d=u/2;if(o)return{tx:a.x,ty:a.y+d};const f=a.x+c,h=a.y+d,m=e,v=t,E=(m-f)/l-(v-h)/u,p=(m-f)/u+(v-h)/u,g=1/(Math.abs(E)+Math.abs(p)),S=g*E,_=g*p,w=c*(S+_)+f;return{tx:Math.min(Math.max(w,a.x+r),a.x+l-r),ty:a.y}}const RC=({isCircular:e,sourceX:t,labelX:n,sourceY:r,labelY:o})=>e?{x:t-Zi*1.5,y:r}:{x:n-Zi/2,y:o-Zi/2};function NC(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,a=q(p=>p.removeEdge),l=le(N.useCallback(p=>p.nodeInternals.get(n),[n])),u=le(N.useCallback(p=>p.nodeInternals.get(r),[r]));if(!l||!u)return null;const c=n===r,{tx:d,ty:f}=wC(i,s,u,20,c),[h,m,v]=Hi({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:c?G.Left:G.Top,targetX:d,targetY:f}),E=(p,g)=>{p.stopPropagation(),a(g)};return M("g",{className:"group",children:[y(So,{path:h,...e}),y("foreignObject",{width:Zi,height:Zi,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",...RC({isCircular:c,sourceX:i,labelX:m,sourceY:s,labelY:v}),children:y("div",{className:"h-10 w-10",children:M("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:p=>E(p,t),children:[y(Fe,{tag:"trash-can",className:"text-negative"}),y("span",{className:"sr-only",children:L(x.REMOVE_EDGE)})]})})})]})}var OC={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},xC={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},TC={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},CC={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},bC={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]},IC={prefix:"fas",iconName:"up-from-bracket",icon:[448,512,[],"e590","M73.9 134.1L196.7 11.3C203.9 4.1 213.8 0 224 0s20.1 4.1 27.3 11.3L374.1 134.1c6.4 6.4 9.9 15 9.9 24c0 18.7-15.2 33.9-33.9 33.9H288V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192H97.9C79.2 192 64 176.8 64 158.1c0-9 3.6-17.6 9.9-24zM64 352v64c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V352c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 53-43 96-96 96H96c-53 0-96-43-96-96V352c0-17.7 14.3-32 32-32s32 14.3 32 32z"]};const AC={"arrow-left":TC,"circle-exclamation":xC,"circle-info":CC,"up-from-bracket":IC,"trash-can":OC,xmark:bC},Fe=N.forwardRef(function({className:t="",size:n="",tag:r},o){const i=AC[r];return i?y("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:y("path",{d:i.icon[4],fill:"currentColor"})}):(qe().debug(`Unknown icon: ${r}`),null)}),LC=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=q(l=>l.removeNode),i=q(l=>l.isEdgeConnecting);return M("div",{className:"flex w-full items-center justify-between p-4",children:[y("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&M("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[y(Fe,{tag:"trash-can",className:"text-negative"}),y("span",{className:"sr-only",children:L(x.REMOVE_NODE,{title:n})})]})]})},DC=({id:e,missingRequiredEntry:t})=>{const n=q(i=>i.getTargetEdges),[r,o]=N.useState(!1);return N.useEffect(()=>{const i=()=>n(e).length===0;o(i());const s=q.subscribe((a,l)=>{a.edges.length!==l.edges.length&&o(i()),a.nodes.length!==l.nodes.length&&o(i()),a.isEdgeUpdateSuccessful!==l.isEdgeUpdateSuccessful&&o(i())});return()=>s()},[e,n]),r||t?M("div",{className:"flex flex-col gap-y-6 px-4 pb-4 text-sm italic leading-4",children:[r&&y("p",{children:"Not Connected to Flow"}),t&&y("p",{children:"Missing Required Entry"})]}):null},kC=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return y(Ro,{type:"target",id:`target-${e}`,position:G.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},je=({children:e,id:t,isConnectable:n=!0,missingRequiredEntry:r,nodeTitle:o,selected:i,showDelete:s,showValidation:a=!0,target:l=!0})=>M("section",{className:`${i?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[l&&t&&y(kC,{id:t,isConnectable:n}),y(LC,{nodeId:t,isSelected:i,nodeTitle:o,showDelete:s}),a&&y(DC,{id:t,missingRequiredEntry:r??!1}),e]}),PC=({children:e,handleClick:t,...n})=>y("li",{role:"presentation",children:M("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[y("span",{className:"text-sm text-foreground",children:e}),M("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[y("span",{className:"sr-only",children:"Remove"}),y(Fe,{tag:"xmark",size:"xs"})]})]})}),Kn=e=>y("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:y("select",{className:"pr-8",...e,children:e.children})}),MC={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Qt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=G.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");const s=t?e:"disabled",a=q(f=>f.updatingSourceHandleId),c=!q(f=>f.edges.some(h=>h.sourceHandle===n))||a===n;return y("div",{className:`absolute top-auto left-1/2 h-5 w-5 -translate-x-1/2 rounded-full ${i} ${c&&r&&t?"":"nodrag cursor-not-allowed"}`,children:y(Ro,{className:`bottom-0 h-full w-full border-[3px] bg-background transition-colors ${MC[s]??""}`,id:n,isConnectable:c&&r&&t,position:o,type:"source"})})},Ji=({children:e})=>y("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),gn=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=G.Bottom,positionClasses:s="-bottom-2.5"})=>M("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[y("div",{className:"flex flex-col items-center justify-center",children:y("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),y(Qt,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),UC=({checked:e=!1,name:t,onClick:n})=>M("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[y("span",{className:"sr-only",children:L(e?x.ON:x.OFF)}),y("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),Ad=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>M("div",{className:"mb-2 flex items-center justify-between",children:[M("div",{className:"flex flex-grow flex-col",children:[y("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&y("span",{className:"text-xs text-foreground/50",children:r})]}),y(UC,{checked:e,name:n,onClick:t})]}),_r=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>M("label",{children:[y("span",{className:"sr-only",children:t}),y("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),y("p",{className:"requirements",role:"alert",children:e})]});/*!
|
|
60
|
+
*/var kl=R,hw=pw;function gw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mw=typeof Object.is=="function"?Object.is:gw,vw=hw.useSyncExternalStore,yw=kl.useRef,Ew=kl.useEffect,Sw=kl.useMemo,_w=kl.useDebugValue;Kg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=yw(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Sw(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&s.hasValue){var m=s.value;if(o(m,p))return d=m}return d=p}if(m=d,mw(c,p))return m;var v=r(p);return o!==void 0&&o(m,v)?m:(c=p,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=vw(e,i[0],i[1]);return Ew(function(){s.hasValue=!0,s.value=l},[l]),_w(l),l},Wg.exports=Kg;var ww=Wg.exports;const Rw=hf(ww),{useSyncExternalStoreWithSelector:Nw}=Rw;function qg(e,t=e.getState,n){const r=Nw(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return R.useDebugValue(r),r}const Zg=e=>{var t;((t={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?Yg(e):e,r=(o,i)=>qg(n,o,i);return Object.assign(r,n),r},Pl=e=>e?Zg(e):Zg;function Ge(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Ow={value:()=>{}};function Ml(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ul(n)}function Ul(e){this._=e}function xw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ul.prototype=Ml.prototype={constructor:Ul,on:function(e,t){var n=this._,r=xw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Tw(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Jg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Jg(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ul(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},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)}};function Tw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Jg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Ow,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var $c="http://www.w3.org/1999/xhtml";const em={svg:"http://www.w3.org/2000/svg",xhtml:$c,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),em.hasOwnProperty(t)?{space:em[t],local:e}:e}function Cw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===$c&&t.documentElement.namespaceURI===$c?t.createElement(e):t.createElementNS(n,e)}}function bw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tm(e){var t=Fl(e);return(t.local?bw:Cw)(t)}function Iw(){}function zc(e){return e==null?Iw:function(){return this.querySelector(e)}}function Aw(e){typeof e!="function"&&(e=zc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new dt(r,this._parents)}function Lw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Dw(){return[]}function nm(e){return e==null?Dw:function(){return this.querySelectorAll(e)}}function kw(e){return function(){return Lw(e.apply(this,arguments))}}function Pw(e){typeof e=="function"?e=kw(e):e=nm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new dt(r,o)}function rm(e){return function(){return this.matches(e)}}function om(e){return function(t){return t.matches(e)}}var Mw=Array.prototype.find;function Uw(e){return function(){return Mw.call(this.children,e)}}function Fw(){return this.firstElementChild}function Vw(e){return this.select(e==null?Fw:Uw(typeof e=="function"?e:om(e)))}var Bw=Array.prototype.filter;function $w(){return Array.from(this.children)}function zw(e){return function(){return Bw.call(this.children,e)}}function Hw(e){return this.selectAll(e==null?$w:zw(typeof e=="function"?e:om(e)))}function jw(e){typeof e!="function"&&(e=rm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new dt(r,this._parents)}function im(e){return new Array(e.length)}function Gw(){return new dt(this._enter||this._groups.map(im),this._parents)}function Vl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Vl.prototype={constructor:Vl,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)}};function Yw(e){return function(){return e}}function Ww(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Vl(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Kw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(f[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<d;++l)p=s.call(e,i[l],l,i)+"",(a=u.get(p))?(r[l]=a,a.__data__=i[l],u.delete(p)):n[l]=new Vl(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function Qw(e){return e.__data__}function Xw(e,t){if(!arguments.length)return Array.from(this,Qw);var n=t?Kw:Ww,r=this._parents,o=this._groups;typeof e!="function"&&(e=Yw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,p=qw(e.call(c,c&&c.__data__,u,r)),m=p.length,v=l[u]=new Array(m),E=s[u]=new Array(m),h=a[u]=new Array(f);n(c,d,v,E,h,p,t);for(var g=0,S=0,_,w;g<m;++g)if(_=v[g]){for(g>=S&&(S=g+1);!(w=E[S])&&++S<m;);_._next=w||null}}return s=new dt(s,r),s._enter=l,s._exit=a,s}function qw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Zw(){return new dt(this._exit||this._groups.map(im),this._parents)}function Jw(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function eR(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),p,m=0;m<d;++m)(p=u[m]||c[m])&&(f[m]=p);for(;a<o;++a)l[a]=n[a];return new dt(l,this._parents)}function tR(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function nR(e){e||(e=rR);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new dt(o,this._parents).order()}function rR(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function iR(){return Array.from(this)}function sR(){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 s=r[o];if(s)return s}return null}function lR(){let e=0;for(const t of this)++e;return e}function aR(){return!this.node()}function uR(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function cR(e){return function(){this.removeAttribute(e)}}function dR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fR(e,t){return function(){this.setAttribute(e,t)}}function pR(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function mR(e,t){var n=Fl(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?dR:cR:typeof t=="function"?n.local?gR:hR:n.local?pR:fR)(n,t))}function sm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function vR(e){return function(){this.style.removeProperty(e)}}function yR(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ER(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function SR(e,t,n){return arguments.length>1?this.each((t==null?vR:typeof t=="function"?ER:yR)(e,t,n??"")):mo(this.node(),e)}function mo(e,t){return e.style.getPropertyValue(t)||sm(e).getComputedStyle(e,null).getPropertyValue(t)}function _R(e){return function(){delete this[e]}}function wR(e,t){return function(){this[e]=t}}function RR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NR(e,t){return arguments.length>1?this.each((t==null?_R:typeof t=="function"?RR:wR)(e,t)):this.node()[e]}function lm(e){return e.trim().split(/^|\s+/)}function Hc(e){return e.classList||new am(e)}function am(e){this._node=e,this._names=lm(e.getAttribute("class")||"")}am.prototype={add:function(e){var t=this._names.indexOf(e);t<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}};function um(e,t){for(var n=Hc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function cm(e,t){for(var n=Hc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function OR(e){return function(){um(this,e)}}function xR(e){return function(){cm(this,e)}}function TR(e,t){return function(){(t.apply(this,arguments)?um:cm)(this,e)}}function CR(e,t){var n=lm(e+"");if(arguments.length<2){for(var r=Hc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?TR:t?OR:xR)(n,t))}function bR(){this.textContent=""}function IR(e){return function(){this.textContent=e}}function AR(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function LR(e){return arguments.length?this.each(e==null?bR:(typeof e=="function"?AR:IR)(e)):this.node().textContent}function DR(){this.innerHTML=""}function kR(e){return function(){this.innerHTML=e}}function PR(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function MR(e){return arguments.length?this.each(e==null?DR:(typeof e=="function"?PR:kR)(e)):this.node().innerHTML}function UR(){this.nextSibling&&this.parentNode.appendChild(this)}function FR(){return this.each(UR)}function VR(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BR(){return this.each(VR)}function $R(e){var t=typeof e=="function"?e:tm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function zR(){return null}function HR(e,t){var n=typeof e=="function"?e:tm(e),r=t==null?zR:typeof t=="function"?t:zc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function jR(){var e=this.parentNode;e&&e.removeChild(this)}function GR(){return this.each(jR)}function YR(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WR(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KR(e){return this.select(e?WR:YR)}function QR(e){return arguments.length?this.property("__data__",e):this.node().__data__}function XR(e){return function(t){e.call(this,t,this.__data__)}}function qR(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function ZR(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function JR(e,t,n){return function(){var r=this.__on,o,i=XR(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function e1(e,t,n){var r=qR(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?JR:ZR,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function dm(e,t,n){var r=sm(e),o=r.CustomEvent;typeof o=="function"?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 t1(e,t){return function(){return dm(this,e,t)}}function n1(e,t){return function(){return dm(this,e,t.apply(this,arguments))}}function r1(e,t){return this.each((typeof t=="function"?n1:t1)(e,t))}function*o1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var fm=[null];function dt(e,t){this._groups=e,this._parents=t}function Li(){return new dt([[document.documentElement]],fm)}function i1(){return this}dt.prototype=Li.prototype={constructor:dt,select:Aw,selectAll:Pw,selectChild:Vw,selectChildren:Hw,filter:jw,data:Xw,enter:Gw,exit:Zw,join:Jw,merge:eR,selection:i1,order:tR,sort:nR,call:oR,nodes:iR,node:sR,size:lR,empty:aR,each:uR,attr:mR,style:SR,property:NR,classed:CR,text:LR,html:MR,raise:FR,lower:BR,append:$R,insert:HR,remove:GR,clone:KR,datum:QR,on:e1,dispatch:r1,[Symbol.iterator]:o1};function Pt(e){return typeof e=="string"?new dt([[document.querySelector(e)]],[document.documentElement]):new dt([[e]],fm)}function s1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kt(e,t){if(e=s1(e),t===void 0&&(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()),[r.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]}const l1={passive:!1},Di={capture:!0,passive:!1};function jc(e){e.stopImmediatePropagation()}function vo(e){e.preventDefault(),e.stopImmediatePropagation()}function pm(e){var t=e.document.documentElement,n=Pt(e).on("dragstart.drag",vo,Di);"onselectstart"in t?n.on("selectstart.drag",vo,Di):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function hm(e,t){var n=e.document.documentElement,r=Pt(e).on("dragstart.drag",null);t&&(r.on("click.drag",vo,Di),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 Bl=e=>()=>e;function Gc(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Gc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function a1(e){return!e.ctrlKey&&!e.button}function u1(){return this.parentNode}function c1(e,t){return t??{x:e.x,y:e.y}}function d1(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(){var e=a1,t=u1,n=c1,r=d1,o={},i=Ml("start","drag","end"),s=0,l,a,u,c,d=0;function f(_){_.on("mousedown.drag",p).filter(r).on("touchstart.drag",E).on("touchmove.drag",h,l1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(_,w){if(!(c||!e.call(this,_,w))){var N=S(this,t.call(this,_,w),_,w,"mouse");N&&(Pt(_.view).on("mousemove.drag",m,Di).on("mouseup.drag",v,Di),pm(_.view),jc(_),u=!1,l=_.clientX,a=_.clientY,N("start",_))}}function m(_){if(vo(_),!u){var w=_.clientX-l,N=_.clientY-a;u=w*w+N*N>d}o.mouse("drag",_)}function v(_){Pt(_.view).on("mousemove.drag mouseup.drag",null),hm(_.view,u),vo(_),o.mouse("end",_)}function E(_,w){if(e.call(this,_,w)){var N=_.changedTouches,C=t.call(this,_,w),L=N.length,B,I;for(B=0;B<L;++B)(I=S(this,C,_,w,N[B].identifier,N[B]))&&(jc(_),I("start",_,N[B]))}}function h(_){var w=_.changedTouches,N=w.length,C,L;for(C=0;C<N;++C)(L=o[w[C].identifier])&&(vo(_),L("drag",_,w[C]))}function g(_){var w=_.changedTouches,N=w.length,C,L;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),C=0;C<N;++C)(L=o[w[C].identifier])&&(jc(_),L("end",_,w[C]))}function S(_,w,N,C,L,B){var I=i.copy(),V=Kt(B||N,w),$,F,O;if((O=n.call(_,new Gc("beforestart",{sourceEvent:N,target:f,identifier:L,active:s,x:V[0],y:V[1],dx:0,dy:0,dispatch:I}),C))!=null)return $=O.x-V[0]||0,F=O.y-V[1]||0,function M(D,A,T){var P=V,U;switch(D){case"start":o[L]=M,U=s++;break;case"end":delete o[L],--s;case"drag":V=Kt(T||A,w),U=s;break}I.call(D,_,new Gc(D,{sourceEvent:A,subject:O,target:f,identifier:L,active:U,x:V[0]+$,y:V[1]+F,dx:V[0]-P[0],dy:V[1]-P[1],dispatch:I}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Bl(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:Bl(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Bl(_),f):n},f.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Bl(!!_),f):r},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(d=(_=+_)*_,f):Math.sqrt(d)},f}function Yc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ki(){}var Pi=.7,$l=1/Pi,yo="\\s*([+-]?\\d+)\\s*",Mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",p1=/^#([0-9a-f]{3,8})$/,h1=new RegExp(`^rgb\\(${yo},${yo},${yo}\\)$`),g1=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),m1=new RegExp(`^rgba\\(${yo},${yo},${yo},${Mi}\\)$`),v1=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Mi}\\)$`),y1=new RegExp(`^hsl\\(${Mi},${Qt},${Qt}\\)$`),E1=new RegExp(`^hsla\\(${Mi},${Qt},${Qt},${Mi}\\)$`),mm={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};Yc(ki,Ui,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:vm,formatHex:vm,formatHex8:S1,formatHsl:_1,formatRgb:ym,toString:ym});function vm(){return this.rgb().formatHex()}function S1(){return this.rgb().formatHex8()}function _1(){return Rm(this).formatHsl()}function ym(){return this.rgb().formatRgb()}function Ui(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=p1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Em(t):n===3?new tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=h1.exec(e))?new tt(t[1],t[2],t[3],1):(t=g1.exec(e))?new tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=m1.exec(e))?zl(t[1],t[2],t[3],t[4]):(t=v1.exec(e))?zl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=y1.exec(e))?wm(t[1],t[2]/100,t[3]/100,1):(t=E1.exec(e))?wm(t[1],t[2]/100,t[3]/100,t[4]):mm.hasOwnProperty(e)?Em(mm[e]):e==="transparent"?new tt(NaN,NaN,NaN,0):null}function Em(e){return new tt(e>>16&255,e>>8&255,e&255,1)}function zl(e,t,n,r){return r<=0&&(e=t=n=NaN),new tt(e,t,n,r)}function w1(e){return e instanceof ki||(e=Ui(e)),e?(e=e.rgb(),new tt(e.r,e.g,e.b,e.opacity)):new tt}function Wc(e,t,n,r){return arguments.length===1?w1(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Yc(tt,Wc,gm(ki,{brighter(e){return e=e==null?$l:Math.pow($l,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pi:Math.pow(Pi,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tt(Er(this.r),Er(this.g),Er(this.b),Hl(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:Sm,formatHex:Sm,formatHex8:R1,formatRgb:_m,toString:_m}));function Sm(){return`#${Sr(this.r)}${Sr(this.g)}${Sr(this.b)}`}function R1(){return`#${Sr(this.r)}${Sr(this.g)}${Sr(this.b)}${Sr((isNaN(this.opacity)?1:this.opacity)*255)}`}function _m(){const e=Hl(this.opacity);return`${e===1?"rgb(":"rgba("}${Er(this.r)}, ${Er(this.g)}, ${Er(this.b)}${e===1?")":`, ${e})`}`}function Hl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Er(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sr(e){return e=Er(e),(e<16?"0":"")+e.toString(16)}function wm(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Mt(e,t,n,r)}function Rm(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof ki||(e=Ui(e)),!e)return new Mt;if(e instanceof Mt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Mt(s,l,a,e.opacity)}function N1(e,t,n,r){return arguments.length===1?Rm(e):new Mt(e,t,n,r??1)}function Mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Yc(Mt,N1,gm(ki,{brighter(e){return e=e==null?$l:Math.pow($l,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pi:Math.pow(Pi,e),new Mt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,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 tt(Kc(e>=240?e-240:e+120,o,r),Kc(e,o,r),Kc(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Mt(Nm(this.h),jl(this.s),jl(this.l),Hl(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=Hl(this.opacity);return`${e===1?"hsl(":"hsla("}${Nm(this.h)}, ${jl(this.s)*100}%, ${jl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Nm(e){return e=(e||0)%360,e<0?e+360:e}function jl(e){return Math.max(0,Math.min(1,e||0))}function Kc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Om=e=>()=>e;function O1(e,t){return function(n){return e+n*t}}function x1(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)}}function T1(e){return(e=+e)==1?xm:function(t,n){return n-t?x1(t,n,e):Om(isNaN(t)?n:t)}}function xm(e,t){var n=t-e;return n?O1(e,n):Om(isNaN(e)?t:e)}const Tm=function e(t){var n=T1(t);function r(o,i){var s=n((o=Wc(o)).r,(i=Wc(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=xm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Hn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Qc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xc=new RegExp(Qc.source,"g");function C1(e){return function(){return e}}function b1(e){return function(t){return e(t)+""}}function I1(e,t){var n=Qc.lastIndex=Xc.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Qc.exec(e))&&(o=Xc.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Hn(r,o)})),n=Xc.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?b1(a[0].x):C1(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}var Cm=180/Math.PI,qc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Cm,skewX:Math.atan(a)*Cm,scaleX:s,scaleY:l}}var Gl;function A1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?qc:bm(t.a,t.b,t.c,t.d,t.e,t.f)}function L1(e){return e==null||(Gl||(Gl=document.createElementNS("http://www.w3.org/2000/svg","g")),Gl.setAttribute("transform",e),!(e=Gl.transform.baseVal.consolidate()))?qc:(e=e.matrix,bm(e.a,e.b,e.c,e.d,e.e,e.f))}function Im(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,p,m){if(u!==d||c!==f){var v=p.push("translate(",null,t,null,n);m.push({i:v-4,x:Hn(u,d)},{i:v-2,x:Hn(c,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Hn(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Hn(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,p,m){if(u!==d||c!==f){var v=p.push(o(p)+"scale(",null,",",null,")");m.push({i:v-4,x:Hn(u,d)},{i:v-2,x:Hn(c,f)})}else(d!==1||f!==1)&&p.push(o(p)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(p){for(var m=-1,v=f.length,E;++m<v;)d[(E=f[m]).i]=E.x(p);return d.join("")}}}var D1=Im(A1,"px, ","px)","deg)"),k1=Im(L1,", ",")",")"),P1=1e-12;function Am(e){return((e=Math.exp(e))+1/e)/2}function M1(e){return((e=Math.exp(e))-1/e)/2}function U1(e){return((e=Math.exp(2*e))-1)/(e+1)}const F1=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],p=c-l,m=d-a,v=p*p+m*m,E,h;if(v<P1)h=Math.log(f/u)/t,E=function(C){return[l+C*p,a+C*m,u*Math.exp(t*C*h)]};else{var g=Math.sqrt(v),S=(f*f-u*u+r*v)/(2*u*n*g),_=(f*f-u*u-r*v)/(2*f*n*g),w=Math.log(Math.sqrt(S*S+1)-S),N=Math.log(Math.sqrt(_*_+1)-_);h=(N-w)/t,E=function(C){var L=C*h,B=Am(w),I=u/(n*g)*(B*U1(t*L+w)-M1(w));return[l+I*p,a+I*m,u*B/Am(t*L+w)]}}return E.duration=h*1e3*t/Math.SQRT2,E}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Eo=0,Fi=0,Vi=0,Lm=1e3,Yl,Bi,Wl=0,_r=0,Kl=0,$i=typeof performance=="object"&&performance.now?performance:Date,Dm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Zc(){return _r||(Dm(V1),_r=$i.now()+Kl)}function V1(){_r=0}function Ql(){this._call=this._time=this._next=null}Ql.prototype=km.prototype={constructor:Ql,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Zc():+n)+(t==null?0:+t),!this._next&&Bi!==this&&(Bi?Bi._next=this:Yl=this,Bi=this),this._call=e,this._time=n,Jc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jc())}};function km(e,t,n){var r=new Ql;return r.restart(e,t,n),r}function B1(){Zc(),++Eo;for(var e=Yl,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Eo}function Pm(){_r=(Wl=$i.now())+Kl,Eo=Fi=0;try{B1()}finally{Eo=0,z1(),_r=0}}function $1(){var e=$i.now(),t=e-Wl;t>Lm&&(Kl-=t,Wl=e)}function z1(){for(var e,t=Yl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Yl=n);Bi=e,Jc(r)}function Jc(e){if(!Eo){Fi&&(Fi=clearTimeout(Fi));var t=e-_r;t>24?(e<1/0&&(Fi=setTimeout(Pm,e-$i.now()-Kl)),Vi&&(Vi=clearInterval(Vi))):(Vi||(Wl=$i.now(),Vi=setInterval($1,Lm)),Eo=1,Dm(Pm))}}function Mm(e,t,n){var r=new Ql;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var H1=Ml("start","end","cancel","interrupt"),j1=[],Um=0,Fm=1,ed=2,Xl=3,Vm=4,td=5,ql=6;function Zl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;G1(e,n,{name:t,index:r,group:o,on:H1,tween:j1,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Um})}function nd(e,t){var n=Ut(e,t);if(n.state>Um)throw new Error("too late; already scheduled");return n}function Xt(e,t){var n=Ut(e,t);if(n.state>Xl)throw new Error("too late; already running");return n}function Ut(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function G1(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=km(i,0,n.time);function i(u){n.state=Fm,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,p;if(n.state!==Fm)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===Xl)return Mm(s);p.state===Vm?(p.state=ql,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=ql,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(Mm(function(){n.state===Xl&&(n.state=Vm,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=ed,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ed){for(n.state=Xl,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=p);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=td,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===td&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=ql,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Jl(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>ed&&r.state<td,r.state=ql,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Y1(e){return this.each(function(){Jl(this,e)})}function W1(e,t){var n,r;return function(){var o=Xt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function K1(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Xt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function Q1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ut(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?W1:K1)(n,e,t))}function rd(e,t,n){var r=e._id;return e.each(function(){var o=Xt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ut(o,r).value[t]}}function Bm(e,t){var n;return(typeof t=="number"?Hn:t instanceof Ui?Tm:(n=Ui(t))?(t=n,Tm):I1)(e,t)}function X1(e){return function(){this.removeAttribute(e)}}function q1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Z1(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function J1(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function eN(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function tN(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function nN(e,t){var n=Fl(e),r=n==="transform"?k1:Bm;return this.attrTween(e,typeof t=="function"?(n.local?tN:eN)(n,r,rd(this,"attr."+e,t)):t==null?(n.local?q1:X1)(n):(n.local?J1:Z1)(n,r,t))}function rN(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function oN(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function iN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&oN(e,i)),n}return o._value=t,o}function sN(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&rN(e,i)),n}return o._value=t,o}function lN(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Fl(e);return this.tween(n,(r.local?iN:sN)(r,t))}function aN(e,t){return function(){nd(this,e).delay=+t.apply(this,arguments)}}function uN(e,t){return t=+t,function(){nd(this,e).delay=t}}function cN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?aN:uN)(t,e)):Ut(this.node(),t).delay}function dN(e,t){return function(){Xt(this,e).duration=+t.apply(this,arguments)}}function fN(e,t){return t=+t,function(){Xt(this,e).duration=t}}function pN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dN:fN)(t,e)):Ut(this.node(),t).duration}function hN(e,t){if(typeof t!="function")throw new Error;return function(){Xt(this,e).ease=t}}function gN(e){var t=this._id;return arguments.length?this.each(hN(t,e)):Ut(this.node(),t).ease}function mN(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xt(this,e).ease=n}}function vN(e){if(typeof e!="function")throw new Error;return this.each(mN(this._id,e))}function yN(e){typeof e!="function"&&(e=rm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new gn(r,this._parents,this._name,this._id)}function EN(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),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,p=0;p<c;++p)(f=a[p]||u[p])&&(d[p]=f);for(;l<r;++l)s[l]=t[l];return new gn(s,this._parents,this._name,this._id)}function SN(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function _N(e,t,n){var r,o,i=SN(t)?nd:Xt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function wN(e,t){var n=this._id;return arguments.length<2?Ut(this.node(),n).on.on(e):this.each(_N(n,e,t))}function RN(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function NN(){return this.on("end.remove",RN(this._id))}function ON(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Zl(u[f],t,n,f,u,Ut(c,n)));return new gn(i,this._parents,t,n)}function xN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),p,m=Ut(c,n),v=0,E=f.length;v<E;++v)(p=f[v])&&Zl(p,t,n,v,f,m);i.push(f),s.push(c)}return new gn(i,s,t,n)}var TN=Li.prototype.constructor;function CN(){return new TN(this._groups,this._parents)}function bN(e,t){var n,r,o;return function(){var i=mo(this,e),s=(this.style.removeProperty(e),mo(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function $m(e){return function(){this.style.removeProperty(e)}}function IN(e,t,n){var r,o=n+"",i;return function(){var s=mo(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function AN(e,t,n){var r,o,i;return function(){var s=mo(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),mo(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function LN(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Xt(this,e),u=a.on,c=a.value[i]==null?l||(l=$m(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function DN(e,t,n){var r=(e+="")=="transform"?D1:Bm;return t==null?this.styleTween(e,bN(e,r)).on("end.style."+e,$m(e)):typeof t=="function"?this.styleTween(e,AN(e,r,rd(this,"style."+e,t))).each(LN(this._id,e)):this.styleTween(e,IN(e,r,t),n).on("end.style."+e,null)}function kN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function PN(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&kN(e,s,n)),r}return i._value=t,i}function MN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,PN(e,t,n??""))}function UN(e){return function(){this.textContent=e}}function FN(e){return function(){var t=e(this);this.textContent=t??""}}function VN(e){return this.tween("text",typeof e=="function"?FN(rd(this,"text",e)):UN(e==null?"":e+""))}function BN(e){return function(t){this.textContent=e.call(this,t)}}function $N(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&BN(o)),t}return r._value=e,r}function zN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,$N(e))}function HN(){for(var e=this._name,t=this._id,n=zm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=Ut(a,t);Zl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new gn(r,this._parents,e,n)}function jN(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Xt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var GN=0;function gn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function zm(){return++GN}var mn=Li.prototype;gn.prototype={constructor:gn,select:ON,selectAll:xN,selectChild:mn.selectChild,selectChildren:mn.selectChildren,filter:yN,merge:EN,selection:CN,transition:HN,call:mn.call,nodes:mn.nodes,node:mn.node,size:mn.size,empty:mn.empty,each:mn.each,on:wN,attr:nN,attrTween:lN,style:DN,styleTween:MN,text:VN,textTween:zN,remove:NN,tween:Q1,delay:cN,duration:pN,ease:gN,easeVarying:vN,end:jN,[Symbol.iterator]:mn[Symbol.iterator]};function YN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var WN={time:null,delay:0,duration:250,ease:YN};function KN(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function QN(e){var t,n;e instanceof gn?(t=e._id,e=e._name):(t=zm(),(n=WN).time=Zc(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Zl(a,e,t,u,s,n||KN(a,t));return new gn(r,this._parents,e,t)}Li.prototype.interrupt=Y1,Li.prototype.transition=QN;const ea=e=>()=>e;function XN(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 vn(e,t,n){this.k=e,this.x=t,this.y=n}vn.prototype={constructor:vn,scale:function(e){return e===1?this:new vn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vn(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 jn=new vn(1,0,0);vn.prototype;function od(e){e.stopImmediatePropagation()}function zi(e){e.preventDefault(),e.stopImmediatePropagation()}function qN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ZN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.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 Hm(){return this.__zoom||jn}function JN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eO(){return navigator.maxTouchPoints||"ontouchstart"in this}function tO(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function nO(){var e=qN,t=ZN,n=tO,r=JN,o=eO,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=F1,u=Ml("start","zoom","end"),c,d,f,p=500,m=150,v=0,E=10;function h(O){O.property("__zoom",Hm).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",V).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(O,M,D,A){var T=O.selection?O.selection():O;T.property("__zoom",Hm),O!==T?w(O,M,D,A):T.interrupt().each(function(){N(this,arguments).event(A).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},h.scaleBy=function(O,M,D,A){h.scaleTo(O,function(){var T=this.__zoom.k,P=typeof M=="function"?M.apply(this,arguments):M;return T*P},D,A)},h.scaleTo=function(O,M,D,A){h.transform(O,function(){var T=t.apply(this,arguments),P=this.__zoom,U=D==null?_(T):typeof D=="function"?D.apply(this,arguments):D,z=P.invert(U),j=typeof M=="function"?M.apply(this,arguments):M;return n(S(g(P,j),U,z),T,s)},D,A)},h.translateBy=function(O,M,D,A){h.transform(O,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,A)},h.translateTo=function(O,M,D,A,T){h.transform(O,function(){var P=t.apply(this,arguments),U=this.__zoom,z=A==null?_(P):typeof A=="function"?A.apply(this,arguments):A;return n(jn.translate(z[0],z[1]).scale(U.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof D=="function"?-D.apply(this,arguments):-D),P,s)},A,T)};function g(O,M){return M=Math.max(i[0],Math.min(i[1],M)),M===O.k?O:new vn(M,O.x,O.y)}function S(O,M,D){var A=M[0]-D[0]*O.k,T=M[1]-D[1]*O.k;return A===O.x&&T===O.y?O:new vn(O.k,A,T)}function _(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function w(O,M,D,A){O.on("start.zoom",function(){N(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(A).end()}).tween("zoom",function(){var T=this,P=arguments,U=N(T,P).event(A),z=t.apply(T,P),j=D==null?_(z):typeof D=="function"?D.apply(T,P):D,K=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),W=T.__zoom,J=typeof M=="function"?M.apply(T,P):M,X=a(W.invert(j).concat(K/W.k),J.invert(j).concat(K/J.k));return function(te){if(te===1)te=J;else{var ie=X(te),ve=K/ie[2];te=new vn(ve,j[0]-ie[0]*ve,j[1]-ie[1]*ve)}U.zoom(null,te)}})}function N(O,M,D){return!D&&O.__zooming||new C(O,M)}function C(O,M){this.that=O,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,M),this.taps=0}C.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,M){return this.mouse&&O!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var M=Pt(this.that).datum();u.call(O,this.that,new XN(O,{sourceEvent:this.sourceEvent,target:h,type:O,transform:this.that.__zoom,dispatch:u}),M)}};function L(O,...M){if(!e.apply(this,arguments))return;var D=N(this,M).event(O),A=this.__zoom,T=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),P=Kt(O);if(D.wheel)(D.mouse[0][0]!==P[0]||D.mouse[0][1]!==P[1])&&(D.mouse[1]=A.invert(D.mouse[0]=P)),clearTimeout(D.wheel);else{if(A.k===T)return;D.mouse=[P,A.invert(P)],Jl(this),D.start()}zi(O),D.wheel=setTimeout(U,m),D.zoom("mouse",n(S(g(A,T),D.mouse[0],D.mouse[1]),D.extent,s));function U(){D.wheel=null,D.end()}}function B(O,...M){if(f||!e.apply(this,arguments))return;var D=O.currentTarget,A=N(this,M,!0).event(O),T=Pt(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",K,!0),P=Kt(O,D),U=O.clientX,z=O.clientY;pm(O.view),od(O),A.mouse=[P,this.__zoom.invert(P)],Jl(this),A.start();function j(W){if(zi(W),!A.moved){var J=W.clientX-U,X=W.clientY-z;A.moved=J*J+X*X>v}A.event(W).zoom("mouse",n(S(A.that.__zoom,A.mouse[0]=Kt(W,D),A.mouse[1]),A.extent,s))}function K(W){T.on("mousemove.zoom mouseup.zoom",null),hm(W.view,A.moved),zi(W),A.event(W).end()}}function I(O,...M){if(e.apply(this,arguments)){var D=this.__zoom,A=Kt(O.changedTouches?O.changedTouches[0]:O,this),T=D.invert(A),P=D.k*(O.shiftKey?.5:2),U=n(S(g(D,P),A,T),t.apply(this,M),s);zi(O),l>0?Pt(this).transition().duration(l).call(w,U,A,O):Pt(this).call(h.transform,U,A,O)}}function V(O,...M){if(e.apply(this,arguments)){var D=O.touches,A=D.length,T=N(this,M,O.changedTouches.length===A).event(O),P,U,z,j;for(od(O),U=0;U<A;++U)z=D[U],j=Kt(z,this),j=[j,this.__zoom.invert(j),z.identifier],T.touch0?!T.touch1&&T.touch0[2]!==j[2]&&(T.touch1=j,T.taps=0):(T.touch0=j,P=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),P&&(T.taps<2&&(d=j[0],c=setTimeout(function(){c=null},p)),Jl(this),T.start())}}function $(O,...M){if(this.__zooming){var D=N(this,M).event(O),A=O.changedTouches,T=A.length,P,U,z,j;for(zi(O),P=0;P<T;++P)U=A[P],z=Kt(U,this),D.touch0&&D.touch0[2]===U.identifier?D.touch0[0]=z:D.touch1&&D.touch1[2]===U.identifier&&(D.touch1[0]=z);if(U=D.that.__zoom,D.touch1){var K=D.touch0[0],W=D.touch0[1],J=D.touch1[0],X=D.touch1[1],te=(te=J[0]-K[0])*te+(te=J[1]-K[1])*te,ie=(ie=X[0]-W[0])*ie+(ie=X[1]-W[1])*ie;U=g(U,Math.sqrt(te/ie)),z=[(K[0]+J[0])/2,(K[1]+J[1])/2],j=[(W[0]+X[0])/2,(W[1]+X[1])/2]}else if(D.touch0)z=D.touch0[0],j=D.touch0[1];else return;D.zoom("touch",n(S(U,z,j),D.extent,s))}}function F(O,...M){if(this.__zooming){var D=N(this,M).event(O),A=O.changedTouches,T=A.length,P,U;for(od(O),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),P=0;P<T;++P)U=A[P],D.touch0&&D.touch0[2]===U.identifier?delete D.touch0:D.touch1&&D.touch1[2]===U.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(U=Kt(U,this),Math.hypot(d[0]-U[0],d[1]-U[1])<E)){var z=Pt(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return h.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:ea(+O),h):r},h.filter=function(O){return arguments.length?(e=typeof O=="function"?O:ea(!!O),h):e},h.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:ea(!!O),h):o},h.extent=function(O){return arguments.length?(t=typeof O=="function"?O:ea([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),h):t},h.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],h):[i[0],i[1]]},h.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(O){return arguments.length?(n=O,h):n},h.duration=function(O){return arguments.length?(l=+O,h):l},h.interpolate=function(O){return arguments.length?(a=O,h):a},h.on=function(){var O=u.on.apply(u,arguments);return O===u?h:O},h.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,h):Math.sqrt(v)},h.tapDistance=function(O){return arguments.length?(E=+O,h):E},h}const ta=R.createContext(null),rO=ta.Provider,Gn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`},jm=Gn.error001();function ce(e,t){const n=R.useContext(ta);if(n===null)throw new Error(jm);return qg(n,e,t)}const Ce=()=>{const e=R.useContext(ta);if(e===null)throw new Error(jm);return R.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},oO=e=>e.userSelectionActive?"none":"all";function id({position:e,children:t,className:n,style:r,...o}){const i=ce(oO),s=`${e}`.split("-");return y("div",{className:et(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function iO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:y(id,{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:y("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const sO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c})=>{const d=R.useRef(null),[f,p]=R.useState({x:0,y:0,width:0,height:0}),m=et(["react-flow__edge-textwrapper",u]);return R.useEffect(()=>{if(d.current){const v=d.current.getBBox();p({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:k("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...c,children:[o&&y("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),y("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),a]})};var lO=R.memo(sO);const sd=e=>({width:e.offsetWidth,height:e.offsetHeight}),So=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ld=(e={x:0,y:0},t)=>({x:So(e.x,t[0][0],t[1][0]),y:So(e.y,t[0][1],t[1][1])}),Gm=(e,t,n)=>e<t?So(Math.abs(e-t),1,50)/50:e>n?-So(Math.abs(e-n),1,50)/50:0,Ym=(e,t)=>{const n=Gm(e.x,35,t.width-35)*20,r=Gm(e.y,35,t.height-35)*20;return[n,r]},Wm=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aO=(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)}),Km=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),uO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Qm=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),ad=(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)},cO=e=>Rt(e.width)&&Rt(e.height)&&Rt(e.x)&&Rt(e.y),Rt=e=>!isNaN(e)&&isFinite(e),Oe=Symbol.for("internals"),Xm=["Enter"," ","Escape"],dO=(e,t)=>{},fO=e=>"nativeEvent"in e;function ud(e){var o,i;const t=fO(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const qm=e=>"clientX"in e,Yn=(e,t)=>{var i,s;const n=qm(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},_o=({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,style:u,markerEnd:c,markerStart:d,interactionWidth:f=20})=>k(Ee,{children:[y("path",{style:u,d:e,fill:"none",className:"react-flow__edge-path",markerEnd:c,markerStart:d}),f&&y("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&Rt(t)&&Rt(n)?y(lO,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]});_o.displayName="BaseEdge";function Hi(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Zm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function Jm({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}var Wn;(function(e){e.Strict="strict",e.Loose="loose"})(Wn||(Wn={}));var wo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wo||(wo={}));var ji;(function(e){e.Partial="partial",e.Full="full"})(ji||(ji={}));var Kn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Kn||(Kn={}));var Gi;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Gi||(Gi={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));function ev({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Y.Left||e===Y.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function tv({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top}){const[s,l]=ev({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=ev({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,p]=Jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,p]}const cd=R.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:v})=>{const[E,h,g]=tv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return y(_o,{path:E,labelX:h,labelY:g,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:v})});cd.displayName="SimpleBezierEdge";const nv={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},pO=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.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},rv=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hO({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:o,offset:i}){const s=nv[t],l=nv[r],a={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},c=pO({source:a,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let p=[],m,v;const[E,h,g,S]=Zm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*l[d]===-1){m=o.x||E,v=o.y||h;const w=[{x:m,y:a.y},{x:m,y:u.y}],N=[{x:a.x,y:v},{x:u.x,y:v}];s[d]===f?p=d==="x"?w:N:p=d==="x"?N:w}else{const w=[{x:a.x,y:u.y}],N=[{x:u.x,y:a.y}];if(d==="x"?p=s.x===f?N:w:p=s.y===f?w:N,t!==r){const C=d==="x"?"y":"x",L=s[d]===l[C],B=a[C]>u[C],I=a[C]<u[C];(s[d]===1&&(!L&&B||L&&I)||s[d]!==1&&(!L&&I||L&&B))&&(p=d==="x"?w:N)}m=p[0].x,v=p[0].y}return[[e,a,...p,u,n],m,v,g,S]}function gO(e,t,n,r){const o=Math.min(rv(e,t)/2,rv(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Yi({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20}){const[c,d,f,p,m]=hO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u});return[c.reduce((E,h,g)=>{let S="";return g>0&&g<c.length-1?S=gO(c[g-1],h,c[g+1],s):S=`${g===0?"M":"L"}${h.x} ${h.y}`,E+=S,E},""),d,f,p,m]}const na=R.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,sourcePosition:d=Y.Bottom,targetPosition:f=Y.Top,markerEnd:p,markerStart:m,pathOptions:v,interactionWidth:E})=>{const[h,g,S]=Yi({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return y(_o,{path:h,labelX:g,labelY:S,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:p,markerStart:m,interactionWidth:E})});na.displayName="SmoothStepEdge";const dd=R.memo(e=>{var t;return y(na,{...e,pathOptions:R.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});dd.displayName="StepEdge";function mO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Zm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const fd=R.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:p})=>{const[m,v,E]=mO({sourceX:e,sourceY:t,targetX:n,targetY:r});return y(_o,{path:m,labelX:v,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:p})});fd.displayName="StraightEdge";function ra(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ov({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Y.Left:return[t-ra(t-r,i),n];case Y.Right:return[t+ra(r-t,i),n];case Y.Top:return[t,n-ra(n-o,i)];case Y.Bottom:return[t,n+ra(o-n,i)]}}function iv({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,curvature:s=.25}){const[l,a]=ov({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=ov({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,p,m]=Jm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,p,m]}const oa=R.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=Y.Bottom,targetPosition:i=Y.Top,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,pathOptions:v,interactionWidth:E})=>{const[h,g,S]=iv({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return y(_o,{path:h,labelX:g,labelY:S,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:E})});oa.displayName="BezierEdge";const pd=R.createContext(null),vO=pd.Provider;pd.Consumer;const yO=()=>R.useContext(pd),EO=e=>"id"in e&&"source"in e&&"target"in e,sv=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,hd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,SO=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),lv=(e,t)=>{if(!e.source||!e.target)return t;let n;return EO(e)?n={...e}:n={...e,id:sv(e)},SO(n,t)?t:t.concat(n)},_O=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...i}=e;if(!t.source||!t.target||!n.find(a=>a.id===o))return n;const l={...i,id:r.shouldReplaceId?sv(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(l)},av=({x:e,y:t},[n,r,o],i,[s,l])=>{const a={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(a.x/s),y:l*Math.round(a.y/l)}:a},wO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Ro=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},uv=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=Ro(o,t).positionAbsolute;return aO(r,Km({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return uO(n)},cv=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,l=[0,0])=>{const a={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:p=!0,hidden:m=!1}=c;if(s&&!p||m)return!1;const{positionAbsolute:v}=Ro(c,l),E={x:v.x,y:v.y,width:d||0,height:f||0},h=ad(a,E),g=typeof d>"u"||typeof f>"u"||d===null||f===null,S=i&&h>0,_=(d||0)*(f||0);(g||S||h>=_||c.dragging)&&u.push(c)}),u},dv=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},fv=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),l=n/(e.height*(1+i)),a=Math.min(s,l),u=So(a,r,o),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,p=n/2-d*u;return[f,p,u]},wr=(e,t=0)=>e.transition().duration(t);function pv(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,l;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+i.y+i.height/2}),o},[])}function RO(e,t,n){let r=null,o=1/0;return n.forEach(i=>{const s=Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));s<=t&&s<o&&(o=s,r=i)}),r}const NO={source:null,target:null,sourceHandle:null,targetHandle:null};function hv(e,t,n,r,o,i,s,l){const a=i==="target",u=l.querySelector(`.react-flow__handle[data-id="${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`),{x:c,y:d}=Yn(e),f=l.elementFromPoint(c,d),p=f!=null&&f.classList.contains("react-flow__handle")?f:u,m={handleDomNode:p,isValid:!1,connection:NO,endHandle:null};if(p){const v=gv(void 0,p),E=p.getAttribute("data-nodeid"),h=p.getAttribute("data-handleid"),g=p.classList.contains("connectable"),S=p.classList.contains("connectableend"),_={source:a?E:r,sourceHandle:a?h:o,target:a?r:E,targetHandle:a?o:h};m.connection=_,g&&S&&(n===Wn.Strict?a&&v==="source"||!a&&v==="target":E!==r||h!==o)&&(m.endHandle={nodeId:E,handleId:h,type:v},m.isValid=s(_))}return m}function OO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[Oe]){const{handleBounds:s}=i[Oe];let l=[],a=[];s&&(l=pv(i,s,"source",`${t}-${n}-${r}`),a=pv(i,s,"target",`${t}-${n}-${r}`)),o.push(...l,...a)}return o},[])}function gv(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function gd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function xO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function mv({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:l,edgeUpdaterType:a,onEdgeUpdateEnd:u}){const c=Wm(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:m,onConnectStart:v,panBy:E,getNodes:h,cancelConnection:g}=i();let S=0,_;const{x:w,y:N}=Yn(e),C=c==null?void 0:c.elementFromPoint(w,N),L=gv(a,C),B=f==null?void 0:f.getBoundingClientRect();if(!B||!L)return;let I,V=Yn(e,B),$=!1,F=null,O=!1,M=null;const D=OO({nodes:h(),nodeId:n,handleId:t,handleType:L}),A=()=>{if(!p)return;const[U,z]=Ym(V,B);E({x:U,y:z}),S=requestAnimationFrame(A)};s({connectionPosition:V,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:L});function T(U){const{transform:z}=i();V=Yn(U,B),_=RO(av(V,z,!1,[1,1]),m,D),$||(A(),$=!0);const j=hv(U,_,d,n,t,o?"target":"source",l,c);if(M=j.handleDomNode,F=j.connection,O=j.isValid,s({connectionPosition:_&&O?wO({x:_.x,y:_.y},z):V,connectionStatus:xO(!!_,O),connectionEndHandle:j.endHandle}),!_&&!O&&!M)return gd(I);F.source!==F.target&&M&&(gd(I),I=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",O),M.classList.toggle("react-flow__handle-valid",O))}function P(U){var z,j;(_||M)&&F&&O&&(r==null||r(F)),(j=(z=i()).onConnectEnd)==null||j.call(z,U),a&&(u==null||u(U)),gd(I),g(),cancelAnimationFrame(S),$=!1,O=!1,F=null,M=null,c.removeEventListener("mousemove",T),c.removeEventListener("mouseup",P),c.removeEventListener("touchmove",T),c.removeEventListener("touchend",P)}c.addEventListener("mousemove",T),c.addEventListener("mouseup",P),c.addEventListener("touchmove",T),c.addEventListener("touchend",P)}const vv=()=>!0,TO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),CO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},yv=R.forwardRef(({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},p)=>{var B,I;const m=s||null,v=e==="target",E=Ce(),h=yO(),{connectOnClick:g,noPanClassName:S}=ce(TO,Ge),{connecting:_,clickConnecting:w}=ce(CO(h,m,e));h||(I=(B=E.getState()).onError)==null||I.call(B,"010",Gn.error010());const N=V=>{const{defaultEdgeOptions:$,onConnect:F,hasDefaultEdges:O}=E.getState(),M={...$,...V};if(O){const{edges:D,setEdges:A}=E.getState();A(lv(M,D))}F==null||F(M),l==null||l(M)},C=V=>{if(!h)return;const $=qm(V);o&&($&&V.button===0||!$)&&mv({event:V,handleId:m,nodeId:h,onConnect:N,isTarget:v,getState:E.getState,setState:E.setState,isValidConnection:n||E.getState().isValidConnection||vv}),$?c==null||c(V):d==null||d(V)},L=V=>{const{onClickConnectStart:$,onClickConnectEnd:F,connectionClickStartHandle:O,connectionMode:M,isValidConnection:D}=E.getState();if(!h||!O&&!o)return;if(!O){$==null||$(V,{nodeId:h,handleId:m,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:h,type:e,handleId:m}});return}const A=Wm(V.target),T=n||D||vv,{connection:P,isValid:U}=hv(V,{nodeId:h,id:m,type:e},M,O.nodeId,O.handleId||null,O.type,T,A);U&&N(P),F==null||F(V),E.setState({connectionClickStartHandle:null})};return y("div",{"data-handleid":m,"data-nodeid":h,"data-handlepos":t,"data-id":`${h}-${m}-${e}`,className:et(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:w,connectionindicator:r&&(o&&!_||i&&_)}]),onMouseDown:C,onTouchStart:C,onClick:g?L:void 0,ref:p,...f,children:a})});yv.displayName="Handle";var No=R.memo(yv);const Ev=({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:r=Y.Bottom})=>k(Ee,{children:[y(No,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,y(No,{type:"source",position:r,isConnectable:t})]});Ev.displayName="DefaultNode";var md=R.memo(Ev);const Sv=({data:e,isConnectable:t,sourcePosition:n=Y.Bottom})=>k(Ee,{children:[e==null?void 0:e.label,y(No,{type:"source",position:n,isConnectable:t})]});Sv.displayName="InputNode";var _v=R.memo(Sv);const wv=({data:e,isConnectable:t,targetPosition:n=Y.Top})=>k(Ee,{children:[y(No,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});wv.displayName="OutputNode";var Rv=R.memo(wv);const vd=()=>null;vd.displayName="GroupNode";const bO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),ia=e=>e.id;function IO(e,t){return Ge(e.selectedNodes.map(ia),t.selectedNodes.map(ia))&&Ge(e.selectedEdges.map(ia),t.selectedEdges.map(ia))}const Nv=R.memo(({onSelectionChange:e})=>{const t=Ce(),{selectedNodes:n,selectedEdges:r}=ce(bO,IO);return R.useEffect(()=>{var i,s;const o={nodes:n,edges:r};e==null||e(o),(s=(i=t.getState()).onSelectionChange)==null||s.call(i,o)},[n,r,e]),null});Nv.displayName="SelectionListener";const AO=e=>!!e.onSelectionChange;function LO({onSelectionChange:e}){const t=ce(AO);return e||t?y(Nv,{onSelectionChange:e}):null}const DO=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Oo(e,t){R.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Z(e,t,n){R.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const kO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:a,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:p,elevateNodesOnSelect:m,minZoom:v,maxZoom:E,nodeExtent:h,onNodesChange:g,onEdgesChange:S,elementsSelectable:_,connectionMode:w,snapGrid:N,snapToGrid:C,translateExtent:L,connectOnClick:B,defaultEdgeOptions:I,fitView:V,fitViewOptions:$,onNodesDelete:F,onEdgesDelete:O,onNodeDrag:M,onNodeDragStart:D,onNodeDragStop:A,onSelectionDrag:T,onSelectionDragStart:P,onSelectionDragStop:U,noPanClassName:z,nodeOrigin:j,rfId:K,autoPanOnConnect:W,autoPanOnNodeDrag:J,onError:X,connectionRadius:te,isValidConnection:ie})=>{const{setNodes:ve,setEdges:de,setDefaultNodesAndEdges:be,setMinZoom:Ke,setMaxZoom:gt,setTranslateExtent:ye,setNodeExtent:pe,reset:nt}=ce(DO,Ge),Q=Ce();return R.useEffect(()=>{const nr=r==null?void 0:r.map(br=>({...br,...I}));return be(n,nr),()=>{nt()}},[]),Z("defaultEdgeOptions",I,Q.setState),Z("connectionMode",w,Q.setState),Z("onConnect",o,Q.setState),Z("onConnectStart",i,Q.setState),Z("onConnectEnd",s,Q.setState),Z("onClickConnectStart",l,Q.setState),Z("onClickConnectEnd",a,Q.setState),Z("nodesDraggable",u,Q.setState),Z("nodesConnectable",c,Q.setState),Z("nodesFocusable",d,Q.setState),Z("edgesFocusable",f,Q.setState),Z("edgesUpdatable",p,Q.setState),Z("elementsSelectable",_,Q.setState),Z("elevateNodesOnSelect",m,Q.setState),Z("snapToGrid",C,Q.setState),Z("snapGrid",N,Q.setState),Z("onNodesChange",g,Q.setState),Z("onEdgesChange",S,Q.setState),Z("connectOnClick",B,Q.setState),Z("fitViewOnInit",V,Q.setState),Z("fitViewOnInitOptions",$,Q.setState),Z("onNodesDelete",F,Q.setState),Z("onEdgesDelete",O,Q.setState),Z("onNodeDrag",M,Q.setState),Z("onNodeDragStart",D,Q.setState),Z("onNodeDragStop",A,Q.setState),Z("onSelectionDrag",T,Q.setState),Z("onSelectionDragStart",P,Q.setState),Z("onSelectionDragStop",U,Q.setState),Z("noPanClassName",z,Q.setState),Z("nodeOrigin",j,Q.setState),Z("rfId",K,Q.setState),Z("autoPanOnConnect",W,Q.setState),Z("autoPanOnNodeDrag",J,Q.setState),Z("onError",X,Q.setState),Z("connectionRadius",te,Q.setState),Z("isValidConnection",ie,Q.setState),Oo(e,ve),Oo(t,de),Oo(v,Ke),Oo(E,gt),Oo(L,ye),Oo(h,pe),null},Ov={display:"none"},PO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xv="react-flow__node-desc",Tv="react-flow__edge-desc",MO="react-flow__aria-live",UO=e=>e.ariaLiveMessage;function FO({rfId:e}){const t=ce(UO);return y("div",{id:`${MO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:PO,children:t})}function VO({rfId:e,disableKeyboardA11y:t}){return k(Ee,{children:[k("div",{id:`${xv}-${e}`,style:Ov,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),y("div",{id:`${Tv}-${e}`,style:Ov,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&y(FO,{rfId:e})]})}const BO=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,$O=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,Cv="react-flow__edgeupdater",bv=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l})=>y("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:et([Cv,`${Cv}-${l}`]),cx:BO(t,r,e),cy:$O(n,r,e),r,stroke:"transparent",fill:"transparent"}),zO=()=>!0;var xo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:l,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:v,style:E,source:h,target:g,sourceX:S,sourceY:_,targetX:w,targetY:N,sourcePosition:C,targetPosition:L,elementsSelectable:B,hidden:I,sourceHandleId:V,targetHandleId:$,onContextMenu:F,onMouseEnter:O,onMouseMove:M,onMouseLeave:D,edgeUpdaterRadius:A,onEdgeUpdate:T,onEdgeUpdateStart:P,onEdgeUpdateEnd:U,markerEnd:z,markerStart:j,rfId:K,ariaLabel:W,isFocusable:J,isUpdatable:X,pathOptions:te,interactionWidth:ie})=>{const ve=R.useRef(null),[de,be]=R.useState(!1),[Ke,gt]=R.useState(!1),ye=Ce(),pe=R.useMemo(()=>`url(#${hd(j,K)})`,[j,K]),nt=R.useMemo(()=>`url(#${hd(z,K)})`,[z,K]);if(I)return null;const Q=rt=>{const{edges:zt,addSelectedEdges:Lr}=ye.getState();if(B&&(ye.setState({nodesSelectionActive:!1}),Lr([n])),s){const Dr=zt.find(kr=>kr.id===n);s(rt,Dr)}},nr=Hi(n,ye.getState,l),br=Hi(n,ye.getState,F),fs=Hi(n,ye.getState,O),ps=Hi(n,ye.getState,M),Fo=Hi(n,ye.getState,D),Ir=(rt,zt)=>{if(rt.button!==0)return;const{edges:Lr,isValidConnection:Dr}=ye.getState(),kr=zt?g:h,Ra=(zt?$:V)||null,Pr=zt?"target":"source",cf=Dr||zO,df=zt,gs=Lr.find(Mr=>Mr.id===n);gt(!0),P==null||P(rt,gs,Pr);const ff=Mr=>{gt(!1),U==null||U(Mr,gs,Pr)};mv({event:rt,handleId:Ra,nodeId:kr,onConnect:Mr=>T==null?void 0:T(gs,Mr),isTarget:df,getState:ye.getState,setState:ye.setState,isValidConnection:cf,edgeUpdaterType:Pr,onEdgeUpdateEnd:ff})},rr=rt=>Ir(rt,!0),Vo=rt=>Ir(rt,!1),or=()=>be(!0),Ar=()=>be(!1),hs=!B&&!s,Bo=rt=>{var zt;if(Xm.includes(rt.key)&&B){const{unselectNodesAndEdges:Lr,addSelectedEdges:Dr,edges:kr}=ye.getState();rt.key==="Escape"?((zt=ve.current)==null||zt.blur(),Lr({edges:[kr.find(Pr=>Pr.id===n)]})):Dr([n])}};return k("g",{className:et(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:a,animated:u,inactive:hs,updating:de}]),onClick:Q,onDoubleClick:nr,onContextMenu:br,onMouseEnter:fs,onMouseMove:ps,onMouseLeave:Fo,onKeyDown:J?Bo:void 0,tabIndex:J?0:void 0,role:J?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${h} to ${g}`,"aria-describedby":J?`${Tv}-${K}`:void 0,ref:ve,children:[!Ke&&y(e,{id:n,source:h,target:g,selected:a,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:v,data:i,style:E,sourceX:S,sourceY:_,targetX:w,targetY:N,sourcePosition:C,targetPosition:L,sourceHandleId:V,targetHandleId:$,markerStart:pe,markerEnd:nt,pathOptions:te,interactionWidth:ie}),X&&k(Ee,{children:[(X==="source"||X===!0)&&y(bv,{position:C,centerX:S,centerY:_,radius:A,onMouseDown:rr,onMouseEnter:or,onMouseOut:Ar,type:"source"}),(X==="target"||X===!0)&&y(bv,{position:L,centerX:w,centerY:N,radius:A,onMouseDown:Vo,onMouseEnter:or,onMouseOut:Ar,type:"target"})]})]})};return t.displayName="EdgeWrapper",R.memo(t)};function HO(e){const t={default:xo(e.default||oa),straight:xo(e.bezier||fd),step:xo(e.step||dd),smoothstep:xo(e.step||na),simplebezier:xo(e.simplebezier||cd)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=xo(e[i]||oa),o),n);return{...t,...r}}function Iv(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case Y.Top:return{x:r+i/2,y:o};case Y.Right:return{x:r+i,y:o+s/2};case Y.Bottom:return{x:r+i/2,y:o+s};case Y.Left:return{x:r,y:o+s/2}}}function Av(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const jO=(e,t,n,r,o,i)=>{const s=Iv(n,e,t),l=Iv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:l.x,targetY:l.y}};function GO({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:l,transform:a}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Km({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:s/a[2],height:l/a[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Lv(e){var r,o,i,s,l;const t=((r=e==null?void 0:e[Oe])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}function Dv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Dv(n,t):!1}function kv(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function YO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!Dv(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height}})}function Pv(e,t,n,r,o=[0,0],i){let s=e.extent||r;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:c,y:d}=Ro(u,o).positionAbsolute;s=u&&Rt(c)&&Rt(d)&&Rt(u.width)&&Rt(u.height)?[[c+e.width*o[0],d+e.height*o[1]],[c+u.width-e.width+e.width*o[0],d+u.height-e.height+e.height*o[1]]]:s}else i==null||i("005",Gn.error005()),s=r;else if(e.extent&&e.parentNode){const u=n.get(e.parentNode),{x:c,y:d}=Ro(u,o).positionAbsolute;s=[[e.extent[0][0]+c,e.extent[0][1]+d],[e.extent[1][0]+c,e.extent[1][1]+d]]}let l={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);l=Ro(u,o).positionAbsolute}const a=s?ld(t,s):t;return{position:{x:a.x-l.x,y:a.y-l.y},positionAbsolute:a}}function yd({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Mv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),l={x:s.width*r[0],y:s.height*r[1]};return i.map(a=>{const u=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(u.left-s.left-l.x)/n,y:(u.top-s.top-l.y)/n,...sd(a)}})};function Wi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);n(r,{...o})}}function Ed({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:l}=t.getState(),a=l.get(e);t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(i({nodes:[a]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function WO(){const e=Ce();return R.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,a={x:(s-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:i?o[1]*Math.round(a.y/o[1]):a.y,...a}},[])}function Sd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Uv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const l=Ce(),[a,u]=R.useState(!1),c=R.useRef([]),d=R.useRef({x:null,y:null}),f=R.useRef(0),p=R.useRef(null),m=R.useRef({x:0,y:0}),v=R.useRef(null),E=R.useRef(!1),h=WO();return R.useEffect(()=>{if(e!=null&&e.current){const g=Pt(e.current),S=({x:w,y:N})=>{const{nodeInternals:C,onNodeDrag:L,onSelectionDrag:B,updateNodePositions:I,nodeExtent:V,snapGrid:$,snapToGrid:F,nodeOrigin:O,onError:M}=l.getState();d.current={x:w,y:N};let D=!1;if(c.current=c.current.map(T=>{const P={x:w-T.distance.x,y:N-T.distance.y};F&&(P.x=$[0]*Math.round(P.x/$[0]),P.y=$[1]*Math.round(P.y/$[1]));const U=Pv(T,P,C,V,O,M);return D=D||T.position.x!==U.position.x||T.position.y!==U.position.y,T.position=U.position,T.positionAbsolute=U.positionAbsolute,T}),!D)return;I(c.current,!0,!0),u(!0);const A=o?L:Sd(B);if(A&&v.current){const[T,P]=yd({nodeId:o,dragItems:c.current,nodeInternals:C});A(v.current,T,P)}},_=()=>{if(!p.current)return;const[w,N]=Ym(m.current,p.current);if(w!==0||N!==0){const{transform:C,panBy:L}=l.getState();d.current.x=(d.current.x??0)-w/C[2],d.current.y=(d.current.y??0)-N/C[2],S(d.current),L({x:w,y:N})}f.current=requestAnimationFrame(_)};if(t)g.on(".drag",null);else{const w=f1().on("start",N=>{var D;const{nodeInternals:C,multiSelectionActive:L,domNode:B,nodesDraggable:I,unselectNodesAndEdges:V,onNodeDragStart:$,onSelectionDragStart:F}=l.getState(),O=o?$:Sd(F);!s&&!L&&o&&((D=C.get(o))!=null&&D.selected||V()),o&&i&&s&&Ed({id:o,store:l,nodeRef:e});const M=h(N);if(d.current=M,c.current=YO(C,I,M,o),O&&c.current){const[A,T]=yd({nodeId:o,dragItems:c.current,nodeInternals:C});O(N.sourceEvent,A,T)}p.current=(B==null?void 0:B.getBoundingClientRect())||null,m.current=Yn(N.sourceEvent,p.current)}).on("drag",N=>{const C=h(N),{autoPanOnNodeDrag:L}=l.getState();!E.current&&L&&(E.current=!0,_()),(d.current.x!==C.xSnapped||d.current.y!==C.ySnapped)&&c.current&&(v.current=N.sourceEvent,m.current=Yn(N.sourceEvent,p.current),S(C))}).on("end",N=>{if(u(!1),E.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:C,nodeInternals:L,onNodeDragStop:B,onSelectionDragStop:I}=l.getState(),V=o?B:Sd(I);if(C(c.current,!1,!1),V){const[$,F]=yd({nodeId:o,dragItems:c.current,nodeInternals:L});V(N.sourceEvent,$,F)}}}).filter(N=>{const C=N.target;return!N.button&&(!n||!kv(C,`.${n}`,e))&&(!r||kv(C,r,e))});return g.call(w),()=>{g.on(".drag",null)}}}},[e,t,n,r,i,l,o,s,h]),a}function Fv(){const e=Ce();return R.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:l,snapGrid:a,onError:u,nodesDraggable:c}=e.getState(),d=s().filter(g=>g.selected&&(g.draggable||c&&typeof g.draggable>"u")),f=l?a[0]:5,p=l?a[1]:5,m=n.isShiftPressed?4:1,v=n.x*f*m,E=n.y*p*m,h=d.map(g=>{if(g.positionAbsolute){const S={x:g.positionAbsolute.x+v,y:g.positionAbsolute.y+E};l&&(S.x=a[0]*Math.round(S.x/a[0]),S.y=a[1]*Math.round(S.y/a[1]));const{positionAbsolute:_,position:w}=Pv(g,S,r,o,void 0,u);g.position=w,g.positionAbsolute=_}return g});i(h,!0,!1)},[])}const To={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ki=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:l,yPosOrigin:a,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:p,onContextMenu:m,onDoubleClick:v,style:E,className:h,isDraggable:g,isSelectable:S,isConnectable:_,isFocusable:w,selectNodesOnDrag:N,sourcePosition:C,targetPosition:L,hidden:B,resizeObserver:I,dragHandle:V,zIndex:$,isParent:F,noDragClassName:O,noPanClassName:M,initialized:D,disableKeyboardA11y:A,ariaLabel:T,rfId:P})=>{const U=Ce(),z=R.useRef(null),j=R.useRef(C),K=R.useRef(L),W=R.useRef(r),J=S||g||c||d||f||p,X=Fv(),te=Wi(n,U.getState,d),ie=Wi(n,U.getState,f),ve=Wi(n,U.getState,p),de=Wi(n,U.getState,m),be=Wi(n,U.getState,v),Ke=pe=>{if(S&&(!N||!g)&&Ed({id:n,store:U,nodeRef:z}),c){const nt=U.getState().nodeInternals.get(n);c(pe,{...nt})}},gt=pe=>{if(!ud(pe))if(Xm.includes(pe.key)&&S){const nt=pe.key==="Escape";Ed({id:n,store:U,unselect:nt,nodeRef:z})}else!A&&g&&u&&Object.prototype.hasOwnProperty.call(To,pe.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${pe.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),X({x:To[pe.key].x,y:To[pe.key].y,isShiftPressed:pe.shiftKey}))};R.useEffect(()=>{if(z.current&&!B){const pe=z.current;return I==null||I.observe(pe),()=>I==null?void 0:I.unobserve(pe)}},[B]),R.useEffect(()=>{const pe=W.current!==r,nt=j.current!==C,Q=K.current!==L;z.current&&(pe||nt||Q)&&(pe&&(W.current=r),nt&&(j.current=C),Q&&(K.current=L),U.getState().updateNodeDimensions([{id:n,nodeElement:z.current,forceUpdate:!0}]))},[n,r,C,L]);const ye=Uv({nodeRef:z,disabled:B||!g,noDragClassName:O,handleSelector:V,nodeId:n,isSelectable:S,selectNodesOnDrag:N});return B?null:y("div",{className:et(["react-flow__node",`react-flow__node-${r}`,{[M]:g},h,{selected:u,selectable:S,parent:F,dragging:ye}]),ref:z,style:{zIndex:$,transform:`translate(${l}px,${a}px)`,pointerEvents:J?"all":"none",visibility:D?"visible":"hidden",...E},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:te,onMouseMove:ie,onMouseLeave:ve,onContextMenu:de,onClick:Ke,onDoubleClick:be,onKeyDown:w?gt:void 0,tabIndex:w?0:void 0,role:w?"button":void 0,"aria-describedby":A?void 0:`${xv}-${P}`,"aria-label":T,children:y(vO,{value:n,children:y(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:_,sourcePosition:C,targetPosition:L,dragging:ye,dragHandle:V,zIndex:$})})})};return t.displayName="NodeWrapper",R.memo(t)};function KO(e){const t={input:Ki(e.input||_v),default:Ki(e.default||md),output:Ki(e.output||Rv),group:Ki(e.group||vd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=Ki(e[i]||md),o),n);return{...t,...r}}const QO=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},XO=typeof document<"u"?document:null;var Qi=(e=null,t={target:XO})=>{const[n,r]=R.useState(!1),o=R.useRef(!1),i=R.useRef(new Set([])),[s,l]=R.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return R.useEffect(()=>{var a,u;if(e!==null){const c=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,!o.current&&ud(p))return!1;const m=Bv(p.code,l);i.current.add(p[m]),Vv(s,i.current,!1)&&(p.preventDefault(),r(!0))},d=p=>{if(!o.current&&ud(p))return!1;const m=Bv(p.code,l);Vv(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[m]),o.current=!1},f=()=>{i.current.clear(),r(!1)};return(a=t==null?void 0:t.target)==null||a.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var p,m;(p=t==null?void 0:t.target)==null||p.removeEventListener("keydown",c),(m=t==null?void 0:t.target)==null||m.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function Vv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Bv(e,t){return t.includes(e)?"code":"key"}function $v(e,t,n,r){var s,l;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=Ro(o,r);return $v(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[Oe])==null?void 0:s.z)??0)>(n.z??0)?((l=o[Oe])==null?void 0:l.z)??0:n.z??0},r)}function zv(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:l}=$v(r,e,{...r.position,z:((o=r[Oe])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[Oe].z=l,n!=null&&n[r.id]&&(r[Oe].isParent=!0)}})}function _d(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(l=>{var d;const a=(Rt(l.zIndex)?l.zIndex:0)+(l.selected?s:0),u=t.get(l.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(c.parentNode=l.parentNode,i[l.parentNode]=!0),Object.defineProperty(c,Oe,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[Oe])==null?void 0:d.handleBounds,z:a}}),o.set(l.id,c)}),zv(o,n,i),o}function Hv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:l,d3Selection:a,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(l&&a&&(f||!t.initial)){const m=n().filter(E=>{var g;const h=t.includeHiddenNodes?E.width&&E.height:!E.hidden;return(g=t.nodes)!=null&&g.length?h&&t.nodes.some(S=>S.id===E.id):h}),v=m.every(E=>E.width&&E.height);if(m.length>0&&v){const E=uv(m,d),[h,g,S]=fv(E,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),_=jn.translate(h,g).scale(S);return typeof t.duration=="number"&&t.duration>0?l.transform(wr(a,t.duration),_):l.transform(a,_),!0}}return!1}function qO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Oe]:r[Oe],selected:n.selected})}),new Map(t)}function ZO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function sa({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:l,hasDefaultNodes:a,hasDefaultEdges:u}=n();e!=null&&e.length&&(a&&r({nodeInternals:qO(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:ZO(t,i)}),l==null||l(t))}const Co=()=>{},JO={zoomIn:Co,zoomOut:Co,zoomTo:Co,getZoom:()=>1,setViewport:Co,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Co,fitBounds:Co,project:e=>e,viewportInitialized:!1},ex=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),tx=()=>{const e=Ce(),{d3Zoom:t,d3Selection:n}=ce(ex,Ge);return R.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(wr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(wr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(wr(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,l,a]=e.getState().transform,u=jn.translate(o.x??s,o.y??l).scale(o.zoom??a);t.transform(wr(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>Hv(e.getState,o),setCenter:(o,i,s)=>{const{width:l,height:a,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,d=l/2-o*c,f=a/2-i*c,p=jn.translate(d,f).scale(c);t.transform(wr(n,s==null?void 0:s.duration),p)},fitBounds:(o,i)=>{const{width:s,height:l,minZoom:a,maxZoom:u}=e.getState(),[c,d,f]=fv(o,s,l,a,u,(i==null?void 0:i.padding)??.1),p=jn.translate(c,d).scale(f);t.transform(wr(n,i==null?void 0:i.duration),p)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:l}=e.getState();return av(o,i,s,l)},viewportInitialized:!0}:JO,[t,n])};function wd(){const e=tx(),t=Ce(),n=R.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=R.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=R.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(E=>({...E}))},[]),i=R.useCallback(v=>{const{edges:E=[]}=t.getState();return E.find(h=>h.id===v)},[]),s=R.useCallback(v=>{const{getNodes:E,setNodes:h,hasDefaultNodes:g,onNodesChange:S}=t.getState(),_=E(),w=typeof v=="function"?v(_):v;if(g)h(w);else if(S){const N=w.length===0?_.map(C=>({type:"remove",id:C.id})):w.map(C=>({item:C,type:"reset"}));S(N)}},[]),l=R.useCallback(v=>{const{edges:E=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:S}=t.getState(),_=typeof v=="function"?v(E):v;if(g)h(_);else if(S){const w=_.length===0?E.map(N=>({type:"remove",id:N.id})):_.map(N=>({item:N,type:"reset"}));S(w)}},[]),a=R.useCallback(v=>{const E=Array.isArray(v)?v:[v],{getNodes:h,setNodes:g,hasDefaultNodes:S,onNodesChange:_}=t.getState();if(S){const N=[...h(),...E];g(N)}else if(_){const w=E.map(N=>({item:N,type:"add"}));_(w)}},[]),u=R.useCallback(v=>{const E=Array.isArray(v)?v:[v],{edges:h=[],setEdges:g,hasDefaultEdges:S,onEdgesChange:_}=t.getState();if(S)g([...h,...E]);else if(_){const w=E.map(N=>({item:N,type:"add"}));_(w)}},[]),c=R.useCallback(()=>{const{getNodes:v,edges:E=[],transform:h}=t.getState(),[g,S,_]=h;return{nodes:v().map(w=>({...w})),edges:E.map(w=>({...w})),viewport:{x:g,y:S,zoom:_}}},[]),d=R.useCallback(({nodes:v,edges:E})=>{const{nodeInternals:h,getNodes:g,edges:S,hasDefaultNodes:_,hasDefaultEdges:w,onNodesDelete:N,onEdgesDelete:C,onNodesChange:L,onEdgesChange:B}=t.getState(),I=(v||[]).map(M=>M.id),V=(E||[]).map(M=>M.id),$=g().reduce((M,D)=>{const A=!I.includes(D.id)&&D.parentNode&&M.find(P=>P.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(I.includes(D.id)||A)&&M.push(D),M},[]),F=S.filter(M=>typeof M.deletable=="boolean"?M.deletable:!0),O=F.filter(M=>V.includes(M.id));if($||O){const M=dv($,F),D=[...O,...M],A=D.reduce((T,P)=>(T.includes(P.id)||T.push(P.id),T),[]);if((w||_)&&(w&&t.setState({edges:S.filter(T=>!A.includes(T.id))}),_&&($.forEach(T=>{h.delete(T.id)}),t.setState({nodeInternals:new Map(h)}))),A.length>0&&(C==null||C(D),B&&B(A.map(T=>({id:T,type:"remove"})))),$.length>0&&(N==null||N($),L)){const T=$.map(P=>({id:P.id,type:"remove"}));L(T)}}},[]),f=R.useCallback(v=>{const E=cO(v),h=E?null:t.getState().nodeInternals.get(v.id);return[E?v:Qm(h),h,E]},[]),p=R.useCallback((v,E=!0,h)=>{const[g,S,_]=f(v);return g?(h||t.getState().getNodes()).filter(w=>{if(!_&&(w.id===S.id||!w.positionAbsolute))return!1;const N=Qm(w),C=ad(N,g);return E&&C>0||C>=v.width*v.height}):[]},[]),m=R.useCallback((v,E,h=!0)=>{const[g]=f(v);if(!g)return!1;const S=ad(g,E);return h&&S>0||S>=v.width*v.height},[]);return R.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:l,addNodes:a,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:p,isNodeIntersecting:m}),[e,n,r,o,i,s,l,a,u,c,d,p,m])}var nx=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ce(),{deleteElements:r}=wd(),o=Qi(e),i=Qi(t);R.useEffect(()=>{if(o){const{edges:s,getNodes:l}=n.getState(),a=l().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:a,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),R.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function rx(e){const t=Ce();R.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=sd(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Gn.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Rd={position:"absolute",width:"100%",height:"100%",top:0,left:0},ox=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Nd=e=>({x:e.x,y:e.y,zoom:e.k}),bo=(e,t)=>e.target.closest(`.${t}`),jv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ix=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),sx=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:a=wo.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:p,minZoom:m,maxZoom:v,zoomActivationKeyCode:E,preventScrolling:h=!0,children:g,noWheelClassName:S,noPanClassName:_})=>{const w=R.useRef(),N=Ce(),C=R.useRef(!1),L=R.useRef(!1),B=R.useRef(null),I=R.useRef({x:0,y:0,zoom:0}),{d3Zoom:V,d3Selection:$,d3ZoomHandler:F,userSelectionActive:O}=ce(ix,Ge),M=Qi(E),D=R.useRef(0);return rx(B),R.useEffect(()=>{if(B.current){const A=B.current.getBoundingClientRect(),T=nO().scaleExtent([m,v]).translateExtent(p),P=Pt(B.current).call(T),U=jn.translate(f.x,f.y).scale(So(f.zoom,m,v)),z=[[0,0],[A.width,A.height]],j=T.constrain()(U,z,p);T.transform(P,j),N.setState({d3Zoom:T,d3Selection:P,d3ZoomHandler:P.on("wheel.zoom"),transform:[j.x,j.y,j.k],domNode:B.current.closest(".react-flow")})}},[]),R.useEffect(()=>{$&&V&&(s&&!M&&!O?$.on("wheel.zoom",A=>{if(bo(A,S))return!1;A.preventDefault(),A.stopImmediatePropagation();const T=$.property("__zoom").k||1;if(A.ctrlKey&&i){const j=Kt(A),K=-A.deltaY*(A.deltaMode===1?.05:A.deltaMode?1:.002)*10,W=T*Math.pow(2,K);V.scaleTo($,W,j);return}const P=A.deltaMode===1?20:1,U=a===wo.Vertical?0:A.deltaX*P,z=a===wo.Horizontal?0:A.deltaY*P;V.translateBy($,-(U/T)*l,-(z/T)*l)},{passive:!1}):typeof F<"u"&&$.on("wheel.zoom",function(A,T){if(!h||bo(A,S))return null;A.preventDefault(),F.call(this,A,T)},{passive:!1}))},[O,s,a,$,V,F,M,i,h,S]),R.useEffect(()=>{V&&V.on("start",A=>{var P;if(!A.sourceEvent)return null;D.current=A.sourceEvent.button;const{onViewportChangeStart:T}=N.getState();if(C.current=!0,((P=A.sourceEvent)==null?void 0:P.type)==="mousedown"&&N.setState({paneDragging:!0}),t||T){const U=Nd(A.transform);I.current=U,T==null||T(U),t==null||t(A.sourceEvent,U)}})},[V,t]),R.useEffect(()=>{V&&(O&&!C.current?V.on("zoom",null):O||V.on("zoom",A=>{const{onViewportChange:T}=N.getState();if(N.setState({transform:[A.transform.x,A.transform.y,A.transform.k]}),L.current=!!(r&&jv(d,D.current??0)),e||T){const P=Nd(A.transform);T==null||T(P),e==null||e(A.sourceEvent,P)}}))},[O,V,e,d,r]),R.useEffect(()=>{V&&V.on("end",A=>{if(!A.sourceEvent)return null;const{onViewportChangeEnd:T}=N.getState();if(C.current=!1,N.setState({paneDragging:!1}),r&&jv(d,D.current??0)&&!L.current&&r(A.sourceEvent),L.current=!1,(n||T)&&ox(I.current,A.transform)){const P=Nd(A.transform);I.current=P,clearTimeout(w.current),w.current=setTimeout(()=>{T==null||T(P),n==null||n(A.sourceEvent,P)},s?150:0)}})},[V,s,d,n,r]),R.useEffect(()=>{V&&V.filter(A=>{const T=M||o,P=i&&A.ctrlKey;if(A.button===1&&A.type==="mousedown"&&(bo(A,"react-flow__node")||bo(A,"react-flow__edge")))return!0;if(!d&&!T&&!s&&!u&&!i||O||!u&&A.type==="dblclick"||bo(A,S)&&A.type==="wheel"||bo(A,_)&&A.type!=="wheel"||!i&&A.ctrlKey&&A.type==="wheel"||!T&&!s&&!P&&A.type==="wheel"||!d&&(A.type==="mousedown"||A.type==="touchstart")||Array.isArray(d)&&!d.includes(A.button)&&(A.type==="mousedown"||A.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(A.button)||!A.button||A.button<=1;return(!A.ctrlKey||A.type==="wheel")&&U})},[O,V,o,i,s,u,d,c,M]),y("div",{className:"react-flow__renderer",ref:B,style:Rd,children:g})},lx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ax(){const{userSelectionActive:e,userSelectionRect:t}=ce(lx,Ge);return e&&t?y("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Gv(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Yv(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(l=>l.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const l of i)if(l)switch(l.type){case"select":{s.selected=l.selected;break}case"position":{typeof l.position<"u"&&(s.position=l.position),typeof l.positionAbsolute<"u"&&(s.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(s.dragging=l.dragging),s.expandParent&&Gv(r,s);break}case"dimensions":{typeof l.dimensions<"u"&&(s.width=l.dimensions.width,s.height=l.dimensions.height),typeof l.updateStyle<"u"&&(s.style={...s.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(s.resizing=l.resizing),s.expandParent&&Gv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Wv(e,t){return Yv(e,t)}function ux(e,t){return Yv(e,t)}const Qn=(e,t)=>({id:e,type:"select",selected:t});function Io(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Qn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Qn(r.id,!1))),n},[])}const Od=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},cx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),Kv=R.memo(({isSelecting:e,selectionMode:t=ji.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:a,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=R.useRef(null),p=Ce(),m=R.useRef(0),v=R.useRef(0),E=R.useRef(),{userSelectionActive:h,elementsSelectable:g,dragging:S}=ce(cx,Ge),_=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,v.current=0},w=F=>{i==null||i(F),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},N=F=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){F.preventDefault();return}s==null||s(F)},C=l?F=>l(F):void 0,L=F=>{const{resetSelectedElements:O,domNode:M}=p.getState();if(E.current=M==null?void 0:M.getBoundingClientRect(),!g||!e||F.button!==0||F.target!==f.current||!E.current)return;const{x:D,y:A}=Yn(F,E.current);O(),p.setState({userSelectionRect:{width:0,height:0,startX:D,startY:A,x:D,y:A}}),r==null||r(F)},B=F=>{const{userSelectionRect:O,nodeInternals:M,edges:D,transform:A,onNodesChange:T,onEdgesChange:P,nodeOrigin:U,getNodes:z}=p.getState();if(!e||!E.current||!O)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});const j=Yn(F,E.current),K=O.startX??0,W=O.startY??0,J={...O,x:j.x<K?j.x:K,y:j.y<W?j.y:W,width:Math.abs(j.x-K),height:Math.abs(j.y-W)},X=z(),te=cv(M,J,A,t===ji.Partial,!0,U),ie=dv(te,D).map(de=>de.id),ve=te.map(de=>de.id);if(m.current!==ve.length){m.current=ve.length;const de=Io(X,ve);de.length&&(T==null||T(de))}if(v.current!==ie.length){v.current=ie.length;const de=Io(D,ie);de.length&&(P==null||P(de))}p.setState({userSelectionRect:J})},I=F=>{if(F.button!==0)return;const{userSelectionRect:O}=p.getState();!h&&O&&F.target===f.current&&(w==null||w(F)),p.setState({nodesSelectionActive:m.current>0}),_(),o==null||o(F)},V=F=>{h&&(p.setState({nodesSelectionActive:m.current>0}),o==null||o(F)),_()},$=g&&(e||h);return k("div",{className:et(["react-flow__pane",{dragging:S,selection:e}]),onClick:$?void 0:Od(w,f),onContextMenu:Od(N,f),onWheel:Od(C,f),onMouseEnter:$?void 0:a,onMouseDown:$?L:void 0,onMouseMove:$?B:u,onMouseUp:$?I:void 0,onMouseLeave:$?V:c,ref:f,style:Rd,children:[d,y(ax,{})]})});Kv.displayName="Pane";const dx=e=>{const t=e.getNodes().filter(n=>n.selected);return{...uv(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function fx({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ce(),{width:o,height:i,x:s,y:l,transformString:a,userSelectionActive:u}=ce(dx,Ge),c=Fv(),d=R.useRef(null);if(R.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),Uv({nodeRef:d}),u||!o||!i)return null;const f=e?m=>{const v=r.getState().getNodes().filter(E=>E.selected);e(m,v)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(To,m.key)&&c({x:To[m.key].x,y:To[m.key].y,isShiftPressed:m.shiftKey})};return y("div",{className:et(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:y("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:o,height:i,top:l,left:s}})})}var px=R.memo(fx);const hx=e=>e.nodesSelectionActive,Qv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:l,onMove:a,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:p,onSelectionStart:m,onSelectionEnd:v,multiSelectionKeyCode:E,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:I,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,preventScrolling:M,onSelectionContextMenu:D,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:P})=>{const U=ce(hx),z=Qi(d),K=Qi(h)||I,W=z||f&&K!==!0;return nx({deleteKeyCode:l,multiSelectionKeyCode:E}),y(sx,{onMove:a,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:N,panOnScrollSpeed:C,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:!z&&K,defaultViewport:V,translateExtent:$,minZoom:F,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:M,noWheelClassName:A,noPanClassName:T,children:k(Kv,{onSelectionStart:m,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:K,isSelecting:!!W,selectionMode:p,children:[e,U&&y(px,{onSelectionContextMenu:D,noPanClassName:T,disableKeyboardA11y:P})]})})};Qv.displayName="FlowRenderer";var gx=R.memo(Qv);function mx(e){return ce(R.useCallback(n=>e?cv(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const vx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Xv=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=ce(vx,Ge),l=mx(e.onlyRenderVisibleElements),a=R.useRef(),u=R.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(p=>({id:p.target.getAttribute("data-id"),nodeElement:p.target,forceUpdate:!0}));i(f)});return a.current=c,c},[]);return R.useEffect(()=>()=>{var c;(c=a==null?void 0:a.current)==null||c.disconnect()},[]),y("div",{className:"react-flow__nodes",style:Rd,children:l.map(c=>{var w,N;let d=c.type||"default";e.nodeTypes[d]||(s==null||s("003",Gn.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,p=!!(c.draggable||t&&typeof c.draggable>"u"),m=!!(c.selectable||o&&typeof c.selectable>"u"),v=!!(c.connectable||n&&typeof c.connectable>"u"),E=!!(c.focusable||r&&typeof c.focusable>"u"),h=e.nodeExtent?ld(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,g=(h==null?void 0:h.x)??0,S=(h==null?void 0:h.y)??0,_=QO({x:g,y:S,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return y(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||Y.Bottom,targetPosition:c.targetPosition||Y.Top,hidden:c.hidden,xPos:g,yPos:S,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:p,isSelectable:m,isConnectable:v,isFocusable:E,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((w=c[Oe])==null?void 0:w.z)??0,isParent:!!((N=c[Oe])!=null&&N.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};Xv.displayName="NodeRenderer";var yx=R.memo(Xv);const Ex=[{level:0,isMaxLevel:!0,edges:[]}];function Sx(e,t,n=!1){let r=-1;const o=e.reduce((s,l)=>{var c,d,f,p;const a=Rt(l.zIndex);let u=a?l.zIndex:0;return n&&(u=a?l.zIndex:Math.max(((d=(c=t.get(l.source))==null?void 0:c[Oe])==null?void 0:d.z)||0,((p=(f=t.get(l.target))==null?void 0:f[Oe])==null?void 0:p.z)||0)),s[u]?s[u].push(l):s[u]=[l],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,l])=>{const a=+s;return{edges:l,level:a,isMaxLevel:a===r}});return i.length===0?Ex:i}function _x(e,t,n){const r=ce(R.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),l=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&GO({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:l.width,targetHeight:l.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return Sx(r,t,n)}const wx=({color:e="none",strokeWidth:t=1})=>y("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),Rx=({color:e="none",strokeWidth:t=1})=>y("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),qv={[Gi.Arrow]:wx,[Gi.ArrowClosed]:Rx};function Nx(e){const t=Ce();return R.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(qv,e)?qv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Gn.error009(e)),null)},[e])}const Ox=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=Nx(t);return a?y("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:y(a,{color:n,strokeWidth:s})}):null},xx=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const l=hd(s,t);r.includes(l)||(o.push({id:l,color:s.color||e,...s}),r.push(l))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Zv=({defaultColor:e,rfId:t})=>{const n=ce(R.useCallback(xx({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return y("defs",{children:n.map(r=>y(Ox,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};Zv.displayName="MarkerDefinitions";var Tx=R.memo(Zv);const Cx=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Jv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:p,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,children:E})=>{const{edgesFocusable:h,edgesUpdatable:g,elementsSelectable:S,width:_,height:w,connectionMode:N,nodeInternals:C,onError:L}=ce(Cx,Ge),B=_x(t,C,n);return _?k(Ee,{children:[B.map(({level:I,edges:V,isMaxLevel:$})=>k("svg",{style:{zIndex:I},width:_,height:w,className:"react-flow__edges react-flow__container",children:[$&&y(Tx,{defaultColor:e,rfId:r}),y("g",{children:V.map(F=>{const[O,M,D]=Lv(C.get(F.source)),[A,T,P]=Lv(C.get(F.target));if(!D||!P)return null;let U=F.type||"default";o[U]||(L==null||L("011",Gn.error011(U)),U="default");const z=o[U]||o.default,j=N===Wn.Strict?T.target:(T.target??[]).concat(T.source??[]),K=Av(M.source,F.sourceHandle),W=Av(j,F.targetHandle),J=(K==null?void 0:K.position)||Y.Bottom,X=(W==null?void 0:W.position)||Y.Top,te=!!(F.focusable||h&&typeof F.focusable>"u"),ie=typeof s<"u"&&(F.updatable||g&&typeof F.updatable>"u");if(!K||!W)return L==null||L("008",Gn.error008(K,F)),null;const{sourceX:ve,sourceY:de,targetX:be,targetY:Ke}=jO(O,K,J,A,W,X);return y(z,{id:F.id,className:et([F.className,i]),type:U,data:F.data,selected:!!F.selected,animated:!!F.animated,hidden:!!F.hidden,label:F.label,labelStyle:F.labelStyle,labelShowBg:F.labelShowBg,labelBgStyle:F.labelBgStyle,labelBgPadding:F.labelBgPadding,labelBgBorderRadius:F.labelBgBorderRadius,style:F.style,source:F.source,target:F.target,sourceHandleId:F.sourceHandle,targetHandleId:F.targetHandle,markerEnd:F.markerEnd,markerStart:F.markerStart,sourceX:ve,sourceY:de,targetX:be,targetY:Ke,sourcePosition:J,targetPosition:X,elementsSelectable:S,onEdgeUpdate:s,onContextMenu:l,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:p,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,rfId:r,ariaLabel:F.ariaLabel,isFocusable:te,isUpdatable:ie,pathOptions:"pathOptions"in F?F.pathOptions:void 0,interactionWidth:F.interactionWidth},F.id)})})]},I)),E]}):null};Jv.displayName="EdgeRenderer";var bx=R.memo(Jv);const Ix=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ax({children:e}){const t=ce(Ix);return y("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function Lx(e){const t=wd(),n=R.useRef(!1);R.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Dx={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top},ey=({nodeId:e,handleType:t,style:n,type:r=Kn.Bezier,CustomComponent:o,connectionStatus:i})=>{var N,C,L;const{fromNode:s,handleId:l,toX:a,toY:u,connectionMode:c}=ce(R.useCallback(B=>({fromNode:B.nodeInternals.get(e),handleId:B.connectionHandleId,toX:(B.connectionPosition.x-B.transform[0])/B.transform[2],toY:(B.connectionPosition.y-B.transform[1])/B.transform[2],connectionMode:B.connectionMode}),[e]),Ge),d=(N=s==null?void 0:s[Oe])==null?void 0:N.handleBounds;let f=d==null?void 0:d[t];if(c===Wn.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!s||!f)return null;const p=l?f.find(B=>B.id===l):f[0],m=p?p.x+p.width/2:(s.width??0)/2,v=p?p.y+p.height/2:s.height??0,E=(((C=s.positionAbsolute)==null?void 0:C.x)??0)+m,h=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+v,g=p==null?void 0:p.position,S=g?Dx[g]:null;if(!g||!S)return null;if(o)return y(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:p,fromX:E,fromY:h,toX:a,toY:u,fromPosition:g,toPosition:S,connectionStatus:i});let _="";const w={sourceX:E,sourceY:h,sourcePosition:g,targetX:a,targetY:u,targetPosition:S};return r===Kn.Bezier?[_]=iv(w):r===Kn.Step?[_]=Yi({...w,borderRadius:0}):r===Kn.SmoothStep?[_]=Yi(w):r===Kn.SimpleBezier?[_]=tv(w):_=`M${E},${h} ${a},${u}`,y("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};ey.displayName="ConnectionLine";const kx=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Px({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:l,height:a,connectionStatus:u}=ce(kx,Ge);return!(o&&i&&l&&s)?null:y("svg",{style:e,width:l,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container",children:y("g",{className:et(["react-flow__connection",u]),children:y(ey,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const ty=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:E,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:S,connectionLineContainerStyle:_,selectionKeyCode:w,selectionOnDrag:N,selectionMode:C,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,deleteKeyCode:V,onlyRenderVisibleElements:$,elementsSelectable:F,selectNodesOnDrag:O,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,preventScrolling:P,defaultMarkerColor:U,zoomOnScroll:z,zoomOnPinch:j,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:J,zoomOnDoubleClick:X,panOnDrag:te,onPaneClick:ie,onPaneMouseEnter:ve,onPaneMouseMove:de,onPaneMouseLeave:be,onPaneScroll:Ke,onPaneContextMenu:gt,onEdgeUpdate:ye,onEdgeContextMenu:pe,onEdgeMouseEnter:nt,onEdgeMouseMove:Q,onEdgeMouseLeave:nr,edgeUpdaterRadius:br,onEdgeUpdateStart:fs,onEdgeUpdateEnd:ps,noDragClassName:Fo,noWheelClassName:Ir,noPanClassName:rr,elevateEdgesOnSelect:Vo,disableKeyboardA11y:or,nodeOrigin:Ar,nodeExtent:hs,rfId:Bo})=>(Lx(i),y(gx,{onPaneClick:ie,onPaneMouseEnter:ve,onPaneMouseMove:de,onPaneMouseLeave:be,onPaneContextMenu:gt,onPaneScroll:Ke,deleteKeyCode:V,selectionKeyCode:w,selectionOnDrag:N,selectionMode:C,onSelectionStart:v,onSelectionEnd:E,multiSelectionKeyCode:L,panActivationKeyCode:B,zoomActivationKeyCode:I,elementsSelectable:F,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:z,zoomOnPinch:j,zoomOnDoubleClick:X,panOnScroll:K,panOnScrollSpeed:W,panOnScrollMode:J,panOnDrag:te,defaultViewport:M,translateExtent:D,minZoom:A,maxZoom:T,onSelectionContextMenu:m,preventScrolling:P,noDragClassName:Fo,noWheelClassName:Ir,noPanClassName:rr,disableKeyboardA11y:or,children:k(Ax,{children:[y(bx,{edgeTypes:t,onEdgeClick:l,onEdgeDoubleClick:u,onEdgeUpdate:ye,onlyRenderVisibleElements:$,onEdgeContextMenu:pe,onEdgeMouseEnter:nt,onEdgeMouseMove:Q,onEdgeMouseLeave:nr,onEdgeUpdateStart:fs,onEdgeUpdateEnd:ps,edgeUpdaterRadius:br,defaultMarkerColor:U,noPanClassName:rr,elevateEdgesOnSelect:!!Vo,disableKeyboardA11y:or,rfId:Bo,children:y(Px,{style:g,type:h,component:S,containerStyle:_})}),y("div",{className:"react-flow__edgelabel-renderer"}),y(yx,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:p,selectNodesOnDrag:O,onlyRenderVisibleElements:$,noPanClassName:rr,noDragClassName:Fo,disableKeyboardA11y:or,nodeOrigin:Ar,nodeExtent:hs,rfId:Bo})]})}));ty.displayName="GraphView";var Mx=R.memo(ty);const xd=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:xd,nodeExtent:xd,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Wn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:dO,isValidConnection:void 0},Ux=()=>Yg((e,t)=>({...Xn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:_d(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?_d(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:l,domNode:a,nodeOrigin:u}=t(),c=a==null?void 0:a.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((v,E)=>{const h=o.get(E.id);if(h){const g=sd(E.nodeElement);!!(g.width&&g.height&&(h.width!==g.width||h.height!==g.height||E.forceUpdate))&&(o.set(h.id,{...h,[Oe]:{...h[Oe],handleBounds:{source:Mv(".source",E.nodeElement,f,u),target:Mv(".target",E.nodeElement,f,u)}},...g}),v.push({id:h.id,type:"dimensions",dimensions:g}))}return v},[]);zv(o,u);const m=s||i&&!s&&Hv(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:m}),(p==null?void 0:p.length)>0&&(r==null||r(p))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(l=>{const a={id:l.id,type:"position",dragging:o};return r&&(a.positionAbsolute=l.positionAbsolute,a.position=l.position),a});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:l,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(i){const u=Wv(n,l()),c=_d(u,o,s,a);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Qn(a,!0)):(s=Io(i(),n),l=Io(o,[])),sa({changedNodes:s,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,l=null;r?s=n.map(a=>Qn(a,!0)):(s=Io(o,n),l=Io(i(),[])),sa({changedNodes:l,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),l=r||o,a=s.map(c=>(c.selected=!1,Qn(c.id,!1))),u=l.map(c=>Qn(c.id,!1));sa({changedNodes:a,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(l=>l.selected).map(l=>Qn(l.id,!1)),s=n.filter(l=>l.selected).map(l=>Qn(l.id,!1));sa({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=ld(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:l,translateExtent:a}=t();if(!s||!l||!n.x&&!n.y)return;const u=jn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],d=s==null?void 0:s.constrain()(u,c,a);s.transform(l,d)},cancelConnection:()=>e({connectionNodeId:Xn.connectionNodeId,connectionHandleId:Xn.connectionHandleId,connectionHandleType:Xn.connectionHandleType,connectionStatus:Xn.connectionStatus,connectionStartHandle:Xn.connectionStartHandle,connectionEndHandle:Xn.connectionEndHandle}),reset:()=>e({...Xn})})),ny=({children:e})=>{const t=R.useRef(null);return t.current||(t.current=Ux()),y(rO,{value:t.current,children:e})};ny.displayName="ReactFlowProvider";const ry=({children:e})=>R.useContext(ta)?y(Ee,{children:e}):y(ny,{children:e});ry.displayName="ReactFlowWrapper";function oy(e,t){return R.useRef(null),R.useMemo(()=>t(e),[e])}const Fx={input:_v,default:md,output:Rv,group:vd},Vx={default:oa,straight:fd,step:dd,smoothstep:na,simplebezier:cd},Bx=[0,0],$x=[15,15],zx={x:0,y:0,zoom:1},Hx={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},iy=R.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Fx,edgeTypes:s=Vx,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:E,onClickConnectEnd:h,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:N,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onNodesDelete:I,onEdgesDelete:V,onSelectionChange:$,onSelectionDragStart:F,onSelectionDrag:O,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,connectionMode:P=Wn.Strict,connectionLineType:U=Kn.Bezier,connectionLineStyle:z,connectionLineComponent:j,connectionLineContainerStyle:K,deleteKeyCode:W="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:X=!1,selectionMode:te=ji.Full,panActivationKeyCode:ie="Space",multiSelectionKeyCode:ve="Meta",zoomActivationKeyCode:de="Meta",snapToGrid:be=!1,snapGrid:Ke=$x,onlyRenderVisibleElements:gt=!1,selectNodesOnDrag:ye=!0,nodesDraggable:pe,nodesConnectable:nt,nodesFocusable:Q,nodeOrigin:nr=Bx,edgesFocusable:br,edgesUpdatable:fs,elementsSelectable:ps,defaultViewport:Fo=zx,minZoom:Ir=.5,maxZoom:rr=2,translateExtent:Vo=xd,preventScrolling:or=!0,nodeExtent:Ar,defaultMarkerColor:hs="#b1b1b7",zoomOnScroll:Bo=!0,zoomOnPinch:rt=!0,panOnScroll:zt=!1,panOnScrollSpeed:Lr=.5,panOnScrollMode:Dr=wo.Free,zoomOnDoubleClick:kr=!0,panOnDrag:Ra=!0,onPaneClick:Pr,onPaneMouseEnter:cf,onPaneMouseMove:df,onPaneMouseLeave:gs,onPaneScroll:ff,onPaneContextMenu:nE,children:Mr,onEdgeUpdate:lL,onEdgeContextMenu:aL,onEdgeDoubleClick:uL,onEdgeMouseEnter:cL,onEdgeMouseMove:dL,onEdgeMouseLeave:fL,onEdgeUpdateStart:pL,onEdgeUpdateEnd:hL,edgeUpdaterRadius:gL=10,onNodesChange:mL,onEdgesChange:vL,noDragClassName:yL="nodrag",noWheelClassName:EL="nowheel",noPanClassName:rE="nopan",fitView:SL=!1,fitViewOptions:_L,connectOnClick:wL=!0,attributionPosition:RL,proOptions:NL,defaultEdgeOptions:OL,elevateNodesOnSelect:xL=!0,elevateEdgesOnSelect:TL=!1,disableKeyboardA11y:oE=!1,autoPanOnConnect:CL=!0,autoPanOnNodeDrag:bL=!0,connectionRadius:IL=20,isValidConnection:AL,onError:LL,style:DL,id:iE,...kL},PL)=>{const ML=oy(i,KO),UL=oy(s,HO),pf=iE||"1";return y("div",{...kL,style:{...DL,...Hx},ref:PL,className:et(["react-flow",o]),"data-testid":"rf__wrapper",id:iE,children:k(ry,{children:[y(Mx,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:w,onNodeDoubleClick:N,nodeTypes:ML,edgeTypes:UL,connectionLineType:U,connectionLineStyle:z,connectionLineComponent:j,connectionLineContainerStyle:K,selectionKeyCode:J,selectionOnDrag:X,selectionMode:te,deleteKeyCode:W,multiSelectionKeyCode:ve,panActivationKeyCode:ie,zoomActivationKeyCode:de,onlyRenderVisibleElements:gt,selectNodesOnDrag:ye,defaultViewport:Fo,translateExtent:Vo,minZoom:Ir,maxZoom:rr,preventScrolling:or,zoomOnScroll:Bo,zoomOnPinch:rt,zoomOnDoubleClick:kr,panOnScroll:zt,panOnScrollSpeed:Lr,panOnScrollMode:Dr,panOnDrag:Ra,onPaneClick:Pr,onPaneMouseEnter:cf,onPaneMouseMove:df,onPaneMouseLeave:gs,onPaneScroll:ff,onPaneContextMenu:nE,onSelectionContextMenu:D,onSelectionStart:A,onSelectionEnd:T,onEdgeUpdate:lL,onEdgeContextMenu:aL,onEdgeDoubleClick:uL,onEdgeMouseEnter:cL,onEdgeMouseMove:dL,onEdgeMouseLeave:fL,onEdgeUpdateStart:pL,onEdgeUpdateEnd:hL,edgeUpdaterRadius:gL,defaultMarkerColor:hs,noDragClassName:yL,noWheelClassName:EL,noPanClassName:rE,elevateEdgesOnSelect:TL,rfId:pf,disableKeyboardA11y:oE,nodeOrigin:nr,nodeExtent:Ar}),y(kO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:E,onClickConnectEnd:h,nodesDraggable:pe,nodesConnectable:nt,nodesFocusable:Q,edgesFocusable:br,edgesUpdatable:fs,elementsSelectable:ps,elevateNodesOnSelect:xL,minZoom:Ir,maxZoom:rr,nodeExtent:Ar,onNodesChange:mL,onEdgesChange:vL,snapToGrid:be,snapGrid:Ke,connectionMode:P,translateExtent:Vo,connectOnClick:wL,defaultEdgeOptions:OL,fitView:SL,fitViewOptions:_L,onNodesDelete:I,onEdgesDelete:V,onNodeDragStart:C,onNodeDrag:L,onNodeDragStop:B,onSelectionDrag:O,onSelectionDragStart:F,onSelectionDragStop:M,noPanClassName:rE,nodeOrigin:nr,rfId:pf,autoPanOnConnect:CL,autoPanOnNodeDrag:bL,onError:LL,connectionRadius:IL,isValidConnection:AL}),y(LO,{onSelectionChange:$}),Mr,y(iO,{proOptions:NL,position:RL}),y(VO,{rfId:pf,disableKeyboardA11y:oE})]})})});iy.displayName="ReactFlow";function jx(){const e=Ce();return R.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${t}"]`);o&&requestAnimationFrame(()=>r([{id:t,nodeElement:o,forceUpdate:!0}]))},[])}const Gx=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[Oe])==null?void 0:r.handleBounds)!==void 0}),Yx={includeHiddenNodes:!1};function Wx(e=Yx){return ce(Gx(e))}function Kx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Qx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y("path",{d:"M0 0h32v4.2H0z"})})}function Xx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y("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 qx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y("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 Zx(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y("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"})})}const Ao=({children:e,className:t,...n})=>y("button",{type:"button",className:et(["react-flow__controls-button",t]),...n,children:e});Ao.displayName="ControlButton";const Jx=e=>e.nodesDraggable&&e.nodesConnectable&&e.elementsSelectable,sy=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left"})=>{const f=Ce(),[p,m]=R.useState(!1),v=ce(Jx),{zoomIn:E,zoomOut:h,fitView:g}=wd();if(R.useEffect(()=>{m(!0)},[]),!p)return null;const S=()=>{E(),i==null||i()},_=()=>{h(),s==null||s()},w=()=>{g(o),l==null||l()},N=()=>{f.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)};return k(id,{className:et(["react-flow__controls",u]),position:d,style:e,"data-testid":"rf__controls",children:[t&&k(Ee,{children:[y(Ao,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",children:y(Kx,{})}),y(Ao,{onClick:_,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",children:y(Qx,{})})]}),n&&y(Ao,{className:"react-flow__controls-fitview",onClick:w,title:"fit view","aria-label":"fit view",children:y(Xx,{})}),r&&y(Ao,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?y(Zx,{}):y(qx,{})}),c]})};sy.displayName="Controls";var eT=R.memo(sy);const tT=!1,nT="0.0.3",rT="0.0.0",ly="sw/nodeType",ay=640,uy={type:"floating",markerEnd:{type:Gi.Arrow,width:20,height:20,color:"#c2c8d1"},style:{stroke:"#c2c8d1",strokeWidth:1.5}},oT="422",iT="404";let sT=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const _e=()=>sT(),lT=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},aT=(e,t)=>{var i;const n=new Blob([JSON.stringify({nodes:e,edges:t},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(i=o==null?void 0:o.location)!=null&&i.href&&(o.location.href=r)},uT=e=>e.map(t=>typeof t=="string"?t.trim():t).filter(Boolean).join(),cy=e=>e.split(",").map(t=>t.trim()).filter(Boolean),cT=e=>({...e,...uy}),dT=e=>e.type==="handleCall"?{...e,deletable:!1}:e,dy=e=>e==="success"?"positive":"negative",fT=e=>e.toLowerCase().replace(/ /g,"-"),Nt=e=>typeof e=="string"?e.trim():e,Td=()=>[{result:"success",id:_e()},{result:"noAnswer",id:_e()},{result:"busy",id:_e()},{result:"decline",id:_e()},{result:"error",id:_e()}],fy={answer:()=>({}),cond:()=>({options:[{id:_e(),value:""}],fallback:_e()}),condRequest:()=>({body:"",error:_e(),fallback:_e(),headers:"",method:"POST",options:[{id:_e(),value:""}],url:""}),forwardAddress:()=>({destinations:[],destinationType:"address",options:Td(),sessionTimeout:"",type:"single"}),forwardPhone:()=>({destinations:[],destinationType:"phone",options:Td(),sessionTimeout:"",type:"single"}),forwardResource:()=>({destinations:[],destinationType:"resource",options:Td(),sessionTimeout:"",type:"single"}),hangup:()=>({}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({initialTimeout:"",options:[{command:"",digit:"",id:_e()}],results:[{id:_e(),result:"no_match"},{id:_e(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,format:"wav",stereo:!1,terminators:""}),recordCallStart:()=>({beep:!1,controlId:_e(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),request:()=>({url:"",method:"POST",headers:"",body:"",options:[{id:_e(),result:"success"},{id:_e(),result:"failed"}]}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[{duplicate:!1,id:_e(),key:"",value:""}]}),unset:()=>({variables:[]})};function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pT(e,t){if(Ft(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ft(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function py(e){var t=pT(e,"string");return Ft(t)==="symbol"?t:String(t)}function hy(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,py(r.key),r)}}function xt(e,t,n){return t&&hy(e.prototype,t),n&&hy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function qn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Cd(e,t){return Cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Cd(e,t)}function la(e,t){if(typeof t!="function"&&t!==null)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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cd(e,t)}function Xi(e,t){if(t&&(Ft(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qn(e)}function qt(e){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qt(e)}function yn(e,t,n){return t=py(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hT(e){if(Array.isArray(e))return e}function gT(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mT(e,t){if(e){if(typeof e=="string")return gy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gy(e,t)}}function vT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yT(e){return hT(e)||gT(e)||mT(e)||vT()}function my(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function vy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?my(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):my(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var ET={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},ST=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ot(this,e),this.init(t,n)}return xt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||ET,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,o,i){return i&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(o).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new e(this.logger,vy(vy({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new e(this.logger,n)}}]),e}(),Zt=new ST,Zn=function(){function e(){Ot(this,e),this.observers={}}return xt(e,[{key:"on",value:function(n,r){var o=this;return n.split(" ").forEach(function(i){o.observers[i]=o.observers[i]||[],o.observers[i].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(o){return o!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(a){a.apply(void 0,o)})}if(this.observers["*"]){var l=[].concat(this.observers["*"]);l.forEach(function(a){a.apply(a,[n].concat(o))})}}}]),e}();function qi(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function yy(e){return e==null?"":""+e}function _T(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function bd(e,t,n){function r(l){return l&&l.indexOf("###")>-1?l.replace(/###/g,"."):l}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var s=r(i.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function Ey(e,t,n){var r=bd(e,t,Object),o=r.obj,i=r.k;o[i]=n}function wT(e,t,n,r){var o=bd(e,t,Object),i=o.obj,s=o.k;i[s]=i[s]||[],r&&(i[s]=i[s].concat(n)),r||i[s].push(n)}function aa(e,t){var n=bd(e,t),r=n.obj,o=n.k;if(r)return r[o]}function Sy(e,t,n){var r=aa(e,n);return r!==void 0?r:aa(t,n)}function _y(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):_y(e[r],t[r],n):e[r]=t[r]);return e}function Lo(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var RT={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function NT(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return RT[t]}):e}var ua=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,OT=[" ",",","?","!",";"];function xT(e,t,n){t=t||"",n=n||"";var r=OT.filter(function(l){return t.indexOf(l)<0&&n.indexOf(l)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(l){return l==="?"?"\\?":l}).join("|"),")")),i=!o.test(e);if(!i){var s=e.indexOf(n);s>0&&!o.test(e.substring(0,s))&&(i=!0)}return i}function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ca(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wy(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TT(e){var t=CT();return function(){var r=qt(e),o;if(t){var i=qt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Xi(this,o)}}function CT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ry(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o||typeof o[r[i]]=="string"&&i+1<r.length)return;if(o[r[i]]===void 0){for(var s=2,l=r.slice(i,i+s).join(n),a=o[l];a===void 0&&r.length>i+s;)s++,l=r.slice(i,i+s).join(n),a=o[l];if(a===void 0)return;if(a===null)return null;if(t.endsWith(l)){if(typeof a=="string")return a;if(l&&typeof a[l]=="string")return a[l]}var u=r.slice(i+s).join(n);return u?Ry(a,u,n):void 0}o=o[r[i]]}return o}}var bT=function(e){la(n,e);var t=TT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ot(this,n),o=t.call(this),ua&&Zn.call(qn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return xt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];s&&typeof s!="string"&&(c=c.concat(s)),s&&typeof s=="string"&&(c=c.concat(a?s.split(a):s)),o.indexOf(".")>-1&&(c=o.split("."));var d=aa(this.data,c);return d||!u||typeof s!="string"?d:Ry(this.data&&this.data[o]&&this.data[o][i],s,a)}},{key:"addResource",value:function(o,i,s,l){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];s&&(c=c.concat(u?s.split(u):s)),o.indexOf(".")>-1&&(c=o.split("."),l=i,i=c[1]),this.addNamespaces(i),Ey(this.data,c,l),a.silent||this.emit("added",o,i,s,l)}},{key:"addResources",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var a in s)(typeof s[a]=="string"||Object.prototype.toString.apply(s[a])==="[object Array]")&&this.addResource(o,i,a,s[a],{silent:!0});l.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),l=s,s=i,i=c[1]),this.addNamespaces(i);var d=aa(this.data,c)||{};l?_y(d,s,a):d=ca(ca({},d),s),Ey(this.data,c,d),u.silent||this.emit("added",o,i,s)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ca(ca({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),s=i&&Object.keys(i)||[];return!!s.find(function(l){return i[l]&&Object.keys(i[l]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Zn),Ny={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(l){s.processors[l]&&(n=s.processors[l].process(n,r,o,i))}),n}};function Oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IT(e){var t=AT();return function(){var r=qt(e),o;if(t){var i=qt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Xi(this,o)}}function AT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xy={},Ty=function(e){la(n,e);var t=IT(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ot(this,n),o=t.call(this),ua&&Zn.call(qn(o)),_T(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,qn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=Zt.create("translator"),o}return xt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var s=this.resolve(o,i);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(o,i){var s=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var l=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ns||this.options.defaultNS||[],u=s&&o.indexOf(s)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!xT(o,s,l);if(u&&!c){var d=o.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:o,namespaces:a};var f=o.split(s);(s!==l||s===l&&this.options.ns.indexOf(f[0])>-1)&&(a=f.shift()),o=f.join(l)}return typeof a=="string"&&(a=[a]),{key:o,namespaces:a}}},{key:"translate",value:function(o,i,s){var l=this;if(Ft(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var a=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),d=c.key,f=c.namespaces,p=f[f.length-1],m=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&m.toLowerCase()==="cimode"){if(v){var E=i.nsSeparator||this.options.nsSeparator;return a?{res:"".concat(p).concat(E).concat(d),usedKey:d,exactUsedKey:d,usedLng:m,usedNS:p}:"".concat(p).concat(E).concat(d)}return a?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:p}:d}var h=this.resolve(o,i),g=h&&h.res,S=h&&h.usedKey||d,_=h&&h.exactUsedKey||d,w=Object.prototype.toString.apply(g),N=["[object Number]","[object Function]","[object RegExp]"],C=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,B=typeof g!="string"&&typeof g!="boolean"&&typeof g!="number";if(L&&g&&B&&N.indexOf(w)<0&&!(typeof C=="string"&&w==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,g,Ye(Ye({},i),{},{ns:f})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return a?(h.res=I,h):I}if(u){var V=w==="[object Array]",$=V?[]:{},F=V?_:S;for(var O in g)if(Object.prototype.hasOwnProperty.call(g,O)){var M="".concat(F).concat(u).concat(O);$[O]=this.translate(M,Ye(Ye({},i),{joinArrays:!1,ns:f})),$[O]===M&&($[O]=g[O])}g=$}}else if(L&&typeof C=="string"&&w==="[object Array]")g=g.join(C),g&&(g=this.extendTranslation(g,o,i,s));else{var D=!1,A=!1,T=i.count!==void 0&&typeof i.count!="string",P=n.hasDefaultValue(i),U=T?this.pluralResolver.getSuffix(m,i.count,i):"",z=i["defaultValue".concat(U)]||i.defaultValue;!this.isValidLookup(g)&&P&&(D=!0,g=z),this.isValidLookup(g)||(A=!0,g=d);var j=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,K=j&&A?void 0:g,W=P&&z!==g&&this.options.updateMissing;if(A||D||W){if(this.logger.log(W?"updateKey":"missingKey",m,p,d,W?z:g),u){var J=this.resolve(d,Ye(Ye({},i),{},{keySeparator:!1}));J&&J.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var X=[],te=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&te&&te[0])for(var ie=0;ie<te.length;ie++)X.push(te[ie]);else this.options.saveMissingTo==="all"?X=this.languageUtils.toResolveHierarchy(i.lng||this.language):X.push(i.lng||this.language);var ve=function(be,Ke,gt){var ye=P&>!==g?gt:K;l.options.missingKeyHandler?l.options.missingKeyHandler(be,p,Ke,ye,W,i):l.backendConnector&&l.backendConnector.saveMissing&&l.backendConnector.saveMissing(be,p,Ke,ye,W,i),l.emit("missingKey",be,p,Ke,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?X.forEach(function(de){l.pluralResolver.getSuffixes(de,i).forEach(function(be){ve([de],d+be,i["defaultValue".concat(be)]||z)})}):ve(X,d,z))}g=this.extendTranslation(g,o,i,h,s),A&&g===d&&this.options.appendNamespaceToMissingKey&&(g="".concat(p,":").concat(d)),(A||D)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(p,":").concat(d):d,D?g:void 0):g=this.options.parseMissingKeyHandler(g))}return a?(h.res=g,h):g}},{key:"extendTranslation",value:function(o,i,s,l,a){var u=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,Ye(Ye({},this.options.interpolation.defaultVariables),s),l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Ye(Ye({},s),{interpolation:Ye(Ye({},this.options.interpolation),s.interpolation)}));var c=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(c){var f=o.match(this.interpolator.nestingRegexp);d=f&&f.length}var p=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(p=Ye(Ye({},this.options.interpolation.defaultVariables),p)),o=this.interpolator.interpolate(o,p,s.lng||this.language,s),c){var m=o.match(this.interpolator.nestingRegexp),v=m&&m.length;d<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var g=arguments.length,S=new Array(g),_=0;_<g;_++)S[_]=arguments[_];return a&&a[0]===S[0]&&!s.context?(u.logger.warn("It seems you are nesting recursively key: ".concat(S[0]," in key: ").concat(i[0])),null):u.translate.apply(u,S.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var E=s.postProcess||this.options.postProcess,h=typeof E=="string"?[E]:E;return o!=null&&h&&h.length&&s.applyPostProcessor!==!1&&(o=Ny.handle(h,o,i,this.options&&this.options.postProcessPassResolved?Ye({i18nResolved:l},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l,a,u,c,d;return typeof o=="string"&&(o=[o]),o.forEach(function(f){if(!i.isValidLookup(l)){var p=i.extractFromKey(f,s),m=p.key;a=m;var v=p.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var E=s.count!==void 0&&typeof s.count!="string",h=E&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),g=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",S=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(_){i.isValidLookup(l)||(d=_,!xy["".concat(S[0],"-").concat(_)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(d)&&(xy["".concat(S[0],"-").concat(_)]=!0,i.logger.warn('key "'.concat(a,'" for languages "').concat(S.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),S.forEach(function(w){if(!i.isValidLookup(l)){c=w;var N=[m];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(N,m,w,_,s);else{var C;E&&(C=i.pluralResolver.getSuffix(w,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(E&&(N.push(m+C),h&&N.push(m+L)),g){var B="".concat(m).concat(i.options.contextSeparator).concat(s.context);N.push(B),E&&(N.push(B+C),h&&N.push(B+L))}}for(var I;I=N.pop();)i.isValidLookup(l)||(u=I,l=i.getResource(w,_,I,s))}}))})}}),{res:l,usedKey:a,exactUsedKey:u,usedLng:c,usedNS:d}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,l):this.resourceStore.getResource(o,i,s,l)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&i===s.substring(0,i.length)&&o[s]!==void 0)return!0;return!1}}]),n}(Zn);function Id(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Cy=function(){function e(t){Ot(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zt.create("languageUtils")}return xt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Id(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Id(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var s=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(s))&&(o=s)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var s=r.getLanguagePartFromCode(i);if(r.isSupportedCode(s))return o=s;o=r.options.supportedLngs.find(function(l){if(l.indexOf(s)===0)return l})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],l=function(u){u&&(o.isSupportedCode(u)?s.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(n))):typeof n=="string"&&l(this.formatLanguageCode(n)),i.forEach(function(a){s.indexOf(a)<0&&l(o.formatLanguageCode(a))}),s}}]),e}(),LT=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],DT={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},kT=["v1","v2","v3"],by={zero:0,one:1,two:2,few:3,many:4,other:5};function PT(){var e={};return LT.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:DT[t.fc]}})}),e}var MT=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ot(this,e),this.languageUtils=t,this.options=n,this.logger=Zt.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=PT()}return xt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(s,l){return by[s]-by[l]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):i.numbers.map(function(s){return r.getSuffix(n,s,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var l=function(){return o.options.prepend&&s.toString()?o.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):l():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?l():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!kT.includes(this.options.compatibilityJSON)}}]),e}();function Iy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Iy(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var UT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ot(this,e),this.logger=Zt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return xt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:NT,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Lo(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Lo(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Lo(r.nestingPrefix):r.nestingPrefixEscaped||Lo("$t("),this.nestingSuffix=r.nestingSuffix?Lo(r.nestingSuffix):r.nestingSuffixEscaped||Lo(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var s=this,l,a,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(E){return E.replace(/\$/g,"$$$$")}var f=function(h){if(h.indexOf(s.formatSeparator)<0){var g=Sy(r,c,h);return s.alwaysFormat?s.format(g,void 0,o,Vt(Vt(Vt({},i),r),{},{interpolationkey:h})):g}var S=h.split(s.formatSeparator),_=S.shift().trim(),w=S.join(s.formatSeparator).trim();return s.format(Sy(r,c,_),w,o,Vt(Vt(Vt({},i),r),{},{interpolationkey:_}))};this.resetRegExp();var p=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,m=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(h){return d(h)}},{regex:this.regexp,safeValue:function(h){return s.escapeValue?d(s.escape(h)):d(h)}}];return v.forEach(function(E){for(u=0;l=E.regex.exec(n);){var h=l[1].trim();if(a=f(h),a===void 0)if(typeof p=="function"){var g=p(n,l,i);a=typeof g=="string"?g:""}else if(i&&Object.prototype.hasOwnProperty.call(i,h))a="";else if(m){a=l[0];continue}else s.logger.warn("missed to pass in variable ".concat(h," for interpolating ").concat(n)),a="";else typeof a!="string"&&!s.useRawValueToEscape&&(a=yy(a));var S=E.safeValue(a);if(n=n.replace(l[0],S),m?(E.regex.lastIndex+=a.length,E.regex.lastIndex-=l[0].length):E.regex.lastIndex=0,u++,u>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,l,a;function u(p,m){var v=this.nestingOptionsSeparator;if(p.indexOf(v)<0)return p;var E=p.split(new RegExp("".concat(v,"[ ]*{"))),h="{".concat(E[1]);p=E[0],h=this.interpolate(h,a);var g=h.match(/'/g),S=h.match(/"/g);(g&&g.length%2===0&&!S||S.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),m&&(a=Vt(Vt({},m),a))}catch(_){return this.logger.warn("failed parsing options string in nesting for key ".concat(p),_),"".concat(p).concat(v).concat(h)}return delete a.defaultValue,p}for(;s=this.nestingRegexp.exec(n);){var c=[];a=Vt({},i),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(p){return p.trim()});s[1]=f.shift(),c=f,d=!0}if(l=r(u.call(this,s[1].trim(),a),a),l&&s[0]===n&&typeof l!="string")return l;typeof l!="string"&&(l=yy(l)),l||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),l=""),d&&(l=c.reduce(function(p,m){return o.format(p,m,i.lng,Vt(Vt({},i),{},{interpolationkey:s[1].trim()}))},l.trim())),n=n.replace(s[0],l),this.regexp.lastIndex=0}return n}}]),e}();function Ay(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ay(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ay(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FT(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(s){if(s){var l=s.split(":"),a=yT(l),u=a[0],c=a.slice(1),d=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=d),d==="false"&&(n[u.trim()]=!1),d==="true"&&(n[u.trim()]=!0),isNaN(d)||(n[u.trim()]=parseInt(d,10))}})}}return{formatName:t,formatOptions:n}}function Do(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),l=t[s];return l||(l=e(o,i),t[s]=l),l(r)}}var VT=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ot(this,e),this.logger=Zt.create("formatter"),this.options=t,this.formats={number:Do(function(n,r){var o=new Intl.NumberFormat(n,En({},r));return function(i){return o.format(i)}}),currency:Do(function(n,r){var o=new Intl.NumberFormat(n,En(En({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:Do(function(n,r){var o=new Intl.DateTimeFormat(n,En({},r));return function(i){return o.format(i)}}),relativetime:Do(function(n,r){var o=new Intl.RelativeTimeFormat(n,En({},r));return function(i){return o.format(i,r.range||"day")}}),list:Do(function(n,r){var o=new Intl.ListFormat(n,En({},r));return function(i){return o.format(i)}})},this.init(t)}return xt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Do(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=r.split(this.formatSeparator),a=l.reduce(function(u,c){var d=FT(c),f=d.formatName,p=d.formatOptions;if(i.formats[f]){var m=u;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},E=v.locale||v.lng||s.locale||s.lng||o;m=i.formats[f](u,E,En(En(En({},p),s),v))}catch(h){i.logger.warn(h)}return m}else i.logger.warn("there was no format function for ".concat(f));return u},n);return a}}]),e}();function Ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ly(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BT(e){var t=$T();return function(){var r=qt(e),o;if(t){var i=qt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Xi(this,o)}}function $T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zT(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var HT=function(e){la(n,e);var t=BT(n);function n(r,o,i){var s,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ot(this,n),s=t.call(this),ua&&Zn.call(qn(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=l,s.logger=Zt.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=l.maxParallelReads||10,s.readingCalls=0,s.maxRetries=l.maxRetries>=0?l.maxRetries:5,s.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,l.backend,l),s}return xt(n,[{key:"queueLoad",value:function(o,i,s,l){var a=this,u={},c={},d={},f={};return o.forEach(function(p){var m=!0;i.forEach(function(v){var E="".concat(p,"|").concat(v);!s.reload&&a.store.hasResourceBundle(p,v)?a.state[E]=2:a.state[E]<0||(a.state[E]===1?c[E]===void 0&&(c[E]=!0):(a.state[E]=1,m=!1,c[E]===void 0&&(c[E]=!0),u[E]===void 0&&(u[E]=!0),f[v]===void 0&&(f[v]=!0)))}),m||(d[p]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(o,i,s){var l=o.split("|"),a=l[0],u=l[1];i&&this.emit("failedLoading",a,u,i),s&&this.store.addResourceBundle(a,u,s),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(d){wT(d.loaded,[a],u),zT(d,o),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(f){c[f]||(c[f]={});var p=d.loaded[f];p.length&&p.forEach(function(m){c[f][m]===void 0&&(c[f][m]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(o,i,s){var l=this,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:a,wait:u,callback:c});return}this.readingCalls++;var d=function(v,E){if(l.readingCalls--,l.waitingReads.length>0){var h=l.waitingReads.shift();l.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(v&&E&&a<l.maxRetries){setTimeout(function(){l.read.call(l,o,i,s,a+1,u*2,c)},u);return}c(v,E)},f=this.backend[s].bind(this.backend);if(f.length===2){try{var p=f(o,i);p&&typeof p.then=="function"?p.then(function(m){return d(null,m)}).catch(d):d(null,p)}catch(m){d(m)}return}return f(o,i,d)}},{key:"prepareLoading",value:function(o,i){var s=this,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,l,a);if(!u.toLoad.length)return u.pending.length||a(),null;u.toLoad.forEach(function(c){s.loadOne(c)})}},{key:"load",value:function(o,i,s){this.prepareLoading(o,i,{},s)}},{key:"reload",value:function(o,i,s){this.prepareLoading(o,i,{reload:!0},s)}},{key:"loadOne",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",l=o.split("|"),a=l[0],u=l[1];this.read(a,u,"read",void 0,void 0,function(c,d){c&&i.logger.warn("".concat(s,"loading namespace ").concat(u," for language ").concat(a," failed"),c),!c&&d&&i.logger.log("".concat(s,"loaded namespace ").concat(u," for language ").concat(a),d),i.loaded(o,c,d)})}},{key:"saveMissing",value:function(o,i,s,l,a){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=Dy(Dy({},u),{},{isUpdate:a}),f=this.backend.create.bind(this.backend);if(f.length<6)try{var p;f.length===5?p=f(o,i,s,l,d):p=f(o,i,s,l),p&&typeof p.then=="function"?p.then(function(m){return c(null,m)}).catch(c):c(null,p)}catch(m){c(m)}else f(o,i,s,l,c,d)}!o||!o[0]||this.store.addResource(o[0],i,s,l)}}}]),n}(Zn);function ky(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Ft(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Ft(t[2])==="object"||Ft(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Py(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function My(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?My(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):My(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jT(e){var t=GT();return function(){var r=qt(e),o;if(t){var i=qt(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return Xi(this,o)}}function GT(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function da(){}function YT(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var fa=function(e){la(n,e);var t=jT(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Ot(this,n),r=t.call(this),ua&&Zn.call(qn(r)),r.options=Py(o),r.services={},r.logger=Zt,r.modules={external:[]},YT(qn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),Xi(r,qn(r));setTimeout(function(){r.init(o,i)},0)}return r}return xt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(s=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var l=ky();this.options=Jt(Jt(Jt({},l),this.options),Py(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Jt(Jt({},l.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function a(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?Zt.init(a(this.modules.logger),this.options):Zt.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=VT);var c=new Cy(this.options);this.store=new bT(this.options.resources,this.options);var d=this.services;d.logger=Zt,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new MT(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===l.interpolation.format)&&(d.formatter=a(u),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new UT(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new HT(a(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(h){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[h].concat(S))}),this.modules.languageDetector&&(d.languageDetector=a(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=a(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Ty(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,S=new Array(g>1?g-1:0),_=1;_<g;_++)S[_-1]=arguments[_];o.emit.apply(o,[h].concat(S))}),this.modules.external.forEach(function(h){h.init&&h.init(o)})}if(this.format=this.options.interpolation.format,s||(s=da),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var p=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];p.forEach(function(h){o[h]=function(){var g;return(g=o.store)[h].apply(g,arguments)}});var m=["addResource","addResources","addResourceBundle","removeResourceBundle"];m.forEach(function(h){o[h]=function(){var g;return(g=o.store)[h].apply(g,arguments),o}});var v=qi(),E=function(){var g=function(_,w){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),v.resolve(w),s(_,w)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return g(null,o.t.bind(o));o.changeLanguage(o.options.lng,g)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),v}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:da,l=s,a=typeof o=="string"?o:this.language;if(typeof o=="function"&&(l=o),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode")return l();var u=[],c=function(p){if(p){var m=i.services.languageUtils.toResolveHierarchy(p);m.forEach(function(v){u.indexOf(v)<0&&u.push(v)})}};if(a)c(a);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(f){return c(f)})}this.options.preload&&this.options.preload.forEach(function(f){return c(f)}),this.services.backendConnector.load(u,this.options.ns,function(f){!f&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),l(f)})}else l(null)}},{key:"reloadResources",value:function(o,i,s){var l=qi();return o||(o=this.languages),i||(i=this.options.ns),s||(s=da),this.services.backendConnector.reload(o,i,function(a){l.resolve(),s(a)}),l}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Ny.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i<this.languages.length;i++){var s=this.languages[i];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(o,i){var s=this;this.isLanguageChangingTo=o;var l=qi();this.emit("languageChanging",o);var a=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},u=function(f,p){p?(a(p),s.translator.changeLanguage(p),s.isLanguageChangingTo=void 0,s.emit("languageChanged",p),s.logger.log("languageChanged",p)):s.isLanguageChangingTo=void 0,l.resolve(function(){return s.t.apply(s,arguments)}),i&&i(f,function(){return s.t.apply(s,arguments)})},c=function(f){!o&&!f&&s.services.languageDetector&&(f=[]);var p=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);p&&(s.language||a(p),s.translator.language||s.translator.changeLanguage(p),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(p)),s.loadResources(p,function(m){u(m,p)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(o),l}},{key:"getFixedT",value:function(o,i,s){var l=this,a=function u(c,d){var f;if(Ft(d)!=="object"){for(var p=arguments.length,m=new Array(p>2?p-2:0),v=2;v<p;v++)m[v-2]=arguments[v];f=l.options.overloadTranslationOptionHandler([c,d].concat(m))}else f=Jt({},d);f.lng=f.lng||u.lng,f.lngs=f.lngs||u.lngs,f.ns=f.ns||u.ns,f.keyPrefix=f.keyPrefix||s||u.keyPrefix;var E=l.options.keySeparator||".",h;return f.keyPrefix&&Array.isArray(c)?h=c.map(function(g){return"".concat(f.keyPrefix).concat(E).concat(g)}):h=f.keyPrefix?"".concat(f.keyPrefix).concat(E).concat(c):c,l.t(h,f)};return typeof o=="string"?a.lng=o:a.lngs=o,a.ns=i,a.keyPrefix=s,a}},{key:"t",value:function(){var o;return this.translator&&(o=this.translator).translate.apply(o,arguments)}},{key:"exists",value:function(){var o;return this.translator&&(o=this.translator).exists.apply(o,arguments)}},{key:"setDefaultNamespace",value:function(o){this.options.defaultNS=o}},{key:"hasLoadedNamespace",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var l=this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(l.toLowerCase()==="cimode")return!0;var c=function(p,m){var v=i.services.backendConnector.state["".concat(p,"|").concat(m)];return v===-1||v===2};if(s.precheck){var d=s.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(l,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(l,o)&&(!a||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,l=qi();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(a){s.options.ns.indexOf(a)<0&&s.options.ns.push(a)}),this.loadResources(function(a){l.resolve(),i&&i(a)}),l):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=qi();typeof o=="string"&&(o=[o]);var l=this.options.preload||[],a=o.filter(function(u){return l.indexOf(u)<0});return a.length?(this.options.preload=l.concat(a),this.loadResources(function(u){s.resolve(),i&&i(u)}),s):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new Cy(ky());return i.indexOf(s.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:da,l=Jt(Jt(Jt({},this.options),i),{isClone:!0}),a=new n(l);(i.debug!==void 0||i.prefix!==void 0)&&(a.logger=a.logger.clone(i));var u=["store","services","language"];return u.forEach(function(c){a[c]=o[c]}),a.services=Jt({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new Ty(a.services,a.options),a.translator.on("*",function(c){for(var d=arguments.length,f=new Array(d>1?d-1:0),p=1;p<d;p++)f[p-1]=arguments[p];a.emit.apply(a,[c].concat(f))}),a.init(l,s),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Zn);yn(fa,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new fa(e,t)});var Le=fa.createInstance();Le.createInstance=fa.createInstance,Le.createInstance,Le.dir,Le.init,Le.loadResources,Le.reloadResources,Le.use,Le.changeLanguage,Le.getFixedT,Le.t,Le.exists,Le.setDefaultNamespace,Le.hasLoadedNamespace,Le.loadNamespaces,Le.loadLanguages;var Uy=[],WT=Uy.forEach,KT=Uy.slice;function QT(e){return WT.call(KT.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Fy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,XT=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),s="".concat(t,"=").concat(i);if(o.maxAge>0){var l=o.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(l))}if(o.domain){if(!Fy.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Fy.test(o.path))throw new TypeError("option path is invalid");s+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(s+="; HttpOnly"),o.secure&&(s+="; Secure"),o.sameSite){var a=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(a){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Vy={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=XT(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var i=r[o];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(n)===0)return i.substring(n.length,i.length)}return null},remove:function(t){this.create(t,"",-1)}},qT={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=Vy.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&Vy.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},ZT={name:"querystring",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),s=0;s<i.length;s++){var l=i[s].indexOf("=");if(l>0){var a=i[s].substring(0,l);a===t.lookupQuerystring&&(n=i[s].substring(l+1))}}}return n}},Zi=null,By=function(){if(Zi!==null)return Zi;try{Zi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Zi=!1}return Zi},JT={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&By()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&By()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},Ji=null,$y=function(){if(Ji!==null)return Ji;try{Ji=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ji=!1}return Ji},eC={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&$y()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&$y()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},tC={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},nC={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},rC={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},oC={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function iC(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var zy=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ot(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return xt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=QT(r,this.options||{},iC()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(qT),this.addDetector(ZT),this.addDetector(JT),this.addDetector(eC),this.addDetector(tC),this.addDetector(nC),this.addDetector(rC),this.addDetector(oC)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var s=r.detectors[i].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(o=o.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();zy.type="languageDetector";var sC=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,lC={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},aC=function(t){return lC[t]},uC=function(t){return t.replace(sC,aC)};function Hy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hy(Object(n),!0).forEach(function(r){yn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Gy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:uC};function cC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gy=jy(jy({},Gy),e)}var dC={type:"3rdParty",init:function(t){cC(t.options.react)}};R.createContext(),function(){function e(){Ot(this,e),this.usedNamespaces={}}return xt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();const fC={ABOUT:"About",ACTION:"Action",ADD_CONDITION:"Add Condition",ADD_OPTION:"Add Option",ADD_VARIABLE:"Add Variable",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",BEEP_SUBTITLE:"Play a beep before recording",BEEP:"Beep",BUILDER_VERSION:"Builder Version",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALLER_PRESSES:"Caller Presses",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",DECISION:"Decision",DECLINE:"Decline",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",ELSE:"Else",ENTER_URL:"Enter URL",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_INVALID_JSON:"Invalid JSON",ERROR_NUMBER_IS_REQUIRED:"A number is required.",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"A number between {{min}} and {{max}} is required.",ERROR_RECORDING_LABEL_REQUIRED:"A value is required. Maximum 20 characters.",ERROR_SELECTION_REQUIRED:"A selection is required.",ERROR_STRING_VALUE_REQUIRED:"Invalid character. String value is required.",ERROR_TELEPHONE_KEY_REQUIRED:"A value of 0-9, *, or # is required.",ERROR_TERMINATORS:"This value should contain only 0-9, *, or #.",ERROR_TEXT_IS_REQUIRED:"A text value is required.",ERROR_URL_IS_REQUIRED:"A valid URL is required.",ERROR_VALUE_IS_REQUIRED:"A value is required.",ERROR_VARIABLE_KEY_REQUIRED:"Valid characters are lowercase letters, digits, or underscore. Maximum 20 characters.",ERROR:"Error",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FORMAT:"Format",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FORWARD:"Forward",FROM_PHONE_NUMBER:"From Phone Number",FROM:"From",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP_CALL:"Hang Up Call",HANG_UP:"Hang Up",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_NODE_COND:"Sets branching (when, then, else) based on the specified JavaScript condition.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_OPTION_REMOVE:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_REQUEST:"Makes an HTTP request (GET/POST/PUT/DELETE HTTP) to the specified URL. Responses can be parsed and stored as variables for further use in your flow.",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES_OPTION:"Are you sure you want to remove this variable?",INFO_NODE_SET_VARIABLES:"Sets script variables by accepting an object which maps variable names to values.",INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INPUT:"Input",KEY:"Key",LANGUAGE:"Language",MALE:"Male",METHOD:"Method",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TITLE:"More info {{title}}",MULTIPLE_ADDRESSES:"Multiple Addresses",MULTIPLE_NUMBERS:"Multiple Numbers",MULTIPLE_RESOURCES:"Multiple Resources",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPT_NUMBER:"Opt {{index}}",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_SAYS:"Or says",PHONE_NUMBER:"Phone Number",PKG_VERSION:"Package Version",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",REASON:"Reason",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORD:"Record",RECORDING_NAME_DEFAULT:"Recording {{index}}",RECORDING_NAME:"Recording Name",RECORDING:"Recording",RELAYML_VERSION:"SWML Version",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUEST:"Request",RESYNC:"Resync",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SAVE_VARIABLES:"Save Variables",SECONDS:"seconds",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SELECT_VARIABLES:"Select Variables",SELECT:"Select",SEND_SMS:"Send SMS",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SETTINGS:"Settings",SIMULTANEOUSLY:"Simultaneously",SINGLE_ADDRESS:"Single Address",SINGLE_NUMBER:"Single Number",SINGLE_RESOURCE:"Single Resource",SMS_TEXT:"SMS Text",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOY:"Deploy",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO_SUBTITLE:"Enable stereo audio",STEREO:"Stereo",SUCCESS:"Success",TERMINATORS:"Terminators",TEXT_TO_SPEECH:"Text to Speech",TEXT:"Text",TO_PHONE_NUMBER:"To Phone Number",TO:"To",TOAST_DOCUMENT_OUT_OF_SYNC:'Updates have been made to this Call Flow by another user and your recent changes have not been saved. Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_INPUT:"Wait for Input",WRITE_SOMETHING:"Write something"},x={ABOUT:"ABOUT",ACTION:"ACTION",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_VARIABLE:"ADD_VARIABLE",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",BEEP_SUBTITLE:"BEEP_SUBTITLE",BEEP:"BEEP",BUILDER_VERSION:"BUILDER_VERSION",BUSY:"BUSY",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALLER_PRESSES:"CALLER_PRESSES",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",COND_NUMBER:"COND_NUMBER",CONDITION_NUMBER:"CONDITION_NUMBER",CONDITIONS:"CONDITIONS",DECISION:"DECISION",DECLINE:"DECLINE",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",ELSE:"ELSE",ENTER_URL:"ENTER_URL",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_INVALID_JSON:"ERROR_INVALID_JSON",ERROR_NUMBER_IS_REQUIRED:"ERROR_NUMBER_IS_REQUIRED",ERROR_NUMBER_MIN_MAX_IS_REQUIRED:"ERROR_NUMBER_MIN_MAX_IS_REQUIRED",ERROR_RECORDING_LABEL_REQUIRED:"ERROR_RECORDING_LABEL_REQUIRED",ERROR_SELECTION_REQUIRED:"ERROR_SELECTION_REQUIRED",ERROR_STRING_VALUE_REQUIRED:"ERROR_STRING_VALUE_REQUIRED",ERROR_TELEPHONE_KEY_REQUIRED:"ERROR_TELEPHONE_KEY_REQUIRED",ERROR_TERMINATORS:"ERROR_TERMINATORS",ERROR_TEXT_IS_REQUIRED:"ERROR_TEXT_IS_REQUIRED",ERROR_URL_IS_REQUIRED:"ERROR_URL_IS_REQUIRED",ERROR_VALUE_IS_REQUIRED:"ERROR_VALUE_IS_REQUIRED",ERROR_VARIABLE_KEY_REQUIRED:"ERROR_VARIABLE_KEY_REQUIRED",ERROR:"ERROR",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FORMAT:"FORMAT",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FORWARD:"FORWARD",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",FROM:"FROM",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP_CALL:"HANG_UP_CALL",HANG_UP:"HANG_UP",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_FORWARD_TO_ADDRESS:"INFO_NODE_FORWARD_TO_ADDRESS",INFO_NODE_FORWARD_TO_PHONE:"INFO_NODE_FORWARD_TO_PHONE",INFO_NODE_FORWARD_TO_RESOURCE:"INFO_NODE_FORWARD_TO_RESOURCE",INFO_NODE_GATHER_INPUT:"INFO_NODE_GATHER_INPUT",INFO_NODE_HANG_UP:"INFO_NODE_HANG_UP",INFO_NODE_OPTION_REMOVE:"INFO_NODE_OPTION_REMOVE",INFO_NODE_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES_OPTION:"INFO_NODE_SET_VARIABLES_OPTION",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INPUT:"INPUT",KEY:"KEY",LANGUAGE:"LANGUAGE",MALE:"MALE",METHOD:"METHOD",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TITLE:"MORE_INFO_TITLE",MULTIPLE_ADDRESSES:"MULTIPLE_ADDRESSES",MULTIPLE_NUMBERS:"MULTIPLE_NUMBERS",MULTIPLE_RESOURCES:"MULTIPLE_RESOURCES",NAVIGATE_BACK:"NAVIGATE_BACK",NO_ANSWER:"NO_ANSWER",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPT_NUMBER:"OPT_NUMBER",OPTION_NUMBER:"OPTION_NUMBER",OPTIONAL:"OPTIONAL",OR_SAYS:"OR_SAYS",PHONE_NUMBER:"PHONE_NUMBER",PKG_VERSION:"PKG_VERSION",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",REASON:"REASON",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",RECORD:"RECORD",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORDING_NAME:"RECORDING_NAME",RECORDING:"RECORDING",RELAYML_VERSION:"RELAYML_VERSION",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",REQUEST:"REQUEST",RESYNC:"RESYNC",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SAVE_VARIABLES:"SAVE_VARIABLES",SECONDS:"SECONDS",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT:"SELECT",SEND_SMS:"SEND_SMS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SETTINGS:"SETTINGS",SIMULTANEOUSLY:"SIMULTANEOUSLY",SINGLE_ADDRESS:"SINGLE_ADDRESS",SINGLE_NUMBER:"SINGLE_NUMBER",SINGLE_RESOURCE:"SINGLE_RESOURCE",SMS_TEXT:"SMS_TEXT",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO_SUBTITLE:"STEREO_SUBTITLE",STEREO:"STEREO",SUCCESS:"SUCCESS",TERMINATORS:"TERMINATORS",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TEXT:"TEXT",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",TO:"TO",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WRITE_SOMETHING:"WRITE_SOMETHING"},pC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},hC={"en-US":{translation:fC}},gC=()=>{Le.use(zy).use(dC).init({debug:tT,detection:pC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:hC})};function b(e,t){return t?Le.t(e,t):Le.t(e)}const mC={entries:[],nextLabelIndex:0},Sn=Pl((e,t)=>({...mC,getEntries(){return t().entries},getEntryValue(n){var r;return(r=t().entries.find(o=>o.controlId===n))==null?void 0:r.label},getGeneratedLabel(){let n="";do this.nextLabelIndex++,n=b(x.RECORDING_NAME_DEFAULT,{index:this.nextLabelIndex});while(this.isValueDuplicate(n));return n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=n.trim();return!!t().entries.reduce((s,l)=>{const{label:a,controlId:u}=l;return a!==""&&a===o&&(!r||u!==r)?[...s,l]:s},[]).length},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{e(r=>{let o=[...r.entries];const i=n.label.trim(),s=!!i;return(r.isKeyDuplicate(n.controlId)||!s)&&(o=o.filter(l=>l.controlId!==n.controlId)),s&&o.push({...n,label:i}),{entries:o}})}})),vC=e=>{const t=[];e.forEach(n=>{n.type==="recordCallStart"&&n.data.controlId&&n.data.label&&t.push({controlId:n.data.controlId,label:n.data.label})}),Sn.setState({entries:t,nextLabelIndex:t.length})},yC=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Sn.getState().removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:""}}]:r,[]):[]},Yy={recordCallStart:e=>{const t=Sn.getState().getGeneratedLabel();return Sn.getState().upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},EC=e=>fy[e]!==void 0,SC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,_C=e=>Yy[e.type]!==void 0,Wy=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({id:_e(),type:e,position:r,deletable:n,data:{initial:!0,valid:!1},selected:o}),s=(a,u)=>({...a,data:{...a.data,...u}});let l=i();if(EC(e)){const a=fy[e]();SC(a)&&(l=s(l,a))}return _C(l)&&(l=Yy[l.type](l)),l},es={apiVersion:void 0,builderVersion:rT,pkgVersion:nT,relayMLVersion:void 0},wC=e=>{const t={...es,...e};es.apiVersion=t.apiVersion,es.builderVersion=t.builderVersion,es.relayMLVersion=t.relayMLVersion},Ad=()=>({...es}),Ky=1e3,Qy=ct(),RC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:l,nodes:a,edges:u,documentVersion:c}=n(),{builderVersion:d}=Ad();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!l)throw new Error("Missing httpService");const p={documentVersion:(await l.putFlow({documentVersion:c,builderVersion:d,nodes:a,edges:u})).document_version},m=n().dataHandlingStatus;switch(m){case"saving":t({...p,dataHandlingStatus:"queueing",saveFlowStatus:"saved",deployFlowStatus:"deploy"});break;case"holding":t({...p,saveFlowStatus:"awaiting-save"}),Qy.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s()},Ky);break;default:Qy.debug("Invalid dataHandlingStatus",m)}}catch(f){console.error("Put Flow",f),f instanceof Error&&f.message.includes(oT)?t({dataHandlingStatus:"holding",flowInteractive:!1,httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(l,a,...u)=>{const{dataHandlingStatus:c,initializing:d}=n(),f=typeof l=="function"?l(n()):l;!d&&(f.nodes||f.edges)?c==="queueing"?(f.saveFlowStatus="awaiting-save",t(f,a,...u),clearTimeout(o),o=setTimeout(()=>{s()},Ky)):(f.dataHandlingStatus="holding",t(f,a,...u)):"initializing"in f&&f.initializing!==d?(f.dataHandlingStatus="queueing",f.saveFlowStatus="saved",t(f,a,...u)):t(f,a,...u)},e(r.setState,n,r)},Re=ct(),NC=Wy("handleCall",{position:{x:300,y:100},deletable:!1}),ts={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowURL:"",documentVersion:0,edges:[],flowId:"",flowInteractive:!0,flowTitle:"",getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElementId:"",saveFlowStatus:"initial",deployFlowStatus:"deploy",selectedNode:void 0,updateFlowURL:"",updatingSourceHandleId:void 0},OC=(e,t)=>({...ts,reset:()=>{Re.debug("Reset!"),e({nodes:[...ts.nodes],edges:[...ts.edges]})},deployFlow:async()=>{Re.info("Deploying..."),e({deployFlowStatus:"deploying"});try{const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Re.info("Deploy response",o),e({deployFlowStatus:"deployed"})}catch(n){throw Re.info("Deploy error",n),e({deployFlowStatus:"error"}),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();aT(n,r)},addNode:({nodeType:n,x:r=150,y:o=150})=>{Re.debug("Add Node",n);const{nodes:i,reactFlowInstance:s,flowInteractive:l}=t();if(!l){Re.debug("Flow is not interactive, not adding node");return}if(!s)throw new Error("ReactFlowInstance not found");const a=Wy(n,{position:s.project({x:r,y:o})}),u=i.map(c=>({...c,selected:!1}));u.push(a),e({nodes:u,selectedNode:a})},getNodeEdges:n=>t().edges.filter(r=>r.source===n),getTargetEdges:n=>t().edges.filter(r=>r.target===n),getNodeType:n=>{const r=t().nodes.find(o=>o.id===n);return r==null?void 0:r.type},partialUpdateNodeData:(n,r)=>{var s;if(Re.debug("partialUpdateNodeData",n,r),!t().flowInteractive){Re.debug("Flow is not interactive, not updating node data");return}const o=[],i=t().nodes.map(l=>{if(l.id===n){if("options"in r&&"options"in l.data){const a=l.data.options.map(c=>c.id),u=r.options.map(c=>c.id);o.push(...a.filter(c=>!u.includes(c)))}return{...l,data:{...l.data,...r}}}return l});if(o.length){const l=t().edges.filter(a=>a.sourceHandle&&o.includes(a.sourceHandle));Re.debug("Remove orphaned edges",{sourceHandleDeleted:o,edgesToDelete:l}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:l})}e({nodes:i})},removeNode:n=>{Re.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},removeEdge:n=>{Re.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},onInit:async n=>{const{getFlowURL:r,updateFlowURL:o,deployFlowURL:i}=t();Re.log("onInit",{getFlowURL:r,updateFlowURL:o});try{const s=rw({getFlowURL:r,deployFlowURL:i,updateFlowURL:o,headers:lT()}),l=Ad(),[a,u]=await Promise.all([s.getFlow(),s.getFlowVersions({pageSize:1})]),{id:c,title:d,document_version:f,flow_data:p}=a;if(u.length&&u[0]){const{document_version:v}=u[0];v===f&&e({deployFlowStatus:"deployed"})}let m=p;m||(m={apiVersion:l.apiVersion,builderVersion:l.builderVersion,relayMLVersion:l.relayMLVersion,edges:ts.edges,nodes:ts.nodes.concat([NC])}),e({httpService:s,reactFlowInstance:n,flowId:c,flowTitle:d,documentVersion:f,nodes:m.nodes.map(dT),edges:m.edges.map(cT)}),wC({apiVersion:m.apiVersion,builderVersion:m.builderVersion,relayMLVersion:m.relayMLVersion}),vC(m.nodes)}catch(s){Re.error("Could not load flow. URL:",r);let l="unknown";s instanceof Error&&s.message.includes(iT)&&(l="not-found"),e({httpError:l})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{e({nodes:Wv(n,t().nodes)})},onNodesDelete:n=>{Re.debug("onNodesDelete"),yC(t().nodes,n).forEach(o=>{q.getState().partialUpdateNodeData(o.id,o.data)})},onEdgesChange:n=>{e({edges:ux(n,t().edges)})},onEdgesDelete:n=>{Re.debug("onEdgesDelete [noop]",n)},onConnect:n=>{Re.debug("onConnect"),e({edges:lv(n,t().edges)})},onConnectStart:()=>{Re.debug("onConnectStart"),e({isEdgeConnecting:!0})},onConnectEnd:()=>{Re.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onEdgeUpdateStart:(n,r)=>{Re.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgeUpdate:(n,r)=>{Re.debug("onEdgeUpdate"),e({edges:_O(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Re.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},setColorMode:n=>{e({colorMode:n})}}),q=Pl()(RC(OC));window.__useRFStore=q;const xC={"not-found":{title:"Call Flow not found",message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404"},unknown:{title:"Unknown error",message:"An unknown error occurred. Please try again or go back.",status:""}},TC=({errorType:e})=>{const t=q(i=>i.backButtonHref),{title:n,message:r,status:o}=xC[e];return y("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:k("div",{className:"text-center",children:[o&&y("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),y("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),y("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&y("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:y("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:b(x.GO_BACK)})})]})})},jk="";function CC({fromNode:e,fromPosition:t,fromX:n,fromY:r,toX:o,toY:i}){if(!e)return null;const[s]=Yi({borderRadius:20,sourceX:n,sourceY:r,sourcePosition:t,targetPosition:Y.Top,targetX:o,targetY:i});return k("g",{children:[y("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:s}),y("circle",{cx:o,cy:i,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})}const ns=40;function bC(e,t,n,r=0,o=!1){const{width:i,height:s,position:l}=n,a=i??0,u=s??0,c=a/2,d=u/2;if(o)return{tx:l.x,ty:l.y+d};const f=l.x+c,p=l.y+d,m=e,v=t,E=(m-f)/a-(v-p)/u,h=(m-f)/u+(v-p)/u,g=1/(Math.abs(E)+Math.abs(h)),S=g*E,_=g*h,w=c*(S+_)+f;return{tx:Math.min(Math.max(w,l.x+r),l.x+a-r),ty:l.y}}const IC=({isCircular:e,sourceX:t,labelX:n,sourceY:r,labelY:o})=>e?{x:t-ns*1.5,y:r}:{x:n-ns/2,y:o-ns/2};function AC(e){const{id:t,source:n,target:r,sourcePosition:o,sourceX:i,sourceY:s}=e,l=q(h=>h.removeEdge),a=ce(R.useCallback(h=>h.nodeInternals.get(n),[n])),u=ce(R.useCallback(h=>h.nodeInternals.get(r),[r]));if(!a||!u)return null;const c=n===r,{tx:d,ty:f}=bC(i,s,u,20,c),[p,m,v]=Yi({borderRadius:20,sourceX:i,sourceY:s,sourcePosition:o,targetPosition:c?Y.Left:Y.Top,targetX:d,targetY:f}),E=(h,g)=>{h.stopPropagation(),l(g)};return k("g",{className:"group",children:[y(_o,{path:p,...e}),y("foreignObject",{width:ns,height:ns,className:"hidden group-hover:block",requiredExtensions:"http://www.w3.org/1999/xhtml",...IC({isCircular:c,sourceX:i,labelX:m,sourceY:s,labelY:v}),children:y("div",{className:"h-10 w-10",children:k("button",{className:"flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border border-foreground/10 bg-backgroundAlt",onClick:h=>E(h,t),children:[y(Be,{tag:"trash-can",className:"text-negative"}),y("span",{className:"sr-only",children:b(x.REMOVE_EDGE)})]})})})]})}var LC={prefix:"fas",iconName:"trash-can",icon:[448,512,[61460,"trash-alt"],"f2ed","M135.2 17.7C140.6 6.8 151.7 0 163.8 0H284.2c12.1 0 23.2 6.8 28.6 17.7L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32h96l7.2-14.3zM32 128H416V448c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64V128zm96 64c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16zm96 0c-8.8 0-16 7.2-16 16V432c0 8.8 7.2 16 16 16s16-7.2 16-16V208c0-8.8-7.2-16-16-16z"]},DC={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},kC={prefix:"fas",iconName:"arrow-left",icon:[448,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},PC={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},MC={prefix:"fas",iconName:"xmark",icon:[320,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z"]},UC={prefix:"fas",iconName:"up-from-bracket",icon:[448,512,[],"e590","M73.9 134.1L196.7 11.3C203.9 4.1 213.8 0 224 0s20.1 4.1 27.3 11.3L374.1 134.1c6.4 6.4 9.9 15 9.9 24c0 18.7-15.2 33.9-33.9 33.9H288V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192H97.9C79.2 192 64 176.8 64 158.1c0-9 3.6-17.6 9.9-24zM64 352v64c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V352c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 53-43 96-96 96H96c-53 0-96-43-96-96V352c0-17.7 14.3-32 32-32s32 14.3 32 32z"]};const FC={"arrow-left":kC,"circle-exclamation":DC,"circle-info":PC,"up-from-bracket":UC,"trash-can":LC,xmark:MC},Be=R.forwardRef(function({className:t="",size:n="",tag:r},o){const i=FC[r];return i?y("svg",{"aria-hidden":"true","data-prefix":i.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${i.icon[0]} ${i.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:y("path",{d:i.icon[4],fill:"currentColor"})}):(ct().debug(`Unknown icon: ${r}`),null)}),VC=({isSelected:e,nodeId:t,nodeTitle:n,showDelete:r})=>{const o=q(a=>a.removeNode),i=q(a=>a.isEdgeConnecting);return k("div",{className:"flex w-full items-center justify-between p-4",children:[y("h2",{className:`text-lg font-semibold leading-6 ${e?"text-primary":""}`,children:n}),r&&!i&&k("button",{className:"opacity-0 transition-opacity group-hover/node-wrapper:opacity-100",onClick:()=>{o(t)},children:[y(Be,{tag:"trash-can",className:"text-negative"}),y("span",{className:"sr-only",children:b(x.REMOVE_NODE,{title:n})})]})]})},BC=({id:e,valid:t})=>{const n=q(i=>i.getTargetEdges),[r,o]=R.useState(!1);return R.useEffect(()=>{const i=()=>n(e).length>0;o(i());const s=q.subscribe((l,a)=>{const u=i();l.edges.length!==a.edges.length&&o(u),l.nodes.length!==a.nodes.length&&o(u),l.isEdgeUpdateSuccessful!==a.isEdgeUpdateSuccessful&&o(u)});return()=>s()},[e,n]),r&&t?null:k("div",{className:"flex flex-col gap-y-4 px-4 pb-4 text-sm italic leading-4",children:[!r&&y("p",{children:"Not Connected to Flow"}),!t&&y("p",{children:"Missing Required Entry"})]})},$C=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return y(No,{type:"target",id:`target-${e}`,position:Y.Top,isConnectable:t,className:"mt-1 h-4 w-full rounded-none rounded-t-md border-none bg-primary opacity-0 transition-opacity hover:opacity-100"})},We=({children:e,id:t,isConnectable:n=!0,nodeTitle:r,selected:o,showDelete:i=!0,showValidation:s=!0,target:l=!0,valid:a=!0})=>k("section",{className:`${o?"shadow-xl":""} group/node-wrapper min-w-[300px] rounded-lg border border-foreground/10 bg-background transition-[visibility]`,children:[l&&t&&y($C,{id:t,isConnectable:n}),y(VC,{nodeId:t,isSelected:o,nodeTitle:r,showDelete:i}),s&&y(BC,{id:t,valid:a}),e]}),zC=({children:e,handleClick:t,...n})=>y("li",{role:"presentation",children:k("div",{className:"flex items-center gap-2 rounded-lg bg-secondary p-2 pr-1",role:"option","aria-selected":"true",tabIndex:0,children:[y("span",{className:"text-sm text-foreground",children:e}),k("button",{className:" px-1",onClick:t,onKeyDown:o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())},type:"button",...n,children:[y("span",{className:"sr-only",children:"Remove"}),y(Be,{tag:"xmark",size:"xs"})]})]})}),Bt=e=>{const{children:t,className:n,...r}=e;return k("div",{className:"relative after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']",children:[y("select",{className:`pr-8 ${n}`,...r,children:t}),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_SELECTION_REQUIRED)})]})},HC={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},en=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,position:o=Y.Bottom,positionClasses:i="-bottom-2.5"})=>{if(!n)throw new Error("SourceHandle: id is required");const s=t?e:"disabled",l=q(f=>f.updatingSourceHandleId),c=!q(f=>f.edges.some(p=>p.sourceHandle===n))||l===n;return y("div",{className:`absolute top-auto left-1/2 h-5 w-5 -translate-x-1/2 rounded-full ${i} ${c&&r&&t?"":"nodrag cursor-not-allowed"}`,children:y(No,{className:`bottom-0 h-full w-full border-[3px] bg-background transition-colors ${HC[s]??""}`,id:n,isConnectable:c&&r&&t,position:o,type:"source"})})},rs=({children:e})=>y("div",{className:"divide-foreground/10 flex w-full items-center divide-x",children:e}),_n=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionText:o,position:i=Y.Bottom,positionClasses:s="-bottom-2.5"})=>k("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-4",children:[y("div",{className:"flex flex-col items-center justify-center",children:y("p",{className:`${t?"":"text-disabled"} min-h-[1rem] text-sm leading-4`,children:o})}),y(en,{color:e,enabled:t,id:n,isConnectable:r,position:i,positionClasses:s})]}),jC=({checked:e=!1,name:t,onClick:n})=>k("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,role:"switch","aria-checked":e?"true":"false",children:[y("span",{className:"sr-only",children:b(e?x.ON:x.OFF)}),y("span",{className:`pointer-events-none inline-block h-5 w-5 ${e?"translate-x-5":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),Ld=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>k("div",{className:"mb-2 flex items-center justify-between",children:[k("div",{className:"flex flex-grow flex-col",children:[y("span",{className:"text-base font-medium leading-6 text-foreground",children:o}),r&&y("span",{className:"text-xs text-foreground/50",children:r})]}),y(jC,{checked:e,name:n,onClick:t})]}),Rr=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...l})=>k("label",{children:[y("span",{className:"sr-only",children:t}),y("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-none ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...l}),y("p",{className:"requirements",role:"alert",children:e})]});/*!
|
|
62
62
|
* tabbable 6.1.1
|
|
63
63
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
64
|
-
*/var FC=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ld=FC.join(","),$y=typeof Element>"u",es=$y?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,al=!$y&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ll=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},VC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},BC=function(t,n,r){if(ll(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ld));return n&&es.call(t,Ld)&&o.unshift(t),o=o.filter(r),o},$C=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ll(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=e(l,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=es.call(s,Ld);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!ll(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var h=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,h):o.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return o},zy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||VC(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},zC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Hy=function(t){return t.tagName==="INPUT"},HC=function(t){return Hy(t)&&t.type==="hidden"},jC=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},YC=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},GC=function(t){if(!t.name)return!0;var n=t.form||al(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=YC(o,t.form);return!i||i===t},WC=function(t){return Hy(t)&&t.type==="radio"},KC=function(t){return WC(t)&&!GC(t)},QC=function(t){var n,r=t&&al(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var u,c,d;r=al(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},jy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},XC=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=es.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(es.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,u=al(t);if(l&&!l.shadowRoot&&o(l)===!0)return jy(t);t.assignedSlot?t=t.assignedSlot:!l&&u!==t.ownerDocument?t=u.host:t=l}t=a}if(QC(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return jy(t);return!1},qC=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return es.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ZC=function(t,n){return!(n.disabled||ll(n)||HC(n)||XC(n,t)||jC(n)||qC(n))},Yy=function(t,n){return!(KC(n)||zy(n)<0||!ZC(t,n))},JC=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},eb=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=zy(a,s),u=s?e(o.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:u})}),r.sort(zC).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Gy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=$C([t],n.includeContainer,{filter:Yy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:JC}):r=BC(t,n.includeContainer,Yy.bind(null,n)),eb(r)};function ts(e){return e.split("-")[1]}function Dd(e){return e==="y"?"height":"width"}function wr(e){return e.split("-")[0]}function ns(e){return["top","bottom"].includes(wr(e))?"x":"y"}function Wy(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,a=ns(t),l=Dd(a),u=r[l]/2-o[l]/2,c=a==="x";let d;switch(wr(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:s};break;case"left":d={x:r.x-o.width,y:s};break;default:d={x:r.x,y:r.y}}switch(ts(t)){case"start":d[a]-=u*(n&&c?-1:1);break;case"end":d[a]+=u*(n&&c?-1:1)}return d}const tb=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Wy(u,r,l),f=r,h={},m=0;for(let v=0;v<a.length;v++){const{name:E,fn:p}=a[v],{x:g,y:S,data:_,reset:w}=await p({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,d=S??d,h={...h,[E]:{...h[E],..._}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:d}=Wy(u,f,l)),v=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}};function Ky(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function kd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=t,m=Ky(h),v=a[f?d==="floating"?"reference":"floating":d],E=kd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),p=d==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},_=kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p,offsetParent:g,strategy:l}):p);return{top:(E.top-_.top+m.top)/S.y,bottom:(_.bottom-E.bottom+m.bottom)/S.y,left:(E.left-_.left+m.left)/S.x,right:(_.right-E.right+m.right)/S.x}}const nb=Math.min,rb=Math.max;function Pd(e,t,n){return rb(e,nb(t,n))}const Xy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:a,platform:l}=t;if(n==null)return{};const u=Ky(r),c={x:o,y:i},d=ns(s),f=Dd(d),h=await l.getDimensions(n),m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",E=a.reference[f]+a.reference[d]-c[d]-a.floating[f],p=c[d]-a.reference[d],g=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let S=g?d==="y"?g.clientHeight||0:g.clientWidth||0:0;S===0&&(S=a.floating[f]);const _=E/2-p/2,w=u[m],R=S-h[f]-u[v],C=S/2-h[f]/2+_,A=Pd(w,C,R),B=ts(s)!=null&&C!=A&&a.reference[f]/2-(C<w?u[m]:u[v])-h[f]/2<0;return{[d]:c[d]-(B?C<w?w-C:R-C:0),data:{[d]:A,centerOffset:C-A}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const ob={left:"right",right:"left",bottom:"top",top:"bottom"};function ul(e){return e.replace(/left|right|bottom|top/g,t=>ob[t])}function ib(e,t,n){n===void 0&&(n=!1);const r=ts(e),o=ns(e),i=Dd(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ul(s)),{main:s,cross:ul(s)}}const sb={start:"end",end:"start"};function Md(e){return e.replace(/start|end/g,t=>sb[t])}const ab=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...v}=e,E=wr(r),p=wr(s)===s,g=await(a.isRTL==null?void 0:a.isRTL(l.floating)),S=d||(p||!m?[ul(s)]:function(V){const $=ul(V);return[Md(V),$,Md($)]}(s));d||h==="none"||S.push(...function(V,$,F,O){const P=ts(V);let D=function(I,T,k){const U=["left","right"],z=["right","left"],j=["top","bottom"],K=["bottom","top"];switch(I){case"top":case"bottom":return k?T?z:U:T?U:z;case"left":case"right":return T?j:K;default:return[]}}(wr(V),F==="start",O);return P&&(D=D.map(I=>I+"-"+P),$&&(D=D.concat(D.map(Md)))),D}(s,m,h,g));const _=[s,...S],w=await Qy(t,v),R=[];let C=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&R.push(w[E]),c){const{main:V,cross:$}=ib(r,i,g);R.push(w[V],w[$])}if(C=[...C,{placement:r,overflows:R}],!R.every(V=>V<=0)){var A,B;const V=(((A=o.flip)==null?void 0:A.index)||0)+1,$=_[V];if($)return{data:{index:V,overflows:C},reset:{placement:$}};let F=(B=C.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(f){case"bestFit":{var b;const O=(b=C.map(P=>[P.placement,P.overflows.filter(D=>D>0).reduce((D,I)=>D+I,0)]).sort((P,D)=>P[1]-D[1])[0])==null?void 0:b[0];O&&(F=O);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},lb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:a,platform:l,elements:u}=i,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),d=wr(a),f=ts(a),h=ns(a)==="x",m=["left","top"].includes(d)?-1:1,v=c&&h?-1:1,E=typeof s=="function"?s(i):s;let{mainAxis:p,crossAxis:g,alignmentAxis:S}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return f&&typeof S=="number"&&(g=f==="end"?-1*S:S),h?{x:g*v,y:p*m}:{x:p*m,y:g*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function ub(e){return e==="x"?"y":"x"}const cb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:E=>{let{x:p,y:g}=E;return{x:p,y:g}}},...l}=e,u={x:n,y:r},c=await Qy(t,l),d=ns(wr(o)),f=ub(d);let h=u[d],m=u[f];if(i){const E=d==="y"?"bottom":"right";h=Pd(h+c[d==="y"?"top":"left"],h,h-c[E])}if(s){const E=f==="y"?"bottom":"right";m=Pd(m+c[f==="y"?"top":"left"],m,m-c[E])}const v=a.fn({...t,[d]:h,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ct(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Xt(e){return ct(e).getComputedStyle(e)}const qy=Math.min,rs=Math.max,cl=Math.round;function Zy(e){const t=Xt(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=cl(n)!==o||cl(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Qn(e){return e0(e)?(e.nodeName||"").toLowerCase():""}let dl;function Jy(){if(dl)return dl;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(dl=e.brands.map(t=>t.brand+"/"+t.version).join(" "),dl):navigator.userAgent}function qt(e){return e instanceof ct(e).HTMLElement}function Mt(e){return e instanceof ct(e).Element}function e0(e){return e instanceof ct(e).Node}function t0(e){return typeof ShadowRoot>"u"?!1:e instanceof ct(e).ShadowRoot||e instanceof ShadowRoot}function fl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function db(e){return["table","td","th"].includes(Qn(e))}function Ud(e){const t=/firefox/i.test(Jy()),n=Xt(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Fd(){return/^((?!chrome|android).)*safari/i.test(Jy())}function Vd(e){return["html","body","#document"].includes(Qn(e))}function n0(e){return Mt(e)?e:e.contextElement}const r0={x:1,y:1};function Do(e){const t=n0(e);if(!qt(t))return r0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=Zy(t);let s=(i?cl(n.width):n.width)/r,a=(i?cl(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function Rr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=n0(e);let l=r0;t&&(r?Mt(r)&&(l=Do(r)):l=Do(e));const u=a?ct(a):window,c=Fd()&&n;let d=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,f=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,m=s.height/l.y;if(a){const v=ct(a),E=r&&Mt(r)?ct(r):r;let p=v.frameElement;for(;p&&r&&E!==v;){const g=Do(p),S=p.getBoundingClientRect(),_=getComputedStyle(p);S.x+=(p.clientLeft+parseFloat(_.paddingLeft))*g.x,S.y+=(p.clientTop+parseFloat(_.paddingTop))*g.y,d*=g.x,f*=g.y,h*=g.x,m*=g.y,d+=S.x,f+=S.y,p=ct(p).frameElement}}return{width:h,height:m,top:f,right:d+h,bottom:f+m,left:d,x:d,y:f}}function Xn(e){return((e0(e)?e.ownerDocument:e.document)||window.document).documentElement}function pl(e){return Mt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function o0(e){return Rr(Xn(e)).left+pl(e).scrollLeft}function os(e){if(Qn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||t0(e)&&e.host||Xn(e);return t0(t)?t.host:t}function i0(e){const t=os(e);return Vd(t)?t.ownerDocument.body:qt(t)&&fl(t)?t:i0(t)}function qn(e,t){var n;t===void 0&&(t=[]);const r=i0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=ct(r);return o?t.concat(i,i.visualViewport||[],fl(r)?r:[]):t.concat(r,qn(r))}function s0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=ct(s),u=Xn(s),c=l.visualViewport;let d=u.clientWidth,f=u.clientHeight,h=0,m=0;if(c){d=c.width,f=c.height;const v=Fd();(!v||v&&a==="fixed")&&(h=c.offsetLeft,m=c.offsetTop)}return{width:d,height:f,x:h,y:m}}(e,n);else if(t==="document")r=function(s){const a=Xn(s),l=pl(s),u=s.ownerDocument.body,c=rs(a.scrollWidth,a.clientWidth,u.scrollWidth,u.clientWidth),d=rs(a.scrollHeight,a.clientHeight,u.scrollHeight,u.clientHeight);let f=-l.scrollLeft+o0(s);const h=-l.scrollTop;return Xt(u).direction==="rtl"&&(f+=rs(a.clientWidth,u.clientWidth)-c),{width:c,height:d,x:f,y:h}}(Xn(e));else if(Mt(t))r=function(s,a){const l=Rr(s,!0,a==="fixed"),u=l.top+s.clientTop,c=l.left+s.clientLeft,d=qt(s)?Do(s):{x:1,y:1};return{width:s.clientWidth*d.x,height:s.clientHeight*d.y,x:c*d.x,y:u*d.y}}(t,n);else{const s={...t};if(Fd()){var o,i;const a=ct(e);s.x-=((o=a.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=a.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return kd(r)}function a0(e,t){return qt(e)&&Xt(e).position!=="fixed"?t?t(e):e.offsetParent:null}function l0(e,t){const n=ct(e);let r=a0(e,t);for(;r&&db(r)&&Xt(r).position==="static";)r=a0(r,t);return r&&(Qn(r)==="html"||Qn(r)==="body"&&Xt(r).position==="static"&&!Ud(r))?n:r||function(o){let i=os(o);for(;qt(i)&&!Vd(i);){if(Ud(i))return i;i=os(i)}return null}(e)||n}function fb(e,t,n){const r=qt(t),o=Xn(t),i=Rr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((Qn(t)!=="body"||fl(o))&&(s=pl(t)),qt(t)){const l=Rr(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else o&&(a.x=o0(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}const pb={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const d=c.get(u);if(d)return d;let f=qn(u).filter(E=>Mt(E)&&Qn(E)!=="body"),h=null;const m=Xt(u).position==="fixed";let v=m?os(u):u;for(;Mt(v)&&!Vd(v);){const E=Xt(v),p=Ud(v);E.position==="fixed"?h=null:(m?p||h:p||E.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=E:f=f.filter(g=>g!==v),v=os(v)}return c.set(u,f),f}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((u,c)=>{const d=s0(t,c,o);return u.top=rs(d.top,u.top),u.right=qy(d.right,u.right),u.bottom=qy(d.bottom,u.bottom),u.left=rs(d.left,u.left),u},s0(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=qt(n),i=Xn(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&r!=="fixed")&&((Qn(n)!=="body"||fl(i))&&(s=pl(n)),qt(n))){const u=Rr(n);a=Do(n),l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Mt,getDimensions:function(e){return qt(e)?Zy(e):e.getBoundingClientRect()},getOffsetParent:l0,getDocumentElement:Xn,getScale:Do,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||l0,i=this.getDimensions;return{reference:fb(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Xt(e).direction==="rtl"};function hb(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:a=!1}=r,l=o&&!a,u=l||i?[...Mt(e)?qn(e):e.contextElement?qn(e.contextElement):[],...qn(t)]:[];u.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let c,d=null;if(s){let h=!0;d=new ResizeObserver(()=>{h||n(),h=!1}),Mt(e)&&!a&&d.observe(e),Mt(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let f=a?Rr(e):null;return a&&function h(){const m=Rr(e);!f||m.x===f.x&&m.y===f.y&&m.width===f.width&&m.height===f.height||n(),f=m,c=requestAnimationFrame(h)}(),n(),()=>{var h;u.forEach(m=>{l&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),(h=d)==null||h.disconnect(),d=null,a&&cancelAnimationFrame(c)}}const gb=(e,t,n)=>{const r=new Map,o={platform:pb,...n},i={...o.platform,_c:r};return tb(e,t,{...o,platform:i})},mb=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?Xy({element:t.current,padding:n}).fn(o):{}:t?Xy({element:t,padding:n}).fn(o):{}}}};var hl=typeof document<"u"?N.useLayoutEffect:N.useEffect;function gl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!gl(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!gl(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function u0(e){const t=N.useRef(e);return hl(()=>{t.current=e}),t}function vb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,l]=N.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=N.useState(r);gl(u,r)||c(r);const d=N.useRef(null),f=N.useRef(null),h=N.useRef(a),m=u0(i),v=u0(o),[E,p]=N.useState(null),[g,S]=N.useState(null),_=N.useCallback(b=>{d.current!==b&&(d.current=b,p(b))},[]),w=N.useCallback(b=>{f.current!==b&&(f.current=b,S(b))},[]),R=N.useCallback(()=>{if(!d.current||!f.current)return;const b={placement:t,strategy:n,middleware:u};v.current&&(b.platform=v.current),gb(d.current,f.current,b).then(V=>{const $={...V,isPositioned:!0};C.current&&!gl(h.current,$)&&(h.current=$,Ur.flushSync(()=>{l($)}))})},[u,t,n,v]);hl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(b=>({...b,isPositioned:!1})))},[s]);const C=N.useRef(!1);hl(()=>(C.current=!0,()=>{C.current=!1}),[]),hl(()=>{if(E&&g){if(m.current)return m.current(E,g,R);R()}},[E,g,R,m]);const A=N.useMemo(()=>({reference:d,floating:f,setReference:_,setFloating:w}),[_,w]),B=N.useMemo(()=>({reference:E,floating:g}),[E,g]);return N.useMemo(()=>({...a,update:R,refs:A,elements:B,reference:_,floating:w}),[a,R,A,B,_,w])}var Nr=typeof document<"u"?N.useLayoutEffect:N.useEffect;let Bd=!1,yb=0;const c0=()=>"floating-ui-"+yb++;function Eb(){const[e,t]=N.useState(()=>Bd?c0():void 0);return Nr(()=>{e==null&&t(c0())},[]),N.useEffect(()=>{Bd||(Bd=!0)},[]),e}const $d=xf["useId".toString()]||Eb;function Sb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const _b=N.createContext(null),wb=N.createContext(null),d0=()=>{var e;return((e=N.useContext(_b))==null?void 0:e.id)||null},zd=()=>N.useContext(wb);function mn(e){return(e==null?void 0:e.ownerDocument)||document}function f0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Rb(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Hd(e){return mn(e).defaultView||window}function Zt(e){return e?e instanceof Hd(e).Element:!1}function p0(e){return e?e instanceof Hd(e).HTMLElement:!1}function Nb(e){if(typeof ShadowRoot>"u")return!1;const t=Hd(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ob(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(f0())||t.test(Rb()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xb(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function h0(){return/apple/i.test(navigator.vendor)}function Tb(){return f0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function g0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function m0(e){const t=N.useRef(e);return Nr(()=>{t.current=e}),t}const v0="data-floating-ui-safe-polygon";function jd(e,t,n){return n&&!g0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const Cb=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:l,onOpenChange:u,dataRef:c,events:d,elements:{domReference:f,floating:h},refs:m}=e,v=zd(),E=d0(),p=m0(o),g=m0(r),S=N.useRef(),_=N.useRef(),w=N.useRef(),R=N.useRef(),C=N.useRef(!0),A=N.useRef(!1),B=N.useRef(()=>{}),b=N.useCallback(()=>{var O;const P=(O=c.current.openEvent)==null?void 0:O.type;return(P==null?void 0:P.includes("mouse"))&&P!=="mousedown"},[c]);N.useEffect(()=>{if(!n)return;function O(){clearTimeout(_.current),clearTimeout(R.current),C.current=!0}return d.on("dismiss",O),()=>{d.off("dismiss",O)}},[n,d]),N.useEffect(()=>{if(!n||!p.current||!l)return;function O(){b()&&u(!1)}const P=mn(h).documentElement;return P.addEventListener("mouseleave",O),()=>{P.removeEventListener("mouseleave",O)}},[h,l,u,n,p,c,b]);const V=N.useCallback(function(O){O===void 0&&(O=!0);const P=jd(g.current,"close",S.current);P&&!w.current?(clearTimeout(_.current),_.current=setTimeout(()=>u(!1),P)):O&&(clearTimeout(_.current),u(!1))},[g,u]),$=N.useCallback(()=>{B.current(),w.current=void 0},[]),F=N.useCallback(()=>{if(A.current){const O=mn(m.floating.current).body;O.style.pointerEvents="",O.removeAttribute(v0),A.current=!1}},[m]);return N.useEffect(()=>{if(!n)return;function O(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function P(T){if(clearTimeout(_.current),C.current=!1,i&&!g0(S.current)||s>0&&jd(g.current,"open")===0)return;c.current.openEvent=T;const k=jd(g.current,"open",S.current);k?_.current=setTimeout(()=>{u(!0)},k):u(!0)}function D(T){if(O())return;B.current();const k=mn(h);if(clearTimeout(R.current),p.current){l||clearTimeout(_.current),w.current=p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}});const U=w.current;k.addEventListener("mousemove",U),B.current=()=>{k.removeEventListener("mousemove",U)};return}V()}function I(T){O()||p.current==null||p.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}})(T)}if(Zt(f)){const T=f;return l&&T.addEventListener("mouseleave",I),h==null||h.addEventListener("mouseleave",I),a&&T.addEventListener("mousemove",P,{once:!0}),T.addEventListener("mouseenter",P),T.addEventListener("mouseleave",D),()=>{l&&T.removeEventListener("mouseleave",I),h==null||h.removeEventListener("mouseleave",I),a&&T.removeEventListener("mousemove",P),T.removeEventListener("mouseenter",P),T.removeEventListener("mouseleave",D)}}},[f,h,n,e,i,s,a,V,$,F,u,l,v,g,p,c]),Nr(()=>{var O;if(n&&l&&(O=p.current)!=null&&O.__options.blockPointerEvents&&b()){const I=mn(h).body;if(I.setAttribute(v0,""),I.style.pointerEvents="none",A.current=!0,Zt(f)&&h){var P,D;const T=f,k=v==null||(P=v.nodesRef.current.find(U=>U.id===E))==null||(D=P.context)==null?void 0:D.elements.floating;return k&&(k.style.pointerEvents=""),T.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{T.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,E,h,f,v,p,c,b]),Nr(()=>{l||(S.current=void 0,$(),F())},[l,$,F]),N.useEffect(()=>()=>{$(),clearTimeout(_.current),clearTimeout(R.current),F()},[n,$,F]),N.useMemo(()=>{if(!n)return{};function O(P){S.current=P.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{C.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(_.current)},onMouseLeave(){d.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),V(!1)}}}},[d,n,s,l,u,V])};function Yd(){return Yd=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},Yd.apply(this,arguments)}function y0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Gd(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Nb(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Wd(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function bb(e){return"composedPath"in e?e.composedPath()[0]:e.target}const E0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function S0(e,t){const n=Gy(e,E0());t==="prev"&&n.reverse();const r=n.indexOf(y0(mn(e)));return n.slice(r+1)[0]}function Ib(){return S0(document.body,"next")}function Ab(){return S0(document.body,"prev")}function Kd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Gd(n,r)}function Lb(e){Gy(e,E0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Db(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const kb=xf["useInsertionEffect".toString()]||(e=>e());function Qd(e){const t=N.useRef(()=>{});return kb(()=>{t.current=e}),N.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const _0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Xd,qd;function w0(e){e.key==="Tab"&&(Xd=e.target,clearTimeout(qd))}function Pb(e){const t=Xd===e.relatedTarget;return Xd=e.relatedTarget,clearTimeout(qd),t}const R0=N.forwardRef(function(t,n){const r=Qd(t.onFocus),[o,i]=N.useState();return Nr(()=>(h0()&&i("button"),document.addEventListener("keydown",w0),()=>{document.removeEventListener("keydown",w0)}),[]),N.createElement("span",Yd({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:_0,onFocus:s=>{h0()&&Tb()&&!Pb(s)?(s.persist(),qd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),N0=N.createContext(null),Mb=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=N.useState(null),i=$d(),s=Fb();return Nr(()=>{if(!n)return;const a=t?document.getElementById(t):null;if(a)a.setAttribute("data-floating-ui-portal",""),o(a);else{const l=document.createElement("div");t!==""&&(l.id=t||i),l.setAttribute("data-floating-ui-portal",""),o(l);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(l),()=>{u.removeChild(l)}}},[t,s,i,n]),r},Ub=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=Mb({id:n,enabled:!r}),[s,a]=N.useState(null),l=N.useRef(null),u=N.useRef(null),c=N.useRef(null),d=N.useRef(null),f=!!s&&!s.modal&&!!(r||i)&&o;return N.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(m){i&&Kd(m)&&(m.type==="focusin"?Db:Lb)(i)}return i.addEventListener("focusin",h,!0),i.addEventListener("focusout",h,!0),()=>{i.removeEventListener("focusin",h,!0),i.removeEventListener("focusout",h,!0)}},[i,o,s==null?void 0:s.modal]),N.createElement(N0.Provider,{value:N.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:a}),[o,i])},f&&i&&N.createElement(R0,{"data-type":"outside",ref:l,onFocus:h=>{if(Kd(h,i)){var m;(m=c.current)==null||m.focus()}else{const v=Ab()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),f&&i&&N.createElement("span",{"aria-owns":i.id,style:_0}),r?Ur.createPortal(t,r):i?Ur.createPortal(t,i):null,f&&i&&N.createElement(R0,{"data-type":"outside",ref:u,onFocus:h=>{if(Kd(h,i)){var m;(m=d.current)==null||m.focus()}else{const v=Ib()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},Fb=()=>N.useContext(N0);function ml(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const Vb={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Bb={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$b=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},zb=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:E=!1,bubbles:p=!0}=t===void 0?{}:t;const g=zd(),S=d0()!=null,_=Qd(typeof f=="function"?f:()=>!1),w=typeof f=="function"?_:f,R=N.useRef(!1),{escapeKeyBubbles:C,outsidePressBubbles:A}=$b(p);return N.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=C,u.current.__outsidePressBubbles=A;function B(O){if(O.key==="Escape"){const P=g?Wd(g.nodesRef.current,i):[];if(P.length>0){let D=!0;if(P.forEach(I=>{var T;if((T=I.context)!=null&&T.open&&!I.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function b(O){const P=R.current;if(R.current=!1,P||typeof w=="function"&&!w(O))return;const D=bb(O);if(p0(D)&&l){const k=l.ownerDocument.defaultView||window,U=D.scrollWidth>D.clientWidth,z=D.scrollHeight>D.clientHeight;let j=z&&O.offsetX>D.clientWidth;if(z&&k.getComputedStyle(D).direction==="rtl"&&(j=O.offsetX<=D.offsetWidth-D.clientWidth),j||U&&O.offsetY>D.clientHeight)return}const I=g&&Wd(g.nodesRef.current,i).some(k=>{var U;return ml(O,(U=k.context)==null?void 0:U.elements.floating)});if(ml(O,l)||ml(O,a)||I)return;const T=g?Wd(g.nodesRef.current,i):[];if(T.length>0){let k=!0;if(T.forEach(U=>{var z;if((z=U.context)!=null&&z.open&&!U.context.dataRef.current.__outsidePressBubbles){k=!1;return}}),!k)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:S?{preventScroll:!0}:Ob(O)||xb(O)}}),r(!1)}function V(){r(!1)}const $=mn(l);d&&$.addEventListener("keydown",B),w&&$.addEventListener(h,b);let F=[];return E&&(Zt(a)&&(F=qn(a)),Zt(l)&&(F=F.concat(qn(l))),!Zt(s)&&s&&s.contextElement&&(F=F.concat(qn(s.contextElement)))),F=F.filter(O=>{var P;return O!==((P=$.defaultView)==null?void 0:P.visualViewport)}),F.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{d&&$.removeEventListener("keydown",B),w&&$.removeEventListener(h,b),F.forEach(O=>{O.removeEventListener("scroll",V)})}},[u,l,a,s,d,w,h,o,g,i,n,r,E,c,C,A,S]),N.useEffect(()=>{R.current=!1},[w,h]),N.useMemo(()=>c?{reference:{[Vb[v]]:()=>{m&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Bb[h]]:()=>{R.current=!0}}}:{},[c,o,m,h,v,r])},Hb=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const d=N.useRef(""),f=N.useRef(!1),h=N.useRef();return N.useEffect(()=>{if(!u)return;const v=mn(a).defaultView||window;function E(){!n&&p0(l)&&l===y0(mn(l))&&(f.current=!0)}return v.addEventListener("blur",E),()=>{v.removeEventListener("blur",E)}},[a,l,n,u]),N.useEffect(()=>{if(!u)return;function m(v){(v.type==="referencePress"||v.type==="escapeKey")&&(f.current=!0)}return i.on("dismiss",m),()=>{i.off("dismiss",m)}},[i,u]),N.useEffect(()=>()=>{clearTimeout(h.current)},[]),N.useMemo(()=>u?{reference:{onPointerDown(m){let{pointerType:v}=m;d.current=v,f.current=!!(v&&c)},onMouseLeave(){f.current=!1},onFocus(m){var v;f.current||m.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&ml(o.current.openEvent,l)||(o.current.openEvent=m.nativeEvent,r(!0))},onBlur(m){f.current=!1;const v=m.relatedTarget,E=Zt(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Gd(s.floating.current,v)||Gd(l,v)||E||r(!1)})}}}:{},[u,c,l,s,o,r])};function O0(e){return N.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const jb=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=$d(),s=$d();return N.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function Yb(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=vb(e),i=zd(),s=N.useRef(null),a=N.useRef({}),l=N.useState(()=>Sb())[0],[u,c]=N.useState(null),d=N.useCallback(p=>{const g=Zt(p)?{getBoundingClientRect:()=>p.getBoundingClientRect(),contextElement:p}:p;o.refs.setReference(g)},[o.refs]),f=N.useCallback(p=>{(Zt(p)||p===null)&&(s.current=p,c(p)),(Zt(o.refs.reference.current)||o.refs.reference.current===null||p!==null&&!Zt(p))&&o.refs.setReference(p)},[o.refs]),h=N.useMemo(()=>({...o.refs,setReference:f,setPositionReference:d,domReference:s}),[o.refs,f,d]),m=N.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),v=Qd(n),E=N.useMemo(()=>({...o,refs:h,elements:m,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:v}),[o,r,l,t,v,h,m]);return Nr(()=>{const p=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);p&&(p.context=E)}),N.useMemo(()=>({...o,context:E,refs:h,reference:f,positionReference:d}),[o,h,E,f,d])}function Zd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),o[a]=function(){for(var c,d=arguments.length,f=new Array(d),h=0;h<d;h++)f[h]=arguments[h];(c=r.get(a))==null||c.forEach(m=>m(...f))}}}else o[a]=l}),o),{})}}const Gb=function(e){e===void 0&&(e=[]);const t=e,n=N.useCallback(i=>Zd(i,e,"reference"),t),r=N.useCallback(i=>Zd(i,e,"floating"),t),o=N.useCallback(i=>Zd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return N.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function Wb({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,role:o="tooltip"}={}){const i=pt.useRef(null),[s,a]=pt.useState(e),l=n??s,u=r??a,c=Yb({placement:t,open:l,onOpenChange:u,whileElementsMounted:hb,strategy:"fixed",middleware:[lb(8),ab({fallbackPlacements:["top","bottom","left","right"]}),cb({padding:8}),mb({element:i})]}),d=c.context,f=Cb(d,{move:!1,enabled:n==null}),h=Hb(d,{enabled:n==null}),m=zb(d),v=jb(d,{role:o}),E=Gb([f,h,m,v]);return pt.useMemo(()=>({open:l,setOpen:u,arrowRef:i,...E,...c}),[l,u,E,c])}const x0=pt.createContext(null),Jd=()=>{const e=pt.useContext(x0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},Kb=({children:e,...t})=>{const n=Wb(t);return y(x0.Provider,{value:n,children:e})},Qb={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0"},Xb=()=>{var s,a;const e=Jd(),[t,n]=N.useState(e.middlewareData.arrow);N.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!==null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!==null?`${t==null?void 0:t.y}px`:""},o=((a=(s=e.placement)==null?void 0:s.split("-"))==null?void 0:a[0])||"top",i=`${Qb[o]}`;return y("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
|
|
64
|
+
*/var GC=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Dd=GC.join(","),Xy=typeof Element>"u",os=Xy?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,pa=!Xy&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ha=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&e(t.parentNode);return s},YC=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},WC=function(t,n,r){if(ha(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Dd));return n&&os.call(t,Dd)&&o.unshift(t),o=o.filter(r),o},KC=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ha(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),a=l.length?l:s.children,u=e(a,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:s,candidates:u})}else{var c=os.call(s,Dd);c&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var d=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),f=!ha(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(d&&f){var p=e(d===!0?s.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},qy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||YC(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},QC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Zy=function(t){return t.tagName==="INPUT"},XC=function(t){return Zy(t)&&t.type==="hidden"},qC=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ZC=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},JC=function(t){if(!t.name)return!0;var n=t.form||pa(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=ZC(o,t.form);return!i||i===t},eb=function(t){return Zy(t)&&t.type==="radio"},tb=function(t){return eb(t)&&!JC(t)},nb=function(t){var n,r=t&&pa(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,l,a;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var u,c,d;r=pa(o),o=(u=r)===null||u===void 0?void 0:u.host,i=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return i},Jy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},rb=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=os.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(os.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var a=t.parentElement,u=pa(t);if(a&&!a.shadowRoot&&o(a)===!0)return Jy(t);t.assignedSlot?t=t.assignedSlot:!a&&u!==t.ownerDocument?t=u.host:t=a}t=l}if(nb(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Jy(t);return!1},ob=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return os.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},ib=function(t,n){return!(n.disabled||ha(n)||XC(n)||rb(n,t)||qC(n)||ob(n))},e0=function(t,n){return!(tb(n)||qy(n)<0||!ib(t,n))},sb=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},lb=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,a=qy(l,s),u=s?e(o.candidates):l;a===0?s?n.push.apply(n,u):n.push(l):r.push({documentOrder:i,tabIndex:a,item:o,isScope:s,content:u})}),r.sort(QC).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},t0=function(t,n){n=n||{};var r;return n.getShadowRoot?r=KC([t],n.includeContainer,{filter:e0.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:sb}):r=WC(t,n.includeContainer,e0.bind(null,n)),lb(r)};function is(e){return e.split("-")[1]}function kd(e){return e==="y"?"height":"width"}function Nr(e){return e.split("-")[0]}function ss(e){return["top","bottom"].includes(Nr(e))?"x":"y"}function n0(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,s=r.y+r.height/2-o.height/2,l=ss(t),a=kd(l),u=r[a]/2-o[a]/2,c=l==="x";let d;switch(Nr(t)){case"top":d={x:i,y:r.y-o.height};break;case"bottom":d={x:i,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:s};break;case"left":d={x:r.x-o.width,y:s};break;default:d={x:r.x,y:r.y}}switch(is(t)){case"start":d[l]-=u*(n&&c?-1:1);break;case"end":d[l]+=u*(n&&c?-1:1)}return d}const ab=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=n0(u,r,a),f=r,p={},m=0;for(let v=0;v<l.length;v++){const{name:E,fn:h}=l[v],{x:g,y:S,data:_,reset:w}=await h({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:u,platform:s,elements:{reference:e,floating:t}});c=g??c,d=S??d,p={...p,[E]:{...p[E],..._}},w&&m<=50&&(m++,typeof w=="object"&&(w.placement&&(f=w.placement),w.rects&&(u=w.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:c,y:d}=n0(u,f,a)),v=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:p}};function r0(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function Pd(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function o0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=t,m=r0(p),v=l[f?d==="floating"?"reference":"floating":d],E=Pd(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:c,strategy:a})),h=d==="floating"?{...s.floating,x:r,y:o}:s.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(g))&&await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1},_=Pd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h,offsetParent:g,strategy:a}):h);return{top:(E.top-_.top+m.top)/S.y,bottom:(_.bottom-E.bottom+m.bottom)/S.y,left:(E.left-_.left+m.left)/S.x,right:(_.right-E.right+m.right)/S.x}}const ub=Math.min,cb=Math.max;function Md(e,t,n){return cb(e,ub(t,n))}const i0=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:l,platform:a}=t;if(n==null)return{};const u=r0(r),c={x:o,y:i},d=ss(s),f=kd(d),p=await a.getDimensions(n),m=d==="y"?"top":"left",v=d==="y"?"bottom":"right",E=l.reference[f]+l.reference[d]-c[d]-l.floating[f],h=c[d]-l.reference[d],g=await(a.getOffsetParent==null?void 0:a.getOffsetParent(n));let S=g?d==="y"?g.clientHeight||0:g.clientWidth||0:0;S===0&&(S=l.floating[f]);const _=E/2-h/2,w=u[m],N=S-p[f]-u[v],C=S/2-p[f]/2+_,L=Md(w,C,N),B=is(s)!=null&&C!=L&&l.reference[f]/2-(C<w?u[m]:u[v])-p[f]/2<0;return{[d]:c[d]-(B?C<w?w-C:N-C:0),data:{[d]:L,centerOffset:C-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const db={left:"right",right:"left",bottom:"top",top:"bottom"};function ga(e){return e.replace(/left|right|bottom|top/g,t=>db[t])}function fb(e,t,n){n===void 0&&(n=!1);const r=is(e),o=ss(e),i=kd(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ga(s)),{main:s,cross:ga(s)}}const pb={start:"end",end:"start"};function Ud(e){return e.replace(/start|end/g,t=>pb[t])}const hb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:a}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...v}=e,E=Nr(r),h=Nr(s)===s,g=await(l.isRTL==null?void 0:l.isRTL(a.floating)),S=d||(h||!m?[ga(s)]:function(V){const $=ga(V);return[Ud(V),$,Ud($)]}(s));d||p==="none"||S.push(...function(V,$,F,O){const M=is(V);let D=function(A,T,P){const U=["left","right"],z=["right","left"],j=["top","bottom"],K=["bottom","top"];switch(A){case"top":case"bottom":return P?T?z:U:T?U:z;case"left":case"right":return T?j:K;default:return[]}}(Nr(V),F==="start",O);return M&&(D=D.map(A=>A+"-"+M),$&&(D=D.concat(D.map(Ud)))),D}(s,m,p,g));const _=[s,...S],w=await o0(t,v),N=[];let C=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&N.push(w[E]),c){const{main:V,cross:$}=fb(r,i,g);N.push(w[V],w[$])}if(C=[...C,{placement:r,overflows:N}],!N.every(V=>V<=0)){var L,B;const V=(((L=o.flip)==null?void 0:L.index)||0)+1,$=_[V];if($)return{data:{index:V,overflows:C},reset:{placement:$}};let F=(B=C.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:B.placement;if(!F)switch(f){case"bestFit":{var I;const O=(I=C.map(M=>[M.placement,M.overflows.filter(D=>D>0).reduce((D,A)=>D+A,0)]).sort((M,D)=>M[1]-D[1])[0])==null?void 0:I[0];O&&(F=O);break}case"initialPlacement":F=s}if(r!==F)return{reset:{placement:F}}}return{}}}},gb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(i,s){const{placement:l,platform:a,elements:u}=i,c=await(a.isRTL==null?void 0:a.isRTL(u.floating)),d=Nr(l),f=is(l),p=ss(l)==="x",m=["left","top"].includes(d)?-1:1,v=c&&p?-1:1,E=typeof s=="function"?s(i):s;let{mainAxis:h,crossAxis:g,alignmentAxis:S}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return f&&typeof S=="number"&&(g=f==="end"?-1*S:S),p?{x:g*v,y:h*m}:{x:h*m,y:g*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function mb(e){return e==="x"?"y":"x"}const vb=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:E=>{let{x:h,y:g}=E;return{x:h,y:g}}},...a}=e,u={x:n,y:r},c=await o0(t,a),d=ss(Nr(o)),f=mb(d);let p=u[d],m=u[f];if(i){const E=d==="y"?"bottom":"right";p=Md(p+c[d==="y"?"top":"left"],p,p-c[E])}if(s){const E=f==="y"?"bottom":"right";m=Md(m+c[f==="y"?"top":"left"],m,m-c[E])}const v=l.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ft(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tn(e){return ft(e).getComputedStyle(e)}const s0=Math.min,ls=Math.max,ma=Math.round;function l0(e){const t=tn(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=ma(n)!==o||ma(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function Jn(e){return u0(e)?(e.nodeName||"").toLowerCase():""}let va;function a0(){if(va)return va;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(va=e.brands.map(t=>t.brand+"/"+t.version).join(" "),va):navigator.userAgent}function nn(e){return e instanceof ft(e).HTMLElement}function $t(e){return e instanceof ft(e).Element}function u0(e){return e instanceof ft(e).Node}function c0(e){return typeof ShadowRoot>"u"?!1:e instanceof ft(e).ShadowRoot||e instanceof ShadowRoot}function ya(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=tn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function yb(e){return["table","td","th"].includes(Jn(e))}function Fd(e){const t=/firefox/i.test(a0()),n=tn(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!r&&r!=="none"||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(o=>n.willChange.includes(o))||["paint","layout","strict","content"].some(o=>{const i=n.contain;return i!=null&&i.includes(o)})}function Vd(){return/^((?!chrome|android).)*safari/i.test(a0())}function Bd(e){return["html","body","#document"].includes(Jn(e))}function d0(e){return $t(e)?e:e.contextElement}const f0={x:1,y:1};function ko(e){const t=d0(e);if(!nn(t))return f0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=l0(t);let s=(i?ma(n.width):n.width)/r,l=(i?ma(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}function Or(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=d0(e);let a=f0;t&&(r?$t(r)&&(a=ko(r)):a=ko(e));const u=l?ft(l):window,c=Vd()&&n;let d=(s.left+(c&&((o=u.visualViewport)==null?void 0:o.offsetLeft)||0))/a.x,f=(s.top+(c&&((i=u.visualViewport)==null?void 0:i.offsetTop)||0))/a.y,p=s.width/a.x,m=s.height/a.y;if(l){const v=ft(l),E=r&&$t(r)?ft(r):r;let h=v.frameElement;for(;h&&r&&E!==v;){const g=ko(h),S=h.getBoundingClientRect(),_=getComputedStyle(h);S.x+=(h.clientLeft+parseFloat(_.paddingLeft))*g.x,S.y+=(h.clientTop+parseFloat(_.paddingTop))*g.y,d*=g.x,f*=g.y,p*=g.x,m*=g.y,d+=S.x,f+=S.y,h=ft(h).frameElement}}return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function er(e){return((u0(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ea(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function p0(e){return Or(er(e)).left+Ea(e).scrollLeft}function as(e){if(Jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||c0(e)&&e.host||er(e);return c0(t)?t.host:t}function h0(e){const t=as(e);return Bd(t)?t.ownerDocument.body:nn(t)&&ya(t)?t:h0(t)}function tr(e,t){var n;t===void 0&&(t=[]);const r=h0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=ft(r);return o?t.concat(i,i.visualViewport||[],ya(r)?r:[]):t.concat(r,tr(r))}function g0(e,t,n){let r;if(t==="viewport")r=function(s,l){const a=ft(s),u=er(s),c=a.visualViewport;let d=u.clientWidth,f=u.clientHeight,p=0,m=0;if(c){d=c.width,f=c.height;const v=Vd();(!v||v&&l==="fixed")&&(p=c.offsetLeft,m=c.offsetTop)}return{width:d,height:f,x:p,y:m}}(e,n);else if(t==="document")r=function(s){const l=er(s),a=Ea(s),u=s.ownerDocument.body,c=ls(l.scrollWidth,l.clientWidth,u.scrollWidth,u.clientWidth),d=ls(l.scrollHeight,l.clientHeight,u.scrollHeight,u.clientHeight);let f=-a.scrollLeft+p0(s);const p=-a.scrollTop;return tn(u).direction==="rtl"&&(f+=ls(l.clientWidth,u.clientWidth)-c),{width:c,height:d,x:f,y:p}}(er(e));else if($t(t))r=function(s,l){const a=Or(s,!0,l==="fixed"),u=a.top+s.clientTop,c=a.left+s.clientLeft,d=nn(s)?ko(s):{x:1,y:1};return{width:s.clientWidth*d.x,height:s.clientHeight*d.y,x:c*d.x,y:u*d.y}}(t,n);else{const s={...t};if(Vd()){var o,i;const l=ft(e);s.x-=((o=l.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=l.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return Pd(r)}function m0(e,t){return nn(e)&&tn(e).position!=="fixed"?t?t(e):e.offsetParent:null}function v0(e,t){const n=ft(e);let r=m0(e,t);for(;r&&yb(r)&&tn(r).position==="static";)r=m0(r,t);return r&&(Jn(r)==="html"||Jn(r)==="body"&&tn(r).position==="static"&&!Fd(r))?n:r||function(o){let i=as(o);for(;nn(i)&&!Bd(i);){if(Fd(i))return i;i=as(i)}return null}(e)||n}function Eb(e,t,n){const r=nn(t),o=er(t),i=Or(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((Jn(t)!=="body"||ya(o))&&(s=Ea(t)),nn(t)){const a=Or(t,!0);l.x=a.x+t.clientLeft,l.y=a.y+t.clientTop}else o&&(l.x=p0(o));return{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}const Sb={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(u,c){const d=c.get(u);if(d)return d;let f=tr(u).filter(E=>$t(E)&&Jn(E)!=="body"),p=null;const m=tn(u).position==="fixed";let v=m?as(u):u;for(;$t(v)&&!Bd(v);){const E=tn(v),h=Fd(v);E.position==="fixed"?p=null:(m?h||p:h||E.position!=="static"||!p||!["absolute","fixed"].includes(p.position))?p=E:f=f.filter(g=>g!==v),v=as(v)}return c.set(u,f),f}(t,this._c):[].concat(n),s=[...i,r],l=s[0],a=s.reduce((u,c)=>{const d=g0(t,c,o);return u.top=ls(d.top,u.top),u.right=s0(d.right,u.right),u.bottom=s0(d.bottom,u.bottom),u.left=ls(d.left,u.left),u},g0(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=nn(n),i=er(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l={x:1,y:1};const a={x:0,y:0};if((o||!o&&r!=="fixed")&&((Jn(n)!=="body"||ya(i))&&(s=Ea(n)),nn(n))){const u=Or(n);l=ko(n),a.x=u.x+n.clientLeft,a.y=u.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+a.x,y:t.y*l.y-s.scrollTop*l.y+a.y}},isElement:$t,getDimensions:function(e){return nn(e)?l0(e):e.getBoundingClientRect()},getOffsetParent:v0,getDocumentElement:er,getScale:ko,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||v0,i=this.getDimensions;return{reference:Eb(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>tn(e).direction==="rtl"};function _b(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:l=!1}=r,a=o&&!l,u=a||i?[...$t(e)?tr(e):e.contextElement?tr(e.contextElement):[],...tr(t)]:[];u.forEach(p=>{a&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});let c,d=null;if(s){let p=!0;d=new ResizeObserver(()=>{p||n(),p=!1}),$t(e)&&!l&&d.observe(e),$t(e)||!e.contextElement||l||d.observe(e.contextElement),d.observe(t)}let f=l?Or(e):null;return l&&function p(){const m=Or(e);!f||m.x===f.x&&m.y===f.y&&m.width===f.width&&m.height===f.height||n(),f=m,c=requestAnimationFrame(p)}(),n(),()=>{var p;u.forEach(m=>{a&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),(p=d)==null||p.disconnect(),d=null,l&&cancelAnimationFrame(c)}}const wb=(e,t,n)=>{const r=new Map,o={platform:Sb,...n},i={...o.platform,_c:r};return ab(e,t,{...o,platform:i})},Rb=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?i0({element:t.current,padding:n}).fn(o):{}:t?i0({element:t,padding:n}).fn(o):{}}}};var Sa=typeof document<"u"?R.useLayoutEffect:R.useEffect;function _a(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!_a(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!_a(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function y0(e){const t=R.useRef(e);return Sa(()=>{t.current=e}),t}function Nb(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[l,a]=R.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,c]=R.useState(r);_a(u,r)||c(r);const d=R.useRef(null),f=R.useRef(null),p=R.useRef(l),m=y0(i),v=y0(o),[E,h]=R.useState(null),[g,S]=R.useState(null),_=R.useCallback(I=>{d.current!==I&&(d.current=I,h(I))},[]),w=R.useCallback(I=>{f.current!==I&&(f.current=I,S(I))},[]),N=R.useCallback(()=>{if(!d.current||!f.current)return;const I={placement:t,strategy:n,middleware:u};v.current&&(I.platform=v.current),wb(d.current,f.current,I).then(V=>{const $={...V,isPositioned:!0};C.current&&!_a(p.current,$)&&(p.current=$,Al.flushSync(()=>{a($)}))})},[u,t,n,v]);Sa(()=>{s===!1&&p.current.isPositioned&&(p.current.isPositioned=!1,a(I=>({...I,isPositioned:!1})))},[s]);const C=R.useRef(!1);Sa(()=>(C.current=!0,()=>{C.current=!1}),[]),Sa(()=>{if(E&&g){if(m.current)return m.current(E,g,N);N()}},[E,g,N,m]);const L=R.useMemo(()=>({reference:d,floating:f,setReference:_,setFloating:w}),[_,w]),B=R.useMemo(()=>({reference:E,floating:g}),[E,g]);return R.useMemo(()=>({...l,update:N,refs:L,elements:B,reference:_,floating:w}),[l,N,L,B,_,w])}var xr=typeof document<"u"?R.useLayoutEffect:R.useEffect;let $d=!1,Ob=0;const E0=()=>"floating-ui-"+Ob++;function xb(){const[e,t]=R.useState(()=>$d?E0():void 0);return xr(()=>{e==null&&t(E0())},[]),R.useEffect(()=>{$d||($d=!0)},[]),e}const zd=Tf["useId".toString()]||xb;function Tb(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const Cb=R.createContext(null),bb=R.createContext(null),S0=()=>{var e;return((e=R.useContext(Cb))==null?void 0:e.id)||null},Hd=()=>R.useContext(bb);function wn(e){return(e==null?void 0:e.ownerDocument)||document}function _0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ib(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function jd(e){return wn(e).defaultView||window}function rn(e){return e?e instanceof jd(e).Element:!1}function w0(e){return e?e instanceof jd(e).HTMLElement:!1}function Ab(e){if(typeof ShadowRoot>"u")return!1;const t=jd(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Lb(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(_0())||t.test(Ib()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Db(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function R0(){return/apple/i.test(navigator.vendor)}function kb(){return _0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function N0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function O0(e){const t=R.useRef(e);return xr(()=>{t.current=e}),t}const x0="data-floating-ui-safe-polygon";function Gd(e,t,n){return n&&!N0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const Pb=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:l=!0}=t===void 0?{}:t;const{open:a,onOpenChange:u,dataRef:c,events:d,elements:{domReference:f,floating:p},refs:m}=e,v=Hd(),E=S0(),h=O0(o),g=O0(r),S=R.useRef(),_=R.useRef(),w=R.useRef(),N=R.useRef(),C=R.useRef(!0),L=R.useRef(!1),B=R.useRef(()=>{}),I=R.useCallback(()=>{var O;const M=(O=c.current.openEvent)==null?void 0:O.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"},[c]);R.useEffect(()=>{if(!n)return;function O(){clearTimeout(_.current),clearTimeout(N.current),C.current=!0}return d.on("dismiss",O),()=>{d.off("dismiss",O)}},[n,d]),R.useEffect(()=>{if(!n||!h.current||!a)return;function O(){I()&&u(!1)}const M=wn(p).documentElement;return M.addEventListener("mouseleave",O),()=>{M.removeEventListener("mouseleave",O)}},[p,a,u,n,h,c,I]);const V=R.useCallback(function(O){O===void 0&&(O=!0);const M=Gd(g.current,"close",S.current);M&&!w.current?(clearTimeout(_.current),_.current=setTimeout(()=>u(!1),M)):O&&(clearTimeout(_.current),u(!1))},[g,u]),$=R.useCallback(()=>{B.current(),w.current=void 0},[]),F=R.useCallback(()=>{if(L.current){const O=wn(m.floating.current).body;O.style.pointerEvents="",O.removeAttribute(x0),L.current=!1}},[m]);return R.useEffect(()=>{if(!n)return;function O(){return c.current.openEvent?["click","mousedown"].includes(c.current.openEvent.type):!1}function M(T){if(clearTimeout(_.current),C.current=!1,i&&!N0(S.current)||s>0&&Gd(g.current,"open")===0)return;c.current.openEvent=T;const P=Gd(g.current,"open",S.current);P?_.current=setTimeout(()=>{u(!0)},P):u(!0)}function D(T){if(O())return;B.current();const P=wn(p);if(clearTimeout(N.current),h.current){a||clearTimeout(_.current),w.current=h.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}});const U=w.current;P.addEventListener("mousemove",U),B.current=()=>{P.removeEventListener("mousemove",U)};return}V()}function A(T){O()||h.current==null||h.current({...e,tree:v,x:T.clientX,y:T.clientY,onClose(){F(),$(),V()}})(T)}if(rn(f)){const T=f;return a&&T.addEventListener("mouseleave",A),p==null||p.addEventListener("mouseleave",A),l&&T.addEventListener("mousemove",M,{once:!0}),T.addEventListener("mouseenter",M),T.addEventListener("mouseleave",D),()=>{a&&T.removeEventListener("mouseleave",A),p==null||p.removeEventListener("mouseleave",A),l&&T.removeEventListener("mousemove",M),T.removeEventListener("mouseenter",M),T.removeEventListener("mouseleave",D)}}},[f,p,n,e,i,s,l,V,$,F,u,a,v,g,h,c]),xr(()=>{var O;if(n&&a&&(O=h.current)!=null&&O.__options.blockPointerEvents&&I()){const A=wn(p).body;if(A.setAttribute(x0,""),A.style.pointerEvents="none",L.current=!0,rn(f)&&p){var M,D;const T=f,P=v==null||(M=v.nodesRef.current.find(U=>U.id===E))==null||(D=M.context)==null?void 0:D.elements.floating;return P&&(P.style.pointerEvents=""),T.style.pointerEvents="auto",p.style.pointerEvents="auto",()=>{T.style.pointerEvents="",p.style.pointerEvents=""}}}},[n,a,E,p,f,v,h,c,I]),xr(()=>{a||(S.current=void 0,$(),F())},[a,$,F]),R.useEffect(()=>()=>{$(),clearTimeout(_.current),clearTimeout(N.current),F()},[n,$,F]),R.useMemo(()=>{if(!n)return{};function O(M){S.current=M.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){a||s===0||(clearTimeout(N.current),N.current=setTimeout(()=>{C.current||u(!0)},s))}},floating:{onMouseEnter(){clearTimeout(_.current)},onMouseLeave(){d.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),V(!1)}}}},[d,n,s,a,u,V])};function Yd(){return Yd=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},Yd.apply(this,arguments)}function T0(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function Wd(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ab(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Kd(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)})||[],r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})})||[],n=n.concat(r);return n}function Mb(e){return"composedPath"in e?e.composedPath()[0]:e.target}const C0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function b0(e,t){const n=t0(e,C0());t==="prev"&&n.reverse();const r=n.indexOf(T0(wn(e)));return n.slice(r+1)[0]}function Ub(){return b0(document.body,"next")}function Fb(){return b0(document.body,"prev")}function Qd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wd(n,r)}function Vb(e){t0(e,C0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bb(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const $b=Tf["useInsertionEffect".toString()]||(e=>e());function Xd(e){const t=R.useRef(()=>{});return $b(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const I0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let qd,Zd;function A0(e){e.key==="Tab"&&(qd=e.target,clearTimeout(Zd))}function zb(e){const t=qd===e.relatedTarget;return qd=e.relatedTarget,clearTimeout(Zd),t}const L0=R.forwardRef(function(t,n){const r=Xd(t.onFocus),[o,i]=R.useState();return xr(()=>(R0()&&i("button"),document.addEventListener("keydown",A0),()=>{document.removeEventListener("keydown",A0)}),[]),R.createElement("span",Yd({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:I0,onFocus:s=>{R0()&&kb()&&!zb(s)?(s.persist(),Zd=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),D0=R.createContext(null),Hb=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=R.useState(null),i=zd(),s=Gb();return xr(()=>{if(!n)return;const l=t?document.getElementById(t):null;if(l)l.setAttribute("data-floating-ui-portal",""),o(l);else{const a=document.createElement("div");t!==""&&(a.id=t||i),a.setAttribute("data-floating-ui-portal",""),o(a);const u=(s==null?void 0:s.portalNode)||document.body;return u.appendChild(a),()=>{u.removeChild(a)}}},[t,s,i,n]),r},jb=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=Hb({id:n,enabled:!r}),[s,l]=R.useState(null),a=R.useRef(null),u=R.useRef(null),c=R.useRef(null),d=R.useRef(null),f=!!s&&!s.modal&&!!(r||i)&&o;return R.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function p(m){i&&Qd(m)&&(m.type==="focusin"?Bb:Vb)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,o,s==null?void 0:s.modal]),R.createElement(D0.Provider,{value:R.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:l}),[o,i])},f&&i&&R.createElement(L0,{"data-type":"outside",ref:a,onFocus:p=>{if(Qd(p,i)){var m;(m=c.current)==null||m.focus()}else{const v=Fb()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),f&&i&&R.createElement("span",{"aria-owns":i.id,style:I0}),r?Al.createPortal(t,r):i?Al.createPortal(t,i):null,f&&i&&R.createElement(L0,{"data-type":"outside",ref:u,onFocus:p=>{if(Qd(p,i)){var m;(m=d.current)==null||m.focus()}else{const v=Ub()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},Gb=()=>R.useContext(D0);function wa(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}const Yb={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Wb={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Kb=function(e){var t,n;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(n=e.outsidePress)!=null?n:!0}},Qb=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:l,floating:a},dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:v="pointerdown",ancestorScroll:E=!1,bubbles:h=!0}=t===void 0?{}:t;const g=Hd(),S=S0()!=null,_=Xd(typeof f=="function"?f:()=>!1),w=typeof f=="function"?_:f,N=R.useRef(!1),{escapeKeyBubbles:C,outsidePressBubbles:L}=Kb(h);return R.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=C,u.current.__outsidePressBubbles=L;function B(O){if(O.key==="Escape"){const M=g?Kd(g.nodesRef.current,i):[];if(M.length>0){let D=!0;if(M.forEach(A=>{var T;if((T=A.context)!=null&&T.open&&!A.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function I(O){const M=N.current;if(N.current=!1,M||typeof w=="function"&&!w(O))return;const D=Mb(O);if(w0(D)&&a){const P=a.ownerDocument.defaultView||window,U=D.scrollWidth>D.clientWidth,z=D.scrollHeight>D.clientHeight;let j=z&&O.offsetX>D.clientWidth;if(z&&P.getComputedStyle(D).direction==="rtl"&&(j=O.offsetX<=D.offsetWidth-D.clientWidth),j||U&&O.offsetY>D.clientHeight)return}const A=g&&Kd(g.nodesRef.current,i).some(P=>{var U;return wa(O,(U=P.context)==null?void 0:U.elements.floating)});if(wa(O,a)||wa(O,l)||A)return;const T=g?Kd(g.nodesRef.current,i):[];if(T.length>0){let P=!0;if(T.forEach(U=>{var z;if((z=U.context)!=null&&z.open&&!U.context.dataRef.current.__outsidePressBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:S?{preventScroll:!0}:Lb(O)||Db(O)}}),r(!1)}function V(){r(!1)}const $=wn(a);d&&$.addEventListener("keydown",B),w&&$.addEventListener(p,I);let F=[];return E&&(rn(l)&&(F=tr(l)),rn(a)&&(F=F.concat(tr(a))),!rn(s)&&s&&s.contextElement&&(F=F.concat(tr(s.contextElement)))),F=F.filter(O=>{var M;return O!==((M=$.defaultView)==null?void 0:M.visualViewport)}),F.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{d&&$.removeEventListener("keydown",B),w&&$.removeEventListener(p,I),F.forEach(O=>{O.removeEventListener("scroll",V)})}},[u,a,l,s,d,w,p,o,g,i,n,r,E,c,C,L,S]),R.useEffect(()=>{N.current=!1},[w,p]),R.useMemo(()=>c?{reference:{[Yb[v]]:()=>{m&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Wb[p]]:()=>{N.current=!0}}}:{},[c,o,m,p,v,r])},Xb=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:l,domReference:a}}=e,{enabled:u=!0,keyboardOnly:c=!0}=t===void 0?{}:t;const d=R.useRef(""),f=R.useRef(!1),p=R.useRef();return R.useEffect(()=>{if(!u)return;const v=wn(l).defaultView||window;function E(){!n&&w0(a)&&a===T0(wn(a))&&(f.current=!0)}return v.addEventListener("blur",E),()=>{v.removeEventListener("blur",E)}},[l,a,n,u]),R.useEffect(()=>{if(!u)return;function m(v){(v.type==="referencePress"||v.type==="escapeKey")&&(f.current=!0)}return i.on("dismiss",m),()=>{i.off("dismiss",m)}},[i,u]),R.useEffect(()=>()=>{clearTimeout(p.current)},[]),R.useMemo(()=>u?{reference:{onPointerDown(m){let{pointerType:v}=m;d.current=v,f.current=!!(v&&c)},onMouseLeave(){f.current=!1},onFocus(m){var v;f.current||m.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&wa(o.current.openEvent,a)||(o.current.openEvent=m.nativeEvent,r(!0))},onBlur(m){f.current=!1;const v=m.relatedTarget,E=rn(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";p.current=setTimeout(()=>{Wd(s.floating.current,v)||Wd(a,v)||E||r(!1)})}}}:{},[u,c,a,s,o,r])};function k0(e){return R.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const qb=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=zd(),s=zd();return R.useMemo(()=>{const l={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:l}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?i:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...l,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function Zb(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=Nb(e),i=Hd(),s=R.useRef(null),l=R.useRef({}),a=R.useState(()=>Tb())[0],[u,c]=R.useState(null),d=R.useCallback(h=>{const g=rn(h)?{getBoundingClientRect:()=>h.getBoundingClientRect(),contextElement:h}:h;o.refs.setReference(g)},[o.refs]),f=R.useCallback(h=>{(rn(h)||h===null)&&(s.current=h,c(h)),(rn(o.refs.reference.current)||o.refs.reference.current===null||h!==null&&!rn(h))&&o.refs.setReference(h)},[o.refs]),p=R.useMemo(()=>({...o.refs,setReference:f,setPositionReference:d,domReference:s}),[o.refs,f,d]),m=R.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),v=Xd(n),E=R.useMemo(()=>({...o,refs:p,elements:m,dataRef:l,nodeId:r,events:a,open:t,onOpenChange:v}),[o,r,a,t,v,p,m]);return xr(()=>{const h=i==null?void 0:i.nodesRef.current.find(g=>g.id===r);h&&(h.context=E)}),R.useMemo(()=>({...o,context:E,refs:p,reference:f,positionReference:d}),[o,p,E,f,d])}function Jd(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[n]:null).concat(e).reduce((o,i)=>(i&&Object.entries(i).forEach(s=>{let[l,a]=s;if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var u;(u=r.get(l))==null||u.push(a),o[l]=function(){for(var c,d=arguments.length,f=new Array(d),p=0;p<d;p++)f[p]=arguments[p];(c=r.get(l))==null||c.forEach(m=>m(...f))}}}else o[l]=a}),o),{})}}const Jb=function(e){e===void 0&&(e=[]);const t=e,n=R.useCallback(i=>Jd(i,e,"reference"),t),r=R.useCallback(i=>Jd(i,e,"floating"),t),o=R.useCallback(i=>Jd(i,e,"item"),e.map(i=>i==null?void 0:i.item));return R.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function eI({initialOpen:e=!1,placement:t="top",open:n,onOpenChange:r,role:o="tooltip"}={}){const i=mt.useRef(null),[s,l]=mt.useState(e),a=n??s,u=r??l,c=Zb({placement:t,open:a,onOpenChange:u,whileElementsMounted:_b,strategy:"fixed",middleware:[gb(8),hb({fallbackPlacements:["top","bottom","left","right"]}),vb({padding:8}),Rb({element:i})]}),d=c.context,f=Pb(d,{move:!1,enabled:n==null}),p=Xb(d,{enabled:n==null}),m=Qb(d),v=qb(d,{role:o}),E=Jb([f,p,m,v]);return mt.useMemo(()=>({open:a,setOpen:u,arrowRef:i,...E,...c}),[a,u,E,c])}const P0=mt.createContext(null),ef=()=>{const e=mt.useContext(P0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},tI=({children:e,...t})=>{const n=eI(t);return y(P0.Provider,{value:n,children:e})},nI={top:"-bottom-1 before:border-t-0 before:border-l-0",bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0"},rI=()=>{var s,l;const e=ef(),[t,n]=R.useState(e.middlewareData.arrow);R.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!==null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!==null?`${t==null?void 0:t.y}px`:""},o=((l=(s=e.placement)==null?void 0:s.split("-"))==null?void 0:l[0])||"top",i=`${nI[o]}`;return y("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
|
|
65
65
|
before:absolute before:h-2 before:w-2 before:border before:border-foreground/30 before:content-['']
|
|
66
|
-
${i}`})},qb=pt.forwardRef(function(t,n){var l;const r=q(u=>u.rootElementId),o=N.useRef(null),i=Jd(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(l=s.shadowRoot)==null?void 0:l.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const a=O0([i.refs.setFloating,n]);return y(Ub,{root:o.current,children:i.open&&M("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:a,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,y(Xb,{})]})})}),Zb=pt.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=Jd(),s=O0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&pt.isValidElement(t)?pt.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):y("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),Or=({asChild:e=!0,children:t,placement:n="top",trigger:r=y(Fe,{tag:"circle-info"}),...o})=>M(Kb,{...o,placement:n,children:[y(Zb,{asChild:e,children:r}),y(qb,{children:t})]}),Jb=({dragging:e,id:t,isConnectable:n,selected:r})=>y(je,{id:t,isConnectable:n,missingRequiredEntry:!1,nodeTitle:"Answer Call",selected:r,showDelete:!e,children:y(Qt,{id:t,isConnectable:n,color:"positive"})}),eI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>y(je,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:L(x.CONDITIONS),selected:o,showDelete:!n,children:M(Ji,{children:[t.options.map((i,s)=>{const a=Boolean(i.value);return y(gn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:L(x.COND_NUMBER,{index:s+1})},i.id)}),y(gn,{color:"negative",id:t.fallback,isConnectable:r,optionText:L(x.ELSE)})]})}),tI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return y(je,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:L(x.REQUEST),selected:o,showDelete:!t,children:M(Ji,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>y(gn,{color:"positive",enabled:Boolean(s.value),id:s.id,isConnectable:r,optionText:L(x.OPT_NUMBER,{index:a+1})},s.id)),y(gn,{color:"negative",id:e.fallback,isConnectable:r,optionText:L(x.ELSE)}),y(gn,{color:"negative",id:e.error,isConnectable:r,optionText:L(x.FAILURE)})]})})},nI={success:x.SUCCESS,noAnswer:x.NO_ANSWER,busy:x.BUSY,decline:x.DECLINE,error:x.ERROR},rI={address:x.FORWARD_TO_ADDRESS,phone:x.FORWARD_TO_PHONE,resource:x.FORWARD_TO_RESOURCE},ef=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>M(je,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:L(rI[t.destinationType]),selected:o,showDelete:!n,children:[t.destinations.length>0?y("section",{className:"p-4 pt-2",children:y("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>y("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,y(Ji,{children:t.options.map(i=>y(gn,{id:i.id,optionText:L(nI[i.result]),color:ry(i.result),isConnectable:r},i.id))})]}),oI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>y(je,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:"Gather Input",selected:o,showDelete:!n,children:M(Ji,{children:[t.options.map((i,s)=>{const a=Boolean(i.command||i.digit);return y(gn,{color:"positive",enabled:a,id:i.id,isConnectable:r,optionText:L(x.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>y(gn,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?L(x.NO_INPUT):L(x.UNKNOWN)},i.id))]})}),iI=({id:e,isConnectable:t,selected:n})=>y(je,{allowDelete:!1,id:e,isConnectable:t,nodeTitle:L(x.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:y(Qt,{id:e,color:"positive",isConnectable:t})}),tf={busy:x.BUSY,decline:x.DECLINE,hangup:x.HANG_UP},sI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>y(je,{id:n,isConnectable:r,missingRequiredEntry:!1,nodeTitle:L(x.HANG_UP_CALL),selected:o,showDelete:!t,children:e.reason&&y("section",{className:"p-4 pt-2",children:y("p",{children:L(tf[e.reason])})})}),aI=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},lI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=aI(i)||"Play Audio"),M(je,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:L(x.PLAY_AUDIO_TTS),selected:o,showDelete:!t,children:[i&&y("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?y("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):y("p",{className:"break-words line-clamp-3",children:i})}),y(Qt,{id:n,isConnectable:r})]})},uI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,missingRequiredParams:s}=e;return M(je,{id:n,isConnectable:r,missingRequiredEntry:s,nodeTitle:L(x.RECORD_CALL_START),selected:o,showDelete:!t,children:[i&&y("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),y(Qt,{id:n,isConnectable:r,color:"positive"})]})},cI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var a;const i=(a=Wn(l=>l.entries))==null?void 0:a.find(l=>l.controlId===e.controlId),s=i==null?void 0:i.label;return M(je,{id:n,isConnectable:r,missingRequiredEntry:!s,nodeTitle:L(x.RECORD_CALL_STOP),selected:o,showDelete:!t,children:[s&&y("section",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),y(Qt,{id:n,color:"positive",isConnectable:r})]})},dI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>y(je,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:L(x.VOICEMAIL_RECORDING),selected:o,showDelete:!t,children:y(Qt,{id:n,isConnectable:r,color:"positive"})}),fI={success:x.SUCCESS,failed:x.FAILED},pI={answer:Jb,cond:eI,condRequest:tI,forwardAddress:ef,forwardPhone:ef,forwardResource:ef,handleCall:iI,hangup:sI,play:lI,promptPlay:oI,record:dI,recordCallStart:uI,recordCallStop:cI,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return M(je,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:L(x.REQUEST),selected:o,showDelete:!t,children:[y("p",{className:"pl-4 pb-1 text-sm text-foreground/70",children:L(x.DEPRECATED)}),y(Ji,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>y(gn,{id:s.id,optionText:L(fI[s.result]),color:ry(s.result),isConnectable:r},s.id))})]})},sendSms:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>M(je,{id:n,isConnectable:r,missingRequiredEntry:e.missingRequiredParams,nodeTitle:L(x.SEND_SMS),selected:o,showDelete:!t,children:[(e.body||e.toNumber)&&M("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&M("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[L(x.FROM),": ",e.fromNumber]}),e.toNumber&&M("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[L(x.TO),": ",e.toNumber]}),e.body&&y("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),y(Qt,{id:n,isConnectable:r})]}),set:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>M(je,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:L(x.SET_VARIABLES),selected:o,showDelete:!n,children:[t.variables.length>0&&y("div",{className:"flow-root",children:y("div",{className:"inline-block p-4 pt-0 align-middle",children:M("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[y("thead",{children:M("tr",{children:[y("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:L(x.KEY)}),y("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:L(x.VALUE)})]})}),y("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:t.variables.map(i=>i.key?M("tr",{children:[y("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm",children:i.key}),y("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:i.value})]},i.id):null)})]})})}),y(Qt,{id:e,isConnectable:r,color:"positive"})]}),unset:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const i=q(s=>s.partialUpdateNodeData);return N.useEffect(()=>{const s=Sr.subscribe(a=>{const u=Array.from(a.variables.values()).reduce((c,d)=>{const f=t.variables.find(h=>h.setId===d.id);return f&&c.push({...f,key:d.key}),c},[]);i(e,{variables:u,missingRequiredParams:u.length===0})});return()=>s()},[i,e,t.variables]),y(je,{id:e,isConnectable:r,missingRequiredEntry:t.missingRequiredParams,nodeTitle:L(x.UNSET_VARIABLES),selected:o,showDelete:!n,children:y(Qt,{id:e,isConnectable:r,color:"positive"})})}},hI={floating:NC},gI={duration:1e3,includeHiddenNodes:!0,padding:.3},mI=e=>({edges:e.edges,nodes:e.nodes,addNode:e.addNode,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgesDelete:e.onEdgesDelete,onEdgeUpdate:e.onEdgeUpdate,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodeDragStart:e.onNodeDragStart,onNodeDragStop:e.onNodeDragStop,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),vI=({children:e})=>{const t=N.useRef(null),{edges:n,nodes:r,addNode:o,onConnect:i,onConnectEnd:s,onConnectStart:a,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:E,onNodesDelete:p,onSelectionChange:g}=q(mI,Je),S=N.useCallback(w=>{w.preventDefault(),w.target instanceof HTMLElement&&w.target.draggable&&(w.dataTransfer.dropEffect="move")},[]),_=N.useCallback(w=>{if(w.preventDefault(),!t.current)return qe().warn("reactFlowWrapper not available yet");const R=w.dataTransfer.getData(ey);if(!R)return qe().warn("nodeType not valid");const C=t.current.getBoundingClientRect();o({nodeType:R,x:w.clientX-C.left,y:w.clientY-C.top})},[o]);return y("div",{className:"bg-sw-white !h-auto w-full",ref:t,children:y(Xv,{connectionLineComponent:_C,connectionMode:$n.Strict,defaultEdgeOptions:ny,edges:n,edgeTypes:hI,fitView:!0,fitViewOptions:gI,nodes:r,nodeTypes:pI,onConnect:i,onConnectEnd:s,onConnectStart:a,onDragOver:S,onDrop:_,onEdgesChange:l,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:h,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:E,onNodesDelete:p,onSelectionChange:g,children:e})})},yI=1e3,EI=e=>q.setState({initializing:e}),SI=()=>{const e=q(i=>i.initializing),t=q(i=>i.flowInteractive),n=Oe(),r=Vx(),o=N.useCallback(i=>{n.setState({nodesDraggable:i,nodesConnectable:i,elementsSelectable:i})},[n]);N.useEffect(()=>{let i;e&&(r?(i&&clearTimeout(i),i=setTimeout(()=>{o(!0),EI(!1)},yI)):o(!1))},[e,r,o]),N.useEffect(()=>{e||o(t)},[e,t,o])};function T0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=a=>a===null?null:JSON.parse(a),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const is=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return is(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return is(r)(n)}}}},_I=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,p)=>({...p,...E}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const c=is(i.serialize),d=()=>{const E=i.partialize({...r()});let p;const g=c({state:E,version:i.version}).then(S=>u.setItem(i.name,S)).catch(S=>{p=S});if(p)throw p;return g},f=o.setState;o.setState=(E,p)=>{f(E,p),d()};const h=e((...E)=>{n(...E),d()},r,o);let m;const v=()=>{var E;if(!u)return;s=!1,a.forEach(g=>g(r()));const p=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return is(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var S;return m=i.merge(g,(S=r())!=null?S:h),n(m,!0),d()}).then(()=>{p==null||p(m,void 0),s=!0,l.forEach(g=>g(m))}).catch(g=>{p==null||p(void 0,g)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(u=E.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:E=>(a.add(E),()=>{a.delete(E)}),onFinishHydration:E=>(l.add(E),()=>{l.delete(E)})},v(),m||h},wI=(e,t)=>(n,r,o)=>{let i={storage:T0(()=>localStorage),partialize:v=>v,version:0,merge:(v,E)=>({...E,...v}),...t},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const c=()=>{const v=i.partialize({...r()});return u.setItem(i.name,{state:v,version:i.version})},d=o.setState;o.setState=(v,E)=>{d(v,E),c()};const f=e((...v)=>{n(...v),c()},r,o);let h;const m=()=>{var v;if(!u)return;s=!1,a.forEach(p=>p(r()));const E=((v=i.onRehydrateStorage)==null?void 0:v.call(i,r()))||void 0;return is(u.getItem.bind(u))(i.name).then(p=>{if(p)if(typeof p.version=="number"&&p.version!==i.version){if(i.migrate)return i.migrate(p.state,p.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return p.state}).then(p=>{var g;return h=i.merge(p,(g=r())!=null?g:f),n(h,!0),c()}).then(()=>{E==null||E(h,void 0),s=!0,l.forEach(p=>p(h))}).catch(p=>{E==null||E(void 0,p)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},m(),h||f},RI=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_I(e,t)):wI(e,t)},C0=window,b0={showAllNodes:!1,showDevOptions:!1,showDeployButton:!1},Zn=Ca()(RI(e=>({...b0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:T0(()=>localStorage),version:0}));Zn.subscribe(e=>{console.log("feature flags changed",e)});const NI=e=>{const t=(r,o)=>{Zn.setState(i=>({...i,[r]:o}))},n=r=>{const o=Zn.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(C0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});C0.swFlags=r}},OI=()=>NI(b0),Rt=e=>{const[t,n]=N.useReducer((r,o)=>({...r,...o}),e);return[t,n]},nf=qe(),xI={deploy:x.STATUS_DEPLOY,deployed:x.STATUS_DEPLOYED,deploying:x.STATUS_DEPLOYING,error:x.STATUS_DEPLOY_ERROR},TI=()=>{const e=q(h=>h.httpError),t=q(h=>h.saveFlowStatus),n=q(h=>h.httpService),r=q(h=>h.documentVersion),o={error:void 0,status:"deploy",prevDocVersion:r},[i,s]=Rt(o),a=xI[i.status],l=async()=>{try{nf.info("Deploying..."),s({status:"deploying",error:void 0});const h=await(n==null?void 0:n.deployFlow({documentVersion:r}));if(h)nf.info("Deployed!"),s({status:"deployed"});else throw new Error(`Failed to deploy!, response: ${h}`)}catch(h){nf.error(h),h instanceof Error?s({status:"error",error:h.message}):s({status:"error",error:"Failed to deploy!"})}};N.useEffect(()=>{t==="saved"&&r!==i.prevDocVersion&&s({status:"deploy",prevDocVersion:r})},[i.prevDocVersion,r,t,s]);const u=Boolean(e)||t!=="saved"||i.status==="deployed"||i.status==="deploying",c=u?"text-disabled hover:bg-background hover:text-disabled":"",d=i.status==="deployed"?"text-positive":"",f=i.status==="error"?"text-negative":"";return M(Io,{className:`hidden sm:flex ${c} ${d} ${f}`,disabled:u,onClick:l,children:[L(a),y(Or,{placement:"right",trigger:y("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:i.status==="error"?M(Ee,{children:[y("span",{className:"sr-only",children:L(x.MORE_INFO_DEPLOY_ERROR)}),y(Fe,{tag:"circle-exclamation"})]}):M(Ee,{children:[y("span",{className:"sr-only",children:L(x.MORE_INFO_DEPLOY)}),y(Fe,{tag:"up-from-bracket"})]})}),children:i.status==="error"?L(x.MORE_INFO_DEPLOY_ERROR,{message:i.error}):L(x.MORE_INFO_DEPLOY)})]})},CI="react-flow__controls-button",bI="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",II="hidden sm:flex",I0=N.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,u=`${CI} ${a==="button"?"":bI} ${o?II:""} ${r}`;return y(a,{className:u,ref:s,...i,children:n})}),AI=()=>{const[e,t]=N.useState(!1);return y(Or,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:M(I0,{asTag:"button",onClick:()=>{t(r=>!r)},children:["Help",M("div",{className:"flex items-center justify-center pl-1",children:[y("span",{className:"sr-only",children:L(x.MORE_INFO_STATUS_ERROR)}),y(Fe,{tag:"circle-info"})]})]}),children:M("section",{className:"p-2",children:[y("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),M("div",{className:"text-sm",children:[y("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),M("ol",{className:"my-4 list-inside list-decimal",children:[M("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing: ",y("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),M("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls: ",y("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),y("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),y("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),y("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},LI={"awaiting-save":x.STATUS_SAVING,"document-sync":x.STATUS_LOCKED,error:x.STATUS_ERROR,initial:x.STATUS_LOADING,saved:x.STATUS_SAVED,saving:x.STATUS_SAVING},A0=e=>(e.preventDefault(),e.returnValue=""),DI=()=>{const e=q(i=>i.saveFlowStatus),t=q(i=>i.httpError),r=LI[t==="document-sync"?t:e],o=e==="error"||t;return N.useEffect(()=>{if(!(e==="saved"||t))return addEventListener("beforeunload",A0,{capture:!0}),()=>{removeEventListener("beforeunload",A0,{capture:!0})}},[t,e]),M(I0,{"aria-live":o?"assertive":"polite",className:`${o?"text-negative":"text-foreground"}`,hiddenSmallScreen:!0,role:o?"alert":"status",children:[y("p",{children:L(r)}),o&&y(Or,{placement:"bottom",trigger:M("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:[y("span",{className:"sr-only",children:L(x.MORE_INFO_STATUS_ERROR)}),y(Fe,{tag:"circle-exclamation"})]}),children:L(t==="document-sync"?x.INFO_STATUS_ERROR_OUT_OF_SYNC:x.INFO_STATUS_ERROR)})]})},kI=()=>{SI();const e=q(s=>s.isDraggingNode),t=q(s=>s.rootAppWidth),n=q(s=>s.httpError),r=Zn(s=>s.showDeployButton),i=!Boolean(t&&t<ty)&&n!=="document-sync";return M(Gx,{className:e?"group/control-buttons":"",position:"top-left",showInteractive:i,children:[y(DI,{}),r&&y(TI,{}),y(AI,{})]})},L0=/^[\w\d ']+$/,D0=/^\d+$/,k0=/^\d|\*|#$/,PI=/^[\d|\*|#$]{0,12}$/,MI=/^.{1,20}$/,P0=/^[a-z0-9_]{1,20}$/,vl={MIN:1,MAX:99},xr=e=>(/(?:\/\^)(.+)(?:\$\/)/.exec(e.toString())??[])[1],rf=e=>t=>Boolean(e.exec(t)),of=e=>rf(k0)(e),sf=e=>rf(L0)(e),M0=e=>rf(P0)(e),U0=e=>typeof e=="string"&&e===""||Array.isArray(e)&&e.length===0?!1:typeof e=="object"&&e!==null?Object.keys(e).length===0?!1:Object.values(e).every(U0):!0,UI=e=>{var i;const t=N.useRef(),n=Mx(),r=e&&"options"in e.data?(i=e.data.options)==null?void 0:i.length:0;return t.current=r,{updateDynamicHandles:s=>{"options"in s&&s.options.length!==t.current&&(e&&n(e.id),t.current=s.options.length)}}},FI=()=>({value:{id:we(),value:""},valid:!0}),F0=e=>e.every(t=>t.valid),V0=({displayOptions:e,setDisplayData:t,handleOnUpdate:n})=>{const r=c=>{t({options:{value:c,valid:F0(c)}}),n({options:c.map(d=>d.value)})},o=c=>{c.preventDefault();const d=[...e,FI()];r(d)},i=c=>{const d=e.filter((f,h)=>h!==c);r(d)},s=(c,d)=>c.map(h=>h.value.id===d.value.id?{...h,...d}:h),a=c=>c.map(d=>({...d.value,value:d.value.value.trim()})),l=(c,d)=>{var g;const f=e;f[c]||qe().error(`Option not found at index ${c}`);const h=f[c],m={...h==null?void 0:h.value,...d},v=Boolean((g=m.value)==null?void 0:g.trim()),p=s(e,{value:m,valid:v});t({options:{value:p,valid:F0(p)}}),n({options:a(p)})},u=(c,d)=>{const f=c.target,{name:h,value:m}=f;switch(h){case"value":d!==void 0&&l(d,{[h]:m});break;default:qe().error(`Unhandled input name: ${h}`)}};return y("div",{className:"divide-y divide-foreground/10",children:e.map((c,d,f)=>M("div",{className:"mb-3",children:[M("div",{className:"flex items-center",children:[y("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:L(x.CONDITION_NUMBER,{index:d+1})}),Boolean(e.length>1)&&y(Or,{trigger:M("button",{className:"px-2",onClick:()=>i(d),type:"button",children:[y("span",{className:"sr-only",children:L(x.REMOVE_CONDITION,{index:d+1})}),y(Fe,{tag:"xmark"})]}),children:L(x.INFO_NODE_OPTION_REMOVE)})]}),M("label",{className:"flex flex-col",children:[y("input",{className:`w-full ${c.valid?"":"invalid"}`,defaultValue:c.value.value,name:"value",onChange:h=>u(h,d),placeholder:"%{count} > 3, /hello/.test('%{foo}')",type:"text"}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),d===f.length-1&&M("button",{onClick:o,type:"button",className:"mb-3 text-primary",children:["+ ",L(x.ADD_CONDITION)]})]},c.value.id))})},B0={url:x.PLAY_AUDIO_FILE,text:x.TEXT_TO_SPEECH},$0=({displayData:e,label:t,handleOnUpdate:n,setDisplayData:r,showDefaultOption:o})=>{var l,u;const i=e.selected.value,s=c=>{const d=c.currentTarget.value;r({selected:{value:d,valid:Boolean(d)||!o}}),n({selected:d})},a=c=>{const d=c.target,{name:f,value:h}=d,m=h.trim();let v=!0;switch(f){case"url":v=d.checkValidity(),r({[f]:{value:h,valid:v}}),n({text:"",url:v?m:""});break;case"text":v=d.checkValidity()&&m.length>0,r({[f]:{value:h,valid:v}}),n({text:v?m:"",url:""});break;default:throw new Error(`Unhandled input name: ${f}`)}};return M("div",{children:[M("label",{children:[y("span",{className:"sr-only",children:t}),M(Kn,{className:"w-full",name:"selected",onChange:s,value:i,children:[o&&y("option",{value:"",children:L(x.SELECT)}),Object.keys(B0).map(c=>y("option",{value:c,children:L(B0[c])},c))]})]}),i&&y(VI,{name:i,onChange:a,required:!0,selected:i,valid:(l=e[i])==null?void 0:l.valid,value:(u=e[i])==null?void 0:u.value})]})},VI=({name:e,onChange:t,required:n,selected:r,valid:o,value:i})=>{const a={url:y(_r,{errorText:L(x.ERROR_URL_IS_REQUIRED),inputMode:"url",label:L(x.PLAY_AUDIO_FILE),name:e,onChange:t,placeholder:L(x.ENTER_URL),required:n,valid:o,value:i}),text:y(_r,{errorText:L(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:L(x.TEXT_TO_SPEECH),name:e,onChange:t,placeholder:L(x.WRITE_SOMETHING),required:n,valid:o,value:i})}[r];return y(Ee,{children:a})},BI=[{field:"stereo",title:x.STEREO,subtitle:x.STEREO_SUBTITLE},{field:"beep",title:x.BEEP,subtitle:x.BEEP_SUBTITLE}],z0=({displayData:e,handleOnUpdate:t,setDisplayData:n})=>{const r=s=>{const a=s.target.name,l=!e[a].value,u={[a]:{value:l}};n(u),t({[a]:l})},o=s=>{const a=s.target,{name:l,value:u}=a,c=a.checkValidity(),d={[l]:{value:u,valid:c}};n(d),t({[l]:c?u.trim():""})},i=s=>{const a=s.target.name,l=s.target.value,u={[a]:{value:l,valid:!0}};n(u),t({[a]:l})};return M(Ee,{children:[y("div",{className:"mb-5",children:BI.map(s=>{const a=e[s.field].value;return y("div",{children:y(Ad,{checked:a,clickHandler:r,name:s.field,subtitle:L(s.subtitle),title:L(s.title)})},s.field)})}),M("label",{children:[L(x.TERMINATORS),y("input",{className:`w-full ${e.terminators.valid?"":"invalid"}`,defaultValue:e.terminators.value||"",name:"terminators",onChange:o,pattern:xr(PI),placeholder:"#*0",type:"text"}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_TERMINATORS)})]}),M("label",{children:[L(x.FORMAT),M(Kn,{className:"w-full",value:e.format.value,name:"format",onChange:i,children:[y("option",{value:"mp3",children:"MP3"}),y("option",{value:"wav",children:"WAV"})]})]})]})},dt=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>y("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:M("div",{className:"flex flex-col overflow-hidden",children:[M("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[y("span",{className:"text-lg font-semibold leading-6",children:o}),n&&y(Or,{trigger:M("div",{role:"tooltip",tabIndex:0,children:[y("span",{className:"sr-only",children:L(x.MORE_INFO_TITLE,{title:o})}),y(Fe,{tag:"circle-info"})]}),children:n})]}),y("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),$I=["GET","POST","PUT","DELETE"],zI=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},HI=()=>({value:{id:we(),value:""},valid:!0}),jI=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0},options:{value:e.options.length?e.options.map(l=>({value:l,valid:Boolean(l.value)})):[HI()],valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return M(dt,{info:L(x.INFO_NODE_REQUEST),title:L(x.REQUEST),children:[M("label",{children:[y("div",{children:L(x.URL)}),y("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),M("label",{className:"mb-3 block",children:[L(x.METHOD),y(Kn,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:$I.map(l=>y("option",{value:l,children:l},l))})]}),y("div",{className:"mb-4",children:y(Ad,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:L(x.SAVE_VARIABLES_SUBTITLE),title:L(x.SAVE_VARIABLES)})}),M("label",{children:[y("div",{children:L(x.REQUEST_HEADERS)}),y(_r,{errorText:L(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:L(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),M("label",{children:[y("div",{children:L(x.REQUEST_BODY)}),y(_r,{inputMode:"text",valid:!0,label:L(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:zI(r.body.value)})]}),y(V0,{displayOptions:r.options.value,setDisplayData:o,handleOnUpdate:t})]})},ss=({displayData:e,formRef:t,setCompleted:n})=>{N.useEffect(()=>{var a,l;const r=t.current,o=new FormData(r),i=Object.fromEntries(o.entries());let s=!0;for(const u of Object.keys(i)){if(((a=e[u])==null?void 0:a.valid)!==void 0&&(s=s&&Boolean((l=e[u])==null?void 0:l.valid),s)){const c=r.elements.namedItem(u);c&&"checkValidity"in c&&(s=s&&c.checkValidity())}if(!s)break}n(s)},[e,t,n])},YI=()=>({value:{id:we(),value:""},valid:!0}),GI=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={options:{value:e.options.length?e.options.map(a=>({value:a,valid:Boolean(a.value)})):[YI()],valid:!0}},[o,i]=Rt(r);return ss({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),y(dt,{formRef:n,info:L(x.INFO_NODE_COND),title:L(x.CONDITIONS),children:y(V0,{displayOptions:o.options.value,handleOnUpdate:t,setDisplayData:i})})},WI={address:{info:x.INFO_NODE_FORWARD_TO_ADDRESS,title:x.FORWARD_TO_ADDRESS,call:x.CALL_ADDRESSES,single:x.SINGLE_ADDRESS,multiple:x.MULTIPLE_ADDRESSES},phone:{info:x.INFO_NODE_FORWARD_TO_PHONE,title:x.FORWARD_TO_PHONE,call:x.CALL_NUMBERS,single:x.SINGLE_NUMBER,multiple:x.MULTIPLE_NUMBERS},resource:{info:x.INFO_NODE_FORWARD_TO_RESOURCE,title:x.FORWARD_TO_RESOURCE,call:x.CALL_RESOURCES,single:x.SINGLE_RESOURCE,multiple:x.MULTIPLE_RESOURCES}},af=({destinationType:e,nodeData:t,handleOnUpdate:n})=>{const r=N.useRef(),o=WI[e],i={single:o.single,multiple:o.multiple},s={callOrder:{value:"serial"},destinationList:{value:Jx(t.destinations),valid:!0},destinationSingle:{value:t.destinations.length===1&&t.destinations[0]?t.destinations[0]:"",valid:!0},sessionTimeout:{value:t.sessionTimeout,valid:!0},type:{value:t.type??"single"}},[a,l]=Rt(s);ss({displayData:a,formRef:r,setCompleted:h=>{n({},h)}});const c=h=>{const m=h.currentTarget.value,v=a.destinationSingle.value;let E="single",p=v.trim()?[v.trim()]:[];m==="multiple"&&(E=a.callOrder.value,p=Nd(a.destinationList.value)),l({type:{value:E}}),n({destinations:p,type:E})},d=h=>{const m=h.currentTarget.value;l({type:{value:m}}),n({type:m})},f=h=>{const m=h.target,v=m.name,E=m.value;let p=!0;switch(v){case"destinationSingle":p=m.checkValidity()&&E.trim().length>0,l({[v]:{value:E,valid:p}}),n({destinations:p?[E.trim()]:[]});break;case"destinationList":p=m.checkValidity()&&Boolean(Nd(E).length),l({[v]:{value:E,valid:p}}),n({destinations:p?Nd(E):[]});break;case"sessionTimeout":p=m.checkValidity(),l({[v]:{value:E?Number.parseInt(E,10):void 0,valid:p}}),n({sessionTimeout:p&&E?Number.parseInt(E,10):void 0});break;default:throw new Error(`Unhandled input name: ${v}`)}};return M(dt,{info:L(o.info),title:L(o.title),formRef:r,children:[y("div",{className:"mb-1",children:M("label",{children:[y("span",{className:"sr-only",children:L(x.CHOOSE_OPTION_SINGLE_MULTIPLE)}),y(Kn,{className:"w-full",name:"quantity",onChange:c,value:a.type.value==="single"?"single":"multiple",children:Object.keys(i).map(h=>y("option",{value:h,children:L(i[h])},h))})]})}),y("div",{children:a.type.value==="single"?y(KI,{displayData:a,destinationType:e,handleChange:f}):y(QI,{displayData:a,destinationType:e,handleCallOrderSelectChange:d,handleChange:f,labels:o})}),e!=="phone"&&M("label",{children:[y("div",{children:L(x.DISCONNECT_CALL_AFTER_RINGING)}),M("div",{className:"flex flex-wrap items-center gap-x-2",children:[y("input",{className:`w-14 ${a.sessionTimeout.valid?"":"invalid"}`,defaultValue:a.sessionTimeout.value,min:0,name:"sessionTimeout",onChange:f,pattern:xr(D0),type:"number",inputMode:"numeric"}),L(x.SECONDS),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},KI=({displayData:e,destinationType:t,handleChange:n})=>M(Ee,{children:[M("label",{children:[y("span",{className:"sr-only",children:L(x.SINGLE_NUMBER)}),y("input",{className:`w-full ${e.destinationSingle.valid?"":"invalid"}`,defaultValue:e.destinationSingle.value,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:t==="phone"?"tel":"text"}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),t!=="phone"&&y("div",{className:"mb-4 pt-4 text-xs uppercase",children:L(x.SETTINGS)})]}),QI=({displayData:e,destinationType:t,handleCallOrderSelectChange:n,handleChange:r,labels:o})=>{const i={serial:x.SEQUENTIALLY,parallel:x.SIMULTANEOUSLY};return M(Ee,{children:[M("label",{children:[y("span",{className:"sr-only",children:L(x.MULTIPLE_NUMBERS)}),y("textarea",{className:`min-h-[77px] w-full ${e.destinationList.valid?"":"invalid"}`,name:"destinationList",onChange:r,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:e.destinationList.value}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),y("div",{className:"mb-4 pt-4 text-xs uppercase",children:L(x.SETTINGS)}),y("div",{className:`${t==="phone"?"":"mb-4"}`,children:M("label",{children:[L(o.call),y(Kn,{className:"w-full",name:"callOrder",onChange:n,value:e.type.value,children:Object.keys(i).map(s=>y("option",{value:s,children:L(i[s])},s))})]})})]})},H0=()=>({value:{id:we(),command:"",digit:""},valid:!0}),lf=e=>e.every(t=>t.valid),XI=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={initialTimeout:{value:e.initialTimeout??5,valid:!0},url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected||"text",valid:!0},options:{value:e.options.length?e.options.map(m=>({value:m,valid:Boolean(m.command||m.digit)})):[H0()],valid:!0}},[o,i]=Rt(r);ss({displayData:o,formRef:n,setCompleted:m=>{t({},m)}});const a=m=>{m.preventDefault();const v=[...o.options.value,H0()];i({options:{value:v,valid:lf(v)}}),t({options:v.map(E=>E.value)})},l=m=>{const E=o.options.value.filter((p,g)=>g!==m);i({options:{value:E,valid:lf(E)}}),t({options:E.map(p=>p.value)})},u=(m,v)=>m.map(p=>p.value.id===v.value.id?{...p,...v}:p),c=m=>m.map(v=>{const E=v.value.command.trim(),p=v.value.digit.trim();return{...v.value,command:sf(E)?E:"",digit:of(p)?p:""}}),d=(m,v)=>{const E=o.options.value;if(!E[m])throw new Error(`Option not found at index ${m}`);const p=E[m],g={...p==null?void 0:p.value,...v},S=g.command.trim(),_=g.digit.trim(),w=Boolean(S)&&sf(S)||Boolean(_)&&of(_),R={value:g,valid:w},C=u(o.options.value,R);i({options:{value:C,valid:lf(C)}}),t({options:c(C)})},f=(m,v)=>{const E=m.target,{name:p,value:g}=E;let S=!0;switch(p){case"digit":case"command":v!==void 0&&d(v,{[p]:g});break;case"initialTimeout":{S=E.checkValidity(),i({[p]:{value:Number.parseInt(g,10),valid:S}}),t({initialTimeout:S&&g?parseInt(g,10):5});break}default:throw new Error(`Unhandled input name: ${p}`)}},h=o.options.value;return y(dt,{formRef:n,info:L(x.INFO_NODE_GATHER_INPUT),title:L(x.GATHER_INPUT),children:M("div",{className:"divide-y divide-foreground/10",children:[y("div",{className:"mb-2",children:y($0,{displayData:o,label:L(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i})}),y("ul",{children:h.map((m,v,E)=>M("li",{className:"mb-3",children:[M("div",{className:"flex items-center",children:[y("h2",{className:"nowrap flex-1 py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:L(x.OPTION_NUMBER,{index:v+1})}),Boolean(h.length>1)&&y(Or,{trigger:M("button",{className:"px-2",onClick:()=>l(v),type:"button",children:[y("span",{className:"sr-only",children:L(x.REMOVE_OPTION,{index:v+1})}),y(Fe,{tag:"xmark"})]}),children:L(x.INFO_NODE_OPTION_REMOVE)})]}),M("label",{className:"flex flex-col",children:[L(x.CALLER_PRESSES),y("input",{className:`w-1/4 ${!m.valid||m.value.digit&&!of(m.value.digit)?"invalid":""}`,defaultValue:m.value.digit,name:"digit",onChange:p=>f(p,v),pattern:xr(k0),type:"text"}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_TELEPHONE_KEY_REQUIRED)})]}),M("label",{className:"flex flex-col",children:[L(x.OR_SAYS),y("input",{className:`w-full ${!m.valid||m.value.command&&!sf(m.value.command)?"invalid":""}`,defaultValue:m.value.command,name:"command",onChange:p=>f(p,v),pattern:`${xr(L0)}|''`,type:"text"}),y("p",{className:"requirements",role:"alert",children:L(x.ERROR_TEXT_IS_REQUIRED)})]}),v===E.length-1&&M("button",{onClick:a,type:"button",className:"mb-3 text-primary",children:["+ ",L(x.ADD_OPTION)]})]},m.value.id))}),M("div",{className:"pt-6",children:[y("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:L(x.SETTINGS)}),M("label",{children:[y("div",{className:"w-full",children:L(x.WAIT_FOR_INPUT)}),M("div",{className:"flex flex-wrap items-center gap-x-2",children:[y("input",{className:`w-14 ${o.initialTimeout.valid?"":"invalid"}`,defaultValue:o.initialTimeout.value,min:vl.MIN,max:vl.MAX,name:"initialTimeout",onChange:f,pattern:xr(D0),type:"number",inputMode:"numeric"}),L(x.SECONDS),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{min:vl.MIN,max:vl.MAX})})]})]})]})]})})},qI=({nodeData:e,handleOnChange:t})=>y(dt,{handleOnChange:t,info:L(x.INFO_NODE_HANG_UP),title:L(x.HANG_UP_CALL),children:M("label",{children:[M("p",{className:"mb-2 whitespace-nowrap",children:[L(x.REASON)," (",L(x.OPTIONAL),")"]}),M(Kn,{className:"w-full",defaultValue:e.reason,name:"reason",children:[y("option",{value:"",children:L(x.SELECT)}),Object.keys(tf).map(n=>y("option",{value:n,children:L(tf[n])},n))]})]})}),ZI=({nodeData:e,handleOnUpdate:t})=>{const n=N.useRef(),r={url:{value:e.url,valid:!0},text:{value:e.text,valid:!0},selected:{value:e.selected,valid:Boolean(e.selected)}},[o,i]=Rt(r);return ss({displayData:o,formRef:n,setCompleted:a=>{t({},a)}}),y(dt,{formRef:n,info:L(x.INFO_NODE_PLAY),title:L(x.PLAY_AUDIO_TTS),children:y($0,{displayData:o,label:L(x.CHOOSE_OPTION_TTS_AUDIO),handleOnUpdate:t,setDisplayData:i,showDefaultOption:!0})})},JI=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},controlId:{value:e.controlId},format:{value:e.format,valid:!0},label:{value:e.label,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},r=N.useRef(),[o,i]=Rt(n),[s,a]=N.useState(!1),l=Wn(f=>f.upsertEntry),u=Wn(f=>f.isValueDuplicate);ss({displayData:o,formRef:r,setCompleted:f=>{t({},f)}});const d=f=>{let h=!0;const m=f.target,{name:v,value:E}=m,p=E.trim(),g=u(p,e.controlId);a(g),h=m.checkValidity()&&Boolean(p)&&!g,i({[v]:{value:E,valid:h}}),t({[v]:h?p:""}),l({controlId:e.controlId,label:h?p:""})};return M(dt,{info:L(x.INFO_NODE_RECORD_CALL_START),title:L(x.RECORD_CALL_START),formRef:r,children:[M("label",{children:[L(x.RECORDING_NAME),y("input",{className:`w-full ${o.label.valid?"":"invalid"}`,defaultValue:o.label.value,name:"label",onChange:d,pattern:xr(MI),required:!0,type:"text"}),y("p",{className:"requirements",role:"alert",children:L(s?x.ERROR_DUPLICATE_RECORDING_LABEL:x.ERROR_RECORDING_LABEL_REQUIRED)})]}),y(z0,{handleOnUpdate:t,displayData:o,setDisplayData:i})]})},eA=({nodeData:e,handleOnChange:t})=>{const r=Wn(o=>o.getEntries)().sort((o,i)=>o.label.toLowerCase().localeCompare(i.label.toLowerCase()));return y(dt,{handleOnChange:t,info:L(x.INFO_NODE_RECORD_CALL_STOP),title:L(x.RECORD_CALL_STOP),children:r.length?M("label",{children:[y("p",{className:"mb-2 whitespace-nowrap",children:L(x.RECORDING_NAME)}),M(Kn,{className:"w-full",defaultValue:e.controlId,name:"controlId",children:[y("option",{value:"",children:L(x.SELECT)}),r.map(o=>y("option",{value:o.controlId,children:o.label},o.controlId))]})]}):y("p",{className:"text-negative",children:L(x.ERROR_ADD_RECORDING_FIRST)})})},tA=({nodeData:e,handleOnUpdate:t})=>{const n={beep:{value:e.beep},format:{value:e.format,valid:!0},stereo:{value:e.stereo},terminators:{value:e.terminators,valid:!0}},[r,o]=Rt(n);return y(dt,{info:L(x.INFO_NODE_RECORD),title:L(x.VOICEMAIL_RECORDING),children:y(z0,{handleOnUpdate:t,displayData:r,setDisplayData:o})})},nA=["GET","POST","PUT","DELETE"],rA=e=>{console.log("bodyToTextArea",e);try{return typeof e=="string"?e:JSON.stringify(e)}catch{return e}},oA=({nodeData:e,handleOnUpdate:t})=>{const n={url:{value:e.url,valid:!0},method:{value:e.method,valid:!0},headers:{value:e.headers,valid:!0},body:{value:e.body,valid:!0},saveVariables:{value:Boolean(e.saveVariables),valid:!0}},[r,o]=Rt(n),i=l=>{const u=l.target,{name:c,value:d}=u,f=typeof d=="string"?d.trim():d;let h=!0;switch(c){case"url":case"method":h=u.checkValidity()&&!!f,o({[c]:{value:d,valid:h}}),t({[c]:h?f:""});break;case"headers":if(!d){o({[c]:{value:{},valid:!0}}),t({[c]:{}});return}try{const m=JSON.parse(d);o({[c]:{valid:!0}}),t({[c]:m})}catch{o({[c]:{valid:!1}}),t({[c]:{}})}break;case"body":try{const m=JSON.parse(d);o({[c]:{value:d,valid:!0}}),t({[c]:m})}catch{o({[c]:{value:d,valid:!0}}),t({[c]:d})}break;default:throw new Error(`Unhandled input name: ${c}`)}},s=l=>{const u=l.target.name,c=l.target.value,d={[u]:c};o(d),t(d)},a=l=>{const u=l.target.name,c=!r[u].value;o({[u]:{value:c}}),t({[u]:c})};return M(dt,{info:L(x.INFO_NODE_REQUEST),title:L(x.REQUEST),children:[y("p",{className:"pb-1 text-sm text-foreground/70",children:L(x.DEPRECATED)}),M("label",{children:[y("div",{children:L(x.URL)}),y("input",{className:`w-full ${r.url.valid?"":"invalid"}`,defaultValue:r.url.value,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",required:!0,type:"text"}),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),M("label",{className:"mb-3 block",children:[L(x.METHOD),y(Kn,{className:"w-full",value:r.method.value,name:"method",onChange:s,children:nA.map(l=>y("option",{value:l,children:l},l))})]}),y("div",{className:"mb-4",children:y(Ad,{checked:r.saveVariables.value,clickHandler:a,name:"saveVariables",subtitle:L(x.SAVE_VARIABLES_SUBTITLE),title:L(x.SAVE_VARIABLES)})}),M("label",{children:[y("div",{children:L(x.REQUEST_HEADERS)}),y(_r,{errorText:L(x.ERROR_INVALID_JSON),inputMode:"text",valid:Boolean(r.headers.valid),label:L(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',required:!0,value:JSON.stringify(r.headers.value)})]}),M("label",{children:[y("div",{children:L(x.REQUEST_BODY)}),y(_r,{inputMode:"text",valid:!0,label:L(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",value:rA(r.body.value)})]})]})},iA=({nodeData:e,handleOnUpdate:t})=>{const n={body:{value:e.body,valid:!0},fromNumber:{value:e.fromNumber,valid:!0},toNumber:{value:e.toNumber,valid:!0}},[r,o]=Rt(n),i=s=>{const a=s.target,{name:l,value:u}=a,c=typeof u=="string"?u.trim():u;let d=!0;switch(l){case"body":case"fromNumber":case"toNumber":d=a.checkValidity()&&!!c,o({[l]:{value:u,valid:d}}),t({[l]:d?c:""});break;default:throw new Error(`Unhandled input name: ${l}`)}};return M(dt,{info:L(x.INFO_NODE_SEND_SMS),title:L(x.SEND_SMS),children:[M("label",{className:"mb-1",children:[y("div",{children:L(x.FROM_PHONE_NUMBER)}),y("input",{className:`w-full ${r.fromNumber.valid?"":"invalid"}`,defaultValue:r.fromNumber.value,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),M("label",{className:"mb-1",children:[y("div",{children:L(x.TO_PHONE_NUMBER)}),y("input",{className:`w-full ${r.toNumber.valid?"":"invalid"}`,defaultValue:r.toNumber.value,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",required:!0,type:"tel"}),y("p",{className:"requirements w-full",role:"alert",children:L(x.ERROR_VALUE_IS_REQUIRED)})]}),M("label",{children:[y("div",{children:L(x.TEXT)}),y(_r,{errorText:L(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",valid:Boolean(r.body.valid),label:L(x.SMS_TEXT),name:"body",onChange:i,placeholder:L(x.WRITE_SOMETHING),required:!0,value:r.body.value})]})]})},j0=()=>({id:we(),key:"",value:"",valid:!0}),Y0=e=>e.reduce((t,{id:n,key:r,value:o,valid:i})=>(i&&r.trim().length>0&&t.push({id:n,key:r,value:o}),t),[]),sA=({nodeData:e,handleOnUpdate:t})=>{var v;const n=Sr(E=>E.isKeyDuplicate),r={variables:{value:e.variables.length>0?e.variables.map(E=>({...E,valid:!0})):[j0()],valid:!0}},[o,i]=Rt(r),s=Sr(E=>E.upsertVariable),a=Sr(E=>E.removeVariable),l=E=>{E.preventDefault(),i({variables:{value:[...o.variables.value,j0()],valid:!0}})},u=E=>E.key.trim().length>0&&!n(E.key,E.id)&&M0(E.key),c=E=>E.every(p=>p.valid),d=E=>o.variables.value.map(p=>p.id===E.id?{...p,...E}:p),f=(E,p)=>{const g=o.variables.value[E];if(!g)throw new Error(`Variable not found at index ${E}`);const S={...g,...p};S.valid=u(S);const _=d(S),w=c(_);i({variables:{value:_,valid:w}}),t({variables:Y0(_)},w),S.valid?s({id:S.id,key:S.key,value:S.value}):a(S.id)},h=E=>{const p=o.variables.value[E];if(p){const g=o.variables.value.filter((_,w)=>w!==E),S=c(g);i({variables:{value:g,valid:S}}),t({variables:Y0(g)},S),a(p.id)}},m=(E,p)=>{const g=E.target,S=g.name;if(g.checkValidity())switch(S){case"key":case"value":f(p,{[S]:g.value});break;default:throw new Error(`Unhandled input name: ${S}`)}else f(p,{[S]:"",valid:!1})};return y(dt,{info:L(x.INFO_NODE_SET_VARIABLES),title:L(x.SET_VARIABLES),children:y("div",{className:"divide-y divide-foreground/10",children:(v=o.variables.value)==null?void 0:v.map((E,p,g)=>{const S=n(E.key,E.id);return M("div",{className:"mb-3",children:[M("div",{className:"flex flex-nowrap",children:[y("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:L(x.VARIABLE_KEY,{key:E.key})}),Boolean(g.length>1)&&y(Or,{trigger:M("button",{className:"px-2",onClick:()=>h(p),type:"button",children:[y("span",{className:"sr-only",children:L(x.REMOVE_VARIABLE,{key:E.key})}),y(Fe,{tag:"xmark"})]}),children:L(x.INFO_NODE_SET_VARIABLES_OPTION)})]}),M("label",{className:"flex flex-col",children:[L(x.KEY),y("input",{className:`w-full ${(E.valid||M0(E.key))&&!S?"":"invalid"}`,defaultValue:E.key,name:"key",onChange:_=>m(_,p),pattern:xr(P0),type:"text"}),y("p",{className:"requirements",children:L(S?x.ERROR_DUPLICATE_VARIABLE_KEY:x.ERROR_VARIABLE_KEY_REQUIRED)})]}),M("label",{className:"flex flex-col",children:[L(x.VALUE),y("input",{className:"w-full",defaultValue:E.value,name:"value",onChange:_=>m(_,p),type:"text"}),y("p",{className:"requirements",children:L(x.ERROR_TEXT_IS_REQUIRED)})]}),p===g.length-1&&M("button",{onClick:l,type:"button",className:"mb-3 text-primary",children:["+ ",L(x.ADD_VARIABLE)]})]},E.id)})})})},aA=(e,t)=>{N.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var a;const s=i.target;s instanceof Node&&!((a=e.current)!=null&&a.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},lA=({key:e,setId:t})=>({id:we(),key:e,setId:t}),uA=e=>e.length>0,cA=({nodeData:e,handleOnUpdate:t})=>{const r={currentFocus:void 0,listOpen:!1,setVariablesList:Array.from(Sr(m=>m.variables).values()).map(m=>({...m,selected:Boolean(e.variables.find(v=>v.setId===m.id))})).sort((m,v)=>m.key.toLowerCase().localeCompare(v.key.toLowerCase())),unsetVariables:e.variables},[o,i]=Rt(r),s=m=>o.setVariablesList.map(v=>v.id===m?{...v,selected:!v.selected}:v),a=m=>{const v=o.setVariablesList[m];if(!v)throw new Error("Variable not found");if(v.selected){const E=o.unsetVariables.findIndex(p=>p.setId===v.id);l(E)}else{const E=[...o.unsetVariables,lA({key:v.key,setId:v.id})];i({unsetVariables:E,setVariablesList:s(v.id)}),t({variables:E},!0)}},l=m=>{const v=o.unsetVariables[m];if(!v)throw new Error("Cannot Remove Variable, not found");const E=o.unsetVariables.filter(p=>p.id!==v.id);i({unsetVariables:E,setVariablesList:s(v.setId)}),t({variables:E},uA(E))},u=N.useRef(null);aA(u,()=>i({listOpen:!1}));const c=m=>{(m.key==="Escape"||m.key==="Esc")&&i({listOpen:!1})},d=(m,v)=>{m.preventDefault(),(m.key===" "||m.code==="Space"||m.key==="Enter")&&a(v),c(m)},f=()=>{i({listOpen:!o.listOpen})},h=o.unsetVariables.length;return M(dt,{info:L(x.INFO_NODE_UNSET_VARIABLES),title:L(x.UNSET_VARIABLES),children:[M("div",{className:"my-1 flex flex-col",children:[y("label",{id:"listbox-label",className:"sr-only",children:L(x.SELECT_VARIABLES_TO_UNSET)}),M("div",{className:"relative",ref:u,children:[y("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
|
|
66
|
+
${i}`})},oI=mt.forwardRef(function(t,n){var a;const r=q(u=>u.rootElementId),o=R.useRef(null),i=ef(),s=document.getElementById(r);if(s&&!o.current&&(o.current=(a=s.shadowRoot)==null?void 0:a.getRootNode()),!o.current)throw new Error(`shadowRoot id:${r} not found. Floating portal cannot be rendered`);const l=k0([i.refs.setFloating,n]);return y(jb,{root:o.current,children:i.open&&k("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm leading-4 text-background shadow-sm",ref:l,style:{position:i.strategy,top:i.y??0,left:i.x??0,visibility:i.x==null?"hidden":"visible",...t.style},...i.getFloatingProps(t),children:[t.children,y(rI,{})]})})}),iI=mt.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=ef(),s=k0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&mt.isValidElement(t)?mt.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):y("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),Tr=({asChild:e=!0,children:t,placement:n="top",trigger:r=y(Be,{tag:"circle-info"}),...o})=>k(tI,{...o,placement:n,children:[y(iI,{asChild:e,children:r}),y(oI,{children:t})]}),sI=({dragging:e,id:t,isConnectable:n,selected:r})=>y(We,{id:t,isConnectable:n,nodeTitle:"Answer Call",selected:r,showDelete:!e,valid:!0,children:y(en,{id:t,isConnectable:n,color:"positive"})}),lI=/^[\w\d -']+$/,aI=/^\d+$/,uI=/^\d|\*|#$/,cI=/^[\d\*#$]{0,12}$/,dI=/^.{1,20}$/,fI=/^[a-z0-9_]{1,20}$/,Po={MIN:1,MAX:99},Mo=e=>t=>!!e.exec(t),tf=e=>Nt(e)?Mo(aI)(e):!0,pI=e=>Nt(e)?Mo(uI)(e):!0,hI=e=>Nt(e)?Mo(lI)(e):!0,gI=e=>Nt(e)?Mo(fI)(e):!0,M0=e=>Nt(e)?Mo(cI)(e):!0,mI=e=>Nt(e)?Mo(dI)(e):!0,U0=e=>{if(!Nt(e))return!0;try{return JSON.parse(e),!0}catch{return!1}},oe=e=>!!Nt(e),vI=(e,t)=>{if(typeof e=="string"&&!Nt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n>=t},yI=(e,t)=>{if(typeof e=="string"&&!Nt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n<=t},Uo={cond:{fieldValidators:{value:[oe]},validate:e=>V0("cond",e),validateField:(e,t)=>se({name:e,nodeType:"cond",value:t})},condRequest:{fieldValidators:{body:[],headers:[U0],method:[oe],saveVariables:[],url:[oe],value:[oe]},validate:e=>{const t=e,n=[];return["body","headers","method","saveVariables","url"].forEach(o=>{se({name:o,nodeType:"condRequest",value:t[o]})||n.push(o)}),[...n,...V0("condRequest",e)]},validateField:(e,t)=>se({name:e,nodeType:"condRequest",value:t})},forwardAddress:{fieldValidators:{callOrder:[oe],destinationList:[oe],destinationSingle:[oe],sessionTimeout:[tf]},validate:e=>nf("forwardAddress",e,!0),validateField:(e,t)=>se({name:e,nodeType:"forwardAddress",value:t})},forwardPhone:{fieldValidators:{callOrder:[oe],destinationList:[oe],destinationSingle:[oe]},validate:e=>nf("forwardPhone",e,!1),validateField:(e,t)=>se({name:e,nodeType:"forwardPhone",value:t})},forwardResource:{fieldValidators:{callOrder:[oe],destinationList:[oe],destinationSingle:[oe],sessionTimeout:[tf]},validate:e=>nf("forwardResource",e,!0),validateField:(e,t)=>se({name:e,nodeType:"forwardResource",value:t})},hangup:{fieldValidators:{reason:[]},validate:e=>rf("hangup",e),validateField:(e,t)=>se({name:e,nodeType:"hangup",value:t})},play:{fieldValidators:{selected:[oe],text:[oe],url:[oe]},validate:e=>rf("play",e),validateField:(e,t)=>se({name:e,nodeType:"play",value:t})},promptPlay:{fieldValidators:{url:[oe],selected:[oe],text:[oe],initialTimeout:[tf,{test:vI,testValue:Po.MIN},{test:yI,testValue:Po.MAX}],command:[hI],digit:[pI]},validate:e=>{const t=e,n="promptPlay",r=rf("promptPlay",t),o=Bg(t.initialTimeout);return o!=null&&o.trim()&&!se({name:"initialTimeout",nodeType:n,value:o})&&r.push("initialTimeout"),t.options.forEach(i=>{const s=se({name:"command",nodeType:n,value:i.command}),l=se({name:"digit",nodeType:n,value:i.digit});s&&l&&(i.command||i.digit)||r.push(`option_${i.id}`)}),r},validateField:(e,t)=>se({name:e,nodeType:"promptPlay",value:t})},record:{fieldValidators:{beep:[],format:[oe],stereo:[],terminators:[M0]},validate:e=>us({nodeData:e,nodeType:"record"}),validateField:(e,t)=>se({name:e,nodeType:"record",value:t})},recordCallStart:{fieldValidators:{beep:[],controlId:[],format:[oe],label:[oe,mI],stereo:[],terminators:[M0]},validate:e=>us({nodeData:e,nodeType:"recordCallStart"}),validateField:(e,t)=>se({name:e,nodeType:"recordCallStart",value:t})},recordCallStop:{fieldValidators:{controlId:[oe]},validate:e=>us({nodeData:e,nodeType:"recordCallStop"}),validateField:(e,t)=>se({name:e,nodeType:"recordCallStop",value:t})},request:{fieldValidators:{body:[],headers:[U0],method:[oe],saveVariables:[],url:[oe]},validate:e=>us({nodeData:e,nodeType:"request"}),validateField:(e,t)=>se({name:e,nodeType:"request",value:t})},sendSms:{fieldValidators:{body:[oe],fromNumber:[oe],toNumber:[oe]},validate:e=>us({nodeData:e,nodeType:"sendSms"}),validateField:(e,t)=>se({name:e,nodeType:"sendSms",value:t})},set:{fieldValidators:{key:[oe,gI],value:[]},validate:e=>{const t=e,n="set",r=[];return t.variables.forEach(o=>{const i=se({name:"key",nodeType:n,value:o.key}),s=se({name:"value",nodeType:n,value:o.value});i&&s||r.push(`variable_${o.id}`)}),r},validateField:(e,t)=>se({name:e,nodeType:"set",value:t})},unset:{fieldValidators:{},validate:e=>e.variables.length>0?[]:["variables"],validateField:(e,t)=>se({name:e,nodeType:"unset",value:t})}},Tt=e=>{const t=Uo==null?void 0:Uo[e];return{validate:t==null?void 0:t.validate,validateField:t==null?void 0:t.validateField}},F0=(e,t)=>{var r;const n=(r=Uo[e])==null?void 0:r.validate;return n===void 0?[]:n(t)},EI=(e,t)=>{var n;return!e||!t?!1:((n=F0(e,t))==null?void 0:n.length)===0},se=({name:e,nodeType:t,value:n})=>{var i,s;let r=!0;const o=(s=(i=Uo[t])==null?void 0:i.fieldValidators)==null?void 0:s[e];return o==null||o.forEach(l=>{typeof l=="function"?r=r&&l(n):r=r&&l.test(n,l.testValue)}),r},us=({nodeData:e,nodeType:t})=>{var o;const n=((o=Uo[t])==null?void 0:o.fieldValidators)??{},r=[];return Object.keys(n).forEach(i=>{const s=i;se({name:i,nodeType:t,value:(e==null?void 0:e[s])??""})||r.push(i)}),r},V0=(e,t)=>{const n=t,r=[];return n.options.forEach(o=>{se({name:"value",nodeType:e,value:o.value})||r.push(`condition_${o.id}`)}),r},nf=(e,t,n)=>{var o;const r=[];switch(t.type){case"single":(o=t.destinations[0])!=null&&o.trim().length||r.push("destinationSingle");break;case"serial":case"parallel":t.destinations.length||r.push("destinationList");break;default:r.push("callOrder")}return n&&(se({name:"sessionTimeout",nodeType:e,value:t.sessionTimeout})||r.push("sessionTimeout")),r},rf=(e,t)=>{const n=[];return se({name:"selected",nodeType:e,value:t==null?void 0:t.selected})||n.push("selected"),t.selected==="url"?se({name:"url",nodeType:e,value:t.url})||n.push("url"):t.selected==="text"&&(se({name:"text",nodeType:e,value:t.text})||n.push("text")),n},pt=({data:e,id:t})=>{const n=q(s=>s.partialUpdateNodeData),o=q(s=>s.getNodeType)(t),i=Sn(s=>s.isValueDuplicate);return R.useEffect(()=>{if(o){let s=EI(o,e);if(o==="recordCallStart"){const l=e;s=s&&!i(l.label,l.controlId)}s!==e.valid&&n(t,{valid:s})}},[e,t,o,n]),{valid:()=>e.valid,getInvalidFields:()=>!o||e.valid?[]:F0(o,e)}},SI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>(pt({id:e,data:t}),y(We,{id:e,isConnectable:r,nodeTitle:b(x.CONDITIONS),selected:o,showDelete:!n,valid:t.valid,children:k(rs,{children:[t.options.map((i,s)=>{const l=!!i.value;return y(_n,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:b(x.COND_NUMBER,{index:s+1})},i.id)}),y(_n,{color:"negative",id:t.fallback,isConnectable:r,optionText:b(x.ELSE)})]})})),_I=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return pt({id:n,data:e}),y(We,{id:n,isConnectable:r,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,valid:e.valid,children:k(rs,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,l)=>y(_n,{color:"positive",enabled:!!s.value,id:s.id,isConnectable:r,optionText:b(x.COND_NUMBER,{index:l+1})},s.id)),y(_n,{color:"negative",id:e.fallback,isConnectable:r,optionText:b(x.ELSE)}),y(_n,{color:"negative",id:e.error,isConnectable:r,optionText:b(x.FAILURE)})]})})},wI={success:x.SUCCESS,noAnswer:x.NO_ANSWER,busy:x.BUSY,decline:x.DECLINE,error:x.ERROR},RI={address:x.FORWARD_TO_ADDRESS,phone:x.FORWARD_TO_PHONE,resource:x.FORWARD_TO_RESOURCE},of=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>(pt({id:e,data:t}),k(We,{id:e,isConnectable:r,nodeTitle:b(RI[t.destinationType]),selected:o,showDelete:!n,valid:t.valid,children:[t.destinations.length>0?y("section",{className:"p-4 pt-2",children:y("ul",{className:"space-y-2",children:t.destinations.map((i,s)=>y("li",{className:"text-sm",children:i},`node-${i}-${s}`))})}):null,y(rs,{children:t.options.map(i=>y(_n,{id:i.id,optionText:b(wI[i.result]),color:dy(i.result),isConnectable:r},i.id))})]})),NI=({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>(pt({id:e,data:t}),y(We,{id:e,isConnectable:r,nodeTitle:b(x.GATHER_INPUT),selected:o,showDelete:!n,valid:t.valid,children:k(rs,{children:[t.options.map((i,s)=>{const l=!!(i.command||i.digit);return y(_n,{color:"positive",enabled:l,id:i.id,isConnectable:r,optionText:b(x.OPT_NUMBER,{index:s+1})},i.id)}),t.results.map(i=>y(_n,{color:"negative",id:i.id,isConnectable:r,optionText:i.result==="no_input"?b(x.NO_INPUT):b(x.UNKNOWN)},i.id))]})})),OI=({id:e,isConnectable:t,selected:n})=>y(We,{id:e,isConnectable:t,nodeTitle:b(x.HANDLE_CALL),selected:n,showDelete:!1,showValidation:!1,target:!1,children:y(en,{id:e,color:"positive",isConnectable:t})}),sf={busy:x.BUSY,decline:x.DECLINE,hangup:x.HANG_UP},xI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>(pt({id:n,data:e}),y(We,{id:n,isConnectable:r,nodeTitle:b(x.HANG_UP_CALL),selected:o,showDelete:!t,valid:e.valid,children:e.reason&&y("section",{className:"p-4 pt-2",children:y("p",{children:b(sf[e.reason])})})})),TI=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}},CI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{pt({id:n,data:e});let i=e.selected&&e[e.selected];return i&&e.selected==="url"&&(i=TI(i)||"Play Audio"),k(We,{id:n,isConnectable:r,nodeTitle:b(x.PLAY_AUDIO_TTS),selected:o,showDelete:!t,valid:e.valid,children:[i&&y("div",{className:"max-w-[300px] p-4 pt-0",children:e.selected==="url"?y("a",{className:"break-words text-primary underline line-clamp-3",href:e.url,target:"_blank",rel:"noopener noreferrer",children:i}):y("p",{className:"break-words line-clamp-3",children:i})}),y(en,{id:n,isConnectable:r})]})},bI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{const{label:i,valid:s}=e;return pt({id:n,data:e}),k(We,{id:n,isConnectable:r,nodeTitle:b(x.RECORD_CALL_START),selected:o,showDelete:!t,valid:s,children:[i&&s&&y("p",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:i}),y(en,{id:n,isConnectable:r,color:"positive"})]})},II=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var l;pt({id:n,data:e});const i=(l=Sn(a=>a.entries))==null?void 0:l.find(a=>a.controlId===e.controlId),s=i==null?void 0:i.label;return k(We,{id:n,isConnectable:r,nodeTitle:b(x.RECORD_CALL_STOP),selected:o,showDelete:!t,valid:e.valid,children:[s&&y("p",{className:"whitespace-nowrap px-4 pb-4 text-sm",children:s}),y(en,{id:n,color:"positive",isConnectable:r})]})},AI=({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>(pt({id:n,data:e}),y(We,{id:n,isConnectable:r,nodeTitle:b(x.VOICEMAIL_RECORDING),selected:o,showDelete:!t,valid:e.valid,children:y(en,{id:n,isConnectable:r,color:"positive"})})),LI={success:x.SUCCESS,failed:x.FAILED},DI={answer:sI,cond:SI,condRequest:_I,forwardAddress:of,forwardPhone:of,forwardResource:of,handleCall:OI,hangup:xI,play:CI,promptPlay:NI,record:AI,recordCallStart:bI,recordCallStop:II,request:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>{var i;return pt({id:n,data:e}),k(We,{id:n,isConnectable:r,nodeTitle:b(x.REQUEST),selected:o,showDelete:!t,valid:e.valid,children:[y("p",{className:"pl-4 pb-1 text-sm text-foreground/70",children:b(x.DEPRECATED)}),y(rs,{children:(i=e==null?void 0:e.options)==null?void 0:i.map(s=>y(_n,{id:s.id,optionText:b(LI[s.result]),color:dy(s.result),isConnectable:r},s.id))})]})},sendSms:({data:e,dragging:t,id:n,isConnectable:r,selected:o})=>(pt({id:n,data:e}),k(We,{id:n,isConnectable:r,nodeTitle:b(x.SEND_SMS),selected:o,showDelete:!t,valid:e.valid,children:[(e.body||e.toNumber||e.fromNumber)&&k("div",{className:"max-w-[300px] p-4 pt-0",children:[e.fromNumber&&k("p",{className:`whitespace-nowrap ${e.toNumber||e.body?"pb-2":""}`,children:[b(x.FROM),": ",e.fromNumber]}),e.toNumber&&k("p",{className:`whitespace-nowrap ${e.body?"pb-2":""}`,children:[b(x.TO),": ",e.toNumber]}),e.body&&y("p",{className:"break-words pt-1 line-clamp-3",children:e.body})]}),y(en,{id:n,isConnectable:r})]})),set:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>{const{getInvalidFields:i}=pt({id:e,data:t}),s=i().reduce((u,c)=>(c.startsWith("variable_")&&u.push(c.replace("variable_","")),u),[]),l=t.variables.reduce((u,c)=>{const d={...c,key:c.key.trim()};return!d.key||s.includes(d.id)?u:[...u,d]},[]),a=[];return l.forEach((u,c)=>{c!==l.findIndex(d=>d.key===u.key)&&a.push(u.key)}),k(We,{id:e,isConnectable:r,nodeTitle:b(x.SET_VARIABLES),selected:o,showDelete:!n,valid:t.valid,children:[l.length>0&&y("div",{className:"flow-root",children:y("div",{className:"inline-block p-4 pt-0 align-middle",children:k("table",{className:"w-80 table-fixed divide-y divide-foreground/10",children:[y("thead",{children:k("tr",{children:[y("th",{scope:"col",className:"py-3.5 text-left text-sm font-semibold",children:b(x.KEY)}),y("th",{scope:"col",className:"px-2 py-3.5 text-left text-sm font-semibold",children:b(x.VALUE)})]})}),y("tbody",{className:"divide-y divide-foreground/10 bg-background text-sm",children:l.map(u=>k("tr",{children:[y("td",{className:`overflow-hidden text-ellipsis whitespace-nowrap py-2 text-sm ${a.includes(u.key)?"text-negative":""}`,children:u.key}),y("td",{className:"overflow-hidden text-ellipsis whitespace-nowrap break-all px-2 py-2 text-sm",children:u.value})]},u.id))})]})})}),y(en,{id:e,isConnectable:r,color:"positive"})]})},unset:({id:e,data:t,dragging:n,isConnectable:r,selected:o})=>(pt({id:e,data:t}),y(We,{id:e,isConnectable:r,nodeTitle:b(x.UNSET_VARIABLES),selected:o,showDelete:!n,valid:t.valid,children:y(en,{id:e,isConnectable:r,color:"positive"})}))},kI={floating:AC},PI={duration:1e3,includeHiddenNodes:!0,padding:.3},MI=e=>({edges:e.edges,nodes:e.nodes,addNode:e.addNode,onConnect:e.onConnect,onConnectEnd:e.onConnectEnd,onConnectStart:e.onConnectStart,onEdgesChange:e.onEdgesChange,onEdgesDelete:e.onEdgesDelete,onEdgeUpdate:e.onEdgeUpdate,onEdgeUpdateEnd:e.onEdgeUpdateEnd,onEdgeUpdateStart:e.onEdgeUpdateStart,onInit:e.onInit,onNodeDragStart:e.onNodeDragStart,onNodeDragStop:e.onNodeDragStop,onNodesChange:e.onNodesChange,onNodesDelete:e.onNodesDelete,onSelectionChange:e.onSelectionChange}),UI=({children:e})=>{const t=R.useRef(null),{edges:n,nodes:r,addNode:o,onConnect:i,onConnectEnd:s,onConnectStart:l,onEdgesChange:a,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:E,onNodesDelete:h,onSelectionChange:g}=q(MI,Ge),S=R.useCallback(w=>{w.preventDefault(),w.target instanceof HTMLElement&&w.target.draggable&&(w.dataTransfer.dropEffect="move")},[]),_=R.useCallback(w=>{if(w.preventDefault(),!t.current)return ct().warn("reactFlowWrapper not available yet");const N=w.dataTransfer.getData(ly);if(!N)return ct().warn("nodeType not valid");const C=t.current.getBoundingClientRect();o({nodeType:N,x:w.clientX-C.left,y:w.clientY-C.top})},[o]);return y("div",{className:"bg-sw-white !h-auto w-full",ref:t,children:y(iy,{connectionLineComponent:CC,connectionMode:Wn.Strict,deleteKeyCode:"Shift+Backspace",defaultEdgeOptions:uy,edges:n,edgeTypes:kI,fitView:!0,fitViewOptions:PI,nodes:r,nodeTypes:DI,onConnect:i,onConnectEnd:s,onConnectStart:l,onDragOver:S,onDrop:_,onEdgesChange:a,onEdgesDelete:u,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:m,onNodeDragStop:v,onNodesChange:E,onNodesDelete:h,onSelectionChange:g,children:e})})},FI=1e3,VI=e=>q.setState({initializing:e}),BI=()=>{const e=q(i=>i.initializing),t=q(i=>i.flowInteractive),n=Ce(),r=Wx(),o=R.useCallback(i=>{n.setState({nodesDraggable:i,nodesConnectable:i,elementsSelectable:i})},[n]);R.useEffect(()=>{let i;e&&(r?(i&&clearTimeout(i),i=setTimeout(()=>{o(!0),VI(!1)},FI)):o(!1))},[e,r,o]),R.useEffect(()=>{e||o(t)},[e,t,o])},B0=e=>{const[t,n]=R.useReducer((r,o)=>({...r,...o}),e);return[t,n]},$I={deploy:x.STATUS_DEPLOY,deployed:x.STATUS_DEPLOYED,deploying:x.STATUS_DEPLOYING,error:x.STATUS_DEPLOY_ERROR},zI=e=>({deployFlowURL:e.deployFlowURL,httpError:e.httpError,saveFlowStatus:e.saveFlowStatus,documentVersion:e.documentVersion,deployFlow:e.deployFlow,deployFlowStatus:e.deployFlowStatus}),HI=()=>{const{httpError:e,saveFlowStatus:t,documentVersion:n,deployFlow:r,deployFlowURL:o,deployFlowStatus:i}=q(zI,Ge),s={error:void 0,prevDocVersion:n},[l,a]=B0(s),u=$I[i],c=async()=>{try{a({error:void 0}),await r()}catch(v){v instanceof Error?a({error:v.message}):a({error:"Failed to deploy!"})}};R.useEffect(()=>{t==="saved"&&n!==l.prevDocVersion&&a({prevDocVersion:n})},[l.prevDocVersion,n,t,a]);const d=!!e||t!=="saved"||i==="deployed"||i==="deploying",f=d?"text-disabled hover:bg-background hover:text-disabled":"",p=i==="deployed"?"text-positive":"",m=i==="error"?"text-negative":"";return o?k(Ao,{className:`hidden sm:flex ${f} ${p} ${m}`,disabled:d,onClick:c,children:[b(u),y(Tr,{placement:"right",trigger:y("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:i==="error"?k(Ee,{children:[y("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY_ERROR)}),y(Be,{tag:"circle-exclamation"})]}):k(Ee,{children:[y("span",{className:"sr-only",children:b(x.MORE_INFO_DEPLOY)}),y(Be,{tag:"up-from-bracket"})]})}),children:i==="error"?b(x.MORE_INFO_DEPLOY_ERROR,{message:l.error}):b(x.MORE_INFO_DEPLOY)})]}):null},jI="react-flow__controls-button",GI="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",YI="hidden sm:flex",$0=R.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const l=t,u=`${jI} ${l==="button"?"":GI} ${o?YI:""} ${r}`;return y(l,{className:u,ref:s,...i,children:n})}),WI=()=>{const[e,t]=R.useState(!1);return y(Tr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:k($0,{asTag:"button",onClick:()=>{t(r=>!r)},children:["Help",k("div",{className:"flex items-center justify-center pl-1",children:[y("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),y(Be,{tag:"circle-info"})]})]}),children:k("section",{className:"p-2",children:[y("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),k("div",{className:"text-sm",children:[y("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),k("ol",{className:"my-4 list-inside list-decimal",children:[k("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing: ",y("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),k("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls: ",y("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),y("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),y("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),y("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},KI={"awaiting-save":x.STATUS_SAVING,"document-sync":x.STATUS_LOCKED,error:x.STATUS_ERROR,initial:x.STATUS_LOADING,saved:x.STATUS_SAVED,saving:x.STATUS_SAVING},z0=e=>(e.preventDefault(),e.returnValue=""),QI=()=>{const e=q(i=>i.saveFlowStatus),t=q(i=>i.httpError),r=KI[t==="document-sync"?t:e],o=e==="error"||t;return R.useEffect(()=>{if(!(e==="saved"||t))return addEventListener("beforeunload",z0,{capture:!0}),()=>{removeEventListener("beforeunload",z0,{capture:!0})}},[t,e]),k($0,{"aria-live":o?"assertive":"polite",className:`${o?"text-negative":"text-foreground"}`,hiddenSmallScreen:!0,role:o?"alert":"status",children:[y("p",{children:b(r)}),o&&y(Tr,{placement:"bottom",trigger:k("div",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:[y("span",{className:"sr-only",children:b(x.MORE_INFO_STATUS_ERROR)}),y(Be,{tag:"circle-exclamation"})]}),children:b(t==="document-sync"?x.INFO_STATUS_ERROR_OUT_OF_SYNC:x.INFO_STATUS_ERROR)})]})},XI=()=>{BI();const e=q(i=>i.isDraggingNode),t=q(i=>i.rootAppWidth),n=q(i=>i.httpError),o=!!!(t&&t<ay)&&n!=="document-sync";return k(eT,{className:e?"group/control-buttons":"",position:"top-left",showInteractive:o,children:[y(QI,{}),y(HI,{}),y(WI,{})]})},qI=e=>{var i;const t=R.useRef(),n=jx(),r=e&&"options"in e.data?(i=e.data.options)==null?void 0:i.length:0;return t.current=r,{updateDynamicHandles:s=>{"options"in s&&s.options.length!==t.current&&(e&&n(e.id),t.current=s.options.length)}}},ZI=()=>({id:_e(),value:""}),H0=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("cond"),[r,o]=R.useState({options:e.options.map(c=>({id:!0,initial:e.initial,value:n("value",c.value)}))}),i=c=>{c.preventDefault(),o({...r,options:[...r.options,{initial:!0,value:!0}]}),t({options:[...e.options,ZI()]})},s=(c,d)=>{c.preventDefault();const f=[...r.options];f.splice(d,1),o({...r,options:f});const p=[...e.options];p.splice(d,1),t({options:p})},l=(c,d)=>{const f=[...e.options];if(!f[c])throw new Error(`Option not found at index ${c}`);const{name:p,value:m}=d,v=[...r.options];v[c]={...v[c],initial:!1,[p]:n(p,m)},o({...r,options:v}),f[c]={...f[c],[p]:m},t({options:f})},a=(c,d)=>{const f=c.target,{name:p,value:m}=f;switch(t({initial:!1}),p){case"value":d!==void 0&&l(d,{name:p,value:m});break;default:ct().error(`Unhandled input name: ${p}`)}},u=({index:c,name:d})=>{const f=r.options[c];return(f==null?void 0:f[d])||(f==null?void 0:f.initial)};return y("ol",{className:"divide-y divide-foreground/10",children:e.options.map((c,d,f)=>k("li",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[y("h2",{className:"nowrap flex-1 py-4 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.CONDITION_NUMBER,{index:d+1})}),f.length>1&&y(Tr,{trigger:k("button",{className:"px-2",onClick:p=>s(p,d),type:"button",children:[y("span",{className:"sr-only",children:b(x.REMOVE_CONDITION,{index:d+1})}),y(Be,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[y("span",{className:"sr-only",children:b(x.CONDITION_NUMBER,{index:d})}),y("input",{className:`w-full ${u({index:d,name:"value"})?"":"invalid"}`,name:"value",onChange:p=>a(p,d),placeholder:"%{count} > 3, /hello/.test('%{foo}')",type:"text",value:c.value}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),d===f.length-1&&k("button",{onClick:i,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_CONDITION)]})]},c.id))})},JI=ct(),cs=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),eA={idsByKey:{},voiceById:{},languageById:{}},tA=(e,t)=>({...eA,init:async({voicesURL:n="/voices.json"})=>{try{JI.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},l={};o.forEach(a=>{var E,h,g;const u=!!a.premium,c=a.signalwire_id,d=a.gender.toLowerCase(),f={id:c,key:`${a.language_code}-${d}-${a.signalwire_id}`,name:`${a.friendly_name} ${u?"(premium)":""}`,gender:d,premium:u};i[c]=f,s[a.language_code]={id:a.language_code,name:a.language};const p=cs(a.language_code);p in l||(l[p]=[]),(E=l[p])==null||E.push(f);const m=cs(d);m in l||(l[m]=[]),(h=l[m])==null||h.push(f);const v=cs(a.language_code,d);v in l||(l[v]=[]),(g=l[v])==null||g.push(f)}),e({idsByKey:l,voiceById:i,languageById:s})}catch(r){console.error("Error",r)}},getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=cs(n,r);return s?i[s]??[]:Object.values(o)},getLanguages:()=>Object.values(t().languageById),getGenderByKeys:({languageId:n})=>{var s;const{idsByKey:r}=t(),o=cs(n);if(!o)return["female","male"];const i=new Set;return(s=r[o])==null||s.forEach(l=>{l.gender&&i.add(l.gender)}),Array.from(i).sort((l,a)=>l.toLowerCase().localeCompare(a.toLowerCase()))}}),lf=Pl()(tA);window.__useVoiceStore=lf;const j0=e=>y("option",{value:e.id,children:e.name},e.key??e.id),nA=e=>({getLanguages:e.getLanguages,getVoicesByKeys:e.getVoicesByKeys,getGenderByKeys:e.getGenderByKeys}),rA=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=lf(nA);return k(Ee,{children:[k("label",{children:[b(x.LANGUAGE),k(Bt,{className:"w-full",value:t??"",name:"language",onChange:e,children:[y("option",{value:"",children:b(x.SELECT)}),o().map(j0)]})]}),k("label",{children:[b(x.GENDER),k(Bt,{className:"w-full",value:n??"",name:"gender",onChange:e,children:[y("option",{value:"",children:b(x.SELECT)}),s({languageId:t}).map(l=>y("option",{value:l,children:l},l))]})]}),k("label",{children:[b(x.VOICE),k(Bt,{className:"w-full",value:r??"",name:"voice",onChange:e,children:[y("option",{value:"",children:b(x.SELECT)}),i({languageId:t,gender:n}).map(j0)]})]})]})},G0={url:x.PLAY_AUDIO_FILE,text:x.TEXT_TO_SPEECH},Y0=({handleOnUpdate:e,label:t,nodeData:n,showDefaultOption:r})=>{const{validateField:o}=Tt("play"),[i,s]=R.useState({gender:!0,language:!0,selected:n.initial||o("selected",n.selected),url:n.initial||o("url",n.url),voice:!0,text:n.initial||o("text",n.text)}),l=n.selected;R.useEffect(()=>{!l&&!r&&e({selected:"url"})},[e,l,r]);const a=c=>{const d=c.target,{name:f,value:p}=d;switch(f){case"selected":case"text":case"url":s({...i,[f]:o(f,p)}),e({initial:!1,[f]:p});break;default:throw new Error(`Unhandled input name: ${f}`)}},u=c=>{const d=c.target,{name:f,value:p}=d;switch(f){case"language":e({language:p,gender:void 0,voice:void 0});break;case"gender":e({gender:p,voice:void 0});break;default:e({[f]:p})}};return k("div",{children:[k("label",{children:[y("span",{className:"sr-only",children:t}),k(Bt,{className:`w-full ${i.selected?"":"invalid"}`,name:"selected",onChange:a,value:l,children:[r&&y("option",{value:"",children:b(x.SELECT)}),Object.keys(G0).map(c=>y("option",{value:c,children:b(G0[c])},c))]})]}),l&&y(oA,{nodeData:n,onChange:a,playSettingsChangeHandler:u,selected:l,valid:i[l]})]})},oA=({nodeData:e,onChange:t,playSettingsChangeHandler:n,selected:r,valid:o})=>{const i=e[r],l={url:y(Rr,{errorText:b(x.ERROR_URL_IS_REQUIRED),inputMode:"url",label:b(x.PLAY_AUDIO_FILE),name:r,onChange:t,placeholder:b(x.ENTER_URL),valid:o,value:i}),text:k(Ee,{children:[y(rA,{onChange:n,languageId:e.language,gender:e.gender,voiceId:e.voice}),y(Rr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:b(x.TEXT_TO_SPEECH),name:r,onChange:t,placeholder:b(x.WRITE_SOMETHING),valid:o,value:i})]})}[r];return y(Ee,{children:l})},iA=[{field:"stereo",title:x.STEREO,subtitle:x.STEREO_SUBTITLE},{field:"beep",title:x.BEEP,subtitle:x.BEEP_SUBTITLE}],W0=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=Tt("record"),[r,o]=R.useState({beep:!0,format:!0,stereo:!0,terminators:t.initial||n("terminators",t.terminators)});t.format||e({format:"mp3"});const i=l=>{const a=l.target.name;e({[a]:!t[a]})},s=l=>{const a=l.target,{name:u,value:c}=a;switch(u){case"format":case"terminators":o({...r,[u]:n(u,c)}),e({initial:!1,[u]:c});break;default:throw new Error(`Unhandled input name: ${u}`)}};return k(Ee,{children:[y("div",{className:"mb-5",children:iA.map(l=>{const a=t[l.field];return y("div",{children:y(Ld,{checked:a,clickHandler:i,name:l.field,subtitle:b(l.subtitle),title:b(l.title)})},l.field)})}),k("label",{children:[b(x.TERMINATORS),y("input",{className:`w-full ${r.terminators?"":"invalid"}`,name:"terminators",onChange:s,placeholder:"#*0",type:"text",value:t.terminators}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_TERMINATORS)})]}),k("label",{children:[b(x.FORMAT),k(Bt,{className:"w-full",name:"format",onChange:s,value:t.format,children:[y("option",{value:"mp3",children:"MP3"}),y("option",{value:"wav",children:"WAV"})]})]})]})},ht=({children:e,formRef:t,info:n,handleOnChange:r=()=>null,title:o})=>y("form",{className:"flex h-full flex-col overflow-hidden",noValidate:!0,onChange:r,ref:t,children:k("div",{className:"flex flex-col overflow-hidden",children:[k("legend",{className:"mb-2 flex w-full shrink-0 items-center justify-between px-4",children:[y("span",{className:"text-lg font-semibold leading-6",children:o}),n&&y(Tr,{trigger:k("div",{role:"tooltip",tabIndex:0,children:[y("span",{className:"sr-only",children:b(x.MORE_INFO_TITLE,{title:o})}),y(Be,{tag:"circle-info"})]}),children:n})]}),y("div",{className:"mx-1 flex-1 overflow-y-auto px-3",children:e})]})}),sA=["GET","POST","PUT","DELETE"],lA=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("condRequest"),[r,o]=R.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=a=>{const u=a.target,{name:c,value:d}=u;switch(t({initial:!1}),c){case"url":case"method":o({...r,[c]:n(c,d)}),t({[c]:d});break;case"headers":o({...r,[c]:n(c,d)}),t({[c]:d});break;case"body":o({...r,[c]:n(c,d)}),t({[c]:d});break;default:throw new Error(`Unhandled input name: ${c}`)}},s=a=>{const{name:u,value:c}=a.target;t({[u]:c})},l=a=>{const{name:u}=a.target,c=!e[u];t({[u]:c})};return k(ht,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[k("label",{children:[y("div",{children:b(x.URL)}),y("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",type:"text",value:e.url}),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),y(Bt,{className:"w-full",name:"method",onChange:s,value:e.method,children:sA.map(a=>y("option",{value:a,children:a},a))})]}),y("div",{className:"mb-4",children:y(Ld,{checked:e.saveVariables,clickHandler:l,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[y("div",{children:b(x.REQUEST_HEADERS)}),y(Rr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})]}),k("label",{children:[y("div",{children:b(x.REQUEST_BODY)}),y(Rr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",valid:r.body,value:e.body??""})]}),y(H0,{nodeData:e,handleOnUpdate:t})]})},aA=({nodeData:e,handleOnUpdate:t})=>{const n=R.useRef();return y(ht,{formRef:n,info:b(x.INFO_NODE_COND),title:b(x.CONDITIONS),children:y(H0,{nodeData:e,handleOnUpdate:t})})},uA={forwardAddress:{info:x.INFO_NODE_FORWARD_TO_ADDRESS,title:x.FORWARD_TO_ADDRESS,call:x.CALL_ADDRESSES,single:x.SINGLE_ADDRESS,multiple:x.MULTIPLE_ADDRESSES},forwardPhone:{info:x.INFO_NODE_FORWARD_TO_PHONE,title:x.FORWARD_TO_PHONE,call:x.CALL_NUMBERS,single:x.SINGLE_NUMBER,multiple:x.MULTIPLE_NUMBERS},forwardResource:{info:x.INFO_NODE_FORWARD_TO_RESOURCE,title:x.FORWARD_TO_RESOURCE,call:x.CALL_RESOURCES,single:x.SINGLE_RESOURCE,multiple:x.MULTIPLE_RESOURCES}},K0={serial:x.SEQUENTIALLY,parallel:x.SIMULTANEOUSLY},af=({nodeType:e,nodeData:t,handleOnUpdate:n})=>{var g;const{validateField:r}=Tt(e),o=R.useRef(),[i,s]=R.useState(((g=t.destinations)==null?void 0:g[0])??""),[l,a]=R.useState(uT(t.destinations)),[u,c]=R.useState(["serial","parallel"].includes(t.type)?t.type:"serial"),d=uA[e],f={single:d.single,multiple:d.multiple},[p,m]=R.useState({destinationList:t.initial||r("destinationSingle",i),destinationSingle:t.initial||r("destinationList",l),sessionTimeout:t.initial||r("sessionTimeout",t.sessionTimeout)}),v=S=>{const _=S.currentTarget.value;let w="single",N=i.trim()?[i.trim()]:[];_==="multiple"&&(w=u,N=cy(l)),n({destinations:N,type:w})},E=S=>{const _=S.currentTarget.value;c(_),n({type:_})},h=S=>{const _=S.target,{name:w,value:N}=_;switch(w){case"destinationSingle":m({...p,[w]:r(w,N)}),s(N),n({initial:!1,destinations:[N]});break;case"destinationList":m({...p,[w]:r(w,N)}),a(N),n({initial:!1,destinations:cy(N)});break;case"sessionTimeout":m({...p,[w]:r(w,N)}),n({initial:!1,sessionTimeout:N});break;default:throw new Error(`Unhandled input name: ${w}`)}};return k(ht,{info:b(d.info),title:b(d.title),formRef:o,children:[y("div",{className:"mb-1",children:k("label",{children:[y("span",{className:"sr-only",children:b(x.CHOOSE_OPTION_SINGLE_MULTIPLE)}),y(Bt,{className:"w-full",name:"quantity",onChange:v,value:t.type==="single"?"single":"multiple",children:Object.keys(f).map(S=>y("option",{value:S,children:b(f[S])},S))})]})}),y("div",{children:t.type==="single"?y(cA,{destination:i,fieldValid:p,handleChange:h,labels:d,nodeType:e}):y(dA,{callOrder:u,destinationList:l,fieldValid:p,handleCallOrderSelectChange:E,handleChange:h,labels:d,nodeType:e})}),e!=="forwardPhone"&&k("label",{children:[y("div",{children:b(x.DISCONNECT_CALL_AFTER_RINGING)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[y("input",{className:`w-14 ${p.sessionTimeout?"":"invalid"}`,inputMode:"numeric",min:0,name:"sessionTimeout",onChange:h,type:"number",value:t.sessionTimeout}),b(x.SECONDS),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_IS_REQUIRED)})]})]})]})},cA=({destination:e,fieldValid:t,handleChange:n,labels:r,nodeType:o})=>k(Ee,{children:[k("label",{children:[y("span",{className:"sr-only",children:b(r.single)}),y("input",{className:`w-full ${t.destinationSingle?"":"invalid"}`,name:"destinationSingle",onChange:n,placeholder:"+1 (204) 000 0000",required:!0,type:o==="forwardPhone"?"tel":"text",value:e}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),o!=="forwardPhone"&&y("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)})]}),dA=({callOrder:e,destinationList:t,fieldValid:n,handleCallOrderSelectChange:r,handleChange:o,labels:i,nodeType:s})=>k(Ee,{children:[k("label",{children:[y("span",{className:"sr-only",children:b(i.multiple)}),y("textarea",{className:`min-h-[77px] w-full ${n.destinationList?"":"invalid"}`,name:"destinationList",onChange:o,placeholder:"+1 (204) 123 0000, +1 (204) 456 0000, +1 (204) 789 0000",required:!0,value:t}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),y("div",{className:"mb-4 pt-4 text-xs uppercase",children:b(x.SETTINGS)}),y("div",{className:`${s==="forwardPhone"?"":"mb-4"}`,children:k("label",{children:[b(i.call),y(Bt,{className:"w-full",name:"callOrder",onChange:r,value:e,children:Object.keys(K0).map(l=>y("option",{value:l,children:b(K0[l])},l))})]})})]}),fA=()=>({id:_e(),command:"",digit:""}),pA=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("promptPlay"),r=R.useRef(),[o,i]=R.useState({initialTimeout:e.initial||n("initialTimeout",e.initialTimeout),options:e.options.map(d=>({initial:e.initial,command:n("command",d.command),digit:n("digit",d.digit)}))}),s=d=>{d.preventDefault(),i({...o,options:[...o.options,{initial:!0,command:!0,digit:!0}]}),t({options:[...e.options,fA()]})},l=(d,f)=>{d.preventDefault();const p=[...o.options];p.splice(f,1),i({...o,options:p});const m=[...e.options];m.splice(f,1),t({options:m})},a=(d,f)=>{const p=[...e.options];if(!p[d])throw new Error(`Option not found at index ${d}`);const{name:m,value:v}=f,E=[...o.options];E[d]={...E[d],initial:!1,[m]:n(m,v)},i({...o,options:E}),p[d]={...p[d],[m]:v},t({options:p})},u=(d,f)=>{const p=d.target,{name:m,value:v}=p;switch(t({initial:!1}),m){case"digit":case"command":f!==void 0&&a(f,{name:m,value:v});break;case"initialTimeout":{i({...o,[m]:n(m,v)}),t({[m]:v});break}default:throw new Error(`Unhandled input name: ${m}`)}},c=({index:d,name:f})=>{var v;const p=o.options[d];if(p!=null&&p.initial)return!0;if(!(p!=null&&p[f]))return!1;const m=(v=e.options)==null?void 0:v[d];return Nt(m==null?void 0:m.digit)||Nt(m==null?void 0:m.command)};return y(ht,{formRef:r,info:b(x.INFO_NODE_GATHER_INPUT),title:b(x.GATHER_INPUT),children:k("div",{className:"divide-y divide-foreground/10",children:[y("div",{className:"mb-2",children:y(Y0,{handleOnUpdate:t,label:b(x.CHOOSE_OPTION_TTS_AUDIO),nodeData:e})}),y("ul",{children:e.options.map((d,f,p)=>k("li",{className:"mb-3",children:[k("div",{className:"flex items-center",children:[y("h2",{className:"nowrap flex-1 pt-3 pb-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.OPTION_NUMBER,{index:f+1})}),p.length>1&&y(Tr,{trigger:k("button",{className:"px-2",onClick:m=>l(m,f),type:"button",children:[y("span",{className:"sr-only",children:b(x.REMOVE_OPTION,{index:f+1})}),y(Be,{tag:"xmark"})]}),children:b(x.INFO_NODE_OPTION_REMOVE)})]}),k("label",{className:"flex flex-col",children:[b(x.CALLER_PRESSES),y("input",{className:`w-1/4 ${c({index:f,name:"digit"})?"":"invalid"}`,name:"digit",onChange:m=>u(m,f),type:"text",value:d.digit}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_TELEPHONE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.OR_SAYS),y("input",{className:`w-full ${c({index:f,name:"command"})?"":"invalid"}`,name:"command",onChange:m=>u(m,f),type:"text",value:d.command}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),f===p.length-1&&k("button",{className:"mb-3 text-primary",onClick:s,type:"button",children:["+ ",b(x.ADD_OPTION)]})]},d.id))}),k("div",{className:"pt-6",children:[y("h2",{className:"pb-6 text-sm uppercase leading-4 text-foreground/50",children:b(x.SETTINGS)}),k("label",{children:[y("div",{className:"w-full",children:b(x.WAIT_FOR_INPUT)}),k("div",{className:"flex flex-wrap items-center gap-x-2",children:[y("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:Po.MIN,max:Po.MAX,name:"initialTimeout",onChange:u,type:"number",value:e.initialTimeout}),b(x.SECONDS),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Po.MAX,min:Po.MIN})})]})]})]})]})})},hA=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=Tt("play"),[r,o]=R.useState({reason:t.initial||n("reason",t.reason)}),i=s=>{const l=s.target,{name:a,value:u}=l;switch(a){case"reason":o({...r,[a]:n(a,u)}),e({initial:!1,[a]:u});break;default:throw new Error(`Unhandled input name: ${a}`)}};return y(ht,{info:b(x.INFO_NODE_HANG_UP),title:b(x.HANG_UP_CALL),children:k("label",{children:[k("p",{className:"mb-2 whitespace-nowrap",children:[b(x.REASON)," (",b(x.OPTIONAL),")"]}),k(Bt,{className:"w-full",name:"reason",onChange:i,value:t.reason,children:[y("option",{value:"",children:b(x.SELECT)}),Object.keys(sf).map(s=>y("option",{value:s,children:b(sf[s])},s))]})]})})},gA=({nodeData:e,handleOnUpdate:t})=>{const n=R.useRef();return y(ht,{formRef:n,info:b(x.INFO_NODE_PLAY),title:b(x.PLAY_AUDIO_TTS),children:y(Y0,{handleOnUpdate:t,label:b(x.CHOOSE_OPTION_TTS_AUDIO),nodeData:e,showDefaultOption:!0})})},mA=({nodeData:e,handleOnUpdate:t})=>{const n=R.useRef(),{validateField:r}=Tt("recordCallStart"),[o,i]=R.useState({label:e.initial||r("label",e.label)}),[s,l]=R.useState(!1),a=Sn(d=>d.upsertEntry),u=Sn(d=>d.isValueDuplicate);R.useEffect(()=>{l(u(e.label,e.controlId))},[u,e.controlId,e.label]);const c=d=>{const f=d.target,{name:p,value:m}=f;i({...o,[p]:r(p,m)}),t({initial:!1,[p]:m}),a({controlId:e.controlId,label:m})};return k(ht,{info:b(x.INFO_NODE_RECORD_CALL_START),title:b(x.RECORD_CALL_START),formRef:n,children:[k("label",{children:[b(x.RECORDING_NAME),y("input",{className:`w-full ${o.label&&!s?"":"invalid"}`,name:"label",onChange:c,type:"text",value:e.label}),y("p",{className:"requirements",role:"alert",children:b(s?x.ERROR_DUPLICATE_RECORDING_LABEL:x.ERROR_RECORDING_LABEL_REQUIRED)})]}),y(W0,{handleOnUpdate:t,nodeData:e})]})},vA=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("recordCallStop"),[r,o]=R.useState({controlId:e.initial||n("controlId",e.controlId)}),s=Sn(a=>a.getEntries)().sort((a,u)=>a.label.toLowerCase().localeCompare(u.label.toLowerCase())),l=a=>{const u=a.target,{name:c,value:d}=u;o({...r,[c]:n(c,d)}),t({initial:!1,[c]:d})};return y(ht,{info:b(x.INFO_NODE_RECORD_CALL_STOP),title:b(x.RECORD_CALL_STOP),children:s.length?k("label",{children:[y("p",{className:"mb-2 whitespace-nowrap",children:b(x.RECORDING_NAME)}),k(Bt,{className:`w-full ${r.controlId?"":"invalid"}`,name:"controlId",value:e.controlId,onChange:l,children:[y("option",{value:"",children:b(x.SELECT)}),s.map(a=>y("option",{value:a.controlId,children:a.label},a.controlId))]})]}):y("p",{role:"alert",className:"text-negative",children:b(x.ERROR_ADD_RECORDING_FIRST)})})},yA=({nodeData:e,handleOnUpdate:t})=>y(ht,{info:b(x.INFO_NODE_RECORD),title:b(x.VOICEMAIL_RECORDING),children:y(W0,{handleOnUpdate:t,nodeData:e})}),EA=["GET","POST","PUT","DELETE"],SA=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("request"),[r,o]=R.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=a=>{const u=a.target,{name:c,value:d}=u;switch(t({initial:!1}),c){case"url":case"method":o({...r,[c]:n(c,d)}),t({[c]:d});break;case"headers":o({...r,[c]:n(c,d)}),t({[c]:d});break;case"body":o({...r,[c]:n(c,d)}),t({[c]:d});break;default:throw new Error(`Unhandled input name: ${c}`)}},s=a=>{const{name:u,value:c}=a.target;t({[u]:c})},l=a=>{const{name:u}=a.target,c=!e[u];t({[u]:c})};return k(ht,{info:b(x.INFO_NODE_REQUEST),title:b(x.REQUEST),children:[k("label",{children:[y("div",{children:b(x.URL)}),y("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://user:password@example.com/api/status",type:"text",value:e.url}),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-3 block",children:[b(x.METHOD),y(Bt,{className:"w-full",name:"method",onChange:s,value:e.method,children:EA.map(a=>y("option",{value:a,children:a},a))})]}),y("div",{className:"mb-4",children:y(Ld,{checked:e.saveVariables,clickHandler:l,name:"saveVariables",subtitle:b(x.SAVE_VARIABLES_SUBTITLE),title:b(x.SAVE_VARIABLES)})}),k("label",{children:[y("div",{children:b(x.REQUEST_HEADERS)}),y(Rr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",label:b(x.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})]}),k("label",{children:[y("div",{children:b(x.REQUEST_BODY)}),y(Rr,{errorText:b(x.ERROR_INVALID_JSON),inputMode:"text",label:b(x.REQUEST_BODY),name:"body",onChange:i,placeholder:"String or JSON to serialize",valid:r.body,value:e.body??""})]})]})},_A=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=Tt("sendSms"),[r,o]=R.useState({body:e.initial||n("body",e.body),fromNumber:e.initial||n("fromNumber",e.fromNumber),toNumber:e.initial||n("toNumber",e.toNumber)}),i=s=>{const l=s.target,{name:a,value:u}=l;switch(a){case"body":case"fromNumber":case"toNumber":o({...r,[a]:n(a,u)}),t({initial:!1,[a]:u});break;default:throw new Error(`Unhandled input name: ${a}`)}};return k(ht,{info:b(x.INFO_NODE_SEND_SMS),title:b(x.SEND_SMS),children:[k("label",{className:"mb-1",children:[y("div",{children:b(x.FROM_PHONE_NUMBER)}),y("input",{className:`w-full ${r.fromNumber?"":"invalid"}`,name:"fromNumber",onChange:i,placeholder:"+1 (204) 000 0000",type:"tel",value:e.fromNumber}),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{className:"mb-1",children:[y("div",{children:b(x.TO_PHONE_NUMBER)}),y("input",{className:`w-full ${r.toNumber?"":"invalid"}`,value:e.toNumber,name:"toNumber",onChange:i,placeholder:"+1 (204) 000 0000",type:"tel"}),y("p",{className:"requirements w-full",role:"alert",children:b(x.ERROR_VALUE_IS_REQUIRED)})]}),k("label",{children:[y("div",{children:b(x.TEXT)}),y(Rr,{errorText:b(x.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:b(x.SMS_TEXT),name:"body",onChange:i,placeholder:b(x.WRITE_SOMETHING),valid:r.body,value:e.body})]})]})},wA=()=>({id:_e(),key:"",value:""}),RA=({nodeData:e,handleOnUpdate:t})=>{var f;const{validateField:n}=Tt("set"),[r,o]=R.useState({variables:e.variables.map(p=>({key:e.initial||n("key",p.key),value:e.initial||n("value",p.value)}))}),i=e.variables.filter((p,m,v)=>v.findIndex(E=>E.key.trim()===p.key.trim())!==m),s=p=>{p==null||p.preventDefault(),o({...r,variables:[...r.variables,{key:!0,value:!0}]}),t({variables:[...e.variables,wA()]})},l=(p,m)=>{const v=[...e.variables];let E=v[p];if(!E)throw new Error(`Variable not found at index ${p}`);const{name:h,value:g}=m,S=[...r.variables];S[p]={...S[p],[h]:n(h,g)},o({...r,variables:S}),E={...v[p],[h]:g},v[p]=E,t({variables:v})},a=(p,m)=>{p.preventDefault();const v=[...r.variables];v.splice(m,1),o({...r,variables:v});const E=[...e.variables];E.splice(m,1),t({variables:E})},u=(p,m)=>{const v=p.target,{name:E,value:h}=v;switch(E){case"key":case"value":m!==void 0&&l(m,{name:E,value:h});break;default:throw new Error(`Unhandled input name: ${E}`)}},c=({index:p,name:m})=>{const v=r.variables[p];return v==null?void 0:v[m]},d=p=>i.find(m=>m.key.trim()===p.trim());return y(ht,{info:b(x.INFO_NODE_SET_VARIABLES),title:b(x.SET_VARIABLES),children:y("ul",{className:"divide-y divide-foreground/10",children:(f=e.variables)==null?void 0:f.map((p,m,v)=>{const E=d(p.key);return k("li",{className:"mb-3",children:[k("div",{className:"flex flex-nowrap",children:[y("h3",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap py-6 text-sm font-medium uppercase leading-4 text-foreground/50",children:b(x.VARIABLE_KEY,{key:p.key})}),v.length>1&&y(Tr,{trigger:k("button",{className:"px-2",onClick:h=>a(h,m),type:"button",children:[y("span",{className:"sr-only",children:b(x.REMOVE_VARIABLE,{key:p.key})}),y(Be,{tag:"xmark"})]}),children:b(x.INFO_NODE_SET_VARIABLES_OPTION)})]}),k("label",{className:"flex flex-col",children:[b(x.KEY),y("input",{className:`w-full ${c({index:m,name:"key"})&&!E?"":"invalid"}`,name:"key",onChange:h=>u(h,m),type:"text",value:p.key}),y("p",{className:"requirements",role:"alert",children:b(E?x.ERROR_DUPLICATE_VARIABLE_KEY:x.ERROR_VARIABLE_KEY_REQUIRED)})]}),k("label",{className:"flex flex-col",children:[b(x.VALUE),y("input",{className:`w-full ${c({index:m,name:"value"})?"":"invalid"}`,name:"value",onChange:h=>u(h,m),type:"text",value:p.value}),y("p",{className:"requirements",role:"alert",children:b(x.ERROR_TEXT_IS_REQUIRED)})]}),m===v.length-1&&k("button",{onClick:s,type:"button",className:"mb-3 text-primary",children:["+ ",b(x.ADD_VARIABLE)]})]},p.id)})})})},NA=(e,t)=>{R.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var l;const s=i.target;s instanceof Node&&!((l=e.current)!=null&&l.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},OA=e=>({id:_e(),key:e}),xA=({nodeData:e,handleOnUpdate:t})=>{const i={currentFocus:void 0,listOpen:!1,setVariablesList:q(E=>E.nodes).reduce((E,h)=>{if(h.type==="set"){const g=h.data.variables.map(S=>({id:S.id,key:S.key}));return[...E,...g]}else if(h.type==="unset")return[...E,...h.data.variables];return E},[]).reduce((E,h)=>(E.find(g=>g.key===h.key)||E.push(h),E),[]).map(E=>({...E,selected:!!e.variables.find(h=>h.key===E.key)})).sort((E,h)=>E.key.toLowerCase().localeCompare(h.key.toLowerCase()))},[s,l]=B0(i),a=E=>s.setVariablesList.map(h=>h.id===E?{...h,selected:!h.selected}:h),u=E=>{const h=s.setVariablesList.find(g=>g.id===E);if(!h)throw new Error("Variable not found");if(h.selected)c(h.id);else{const g=[...e.variables,OA(h.key)];l({setVariablesList:a(h.id)}),t({variables:g})}},c=E=>{const h=s.setVariablesList.filter(g=>g.selected&&g.id!==E);l({setVariablesList:a(E)}),t({variables:h})},d=R.useRef(null);NA(d,()=>l({listOpen:!1}));const f=E=>{(E.key==="Escape"||E.key==="Esc")&&l({listOpen:!1})},p=(E,h)=>{E.preventDefault(),(E.key===" "||E.code==="Space"||E.key==="Enter")&&u(h),f(E)},m=()=>{l({listOpen:!s.listOpen})},v=e.variables.length;return k(ht,{info:b(x.INFO_NODE_UNSET_VARIABLES),title:b(x.UNSET_VARIABLES),children:[k("div",{className:"my-1 flex flex-col",children:[y("label",{id:"listbox-label",className:"sr-only",children:b(x.SELECT_VARIABLES_TO_UNSET)}),k("div",{className:"relative",ref:d,children:[y("button",{"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"listbox-label",className:`relative w-full cursor-pointer rounded-md border border-foreground/10 bg-transparent py-1.5 px-3 text-left shadow-sm
|
|
67
67
|
after:absolute after:right-3 after:top-3 after:h-[7px] after:w-[7px] after:rotate-45 after:border-r after:border-b after:border-foreground after:content-['']
|
|
68
|
-
focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:f,onKeyDown:c,type:"button",children:h>0?L(x.NUMBER_OF_VARIABLES_SELECTED,{count:h}):L(x.SELECT_VARIABLES)}),o.listOpen&&M("ul",{"aria-activedescendant":o.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!o.setVariablesList.length&&y("li",{"aria-disabled":"true",className:"relative",role:"option",children:y("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:L(x.NO_VARIABLES_SET)})}),o.setVariablesList.map((m,v)=>y("li",{"aria-selected":m.selected,className:"relative",id:m.id,role:"option",children:M("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[y("input",{checked:m.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>a(v),onKeyDown:E=>d(E,v),type:"checkbox"}),m.key]})},m.id))]})]})]}),h>0&&M("section",{className:"pt-3",children:[y("h3",{className:"mb-2 leading-5 text-foreground",children:L(x.UNSET_VARIABLES)}),y("ul",{className:"flex flex-wrap gap-2",children:o.unsetVariables.map((m,v)=>y(PC,{handleClick:()=>l(v),children:m.key},m.id))})]})]})},dA=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":return!0}return!1},fA=()=>{const e=q(c=>c.selectedNode),t=q(c=>c.partialUpdateNodeData),n=e==null?void 0:e.data,r=e==null?void 0:e.id,{updateDynamicHandles:o}=UI(e);if(!(e&&n&&r))return null;const i=c=>{const d=new FormData(c.currentTarget),f=Object.fromEntries(d.entries());t(r,{...f,missingRequiredParams:!U0(f)})},s=(c,d)=>{typeof d=="boolean"&&(c.missingRequiredParams=!d),dA(e,c)&&o(c),t(r,c)},a={cond:()=>y(GI,{nodeData:n,handleOnUpdate:s}),condRequest:()=>y(jI,{nodeData:n,handleOnUpdate:s}),forwardAddress:()=>y(af,{destinationType:"address",nodeData:n,handleOnUpdate:s}),forwardPhone:()=>y(af,{destinationType:"phone",nodeData:n,handleOnUpdate:s}),forwardResource:()=>y(af,{destinationType:"resource",nodeData:n,handleOnUpdate:s}),hangup:()=>y(qI,{nodeData:n,handleOnChange:i}),play:()=>y(ZI,{nodeData:n,handleOnUpdate:s}),promptPlay:()=>y(XI,{nodeData:n,handleOnUpdate:s}),set:()=>y(sA,{nodeData:n,handleOnUpdate:s}),unset:()=>y(cA,{nodeData:n,handleOnUpdate:s}),record:()=>y(tA,{nodeData:n,handleOnUpdate:s}),recordCallStart:()=>y(JI,{nodeData:n,handleOnUpdate:s}),recordCallStop:()=>y(eA,{nodeData:n,handleOnChange:i}),sendSms:()=>y(iA,{nodeData:n,handleOnUpdate:s}),request:()=>y(oA,{nodeData:n,handleOnUpdate:s})};if(!(c=>Boolean(c in a))(e.type))return null;const u=a[e.type];return y(nd,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:y(u,{})})},pA=({asDialog:e=!1,open:t=!1}={})=>{const[n,r]=pt.useState(t);N.useEffect(()=>{r(t)},[t]);const o=N.useCallback(()=>r(!1),[]),i=N.useCallback(()=>r(!0),[]);return{asDialog:e,isOpen:n,closeContainer:o,openContainer:i}},G0=N.createContext(null),uf=()=>{const e=N.useContext(G0);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},hA=({children:e,...t})=>{const n=pA(t);return y(G0.Provider,{value:n,children:e})},gA=({title:e,children:t})=>{const{asDialog:n}=uf();return M("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:n?"dialog":"alert",children:[M("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[y("span",{className:"mr-2",children:y(Fe,{tag:"circle-exclamation"})}),e]}),y("div",{className:"mt-2 text-sm leading-5",children:t})]})},mA=({children:e})=>{const{asDialog:t,closeContainer:n,isOpen:r}=uf(),o=N.useRef(null);return N.useEffect(()=>{if(!o.current)return;let i,s;const a=l=>{var u,c;if(l.key==="Escape"&&n(),l.key==="Tab"){const d=(c=(u=document.activeElement)==null?void 0:u.shadowRoot)==null?void 0:c.activeElement;l.shiftKey?d===i&&(s==null||s.focus(),l.preventDefault()):d===s&&(i==null||i.focus(),l.preventDefault())}};if(t){const l=o.current.querySelectorAll("button");i=l[0],s=l[l.length-1],s==null||s.focus(),document.addEventListener("keydown",a)}return()=>{document.removeEventListener("keydown",a)}},[t,n]),r?y("section",{className:`flex w-full justify-center px-6 ${t?"fixed top-0 z-50 h-full items-start py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 z-10 translate-y-1/2 items-center"}`,ref:t?o:void 0,children:e}):null},vA=({asDialog:e=!1,open:t,children:n})=>y(hA,{asDialog:e,open:t,children:y(mA,{children:n})}),yA=()=>{const t=q(n=>n.httpError)==="document-sync";return t?y(vA,{asDialog:!0,open:t,children:y(gA,{title:L(x.DOCUMENT_OUT_OF_SYNC),children:y(EA,{})})}):null},EA=()=>{const{closeContainer:e}=uf(),t=()=>{window.location.reload()};return M(Ee,{children:[y("p",{children:L(x.TOAST_DOCUMENT_OUT_OF_SYNC)}),M("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[y("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:L(x.IGNORE)}),y("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:L(x.RESYNC)})]})]})},{apiVersion:SA,builderVersion:_A,cfbAppVersion:wA,relayMLVersion:RA}=bd(),NA={[x.API_VERSION]:SA,[x.APP_VERSION]:wA,[x.BUILDER_VERSION]:_A,[x.RELAYML_VERSION]:RA},OA=()=>{const e=()=>{var r;((r=n.current)==null?void 0:r.open)===!1&&n.current.showModal()},t=()=>{var r;(r=n.current)!=null&&r.open&&n.current.close()},n=pt.useRef(null);return M("section",{className:"ml-4 mt-4",children:[y("menu",{children:y("button",{className:"text-xs text-foreground hover:underline",onClick:e,children:L(x.ABOUT)})}),y("dialog",{ref:n,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:M("div",{className:"h-full px-2 pb-10",children:[M("div",{className:"flex items-center justify-between",children:[y("h2",{className:"text-2xl leading-10",children:L(x.ABOUT)}),M("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[y("span",{className:"sr-only",children:L(x.CLOSE)}),y(Fe,{tag:"xmark",size:"lg"})]})]}),M("div",{className:"h-full overflow-y-auto",children:[y("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(NA).map(([r,o])=>y("li",{className:"text-foreground/70",children:M("p",{children:[L(r),": ",o]})},r))}),y("div",{className:"mt-6 flex items-center justify-center ",children:y("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:L(x.CLOSE)})})]})]})})]})},xA=()=>{const e=q(t=>t.backButtonHref);return e?M("a",{href:e,children:[y("span",{className:"sr-only",children:L(x.NAVIGATE_BACK)}),y(Fe,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},TA=()=>M("div",{className:"rounded-sm border border-gray-200 p-2",children:[y("h3",{className:"w-full",children:"Feature Flags"}),M("div",{className:"flex flex-col gap-y-2 py-2",children:[y(cf,{flagName:"showAllNodes"}),y(cf,{flagName:"showDevOptions"}),y(cf,{flagName:"showDeployButton"})]})]}),cf=({flagName:e})=>{const t=Zn(o=>o.toggleFlag),r=Zn(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return M("label",{className:"flex cursor-pointer items-center",children:[M("div",{className:"relative",children:[y("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),y("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:y("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),y("p",{className:"ml-3 text-sm font-medium",children:e})]})},W0={action:{label:x.ACTION,nodes:{answer:{active:!0,label:x.ANSWER_CALL},hangup:{active:!0,label:x.HANG_UP_CALL},sendSms:{active:!0,label:x.SEND_SMS},play:{active:!0,label:x.PLAY_AUDIO_TTS}}},decision:{label:x.DECISION,nodes:{cond:{active:!0,label:x.CONDITIONS},set:{active:!0,label:x.SET_VARIABLES},unset:{active:!0,label:x.UNSET_VARIABLES}}},forwardTo:{label:x.FORWARD,nodes:{forwardAddress:{active:!1,label:x.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:x.FORWARD_TO_PHONE},forwardResource:{active:!1,label:x.FORWARD_TO_RESOURCE}}},input:{label:x.INPUT,nodes:{promptPlay:{active:!0,label:x.GATHER_INPUT},request:{active:!0,deprecated:!0,label:x.REQUEST},condRequest:{active:!0,label:x.REQUEST}}},recording:{label:x.RECORD,nodes:{record:{active:!0,label:x.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:x.RECORD_CALL_START},recordCallStop:{active:!0,label:x.RECORD_CALL_STOP}}}},CA=(e,t)=>({label:L(W0[e].label),nodes:Object.entries(W0[e].nodes).map(([n,r])=>(r.active||t)&&{deprecated:Boolean(r.deprecated),title:L(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),bA=["action","forwardTo","recording","input","decision"],IA=()=>{const e=Zn(u=>u.showAllNodes),t=Zn(u=>u.showDevOptions),n=q(u=>u.addNode),r=q(u=>u.flowTitle),o=q(u=>u.exportStoreData),i=N.useRef(null),s=u=>{u.preventDefault(),i.current&&i.current.showModal()},a=N.useCallback(u=>{u.preventDefault();const{nodeType:c}=u.currentTarget.dataset;c&&n({nodeType:c})},[n]),l=N.useCallback(u=>{const{nodeType:c}=u.currentTarget.dataset;c&&(u.dataTransfer.setData(ey,c),u.dataTransfer.effectAllowed="move")},[]);return M(Ee,{children:[M("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background py-4 text-foreground sm:flex",children:[M("nav",{className:"mx-4 flex shrink-0 items-center justify-between",children:[y(xA,{}),t&&y("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),y("h1",{className:"m-4 block shrink-0 text-lg font-semibold leading-tight line-clamp-2",children:r}),y("ul",{className:"overflow-y-auto",id:"sidebar-node-list",children:bA.map(u=>y("li",{children:y(AA,{group:u,handleOnClick:a,handleDragStart:l,showAllNodes:e})},u))}),y(OA,{})]}),t&&y("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:y("form",{children:M("fieldset",{children:[M("legend",{className:"flex w-full justify-between pb-2",children:[y("h1",{className:"text-2xl leading-10",children:"Dev Options"}),M("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[y("span",{className:"sr-only",children:"Close"}),y(Fe,{tag:"xmark",size:"lg"})]})]}),M("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[y("h3",{className:"w-full",children:"Flow Data"}),y("div",{className:"flex flex-row gap-x-2 py-2",children:y("div",{className:"flex items-center",children:y("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),y(TA,{})]})})})]})},AA=({group:e,handleOnClick:t,handleDragStart:n,showAllNodes:r})=>{const o=CA(e,r),i=`ngm-heading-${nT(o.label)}`;return M(Ee,{children:[y("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:i,children:o.label}),y("ul",{"aria-labelledby":i,className:"flex-1 px-4 pb-2",children:o.nodes.map(s=>y("li",{children:M("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 p-3 text-center text-sm line-clamp-1 hover:shadow-md",onClick:t,onDragStart:n,"data-node-type":s.type,draggable:!0,children:[s.title,s.deprecated&&M("p",{className:"inline-block text-xs text-foreground/70",children:[" ",L(x.DEPRECATED)]})]})},s.type))})]})},LA=()=>{const e=N.useRef(null),[t,n]=N.useState(),[r,o]=N.useState(null);return N.useLayoutEffect(()=>(e.current=new ResizeObserver(([i])=>n(i)),r&&e.current.observe(r),()=>{var i;return(i=e.current)==null?void 0:i.disconnect()}),[r]),{setTarget:o,observerEntry:t}},DA=e=>{q.setState({flowInteractive:e})},kA=({rootAppHeight:e,rootAppWidth:t})=>{q.setState({rootAppHeight:e,rootAppWidth:t})},PA=()=>{const{observerEntry:e,setTarget:t}=LA(),n=q(o=>o.initializing),r=q(o=>o.rootAppWidth);return N.useEffect(()=>{!n&&r&&DA(r>=ty)},[n,r]),N.useEffect(()=>{e&&(qe().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),kA({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},Ok="";function MA(){qe().warn("Hello World!");const{rootTarget:e}=PA(),t=q(o=>o.colorMode)??"",n=q(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return y(Ee,{children:y("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?y(SC,{errorType:n}):M(Ee,{children:[y(IA,{}),y(yA,{}),M(vI,{children:[y(kI,{}),y(fA,{})]})]})})})}const UA=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
|
|
69
|
-
`,
|
|
68
|
+
focus:outline-none focus:ring-1 focus:ring-foreground`,onClick:m,onKeyDown:f,type:"button",children:v>0?b(x.NUMBER_OF_VARIABLES_SELECTED,{count:v}):b(x.SELECT_VARIABLES)}),s.listOpen&&k("ul",{"aria-activedescendant":s.currentFocus,"aria-labelledby":"listbox-label","aria-multiselectable":"true",className:"mt-1 max-h-60 w-full overflow-auto rounded-lg border border-foreground/10 bg-backgroundAlt py-1 shadow-xl",role:"listbox",children:[!s.setVariablesList.length&&y("li",{"aria-disabled":"true",className:"relative",role:"option",children:y("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:b(x.NO_VARIABLES_SET)})}),s.setVariablesList.map(E=>{if(E.key)return y("li",{"aria-selected":E.selected,className:"relative",id:E.id,role:"option",children:k("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[y("input",{checked:E.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>u(E.id),onKeyDown:h=>p(h,E.id),type:"checkbox"}),E.key]})},E.id)})]})]})]}),v>0&&k("section",{className:"pt-3",children:[y("h3",{className:"mb-2 leading-5 text-foreground",children:b(x.UNSET_VARIABLES)}),y("ul",{className:"flex flex-wrap gap-2",children:s.setVariablesList.map(E=>E.selected&&y(zC,{handleClick:()=>c(E.id),children:E.key},E.id))})]})]})},Q0={cond:({data:e,formUpdate:t})=>y(aA,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>y(lA,{handleOnUpdate:t,nodeData:e}),forwardAddress:({data:e,formUpdate:t})=>y(af,{handleOnUpdate:t,nodeData:e,nodeType:"forwardAddress"}),forwardPhone:({data:e,formUpdate:t})=>y(af,{handleOnUpdate:t,nodeData:e,nodeType:"forwardPhone"}),forwardResource:({data:e,formUpdate:t})=>y(af,{handleOnUpdate:t,nodeData:e,nodeType:"forwardResource"}),hangup:({data:e,formUpdate:t})=>y(hA,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>y(gA,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>y(pA,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>y(RA,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>y(xA,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>y(yA,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>y(mA,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>y(vA,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>y(SA,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>y(_A,{handleOnUpdate:t,nodeData:e})},TA=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},CA=e=>{if(e in Q0)return Q0[e]},bA=()=>{var a;const e=q(u=>u.partialUpdateNodeData),t=q(u=>u.selectedNode),n=t==null?void 0:t.id,o=(a=q(u=>u.nodes).find(u=>u.id===n))==null?void 0:a.data,{updateDynamicHandles:i}=qI(t);if(!(t&&o&&n))return null;const s=u=>{TA(t,u)&&i(u),e(n,u)},l=CA(t.type);return l?y(id,{className:"nokey flex max-h-[95%] w-[300px] flex-col overflow-hidden rounded-md border border-foreground/10 bg-background py-4",position:"top-right",children:y(l,{data:o,formUpdate:s},n)}):null},IA=({asDialog:e=!1,open:t=!1}={})=>{const[n,r]=mt.useState(t);R.useEffect(()=>{r(t)},[t]);const o=R.useCallback(()=>r(!1),[]),i=R.useCallback(()=>r(!0),[]);return{asDialog:e,isOpen:n,closeContainer:o,openContainer:i}},X0=R.createContext(null),uf=()=>{const e=R.useContext(X0);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},AA=({children:e,...t})=>{const n=IA(t);return y(X0.Provider,{value:n,children:e})},LA=({title:e,children:t})=>{const{asDialog:n}=uf();return k("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:n?"dialog":"alert",children:[k("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[y("span",{className:"mr-2",children:y(Be,{tag:"circle-exclamation"})}),e]}),y("div",{className:"mt-2 text-sm leading-5",children:t})]})},DA=({children:e})=>{const{asDialog:t,closeContainer:n,isOpen:r}=uf(),o=R.useRef(null);return R.useEffect(()=>{if(!o.current)return;let i,s;const l=a=>{var u,c;if(a.key==="Escape"&&n(),a.key==="Tab"){const d=(c=(u=document.activeElement)==null?void 0:u.shadowRoot)==null?void 0:c.activeElement;a.shiftKey?d===i&&(s==null||s.focus(),a.preventDefault()):d===s&&(i==null||i.focus(),a.preventDefault())}};if(t){const a=o.current.querySelectorAll("button");i=a[0],s=a[a.length-1],s==null||s.focus(),document.addEventListener("keydown",l)}return()=>{document.removeEventListener("keydown",l)}},[t,n]),r?y("section",{className:`flex w-full justify-center px-6 ${t?"fixed top-0 z-50 h-full items-start py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 z-10 translate-y-1/2 items-center"}`,ref:t?o:void 0,children:e}):null},kA=({asDialog:e=!1,open:t,children:n})=>y(AA,{asDialog:e,open:t,children:y(DA,{children:n})}),PA=()=>{const t=q(n=>n.httpError)==="document-sync";return t?y(kA,{asDialog:!0,open:t,children:y(LA,{title:b(x.DOCUMENT_OUT_OF_SYNC),children:y(MA,{})})}):null},MA=()=>{const{closeContainer:e}=uf(),t=()=>{window.location.reload()};return k(Ee,{children:[y("p",{children:b(x.TOAST_DOCUMENT_OUT_OF_SYNC)}),k("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[y("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:b(x.IGNORE)}),y("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:b(x.RESYNC)})]})]})};function q0(e){let t;try{t=e()}catch{return}return{getItem:r=>{var o;const i=l=>l===null?null:JSON.parse(l),s=(o=t.getItem(r))!=null?o:null;return s instanceof Promise?s.then(i):i(s)},setItem:(r,o)=>t.setItem(r,JSON.stringify(o)),removeItem:r=>t.removeItem(r)}}const ds=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return ds(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return ds(r)(n)}}}},UA=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,h)=>({...h,...E}),...t},s=!1;const l=new Set,a=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const c=ds(i.serialize),d=()=>{const E=i.partialize({...r()});let h;const g=c({state:E,version:i.version}).then(S=>u.setItem(i.name,S)).catch(S=>{h=S});if(h)throw h;return g},f=o.setState;o.setState=(E,h)=>{f(E,h),d()};const p=e((...E)=>{n(...E),d()},r,o);let m;const v=()=>{var E;if(!u)return;s=!1,l.forEach(g=>g(r()));const h=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return ds(u.getItem.bind(u))(i.name).then(g=>{if(g)return i.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==i.version){if(i.migrate)return i.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var S;return m=i.merge(g,(S=r())!=null?S:p),n(m,!0),d()}).then(()=>{h==null||h(m,void 0),s=!0,a.forEach(g=>g(m))}).catch(g=>{h==null||h(void 0,g)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(u=E.getStorage())},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:E=>(l.add(E),()=>{l.delete(E)}),onFinishHydration:E=>(a.add(E),()=>{a.delete(E)})},v(),m||p},FA=(e,t)=>(n,r,o)=>{let i={storage:q0(()=>localStorage),partialize:v=>v,version:0,merge:(v,E)=>({...E,...v}),...t},s=!1;const l=new Set,a=new Set;let u=i.storage;if(!u)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const c=()=>{const v=i.partialize({...r()});return u.setItem(i.name,{state:v,version:i.version})},d=o.setState;o.setState=(v,E)=>{d(v,E),c()};const f=e((...v)=>{n(...v),c()},r,o);let p;const m=()=>{var v;if(!u)return;s=!1,l.forEach(h=>h(r()));const E=((v=i.onRehydrateStorage)==null?void 0:v.call(i,r()))||void 0;return ds(u.getItem.bind(u))(i.name).then(h=>{if(h)if(typeof h.version=="number"&&h.version!==i.version){if(i.migrate)return i.migrate(h.state,h.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return h.state}).then(h=>{var g;return p=i.merge(h,(g=r())!=null?g:f),n(p,!0),c()}).then(()=>{E==null||E(p,void 0),s=!0,a.forEach(h=>h(p))}).catch(h=>{E==null||E(void 0,h)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(u=v.storage)},clearStorage:()=>{u==null||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:v=>(l.add(v),()=>{l.delete(v)}),onFinishHydration:v=>(a.add(v),()=>{a.delete(v)})},m(),p||f},VA=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_BASIC_AUTH:"78429ef1-283b-4fa9-8ebc-16b59f95bb1f:PT2d31b8e287dde883891cb987786603e6675141a30b7db9ad",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),UA(e,t)):FA(e,t)},Z0=window,J0={showAllNodes:!1,showDevOptions:!1},Cr=Pl()(VA(e=>({...J0,toggleFlag:t=>{e(n=>({...n,[t]:!n[t]}))}}),{name:"flags",storage:q0(()=>localStorage),version:0}));Cr.subscribe(e=>{console.log("feature flags changed",e)});const BA=e=>{const t=(r,o)=>{Cr.setState(i=>({...i,[r]:o}))},n=r=>{const o=Cr.getState(),i={...r};return Object.entries(o).forEach(([s,l])=>{s in i&&typeof l=="boolean"&&(i[s]=l)}),i};if(Z0){const r=new Proxy(n(e),{get:(o,i)=>Reflect.get(o,i),set:(o,i,s)=>{if(typeof s=="boolean"&&i in o)t(i,s);else throw new Error("unknown flag");return Reflect.set(o,i,s)}});Z0.swFlags=r}},$A=()=>BA(J0),{apiVersion:zA,builderVersion:HA,pkgVersion:jA,relayMLVersion:GA}=Ad(),YA=()=>{const e={[x.API_VERSION]:zA,[x.BUILDER_VERSION]:HA,[x.PKG_VERSION]:jA,[x.RELAYML_VERSION]:GA},t=()=>{var o;((o=r.current)==null?void 0:o.open)===!1&&r.current.showModal()},n=()=>{var o;(o=r.current)!=null&&o.open&&r.current.close()},r=mt.useRef(null);return k("section",{className:"ml-4 mt-4",children:[y("menu",{children:y("button",{className:"text-xs text-foreground hover:underline",onClick:t,children:b(x.ABOUT)})}),y("dialog",{ref:r,className:"aspect-[5/4] w-72 max-w-xs overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground shadow-xl backdrop:backdrop-blur-sm backdrop:backdrop-brightness-95",children:k("div",{className:"h-full px-2 pb-10",children:[k("div",{className:"flex items-center justify-between",children:[y("h2",{className:"text-2xl leading-10",children:b(x.ABOUT)}),k("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:n,children:[y("span",{className:"sr-only",children:b(x.CLOSE)}),y(Be,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"h-full overflow-y-auto",children:[y("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(e).map(([o,i])=>y("li",{className:"text-foreground/70",children:k("p",{children:[b(o),": ",i]})},o))}),y("div",{className:"mt-6 flex items-center justify-center ",children:y("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:n,children:b(x.CLOSE)})})]})]})})]})},WA=()=>{const e=q(t=>t.backButtonHref);return e?k("a",{href:e,children:[y("span",{className:"sr-only",children:b(x.NAVIGATE_BACK)}),y(Be,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},KA=()=>k("div",{className:"rounded-sm border border-gray-200 p-2",children:[y("h3",{className:"w-full",children:"Feature Flags"}),k("div",{className:"flex flex-col gap-y-2 py-2",children:[y(eE,{flagName:"showAllNodes"}),y(eE,{flagName:"showDevOptions"})]})]}),eE=({flagName:e})=>{const t=Cr(o=>o.toggleFlag),r=Cr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return k("label",{className:"flex cursor-pointer items-center",children:[k("div",{className:"relative",children:[y("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),y("div",{className:"h-5 w-10 rounded-full bg-foreground/70",children:y("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),y("p",{className:"ml-3 text-sm font-medium",children:e})]})},tE={action:{label:x.ACTION,nodes:{answer:{active:!0,label:x.ANSWER_CALL},hangup:{active:!0,label:x.HANG_UP_CALL},sendSms:{active:!0,label:x.SEND_SMS},play:{active:!0,label:x.PLAY_AUDIO_TTS}}},decision:{label:x.DECISION,nodes:{cond:{active:!0,label:x.CONDITIONS},set:{active:!0,label:x.SET_VARIABLES},unset:{active:!0,label:x.UNSET_VARIABLES}}},forwardTo:{label:x.FORWARD,nodes:{forwardAddress:{active:!1,label:x.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,label:x.FORWARD_TO_PHONE},forwardResource:{active:!1,label:x.FORWARD_TO_RESOURCE}}},input:{label:x.INPUT,nodes:{promptPlay:{active:!0,label:x.GATHER_INPUT},request:{active:!1,deprecated:!0,label:x.REQUEST},condRequest:{active:!0,label:x.REQUEST}}},recording:{label:x.RECORD,nodes:{record:{active:!0,label:x.VOICEMAIL_RECORDING},recordCallStart:{active:!0,label:x.RECORD_CALL_START},recordCallStop:{active:!0,label:x.RECORD_CALL_STOP}}}},QA=(e,t)=>({label:b(tE[e].label),nodes:Object.entries(tE[e].nodes).map(([n,r])=>(r.active||t)&&{deprecated:!!r.deprecated,title:b(r.label),type:n}).filter(Boolean).sort((n,r)=>n.title.localeCompare(r.title))}),XA=["action","forwardTo","recording","input","decision"],qA=()=>{const e=Cr(u=>u.showAllNodes),t=Cr(u=>u.showDevOptions),n=q(u=>u.addNode),r=q(u=>u.flowTitle),o=q(u=>u.exportStoreData),i=R.useRef(null),s=u=>{u.preventDefault(),i.current&&i.current.showModal()},l=R.useCallback(u=>{u.preventDefault();const{nodeType:c}=u.currentTarget.dataset;c&&n({nodeType:c})},[n]),a=R.useCallback(u=>{const{nodeType:c}=u.currentTarget.dataset;c&&(u.dataTransfer.setData(ly,c),u.dataTransfer.effectAllowed="move")},[]);return k(Ee,{children:[k("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background py-4 text-foreground sm:flex",children:[k("nav",{className:"mx-4 flex shrink-0 items-center justify-between",children:[y(WA,{}),t&&y("button",{className:"rounded bg-positive p-1 px-2 text-xs text-white",onClick:s,children:"Dev Options"})]}),y("h1",{className:"m-4 block shrink-0 text-lg font-semibold leading-tight line-clamp-2",children:r}),y("ul",{className:"overflow-y-auto",id:"sidebar-node-list",children:XA.map(u=>y("li",{children:y(ZA,{group:u,handleOnClick:l,handleDragStart:a,showAllNodes:e})},u))}),y(YA,{})]}),t&&y("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:i,children:y("form",{children:k("fieldset",{children:[k("legend",{className:"flex w-full justify-between pb-2",children:[y("h1",{className:"text-2xl leading-10",children:"Dev Options"}),k("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[y("span",{className:"sr-only",children:"Close"}),y(Be,{tag:"xmark",size:"lg"})]})]}),k("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[y("h3",{className:"w-full",children:"Flow Data"}),y("div",{className:"flex flex-row gap-x-2 py-2",children:y("div",{className:"flex items-center",children:y("button",{type:"button",className:"rounded border bg-background px-2 py-1 text-sm hover:scale-105 hover:bg-background/80 active:scale-95",onClick:o,children:"View JSON File"})})})]}),y(KA,{})]})})})]})},ZA=({group:e,handleOnClick:t,handleDragStart:n,showAllNodes:r})=>{const o=QA(e,r),i=`ngm-heading-${fT(o.label)}`;return k(Ee,{children:[y("h2",{className:"px-4 pb-2 text-sm uppercase text-foreground/50",id:i,children:o.label}),y("ul",{"aria-labelledby":i,className:"flex-1 px-4 pb-2",children:o.nodes.map(s=>y("li",{children:y("button",{className:"mb-2 block w-full rounded-lg border border-foreground/10 text-center text-sm line-clamp-1 hover:shadow-md",onClick:t,onDragStart:n,"data-node-type":s.type,draggable:!0,children:k("span",{className:"block p-3",children:[s.title,s.deprecated&&k("span",{className:"inline-block text-xs text-foreground/70",children:[" ",b(x.DEPRECATED)]})]})})},s.type))})]})},JA=()=>{const e=R.useRef(null),[t,n]=R.useState(),[r,o]=R.useState(null);return R.useLayoutEffect(()=>(e.current=new ResizeObserver(([i])=>n(i)),r&&e.current.observe(r),()=>{var i;return(i=e.current)==null?void 0:i.disconnect()}),[r]),{setTarget:o,observerEntry:t}},eL=e=>{q.setState({flowInteractive:e})},tL=({rootAppHeight:e,rootAppWidth:t})=>{q.setState({rootAppHeight:e,rootAppWidth:t})},nL=()=>{const{observerEntry:e,setTarget:t}=JA(),n=q(o=>o.initializing),r=q(o=>o.rootAppWidth);return R.useEffect(()=>{!n&&r&&eL(r>=ay)},[n,r]),R.useEffect(()=>{e&&(ct().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),tL({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},Jk="";function rL(){ct().debug("Hello World!");const{rootTarget:e}=nL(),t=q(o=>o.colorMode)??"",n=q(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return y(Ee,{children:y("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?y(TC,{errorType:n}):k(Ee,{children:[y(qA,{}),y(PA,{}),k(UI,{children:[y(XI,{}),y(bA,{})]})]})})})}const oL=`@font-face{font-family:SWInter;font-style:normal;font-weight:400;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Regular.woff) format("woff")}
|
|
69
|
+
`,iL=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function sL(e){iL(e);const{backButtonHref:t,rootElementId:n="sw-cfb-root",styleHref:r="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",voicesURL:o="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",getFlowURL:i,updateFlowURL:s,deployFlowURL:l}=e;lf.getState().init({voicesURL:o}),q.setState({backButtonHref:t,deployFlowURL:l,getFlowURL:i,rootElementId:n,updateFlowURL:s}),gC(),$A();const a=document.getElementById(n);if(!a)throw new Error(`Id: '${n}' not found in the DOM`);a.attachShadow({mode:"open"}),a.shadowRoot&&Ia.createRoot(a.shadowRoot).render(k(R.StrictMode,{children:[y("link",{type:"text/css",rel:"stylesheet",href:r}),y(rL,{})]}));const u=document.createElement("style");document.head.appendChild(u),u.appendChild(document.createTextNode(oL))}Ur.main=sL,Object.defineProperty(Ur,Symbol.toStringTag,{value:"Module"})});
|