mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
152 lines
1.3 MiB
152 lines
1.3 MiB
function $7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dQ(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){if(this instanceof r){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(t,i);return new o}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var F7={exports:{}},D_={},B7={exports:{}},xt={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var dm=Symbol.for("react.element"),fQ=Symbol.for("react.portal"),hQ=Symbol.for("react.fragment"),pQ=Symbol.for("react.strict_mode"),gQ=Symbol.for("react.profiler"),mQ=Symbol.for("react.provider"),yQ=Symbol.for("react.context"),vQ=Symbol.for("react.forward_ref"),_Q=Symbol.for("react.suspense"),bQ=Symbol.for("react.memo"),SQ=Symbol.for("react.lazy"),VP=Symbol.iterator;function wQ(e){return e===null||typeof e!="object"?null:(e=VP&&e[VP]||e["@@iterator"],typeof e=="function"?e:null)}var U7={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z7=Object.assign,V7={};function Kf(e,t,n){this.props=e,this.context=t,this.refs=V7,this.updater=n||U7}Kf.prototype.isReactComponent={};Kf.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")};Kf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function j7(){}j7.prototype=Kf.prototype;function h4(e,t,n){this.props=e,this.context=t,this.refs=V7,this.updater=n||U7}var p4=h4.prototype=new j7;p4.constructor=h4;z7(p4,Kf.prototype);p4.isPureReactComponent=!0;var jP=Array.isArray,G7=Object.prototype.hasOwnProperty,g4={current:null},H7={key:!0,ref:!0,__self:!0,__source:!0};function W7(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)G7.call(t,r)&&!H7.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:dm,type:e,key:o,ref:s,props:i,_owner:g4.current}}function xQ(e,t){return{$$typeof:dm,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function m4(e){return typeof e=="object"&&e!==null&&e.$$typeof===dm}function CQ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var GP=/\/+/g;function Bw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?CQ(""+e.key):t.toString(36)}function uv(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case dm:case fQ:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+Bw(s,0):r,jP(i)?(n="",e!=null&&(n=e.replace(GP,"$&/")+"/"),uv(i,t,n,"",function(u){return u})):i!=null&&(m4(i)&&(i=xQ(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(GP,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",jP(e))for(var a=0;a<e.length;a++){o=e[a];var l=r+Bw(o,a);s+=uv(o,t,n,l,i)}else if(l=wQ(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=r+Bw(o,a++),s+=uv(o,t,n,l,i);else if(o==="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 a0(e,t,n){if(e==null)return e;var r=[],i=0;return uv(e,r,"","",function(o){return t.call(n,o,i++)}),r}function TQ(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 bi={current:null},cv={transition:null},EQ={ReactCurrentDispatcher:bi,ReactCurrentBatchConfig:cv,ReactCurrentOwner:g4};xt.Children={map:a0,forEach:function(e,t,n){a0(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return a0(e,function(){t++}),t},toArray:function(e){return a0(e,function(t){return t})||[]},only:function(e){if(!m4(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};xt.Component=Kf;xt.Fragment=hQ;xt.Profiler=gQ;xt.PureComponent=h4;xt.StrictMode=pQ;xt.Suspense=_Q;xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=EQ;xt.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=z7({},e.props),i=e.key,o=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,s=g4.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)G7.call(t,l)&&!H7.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:dm,type:e.type,key:i,ref:o,props:r,_owner:s}};xt.createContext=function(e){return e={$$typeof:yQ,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mQ,_context:e},e.Consumer=e};xt.createElement=W7;xt.createFactory=function(e){var t=W7.bind(null,e);return t.type=e,t};xt.createRef=function(){return{current:null}};xt.forwardRef=function(e){return{$$typeof:vQ,render:e}};xt.isValidElement=m4;xt.lazy=function(e){return{$$typeof:SQ,_payload:{_status:-1,_result:e},_init:TQ}};xt.memo=function(e,t){return{$$typeof:bQ,type:e,compare:t===void 0?null:t}};xt.startTransition=function(e){var t=cv.transition;cv.transition={};try{e()}finally{cv.transition=t}};xt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};xt.useCallback=function(e,t){return bi.current.useCallback(e,t)};xt.useContext=function(e){return bi.current.useContext(e)};xt.useDebugValue=function(){};xt.useDeferredValue=function(e){return bi.current.useDeferredValue(e)};xt.useEffect=function(e,t){return bi.current.useEffect(e,t)};xt.useId=function(){return bi.current.useId()};xt.useImperativeHandle=function(e,t,n){return bi.current.useImperativeHandle(e,t,n)};xt.useInsertionEffect=function(e,t){return bi.current.useInsertionEffect(e,t)};xt.useLayoutEffect=function(e,t){return bi.current.useLayoutEffect(e,t)};xt.useMemo=function(e,t){return bi.current.useMemo(e,t)};xt.useReducer=function(e,t,n){return bi.current.useReducer(e,t,n)};xt.useRef=function(e){return bi.current.useRef(e)};xt.useState=function(e){return bi.current.useState(e)};xt.useSyncExternalStore=function(e,t,n){return bi.current.useSyncExternalStore(e,t,n)};xt.useTransition=function(){return bi.current.useTransition()};xt.version="18.2.0";B7.exports=xt;var L=B7.exports;const jt=Tc(L),HP=$7({__proto__:null,default:jt},[L]);/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var AQ=L,PQ=Symbol.for("react.element"),RQ=Symbol.for("react.fragment"),OQ=Object.prototype.hasOwnProperty,kQ=AQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,IQ={key:!0,ref:!0,__self:!0,__source:!0};function q7(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)OQ.call(t,r)&&!IQ.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:PQ,type:e,key:o,ref:s,props:i,_owner:kQ.current}}D_.Fragment=RQ;D_.jsx=q7;D_.jsxs=q7;F7.exports=D_;var ue=F7.exports,PC={},K7={exports:{}},so={},X7={exports:{}},Y7={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/(function(e){function t($,j){var G=$.length;$.push(j);e:for(;0<G;){var q=G-1>>>1,Z=$[q];if(0<i(Z,j))$[q]=j,$[G]=Z,G=q;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var j=$[0],G=$.pop();if(G!==j){$[0]=G;e:for(var q=0,Z=$.length,ee=Z>>>1;q<ee;){var ie=2*(q+1)-1,se=$[ie],le=ie+1,W=$[le];if(0>i(se,G))le<Z&&0>i(W,se)?($[q]=W,$[le]=G,q=le):($[q]=se,$[ie]=G,q=ie);else if(le<Z&&0>i(W,G))$[q]=W,$[le]=G,q=le;else break e}}return j}function i($,j){var G=$.sortIndex-j.sortIndex;return G!==0?G:$.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,f=null,h=3,g=!1,m=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y($){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=$)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function S($){if(v=!1,y($),!m)if(n(l)!==null)m=!0,D(C);else{var j=n(u);j!==null&&U(S,j.startTime-$)}}function C($,j){m=!1,v&&(v=!1,_(P),P=-1),g=!0;var G=h;try{for(y(j),f=n(l);f!==null&&(!(f.expirationTime>j)||$&&!M());){var q=f.callback;if(typeof q=="function"){f.callback=null,h=f.priorityLevel;var Z=q(f.expirationTime<=j);j=e.unstable_now(),typeof Z=="function"?f.callback=Z:f===n(l)&&r(l),y(j)}else r(l);f=n(l)}if(f!==null)var ee=!0;else{var ie=n(u);ie!==null&&U(S,ie.startTime-j),ee=!1}return ee}finally{f=null,h=G,g=!1}}var T=!1,E=null,P=-1,k=5,O=-1;function M(){return!(e.unstable_now()-O<k)}function V(){if(E!==null){var $=e.unstable_now();O=$;var j=!0;try{j=E(!0,$)}finally{j?B():(T=!1,E=null)}}else T=!1}var B;if(typeof b=="function")B=function(){b(V)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,N=A.port2;A.port1.onmessage=V,B=function(){N.postMessage(null)}}else B=function(){x(V,0)};function D($){E=$,T||(T=!0,B())}function U($,j){P=x(function(){$(e.unstable_now())},j)}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($){$.callback=null},e.unstable_continueExecution=function(){m||g||(m=!0,D(C))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function($){switch(h){case 1:case 2:case 3:var j=3;break;default:j=h}var G=h;h=j;try{return $()}finally{h=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,j){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var G=h;h=$;try{return j()}finally{h=G}},e.unstable_scheduleCallback=function($,j,G){var q=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?q+G:q):G=q,$){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=G+Z,$={id:d++,callback:j,priorityLevel:$,startTime:G,expirationTime:Z,sortIndex:-1},G>q?($.sortIndex=G,t(u,$),n(l)===null&&$===n(u)&&(v?(_(P),P=-1):v=!0,U(S,G-q))):($.sortIndex=Z,t(l,$),m||g||(m=!0,D(C))),$},e.unstable_shouldYield=M,e.unstable_wrapCallback=function($){var j=h;return function(){var G=h;h=j;try{return $.apply(this,arguments)}finally{h=G}}}})(Y7);X7.exports=Y7;var MQ=X7.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Q7=L,no=MQ;function ge(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 Z7=new Set,Zp={};function Ec(e,t){xf(e,t),xf(e+"Capture",t)}function xf(e,t){for(Zp[e]=t,e=0;e<t.length;e++)Z7.add(t[e])}var Ba=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),RC=Object.prototype.hasOwnProperty,NQ=/^[: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]*$/,WP={},qP={};function LQ(e){return RC.call(qP,e)?!0:RC.call(WP,e)?!1:NQ.test(e)?qP[e]=!0:(WP[e]=!0,!1)}function DQ(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 $Q(e,t,n,r){if(t===null||typeof t>"u"||DQ(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 Si(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Vr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vr[e]=new Si(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vr[t]=new Si(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vr[e]=new Si(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vr[e]=new Si(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){Vr[e]=new Si(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vr[e]=new Si(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vr[e]=new Si(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vr[e]=new Si(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vr[e]=new Si(e,5,!1,e.toLowerCase(),null,!1,!1)});var y4=/[\-:]([a-z])/g;function v4(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(y4,v4);Vr[t]=new Si(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(y4,v4);Vr[t]=new Si(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(y4,v4);Vr[t]=new Si(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vr[e]=new Si(e,1,!1,e.toLowerCase(),null,!1,!1)});Vr.xlinkHref=new Si("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vr[e]=new Si(e,1,!1,e.toLowerCase(),null,!0,!0)});function _4(e,t,n,r){var i=Vr.hasOwnProperty(t)?Vr[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($Q(t,n,i,r)&&(n=null),r||i===null?LQ(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qa=Q7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l0=Symbol.for("react.element"),Ld=Symbol.for("react.portal"),Dd=Symbol.for("react.fragment"),b4=Symbol.for("react.strict_mode"),OC=Symbol.for("react.profiler"),J7=Symbol.for("react.provider"),eM=Symbol.for("react.context"),S4=Symbol.for("react.forward_ref"),kC=Symbol.for("react.suspense"),IC=Symbol.for("react.suspense_list"),w4=Symbol.for("react.memo"),Sl=Symbol.for("react.lazy"),tM=Symbol.for("react.offscreen"),KP=Symbol.iterator;function qh(e){return e===null||typeof e!="object"?null:(e=KP&&e[KP]||e["@@iterator"],typeof e=="function"?e:null)}var On=Object.assign,Uw;function Sp(e){if(Uw===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Uw=t&&t[1]||""}return`
|
||
`+Uw+e}var zw=!1;function Vw(e,t){if(!e||zw)return"";zw=!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 i=u.stack.split(`
|
||
`),o=r.stack.split(`
|
||
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
|
||
`+i[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{zw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sp(e):""}function FQ(e){switch(e.tag){case 5:return Sp(e.type);case 16:return Sp("Lazy");case 13:return Sp("Suspense");case 19:return Sp("SuspenseList");case 0:case 2:case 15:return e=Vw(e.type,!1),e;case 11:return e=Vw(e.type.render,!1),e;case 1:return e=Vw(e.type,!0),e;default:return""}}function MC(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 Dd:return"Fragment";case Ld:return"Portal";case OC:return"Profiler";case b4:return"StrictMode";case kC:return"Suspense";case IC:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eM:return(e.displayName||"Context")+".Consumer";case J7:return(e._context.displayName||"Context")+".Provider";case S4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w4:return t=e.displayName||null,t!==null?t:MC(e.type)||"Memo";case Sl:t=e._payload,e=e._init;try{return MC(e(t))}catch{}}return null}function BQ(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 MC(t);case 8:return t===b4?"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 Xl(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nM(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function UQ(e){var t=nM(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 i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.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 u0(e){e._valueTracker||(e._valueTracker=UQ(e))}function rM(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nM(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Wv(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 NC(e,t){var n=t.checked;return On({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function XP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xl(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 iM(e,t){t=t.checked,t!=null&&_4(e,"checked",t,!1)}function LC(e,t){iM(e,t);var n=Xl(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")?DC(e,t.type,n):t.hasOwnProperty("defaultValue")&&DC(e,t.type,Xl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function YP(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 DC(e,t,n){(t!=="number"||Wv(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wp=Array.isArray;function Jd(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Xl(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function $C(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ge(91));return On({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function QP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ge(92));if(wp(n)){if(1<n.length)throw Error(ge(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xl(n)}}function oM(e,t){var n=Xl(t.value),r=Xl(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 ZP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function sM(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 FC(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?sM(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var c0,aM=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(c0=c0||document.createElement("div"),c0.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=c0.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jp(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kp={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},zQ=["Webkit","ms","Moz","O"];Object.keys(kp).forEach(function(e){zQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kp[t]=kp[e]})});function lM(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kp.hasOwnProperty(e)&&kp[e]?(""+t).trim():t+"px"}function uM(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=lM(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var VQ=On({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 BC(e,t){if(t){if(VQ[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ge(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ge(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ge(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ge(62))}}function UC(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 zC=null;function x4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var VC=null,ef=null,tf=null;function JP(e){if(e=pm(e)){if(typeof VC!="function")throw Error(ge(280));var t=e.stateNode;t&&(t=z_(t),VC(e.stateNode,e.type,t))}}function cM(e){ef?tf?tf.push(e):tf=[e]:ef=e}function dM(){if(ef){var e=ef,t=tf;if(tf=ef=null,JP(e),t)for(e=0;e<t.length;e++)JP(t[e])}}function fM(e,t){return e(t)}function hM(){}var jw=!1;function pM(e,t,n){if(jw)return e(t,n);jw=!0;try{return fM(e,t,n)}finally{jw=!1,(ef!==null||tf!==null)&&(hM(),dM())}}function eg(e,t){var n=e.stateNode;if(n===null)return null;var r=z_(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(ge(231,t,typeof n));return n}var jC=!1;if(Ba)try{var Kh={};Object.defineProperty(Kh,"passive",{get:function(){jC=!0}}),window.addEventListener("test",Kh,Kh),window.removeEventListener("test",Kh,Kh)}catch{jC=!1}function jQ(e,t,n,r,i,o,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Ip=!1,qv=null,Kv=!1,GC=null,GQ={onError:function(e){Ip=!0,qv=e}};function HQ(e,t,n,r,i,o,s,a,l){Ip=!1,qv=null,jQ.apply(GQ,arguments)}function WQ(e,t,n,r,i,o,s,a,l){if(HQ.apply(this,arguments),Ip){if(Ip){var u=qv;Ip=!1,qv=null}else throw Error(ge(198));Kv||(Kv=!0,GC=u)}}function Ac(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 gM(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 e8(e){if(Ac(e)!==e)throw Error(ge(188))}function qQ(e){var t=e.alternate;if(!t){if(t=Ac(e),t===null)throw Error(ge(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return e8(i),e;if(o===r)return e8(i),t;o=o.sibling}throw Error(ge(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,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){for(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)throw Error(ge(189))}}if(n.alternate!==r)throw Error(ge(190))}if(n.tag!==3)throw Error(ge(188));return n.stateNode.current===n?e:t}function mM(e){return e=qQ(e),e!==null?yM(e):null}function yM(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yM(e);if(t!==null)return t;e=e.sibling}return null}var vM=no.unstable_scheduleCallback,t8=no.unstable_cancelCallback,KQ=no.unstable_shouldYield,XQ=no.unstable_requestPaint,jn=no.unstable_now,YQ=no.unstable_getCurrentPriorityLevel,C4=no.unstable_ImmediatePriority,_M=no.unstable_UserBlockingPriority,Xv=no.unstable_NormalPriority,QQ=no.unstable_LowPriority,bM=no.unstable_IdlePriority,$_=null,zs=null;function ZQ(e){if(zs&&typeof zs.onCommitFiberRoot=="function")try{zs.onCommitFiberRoot($_,e,void 0,(e.current.flags&128)===128)}catch{}}var ss=Math.clz32?Math.clz32:tZ,JQ=Math.log,eZ=Math.LN2;function tZ(e){return e>>>=0,e===0?32:31-(JQ(e)/eZ|0)|0}var d0=64,f0=4194304;function xp(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 Yv(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=xp(a):(o&=s,o!==0&&(r=xp(o)))}else s=n&~i,s!==0?r=xp(s):o!==0&&(r=xp(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&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-ss(t),i=1<<n,r|=e[n],t&=~i;return r}function nZ(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 rZ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var s=31-ss(o),a=1<<s,l=i[s];l===-1?(!(a&n)||a&r)&&(i[s]=nZ(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function HC(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function SM(){var e=d0;return d0<<=1,!(d0&4194240)&&(d0=64),e}function Gw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function fm(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ss(t),e[t]=n}function iZ(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 i=31-ss(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function T4(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ss(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Gt=0;function wM(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var xM,E4,CM,TM,EM,WC=!1,h0=[],Dl=null,$l=null,Fl=null,tg=new Map,ng=new Map,Al=[],oZ="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 n8(e,t){switch(e){case"focusin":case"focusout":Dl=null;break;case"dragenter":case"dragleave":$l=null;break;case"mouseover":case"mouseout":Fl=null;break;case"pointerover":case"pointerout":tg.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ng.delete(t.pointerId)}}function Xh(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=pm(t),t!==null&&E4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function sZ(e,t,n,r,i){switch(t){case"focusin":return Dl=Xh(Dl,e,t,n,r,i),!0;case"dragenter":return $l=Xh($l,e,t,n,r,i),!0;case"mouseover":return Fl=Xh(Fl,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return tg.set(o,Xh(tg.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,ng.set(o,Xh(ng.get(o)||null,e,t,n,r,i)),!0}return!1}function AM(e){var t=qu(e.target);if(t!==null){var n=Ac(t);if(n!==null){if(t=n.tag,t===13){if(t=gM(n),t!==null){e.blockedOn=t,EM(e.priority,function(){CM(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 dv(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=qC(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);zC=r,n.target.dispatchEvent(r),zC=null}else return t=pm(n),t!==null&&E4(t),e.blockedOn=n,!1;t.shift()}return!0}function r8(e,t,n){dv(e)&&n.delete(t)}function aZ(){WC=!1,Dl!==null&&dv(Dl)&&(Dl=null),$l!==null&&dv($l)&&($l=null),Fl!==null&&dv(Fl)&&(Fl=null),tg.forEach(r8),ng.forEach(r8)}function Yh(e,t){e.blockedOn===t&&(e.blockedOn=null,WC||(WC=!0,no.unstable_scheduleCallback(no.unstable_NormalPriority,aZ)))}function rg(e){function t(i){return Yh(i,e)}if(0<h0.length){Yh(h0[0],e);for(var n=1;n<h0.length;n++){var r=h0[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Dl!==null&&Yh(Dl,e),$l!==null&&Yh($l,e),Fl!==null&&Yh(Fl,e),tg.forEach(t),ng.forEach(t),n=0;n<Al.length;n++)r=Al[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Al.length&&(n=Al[0],n.blockedOn===null);)AM(n),n.blockedOn===null&&Al.shift()}var nf=qa.ReactCurrentBatchConfig,Qv=!0;function lZ(e,t,n,r){var i=Gt,o=nf.transition;nf.transition=null;try{Gt=1,A4(e,t,n,r)}finally{Gt=i,nf.transition=o}}function uZ(e,t,n,r){var i=Gt,o=nf.transition;nf.transition=null;try{Gt=4,A4(e,t,n,r)}finally{Gt=i,nf.transition=o}}function A4(e,t,n,r){if(Qv){var i=qC(e,t,n,r);if(i===null)ex(e,t,r,Zv,n),n8(e,r);else if(sZ(i,e,t,n,r))r.stopPropagation();else if(n8(e,r),t&4&&-1<oZ.indexOf(e)){for(;i!==null;){var o=pm(i);if(o!==null&&xM(o),o=qC(e,t,n,r),o===null&&ex(e,t,r,Zv,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else ex(e,t,r,null,n)}}var Zv=null;function qC(e,t,n,r){if(Zv=null,e=x4(r),e=qu(e),e!==null)if(t=Ac(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gM(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 Zv=e,null}function PM(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(YQ()){case C4:return 1;case _M:return 4;case Xv:case QQ:return 16;case bM:return 536870912;default:return 16}default:return 16}}var kl=null,P4=null,fv=null;function RM(){if(fv)return fv;var e,t=P4,n=t.length,r,i="value"in kl?kl.value:kl.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[o-r];r++);return fv=i.slice(e,1<r?1-r:void 0)}function hv(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 p0(){return!0}function i8(){return!1}function ao(e){function t(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?p0:i8,this.isPropagationStopped=i8,this}return On(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=p0)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=p0)},persist:function(){},isPersistent:p0}),t}var Xf={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},R4=ao(Xf),hm=On({},Xf,{view:0,detail:0}),cZ=ao(hm),Hw,Ww,Qh,F_=On({},hm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:O4,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!==Qh&&(Qh&&e.type==="mousemove"?(Hw=e.screenX-Qh.screenX,Ww=e.screenY-Qh.screenY):Ww=Hw=0,Qh=e),Hw)},movementY:function(e){return"movementY"in e?e.movementY:Ww}}),o8=ao(F_),dZ=On({},F_,{dataTransfer:0}),fZ=ao(dZ),hZ=On({},hm,{relatedTarget:0}),qw=ao(hZ),pZ=On({},Xf,{animationName:0,elapsedTime:0,pseudoElement:0}),gZ=ao(pZ),mZ=On({},Xf,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yZ=ao(mZ),vZ=On({},Xf,{data:0}),s8=ao(vZ),_Z={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bZ={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"},SZ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wZ(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=SZ[e])?!!t[e]:!1}function O4(){return wZ}var xZ=On({},hm,{key:function(e){if(e.key){var t=_Z[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=hv(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bZ[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:O4,charCode:function(e){return e.type==="keypress"?hv(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hv(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CZ=ao(xZ),TZ=On({},F_,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a8=ao(TZ),EZ=On({},hm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:O4}),AZ=ao(EZ),PZ=On({},Xf,{propertyName:0,elapsedTime:0,pseudoElement:0}),RZ=ao(PZ),OZ=On({},F_,{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}),kZ=ao(OZ),IZ=[9,13,27,32],k4=Ba&&"CompositionEvent"in window,Mp=null;Ba&&"documentMode"in document&&(Mp=document.documentMode);var MZ=Ba&&"TextEvent"in window&&!Mp,OM=Ba&&(!k4||Mp&&8<Mp&&11>=Mp),l8=String.fromCharCode(32),u8=!1;function kM(e,t){switch(e){case"keyup":return IZ.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function IM(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $d=!1;function NZ(e,t){switch(e){case"compositionend":return IM(t);case"keypress":return t.which!==32?null:(u8=!0,l8);case"textInput":return e=t.data,e===l8&&u8?null:e;default:return null}}function LZ(e,t){if($d)return e==="compositionend"||!k4&&kM(e,t)?(e=RM(),fv=P4=kl=null,$d=!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 OM&&t.locale!=="ko"?null:t.data;default:return null}}var DZ={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 c8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!DZ[e.type]:t==="textarea"}function MM(e,t,n,r){cM(r),t=Jv(t,"onChange"),0<t.length&&(n=new R4("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Np=null,ig=null;function $Z(e){GM(e,0)}function B_(e){var t=Ud(e);if(rM(t))return e}function FZ(e,t){if(e==="change")return t}var NM=!1;if(Ba){var Kw;if(Ba){var Xw="oninput"in document;if(!Xw){var d8=document.createElement("div");d8.setAttribute("oninput","return;"),Xw=typeof d8.oninput=="function"}Kw=Xw}else Kw=!1;NM=Kw&&(!document.documentMode||9<document.documentMode)}function f8(){Np&&(Np.detachEvent("onpropertychange",LM),ig=Np=null)}function LM(e){if(e.propertyName==="value"&&B_(ig)){var t=[];MM(t,ig,e,x4(e)),pM($Z,t)}}function BZ(e,t,n){e==="focusin"?(f8(),Np=t,ig=n,Np.attachEvent("onpropertychange",LM)):e==="focusout"&&f8()}function UZ(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return B_(ig)}function zZ(e,t){if(e==="click")return B_(t)}function VZ(e,t){if(e==="input"||e==="change")return B_(t)}function jZ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fs=typeof Object.is=="function"?Object.is:jZ;function og(e,t){if(fs(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 i=n[r];if(!RC.call(t,i)||!fs(e[i],t[i]))return!1}return!0}function h8(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function p8(e,t){var n=h8(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=h8(n)}}function DM(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?DM(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $M(){for(var e=window,t=Wv();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wv(e.document)}return t}function I4(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 GZ(e){var t=$M(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&DM(n.ownerDocument.documentElement,n)){if(r!==null&&I4(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 i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=p8(n,o);var s=p8(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>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 HZ=Ba&&"documentMode"in document&&11>=document.documentMode,Fd=null,KC=null,Lp=null,XC=!1;function g8(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;XC||Fd==null||Fd!==Wv(r)||(r=Fd,"selectionStart"in r&&I4(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}),Lp&&og(Lp,r)||(Lp=r,r=Jv(KC,"onSelect"),0<r.length&&(t=new R4("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Fd)))}function g0(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Bd={animationend:g0("Animation","AnimationEnd"),animationiteration:g0("Animation","AnimationIteration"),animationstart:g0("Animation","AnimationStart"),transitionend:g0("Transition","TransitionEnd")},Yw={},FM={};Ba&&(FM=document.createElement("div").style,"AnimationEvent"in window||(delete Bd.animationend.animation,delete Bd.animationiteration.animation,delete Bd.animationstart.animation),"TransitionEvent"in window||delete Bd.transitionend.transition);function U_(e){if(Yw[e])return Yw[e];if(!Bd[e])return e;var t=Bd[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in FM)return Yw[e]=t[n];return e}var BM=U_("animationend"),UM=U_("animationiteration"),zM=U_("animationstart"),VM=U_("transitionend"),jM=new Map,m8="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 uu(e,t){jM.set(e,t),Ec(t,[e])}for(var Qw=0;Qw<m8.length;Qw++){var Zw=m8[Qw],WZ=Zw.toLowerCase(),qZ=Zw[0].toUpperCase()+Zw.slice(1);uu(WZ,"on"+qZ)}uu(BM,"onAnimationEnd");uu(UM,"onAnimationIteration");uu(zM,"onAnimationStart");uu("dblclick","onDoubleClick");uu("focusin","onFocus");uu("focusout","onBlur");uu(VM,"onTransitionEnd");xf("onMouseEnter",["mouseout","mouseover"]);xf("onMouseLeave",["mouseout","mouseover"]);xf("onPointerEnter",["pointerout","pointerover"]);xf("onPointerLeave",["pointerout","pointerover"]);Ec("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ec("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ec("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ec("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ec("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ec("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cp="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(" "),KZ=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cp));function y8(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,WQ(r,t,void 0,e),e.currentTarget=null}function GM(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=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!==o&&i.isPropagationStopped())break e;y8(i,a,u),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;y8(i,a,u),o=l}}}if(Kv)throw e=GC,Kv=!1,GC=null,e}function cn(e,t){var n=t[e3];n===void 0&&(n=t[e3]=new Set);var r=e+"__bubble";n.has(r)||(HM(t,e,2,!1),n.add(r))}function Jw(e,t,n){var r=0;t&&(r|=4),HM(n,e,r,t)}var m0="_reactListening"+Math.random().toString(36).slice(2);function sg(e){if(!e[m0]){e[m0]=!0,Z7.forEach(function(n){n!=="selectionchange"&&(KZ.has(n)||Jw(n,!1,e),Jw(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[m0]||(t[m0]=!0,Jw("selectionchange",!1,t))}}function HM(e,t,n,r){switch(PM(t)){case 1:var i=lZ;break;case 4:i=uZ;break;default:i=A4}n=i.bind(null,t,n,e),i=void 0,!jC||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ex(e,t,n,r,i){var o=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===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=qu(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}pM(function(){var u=o,d=x4(n),f=[];e:{var h=jM.get(e);if(h!==void 0){var g=R4,m=e;switch(e){case"keypress":if(hv(n)===0)break e;case"keydown":case"keyup":g=CZ;break;case"focusin":m="focus",g=qw;break;case"focusout":m="blur",g=qw;break;case"beforeblur":case"afterblur":g=qw;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":g=o8;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=fZ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=AZ;break;case BM:case UM:case zM:g=gZ;break;case VM:g=RZ;break;case"scroll":g=cZ;break;case"wheel":g=kZ;break;case"copy":case"cut":case"paste":g=yZ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=a8}var v=(t&4)!==0,x=!v&&e==="scroll",_=v?h!==null?h+"Capture":null:h;v=[];for(var b=u,y;b!==null;){y=b;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,_!==null&&(S=eg(b,_),S!=null&&v.push(ag(b,S,y)))),x)break;b=b.return}0<v.length&&(h=new g(h,m,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",h&&n!==zC&&(m=n.relatedTarget||n.fromElement)&&(qu(m)||m[Ua]))break e;if((g||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,g?(m=n.relatedTarget||n.toElement,g=u,m=m?qu(m):null,m!==null&&(x=Ac(m),m!==x||m.tag!==5&&m.tag!==6)&&(m=null)):(g=null,m=u),g!==m)){if(v=o8,S="onMouseLeave",_="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=a8,S="onPointerLeave",_="onPointerEnter",b="pointer"),x=g==null?h:Ud(g),y=m==null?h:Ud(m),h=new v(S,b+"leave",g,n,d),h.target=x,h.relatedTarget=y,S=null,qu(d)===u&&(v=new v(_,b+"enter",m,n,d),v.target=y,v.relatedTarget=x,S=v),x=S,g&&m)t:{for(v=g,_=m,b=0,y=v;y;y=hd(y))b++;for(y=0,S=_;S;S=hd(S))y++;for(;0<b-y;)v=hd(v),b--;for(;0<y-b;)_=hd(_),y--;for(;b--;){if(v===_||_!==null&&v===_.alternate)break t;v=hd(v),_=hd(_)}v=null}else v=null;g!==null&&v8(f,h,g,v,!1),m!==null&&x!==null&&v8(f,x,m,v,!0)}}e:{if(h=u?Ud(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var C=FZ;else if(c8(h))if(NM)C=VZ;else{C=UZ;var T=BZ}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=zZ);if(C&&(C=C(e,u))){MM(f,C,n,d);break e}T&&T(e,h,u),e==="focusout"&&(T=h._wrapperState)&&T.controlled&&h.type==="number"&&DC(h,"number",h.value)}switch(T=u?Ud(u):window,e){case"focusin":(c8(T)||T.contentEditable==="true")&&(Fd=T,KC=u,Lp=null);break;case"focusout":Lp=KC=Fd=null;break;case"mousedown":XC=!0;break;case"contextmenu":case"mouseup":case"dragend":XC=!1,g8(f,n,d);break;case"selectionchange":if(HZ)break;case"keydown":case"keyup":g8(f,n,d)}var E;if(k4)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else $d?kM(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(OM&&n.locale!=="ko"&&($d||P!=="onCompositionStart"?P==="onCompositionEnd"&&$d&&(E=RM()):(kl=d,P4="value"in kl?kl.value:kl.textContent,$d=!0)),T=Jv(u,P),0<T.length&&(P=new s8(P,e,null,n,d),f.push({event:P,listeners:T}),E?P.data=E:(E=IM(n),E!==null&&(P.data=E)))),(E=MZ?NZ(e,n):LZ(e,n))&&(u=Jv(u,"onBeforeInput"),0<u.length&&(d=new s8("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=E))}GM(f,t)})}function ag(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jv(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=eg(e,n),o!=null&&r.unshift(ag(e,o,i)),o=eg(e,t),o!=null&&r.push(ag(e,o,i))),e=e.return}return r}function hd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function v8(e,t,n,r,i){for(var o=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,i?(l=eg(n,o),l!=null&&s.unshift(ag(n,l,a))):i||(l=eg(n,o),l!=null&&s.push(ag(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var XZ=/\r\n?/g,YZ=/\u0000|\uFFFD/g;function _8(e){return(typeof e=="string"?e:""+e).replace(XZ,`
|
||
`).replace(YZ,"")}function y0(e,t,n){if(t=_8(t),_8(e)!==t&&n)throw Error(ge(425))}function e1(){}var YC=null,QC=null;function ZC(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 JC=typeof setTimeout=="function"?setTimeout:void 0,QZ=typeof clearTimeout=="function"?clearTimeout:void 0,b8=typeof Promise=="function"?Promise:void 0,ZZ=typeof queueMicrotask=="function"?queueMicrotask:typeof b8<"u"?function(e){return b8.resolve(null).then(e).catch(JZ)}:JC;function JZ(e){setTimeout(function(){throw e})}function tx(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),rg(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);rg(t)}function Bl(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 S8(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 Yf=Math.random().toString(36).slice(2),Is="__reactFiber$"+Yf,lg="__reactProps$"+Yf,Ua="__reactContainer$"+Yf,e3="__reactEvents$"+Yf,eJ="__reactListeners$"+Yf,tJ="__reactHandles$"+Yf;function qu(e){var t=e[Is];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ua]||n[Is]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=S8(e);e!==null;){if(n=e[Is])return n;e=S8(e)}return t}e=n,n=e.parentNode}return null}function pm(e){return e=e[Is]||e[Ua],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ud(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ge(33))}function z_(e){return e[lg]||null}var t3=[],zd=-1;function cu(e){return{current:e}}function pn(e){0>zd||(e.current=t3[zd],t3[zd]=null,zd--)}function ln(e,t){zd++,t3[zd]=e.current,e.current=t}var Yl={},ni=cu(Yl),Li=cu(!1),uc=Yl;function Cf(e,t){var n=e.type.contextTypes;if(!n)return Yl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Di(e){return e=e.childContextTypes,e!=null}function t1(){pn(Li),pn(ni)}function w8(e,t,n){if(ni.current!==Yl)throw Error(ge(168));ln(ni,t),ln(Li,n)}function WM(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(ge(108,BQ(e)||"Unknown",i));return On({},n,r)}function n1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yl,uc=ni.current,ln(ni,e),ln(Li,Li.current),!0}function x8(e,t,n){var r=e.stateNode;if(!r)throw Error(ge(169));n?(e=WM(e,t,uc),r.__reactInternalMemoizedMergedChildContext=e,pn(Li),pn(ni),ln(ni,e)):pn(Li),ln(Li,n)}var Ta=null,V_=!1,nx=!1;function qM(e){Ta===null?Ta=[e]:Ta.push(e)}function nJ(e){V_=!0,qM(e)}function du(){if(!nx&&Ta!==null){nx=!0;var e=0,t=Gt;try{var n=Ta;for(Gt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ta=null,V_=!1}catch(i){throw Ta!==null&&(Ta=Ta.slice(e+1)),vM(C4,du),i}finally{Gt=t,nx=!1}}return null}var Vd=[],jd=0,r1=null,i1=0,To=[],Eo=0,cc=null,Pa=1,Ra="";function Bu(e,t){Vd[jd++]=i1,Vd[jd++]=r1,r1=e,i1=t}function KM(e,t,n){To[Eo++]=Pa,To[Eo++]=Ra,To[Eo++]=cc,cc=e;var r=Pa;e=Ra;var i=32-ss(r)-1;r&=~(1<<i),n+=1;var o=32-ss(t)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Pa=1<<32-ss(t)+i|n<<i|r,Ra=o+e}else Pa=1<<o|n<<i|r,Ra=e}function M4(e){e.return!==null&&(Bu(e,1),KM(e,1,0))}function N4(e){for(;e===r1;)r1=Vd[--jd],Vd[jd]=null,i1=Vd[--jd],Vd[jd]=null;for(;e===cc;)cc=To[--Eo],To[Eo]=null,Ra=To[--Eo],To[Eo]=null,Pa=To[--Eo],To[Eo]=null}var eo=null,Ji=null,_n=!1,ns=null;function XM(e,t){var n=Po(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 C8(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,eo=e,Ji=Bl(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,eo=e,Ji=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=cc!==null?{id:Pa,overflow:Ra}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Po(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,eo=e,Ji=null,!0):!1;default:return!1}}function n3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function r3(e){if(_n){var t=Ji;if(t){var n=t;if(!C8(e,t)){if(n3(e))throw Error(ge(418));t=Bl(n.nextSibling);var r=eo;t&&C8(e,t)?XM(r,n):(e.flags=e.flags&-4097|2,_n=!1,eo=e)}}else{if(n3(e))throw Error(ge(418));e.flags=e.flags&-4097|2,_n=!1,eo=e}}}function T8(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;eo=e}function v0(e){if(e!==eo)return!1;if(!_n)return T8(e),_n=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ZC(e.type,e.memoizedProps)),t&&(t=Ji)){if(n3(e))throw YM(),Error(ge(418));for(;t;)XM(e,t),t=Bl(t.nextSibling)}if(T8(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ge(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ji=Bl(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ji=null}}else Ji=eo?Bl(e.stateNode.nextSibling):null;return!0}function YM(){for(var e=Ji;e;)e=Bl(e.nextSibling)}function Tf(){Ji=eo=null,_n=!1}function L4(e){ns===null?ns=[e]:ns.push(e)}var rJ=qa.ReactCurrentBatchConfig;function Zo(e,t){if(e&&e.defaultProps){t=On({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var o1=cu(null),s1=null,Gd=null,D4=null;function $4(){D4=Gd=s1=null}function F4(e){var t=o1.current;pn(o1),e._currentValue=t}function i3(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 rf(e,t){s1=e,D4=Gd=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ki=!0),e.firstContext=null)}function Io(e){var t=e._currentValue;if(D4!==e)if(e={context:e,memoizedValue:t,next:null},Gd===null){if(s1===null)throw Error(ge(308));Gd=e,s1.dependencies={lanes:0,firstContext:e}}else Gd=Gd.next=e;return t}var Ku=null;function B4(e){Ku===null?Ku=[e]:Ku.push(e)}function QM(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,B4(t)):(n.next=i.next,i.next=n),t.interleaved=n,za(e,r)}function za(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 wl=!1;function U4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ZM(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 Ia(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ul(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,za(e,n)}return i=r.interleaved,i===null?(t.next=t,B4(r)):(t.next=i.next,i.next=t),r.interleaved=t,za(e,n)}function pv(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,T4(e,n)}}function E8(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=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};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 a1(e,t,n,r){var i=e.updateQueue;wl=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?o=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,d=u=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(h=t,g=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){f=m.call(g,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,h=typeof m=="function"?m.call(g,f,h):m,h==null)break e;f=On({},f,h);break e;case 2:wl=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=g,l=f):d=d.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);fc|=s,e.lanes=s,e.memoizedState=f}}function A8(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(ge(191,i));i.call(r)}}}var JM=new Q7.Component().refs;function o3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:On({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var j_={isMounted:function(e){return(e=e._reactInternals)?Ac(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gi(),i=Vl(e),o=Ia(r,i);o.payload=t,n!=null&&(o.callback=n),t=Ul(e,o,i),t!==null&&(as(t,e,i,r),pv(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gi(),i=Vl(e),o=Ia(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Ul(e,o,i),t!==null&&(as(t,e,i,r),pv(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gi(),r=Vl(e),i=Ia(n,r);i.tag=2,t!=null&&(i.callback=t),t=Ul(e,i,r),t!==null&&(as(t,e,r,n),pv(t,e,r))}};function P8(e,t,n,r,i,o,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,s):t.prototype&&t.prototype.isPureReactComponent?!og(n,r)||!og(i,o):!0}function eN(e,t,n){var r=!1,i=Yl,o=t.contextType;return typeof o=="object"&&o!==null?o=Io(o):(i=Di(t)?uc:ni.current,r=t.contextTypes,o=(r=r!=null)?Cf(e,i):Yl),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=j_,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function R8(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&&j_.enqueueReplaceState(t,t.state,null)}function s3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=JM,U4(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=Io(o):(o=Di(t)?uc:ni.current,i.context=Cf(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(o3(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&j_.enqueueReplaceState(i,i.state,null),a1(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Zh(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(ge(309));var r=n.stateNode}if(!r)throw Error(ge(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(s){var a=i.refs;a===JM&&(a=i.refs={}),s===null?delete a[o]:a[o]=s},t._stringRef=o,t)}if(typeof e!="string")throw Error(ge(284));if(!n._owner)throw Error(ge(290,e))}return e}function _0(e,t){throw e=Object.prototype.toString.call(t),Error(ge(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function O8(e){var t=e._init;return t(e._payload)}function tN(e){function t(_,b){if(e){var y=_.deletions;y===null?(_.deletions=[b],_.flags|=16):y.push(b)}}function n(_,b){if(!e)return null;for(;b!==null;)t(_,b),b=b.sibling;return null}function r(_,b){for(_=new Map;b!==null;)b.key!==null?_.set(b.key,b):_.set(b.index,b),b=b.sibling;return _}function i(_,b){return _=jl(_,b),_.index=0,_.sibling=null,_}function o(_,b,y){return _.index=y,e?(y=_.alternate,y!==null?(y=y.index,y<b?(_.flags|=2,b):y):(_.flags|=2,b)):(_.flags|=1048576,b)}function s(_){return e&&_.alternate===null&&(_.flags|=2),_}function a(_,b,y,S){return b===null||b.tag!==6?(b=ux(y,_.mode,S),b.return=_,b):(b=i(b,y),b.return=_,b)}function l(_,b,y,S){var C=y.type;return C===Dd?d(_,b,y.props.children,S,y.key):b!==null&&(b.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Sl&&O8(C)===b.type)?(S=i(b,y.props),S.ref=Zh(_,b,y),S.return=_,S):(S=bv(y.type,y.key,y.props,null,_.mode,S),S.ref=Zh(_,b,y),S.return=_,S)}function u(_,b,y,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=cx(y,_.mode,S),b.return=_,b):(b=i(b,y.children||[]),b.return=_,b)}function d(_,b,y,S,C){return b===null||b.tag!==7?(b=nc(y,_.mode,S,C),b.return=_,b):(b=i(b,y),b.return=_,b)}function f(_,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=ux(""+b,_.mode,y),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case l0:return y=bv(b.type,b.key,b.props,null,_.mode,y),y.ref=Zh(_,null,b),y.return=_,y;case Ld:return b=cx(b,_.mode,y),b.return=_,b;case Sl:var S=b._init;return f(_,S(b._payload),y)}if(wp(b)||qh(b))return b=nc(b,_.mode,y,null),b.return=_,b;_0(_,b)}return null}function h(_,b,y,S){var C=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:a(_,b,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case l0:return y.key===C?l(_,b,y,S):null;case Ld:return y.key===C?u(_,b,y,S):null;case Sl:return C=y._init,h(_,b,C(y._payload),S)}if(wp(y)||qh(y))return C!==null?null:d(_,b,y,S,null);_0(_,y)}return null}function g(_,b,y,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return _=_.get(y)||null,a(b,_,""+S,C);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case l0:return _=_.get(S.key===null?y:S.key)||null,l(b,_,S,C);case Ld:return _=_.get(S.key===null?y:S.key)||null,u(b,_,S,C);case Sl:var T=S._init;return g(_,b,y,T(S._payload),C)}if(wp(S)||qh(S))return _=_.get(y)||null,d(b,_,S,C,null);_0(b,S)}return null}function m(_,b,y,S){for(var C=null,T=null,E=b,P=b=0,k=null;E!==null&&P<y.length;P++){E.index>P?(k=E,E=null):k=E.sibling;var O=h(_,E,y[P],S);if(O===null){E===null&&(E=k);break}e&&E&&O.alternate===null&&t(_,E),b=o(O,b,P),T===null?C=O:T.sibling=O,T=O,E=k}if(P===y.length)return n(_,E),_n&&Bu(_,P),C;if(E===null){for(;P<y.length;P++)E=f(_,y[P],S),E!==null&&(b=o(E,b,P),T===null?C=E:T.sibling=E,T=E);return _n&&Bu(_,P),C}for(E=r(_,E);P<y.length;P++)k=g(E,_,P,y[P],S),k!==null&&(e&&k.alternate!==null&&E.delete(k.key===null?P:k.key),b=o(k,b,P),T===null?C=k:T.sibling=k,T=k);return e&&E.forEach(function(M){return t(_,M)}),_n&&Bu(_,P),C}function v(_,b,y,S){var C=qh(y);if(typeof C!="function")throw Error(ge(150));if(y=C.call(y),y==null)throw Error(ge(151));for(var T=C=null,E=b,P=b=0,k=null,O=y.next();E!==null&&!O.done;P++,O=y.next()){E.index>P?(k=E,E=null):k=E.sibling;var M=h(_,E,O.value,S);if(M===null){E===null&&(E=k);break}e&&E&&M.alternate===null&&t(_,E),b=o(M,b,P),T===null?C=M:T.sibling=M,T=M,E=k}if(O.done)return n(_,E),_n&&Bu(_,P),C;if(E===null){for(;!O.done;P++,O=y.next())O=f(_,O.value,S),O!==null&&(b=o(O,b,P),T===null?C=O:T.sibling=O,T=O);return _n&&Bu(_,P),C}for(E=r(_,E);!O.done;P++,O=y.next())O=g(E,_,P,O.value,S),O!==null&&(e&&O.alternate!==null&&E.delete(O.key===null?P:O.key),b=o(O,b,P),T===null?C=O:T.sibling=O,T=O);return e&&E.forEach(function(V){return t(_,V)}),_n&&Bu(_,P),C}function x(_,b,y,S){if(typeof y=="object"&&y!==null&&y.type===Dd&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case l0:e:{for(var C=y.key,T=b;T!==null;){if(T.key===C){if(C=y.type,C===Dd){if(T.tag===7){n(_,T.sibling),b=i(T,y.props.children),b.return=_,_=b;break e}}else if(T.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Sl&&O8(C)===T.type){n(_,T.sibling),b=i(T,y.props),b.ref=Zh(_,T,y),b.return=_,_=b;break e}n(_,T);break}else t(_,T);T=T.sibling}y.type===Dd?(b=nc(y.props.children,_.mode,S,y.key),b.return=_,_=b):(S=bv(y.type,y.key,y.props,null,_.mode,S),S.ref=Zh(_,b,y),S.return=_,_=S)}return s(_);case Ld:e:{for(T=y.key;b!==null;){if(b.key===T)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){n(_,b.sibling),b=i(b,y.children||[]),b.return=_,_=b;break e}else{n(_,b);break}else t(_,b);b=b.sibling}b=cx(y,_.mode,S),b.return=_,_=b}return s(_);case Sl:return T=y._init,x(_,b,T(y._payload),S)}if(wp(y))return m(_,b,y,S);if(qh(y))return v(_,b,y,S);_0(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(n(_,b.sibling),b=i(b,y),b.return=_,_=b):(n(_,b),b=ux(y,_.mode,S),b.return=_,_=b),s(_)):n(_,b)}return x}var Ef=tN(!0),nN=tN(!1),gm={},Vs=cu(gm),ug=cu(gm),cg=cu(gm);function Xu(e){if(e===gm)throw Error(ge(174));return e}function z4(e,t){switch(ln(cg,t),ln(ug,e),ln(Vs,gm),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:FC(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=FC(t,e)}pn(Vs),ln(Vs,t)}function Af(){pn(Vs),pn(ug),pn(cg)}function rN(e){Xu(cg.current);var t=Xu(Vs.current),n=FC(t,e.type);t!==n&&(ln(ug,e),ln(Vs,n))}function V4(e){ug.current===e&&(pn(Vs),pn(ug))}var En=cu(0);function l1(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 rx=[];function j4(){for(var e=0;e<rx.length;e++)rx[e]._workInProgressVersionPrimary=null;rx.length=0}var gv=qa.ReactCurrentDispatcher,ix=qa.ReactCurrentBatchConfig,dc=0,Rn=null,cr=null,wr=null,u1=!1,Dp=!1,dg=0,iJ=0;function Kr(){throw Error(ge(321))}function G4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fs(e[n],t[n]))return!1;return!0}function H4(e,t,n,r,i,o){if(dc=o,Rn=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gv.current=e===null||e.memoizedState===null?lJ:uJ,e=n(r,i),Dp){o=0;do{if(Dp=!1,dg=0,25<=o)throw Error(ge(301));o+=1,wr=cr=null,t.updateQueue=null,gv.current=cJ,e=n(r,i)}while(Dp)}if(gv.current=c1,t=cr!==null&&cr.next!==null,dc=0,wr=cr=Rn=null,u1=!1,t)throw Error(ge(300));return e}function W4(){var e=dg!==0;return dg=0,e}function As(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wr===null?Rn.memoizedState=wr=e:wr=wr.next=e,wr}function Mo(){if(cr===null){var e=Rn.alternate;e=e!==null?e.memoizedState:null}else e=cr.next;var t=wr===null?Rn.memoizedState:wr.next;if(t!==null)wr=t,cr=e;else{if(e===null)throw Error(ge(310));cr=e,e={memoizedState:cr.memoizedState,baseState:cr.baseState,baseQueue:cr.baseQueue,queue:cr.queue,next:null},wr===null?Rn.memoizedState=wr=e:wr=wr.next=e}return wr}function fg(e,t){return typeof t=="function"?t(e):t}function ox(e){var t=Mo(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=cr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,u=o;do{var d=u.lane;if((dc&d)===d)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 f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Rn.lanes|=d,fc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=a,fs(r,t.memoizedState)||(ki=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Rn.lanes|=o,fc|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sx(e){var t=Mo(),n=t.queue;if(n===null)throw Error(ge(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);fs(o,t.memoizedState)||(ki=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function iN(){}function oN(e,t){var n=Rn,r=Mo(),i=t(),o=!fs(r.memoizedState,i);if(o&&(r.memoizedState=i,ki=!0),r=r.queue,q4(lN.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||wr!==null&&wr.memoizedState.tag&1){if(n.flags|=2048,hg(9,aN.bind(null,n,r,i,t),void 0,null),Tr===null)throw Error(ge(349));dc&30||sN(n,t,i)}return i}function sN(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Rn.updateQueue,t===null?(t={lastEffect:null,stores:null},Rn.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function aN(e,t,n,r){t.value=n,t.getSnapshot=r,uN(t)&&cN(e)}function lN(e,t,n){return n(function(){uN(t)&&cN(e)})}function uN(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fs(e,n)}catch{return!0}}function cN(e){var t=za(e,1);t!==null&&as(t,e,1,-1)}function k8(e){var t=As();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fg,lastRenderedState:e},t.queue=e,e=e.dispatch=aJ.bind(null,Rn,e),[t.memoizedState,e]}function hg(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Rn.updateQueue,t===null?(t={lastEffect:null,stores:null},Rn.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 dN(){return Mo().memoizedState}function mv(e,t,n,r){var i=As();Rn.flags|=e,i.memoizedState=hg(1|t,n,void 0,r===void 0?null:r)}function G_(e,t,n,r){var i=Mo();r=r===void 0?null:r;var o=void 0;if(cr!==null){var s=cr.memoizedState;if(o=s.destroy,r!==null&&G4(r,s.deps)){i.memoizedState=hg(t,n,o,r);return}}Rn.flags|=e,i.memoizedState=hg(1|t,n,o,r)}function I8(e,t){return mv(8390656,8,e,t)}function q4(e,t){return G_(2048,8,e,t)}function fN(e,t){return G_(4,2,e,t)}function hN(e,t){return G_(4,4,e,t)}function pN(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 gN(e,t,n){return n=n!=null?n.concat([e]):null,G_(4,4,pN.bind(null,t,e),n)}function K4(){}function mN(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&G4(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function yN(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&G4(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function vN(e,t,n){return dc&21?(fs(n,t)||(n=SM(),Rn.lanes|=n,fc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ki=!0),e.memoizedState=n)}function oJ(e,t){var n=Gt;Gt=n!==0&&4>n?n:4,e(!0);var r=ix.transition;ix.transition={};try{e(!1),t()}finally{Gt=n,ix.transition=r}}function _N(){return Mo().memoizedState}function sJ(e,t,n){var r=Vl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bN(e))SN(t,n);else if(n=QM(e,t,n,r),n!==null){var i=gi();as(n,e,r,i),wN(n,t,r)}}function aJ(e,t,n){var r=Vl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bN(e))SN(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,fs(a,s)){var l=t.interleaved;l===null?(i.next=i,B4(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=QM(e,t,i,r),n!==null&&(i=gi(),as(n,e,r,i),wN(n,t,r))}}function bN(e){var t=e.alternate;return e===Rn||t!==null&&t===Rn}function SN(e,t){Dp=u1=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wN(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,T4(e,n)}}var c1={readContext:Io,useCallback:Kr,useContext:Kr,useEffect:Kr,useImperativeHandle:Kr,useInsertionEffect:Kr,useLayoutEffect:Kr,useMemo:Kr,useReducer:Kr,useRef:Kr,useState:Kr,useDebugValue:Kr,useDeferredValue:Kr,useTransition:Kr,useMutableSource:Kr,useSyncExternalStore:Kr,useId:Kr,unstable_isNewReconciler:!1},lJ={readContext:Io,useCallback:function(e,t){return As().memoizedState=[e,t===void 0?null:t],e},useContext:Io,useEffect:I8,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,mv(4194308,4,pN.bind(null,t,e),n)},useLayoutEffect:function(e,t){return mv(4194308,4,e,t)},useInsertionEffect:function(e,t){return mv(4,2,e,t)},useMemo:function(e,t){var n=As();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=As();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=sJ.bind(null,Rn,e),[r.memoizedState,e]},useRef:function(e){var t=As();return e={current:e},t.memoizedState=e},useState:k8,useDebugValue:K4,useDeferredValue:function(e){return As().memoizedState=e},useTransition:function(){var e=k8(!1),t=e[0];return e=oJ.bind(null,e[1]),As().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Rn,i=As();if(_n){if(n===void 0)throw Error(ge(407));n=n()}else{if(n=t(),Tr===null)throw Error(ge(349));dc&30||sN(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,I8(lN.bind(null,r,o,e),[e]),r.flags|=2048,hg(9,aN.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=As(),t=Tr.identifierPrefix;if(_n){var n=Ra,r=Pa;n=(r&~(1<<32-ss(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=dg++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=iJ++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},uJ={readContext:Io,useCallback:mN,useContext:Io,useEffect:q4,useImperativeHandle:gN,useInsertionEffect:fN,useLayoutEffect:hN,useMemo:yN,useReducer:ox,useRef:dN,useState:function(){return ox(fg)},useDebugValue:K4,useDeferredValue:function(e){var t=Mo();return vN(t,cr.memoizedState,e)},useTransition:function(){var e=ox(fg)[0],t=Mo().memoizedState;return[e,t]},useMutableSource:iN,useSyncExternalStore:oN,useId:_N,unstable_isNewReconciler:!1},cJ={readContext:Io,useCallback:mN,useContext:Io,useEffect:q4,useImperativeHandle:gN,useInsertionEffect:fN,useLayoutEffect:hN,useMemo:yN,useReducer:sx,useRef:dN,useState:function(){return sx(fg)},useDebugValue:K4,useDeferredValue:function(e){var t=Mo();return cr===null?t.memoizedState=e:vN(t,cr.memoizedState,e)},useTransition:function(){var e=sx(fg)[0],t=Mo().memoizedState;return[e,t]},useMutableSource:iN,useSyncExternalStore:oN,useId:_N,unstable_isNewReconciler:!1};function Pf(e,t){try{var n="",r=t;do n+=FQ(r),r=r.return;while(r);var i=n}catch(o){i=`
|
||
Error generating stack: `+o.message+`
|
||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function ax(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function a3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var dJ=typeof WeakMap=="function"?WeakMap:Map;function xN(e,t,n){n=Ia(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){f1||(f1=!0,y3=r),a3(e,t)},n}function CN(e,t,n){n=Ia(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){a3(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){a3(e,t),typeof r!="function"&&(zl===null?zl=new Set([this]):zl.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function M8(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new dJ;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=TJ.bind(null,e,t,n),t.then(e,e))}function N8(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 L8(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=Ia(-1,1),t.tag=2,Ul(n,t,1))),n.lanes|=1),e)}var fJ=qa.ReactCurrentOwner,ki=!1;function pi(e,t,n,r){t.child=e===null?nN(t,null,n,r):Ef(t,e.child,n,r)}function D8(e,t,n,r,i){n=n.render;var o=t.ref;return rf(t,i),r=H4(e,t,n,r,o,i),n=W4(),e!==null&&!ki?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i)):(_n&&n&&M4(t),t.flags|=1,pi(e,t,r,i),t.child)}function $8(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!nT(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,TN(e,t,o,r,i)):(e=bv(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:og,n(s,r)&&e.ref===t.ref)return Va(e,t,i)}return t.flags|=1,e=jl(o,r),e.ref=t.ref,e.return=t,t.child=e}function TN(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(og(o,r)&&e.ref===t.ref)if(ki=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(ki=!0);else return t.lanes=e.lanes,Va(e,t,i)}return l3(e,t,n,r,i)}function EN(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ln(Wd,Qi),Qi|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ln(Wd,Qi),Qi|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,ln(Wd,Qi),Qi|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,ln(Wd,Qi),Qi|=r;return pi(e,t,i,n),t.child}function AN(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function l3(e,t,n,r,i){var o=Di(n)?uc:ni.current;return o=Cf(t,o),rf(t,i),n=H4(e,t,n,r,o,i),r=W4(),e!==null&&!ki?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Va(e,t,i)):(_n&&r&&M4(t),t.flags|=1,pi(e,t,n,i),t.child)}function F8(e,t,n,r,i){if(Di(n)){var o=!0;n1(t)}else o=!1;if(rf(t,i),t.stateNode===null)yv(e,t),eN(t,n,r),s3(t,n,r,i),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=Io(u):(u=Di(n)?uc:ni.current,u=Cf(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&R8(t,s,r,u),wl=!1;var h=t.memoizedState;s.state=h,a1(t,r,s,i),l=t.memoizedState,a!==r||h!==l||Li.current||wl?(typeof d=="function"&&(o3(t,n,d,r),l=t.memoizedState),(a=wl||P8(t,n,a,r,h,l,u))?(f||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,ZM(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Zo(t.type,a),s.props=u,f=t.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Io(l):(l=Di(n)?uc:ni.current,l=Cf(t,l));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&R8(t,s,r,l),wl=!1,h=t.memoizedState,s.state=h,a1(t,r,s,i);var m=t.memoizedState;a!==f||h!==m||Li.current||wl?(typeof g=="function"&&(o3(t,n,g,r),m=t.memoizedState),(u=wl||P8(t,n,u,r,h,m,l)||!1)?(d||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&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===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&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return u3(e,t,n,r,o,i)}function u3(e,t,n,r,i,o){AN(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&x8(t,n,!1),Va(e,t,o);r=t.stateNode,fJ.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ef(t,e.child,null,o),t.child=Ef(t,null,a,o)):pi(e,t,a,o),t.memoizedState=r.state,i&&x8(t,n,!0),t.child}function PN(e){var t=e.stateNode;t.pendingContext?w8(e,t.pendingContext,t.pendingContext!==t.context):t.context&&w8(e,t.context,!1),z4(e,t.containerInfo)}function B8(e,t,n,r,i){return Tf(),L4(i),t.flags|=256,pi(e,t,n,r),t.child}var c3={dehydrated:null,treeContext:null,retryLane:0};function d3(e){return{baseLanes:e,cachePool:null,transitions:null}}function RN(e,t,n){var r=t.pendingProps,i=En.current,o=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ln(En,i&1),e===null)return r3(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,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=q_(s,r,0,null),e=nc(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=d3(n),t.memoizedState=c3,e):X4(t,s));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return hJ(e,t,s,r,a,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=jl(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=jl(a,o):(o=nc(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?d3(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=c3,r}return o=e.child,e=o.sibling,r=jl(o,{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 X4(e,t){return t=q_({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function b0(e,t,n,r){return r!==null&&L4(r),Ef(t,e.child,null,n),e=X4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hJ(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=ax(Error(ge(422))),b0(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=q_({mode:"visible",children:r.children},i,0,null),o=nc(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Ef(t,e.child,null,s),t.child.memoizedState=d3(s),t.memoizedState=c3,o);if(!(t.mode&1))return b0(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(ge(419)),r=ax(o,r,void 0),b0(e,t,s,r)}if(a=(s&e.childLanes)!==0,ki||a){if(r=Tr,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,za(e,i),as(r,e,i,-1))}return tT(),r=ax(Error(ge(421))),b0(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=EJ.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Ji=Bl(i.nextSibling),eo=t,_n=!0,ns=null,e!==null&&(To[Eo++]=Pa,To[Eo++]=Ra,To[Eo++]=cc,Pa=e.id,Ra=e.overflow,cc=t),t=X4(t,r.children),t.flags|=4096,t)}function U8(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),i3(e.return,t,n)}function lx(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function ON(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(pi(e,t,r.children,n),r=En.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&&U8(e,n,t);else if(e.tag===19)U8(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(ln(En,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&l1(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),lx(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&l1(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}lx(t,!0,n,null,o);break;case"together":lx(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yv(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Va(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),fc|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ge(153));if(t.child!==null){for(e=t.child,n=jl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=jl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pJ(e,t,n){switch(t.tag){case 3:PN(t),Tf();break;case 5:rN(t);break;case 1:Di(t.type)&&n1(t);break;case 4:z4(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ln(o1,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ln(En,En.current&1),t.flags|=128,null):n&t.child.childLanes?RN(e,t,n):(ln(En,En.current&1),e=Va(e,t,n),e!==null?e.sibling:null);ln(En,En.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ON(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ln(En,En.current),r)break;return null;case 22:case 23:return t.lanes=0,EN(e,t,n)}return Va(e,t,n)}var kN,f3,IN,MN;kN=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}};f3=function(){};IN=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Xu(Vs.current);var o=null;switch(n){case"input":i=NC(e,i),r=NC(e,r),o=[];break;case"select":i=On({},i,{value:void 0}),r=On({},r,{value:void 0}),o=[];break;case"textarea":i=$C(e,i),r=$C(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=e1)}BC(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Zp.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[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||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Zp.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&cn("scroll",e),o||a===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};MN=function(e,t,n,r){n!==r&&(t.flags|=4)};function Jh(e,t){if(!_n)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 Xr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gJ(e,t,n){var r=t.pendingProps;switch(N4(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xr(t),null;case 1:return Di(t.type)&&t1(),Xr(t),null;case 3:return r=t.stateNode,Af(),pn(Li),pn(ni),j4(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(v0(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ns!==null&&(b3(ns),ns=null))),f3(e,t),Xr(t),null;case 5:V4(t);var i=Xu(cg.current);if(n=t.type,e!==null&&t.stateNode!=null)IN(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ge(166));return Xr(t),null}if(e=Xu(Vs.current),v0(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Is]=t,r[lg]=o,e=(t.mode&1)!==0,n){case"dialog":cn("cancel",r),cn("close",r);break;case"iframe":case"object":case"embed":cn("load",r);break;case"video":case"audio":for(i=0;i<Cp.length;i++)cn(Cp[i],r);break;case"source":cn("error",r);break;case"img":case"image":case"link":cn("error",r),cn("load",r);break;case"details":cn("toggle",r);break;case"input":XP(r,o),cn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},cn("invalid",r);break;case"textarea":QP(r,o),cn("invalid",r)}BC(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&y0(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&y0(r.textContent,a,e),i=["children",""+a]):Zp.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&cn("scroll",r)}switch(n){case"input":u0(r),YP(r,o,!0);break;case"textarea":u0(r),ZP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=e1)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=sM(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[Is]=t,e[lg]=r,kN(e,t,!1,!1),t.stateNode=e;e:{switch(s=UC(n,r),n){case"dialog":cn("cancel",e),cn("close",e),i=r;break;case"iframe":case"object":case"embed":cn("load",e),i=r;break;case"video":case"audio":for(i=0;i<Cp.length;i++)cn(Cp[i],e);i=r;break;case"source":cn("error",e),i=r;break;case"img":case"image":case"link":cn("error",e),cn("load",e),i=r;break;case"details":cn("toggle",e),i=r;break;case"input":XP(e,r),i=NC(e,r),cn("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=On({},r,{value:void 0}),cn("invalid",e);break;case"textarea":QP(e,r),i=$C(e,r),cn("invalid",e);break;default:i=r}BC(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?uM(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&aM(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Jp(e,l):typeof l=="number"&&Jp(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Zp.hasOwnProperty(o)?l!=null&&o==="onScroll"&&cn("scroll",e):l!=null&&_4(e,o,l,s))}switch(n){case"input":u0(e),YP(e,r,!1);break;case"textarea":u0(e),ZP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Xl(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Jd(e,!!r.multiple,o,!1):r.defaultValue!=null&&Jd(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=e1)}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 Xr(t),null;case 6:if(e&&t.stateNode!=null)MN(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ge(166));if(n=Xu(cg.current),Xu(Vs.current),v0(t)){if(r=t.stateNode,n=t.memoizedProps,r[Is]=t,(o=r.nodeValue!==n)&&(e=eo,e!==null))switch(e.tag){case 3:y0(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&y0(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Is]=t,t.stateNode=r}return Xr(t),null;case 13:if(pn(En),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_n&&Ji!==null&&t.mode&1&&!(t.flags&128))YM(),Tf(),t.flags|=98560,o=!1;else if(o=v0(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(ge(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(ge(317));o[Is]=t}else Tf(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xr(t),o=!1}else ns!==null&&(b3(ns),ns=null),o=!0;if(!o)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||En.current&1?hr===0&&(hr=3):tT())),t.updateQueue!==null&&(t.flags|=4),Xr(t),null);case 4:return Af(),f3(e,t),e===null&&sg(t.stateNode.containerInfo),Xr(t),null;case 10:return F4(t.type._context),Xr(t),null;case 17:return Di(t.type)&&t1(),Xr(t),null;case 19:if(pn(En),o=t.memoizedState,o===null)return Xr(t),null;if(r=(t.flags&128)!==0,s=o.rendering,s===null)if(r)Jh(o,!1);else{if(hr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=l1(e),s!==null){for(t.flags|=128,Jh(o,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,e=s.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ln(En,En.current&1|2),t.child}e=e.sibling}o.tail!==null&&jn()>Rf&&(t.flags|=128,r=!0,Jh(o,!1),t.lanes=4194304)}else{if(!r)if(e=l1(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jh(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!_n)return Xr(t),null}else 2*jn()-o.renderingStartTime>Rf&&n!==1073741824&&(t.flags|=128,r=!0,Jh(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=jn(),t.sibling=null,n=En.current,ln(En,r?n&1|2:n&1),t):(Xr(t),null);case 22:case 23:return eT(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qi&1073741824&&(Xr(t),t.subtreeFlags&6&&(t.flags|=8192)):Xr(t),null;case 24:return null;case 25:return null}throw Error(ge(156,t.tag))}function mJ(e,t){switch(N4(t),t.tag){case 1:return Di(t.type)&&t1(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Af(),pn(Li),pn(ni),j4(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return V4(t),null;case 13:if(pn(En),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ge(340));Tf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pn(En),null;case 4:return Af(),null;case 10:return F4(t.type._context),null;case 22:case 23:return eT(),null;case 24:return null;default:return null}}var S0=!1,ei=!1,yJ=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Hd(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ln(e,t,r)}else n.current=null}function h3(e,t,n){try{n()}catch(r){Ln(e,t,r)}}var z8=!1;function vJ(e,t){if(YC=Qv,e=$M(),I4(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 i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===e)break t;if(h===n&&++u===i&&(a=s),h===o&&++d===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(QC={focusedElem:e,selectionRange:n},Qv=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){t=Pe;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,x=m.memoizedState,_=t.stateNode,b=_.getSnapshotBeforeUpdate(t.elementType===t.type?v:Zo(t.type,v),x);_.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ge(163))}}catch(S){Ln(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}return m=z8,z8=!1,m}function $p(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&h3(t,n,o)}i=i.next}while(i!==r)}}function H_(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 p3(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 NN(e){var t=e.alternate;t!==null&&(e.alternate=null,NN(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Is],delete t[lg],delete t[e3],delete t[eJ],delete t[tJ])),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 LN(e){return e.tag===5||e.tag===3||e.tag===4}function V8(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||LN(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 g3(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=e1));else if(r!==4&&(e=e.child,e!==null))for(g3(e,t,n),e=e.sibling;e!==null;)g3(e,t,n),e=e.sibling}function m3(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(m3(e,t,n),e=e.sibling;e!==null;)m3(e,t,n),e=e.sibling}var Fr=null,es=!1;function pl(e,t,n){for(n=n.child;n!==null;)DN(e,t,n),n=n.sibling}function DN(e,t,n){if(zs&&typeof zs.onCommitFiberUnmount=="function")try{zs.onCommitFiberUnmount($_,n)}catch{}switch(n.tag){case 5:ei||Hd(n,t);case 6:var r=Fr,i=es;Fr=null,pl(e,t,n),Fr=r,es=i,Fr!==null&&(es?(e=Fr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fr.removeChild(n.stateNode));break;case 18:Fr!==null&&(es?(e=Fr,n=n.stateNode,e.nodeType===8?tx(e.parentNode,n):e.nodeType===1&&tx(e,n),rg(e)):tx(Fr,n.stateNode));break;case 4:r=Fr,i=es,Fr=n.stateNode.containerInfo,es=!0,pl(e,t,n),Fr=r,es=i;break;case 0:case 11:case 14:case 15:if(!ei&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&h3(n,t,s),i=i.next}while(i!==r)}pl(e,t,n);break;case 1:if(!ei&&(Hd(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ln(n,t,a)}pl(e,t,n);break;case 21:pl(e,t,n);break;case 22:n.mode&1?(ei=(r=ei)||n.memoizedState!==null,pl(e,t,n),ei=r):pl(e,t,n);break;default:pl(e,t,n)}}function j8(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new yJ),t.forEach(function(r){var i=AJ.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Yo(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:Fr=a.stateNode,es=!1;break e;case 3:Fr=a.stateNode.containerInfo,es=!0;break e;case 4:Fr=a.stateNode.containerInfo,es=!0;break e}a=a.return}if(Fr===null)throw Error(ge(160));DN(o,s,i),Fr=null,es=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Ln(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$N(t,e),t=t.sibling}function $N(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yo(t,e),Ts(e),r&4){try{$p(3,e,e.return),H_(3,e)}catch(v){Ln(e,e.return,v)}try{$p(5,e,e.return)}catch(v){Ln(e,e.return,v)}}break;case 1:Yo(t,e),Ts(e),r&512&&n!==null&&Hd(n,n.return);break;case 5:if(Yo(t,e),Ts(e),r&512&&n!==null&&Hd(n,n.return),e.flags&32){var i=e.stateNode;try{Jp(i,"")}catch(v){Ln(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,s=n!==null?n.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&iM(i,o),UC(a,s);var u=UC(a,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d==="style"?uM(i,f):d==="dangerouslySetInnerHTML"?aM(i,f):d==="children"?Jp(i,f):_4(i,d,f,u)}switch(a){case"input":LC(i,o);break;case"textarea":oM(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Jd(i,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?Jd(i,!!o.multiple,o.defaultValue,!0):Jd(i,!!o.multiple,o.multiple?[]:"",!1))}i[lg]=o}catch(v){Ln(e,e.return,v)}}break;case 6:if(Yo(t,e),Ts(e),r&4){if(e.stateNode===null)throw Error(ge(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(v){Ln(e,e.return,v)}}break;case 3:if(Yo(t,e),Ts(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{rg(t.containerInfo)}catch(v){Ln(e,e.return,v)}break;case 4:Yo(t,e),Ts(e);break;case 13:Yo(t,e),Ts(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Z4=jn())),r&4&&j8(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ei=(u=ei)||d,Yo(t,e),ei=u):Yo(t,e),Ts(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Pe=e,d=e.child;d!==null;){for(f=Pe=d;Pe!==null;){switch(h=Pe,g=h.child,h.tag){case 0:case 11:case 14:case 15:$p(4,h,h.return);break;case 1:Hd(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){Ln(r,n,v)}}break;case 5:Hd(h,h.return);break;case 22:if(h.memoizedState!==null){H8(f);continue}}g!==null?(g.return=h,Pe=g):H8(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=lM("display",s))}catch(v){Ln(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Ln(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Yo(t,e),Ts(e),r&4&&j8(e);break;case 21:break;default:Yo(t,e),Ts(e)}}function Ts(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(LN(n)){var r=n;break e}n=n.return}throw Error(ge(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Jp(i,""),r.flags&=-33);var o=V8(e);m3(e,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=V8(e);g3(e,a,s);break;default:throw Error(ge(161))}}catch(l){Ln(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _J(e,t,n){Pe=e,FN(e)}function FN(e,t,n){for(var r=(e.mode&1)!==0;Pe!==null;){var i=Pe,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||S0;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||ei;a=S0;var u=ei;if(S0=s,(ei=l)&&!u)for(Pe=i;Pe!==null;)s=Pe,l=s.child,s.tag===22&&s.memoizedState!==null?W8(i):l!==null?(l.return=s,Pe=l):W8(i);for(;o!==null;)Pe=o,FN(o),o=o.sibling;Pe=i,S0=a,ei=u}G8(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,Pe=o):G8(e)}}function G8(e){for(;Pe!==null;){var t=Pe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ei||H_(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ei)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Zo(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&A8(t,o,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}A8(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 d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&rg(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ge(163))}ei||t.flags&512&&p3(t)}catch(h){Ln(t,t.return,h)}}if(t===e){Pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,Pe=n;break}Pe=t.return}}function H8(e){for(;Pe!==null;){var t=Pe;if(t===e){Pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Pe=n;break}Pe=t.return}}function W8(e){for(;Pe!==null;){var t=Pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{H_(4,t)}catch(l){Ln(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Ln(t,i,l)}}var o=t.return;try{p3(t)}catch(l){Ln(t,o,l)}break;case 5:var s=t.return;try{p3(t)}catch(l){Ln(t,s,l)}}}catch(l){Ln(t,t.return,l)}if(t===e){Pe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Pe=a;break}Pe=t.return}}var bJ=Math.ceil,d1=qa.ReactCurrentDispatcher,Y4=qa.ReactCurrentOwner,Oo=qa.ReactCurrentBatchConfig,Pt=0,Tr=null,Zn=null,zr=0,Qi=0,Wd=cu(0),hr=0,pg=null,fc=0,W_=0,Q4=0,Fp=null,Ri=null,Z4=0,Rf=1/0,Ca=null,f1=!1,y3=null,zl=null,w0=!1,Il=null,h1=0,Bp=0,v3=null,vv=-1,_v=0;function gi(){return Pt&6?jn():vv!==-1?vv:vv=jn()}function Vl(e){return e.mode&1?Pt&2&&zr!==0?zr&-zr:rJ.transition!==null?(_v===0&&(_v=SM()),_v):(e=Gt,e!==0||(e=window.event,e=e===void 0?16:PM(e.type)),e):1}function as(e,t,n,r){if(50<Bp)throw Bp=0,v3=null,Error(ge(185));fm(e,n,r),(!(Pt&2)||e!==Tr)&&(e===Tr&&(!(Pt&2)&&(W_|=n),hr===4&&Pl(e,zr)),$i(e,r),n===1&&Pt===0&&!(t.mode&1)&&(Rf=jn()+500,V_&&du()))}function $i(e,t){var n=e.callbackNode;rZ(e,t);var r=Yv(e,e===Tr?zr:0);if(r===0)n!==null&&t8(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&t8(n),t===1)e.tag===0?nJ(q8.bind(null,e)):qM(q8.bind(null,e)),ZZ(function(){!(Pt&6)&&du()}),n=null;else{switch(wM(r)){case 1:n=C4;break;case 4:n=_M;break;case 16:n=Xv;break;case 536870912:n=bM;break;default:n=Xv}n=WN(n,BN.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function BN(e,t){if(vv=-1,_v=0,Pt&6)throw Error(ge(327));var n=e.callbackNode;if(of()&&e.callbackNode!==n)return null;var r=Yv(e,e===Tr?zr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=p1(e,r);else{t=r;var i=Pt;Pt|=2;var o=zN();(Tr!==e||zr!==t)&&(Ca=null,Rf=jn()+500,tc(e,t));do try{xJ();break}catch(a){UN(e,a)}while(1);$4(),d1.current=o,Pt=i,Zn!==null?t=0:(Tr=null,zr=0,t=hr)}if(t!==0){if(t===2&&(i=HC(e),i!==0&&(r=i,t=_3(e,i))),t===1)throw n=pg,tc(e,0),Pl(e,r),$i(e,jn()),n;if(t===6)Pl(e,r);else{if(i=e.current.alternate,!(r&30)&&!SJ(i)&&(t=p1(e,r),t===2&&(o=HC(e),o!==0&&(r=o,t=_3(e,o))),t===1))throw n=pg,tc(e,0),Pl(e,r),$i(e,jn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(ge(345));case 2:Uu(e,Ri,Ca);break;case 3:if(Pl(e,r),(r&130023424)===r&&(t=Z4+500-jn(),10<t)){if(Yv(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){gi(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=JC(Uu.bind(null,e,Ri,Ca),t);break}Uu(e,Ri,Ca);break;case 4:if(Pl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-ss(r);o=1<<s,s=t[s],s>i&&(i=s),r&=~o}if(r=i,r=jn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bJ(r/1960))-r,10<r){e.timeoutHandle=JC(Uu.bind(null,e,Ri,Ca),r);break}Uu(e,Ri,Ca);break;case 5:Uu(e,Ri,Ca);break;default:throw Error(ge(329))}}}return $i(e,jn()),e.callbackNode===n?BN.bind(null,e):null}function _3(e,t){var n=Fp;return e.current.memoizedState.isDehydrated&&(tc(e,t).flags|=256),e=p1(e,t),e!==2&&(t=Ri,Ri=n,t!==null&&b3(t)),e}function b3(e){Ri===null?Ri=e:Ri.push.apply(Ri,e)}function SJ(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 i=n[r],o=i.getSnapshot;i=i.value;try{if(!fs(o(),i))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 Pl(e,t){for(t&=~Q4,t&=~W_,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ss(t),r=1<<n;e[n]=-1,t&=~r}}function q8(e){if(Pt&6)throw Error(ge(327));of();var t=Yv(e,0);if(!(t&1))return $i(e,jn()),null;var n=p1(e,t);if(e.tag!==0&&n===2){var r=HC(e);r!==0&&(t=r,n=_3(e,r))}if(n===1)throw n=pg,tc(e,0),Pl(e,t),$i(e,jn()),n;if(n===6)throw Error(ge(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Uu(e,Ri,Ca),$i(e,jn()),null}function J4(e,t){var n=Pt;Pt|=1;try{return e(t)}finally{Pt=n,Pt===0&&(Rf=jn()+500,V_&&du())}}function hc(e){Il!==null&&Il.tag===0&&!(Pt&6)&&of();var t=Pt;Pt|=1;var n=Oo.transition,r=Gt;try{if(Oo.transition=null,Gt=1,e)return e()}finally{Gt=r,Oo.transition=n,Pt=t,!(Pt&6)&&du()}}function eT(){Qi=Wd.current,pn(Wd)}function tc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,QZ(n)),Zn!==null)for(n=Zn.return;n!==null;){var r=n;switch(N4(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&t1();break;case 3:Af(),pn(Li),pn(ni),j4();break;case 5:V4(r);break;case 4:Af();break;case 13:pn(En);break;case 19:pn(En);break;case 10:F4(r.type._context);break;case 22:case 23:eT()}n=n.return}if(Tr=e,Zn=e=jl(e.current,null),zr=Qi=t,hr=0,pg=null,Q4=W_=fc=0,Ri=Fp=null,Ku!==null){for(t=0;t<Ku.length;t++)if(n=Ku[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Ku=null}return e}function UN(e,t){do{var n=Zn;try{if($4(),gv.current=c1,u1){for(var r=Rn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}u1=!1}if(dc=0,wr=cr=Rn=null,Dp=!1,dg=0,Y4.current=null,n===null||n.return===null){hr=1,pg=t,Zn=null;break}e:{var o=e,s=n.return,a=n,l=t;if(t=zr,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var g=N8(s);if(g!==null){g.flags&=-257,L8(g,s,a,o,t),g.mode&1&&M8(o,u,t),t=g,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)){M8(o,u,t),tT();break e}l=Error(ge(426))}}else if(_n&&a.mode&1){var x=N8(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),L8(x,s,a,o,t),L4(Pf(l,a));break e}}o=l=Pf(l,a),hr!==4&&(hr=2),Fp===null?Fp=[o]:Fp.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var _=xN(o,l,t);E8(o,_);break e;case 1:a=l;var b=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(zl===null||!zl.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=CN(o,a,t);E8(o,S);break e}}o=o.return}while(o!==null)}jN(n)}catch(C){t=C,Zn===n&&n!==null&&(Zn=n=n.return);continue}break}while(1)}function zN(){var e=d1.current;return d1.current=c1,e===null?c1:e}function tT(){(hr===0||hr===3||hr===2)&&(hr=4),Tr===null||!(fc&268435455)&&!(W_&268435455)||Pl(Tr,zr)}function p1(e,t){var n=Pt;Pt|=2;var r=zN();(Tr!==e||zr!==t)&&(Ca=null,tc(e,t));do try{wJ();break}catch(i){UN(e,i)}while(1);if($4(),Pt=n,d1.current=r,Zn!==null)throw Error(ge(261));return Tr=null,zr=0,hr}function wJ(){for(;Zn!==null;)VN(Zn)}function xJ(){for(;Zn!==null&&!KQ();)VN(Zn)}function VN(e){var t=HN(e.alternate,e,Qi);e.memoizedProps=e.pendingProps,t===null?jN(e):Zn=t,Y4.current=null}function jN(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=mJ(n,t),n!==null){n.flags&=32767,Zn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{hr=6,Zn=null;return}}else if(n=gJ(n,t,Qi),n!==null){Zn=n;return}if(t=t.sibling,t!==null){Zn=t;return}Zn=t=e}while(t!==null);hr===0&&(hr=5)}function Uu(e,t,n){var r=Gt,i=Oo.transition;try{Oo.transition=null,Gt=1,CJ(e,t,n,r)}finally{Oo.transition=i,Gt=r}return null}function CJ(e,t,n,r){do of();while(Il!==null);if(Pt&6)throw Error(ge(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ge(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(iZ(e,o),e===Tr&&(Zn=Tr=null,zr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||w0||(w0=!0,WN(Xv,function(){return of(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Oo.transition,Oo.transition=null;var s=Gt;Gt=1;var a=Pt;Pt|=4,Y4.current=null,vJ(e,n),$N(n,e),GZ(QC),Qv=!!YC,QC=YC=null,e.current=n,_J(n),XQ(),Pt=a,Gt=s,Oo.transition=o}else e.current=n;if(w0&&(w0=!1,Il=e,h1=i),o=e.pendingLanes,o===0&&(zl=null),ZQ(n.stateNode),$i(e,jn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(f1)throw f1=!1,e=y3,y3=null,e;return h1&1&&e.tag!==0&&of(),o=e.pendingLanes,o&1?e===v3?Bp++:(Bp=0,v3=e):Bp=0,du(),null}function of(){if(Il!==null){var e=wM(h1),t=Oo.transition,n=Gt;try{if(Oo.transition=null,Gt=16>e?16:e,Il===null)var r=!1;else{if(e=Il,Il=null,h1=0,Pt&6)throw Error(ge(331));var i=Pt;for(Pt|=4,Pe=e.current;Pe!==null;){var o=Pe,s=o.child;if(Pe.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(Pe=u;Pe!==null;){var d=Pe;switch(d.tag){case 0:case 11:case 15:$p(8,d,o)}var f=d.child;if(f!==null)f.return=d,Pe=f;else for(;Pe!==null;){d=Pe;var h=d.sibling,g=d.return;if(NN(d),d===u){Pe=null;break}if(h!==null){h.return=g,Pe=h;break}Pe=g}}}var m=o.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Pe=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Pe=s;else e:for(;Pe!==null;){if(o=Pe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:$p(9,o,o.return)}var _=o.sibling;if(_!==null){_.return=o.return,Pe=_;break e}Pe=o.return}}var b=e.current;for(Pe=b;Pe!==null;){s=Pe;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,Pe=y;else e:for(s=b;Pe!==null;){if(a=Pe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:H_(9,a)}}catch(C){Ln(a,a.return,C)}if(a===s){Pe=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Pe=S;break e}Pe=a.return}}if(Pt=i,du(),zs&&typeof zs.onPostCommitFiberRoot=="function")try{zs.onPostCommitFiberRoot($_,e)}catch{}r=!0}return r}finally{Gt=n,Oo.transition=t}}return!1}function K8(e,t,n){t=Pf(n,t),t=xN(e,t,1),e=Ul(e,t,1),t=gi(),e!==null&&(fm(e,1,t),$i(e,t))}function Ln(e,t,n){if(e.tag===3)K8(e,e,n);else for(;t!==null;){if(t.tag===3){K8(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(zl===null||!zl.has(r))){e=Pf(n,e),e=CN(t,e,1),t=Ul(t,e,1),e=gi(),t!==null&&(fm(t,1,e),$i(t,e));break}}t=t.return}}function TJ(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=gi(),e.pingedLanes|=e.suspendedLanes&n,Tr===e&&(zr&n)===n&&(hr===4||hr===3&&(zr&130023424)===zr&&500>jn()-Z4?tc(e,0):Q4|=n),$i(e,t)}function GN(e,t){t===0&&(e.mode&1?(t=f0,f0<<=1,!(f0&130023424)&&(f0=4194304)):t=1);var n=gi();e=za(e,t),e!==null&&(fm(e,t,n),$i(e,n))}function EJ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),GN(e,n)}function AJ(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ge(314))}r!==null&&r.delete(t),GN(e,n)}var HN;HN=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Li.current)ki=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ki=!1,pJ(e,t,n);ki=!!(e.flags&131072)}else ki=!1,_n&&t.flags&1048576&&KM(t,i1,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yv(e,t),e=t.pendingProps;var i=Cf(t,ni.current);rf(t,n),i=H4(null,t,r,e,i,n);var o=W4();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Di(r)?(o=!0,n1(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,U4(t),i.updater=j_,t.stateNode=i,i._reactInternals=t,s3(t,r,e,n),t=u3(null,t,r,!0,o,n)):(t.tag=0,_n&&o&&M4(t),pi(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yv(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=RJ(r),e=Zo(r,e),i){case 0:t=l3(null,t,r,e,n);break e;case 1:t=F8(null,t,r,e,n);break e;case 11:t=D8(null,t,r,e,n);break e;case 14:t=$8(null,t,r,Zo(r.type,e),n);break e}throw Error(ge(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zo(r,i),l3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zo(r,i),F8(e,t,r,i,n);case 3:e:{if(PN(t),e===null)throw Error(ge(387));r=t.pendingProps,o=t.memoizedState,i=o.element,ZM(e,t),a1(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Pf(Error(ge(423)),t),t=B8(e,t,r,n,i);break e}else if(r!==i){i=Pf(Error(ge(424)),t),t=B8(e,t,r,n,i);break e}else for(Ji=Bl(t.stateNode.containerInfo.firstChild),eo=t,_n=!0,ns=null,n=nN(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tf(),r===i){t=Va(e,t,n);break e}pi(e,t,r,n)}t=t.child}return t;case 5:return rN(t),e===null&&r3(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,ZC(r,i)?s=null:o!==null&&ZC(r,o)&&(t.flags|=32),AN(e,t),pi(e,t,s,n),t.child;case 6:return e===null&&r3(t),null;case 13:return RN(e,t,n);case 4:return z4(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ef(t,null,r,n):pi(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zo(r,i),D8(e,t,r,i,n);case 7:return pi(e,t,t.pendingProps,n),t.child;case 8:return pi(e,t,t.pendingProps.children,n),t.child;case 12:return pi(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,ln(o1,r._currentValue),r._currentValue=s,o!==null)if(fs(o.value,s)){if(o.children===i.children&&!Li.current){t=Va(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ia(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),i3(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(ge(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),i3(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}pi(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,rf(t,n),i=Io(i),r=r(i),t.flags|=1,pi(e,t,r,n),t.child;case 14:return r=t.type,i=Zo(r,t.pendingProps),i=Zo(r.type,i),$8(e,t,r,i,n);case 15:return TN(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zo(r,i),yv(e,t),t.tag=1,Di(r)?(e=!0,n1(t)):e=!1,rf(t,n),eN(t,r,i),s3(t,r,i,n),u3(null,t,r,!0,e,n);case 19:return ON(e,t,n);case 22:return EN(e,t,n)}throw Error(ge(156,t.tag))};function WN(e,t){return vM(e,t)}function PJ(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 Po(e,t,n,r){return new PJ(e,t,n,r)}function nT(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RJ(e){if(typeof e=="function")return nT(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S4)return 11;if(e===w4)return 14}return 2}function jl(e,t){var n=e.alternate;return n===null?(n=Po(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 bv(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")nT(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Dd:return nc(n.children,i,o,t);case b4:s=8,i|=8;break;case OC:return e=Po(12,n,t,i|2),e.elementType=OC,e.lanes=o,e;case kC:return e=Po(13,n,t,i),e.elementType=kC,e.lanes=o,e;case IC:return e=Po(19,n,t,i),e.elementType=IC,e.lanes=o,e;case tM:return q_(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J7:s=10;break e;case eM:s=9;break e;case S4:s=11;break e;case w4:s=14;break e;case Sl:s=16,r=null;break e}throw Error(ge(130,e==null?e:typeof e,""))}return t=Po(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function nc(e,t,n,r){return e=Po(7,e,r,t),e.lanes=n,e}function q_(e,t,n,r){return e=Po(22,e,r,t),e.elementType=tM,e.lanes=n,e.stateNode={isHidden:!1},e}function ux(e,t,n){return e=Po(6,e,null,t),e.lanes=n,e}function cx(e,t,n){return t=Po(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function OJ(e,t,n,r,i){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=Gw(0),this.expirationTimes=Gw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function rT(e,t,n,r,i,o,s,a,l){return e=new OJ(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Po(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},U4(o),e}function kJ(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ld,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function qN(e){if(!e)return Yl;e=e._reactInternals;e:{if(Ac(e)!==e||e.tag!==1)throw Error(ge(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Di(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ge(171))}if(e.tag===1){var n=e.type;if(Di(n))return WM(e,n,t)}return t}function KN(e,t,n,r,i,o,s,a,l){return e=rT(n,r,!0,e,i,o,s,a,l),e.context=qN(null),n=e.current,r=gi(),i=Vl(n),o=Ia(r,i),o.callback=t??null,Ul(n,o,i),e.current.lanes=i,fm(e,i,r),$i(e,r),e}function K_(e,t,n,r){var i=t.current,o=gi(),s=Vl(i);return n=qN(n),t.context===null?t.context=n:t.pendingContext=n,t=Ia(o,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ul(i,t,s),e!==null&&(as(e,i,s,o),pv(e,i,s)),s}function g1(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 X8(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function iT(e,t){X8(e,t),(e=e.alternate)&&X8(e,t)}function IJ(){return null}var XN=typeof reportError=="function"?reportError:function(e){console.error(e)};function oT(e){this._internalRoot=e}X_.prototype.render=oT.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ge(409));K_(e,t,null,null)};X_.prototype.unmount=oT.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hc(function(){K_(null,e,null,null)}),t[Ua]=null}};function X_(e){this._internalRoot=e}X_.prototype.unstable_scheduleHydration=function(e){if(e){var t=TM();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Al.length&&t!==0&&t<Al[n].priority;n++);Al.splice(n,0,e),n===0&&AM(e)}};function sT(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Y_(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Y8(){}function MJ(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=g1(s);o.call(u)}}var s=KN(t,r,e,0,null,!1,!1,"",Y8);return e._reactRootContainer=s,e[Ua]=s.current,sg(e.nodeType===8?e.parentNode:e),hc(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=g1(l);a.call(u)}}var l=rT(e,0,!1,null,null,!1,!1,"",Y8);return e._reactRootContainer=l,e[Ua]=l.current,sg(e.nodeType===8?e.parentNode:e),hc(function(){K_(t,l,n,r)}),l}function Q_(e,t,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=g1(s);a.call(l)}}K_(t,s,e,i)}else s=MJ(n,t,e,i,r);return g1(s)}xM=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xp(t.pendingLanes);n!==0&&(T4(t,n|1),$i(t,jn()),!(Pt&6)&&(Rf=jn()+500,du()))}break;case 13:hc(function(){var r=za(e,1);if(r!==null){var i=gi();as(r,e,1,i)}}),iT(e,1)}};E4=function(e){if(e.tag===13){var t=za(e,134217728);if(t!==null){var n=gi();as(t,e,134217728,n)}iT(e,134217728)}};CM=function(e){if(e.tag===13){var t=Vl(e),n=za(e,t);if(n!==null){var r=gi();as(n,e,t,r)}iT(e,t)}};TM=function(){return Gt};EM=function(e,t){var n=Gt;try{return Gt=e,t()}finally{Gt=n}};VC=function(e,t,n){switch(t){case"input":if(LC(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 i=z_(r);if(!i)throw Error(ge(90));rM(r),LC(r,i)}}}break;case"textarea":oM(e,n);break;case"select":t=n.value,t!=null&&Jd(e,!!n.multiple,t,!1)}};fM=J4;hM=hc;var NJ={usingClientEntryPoint:!1,Events:[pm,Ud,z_,cM,dM,J4]},ep={findFiberByHostInstance:qu,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},LJ={bundleType:ep.bundleType,version:ep.version,rendererPackageName:ep.rendererPackageName,rendererConfig:ep.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qa.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mM(e),e===null?null:e.stateNode},findFiberByHostInstance:ep.findFiberByHostInstance||IJ,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 x0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!x0.isDisabled&&x0.supportsFiber)try{$_=x0.inject(LJ),zs=x0}catch{}}so.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NJ;so.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sT(t))throw Error(ge(200));return kJ(e,t,null,n)};so.createRoot=function(e,t){if(!sT(e))throw Error(ge(299));var n=!1,r="",i=XN;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=rT(e,1,!1,null,null,n,!1,r,i),e[Ua]=t.current,sg(e.nodeType===8?e.parentNode:e),new oT(t)};so.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(ge(188)):(e=Object.keys(e).join(","),Error(ge(268,e)));return e=mM(t),e=e===null?null:e.stateNode,e};so.flushSync=function(e){return hc(e)};so.hydrate=function(e,t,n){if(!Y_(t))throw Error(ge(200));return Q_(null,e,t,!0,n)};so.hydrateRoot=function(e,t,n){if(!sT(e))throw Error(ge(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=XN;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=KN(t,null,e,1,n??null,i,!1,o,s),e[Ua]=t.current,sg(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new X_(t)};so.render=function(e,t,n){if(!Y_(t))throw Error(ge(200));return Q_(null,e,t,!1,n)};so.unmountComponentAtNode=function(e){if(!Y_(e))throw Error(ge(40));return e._reactRootContainer?(hc(function(){Q_(null,null,e,!1,function(){e._reactRootContainer=null,e[Ua]=null})}),!0):!1};so.unstable_batchedUpdates=J4;so.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Y_(n))throw Error(ge(200));if(e==null||e._reactInternals===void 0)throw Error(ge(38));return Q_(e,t,n,!1,r)};so.version="18.2.0-next-9e3b772b8-20220608";function YN(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(YN)}catch(e){console.error(e)}}YN(),K7.exports=so;var Ms=K7.exports;const bRe=Tc(Ms);var Q8=Ms;PC.createRoot=Q8.createRoot,PC.hydrateRoot=Q8.hydrateRoot;const DJ="modulepreload",$J=function(e,t){return new URL(e,t).href},Z8={},QN=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=$J(o,r),o in Z8)return;Z8[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let d=i.length-1;d>=0;d--){const f=i[d];if(f.href===o&&(!s||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":DJ,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((d,f)=>{u.addEventListener("load",d),u.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};function Cr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function yi(e){return!!e&&!!e[nt]}function Fi(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===HJ}(e)||Array.isArray(e)||!!e[sf]||!!(!((t=e.constructor)===null||t===void 0)&&t[sf])||Z_(e)||J_(e))}function aT(e){return yi(e)||Cr(23,e),e[nt].t}function ja(e,t,n){n===void 0&&(n=!1),Ql(e)===0?(n?Object.keys:af)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function Ql(e){var t=e[nt];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Z_(e)?2:J_(e)?3:0}function Gl(e,t){return Ql(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Sv(e,t){return Ql(e)===2?e.get(t):e[t]}function ZN(e,t,n){var r=Ql(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function JN(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Z_(e){return jJ&&e instanceof Map}function J_(e){return GJ&&e instanceof Set}function br(e){return e.o||e.t}function lT(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=tL(e);delete t[nt];for(var n=af(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function mm(e,t){return t===void 0&&(t=!1),uT(e)||yi(e)||!Fi(e)||(Ql(e)>1&&(e.set=e.add=e.clear=e.delete=FJ),Object.freeze(e),t&&ja(e,function(n,r){return mm(r,!0)},!0)),e}function FJ(){Cr(2)}function uT(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function js(e){var t=w3[e];return t||Cr(18,e),t}function cT(e,t){w3[e]||(w3[e]=t)}function gg(){return yg}function dx(e,t){t&&(js("Patches"),e.u=[],e.s=[],e.v=t)}function m1(e){S3(e),e.p.forEach(BJ),e.p=null}function S3(e){e===yg&&(yg=e.l)}function J8(e){return yg={p:[],l:yg,h:e,m:!0,_:0}}function BJ(e){var t=e[nt];t.i===0||t.i===1?t.j():t.g=!0}function fx(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||js("ES5").S(t,e,r),r?(n[nt].P&&(m1(t),Cr(4)),Fi(e)&&(e=y1(t,e),t.l||v1(t,e)),t.u&&js("Patches").M(n[nt].t,e,t.u,t.s)):e=y1(t,n,[]),m1(t),t.u&&t.v(t.u,t.s),e!==tb?e:void 0}function y1(e,t,n){if(uT(t))return t;var r=t[nt];if(!r)return ja(t,function(a,l){return e9(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return v1(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=lT(r.k):r.o,o=i,s=!1;r.i===3&&(o=new Set(i),i.clear(),s=!0),ja(o,function(a,l){return e9(e,r,i,a,l,n,s)}),v1(e,i,!1),n&&e.u&&js("Patches").N(r,n,e.u,e.s)}return r.o}function e9(e,t,n,r,i,o,s){if(yi(i)){var a=y1(e,i,o&&t&&t.i!==3&&!Gl(t.R,r)?o.concat(r):void 0);if(ZN(n,r,a),!yi(a))return;e.m=!1}else s&&n.add(i);if(Fi(i)&&!uT(i)){if(!e.h.D&&e._<1)return;y1(e,i),t&&t.A.l||v1(e,i)}}function v1(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&mm(t,n)}function hx(e,t){var n=e[nt];return(n?br(n):e)[t]}function t9(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Oi(e){e.P||(e.P=!0,e.l&&Oi(e.l))}function px(e){e.o||(e.o=lT(e.t))}function mg(e,t,n){var r=Z_(t)?js("MapSet").F(t,n):J_(t)?js("MapSet").T(t,n):e.O?function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:gg(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=a,u=vg;s&&(l=[a],u=Tp);var d=Proxy.revocable(l,u),f=d.revoke,h=d.proxy;return a.k=h,a.j=f,h}(t,n):js("ES5").J(t,n);return(n?n.A:gg()).p.push(r),r}function eb(e){return yi(e)||Cr(22,e),function t(n){if(!Fi(n))return n;var r,i=n[nt],o=Ql(n);if(i){if(!i.P&&(i.i<4||!js("ES5").K(i)))return i.t;i.I=!0,r=n9(n,o),i.I=!1}else r=n9(n,o);return ja(r,function(s,a){i&&Sv(i.t,s)===a||ZN(r,s,t(a))}),o===3?new Set(r):r}(e)}function n9(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return lT(e)}function dT(){function e(o,s){var a=i[o];return a?a.enumerable=s:i[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[nt];return vg.get(l,o)},set:function(l){var u=this[nt];vg.set(u,o,l)}},a}function t(o){for(var s=o.length-1;s>=0;s--){var a=o[s][nt];if(!a.P)switch(a.i){case 5:r(a)&&Oi(a);break;case 4:n(a)&&Oi(a)}}}function n(o){for(var s=o.t,a=o.k,l=af(a),u=l.length-1;u>=0;u--){var d=l[u];if(d!==nt){var f=s[d];if(f===void 0&&!Gl(s,d))return!0;var h=a[d],g=h&&h[nt];if(g?g.t!==f:!JN(h,f))return!0}}var m=!!s[nt];return l.length!==af(s).length+(m?0:1)}function r(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l<s.length;l++)if(!s.hasOwnProperty(l))return!0;return!1}var i={};cT("ES5",{J:function(o,s){var a=Array.isArray(o),l=function(d,f){if(d){for(var h=Array(f.length),g=0;g<f.length;g++)Object.defineProperty(h,""+g,e(g,!0));return h}var m=tL(f);delete m[nt];for(var v=af(m),x=0;x<v.length;x++){var _=v[x];m[_]=e(_,d||!!m[_].enumerable)}return Object.create(Object.getPrototypeOf(f),m)}(a,o),u={i:a?5:4,A:s?s.A:gg(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,nt,{value:u,writable:!0}),l},S:function(o,s,a){a?yi(s)&&s[nt].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var d=u[nt];if(d){var f=d.t,h=d.k,g=d.R,m=d.i;if(m===4)ja(h,function(y){y!==nt&&(f[y]!==void 0||Gl(f,y)?g[y]||l(h[y]):(g[y]=!0,Oi(d)))}),ja(f,function(y){h[y]!==void 0||Gl(h,y)||(g[y]=!1,Oi(d))});else if(m===5){if(r(d)&&(Oi(d),g.length=!0),h.length<f.length)for(var v=h.length;v<f.length;v++)g[v]=!1;else for(var x=f.length;x<h.length;x++)g[x]=!0;for(var _=Math.min(h.length,f.length),b=0;b<_;b++)h.hasOwnProperty(b)||(g[b]=!0),g[b]===void 0&&l(h[b])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function fT(){function e(r){if(!Fi(r))return r;if(Array.isArray(r))return r.map(e);if(Z_(r))return new Map(Array.from(r.entries()).map(function(s){return[s[0],e(s[1])]}));if(J_(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var o in r)i[o]=e(r[o]);return Gl(r,sf)&&(i[sf]=r[sf]),i}function t(r){return yi(r)?e(r):r}var n="add";cT("Patches",{$:function(r,i){return i.forEach(function(o){for(var s=o.path,a=o.op,l=r,u=0;u<s.length-1;u++){var d=Ql(l),f=s[u];typeof f!="string"&&typeof f!="number"&&(f=""+f),d!==0&&d!==1||f!=="__proto__"&&f!=="constructor"||Cr(24),typeof l=="function"&&f==="prototype"&&Cr(24),typeof(l=Sv(l,f))!="object"&&Cr(15,s.join("/"))}var h=Ql(l),g=e(o.value),m=s[s.length-1];switch(a){case"replace":switch(h){case 2:return l.set(m,g);case 3:Cr(16);default:return l[m]=g}case n:switch(h){case 1:return m==="-"?l.push(g):l.splice(m,0,g);case 2:return l.set(m,g);case 3:return l.add(g);default:return l[m]=g}case"remove":switch(h){case 1:return l.splice(m,1);case 2:return l.delete(m);case 3:return l.delete(o.value);default:return delete l[m]}default:Cr(17,a)}}),r},N:function(r,i,o,s){switch(r.i){case 0:case 4:case 2:return function(a,l,u,d){var f=a.t,h=a.o;ja(a.R,function(g,m){var v=Sv(f,g),x=Sv(h,g),_=m?Gl(f,g)?"replace":n:"remove";if(v!==x||_!=="replace"){var b=l.concat(g);u.push(_==="remove"?{op:_,path:b}:{op:_,path:b,value:x}),d.push(_===n?{op:"remove",path:b}:_==="remove"?{op:n,path:b,value:t(v)}:{op:"replace",path:b,value:t(v)})}})}(r,i,o,s);case 5:case 1:return function(a,l,u,d){var f=a.t,h=a.R,g=a.o;if(g.length<f.length){var m=[g,f];f=m[0],g=m[1];var v=[d,u];u=v[0],d=v[1]}for(var x=0;x<f.length;x++)if(h[x]&&g[x]!==f[x]){var _=l.concat([x]);u.push({op:"replace",path:_,value:t(g[x])}),d.push({op:"replace",path:_,value:t(f[x])})}for(var b=f.length;b<g.length;b++){var y=l.concat([b]);u.push({op:n,path:y,value:t(g[b])})}f.length<g.length&&d.push({op:"replace",path:l.concat(["length"]),value:f.length})}(r,i,o,s);case 3:return function(a,l,u,d){var f=a.t,h=a.o,g=0;f.forEach(function(m){if(!h.has(m)){var v=l.concat([g]);u.push({op:"remove",path:v,value:m}),d.unshift({op:n,path:v,value:m})}g++}),g=0,h.forEach(function(m){if(!f.has(m)){var v=l.concat([g]);u.push({op:n,path:v,value:m}),d.unshift({op:"remove",path:v,value:m})}g++})}(r,i,o,s)}},M:function(r,i,o,s){o.push({op:"replace",path:[],value:i===tb?void 0:i}),s.push({op:"replace",path:[],value:r})}})}function eL(){function e(a,l){function u(){this.constructor=a}i(a,l),a.prototype=(u.prototype=l.prototype,new u)}function t(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function n(a){a.o||(a.o=new Set,a.t.forEach(function(l){if(Fi(l)){var u=mg(a.A.h,l,a);a.p.set(l,u),a.o.add(u)}else a.o.add(l)}))}function r(a){a.g&&Cr(3,JSON.stringify(br(a)))}var i=function(a,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)d.hasOwnProperty(f)&&(u[f]=d[f])})(a,l)},o=function(){function a(u,d){return this[nt]={i:2,l:d,A:d?d.A:gg(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(a,Map);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return br(this[nt]).size}}),l.has=function(u){return br(this[nt]).has(u)},l.set=function(u,d){var f=this[nt];return r(f),br(f).has(u)&&br(f).get(u)===d||(t(f),Oi(f),f.R.set(u,!0),f.o.set(u,d),f.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var d=this[nt];return r(d),t(d),Oi(d),d.t.has(u)?d.R.set(u,!1):d.R.delete(u),d.o.delete(u),!0},l.clear=function(){var u=this[nt];r(u),br(u).size&&(t(u),Oi(u),u.R=new Map,ja(u.t,function(d){u.R.set(d,!1)}),u.o.clear())},l.forEach=function(u,d){var f=this;br(this[nt]).forEach(function(h,g){u.call(d,f.get(g),g,f)})},l.get=function(u){var d=this[nt];r(d);var f=br(d).get(u);if(d.I||!Fi(f)||f!==d.t.get(u))return f;var h=mg(d.A.h,f,d);return t(d),d.o.set(u,h),h},l.keys=function(){return br(this[nt]).keys()},l.values=function(){var u,d=this,f=this.keys();return(u={})[C0]=function(){return d.values()},u.next=function(){var h=f.next();return h.done?h:{done:!1,value:d.get(h.value)}},u},l.entries=function(){var u,d=this,f=this.keys();return(u={})[C0]=function(){return d.entries()},u.next=function(){var h=f.next();if(h.done)return h;var g=d.get(h.value);return{done:!1,value:[h.value,g]}},u},l[C0]=function(){return this.entries()},a}(),s=function(){function a(u,d){return this[nt]={i:3,l:d,A:d?d.A:gg(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(a,Set);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return br(this[nt]).size}}),l.has=function(u){var d=this[nt];return r(d),d.o?!!d.o.has(u)||!(!d.p.has(u)||!d.o.has(d.p.get(u))):d.t.has(u)},l.add=function(u){var d=this[nt];return r(d),this.has(u)||(n(d),Oi(d),d.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var d=this[nt];return r(d),n(d),Oi(d),d.o.delete(u)||!!d.p.has(u)&&d.o.delete(d.p.get(u))},l.clear=function(){var u=this[nt];r(u),br(u).size&&(n(u),Oi(u),u.o.clear())},l.values=function(){var u=this[nt];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[nt];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[C0]=function(){return this.values()},l.forEach=function(u,d){for(var f=this.values(),h=f.next();!h.done;)u.call(d,h.value,h.value,this),h=f.next()},a}();cT("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function UJ(){dT(),eL(),fT()}function zJ(e){return e}function VJ(e){return e}var r9,yg,hT=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",jJ=typeof Map<"u",GJ=typeof Set<"u",i9=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",tb=hT?Symbol.for("immer-nothing"):((r9={})["immer-nothing"]=!0,r9),sf=hT?Symbol.for("immer-draftable"):"__$immer_draftable",nt=hT?Symbol.for("immer-state"):"__$immer_state",C0=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",HJ=""+Object.prototype.constructor,af=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,tL=Object.getOwnPropertyDescriptors||function(e){var t={};return af(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},w3={},vg={get:function(e,t){if(t===nt)return e;var n=br(e);if(!Gl(n,t))return function(i,o,s){var a,l=t9(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!Fi(r)?r:r===hx(e.t,t)?(px(e),e.o[t]=mg(e.A.h,r,e)):r},has:function(e,t){return t in br(e)},ownKeys:function(e){return Reflect.ownKeys(br(e))},set:function(e,t,n){var r=t9(br(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=hx(br(e),t),o=i==null?void 0:i[nt];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(JN(n,i)&&(n!==void 0||Gl(e.t,t)))return!0;px(e),Oi(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return hx(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,px(e),Oi(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=br(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Cr(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Cr(12)}},Tp={};ja(vg,function(e,t){Tp[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Tp.deleteProperty=function(e,t){return Tp.set.call(this,e,t,void 0)},Tp.set=function(e,t,n){return vg.set.call(this,e[0],t,n,e[0])};var nL=function(){function e(n){var r=this;this.O=i9,this.D=!0,this.produce=function(i,o,s){if(typeof i=="function"&&typeof o!="function"){var a=o;o=i;var l=r;return function(v){var x=this;v===void 0&&(v=a);for(var _=arguments.length,b=Array(_>1?_-1:0),y=1;y<_;y++)b[y-1]=arguments[y];return l.produce(v,function(S){var C;return(C=o).call.apply(C,[x,S].concat(b))})}}var u;if(typeof o!="function"&&Cr(6),s!==void 0&&typeof s!="function"&&Cr(7),Fi(i)){var d=J8(r),f=mg(r,i,void 0),h=!0;try{u=o(f),h=!1}finally{h?m1(d):S3(d)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(v){return dx(d,s),fx(v,d)},function(v){throw m1(d),v}):(dx(d,s),fx(u,d))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===tb&&(u=void 0),r.D&&mm(u,!0),s){var g=[],m=[];js("Patches").M(i,u,g,m),s(g,m)}return u}Cr(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var d=arguments.length,f=Array(d>1?d-1:0),h=1;h<d;h++)f[h-1]=arguments[h];return r.produceWithPatches(u,function(g){return i.apply(void 0,[g].concat(f))})};var s,a,l=r.produce(i,o,function(u,d){s=u,a=d});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Fi(n)||Cr(8),yi(n)&&(n=eb(n));var r=J8(this),i=mg(this,n,void 0);return i[nt].C=!0,S3(r),i},t.finishDraft=function(n,r){var i=n&&n[nt],o=i.A;return dx(o,r),fx(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!i9&&Cr(20),this.O=n},t.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var s=js("Patches").$;return yi(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),ro=new nL,rL=ro.produce,pT=ro.produceWithPatches.bind(ro),WJ=ro.setAutoFreeze.bind(ro),qJ=ro.setUseProxies.bind(ro),x3=ro.applyPatches.bind(ro),KJ=ro.createDraft.bind(ro),XJ=ro.finishDraft.bind(ro);const fu=rL,SRe=Object.freeze(Object.defineProperty({__proto__:null,Immer:nL,applyPatches:x3,castDraft:zJ,castImmutable:VJ,createDraft:KJ,current:eb,default:fu,enableAllPlugins:UJ,enableES5:dT,enableMapSet:eL,enablePatches:fT,finishDraft:XJ,freeze:mm,immerable:sf,isDraft:yi,isDraftable:Fi,nothing:tb,original:aT,produce:rL,produceWithPatches:pT,setAutoFreeze:WJ,setUseProxies:qJ},Symbol.toStringTag,{value:"Module"}));function _g(e){"@babel/helpers - typeof";return _g=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},_g(e)}function YJ(e,t){if(_g(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_g(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QJ(e){var t=YJ(e,"string");return _g(t)==="symbol"?t:String(t)}function ZJ(e,t,n){return t=QJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function s9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o9(Object(n),!0).forEach(function(r){ZJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Br(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var a9=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),gx=function(){return Math.random().toString(36).substring(7).split("").join(".")},Of={INIT:"@@redux/INIT"+gx(),REPLACE:"@@redux/REPLACE"+gx(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+gx()}};function JJ(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ym(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Br(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Br(1));return n(ym)(e,t)}if(typeof e!="function")throw new Error(Br(2));var i=e,o=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function d(){if(l)throw new Error(Br(3));return o}function f(v){if(typeof v!="function")throw new Error(Br(4));if(l)throw new Error(Br(5));var x=!0;return u(),a.push(v),function(){if(x){if(l)throw new Error(Br(6));x=!1,u();var b=a.indexOf(v);a.splice(b,1),s=null}}}function h(v){if(!JJ(v))throw new Error(Br(7));if(typeof v.type>"u")throw new Error(Br(8));if(l)throw new Error(Br(9));try{l=!0,o=i(o,v)}finally{l=!1}for(var x=s=a,_=0;_<x.length;_++){var b=x[_];b()}return v}function g(v){if(typeof v!="function")throw new Error(Br(10));i=v,h({type:Of.REPLACE})}function m(){var v,x=f;return v={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(Br(11));function y(){b.next&&b.next(d())}y();var S=x(y);return{unsubscribe:S}}},v[a9]=function(){return this},v}return h({type:Of.INIT}),r={dispatch:h,subscribe:f,getState:d,replaceReducer:g},r[a9]=m,r}var iL=ym;function eee(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Of.INIT});if(typeof r>"u")throw new Error(Br(12));if(typeof n(void 0,{type:Of.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Br(13))})}function Qf(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]=="function"&&(n[i]=e[i])}var o=Object.keys(n),s;try{eee(n)}catch(a){s=a}return function(l,u){if(l===void 0&&(l={}),s)throw s;for(var d=!1,f={},h=0;h<o.length;h++){var g=o[h],m=n[g],v=l[g],x=m(v,u);if(typeof x>"u")throw u&&u.type,new Error(Br(14));f[g]=x,d=d||x!==v}return d=d||o.length!==Object.keys(l).length,d?f:l}}function l9(e,t){return function(){return t(e.apply(this,arguments))}}function oL(e,t){if(typeof e=="function")return l9(e,t);if(typeof e!="object"||e===null)throw new Error(Br(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=l9(i,t))}return n}function kf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function gT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(Br(15))},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return o=kf.apply(void 0,a)(i.dispatch),s9(s9({},i),{},{dispatch:o})}}}const tee=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:Of,applyMiddleware:gT,bindActionCreators:oL,combineReducers:Qf,compose:kf,createStore:ym,legacy_createStore:iL},Symbol.toStringTag,{value:"Module"}));var _1="NOT_FOUND";function nee(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:_1},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function ree(e,t){var n=[];function r(a){var l=n.findIndex(function(d){return t(a,d.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return _1}function i(a,l){r(a)===_1&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var sL=function(t,n){return t===n};function iee(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function b1(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?sL:r,o=n.maxSize,s=o===void 0?1:o,a=n.resultEqualityCheck,l=iee(i),u=s===1?nee(l):ree(s,l);function d(){var f=u.get(arguments);if(f===_1){if(f=e.apply(null,arguments),a){var h=u.getEntries(),g=h.find(function(m){return a(m.value,f)});g&&(f=g.value)}u.put(arguments,f)}return f}return d.clearCache=function(){return u.clear()},d}function oee(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function aL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];var u=0,d,f={memoizeOptions:void 0},h=a.pop();if(typeof h=="object"&&(f=h,h=a.pop()),typeof h!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof h+"]");var g=f,m=g.memoizeOptions,v=m===void 0?n:m,x=Array.isArray(v)?v:[v],_=oee(a),b=e.apply(void 0,[function(){return u++,h.apply(null,arguments)}].concat(x)),y=e(function(){for(var C=[],T=_.length,E=0;E<T;E++)C.push(_[E].apply(null,arguments));return d=b.apply(null,C),d});return Object.assign(y,{resultFunc:h,memoizedResultFunc:b,dependencies:_,lastResult:function(){return d},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),y};return i}var mi=aL(b1),see=function(t,n){if(n===void 0&&(n=mi),typeof t!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof t));var r=Object.keys(t),i=n(r.map(function(o){return t[o]}),function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return s.reduce(function(l,u,d){return l[r[d]]=u,l},{})});return i};const wRe=Object.freeze(Object.defineProperty({__proto__:null,createSelector:mi,createSelectorCreator:aL,createStructuredSelector:see,defaultEqualityCheck:sL,defaultMemoize:b1},Symbol.toStringTag,{value:"Module"}));function lL(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,e):s(a)}}};return t}var uL=lL();uL.withExtraArgument=lL;const u9=uL;var cL=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vm=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Zl=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},aee=Object.defineProperty,lee=Object.defineProperties,uee=Object.getOwnPropertyDescriptors,c9=Object.getOwnPropertySymbols,cee=Object.prototype.hasOwnProperty,dee=Object.prototype.propertyIsEnumerable,d9=function(e,t,n){return t in e?aee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ii=function(e,t){for(var n in t||(t={}))cee.call(t,n)&&d9(e,n,t[n]);if(c9)for(var r=0,i=c9(t);r<i.length;r++){var n=i[r];dee.call(t,n)&&d9(e,n,t[n])}return e},mx=function(e,t){return lee(e,uee(t))},_m=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{a(n.next(l))}catch(u){i(u)}},s=function(l){try{a(n.throw(l))}catch(u){i(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,s)};a((n=n.apply(e,t)).next())})},Sa=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=mi.apply(void 0,e),r=function(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return n.apply(void 0,Zl([yi(i)?eb(i):i],o))};return r},fee=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kf:kf.apply(null,arguments)};function hs(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var dL=function(e){cL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,Zl([void 0],n[0].concat(this)))):new(t.bind.apply(t,Zl([void 0],n.concat(this))))},t}(Array),fL=function(e){cL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,Zl([void 0],n[0].concat(this)))):new(t.bind.apply(t,Zl([void 0],n.concat(this))))},t}(Array);function C3(e){return Fi(e)?fu(e,function(){}):e}function hee(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function pee(e){return function(){return function(t){return function(n){return t(n)}}}}function hL(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||hs(e)}function pL(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=hL),i===void 0&&(i=[]);var s;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var a=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(x,_){var b=t?t+"."+x:x;if(l){var y=i.some(function(S){return S instanceof RegExp?S.test(b):b===S});if(y)return"continue"}if(!n(_))return{value:{keyPath:b,value:_}};if(typeof _=="object"&&(s=pL(_,b,n,r,i,o),s))return{value:s}},d=0,f=a;d<f.length;d++){var h=f[d],g=h[0],m=h[1],v=u(g,m);if(typeof v=="object")return v.value}return o&&gL(e)&&o.add(e),!1}function gL(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if(!(typeof r!="object"||r===null)&&!gL(r))return!1}return!0}function gee(e){return function(){return function(t){return function(n){return t(n)}}}}function mee(e){return typeof e=="boolean"}function yee(){return function(t){return mL(t)}}function mL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new dL;return n&&(mee(n)?r.push(u9):r.push(u9.withExtraArgument(n.extraArgument))),r}var vee=!0;function yL(e){var t=yee(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,s=o===void 0?t():o,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,d=u===void 0?void 0:u,f=n.enhancers,h=f===void 0?void 0:f,g;if(typeof i=="function")g=i;else if(hs(i))g=Qf(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=s;typeof m=="function"&&(m=m(t));var v=gT.apply(void 0,m),x=kf;l&&(x=fee(Ii({trace:!vee},typeof l=="object"&&l)));var _=new fL(v),b=_;Array.isArray(h)?b=Zl([v],h):typeof h=="function"&&(b=h(_));var y=x.apply(void 0,b);return ym(g,d,y)}function Me(e,t){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return Ii(Ii({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function mT(e){return hs(e)&&"type"in e}function vL(e){return mT(e)&&typeof e.type=="string"&&Object.keys(e).every(_ee)}function _ee(e){return["type","payload","error","meta"].indexOf(e)>-1}function bee(e){return""+e}function _L(e){var t={},n=[],r,i={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,i},addMatcher:function(o,s){return n.push({matcher:o,reducer:s}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function See(e){return typeof e=="function"}function bL(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?_L(t):[t,n,r],o=i[0],s=i[1],a=i[2],l;if(See(e))l=function(){return C3(e())};else{var u=C3(e);l=function(){return u}}function d(f,h){f===void 0&&(f=l());var g=Zl([o[h.type]],s.filter(function(m){var v=m.matcher;return v(h)}).map(function(m){var v=m.reducer;return v}));return g.filter(function(m){return!!m}).length===0&&(g=[a]),g.reduce(function(m,v){if(v)if(yi(m)){var x=m,_=v(x,h);return _===void 0?m:_}else{if(Fi(m))return fu(m,function(b){return v(b,h)});var _=v(m,h);if(_===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return m},f)}return d.getInitialState=l,d}function wee(e,t){return e+"/"+t}function An(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:C3(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},s={},a={};i.forEach(function(d){var f=r[d],h=wee(t,d),g,m;"reducer"in f?(g=f.reducer,m=f.prepare):g=f,o[d]=g,s[h]=g,a[d]=m?Me(h,m):Me(h)});function l(){var d=typeof e.extraReducers=="function"?_L(e.extraReducers):[e.extraReducers],f=d[0],h=f===void 0?{}:f,g=d[1],m=g===void 0?[]:g,v=d[2],x=v===void 0?void 0:v,_=Ii(Ii({},h),s);return bL(n,function(b){for(var y in _)b.addCase(y,_[y]);for(var S=0,C=m;S<C.length;S++){var T=C[S];b.addMatcher(T.matcher,T.reducer)}x&&b.addDefaultCase(x)})}var u;return{name:t,reducer:function(d,f){return u||(u=l()),u(d,f)},actions:a,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function xee(){return{ids:[],entities:{}}}function Cee(){function e(t){return t===void 0&&(t={}),Object.assign(xee(),t)}return{getInitialState:e}}function Tee(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=Sa(n,r,function(u,d){return u.map(function(f){return d[f]})}),o=function(u,d){return d},s=function(u,d){return u[d]},a=Sa(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:a,selectById:Sa(r,o,s)};var l=Sa(t,r);return{selectIds:Sa(t,n),selectEntities:l,selectAll:Sa(t,i),selectTotal:Sa(t,a),selectById:Sa(l,o,s)}}return{getSelectors:e}}function Eee(e){var t=zn(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function zn(e){return function(n,r){function i(s){return vL(s)}var o=function(s){i(r)?e(r.payload,s):e(r,s)};return yi(n)?(o(n),n):fu(n,o)}}function Up(e,t){var n=t(e);return n}function rc(e){return Array.isArray(e)||(e=Object.values(e)),e}function SL(e,t,n){e=rc(e);for(var r=[],i=[],o=0,s=e;o<s.length;o++){var a=s[o],l=Up(a,t);l in n.entities?i.push({id:l,changes:a}):r.push(a)}return[r,i]}function wL(e){function t(m,v){var x=Up(m,e);x in v.entities||(v.ids.push(x),v.entities[x]=m)}function n(m,v){m=rc(m);for(var x=0,_=m;x<_.length;x++){var b=_[x];t(b,v)}}function r(m,v){var x=Up(m,e);x in v.entities||v.ids.push(x),v.entities[x]=m}function i(m,v){m=rc(m);for(var x=0,_=m;x<_.length;x++){var b=_[x];r(b,v)}}function o(m,v){m=rc(m),v.ids=[],v.entities={},n(m,v)}function s(m,v){return a([m],v)}function a(m,v){var x=!1;m.forEach(function(_){_ in v.entities&&(delete v.entities[_],x=!0)}),x&&(v.ids=v.ids.filter(function(_){return _ in v.entities}))}function l(m){Object.assign(m,{ids:[],entities:{}})}function u(m,v,x){var _=x.entities[v.id],b=Object.assign({},_,v.changes),y=Up(b,e),S=y!==v.id;return S&&(m[v.id]=y,delete x.entities[v.id]),x.entities[y]=b,S}function d(m,v){return f([m],v)}function f(m,v){var x={},_={};m.forEach(function(S){S.id in v.entities&&(_[S.id]={id:S.id,changes:Ii(Ii({},_[S.id]?_[S.id].changes:null),S.changes)})}),m=Object.values(_);var b=m.length>0;if(b){var y=m.filter(function(S){return u(x,S,v)}).length>0;y&&(v.ids=Object.keys(v.entities))}}function h(m,v){return g([m],v)}function g(m,v){var x=SL(m,e,v),_=x[0],b=x[1];f(b,v),n(_,v)}return{removeAll:Eee(l),addOne:zn(t),addMany:zn(n),setOne:zn(r),setMany:zn(i),setAll:zn(o),updateOne:zn(d),updateMany:zn(f),upsertOne:zn(h),upsertMany:zn(g),removeOne:zn(s),removeMany:zn(a)}}function Aee(e,t){var n=wL(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function s(b,y){return a([b],y)}function a(b,y){b=rc(b);var S=b.filter(function(C){return!(Up(C,e)in y.entities)});S.length!==0&&x(S,y)}function l(b,y){return u([b],y)}function u(b,y){b=rc(b),b.length!==0&&x(b,y)}function d(b,y){b=rc(b),y.entities={},y.ids=[],a(b,y)}function f(b,y){return h([b],y)}function h(b,y){for(var S=!1,C=0,T=b;C<T.length;C++){var E=T[C],P=y.entities[E.id];if(P){S=!0,Object.assign(P,E.changes);var k=e(P);E.id!==k&&(delete y.entities[E.id],y.entities[k]=P)}}S&&_(y)}function g(b,y){return m([b],y)}function m(b,y){var S=SL(b,e,y),C=S[0],T=S[1];h(T,y),a(C,y)}function v(b,y){if(b.length!==y.length)return!1;for(var S=0;S<b.length&&S<y.length;S++)if(b[S]!==y[S])return!1;return!0}function x(b,y){b.forEach(function(S){y.entities[e(S)]=S}),_(y)}function _(b){var y=Object.values(b.entities);y.sort(t);var S=y.map(e),C=b.ids;v(C,S)||(b.ids=S)}return{removeOne:r,removeMany:i,removeAll:o,addOne:zn(s),updateOne:zn(f),upsertOne:zn(g),setOne:zn(l),setMany:zn(u),setAll:zn(d),addMany:zn(a),updateMany:zn(h),upsertMany:zn(m)}}function hu(e){e===void 0&&(e={});var t=Ii({sortComparer:!1,selectId:function(a){return a.id}},e),n=t.selectId,r=t.sortComparer,i=Cee(),o=Tee(),s=r?Aee(n,r):wL(n);return Ii(Ii(Ii({selectId:n,sortComparer:r},i),o),s)}var Pee="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nb=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=Pee[Math.random()*64|0];return t},Ree=["name","message","stack","code"],yx=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),f9=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),xL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=Ree;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},Jl=function(){function e(t,n,r){var i=Me(t+"/fulfilled",function(u,d,f,h){return{payload:u,meta:mx(Ii({},h||{}),{arg:f,requestId:d,requestStatus:"fulfilled"})}}),o=Me(t+"/pending",function(u,d,f){return{payload:void 0,meta:mx(Ii({},f||{}),{arg:d,requestId:u,requestStatus:"pending"})}}),s=Me(t+"/rejected",function(u,d,f,h,g){return{payload:h,error:(r&&r.serializeError||xL)(u||"Rejected"),meta:mx(Ii({},g||{}),{arg:f,requestId:d,rejectedWithValue:!!h,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),a=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function l(u){return function(d,f,h){var g=r!=null&&r.idGenerator?r.idGenerator(u):nb(),m=new a,v;function x(b){v=b,m.abort()}var _=function(){return _m(this,null,function(){var b,y,S,C,T,E,P;return vm(this,function(k){switch(k.label){case 0:return k.trys.push([0,4,,5]),C=(b=r==null?void 0:r.condition)==null?void 0:b.call(r,u,{getState:f,extra:h}),Oee(C)?[4,C]:[3,2];case 1:C=k.sent(),k.label=2;case 2:if(C===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return T=new Promise(function(O,M){return m.signal.addEventListener("abort",function(){return M({name:"AbortError",message:v||"Aborted"})})}),d(o(g,u,(y=r==null?void 0:r.getPendingMeta)==null?void 0:y.call(r,{requestId:g,arg:u},{getState:f,extra:h}))),[4,Promise.race([T,Promise.resolve(n(u,{dispatch:d,getState:f,extra:h,requestId:g,signal:m.signal,abort:x,rejectWithValue:function(O,M){return new yx(O,M)},fulfillWithValue:function(O,M){return new f9(O,M)}})).then(function(O){if(O instanceof yx)throw O;return O instanceof f9?i(O.payload,g,u,O.meta):i(O,g,u)})])];case 3:return S=k.sent(),[3,5];case 4:return E=k.sent(),S=E instanceof yx?s(null,g,u,E.payload,E.meta):s(E,g,u),[3,5];case 5:return P=r&&!r.dispatchConditionRejection&&s.match(S)&&S.meta.condition,P||d(S),[2,S]}})})}();return Object.assign(_,{abort:x,requestId:g,arg:u,unwrap:function(){return _.then(CL)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function CL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Oee(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var kee=function(e){return e&&typeof e.match=="function"},TL=function(e,t){return kee(e)?e.match(t):e(t)};function Lo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return TL(r,n)})}}function lf(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return TL(r,n)})}}function rb(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function bm(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ib(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return rb(n,["pending"])}:bm(e)?function(n){var r=e.map(function(o){return o.pending}),i=Lo.apply(void 0,r);return i(n)}:ib()(e[0])}function If(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return rb(n,["rejected"])}:bm(e)?function(n){var r=e.map(function(o){return o.rejected}),i=Lo.apply(void 0,r);return i(n)}:If()(e[0])}function Sm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r&&r.meta&&r.meta.rejectedWithValue};return e.length===0?function(r){var i=lf(If.apply(void 0,e),n);return i(r)}:bm(e)?function(r){var i=lf(If.apply(void 0,e),n);return i(r)}:Sm()(e[0])}function pu(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return rb(n,["fulfilled"])}:bm(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=Lo.apply(void 0,r);return i(n)}:pu()(e[0])}function S1(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return rb(n,["pending","fulfilled","rejected"])}:bm(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var s=o[i];r.push(s.pending,s.rejected,s.fulfilled)}var a=Lo.apply(void 0,r);return a(n)}:S1()(e[0])}var yT=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},T3=function(){},EL=function(e,t){return t===void 0&&(t=T3),e.catch(t),e},AL=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},uf=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},Iee="task",PL="listener",RL="completed",vT="cancelled",Mee="task-"+vT,Nee="task-"+RL,OL=PL+"-"+vT,Lee=PL+"-"+RL,wm=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=Iee+" "+vT+" (reason: "+t+")"}return e}(),cf=function(e){if(e.aborted)throw new wm(e.reason)};function kL(e,t){var n=T3;return new Promise(function(r,i){var o=function(){return i(new wm(e.reason))};if(e.aborted){o();return}n=AL(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=T3})}var Dee=function(e,t){return _m(void 0,null,function(){var n,r;return vm(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,e()];case 2:return n=i.sent(),[2,{status:"ok",value:n}];case 3:return r=i.sent(),[2,{status:r instanceof wm?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},w1=function(e){return function(t){return EL(kL(e,t).then(function(n){return cf(e),n}))}},IL=function(e){var t=w1(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},$ee=Object.assign,h9={},xm="listenerMiddleware",Fee=function(e){var t=function(n){return AL(e,function(){return uf(n,e.reason)})};return function(n){yT(n,"taskExecutor");var r=new AbortController;t(r);var i=Dee(function(){return _m(void 0,null,function(){var o;return vm(this,function(s){switch(s.label){case 0:return cf(e),cf(r.signal),[4,n({pause:w1(r.signal),delay:IL(r.signal),signal:r.signal})];case 1:return o=s.sent(),cf(r.signal),[2,o]}})})},function(){return uf(r,Nee)});return{result:w1(e)(i),cancel:function(){uf(r,Mee)}}}},Bee=function(e,t){var n=function(r,i){return _m(void 0,null,function(){var o,s,a,l;return vm(this,function(u){switch(u.label){case 0:cf(t),o=function(){},s=new Promise(function(d,f){var h=e({predicate:r,effect:function(g,m){m.unsubscribe(),d([g,m.getState(),m.getOriginalState()])}});o=function(){h(),f()}}),a=[s],i!=null&&a.push(new Promise(function(d){return setTimeout(d,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,kL(t,Promise.race(a))];case 2:return l=u.sent(),cf(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return EL(n(r,i))}},ML=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=Me(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return yT(o,"options.listener"),{predicate:i,type:t,effect:o}},Uee=function(e){var t=ML(e),n=t.type,r=t.predicate,i=t.effect,o=nb(),s={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},E3=function(e){e.pending.forEach(function(t){uf(t,OL)})},zee=function(e){return function(){e.forEach(E3),e.clear()}},p9=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},NL=Me(xm+"/add"),LL=Me(xm+"/removeAll"),DL=Me(xm+"/remove"),Vee=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,Zl([xm+"/error"],e))};function $L(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?Vee:i;yT(o,"onError");var s=function(g){return g.unsubscribe=function(){return n.delete(g.id)},n.set(g.id,g),function(m){g.unsubscribe(),m!=null&&m.cancelActive&&E3(g)}},a=function(g){for(var m=0,v=Array.from(n.values());m<v.length;m++){var x=v[m];if(g(x))return x}},l=function(g){var m=a(function(v){return v.effect===g.effect});return m||(m=Uee(g)),s(m)},u=function(g){var m=ML(g),v=m.type,x=m.effect,_=m.predicate,b=a(function(y){var S=typeof v=="string"?y.type===v:y.predicate===_;return S&&y.effect===x});return b&&(b.unsubscribe(),g.cancelActive&&E3(b)),!!b},d=function(g,m,v,x){return _m(t,null,function(){var _,b,y;return vm(this,function(S){switch(S.label){case 0:_=new AbortController,b=Bee(l,_.signal),S.label=1;case 1:return S.trys.push([1,3,4,5]),g.pending.add(_),[4,Promise.resolve(g.effect(m,$ee({},v,{getOriginalState:x,condition:function(C,T){return b(C,T).then(Boolean)},take:b,delay:IL(_.signal),pause:w1(_.signal),extra:r,signal:_.signal,fork:Fee(_.signal),unsubscribe:g.unsubscribe,subscribe:function(){n.set(g.id,g)},cancelActiveListeners:function(){g.pending.forEach(function(C,T,E){C!==_&&(uf(C,OL),E.delete(C))})}})))];case 2:return S.sent(),[3,5];case 3:return y=S.sent(),y instanceof wm||p9(o,y,{raisedBy:"effect"}),[3,5];case 4:return uf(_,Lee),g.pending.delete(_),[7];case 5:return[2]}})})},f=zee(n),h=function(g){return function(m){return function(v){if(!mT(v))return m(v);if(NL.match(v))return l(v.payload);if(LL.match(v)){f();return}if(DL.match(v))return u(v.payload);var x=g.getState(),_=function(){if(x===h9)throw new Error(xm+": getOriginalState can only be called synchronously");return x},b;try{if(b=m(v),n.size>0)for(var y=g.getState(),S=Array.from(n.values()),C=0,T=S;C<T.length;C++){var E=T[C],P=!1;try{P=E.predicate(v,y,x)}catch(k){P=!1,p9(o,k,{raisedBy:"predicate"})}P&&d(E,v,g,_)}}finally{x=h9}return b}}};return{middleware:h,startListening:l,stopListening:u,clearListeners:f}}var Yu="RTK_autoBatch",wv=function(){return function(e){var t;return{payload:e,meta:(t={},t[Yu]=!0,t)}}},g9,jee=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(g9||(g9=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},FL=function(e){return function(t){setTimeout(t,e)}},Gee=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:FL(10),BL=function(e){return e===void 0&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(void 0,n),o=!0,s=!1,a=!1,l=new Set,u=e.type==="tick"?jee:e.type==="raf"?Gee:e.type==="callback"?e.queueNotification:FL(e.timeout),d=function(){a=!1,s&&(s=!1,l.forEach(function(f){return f()}))};return Object.assign({},i,{subscribe:function(f){var h=function(){return o&&f()},g=i.subscribe(h);return l.add(f),function(){g(),l.delete(f)}},dispatch:function(f){var h;try{return o=!((h=f==null?void 0:f.meta)!=null&&h[Yu]),s=!o,s&&(a||(a=!0,u(d))),i.dispatch(f)}finally{o=!0}}})}}};dT();const xRe=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:fL,MiddlewareArray:dL,SHOULD_AUTOBATCH:Yu,TaskAbortError:wm,__DO_NOT_USE__ActionTypes:Of,addListener:NL,applyMiddleware:gT,autoBatchEnhancer:BL,bindActionCreators:oL,clearAllListeners:LL,combineReducers:Qf,compose:kf,configureStore:yL,createAction:Me,createAsyncThunk:Jl,createDraftSafeSelector:Sa,createEntityAdapter:hu,createImmutableStateInvariantMiddleware:pee,createListenerMiddleware:$L,createNextState:fu,createReducer:bL,createSelector:mi,createSerializableStateInvariantMiddleware:gee,createSlice:An,createStore:ym,current:eb,findNonSerializableValue:pL,freeze:mm,getDefaultMiddleware:mL,getType:bee,isAction:mT,isAllOf:lf,isAnyOf:Lo,isAsyncThunkAction:S1,isDraft:yi,isFluxStandardAction:vL,isFulfilled:pu,isImmutableDefault:hee,isPending:ib,isPlain:hL,isPlainObject:hs,isRejected:If,isRejectedWithValue:Sm,legacy_createStore:iL,miniSerializeError:xL,nanoid:nb,original:aT,prepareAutoBatched:wv,removeListener:DL,unwrapResult:CL},Symbol.toStringTag,{value:"Module"})),T0=(e,t)=>Math.floor(e/t)*t,Ns=(e,t)=>Math.round(e/t)*t;var Hee=typeof global=="object"&&global&&global.Object===Object&&global;const UL=Hee;var Wee=typeof self=="object"&&self&&self.Object===Object&&self,qee=UL||Wee||Function("return this")();const Js=qee;var Kee=Js.Symbol;const No=Kee;var zL=Object.prototype,Xee=zL.hasOwnProperty,Yee=zL.toString,tp=No?No.toStringTag:void 0;function Qee(e){var t=Xee.call(e,tp),n=e[tp];try{e[tp]=void 0;var r=!0}catch{}var i=Yee.call(e);return r&&(t?e[tp]=n:delete e[tp]),i}var Zee=Object.prototype,Jee=Zee.toString;function ete(e){return Jee.call(e)}var tte="[object Null]",nte="[object Undefined]",m9=No?No.toStringTag:void 0;function gu(e){return e==null?e===void 0?nte:tte:m9&&m9 in Object(e)?Qee(e):ete(e)}function ps(e){return e!=null&&typeof e=="object"}var rte="[object Symbol]";function ob(e){return typeof e=="symbol"||ps(e)&&gu(e)==rte}function VL(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ite=Array.isArray;const Er=ite;var ote=1/0,y9=No?No.prototype:void 0,v9=y9?y9.toString:void 0;function jL(e){if(typeof e=="string")return e;if(Er(e))return VL(e,jL)+"";if(ob(e))return v9?v9.call(e):"";var t=e+"";return t=="0"&&1/e==-ote?"-0":t}var ste=/\s/;function ate(e){for(var t=e.length;t--&&ste.test(e.charAt(t)););return t}var lte=/^\s+/;function ute(e){return e&&e.slice(0,ate(e)+1).replace(lte,"")}function vi(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var _9=0/0,cte=/^[-+]0x[0-9a-f]+$/i,dte=/^0b[01]+$/i,fte=/^0o[0-7]+$/i,hte=parseInt;function vx(e){if(typeof e=="number")return e;if(ob(e))return _9;if(vi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=vi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=ute(e);var n=dte.test(e);return n||fte.test(e)?hte(e.slice(2),n?2:8):cte.test(e)?_9:+e}function sb(e){return e}var pte="[object AsyncFunction]",gte="[object Function]",mte="[object GeneratorFunction]",yte="[object Proxy]";function _T(e){if(!vi(e))return!1;var t=gu(e);return t==gte||t==mte||t==pte||t==yte}var vte=Js["__core-js_shared__"];const _x=vte;var b9=function(){var e=/[^.]+$/.exec(_x&&_x.keys&&_x.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function _te(e){return!!b9&&b9 in e}var bte=Function.prototype,Ste=bte.toString;function Pc(e){if(e!=null){try{return Ste.call(e)}catch{}try{return e+""}catch{}}return""}var wte=/[\\^$.*+?()[\]{}|]/g,xte=/^\[object .+?Constructor\]$/,Cte=Function.prototype,Tte=Object.prototype,Ete=Cte.toString,Ate=Tte.hasOwnProperty,Pte=RegExp("^"+Ete.call(Ate).replace(wte,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rte(e){if(!vi(e)||_te(e))return!1;var t=_T(e)?Pte:xte;return t.test(Pc(e))}function Ote(e,t){return e==null?void 0:e[t]}function Rc(e,t){var n=Ote(e,t);return Rte(n)?n:void 0}var kte=Rc(Js,"WeakMap");const A3=kte;var S9=Object.create,Ite=function(){function e(){}return function(t){if(!vi(t))return{};if(S9)return S9(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const Mte=Ite;function GL(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Nte(){}function HL(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Lte=800,Dte=16,$te=Date.now;function Fte(e){var t=0,n=0;return function(){var r=$te(),i=Dte-(r-n);if(n=r,i>0){if(++t>=Lte)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Bte(e){return function(){return e}}var Ute=function(){try{var e=Rc(Object,"defineProperty");return e({},"",{}),e}catch{}}();const x1=Ute;var zte=x1?function(e,t){return x1(e,"toString",{configurable:!0,enumerable:!1,value:Bte(t),writable:!0})}:sb;const Vte=zte;var jte=Fte(Vte);const WL=jte;function qL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Gte(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Hte(e){return e!==e}function Wte(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function qte(e,t,n){return t===t?Wte(e,t,n):Gte(e,Hte,n)}function Kte(e,t){var n=e==null?0:e.length;return!!n&&qte(e,t,0)>-1}var Xte=9007199254740991,Yte=/^(?:0|[1-9]\d*)$/;function bT(e,t){var n=typeof e;return t=t??Xte,!!t&&(n=="number"||n!="symbol"&&Yte.test(e))&&e>-1&&e%1==0&&e<t}function ST(e,t,n){t=="__proto__"&&x1?x1(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cm(e,t){return e===t||e!==e&&t!==t}var Qte=Object.prototype,Zte=Qte.hasOwnProperty;function KL(e,t,n){var r=e[t];(!(Zte.call(e,t)&&Cm(r,n))||n===void 0&&!(t in e))&&ST(e,t,n)}function Zf(e,t,n,r){var i=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var a=t[o],l=r?r(n[a],e[a],a,n,e):void 0;l===void 0&&(l=e[a]),i?ST(n,a,l):KL(n,a,l)}return n}var w9=Math.max;function XL(e,t,n){return t=w9(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=w9(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),GL(e,this,a)}}function YL(e,t){return WL(XL(e,t,sb),e+"")}var Jte=9007199254740991;function wT(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Jte}function Jf(e){return e!=null&&wT(e.length)&&!_T(e)}function QL(e,t,n){if(!vi(n))return!1;var r=typeof t;return(r=="number"?Jf(n)&&bT(t,n.length):r=="string"&&t in n)?Cm(n[t],e):!1}function ZL(e){return YL(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,s&&QL(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var a=n[r];a&&e(t,a,r,o)}return t})}var ene=Object.prototype;function xT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||ene;return e===n}function tne(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nne="[object Arguments]";function x9(e){return ps(e)&&gu(e)==nne}var JL=Object.prototype,rne=JL.hasOwnProperty,ine=JL.propertyIsEnumerable,one=x9(function(){return arguments}())?x9:function(e){return ps(e)&&rne.call(e,"callee")&&!ine.call(e,"callee")};const bg=one;function sne(){return!1}var eD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,C9=eD&&typeof module=="object"&&module&&!module.nodeType&&module,ane=C9&&C9.exports===eD,T9=ane?Js.Buffer:void 0,lne=T9?T9.isBuffer:void 0,une=lne||sne;const Sg=une;var cne="[object Arguments]",dne="[object Array]",fne="[object Boolean]",hne="[object Date]",pne="[object Error]",gne="[object Function]",mne="[object Map]",yne="[object Number]",vne="[object Object]",_ne="[object RegExp]",bne="[object Set]",Sne="[object String]",wne="[object WeakMap]",xne="[object ArrayBuffer]",Cne="[object DataView]",Tne="[object Float32Array]",Ene="[object Float64Array]",Ane="[object Int8Array]",Pne="[object Int16Array]",Rne="[object Int32Array]",One="[object Uint8Array]",kne="[object Uint8ClampedArray]",Ine="[object Uint16Array]",Mne="[object Uint32Array]",fn={};fn[Tne]=fn[Ene]=fn[Ane]=fn[Pne]=fn[Rne]=fn[One]=fn[kne]=fn[Ine]=fn[Mne]=!0;fn[cne]=fn[dne]=fn[xne]=fn[fne]=fn[Cne]=fn[hne]=fn[pne]=fn[gne]=fn[mne]=fn[yne]=fn[vne]=fn[_ne]=fn[bne]=fn[Sne]=fn[wne]=!1;function Nne(e){return ps(e)&&wT(e.length)&&!!fn[gu(e)]}function CT(e){return function(t){return e(t)}}var tD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zp=tD&&typeof module=="object"&&module&&!module.nodeType&&module,Lne=zp&&zp.exports===tD,bx=Lne&&UL.process,Dne=function(){try{var e=zp&&zp.require&&zp.require("util").types;return e||bx&&bx.binding&&bx.binding("util")}catch{}}();const Mf=Dne;var E9=Mf&&Mf.isTypedArray,$ne=E9?CT(E9):Nne;const TT=$ne;var Fne=Object.prototype,Bne=Fne.hasOwnProperty;function nD(e,t){var n=Er(e),r=!n&&bg(e),i=!n&&!r&&Sg(e),o=!n&&!r&&!i&&TT(e),s=n||r||i||o,a=s?tne(e.length,String):[],l=a.length;for(var u in e)(t||Bne.call(e,u))&&!(s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||bT(u,l)))&&a.push(u);return a}function rD(e,t){return function(n){return e(t(n))}}var Une=rD(Object.keys,Object);const zne=Une;var Vne=Object.prototype,jne=Vne.hasOwnProperty;function iD(e){if(!xT(e))return zne(e);var t=[];for(var n in Object(e))jne.call(e,n)&&n!="constructor"&&t.push(n);return t}function Tm(e){return Jf(e)?nD(e):iD(e)}function Gne(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Hne=Object.prototype,Wne=Hne.hasOwnProperty;function qne(e){if(!vi(e))return Gne(e);var t=xT(e),n=[];for(var r in e)r=="constructor"&&(t||!Wne.call(e,r))||n.push(r);return n}function Em(e){return Jf(e)?nD(e,!0):qne(e)}var Kne=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xne=/^\w*$/;function ET(e,t){if(Er(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||ob(e)?!0:Xne.test(e)||!Kne.test(e)||t!=null&&e in Object(t)}var Yne=Rc(Object,"create");const wg=Yne;function Qne(){this.__data__=wg?wg(null):{},this.size=0}function Zne(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Jne="__lodash_hash_undefined__",ere=Object.prototype,tre=ere.hasOwnProperty;function nre(e){var t=this.__data__;if(wg){var n=t[e];return n===Jne?void 0:n}return tre.call(t,e)?t[e]:void 0}var rre=Object.prototype,ire=rre.hasOwnProperty;function ore(e){var t=this.__data__;return wg?t[e]!==void 0:ire.call(t,e)}var sre="__lodash_hash_undefined__";function are(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wg&&t===void 0?sre:t,this}function pc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pc.prototype.clear=Qne;pc.prototype.delete=Zne;pc.prototype.get=nre;pc.prototype.has=ore;pc.prototype.set=are;function lre(){this.__data__=[],this.size=0}function ab(e,t){for(var n=e.length;n--;)if(Cm(e[n][0],t))return n;return-1}var ure=Array.prototype,cre=ure.splice;function dre(e){var t=this.__data__,n=ab(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():cre.call(t,n,1),--this.size,!0}function fre(e){var t=this.__data__,n=ab(t,e);return n<0?void 0:t[n][1]}function hre(e){return ab(this.__data__,e)>-1}function pre(e,t){var n=this.__data__,r=ab(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Ka(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ka.prototype.clear=lre;Ka.prototype.delete=dre;Ka.prototype.get=fre;Ka.prototype.has=hre;Ka.prototype.set=pre;var gre=Rc(Js,"Map");const xg=gre;function mre(){this.size=0,this.__data__={hash:new pc,map:new(xg||Ka),string:new pc}}function yre(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function lb(e,t){var n=e.__data__;return yre(t)?n[typeof t=="string"?"string":"hash"]:n.map}function vre(e){var t=lb(this,e).delete(e);return this.size-=t?1:0,t}function _re(e){return lb(this,e).get(e)}function bre(e){return lb(this,e).has(e)}function Sre(e,t){var n=lb(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Xa(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xa.prototype.clear=mre;Xa.prototype.delete=vre;Xa.prototype.get=_re;Xa.prototype.has=bre;Xa.prototype.set=Sre;var wre="Expected a function";function AT(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(wre);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(AT.Cache||Xa),n}AT.Cache=Xa;var xre=500;function Cre(e){var t=AT(e,function(r){return n.size===xre&&n.clear(),r}),n=t.cache;return t}var Tre=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ere=/\\(\\)?/g,Are=Cre(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Tre,function(n,r,i,o){t.push(i?o.replace(Ere,"$1"):r||n)}),t});const Pre=Are;function ub(e){return e==null?"":jL(e)}function cb(e,t){return Er(e)?e:ET(e,t)?[e]:Pre(ub(e))}var Rre=1/0;function Am(e){if(typeof e=="string"||ob(e))return e;var t=e+"";return t=="0"&&1/e==-Rre?"-0":t}function PT(e,t){t=cb(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Am(t[n++])];return n&&n==r?e:void 0}function Ore(e,t,n){var r=e==null?void 0:PT(e,t);return r===void 0?n:r}function RT(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var A9=No?No.isConcatSpreadable:void 0;function kre(e){return Er(e)||bg(e)||!!(A9&&e&&e[A9])}function oD(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=kre),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?oD(a,t-1,n,r,i):RT(i,a):r||(i[i.length]=a)}return i}function Ire(e){var t=e==null?0:e.length;return t?oD(e,1):[]}function Mre(e){return WL(XL(e,void 0,Ire),e+"")}var Nre=rD(Object.getPrototypeOf,Object);const OT=Nre;var Lre="[object Object]",Dre=Function.prototype,$re=Object.prototype,sD=Dre.toString,Fre=$re.hasOwnProperty,Bre=sD.call(Object);function aD(e){if(!ps(e)||gu(e)!=Lre)return!1;var t=OT(e);if(t===null)return!0;var n=Fre.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&sD.call(n)==Bre}function lD(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function Ure(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:lD(e,t,n)}var zre="\\ud800-\\udfff",Vre="\\u0300-\\u036f",jre="\\ufe20-\\ufe2f",Gre="\\u20d0-\\u20ff",Hre=Vre+jre+Gre,Wre="\\ufe0e\\ufe0f",qre="\\u200d",Kre=RegExp("["+qre+zre+Hre+Wre+"]");function kT(e){return Kre.test(e)}function Xre(e){return e.split("")}var uD="\\ud800-\\udfff",Yre="\\u0300-\\u036f",Qre="\\ufe20-\\ufe2f",Zre="\\u20d0-\\u20ff",Jre=Yre+Qre+Zre,eie="\\ufe0e\\ufe0f",tie="["+uD+"]",P3="["+Jre+"]",R3="\\ud83c[\\udffb-\\udfff]",nie="(?:"+P3+"|"+R3+")",cD="[^"+uD+"]",dD="(?:\\ud83c[\\udde6-\\uddff]){2}",fD="[\\ud800-\\udbff][\\udc00-\\udfff]",rie="\\u200d",hD=nie+"?",pD="["+eie+"]?",iie="(?:"+rie+"(?:"+[cD,dD,fD].join("|")+")"+pD+hD+")*",oie=pD+hD+iie,sie="(?:"+[cD+P3+"?",P3,dD,fD,tie].join("|")+")",aie=RegExp(R3+"(?="+R3+")|"+sie+oie,"g");function lie(e){return e.match(aie)||[]}function uie(e){return kT(e)?lie(e):Xre(e)}function cie(e){return function(t){t=ub(t);var n=kT(t)?uie(t):void 0,r=n?n[0]:t.charAt(0),i=n?Ure(n,1).join(""):t.slice(1);return r[e]()+i}}var die=cie("toUpperCase");const fie=die;function gD(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function hie(e){return function(t){return e==null?void 0:e[t]}}var pie={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},gie=hie(pie);const mie=gie;var yie=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vie="\\u0300-\\u036f",_ie="\\ufe20-\\ufe2f",bie="\\u20d0-\\u20ff",Sie=vie+_ie+bie,wie="["+Sie+"]",xie=RegExp(wie,"g");function Cie(e){return e=ub(e),e&&e.replace(yie,mie).replace(xie,"")}var Tie=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Eie(e){return e.match(Tie)||[]}var Aie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Pie(e){return Aie.test(e)}var mD="\\ud800-\\udfff",Rie="\\u0300-\\u036f",Oie="\\ufe20-\\ufe2f",kie="\\u20d0-\\u20ff",Iie=Rie+Oie+kie,yD="\\u2700-\\u27bf",vD="a-z\\xdf-\\xf6\\xf8-\\xff",Mie="\\xac\\xb1\\xd7\\xf7",Nie="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lie="\\u2000-\\u206f",Die=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",_D="A-Z\\xc0-\\xd6\\xd8-\\xde",$ie="\\ufe0e\\ufe0f",bD=Mie+Nie+Lie+Die,SD="['’]",P9="["+bD+"]",Fie="["+Iie+"]",wD="\\d+",Bie="["+yD+"]",xD="["+vD+"]",CD="[^"+mD+bD+wD+yD+vD+_D+"]",Uie="\\ud83c[\\udffb-\\udfff]",zie="(?:"+Fie+"|"+Uie+")",Vie="[^"+mD+"]",TD="(?:\\ud83c[\\udde6-\\uddff]){2}",ED="[\\ud800-\\udbff][\\udc00-\\udfff]",Pd="["+_D+"]",jie="\\u200d",R9="(?:"+xD+"|"+CD+")",Gie="(?:"+Pd+"|"+CD+")",O9="(?:"+SD+"(?:d|ll|m|re|s|t|ve))?",k9="(?:"+SD+"(?:D|LL|M|RE|S|T|VE))?",AD=zie+"?",PD="["+$ie+"]?",Hie="(?:"+jie+"(?:"+[Vie,TD,ED].join("|")+")"+PD+AD+")*",Wie="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qie="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kie=PD+AD+Hie,Xie="(?:"+[Bie,TD,ED].join("|")+")"+Kie,Yie=RegExp([Pd+"?"+xD+"+"+O9+"(?="+[P9,Pd,"$"].join("|")+")",Gie+"+"+k9+"(?="+[P9,Pd+R9,"$"].join("|")+")",Pd+"?"+R9+"+"+O9,Pd+"+"+k9,qie,Wie,wD,Xie].join("|"),"g");function Qie(e){return e.match(Yie)||[]}function Zie(e,t,n){return e=ub(e),t=n?void 0:t,t===void 0?Pie(e)?Qie(e):Eie(e):e.match(t)||[]}var Jie="['’]",eoe=RegExp(Jie,"g");function toe(e){return function(t){return gD(Zie(Cie(t).replace(eoe,"")),e,"")}}function noe(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Ml(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=vx(n),n=n===n?n:0),t!==void 0&&(t=vx(t),t=t===t?t:0),noe(vx(e),t,n)}function roe(){this.__data__=new Ka,this.size=0}function ioe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ooe(e){return this.__data__.get(e)}function soe(e){return this.__data__.has(e)}var aoe=200;function loe(e,t){var n=this.__data__;if(n instanceof Ka){var r=n.__data__;if(!xg||r.length<aoe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xa(r)}return n.set(e,t),this.size=n.size,this}function ls(e){var t=this.__data__=new Ka(e);this.size=t.size}ls.prototype.clear=roe;ls.prototype.delete=ioe;ls.prototype.get=ooe;ls.prototype.has=soe;ls.prototype.set=loe;function uoe(e,t){return e&&Zf(t,Tm(t),e)}function coe(e,t){return e&&Zf(t,Em(t),e)}var RD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,I9=RD&&typeof module=="object"&&module&&!module.nodeType&&module,doe=I9&&I9.exports===RD,M9=doe?Js.Buffer:void 0,N9=M9?M9.allocUnsafe:void 0;function OD(e,t){if(t)return e.slice();var n=e.length,r=N9?N9(n):new e.constructor(n);return e.copy(r),r}function kD(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function ID(){return[]}var foe=Object.prototype,hoe=foe.propertyIsEnumerable,L9=Object.getOwnPropertySymbols,poe=L9?function(e){return e==null?[]:(e=Object(e),kD(L9(e),function(t){return hoe.call(e,t)}))}:ID;const IT=poe;function goe(e,t){return Zf(e,IT(e),t)}var moe=Object.getOwnPropertySymbols,yoe=moe?function(e){for(var t=[];e;)RT(t,IT(e)),e=OT(e);return t}:ID;const MD=yoe;function voe(e,t){return Zf(e,MD(e),t)}function ND(e,t,n){var r=t(e);return Er(e)?r:RT(r,n(e))}function O3(e){return ND(e,Tm,IT)}function LD(e){return ND(e,Em,MD)}var _oe=Rc(Js,"DataView");const k3=_oe;var boe=Rc(Js,"Promise");const I3=boe;var Soe=Rc(Js,"Set");const df=Soe;var D9="[object Map]",woe="[object Object]",$9="[object Promise]",F9="[object Set]",B9="[object WeakMap]",U9="[object DataView]",xoe=Pc(k3),Coe=Pc(xg),Toe=Pc(I3),Eoe=Pc(df),Aoe=Pc(A3),zu=gu;(k3&&zu(new k3(new ArrayBuffer(1)))!=U9||xg&&zu(new xg)!=D9||I3&&zu(I3.resolve())!=$9||df&&zu(new df)!=F9||A3&&zu(new A3)!=B9)&&(zu=function(e){var t=gu(e),n=t==woe?e.constructor:void 0,r=n?Pc(n):"";if(r)switch(r){case xoe:return U9;case Coe:return D9;case Toe:return $9;case Eoe:return F9;case Aoe:return B9}return t});const Nf=zu;var Poe=Object.prototype,Roe=Poe.hasOwnProperty;function Ooe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Roe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var koe=Js.Uint8Array;const C1=koe;function MT(e){var t=new e.constructor(e.byteLength);return new C1(t).set(new C1(e)),t}function Ioe(e,t){var n=t?MT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Moe=/\w*$/;function Noe(e){var t=new e.constructor(e.source,Moe.exec(e));return t.lastIndex=e.lastIndex,t}var z9=No?No.prototype:void 0,V9=z9?z9.valueOf:void 0;function Loe(e){return V9?Object(V9.call(e)):{}}function DD(e,t){var n=t?MT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Doe="[object Boolean]",$oe="[object Date]",Foe="[object Map]",Boe="[object Number]",Uoe="[object RegExp]",zoe="[object Set]",Voe="[object String]",joe="[object Symbol]",Goe="[object ArrayBuffer]",Hoe="[object DataView]",Woe="[object Float32Array]",qoe="[object Float64Array]",Koe="[object Int8Array]",Xoe="[object Int16Array]",Yoe="[object Int32Array]",Qoe="[object Uint8Array]",Zoe="[object Uint8ClampedArray]",Joe="[object Uint16Array]",ese="[object Uint32Array]";function tse(e,t,n){var r=e.constructor;switch(t){case Goe:return MT(e);case Doe:case $oe:return new r(+e);case Hoe:return Ioe(e,n);case Woe:case qoe:case Koe:case Xoe:case Yoe:case Qoe:case Zoe:case Joe:case ese:return DD(e,n);case Foe:return new r;case Boe:case Voe:return new r(e);case Uoe:return Noe(e);case zoe:return new r;case joe:return Loe(e)}}function $D(e){return typeof e.constructor=="function"&&!xT(e)?Mte(OT(e)):{}}var nse="[object Map]";function rse(e){return ps(e)&&Nf(e)==nse}var j9=Mf&&Mf.isMap,ise=j9?CT(j9):rse;const ose=ise;var sse="[object Set]";function ase(e){return ps(e)&&Nf(e)==sse}var G9=Mf&&Mf.isSet,lse=G9?CT(G9):ase;const use=lse;var cse=1,dse=2,fse=4,FD="[object Arguments]",hse="[object Array]",pse="[object Boolean]",gse="[object Date]",mse="[object Error]",BD="[object Function]",yse="[object GeneratorFunction]",vse="[object Map]",_se="[object Number]",UD="[object Object]",bse="[object RegExp]",Sse="[object Set]",wse="[object String]",xse="[object Symbol]",Cse="[object WeakMap]",Tse="[object ArrayBuffer]",Ese="[object DataView]",Ase="[object Float32Array]",Pse="[object Float64Array]",Rse="[object Int8Array]",Ose="[object Int16Array]",kse="[object Int32Array]",Ise="[object Uint8Array]",Mse="[object Uint8ClampedArray]",Nse="[object Uint16Array]",Lse="[object Uint32Array]",rn={};rn[FD]=rn[hse]=rn[Tse]=rn[Ese]=rn[pse]=rn[gse]=rn[Ase]=rn[Pse]=rn[Rse]=rn[Ose]=rn[kse]=rn[vse]=rn[_se]=rn[UD]=rn[bse]=rn[Sse]=rn[wse]=rn[xse]=rn[Ise]=rn[Mse]=rn[Nse]=rn[Lse]=!0;rn[mse]=rn[BD]=rn[Cse]=!1;function Vp(e,t,n,r,i,o){var s,a=t&cse,l=t&dse,u=t&fse;if(n&&(s=i?n(e,r,i,o):n(e)),s!==void 0)return s;if(!vi(e))return e;var d=Er(e);if(d){if(s=Ooe(e),!a)return HL(e,s)}else{var f=Nf(e),h=f==BD||f==yse;if(Sg(e))return OD(e,a);if(f==UD||f==FD||h&&!i){if(s=l||h?{}:$D(e),!a)return l?voe(e,coe(s,e)):goe(e,uoe(s,e))}else{if(!rn[f])return i?e:{};s=tse(e,f,a)}}o||(o=new ls);var g=o.get(e);if(g)return g;o.set(e,s),use(e)?e.forEach(function(x){s.add(Vp(x,t,n,x,e,o))}):ose(e)&&e.forEach(function(x,_){s.set(_,Vp(x,t,n,_,e,o))});var m=u?l?LD:O3:l?Em:Tm,v=d?void 0:m(e);return qL(v||e,function(x,_){v&&(_=x,x=e[_]),KL(s,_,Vp(x,t,n,_,e,o))}),s}var Dse=1,$se=4;function Qr(e){return Vp(e,Dse|$se)}var Fse="__lodash_hash_undefined__";function Bse(e){return this.__data__.set(e,Fse),this}function Use(e){return this.__data__.has(e)}function Cg(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Xa;++t<n;)this.add(e[t])}Cg.prototype.add=Cg.prototype.push=Bse;Cg.prototype.has=Use;function zD(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function VD(e,t){return e.has(t)}var zse=1,Vse=2;function jD(e,t,n,r,i,o){var s=n&zse,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,g=n&Vse?new Cg:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var m=e[f],v=t[f];if(r)var x=s?r(v,m,f,t,e,o):r(m,v,f,e,t,o);if(x!==void 0){if(x)continue;h=!1;break}if(g){if(!zD(t,function(_,b){if(!VD(g,b)&&(m===_||i(m,_,n,r,o)))return g.push(b)})){h=!1;break}}else if(!(m===v||i(m,v,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function jse(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function NT(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Gse=1,Hse=2,Wse="[object Boolean]",qse="[object Date]",Kse="[object Error]",Xse="[object Map]",Yse="[object Number]",Qse="[object RegExp]",Zse="[object Set]",Jse="[object String]",eae="[object Symbol]",tae="[object ArrayBuffer]",nae="[object DataView]",H9=No?No.prototype:void 0,Sx=H9?H9.valueOf:void 0;function rae(e,t,n,r,i,o,s){switch(n){case nae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case tae:return!(e.byteLength!=t.byteLength||!o(new C1(e),new C1(t)));case Wse:case qse:case Yse:return Cm(+e,+t);case Kse:return e.name==t.name&&e.message==t.message;case Qse:case Jse:return e==t+"";case Xse:var a=jse;case Zse:var l=r&Gse;if(a||(a=NT),e.size!=t.size&&!l)return!1;var u=s.get(e);if(u)return u==t;r|=Hse,s.set(e,t);var d=jD(a(e),a(t),r,i,o,s);return s.delete(e),d;case eae:if(Sx)return Sx.call(e)==Sx.call(t)}return!1}var iae=1,oae=Object.prototype,sae=oae.hasOwnProperty;function aae(e,t,n,r,i,o){var s=n&iae,a=O3(e),l=a.length,u=O3(t),d=u.length;if(l!=d&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in t:sae.call(t,h)))return!1}var g=o.get(e),m=o.get(t);if(g&&m)return g==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var x=s;++f<l;){h=a[f];var _=e[h],b=t[h];if(r)var y=s?r(b,_,h,t,e,o):r(_,b,h,e,t,o);if(!(y===void 0?_===b||i(_,b,n,r,o):y)){v=!1;break}x||(x=h=="constructor")}if(v&&!x){var S=e.constructor,C=t.constructor;S!=C&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof C=="function"&&C instanceof C)&&(v=!1)}return o.delete(e),o.delete(t),v}var lae=1,W9="[object Arguments]",q9="[object Array]",E0="[object Object]",uae=Object.prototype,K9=uae.hasOwnProperty;function cae(e,t,n,r,i,o){var s=Er(e),a=Er(t),l=s?q9:Nf(e),u=a?q9:Nf(t);l=l==W9?E0:l,u=u==W9?E0:u;var d=l==E0,f=u==E0,h=l==u;if(h&&Sg(e)){if(!Sg(t))return!1;s=!0,d=!1}if(h&&!d)return o||(o=new ls),s||TT(e)?jD(e,t,n,r,i,o):rae(e,t,l,n,r,i,o);if(!(n&lae)){var g=d&&K9.call(e,"__wrapped__"),m=f&&K9.call(t,"__wrapped__");if(g||m){var v=g?e.value():e,x=m?t.value():t;return o||(o=new ls),i(v,x,n,r,o)}}return h?(o||(o=new ls),aae(e,t,n,r,i,o)):!1}function db(e,t,n,r,i){return e===t?!0:e==null||t==null||!ps(e)&&!ps(t)?e!==e&&t!==t:cae(e,t,n,r,db,i)}var dae=1,fae=2;function hae(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],u=e[l],d=a[1];if(s&&a[2]){if(u===void 0&&!(l in e))return!1}else{var f=new ls;if(r)var h=r(u,d,l,e,t,f);if(!(h===void 0?db(d,u,dae|fae,r,f):h))return!1}}return!0}function GD(e){return e===e&&!vi(e)}function pae(e){for(var t=Tm(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,GD(i)]}return t}function HD(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function gae(e){var t=pae(e);return t.length==1&&t[0][2]?HD(t[0][0],t[0][1]):function(n){return n===e||hae(n,e,t)}}function mae(e,t){return e!=null&&t in Object(e)}function yae(e,t,n){t=cb(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=Am(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&wT(i)&&bT(s,i)&&(Er(e)||bg(e)))}function vae(e,t){return e!=null&&yae(e,t,mae)}var _ae=1,bae=2;function Sae(e,t){return ET(e)&&GD(t)?HD(Am(e),t):function(n){var r=Ore(n,e);return r===void 0&&r===t?vae(n,e):db(t,r,_ae|bae)}}function WD(e){return function(t){return t==null?void 0:t[e]}}function wae(e){return function(t){return PT(t,e)}}function xae(e){return ET(e)?WD(Am(e)):wae(e)}function fb(e){return typeof e=="function"?e:e==null?sb:typeof e=="object"?Er(e)?Sae(e[0],e[1]):gae(e):xae(e)}function Cae(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var Tae=Cae();const qD=Tae;function Eae(e,t){return e&&qD(e,t,Tm)}function Aae(e,t){return function(n,r){if(n==null)return n;if(!Jf(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var Pae=Aae(Eae);const hb=Pae;function M3(e,t,n){(n!==void 0&&!Cm(e[t],n)||n===void 0&&!(t in e))&&ST(e,t,n)}function Rae(e){return ps(e)&&Jf(e)}function N3(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Oae(e){return Zf(e,Em(e))}function kae(e,t,n,r,i,o,s){var a=N3(e,n),l=N3(t,n),u=s.get(l);if(u){M3(e,n,u);return}var d=o?o(a,l,n+"",e,t,s):void 0,f=d===void 0;if(f){var h=Er(l),g=!h&&Sg(l),m=!h&&!g&&TT(l);d=l,h||g||m?Er(a)?d=a:Rae(a)?d=HL(a):g?(f=!1,d=OD(l,!0)):m?(f=!1,d=DD(l,!0)):d=[]:aD(l)||bg(l)?(d=a,bg(a)?d=Oae(a):(!vi(a)||_T(a))&&(d=$D(l))):f=!1}f&&(s.set(l,d),i(d,l,r,o,s),s.delete(l)),M3(e,n,d)}function pb(e,t,n,r,i){e!==t&&qD(t,function(o,s){if(i||(i=new ls),vi(o))kae(e,t,s,n,pb,r,i);else{var a=r?r(N3(e,s),o,s+"",e,t,i):void 0;a===void 0&&(a=o),M3(e,s,a)}},Em)}function KD(e,t,n,r,i,o){return vi(e)&&vi(t)&&(o.set(t,e),pb(e,t,void 0,KD,o),o.delete(t)),e}var Iae=ZL(function(e,t,n,r){pb(e,t,n,r)});const Mae=Iae;var Nae=YL(function(e){return e.push(void 0,KD),GL(Mae,void 0,e)});const Lae=Nae;function Dae(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function $ae(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Fae(e){return typeof e=="function"?e:sb}function gc(e,t){var n=Er(e)?qL:hb;return n(e,Fae(t))}function Bae(e,t){var n=[];return hb(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}function XD(e,t){var n=Er(e)?kD:Bae;return n(e,fb(t))}var Uae="[object String]";function zae(e){return typeof e=="string"||!Er(e)&&ps(e)&&gu(e)==Uae}function Vae(e,t){return t.length<2?e:PT(e,lD(t,0,-1))}function gb(e,t){return db(e,t)}var jae=ZL(function(e,t,n){pb(e,t,n)});const Gae=jae;function YD(e,t){return t=cb(t,e),e=Vae(e,t),e==null||delete e[Am($ae(t))]}function Hae(e){return aD(e)?void 0:e}var Wae=1,qae=2,Kae=4,Xae=Mre(function(e,t){var n={};if(e==null)return n;var r=!1;t=VL(t,function(o){return o=cb(o,e),r||(r=o.length>1),o}),Zf(e,LD(e),n),r&&(n=Vp(n,Wae|qae|Kae,Hae));for(var i=t.length;i--;)YD(n,t[i]);return n});const mb=Xae;var Yae=WD("length");const Qae=Yae;var QD="\\ud800-\\udfff",Zae="\\u0300-\\u036f",Jae="\\ufe20-\\ufe2f",ele="\\u20d0-\\u20ff",tle=Zae+Jae+ele,nle="\\ufe0e\\ufe0f",rle="["+QD+"]",L3="["+tle+"]",D3="\\ud83c[\\udffb-\\udfff]",ile="(?:"+L3+"|"+D3+")",ZD="[^"+QD+"]",JD="(?:\\ud83c[\\udde6-\\uddff]){2}",e$="[\\ud800-\\udbff][\\udc00-\\udfff]",ole="\\u200d",t$=ile+"?",n$="["+nle+"]?",sle="(?:"+ole+"(?:"+[ZD,JD,e$].join("|")+")"+n$+t$+")*",ale=n$+t$+sle,lle="(?:"+[ZD+L3+"?",L3,JD,e$,rle].join("|")+")",X9=RegExp(D3+"(?="+D3+")|"+lle+ale,"g");function ule(e){for(var t=X9.lastIndex=0;X9.test(e);)++t;return t}function cle(e){return kT(e)?ule(e):Qae(e)}function dle(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}function LT(e,t,n){var r=Er(e)?gD:dle,i=arguments.length<3;return r(e,fb(t),n,i,hb)}var fle="[object Map]",hle="[object Set]";function DT(e){if(e==null)return 0;if(Jf(e))return zae(e)?cle(e):e.length;var t=Nf(e);return t==fle||t==hle?e.size:iD(e).length}function ple(e,t){var n;return hb(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function Hu(e,t,n){var r=Er(e)?zD:ple;return n&&QL(e,t,n)&&(t=void 0),r(e,fb(t))}var gle=toe(function(e,t,n){return e+(n?" ":"")+fie(t)});const mle=gle;var yle=1/0,vle=df&&1/NT(new df([,-0]))[1]==yle?function(e){return new df(e)}:Nte;const _le=vle;var ble=200;function Sle(e,t,n){var r=-1,i=Kte,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=Dae;else if(o>=ble){var u=t?null:_le(e);if(u)return NT(u);s=!1,i=VD,l=new Cg}else l=t?[]:a;e:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var h=l.length;h--;)if(l[h]===f)continue e;t&&l.push(f),a.push(d)}else i(l,f,n)||(l!==a&&l.push(f),a.push(d))}return a}function wle(e,t){return e&&e.length?Sle(e,fb(t)):[]}function xle(e,t){return e==null?!0:YD(e,t)}const r$={shouldUpdateImagesOnConnect:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches"],disabledSDFeatures:["variation","seamless","symmetry","hires","perlinNoise","noiseThreshold"],canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:20,inputMax:9999,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},i$=An({name:"config",initialState:r$,reducers:{configChanged:(e,t)=>{Gae(e,t.payload)}}}),{configChanged:Cle}=i$.actions,Tle=i$.reducer,CRe={"sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},TRe={"sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Ele={"sd-1":{maxClip:12,markers:[0,1,2,3,4,8,12]},"sd-2":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},sdxl:{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},"sdxl-refiner":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]}},ERe={lycoris:"LyCORIS",diffusers:"Diffusers"},ARe=0,Ale=4294967295;var kt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(kt||(kt={}));var $3;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})($3||($3={}));const Ce=kt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Rl=e=>{switch(typeof e){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return isNaN(e)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(e)?Ce.array:e===null?Ce.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ce.promise:typeof Map<"u"&&e instanceof Map?Ce.map:typeof Set<"u"&&e instanceof Set?Ce.set:typeof Date<"u"&&e instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},me=kt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ple=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class us extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,kt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}us.create=e=>new us(e);const Tg=(e,t)=>{let n;switch(e.code){case me.invalid_type:e.received===Ce.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case me.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,kt.jsonStringifyReplacer)}`;break;case me.unrecognized_keys:n=`Unrecognized key(s) in object: ${kt.joinValues(e.keys,", ")}`;break;case me.invalid_union:n="Invalid input";break;case me.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${kt.joinValues(e.options)}`;break;case me.invalid_enum_value:n=`Invalid enum value. Expected ${kt.joinValues(e.options)}, received '${e.received}'`;break;case me.invalid_arguments:n="Invalid function arguments";break;case me.invalid_return_type:n="Invalid function return type";break;case me.invalid_date:n="Invalid date";break;case me.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:kt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case me.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case me.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case me.custom:n="Invalid input";break;case me.invalid_intersection_types:n="Intersection results could not be merged";break;case me.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case me.not_finite:n="Number must be finite";break;default:n=t.defaultError,kt.assertNever(e)}return{message:n}};let o$=Tg;function Rle(e){o$=e}function T1(){return o$}const E1=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},Ole=[];function Ee(e,t){const n=E1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,T1(),Tg].filter(r=>!!r)});e.common.issues.push(n)}class ri{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Ye;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return ri.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Ye;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const Ye=Object.freeze({status:"aborted"}),s$=e=>({status:"dirty",value:e}),_i=e=>({status:"valid",value:e}),F3=e=>e.status==="aborted",B3=e=>e.status==="dirty",A1=e=>e.status==="valid",P1=e=>typeof Promise<"u"&&e instanceof Promise;var ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ze||(ze={}));class Ks{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Y9=(e,t)=>{if(A1(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new us(e.common.issues);return this._error=n,this._error}}};function ot(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class ct{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Rl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Rl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ri,ctx:{common:t.parent.common,data:t.data,parsedType:Rl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(P1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rl(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Y9(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Rl(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(P1(i)?i:Promise.resolve(i));return Y9(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:me.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new gs({schema:this,typeName:qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ma.create(this,this._def)}nullable(){return vc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cs.create(this,this._def)}promise(){return Df.create(this,this._def)}or(t){return Rg.create([this,t],this._def)}and(t){return Og.create(this,t,this._def)}transform(t){return new gs({...ot(this._def),schema:this,typeName:qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Lg({...ot(this._def),innerType:this,defaultValue:n,typeName:qe.ZodDefault})}brand(){return new l$({typeName:qe.ZodBranded,type:this,...ot(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new I1({...ot(this._def),innerType:this,catchValue:n,typeName:qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Pm.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kle=/^c[^\s-]{8,}$/i,Ile=/^[a-z][a-z0-9]*$/,Mle=/[0-9A-HJKMNP-TV-Z]{26}/,Nle=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,Lle=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,Dle=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,$le=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Fle=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ble=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Ule(e,t){return!!((t==="v4"||!t)&&$le.test(e)||(t==="v6"||!t)&&Fle.test(e))}class os extends ct{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:me.invalid_string,...ze.errToObj(r)}),this.nonempty=t=>this.min(1,ze.errToObj(t)),this.trim=()=>new os({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new os({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new os({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ce.string){const o=this._getOrReturnCtx(t);return Ee(o,{code:me.invalid_type,expected:Ce.string,received:o.parsedType}),Ye}const r=new ri;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ee(i,{code:me.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ee(i,{code:me.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Lle.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"email",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Dle.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"emoji",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Nle.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"uuid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")kle.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"cuid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Ile.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"cuid2",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Mle.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"ulid",code:me.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ee(i,{validation:"url",code:me.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"regex",code:me.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Ble(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Ule(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ee(i,{validation:"ip",code:me.invalid_string,message:o.message}),r.dirty()):kt.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new os({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ze.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}os.create=e=>{var t;return new os({checks:[],typeName:qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ot(e)})};function zle(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class eu extends ct{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ce.number){const o=this._getOrReturnCtx(t);return Ee(o,{code:me.invalid_type,expected:Ce.number,received:o.parsedType}),Ye}let r;const i=new ri;for(const o of this._def.checks)o.kind==="int"?kt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?zle(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.not_finite,message:o.message}),i.dirty()):kt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,i){return new eu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(i)}]})}_addCheck(t){return new eu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&kt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}eu.create=e=>new eu({checks:[],typeName:qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class tu extends ct{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ce.bigint){const o=this._getOrReturnCtx(t);return Ee(o,{code:me.invalid_type,expected:Ce.bigint,received:o.parsedType}),Ye}let r;const i=new ri;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ee(r,{code:me.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):kt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ze.toString(n))}setLimit(t,n,r,i){return new tu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ze.toString(i)}]})}_addCheck(t){return new tu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}tu.create=e=>{var t;return new tu({checks:[],typeName:qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ot(e)})};class Eg extends ct{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ce.boolean){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.boolean,received:r.parsedType}),Ye}return _i(t.data)}}Eg.create=e=>new Eg({typeName:qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ot(e)});class mc extends ct{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ce.date){const o=this._getOrReturnCtx(t);return Ee(o,{code:me.invalid_type,expected:Ce.date,received:o.parsedType}),Ye}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ee(o,{code:me.invalid_date}),Ye}const r=new ri;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ee(i,{code:me.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):kt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new mc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}mc.create=e=>new mc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:qe.ZodDate,...ot(e)});class R1 extends ct{_parse(t){if(this._getType(t)!==Ce.symbol){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.symbol,received:r.parsedType}),Ye}return _i(t.data)}}R1.create=e=>new R1({typeName:qe.ZodSymbol,...ot(e)});class Ag extends ct{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.undefined,received:r.parsedType}),Ye}return _i(t.data)}}Ag.create=e=>new Ag({typeName:qe.ZodUndefined,...ot(e)});class Pg extends ct{_parse(t){if(this._getType(t)!==Ce.null){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.null,received:r.parsedType}),Ye}return _i(t.data)}}Pg.create=e=>new Pg({typeName:qe.ZodNull,...ot(e)});class Lf extends ct{constructor(){super(...arguments),this._any=!0}_parse(t){return _i(t.data)}}Lf.create=e=>new Lf({typeName:qe.ZodAny,...ot(e)});class ic extends ct{constructor(){super(...arguments),this._unknown=!0}_parse(t){return _i(t.data)}}ic.create=e=>new ic({typeName:qe.ZodUnknown,...ot(e)});class Ga extends ct{_parse(t){const n=this._getOrReturnCtx(t);return Ee(n,{code:me.invalid_type,expected:Ce.never,received:n.parsedType}),Ye}}Ga.create=e=>new Ga({typeName:qe.ZodNever,...ot(e)});class O1 extends ct{_parse(t){if(this._getType(t)!==Ce.undefined){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.void,received:r.parsedType}),Ye}return _i(t.data)}}O1.create=e=>new O1({typeName:qe.ZodVoid,...ot(e)});class cs extends ct{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Ce.array)return Ee(n,{code:me.invalid_type,expected:Ce.array,received:n.parsedType}),Ye;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ee(n,{code:s?me.too_big:me.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ee(n,{code:me.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ee(n,{code:me.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Ks(n,s,n.path,a)))).then(s=>ri.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Ks(n,s,n.path,a)));return ri.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new cs({...this._def,minLength:{value:t,message:ze.toString(n)}})}max(t,n){return new cs({...this._def,maxLength:{value:t,message:ze.toString(n)}})}length(t,n){return new cs({...this._def,exactLength:{value:t,message:ze.toString(n)}})}nonempty(t){return this.min(1,t)}}cs.create=(e,t)=>new cs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qe.ZodArray,...ot(t)});function Rd(e){if(e instanceof Tn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ma.create(Rd(r))}return new Tn({...e._def,shape:()=>t})}else return e instanceof cs?new cs({...e._def,type:Rd(e.element)}):e instanceof Ma?Ma.create(Rd(e.unwrap())):e instanceof vc?vc.create(Rd(e.unwrap())):e instanceof Xs?Xs.create(e.items.map(t=>Rd(t))):e}class Tn extends ct{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=kt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Ce.object){const u=this._getOrReturnCtx(t);return Ee(u,{code:me.invalid_type,expected:Ce.object,received:u.parsedType}),Ye}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ga&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||a.push(u);const l=[];for(const u of s){const d=o[u],f=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Ks(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Ga){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")a.length>0&&(Ee(i,{code:me.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of a){const f=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Ks(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const f=await d.key;u.push({key:f,value:await d.value,alwaysSet:d.alwaysSet})}return u}).then(u=>ri.mergeObjectSync(r,u)):ri.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ze.errToObj,new Tn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ze.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Tn({...this._def,unknownKeys:"strip"})}passthrough(){return new Tn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Tn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Tn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Tn({...this._def,catchall:t})}pick(t){const n={};return kt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Tn({...this._def,shape:()=>n})}omit(t){const n={};return kt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Tn({...this._def,shape:()=>n})}deepPartial(){return Rd(this)}partial(t){const n={};return kt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Tn({...this._def,shape:()=>n})}required(t){const n={};return kt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Ma;)o=o._def.innerType;n[r]=o}}),new Tn({...this._def,shape:()=>n})}keyof(){return a$(kt.objectKeys(this.shape))}}Tn.create=(e,t)=>new Tn({shape:()=>e,unknownKeys:"strip",catchall:Ga.create(),typeName:qe.ZodObject,...ot(t)});Tn.strictCreate=(e,t)=>new Tn({shape:()=>e,unknownKeys:"strict",catchall:Ga.create(),typeName:qe.ZodObject,...ot(t)});Tn.lazycreate=(e,t)=>new Tn({shape:e,unknownKeys:"strip",catchall:Ga.create(),typeName:qe.ZodObject,...ot(t)});class Rg extends ct{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new us(a.ctx.common.issues));return Ee(n,{code:me.invalid_union,unionErrors:s}),Ye}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},d=l._parseSync({data:n.data,path:n.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new us(l));return Ee(n,{code:me.invalid_union,unionErrors:a}),Ye}}get options(){return this._def.options}}Rg.create=(e,t)=>new Rg({options:e,typeName:qe.ZodUnion,...ot(t)});const xv=e=>e instanceof Ig?xv(e.schema):e instanceof gs?xv(e.innerType()):e instanceof Mg?[e.value]:e instanceof nu?e.options:e instanceof Ng?Object.keys(e.enum):e instanceof Lg?xv(e._def.innerType):e instanceof Ag?[void 0]:e instanceof Pg?[null]:null;class yb extends ct{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.object)return Ee(n,{code:me.invalid_type,expected:Ce.object,received:n.parsedType}),Ye;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ee(n,{code:me.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ye)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=xv(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new yb({typeName:qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ot(r)})}}function U3(e,t){const n=Rl(e),r=Rl(t);if(e===t)return{valid:!0,data:e};if(n===Ce.object&&r===Ce.object){const i=kt.objectKeys(t),o=kt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const l=U3(e[a],t[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===Ce.array&&r===Ce.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],l=U3(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ce.date&&r===Ce.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Og extends ct{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(F3(o)||F3(s))return Ye;const a=U3(o.value,s.value);return a.valid?((B3(o)||B3(s))&&n.dirty(),{status:n.value,value:a.data}):(Ee(r,{code:me.invalid_intersection_types}),Ye)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Og.create=(e,t,n)=>new Og({left:e,right:t,typeName:qe.ZodIntersection,...ot(n)});class Xs extends ct{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.array)return Ee(r,{code:me.invalid_type,expected:Ce.array,received:r.parsedType}),Ye;if(r.data.length<this._def.items.length)return Ee(r,{code:me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;!this._def.rest&&r.data.length>this._def.items.length&&(Ee(r,{code:me.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Ks(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ri.mergeArray(n,s)):ri.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Xs({...this._def,rest:t})}}Xs.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xs({items:e,typeName:qe.ZodTuple,rest:null,...ot(t)})};class kg extends ct{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.object)return Ee(r,{code:me.invalid_type,expected:Ce.object,received:r.parsedType}),Ye;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Ks(r,a,r.path,a)),value:s._parse(new Ks(r,r.data[a],r.path,a))});return r.common.async?ri.mergeObjectAsync(n,i):ri.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ct?new kg({keyType:t,valueType:n,typeName:qe.ZodRecord,...ot(r)}):new kg({keyType:os.create(),valueType:t,typeName:qe.ZodRecord,...ot(n)})}}class k1 extends ct{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.map)return Ee(r,{code:me.invalid_type,expected:Ce.map,received:r.parsedType}),Ye;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new Ks(r,a,r.path,[u,"key"])),value:o._parse(new Ks(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Ye;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Ye;(u.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(u.value,d.value)}return{status:n.value,value:a}}}}k1.create=(e,t,n)=>new k1({valueType:t,keyType:e,typeName:qe.ZodMap,...ot(n)});class yc extends ct{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ce.set)return Ee(r,{code:me.invalid_type,expected:Ce.set,received:r.parsedType}),Ye;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ee(r,{code:me.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ee(r,{code:me.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const u=new Set;for(const d of l){if(d.status==="aborted")return Ye;d.status==="dirty"&&n.dirty(),u.add(d.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>o._parse(new Ks(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(t,n){return new yc({...this._def,minSize:{value:t,message:ze.toString(n)}})}max(t,n){return new yc({...this._def,maxSize:{value:t,message:ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yc.create=(e,t)=>new yc({valueType:e,minSize:null,maxSize:null,typeName:qe.ZodSet,...ot(t)});class ff extends ct{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.function)return Ee(n,{code:me.invalid_type,expected:Ce.function,received:n.parsedType}),Ye;function r(a,l){return E1({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,T1(),Tg].filter(u=>!!u),issueData:{code:me.invalid_arguments,argumentsError:l}})}function i(a,l){return E1({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,T1(),Tg].filter(u=>!!u),issueData:{code:me.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;return this._def.returns instanceof Df?_i(async(...a)=>{const l=new us([]),u=await this._def.args.parseAsync(a,o).catch(h=>{throw l.addIssue(r(a,h)),l}),d=await s(...u);return await this._def.returns._def.type.parseAsync(d,o).catch(h=>{throw l.addIssue(i(d,h)),l})}):_i((...a)=>{const l=this._def.args.safeParse(a,o);if(!l.success)throw new us([r(a,l.error)]);const u=s(...l.data),d=this._def.returns.safeParse(u,o);if(!d.success)throw new us([i(u,d.error)]);return d.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ff({...this._def,args:Xs.create(t).rest(ic.create())})}returns(t){return new ff({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ff({args:t||Xs.create([]).rest(ic.create()),returns:n||ic.create(),typeName:qe.ZodFunction,...ot(r)})}}class Ig extends ct{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ig.create=(e,t)=>new Ig({getter:e,typeName:qe.ZodLazy,...ot(t)});class Mg extends ct{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ee(n,{received:n.data,code:me.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:t.data}}get value(){return this._def.value}}Mg.create=(e,t)=>new Mg({value:e,typeName:qe.ZodLiteral,...ot(t)});function a$(e,t){return new nu({values:e,typeName:qe.ZodEnum,...ot(t)})}class nu extends ct{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ee(n,{expected:kt.joinValues(r),received:n.parsedType,code:me.invalid_type}),Ye}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ee(n,{received:n.data,code:me.invalid_enum_value,options:r}),Ye}return _i(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return nu.create(t)}exclude(t){return nu.create(this.options.filter(n=>!t.includes(n)))}}nu.create=a$;class Ng extends ct{_parse(t){const n=kt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ce.string&&r.parsedType!==Ce.number){const i=kt.objectValues(n);return Ee(r,{expected:kt.joinValues(i),received:r.parsedType,code:me.invalid_type}),Ye}if(n.indexOf(t.data)===-1){const i=kt.objectValues(n);return Ee(r,{received:r.data,code:me.invalid_enum_value,options:i}),Ye}return _i(t.data)}get enum(){return this._def.values}}Ng.create=(e,t)=>new Ng({values:e,typeName:qe.ZodNativeEnum,...ot(t)});class Df extends ct{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ce.promise&&n.common.async===!1)return Ee(n,{code:me.invalid_type,expected:Ce.promise,received:n.parsedType}),Ye;const r=n.parsedType===Ce.promise?n.data:Promise.resolve(n.data);return _i(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Df.create=(e,t)=>new Df({type:e,typeName:qe.ZodPromise,...ot(t)});class gs extends ct{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null;if(i.type==="preprocess"){const s=i.transform(r.data);return r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}const o={addIssue:s=>{Ee(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ye:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ye:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!A1(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>A1(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);kt.assertNever(i)}}gs.create=(e,t,n)=>new gs({schema:e,typeName:qe.ZodEffects,effect:t,...ot(n)});gs.createWithPreprocess=(e,t,n)=>new gs({schema:t,effect:{type:"preprocess",transform:e},typeName:qe.ZodEffects,...ot(n)});class Ma extends ct{_parse(t){return this._getType(t)===Ce.undefined?_i(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ma.create=(e,t)=>new Ma({innerType:e,typeName:qe.ZodOptional,...ot(t)});class vc extends ct{_parse(t){return this._getType(t)===Ce.null?_i(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:qe.ZodNullable,...ot(t)});class Lg extends ct{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Lg.create=(e,t)=>new Lg({innerType:e,typeName:qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ot(t)});class I1 extends ct{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return P1(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new us(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new us(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}I1.create=(e,t)=>new I1({innerType:e,typeName:qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ot(t)});class M1 extends ct{_parse(t){if(this._getType(t)!==Ce.nan){const r=this._getOrReturnCtx(t);return Ee(r,{code:me.invalid_type,expected:Ce.nan,received:r.parsedType}),Ye}return{status:"valid",value:t.data}}}M1.create=e=>new M1({typeName:qe.ZodNaN,...ot(e)});const Vle=Symbol("zod_brand");class l$ extends ct{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Pm extends ct{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ye:o.status==="dirty"?(n.dirty(),s$(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ye:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new Pm({in:t,out:n,typeName:qe.ZodPipeline})}}const u$=(e,t={},n)=>e?Lf.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,u=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...u,fatal:l})}}):Lf.create(),jle={object:Tn.lazycreate};var qe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(qe||(qe={}));const Gle=(e,t={message:`Input not instance of ${e.name}`})=>u$(n=>n instanceof e,t),c$=os.create,d$=eu.create,Hle=M1.create,Wle=tu.create,f$=Eg.create,qle=mc.create,Kle=R1.create,Xle=Ag.create,Yle=Pg.create,Qle=Lf.create,Zle=ic.create,Jle=Ga.create,eue=O1.create,tue=cs.create,nue=Tn.create,rue=Tn.strictCreate,iue=Rg.create,oue=yb.create,sue=Og.create,aue=Xs.create,lue=kg.create,uue=k1.create,cue=yc.create,due=ff.create,fue=Ig.create,hue=Mg.create,pue=nu.create,gue=Ng.create,mue=Df.create,Q9=gs.create,yue=Ma.create,vue=vc.create,_ue=gs.createWithPreprocess,bue=Pm.create,Sue=()=>c$().optional(),wue=()=>d$().optional(),xue=()=>f$().optional(),Cue={string:e=>os.create({...e,coerce:!0}),number:e=>eu.create({...e,coerce:!0}),boolean:e=>Eg.create({...e,coerce:!0}),bigint:e=>tu.create({...e,coerce:!0}),date:e=>mc.create({...e,coerce:!0})},Tue=Ye;var Et=Object.freeze({__proto__:null,defaultErrorMap:Tg,setErrorMap:Rle,getErrorMap:T1,makeIssue:E1,EMPTY_PATH:Ole,addIssueToContext:Ee,ParseStatus:ri,INVALID:Ye,DIRTY:s$,OK:_i,isAborted:F3,isDirty:B3,isValid:A1,isAsync:P1,get util(){return kt},get objectUtil(){return $3},ZodParsedType:Ce,getParsedType:Rl,ZodType:ct,ZodString:os,ZodNumber:eu,ZodBigInt:tu,ZodBoolean:Eg,ZodDate:mc,ZodSymbol:R1,ZodUndefined:Ag,ZodNull:Pg,ZodAny:Lf,ZodUnknown:ic,ZodNever:Ga,ZodVoid:O1,ZodArray:cs,ZodObject:Tn,ZodUnion:Rg,ZodDiscriminatedUnion:yb,ZodIntersection:Og,ZodTuple:Xs,ZodRecord:kg,ZodMap:k1,ZodSet:yc,ZodFunction:ff,ZodLazy:Ig,ZodLiteral:Mg,ZodEnum:nu,ZodNativeEnum:Ng,ZodPromise:Df,ZodEffects:gs,ZodTransformer:gs,ZodOptional:Ma,ZodNullable:vc,ZodDefault:Lg,ZodCatch:I1,ZodNaN:M1,BRAND:Vle,ZodBranded:l$,ZodPipeline:Pm,custom:u$,Schema:ct,ZodSchema:ct,late:jle,get ZodFirstPartyTypeKind(){return qe},coerce:Cue,any:Qle,array:tue,bigint:Wle,boolean:f$,date:qle,discriminatedUnion:oue,effect:Q9,enum:pue,function:due,instanceof:Gle,intersection:sue,lazy:fue,literal:hue,map:uue,nan:Hle,nativeEnum:gue,never:Jle,null:Yle,nullable:vue,number:d$,object:nue,oboolean:xue,onumber:wue,optional:yue,ostring:Sue,pipeline:bue,preprocess:_ue,promise:mue,record:lue,set:cue,strictObject:rue,string:c$,symbol:Kle,transformer:Q9,tuple:aue,undefined:Xle,union:iue,unknown:Zle,void:eue,NEVER:Tue,ZodIssueCode:me,quotelessJson:Ple,ZodError:us});const Eue=Et.string(),PRe=e=>Eue.safeParse(e).success,Aue=Et.string(),RRe=e=>Aue.safeParse(e).success,Pue=Et.string(),ORe=e=>Pue.safeParse(e).success,Rue=Et.string(),kRe=e=>Rue.safeParse(e).success,Oue=Et.number().int().min(1),IRe=e=>Oue.safeParse(e).success,kue=Et.number().min(1),MRe=e=>kue.safeParse(e).success,Iue=Et.enum(["euler","deis","ddim","ddpm","dpmpp_2s","dpmpp_2m","dpmpp_2m_sde","dpmpp_sde","heun","kdpm_2","lms","pndm","unipc","euler_k","dpmpp_2s_k","dpmpp_2m_k","dpmpp_2m_sde_k","dpmpp_sde_k","heun_k","lms_k","euler_a","kdpm_2_a"]),NRe=e=>Iue.safeParse(e).success,LRe={euler:"Euler",deis:"DEIS",ddim:"DDIM",ddpm:"DDPM",dpmpp_sde:"DPM++ SDE",dpmpp_2s:"DPM++ 2S",dpmpp_2m:"DPM++ 2M",dpmpp_2m_sde:"DPM++ 2M SDE",heun:"Heun",kdpm_2:"KDPM 2",lms:"LMS",pndm:"PNDM",unipc:"UniPC",euler_k:"Euler Karras",dpmpp_sde_k:"DPM++ SDE Karras",dpmpp_2s_k:"DPM++ 2S Karras",dpmpp_2m_k:"DPM++ 2M Karras",dpmpp_2m_sde_k:"DPM++ 2M SDE Karras",heun_k:"Heun Karras",lms_k:"LMS Karras",euler_a:"Euler Ancestral",kdpm_2_a:"KDPM 2 Ancestral"},Mue=Et.number().int().min(0).max(Ale),DRe=e=>Mue.safeParse(e).success,Nue=Et.number().multipleOf(8).min(64),$Re=e=>Nue.safeParse(e).success,Lue=Et.number().multipleOf(8).min(64),FRe=e=>Lue.safeParse(e).success,Rm=Et.enum(["sd-1","sd-2","sdxl","sdxl-refiner"]),$T=Et.object({model_name:Et.string().min(1),base_model:Rm,model_type:Et.literal("main")}),BRe=e=>$T.safeParse(e).success,h$=Et.object({model_name:Et.string().min(1),base_model:Et.literal("sdxl-refiner"),model_type:Et.literal("main")}),URe=e=>h$.safeParse(e).success,Due=Et.object({model_name:Et.string().min(1),base_model:Rm,model_type:Et.literal("onnx")}),p$=Et.union([$T,Due]),$ue=Et.object({model_name:Et.string().min(1),base_model:Rm}),zRe=Et.object({model_name:Et.string().min(1),base_model:Rm}),VRe=Et.object({model_name:Et.string().min(1),base_model:Rm}),Fue=Et.number().min(0).max(1),jRe=e=>Fue.safeParse(e).success;Et.enum(["fp16","fp32"]);const Bue=Et.number().min(1).max(10),GRe=e=>Bue.safeParse(e).success,Uue=Et.number().min(1).max(10),HRe=e=>Uue.safeParse(e).success,zue=Et.number().min(0).max(1),WRe=e=>zue.safeParse(e).success;Et.enum(["box","gaussian"]);const ys={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,shouldUseNoiseSettings:!1,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0,model:null,vae:null,vaePrecision:"fp32",seamlessXAxis:!1,seamlessYAxis:!1,clipSkip:0,shouldUseCpuNoise:!0,shouldShowAdvancedOptions:!1,aspectRatio:null},Vue=ys,g$=An({name:"generation",initialState:Vue,reducers:{setPositivePrompt:(e,t)=>{e.positivePrompt=t.payload},setNegativePrompt:(e,t)=>{e.negativePrompt=t.payload},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},clampSymmetrySteps:e=>{e.horizontalSymmetrySteps=Ml(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=Ml(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},toggleSize:e=>{const[t,n]=[e.width,e.height];e.width=n,e.height=t},setScheduler:(e,t)=>{e.scheduler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setSeamlessXAxis:(e,t)=>{e.seamlessXAxis=t.payload},setSeamlessYAxis:(e,t)=>{e.seamlessYAxis=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},resetParametersState:e=>({...e,...ys}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setMaskBlur:(e,t)=>{e.maskBlur=t.payload},setMaskBlurMethod:(e,t)=>{e.maskBlurMethod=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=t.payload},setShouldUseNoiseSettings:(e,t)=>{e.shouldUseNoiseSettings=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=Ele[e.model.base_model];e.clipSkip=Ml(e.clipSkip,0,n)},vaeSelected:(e,t)=>{e.vae=t.payload},vaePrecisionChanged:(e,t)=>{e.vaePrecision=t.payload},setClipSkip:(e,t)=>{e.clipSkip=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setShouldShowAdvancedOptions:(e,t)=>{e.shouldShowAdvancedOptions=t.payload,t.payload||(e.clipSkip=0)},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Ns(e.width/n,8))}},extraReducers:e=>{e.addCase(Cle,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,s,a]=r.split("/"),l=$T.safeParse({model_name:a,base_model:o,model_type:s});l.success&&(t.model=l.data)}}),e.addCase(Gue,(t,n)=>{n.payload||(t.clipSkip=0)})}}),{clampSymmetrySteps:qRe,clearInitialImage:FT,resetParametersState:KRe,resetSeed:XRe,setCfgScale:YRe,setWidth:QRe,setHeight:ZRe,toggleSize:JRe,setImg2imgStrength:eOe,setInfillMethod:jue,setIterations:tOe,setPerlin:nOe,setPositivePrompt:rOe,setNegativePrompt:iOe,setScheduler:oOe,setMaskBlur:sOe,setMaskBlurMethod:aOe,setSeed:lOe,setSeedWeights:uOe,setShouldFitToWidthHeight:cOe,setShouldGenerateVariations:dOe,setShouldRandomizeSeed:fOe,setSteps:hOe,setThreshold:pOe,setTileSize:gOe,setVariationAmount:mOe,setShouldUseSymmetry:yOe,setHorizontalSymmetrySteps:vOe,setVerticalSymmetrySteps:_Oe,initialImageChanged:vb,modelChanged:Nl,vaeSelected:m$,setShouldUseNoiseSettings:bOe,setSeamlessXAxis:SOe,setSeamlessYAxis:wOe,setClipSkip:xOe,shouldUseCpuNoiseChanged:COe,setShouldShowAdvancedOptions:Gue,setAspectRatio:Hue,vaePrecisionChanged:TOe}=g$.actions,Wue=g$.reducer,y$=["txt2img","img2img","unifiedCanvas","nodes","modelManager","batch"],Z9=(e,t)=>{typeof t=="number"?e.activeTab=t:e.activeTab=y$.indexOf(t)},v$={activeTab:0,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldPinGallery:!0,shouldShowGallery:!0,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,favoriteSchedulers:[]},_$=An({name:"ui",initialState:v$,reducers:{setActiveTab:(e,t)=>{Z9(e,t.payload)},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload,e.shouldShowParametersPanel=!0},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldHidePreview:(e,t)=>{e.shouldHidePreview=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},togglePinGalleryPanel:e=>{e.shouldPinGallery=!e.shouldPinGallery,e.shouldPinGallery||(e.shouldShowGallery=!0)},togglePinParametersPanel:e=>{e.shouldPinParametersPanel=!e.shouldPinParametersPanel,e.shouldPinParametersPanel||(e.shouldShowParametersPanel=!0)},toggleParametersPanel:e=>{e.shouldShowParametersPanel=!e.shouldShowParametersPanel},toggleGalleryPanel:e=>{e.shouldShowGallery=!e.shouldShowGallery},togglePanels:e=>{e.shouldShowGallery||e.shouldShowParametersPanel?(e.shouldShowGallery=!1,e.shouldShowParametersPanel=!1):(e.shouldShowGallery=!0,e.shouldShowParametersPanel=!0)},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker}},extraReducers(e){e.addCase(vb,t=>{Z9(t,"img2img")})}}),{setActiveTab:b$,setShouldPinParametersPanel:EOe,setShouldShowParametersPanel:AOe,setShouldShowImageDetails:POe,setShouldUseCanvasBetaLayout:que,setShouldShowExistingModelsInSearch:ROe,setShouldUseSliders:OOe,setShouldHidePreview:kOe,setShouldShowGallery:IOe,togglePanels:MOe,togglePinGalleryPanel:NOe,togglePinParametersPanel:LOe,toggleParametersPanel:DOe,toggleGalleryPanel:$Oe,setShouldShowProgressInViewer:FOe,favoriteSchedulersChanged:BOe,toggleEmbeddingPicker:UOe}=_$.actions,Kue=_$.reducer;let fi=[],Om=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let s=n.indexOf(i);~s&&(n.splice(s,2),r.lc--,r.lc||r.off())}},notify(i){let o=!fi.length;for(let s=0;s<n.length;s+=2)fi.push(n[s],r.value,i,n[s+1]);if(o){for(let s=0;s<fi.length;s+=4){let a=!1;for(let l=s+7;l<fi.length;l+=4)if(fi[l]<fi[s+3]){a=!0;break}a?fi.push(fi[s],fi[s+1],fi[s+2],fi[s+3]):fi[s](fi[s+1],fi[s+2])}fi.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let s=r.listen(i,o);return i(r.value),s},value:e};return r};const Xue=5,A0=6,P0=10;let Yue=(e,t,n,r)=>(e.events=e.events||{},e.events[n+P0]||(e.events[n+P0]=r(i=>{e.events[n].reduceRight((o,s)=>(s(o),o),{shared:{},...i})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let i=e.events[n],o=i.indexOf(t);i.splice(o,1),i.length||(delete e.events[n],e.events[n+P0](),delete e.events[n+P0])}),Que=1e3,Zue=(e,t)=>Yue(e,r=>{let i=t(r);i&&e.events[A0].push(i)},Xue,r=>{let i=e.listen;e.listen=(...s)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...s));let o=e.off;return e.events[A0]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let s of e.events[A0])s();e.events[A0]=[]}},Que)},()=>{e.listen=i,e.off=o}}),Jue=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(s=>s.get());(n===void 0||o.some((s,a)=>s!==n[a]))&&(n=o,i.set(t(...o)))},i=Om(void 0,Math.max(...e.map(o=>o.l))+1);return Zue(i,()=>{let o=e.map(s=>s.listen(r,i.l));return r(),()=>{for(let s of o)s()}}),i};const ece={"Content-Type":"application/json"},tce=/\/*$/;function nce(e){const t=new URLSearchParams;if(e&&typeof e=="object")for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r);return t.toString()}function rce(e){return JSON.stringify(e)}function ice(e,t){let n=`${t.baseUrl?t.baseUrl.replace(tce,""):""}${e}`;if(t.params.path)for(const[r,i]of Object.entries(t.params.path))n=n.replace(`{${r}}`,encodeURIComponent(String(i)));if(t.params.query){const r=t.querySerializer(t.params.query);r&&(n+=`?${r}`)}return n}function oce(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e,o=new Headers({...ece,...i.headers??{}});async function s(a,l){const{headers:u,body:d,params:f={},parseAs:h="json",querySerializer:g=n??nce,bodySerializer:m=r??rce,...v}=l||{},x=ice(a,{baseUrl:i.baseUrl,params:f,querySerializer:g}),_=new Headers(o),b=new Headers(u);for(const[T,E]of b.entries())E==null?_.delete(T):_.set(T,E);const y={redirect:"follow",...i,...v,headers:_};d&&(y.body=m(d)),y.body instanceof FormData&&_.delete("Content-Type");const S=await t(x,y);if(S.status===204||S.headers.get("Content-Length")==="0")return S.ok?{data:{},response:S}:{error:{},response:S};if(S.ok){let T=S.body;if(h!=="stream"){const E=S.clone();T=typeof E[h]=="function"?await E[h]():await E.text()}return{data:T,response:S}}let C={};try{C=await S.clone().json()}catch{C=await S.clone().text()}return{error:C,response:S}}return{async get(a,l){return s(a,{...l,method:"GET"})},async put(a,l){return s(a,{...l,method:"PUT"})},async post(a,l){return s(a,{...l,method:"POST"})},async del(a,l){return s(a,{...l,method:"DELETE"})},async options(a,l){return s(a,{...l,method:"OPTIONS"})},async head(a,l){return s(a,{...l,method:"HEAD"})},async patch(a,l){return s(a,{...l,method:"PATCH"})},async trace(a,l){return s(a,{...l,method:"TRACE"})}}}const Dg=Om(),$g=Om(),N1=Om(),_b=Jue([Dg,$g,N1],(e,t,n)=>oce({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`})),jr=Jl("api/sessionCreated",async(e,{rejectWithValue:t})=>{const{graph:n}=e,{post:r}=_b.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/",{body:n});return o?t({arg:e,status:s.status,error:o}):i}),sce=e=>vi(e)&&"status"in e,ace=e=>vi(e)&&"detail"in e,km=Jl("api/sessionInvoked",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{put:r}=_b.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/{session_id}/invoke",{params:{query:{all:!0},path:{session_id:n}}});if(o){if(sce(o)&&o.status===403)return t({arg:e,status:s.status,error:o.body.detail});if(ace(o)&&s.status===403)return t({arg:e,status:s.status,error:o.detail});if(o)return t({arg:e,status:s.status,error:o})}}),Oc=Jl("api/sessionCanceled",async(e,{rejectWithValue:t})=>{const{session_id:n}=e,{del:r}=_b.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/{session_id}/invoke",{params:{path:{session_id:n}}});return o?t({arg:e,error:o}):i});Jl("api/listSessions",async(e,{rejectWithValue:t})=>{const{params:n}=e,{get:r}=_b.get(),{data:i,error:o,response:s}=await r("/api/v1/sessions/",{params:n});return o?t({arg:e,error:o}):i});const S$=Lo(jr.rejected,km.rejected),pd=(e,t,n,r,i,o,s)=>{const a=Math.floor(e/2-(n+i/2)*s),l=Math.floor(t/2-(r+o/2)*s);return{x:a,y:l}},gd=(e,t,n,r,i=.95)=>{const o=e*i/n,s=t*i/r;return Math.min(1,Math.min(o,s))},zOe=.999,VOe=.1,jOe=20,np=.95,GOe=30,HOe=10,J9=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Nu=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let s=t*n,a=448;for(;s<i;)if(a+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=a,r.height=Ns(a/o,64)):o<1&&(r.height=a,r.width=Ns(a*o,64)),s=r.width*r.height;return r},lce=e=>({width:Ns(e.width,64),height:Ns(e.height,64)}),WOe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],qOe=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],w$=e=>e.kind==="line"&&e.layer==="mask",KOe=e=>e.kind==="line"&&e.layer==="base",eR=e=>e.kind==="image"&&e.layer==="base",XOe=e=>e.kind==="fillRect"&&e.layer==="base",YOe=e=>e.kind==="eraseRect"&&e.layer==="base",uce=e=>e.kind==="line",Od={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},x$={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"none",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Od,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAntialias:!0,shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},C$=An({name:"canvas",initialState:x$,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Qr(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!w$(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{width:r,height:i}=n,{stageDimensions:o}=e,s={width:T0(Ml(r,64,512),64),height:T0(Ml(i,64,512),64)},a={x:Ns(r/2-s.width/2,64),y:Ns(i/2-s.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const d=Nu(s);e.scaledBoundingBoxDimensions=d}e.boundingBoxDimensions=s,e.boundingBoxCoordinates=a,e.pastLayerStates.push(Qr(e.layerState)),e.layerState={...Od,objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const l=gd(o.width,o.height,r,i,np),u=pd(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=lce(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Nu(n);e.scaledBoundingBoxDimensions=r}},flipBoundingBoxAxes:e=>{const[t,n]=[e.boundingBoxDimensions.width,e.boundingBoxDimensions.height];e.boundingBoxDimensions={width:n,height:t}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=J9(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},canvasSessionIdChanged:(e,t)=>{e.layerState.stagingArea.sessionId=t.payload},stagingAreaInitialized:(e,t)=>{const{sessionId:n,boundingBox:r}=t.payload;e.layerState.stagingArea={boundingBox:r,sessionId:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...e.layerState.stagingArea.boundingBox,imageName:n.image_name}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...Od.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:s}=e;if(n==="move"||n==="colorPicker")return;const a=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:a,points:t.payload,...l};s&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(uce);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Qr(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Qr(e.layerState)),e.layerState=Od,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(eR),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=gd(i.width,i.height,512,512,np),f=pd(i.width,i.height,0,0,512,512,d),h={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=f,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=h,e.boundingBoxScaleMethod==="auto"){const g=Nu(h);e.scaledBoundingBoxDimensions=g}return}const{width:o,height:s}=r,l=gd(t,n,o,s,.95),u=pd(i.width,i.height,0,0,o,s,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=J9(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(eR)){const i=gd(r.width,r.height,512,512,np),o=pd(r.width,r.height,0,0,512,512,i),s={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,e.boundingBoxScaleMethod==="auto"){const a=Nu(s);e.scaledBoundingBoxDimensions=a}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:s,y:a,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:gd(i,o,l,u,np),f=pd(i,o,s,a,l,u,d);e.stageScale=d,e.stageCoordinates=f}else{const d=gd(i,o,512,512,np),f=pd(i,o,0,0,512,512,d),h={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=f,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=h,e.boundingBoxScaleMethod==="auto"){const g=Nu(h);e.scaledBoundingBoxDimensions=g}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:(e,t)=>{if(!e.layerState.stagingArea.images.length)return;const{images:n,selectedImageIndex:r}=e.layerState.stagingArea;e.pastLayerStates.push(Qr(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const i=n[r];i&&e.layerState.objects.push({...i}),e.layerState.stagingArea={...Od.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,s=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>s){const a={width:T0(Ml(o,64,512),64),height:T0(Ml(s,64,512),64)},l={x:Ns(o/2-a.width/2,64),y:Ns(s/2-a.height/2,64)};if(e.boundingBoxDimensions=a,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Nu(a);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Nu(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldAntialias:(e,t)=>{e.shouldAntialias=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Qr(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}},extraReducers:e=>{e.addCase(Oc.pending,t=>{t.layerState.stagingArea.images.length||(t.layerState.stagingArea=Od.stagingArea)}),e.addCase(que,t=>{t.doesCanvasNeedScaling=!0}),e.addCase(b$,t=>{t.doesCanvasNeedScaling=!0}),e.addCase(Hue,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Ns(t.boundingBoxDimensions.width/r,64))})}}),{addEraseRect:QOe,addFillRect:ZOe,addImageToStagingArea:cce,addLine:JOe,addPointToCurrentLine:eke,clearCanvasHistory:tke,clearMask:nke,commitColorPickerColor:rke,commitStagingAreaImage:dce,discardStagedImages:ike,fitBoundingBoxToStage:oke,mouseLeftCanvas:ske,nextStagingAreaImage:ake,prevStagingAreaImage:lke,redo:uke,resetCanvas:BT,resetCanvasInteractionState:cke,resetCanvasView:dke,resizeAndScaleCanvas:fke,resizeCanvas:hke,setBoundingBoxCoordinates:pke,setBoundingBoxDimensions:gke,setBoundingBoxPreviewFill:mke,setBoundingBoxScaleMethod:yke,flipBoundingBoxAxes:vke,setBrushColor:_ke,setBrushSize:bke,setCanvasContainerDimensions:Ske,setColorPickerColor:wke,setCursorPosition:xke,setDoesCanvasNeedScaling:Cke,setInitialCanvasImage:T$,setIsDrawing:Tke,setIsMaskEnabled:Eke,setIsMouseOverBoundingBox:Ake,setIsMoveBoundingBoxKeyHeld:Pke,setIsMoveStageKeyHeld:Rke,setIsMovingBoundingBox:Oke,setIsMovingStage:kke,setIsTransformingBoundingBox:Ike,setLayer:Mke,setMaskColor:Nke,setMergedCanvas:fce,setShouldAutoSave:Lke,setShouldCropToBoundingBoxOnSave:Dke,setShouldDarkenOutsideBoundingBox:$ke,setShouldLockBoundingBox:Fke,setShouldPreserveMaskedArea:Bke,setShouldShowBoundingBox:Uke,setShouldShowBrush:zke,setShouldShowBrushPreview:Vke,setShouldShowCanvasDebugInfo:jke,setShouldShowCheckboardTransparency:Gke,setShouldShowGrid:Hke,setShouldShowIntermediates:Wke,setShouldShowStagingImage:qke,setShouldShowStagingOutline:Kke,setShouldSnapToGrid:Xke,setStageCoordinates:Yke,setStageScale:Qke,setTool:Zke,toggleShouldLockBoundingBox:Jke,toggleTool:eIe,undo:tIe,setScaledBoundingBoxDimensions:nIe,setShouldRestrictStrokesToBox:rIe,stagingAreaInitialized:hce,canvasSessionIdChanged:pce,setShouldAntialias:iIe}=C$.actions,gce=C$.reducer,Jr=["general"],Ll=["control","mask","user","other"],mce=100,tR=20;var L1={exports:{}};/**
|
||
* @license
|
||
* Lodash <https://lodash.com/>
|
||
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
||
* Released under MIT license <https://lodash.com/license>
|
||
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
||
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||
*/L1.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",f=1,h=2,g=4,m=1,v=2,x=1,_=2,b=4,y=8,S=16,C=32,T=64,E=128,P=256,k=512,O=30,M="...",V=800,B=16,A=1,N=2,D=3,U=1/0,$=9007199254740991,j=17976931348623157e292,G=0/0,q=4294967295,Z=q-1,ee=q>>>1,ie=[["ary",E],["bind",x],["bindKey",_],["curry",y],["curryRight",S],["flip",k],["partial",C],["partialRight",T],["rearg",P]],se="[object Arguments]",le="[object Array]",W="[object AsyncFunction]",ne="[object Boolean]",fe="[object Date]",pe="[object DOMException]",ve="[object Error]",ye="[object Function]",Je="[object GeneratorFunction]",Fe="[object Map]",Ae="[object Number]",vt="[object Null]",_e="[object Object]",Qt="[object Promise]",rr="[object Proxy]",qt="[object RegExp]",ht="[object Set]",At="[object String]",un="[object Symbol]",Gr="[object Undefined]",Pr="[object WeakMap]",Ci="[object WeakSet]",In="[object ArrayBuffer]",gn="[object DataView]",ir="[object Float32Array]",mn="[object Float64Array]",Zt="[object Int8Array]",Rr="[object Int16Array]",Hr="[object Int32Array]",si="[object Uint8Array]",Vi="[object Uint8ClampedArray]",$n="[object Uint16Array]",ai="[object Uint32Array]",ra=/\b__p \+= '';/g,uo=/\b(__p \+=) '' \+/g,ia=/(__e\(.*?\)|\b__t\)) \+\n'';/g,nn=/&(?:amp|lt|gt|quot|#39);/g,Ft=/[&<>"']/g,or=RegExp(nn.source),qn=RegExp(Ft.source),yr=/<%-([\s\S]+?)%>/g,Or=/<%([\s\S]+?)%>/g,kr=/<%=([\s\S]+?)%>/g,co=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ir=/^\w*$/,sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ji=/[\\^$.*+?()[\]{}|]/g,bs=RegExp(ji.source),fo=/^\s+/,tl=/\s/,Vo=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mr=/\{\n\/\* \[wrapped with (.+)\] \*/,oa=/,? & /,hh=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ph=/[()=,{}\[\]\/\s]/,gh=/\\(\\)?/g,mh=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,jo=/\w*$/,yh=/^[-+]0x[0-9a-f]+$/i,vh=/^0b[01]+$/i,Gc=/^\[object .+?Constructor\]$/,_h=/^0o[0-7]+$/i,bh=/^(?:0|[1-9]\d*)$/,Sh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ss=/($^)/,wh=/['\n\r\u2028\u2029\\]/g,Go="\\ud800-\\udfff",nl="\\u0300-\\u036f",xh="\\ufe20-\\ufe2f",rl="\\u20d0-\\u20ff",Cu=nl+xh+rl,Hc="\\u2700-\\u27bf",il="a-z\\xdf-\\xf6\\xf8-\\xff",A2="\\xac\\xb1\\xd7\\xf7",ry="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",P2="\\u2000-\\u206f",R2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",iy="A-Z\\xc0-\\xd6\\xd8-\\xde",oy="\\ufe0e\\ufe0f",sy=A2+ry+P2+R2,Ch="['’]",O2="["+Go+"]",ay="["+sy+"]",Wc="["+Cu+"]",ly="\\d+",qc="["+Hc+"]",Kc="["+il+"]",uy="[^"+Go+sy+ly+Hc+il+iy+"]",Th="\\ud83c[\\udffb-\\udfff]",cy="(?:"+Wc+"|"+Th+")",dy="[^"+Go+"]",Eh="(?:\\ud83c[\\udde6-\\uddff]){2}",Ah="[\\ud800-\\udbff][\\udc00-\\udfff]",sa="["+iy+"]",fy="\\u200d",hy="(?:"+Kc+"|"+uy+")",k2="(?:"+sa+"|"+uy+")",Xc="(?:"+Ch+"(?:d|ll|m|re|s|t|ve))?",py="(?:"+Ch+"(?:D|LL|M|RE|S|T|VE))?",gy=cy+"?",my="["+oy+"]?",Yc="(?:"+fy+"(?:"+[dy,Eh,Ah].join("|")+")"+my+gy+")*",Ph="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rh="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qc=my+gy+Yc,I2="(?:"+[qc,Eh,Ah].join("|")+")"+Qc,yy="(?:"+[dy+Wc+"?",Wc,Eh,Ah,O2].join("|")+")",Oh=RegExp(Ch,"g"),vy=RegExp(Wc,"g"),Ho=RegExp(Th+"(?="+Th+")|"+yy+Qc,"g"),Tu=RegExp([sa+"?"+Kc+"+"+Xc+"(?="+[ay,sa,"$"].join("|")+")",k2+"+"+py+"(?="+[ay,sa+hy,"$"].join("|")+")",sa+"?"+hy+"+"+Xc,sa+"+"+py,Rh,Ph,ly,I2].join("|"),"g"),M2=RegExp("["+fy+Go+Cu+oy+"]"),_y=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,N2=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],by=-1,Jt={};Jt[ir]=Jt[mn]=Jt[Zt]=Jt[Rr]=Jt[Hr]=Jt[si]=Jt[Vi]=Jt[$n]=Jt[ai]=!0,Jt[se]=Jt[le]=Jt[In]=Jt[ne]=Jt[gn]=Jt[fe]=Jt[ve]=Jt[ye]=Jt[Fe]=Jt[Ae]=Jt[_e]=Jt[qt]=Jt[ht]=Jt[At]=Jt[Pr]=!1;var Kt={};Kt[se]=Kt[le]=Kt[In]=Kt[gn]=Kt[ne]=Kt[fe]=Kt[ir]=Kt[mn]=Kt[Zt]=Kt[Rr]=Kt[Hr]=Kt[Fe]=Kt[Ae]=Kt[_e]=Kt[qt]=Kt[ht]=Kt[At]=Kt[un]=Kt[si]=Kt[Vi]=Kt[$n]=Kt[ai]=!0,Kt[ve]=Kt[ye]=Kt[Pr]=!1;var Sy={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},L2={"&":"&","<":"<",">":">",'"':""","'":"'"},H={"&":"&","<":"<",">":">",""":'"',"'":"'"},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},re=parseFloat,xe=parseInt,pt=typeof Ze=="object"&&Ze&&Ze.Object===Object&&Ze,Ut=typeof self=="object"&&self&&self.Object===Object&&self,et=pt||Ut||Function("return this")(),at=t&&!t.nodeType&&t,Rt=at&&!0&&e&&!e.nodeType&&e,li=Rt&&Rt.exports===at,Nr=li&&pt.process,vr=function(){try{var J=Rt&&Rt.require&&Rt.require("util").types;return J||Nr&&Nr.binding&&Nr.binding("util")}catch{}}(),Zc=vr&&vr.isArrayBuffer,Jc=vr&&vr.isDate,kh=vr&&vr.isMap,UA=vr&&vr.isRegExp,zA=vr&&vr.isSet,VA=vr&&vr.isTypedArray;function Gi(J,ae,oe){switch(oe.length){case 0:return J.call(ae);case 1:return J.call(ae,oe[0]);case 2:return J.call(ae,oe[0],oe[1]);case 3:return J.call(ae,oe[0],oe[1],oe[2])}return J.apply(ae,oe)}function NG(J,ae,oe,Te){for(var Xe=-1,Nt=J==null?0:J.length;++Xe<Nt;){var ar=J[Xe];ae(Te,ar,oe(ar),J)}return Te}function ho(J,ae){for(var oe=-1,Te=J==null?0:J.length;++oe<Te&&ae(J[oe],oe,J)!==!1;);return J}function LG(J,ae){for(var oe=J==null?0:J.length;oe--&&ae(J[oe],oe,J)!==!1;);return J}function jA(J,ae){for(var oe=-1,Te=J==null?0:J.length;++oe<Te;)if(!ae(J[oe],oe,J))return!1;return!0}function ol(J,ae){for(var oe=-1,Te=J==null?0:J.length,Xe=0,Nt=[];++oe<Te;){var ar=J[oe];ae(ar,oe,J)&&(Nt[Xe++]=ar)}return Nt}function wy(J,ae){var oe=J==null?0:J.length;return!!oe&&ed(J,ae,0)>-1}function D2(J,ae,oe){for(var Te=-1,Xe=J==null?0:J.length;++Te<Xe;)if(oe(ae,J[Te]))return!0;return!1}function yn(J,ae){for(var oe=-1,Te=J==null?0:J.length,Xe=Array(Te);++oe<Te;)Xe[oe]=ae(J[oe],oe,J);return Xe}function sl(J,ae){for(var oe=-1,Te=ae.length,Xe=J.length;++oe<Te;)J[Xe+oe]=ae[oe];return J}function $2(J,ae,oe,Te){var Xe=-1,Nt=J==null?0:J.length;for(Te&&Nt&&(oe=J[++Xe]);++Xe<Nt;)oe=ae(oe,J[Xe],Xe,J);return oe}function DG(J,ae,oe,Te){var Xe=J==null?0:J.length;for(Te&&Xe&&(oe=J[--Xe]);Xe--;)oe=ae(oe,J[Xe],Xe,J);return oe}function F2(J,ae){for(var oe=-1,Te=J==null?0:J.length;++oe<Te;)if(ae(J[oe],oe,J))return!0;return!1}var $G=B2("length");function FG(J){return J.split("")}function BG(J){return J.match(hh)||[]}function GA(J,ae,oe){var Te;return oe(J,function(Xe,Nt,ar){if(ae(Xe,Nt,ar))return Te=Nt,!1}),Te}function xy(J,ae,oe,Te){for(var Xe=J.length,Nt=oe+(Te?1:-1);Te?Nt--:++Nt<Xe;)if(ae(J[Nt],Nt,J))return Nt;return-1}function ed(J,ae,oe){return ae===ae?QG(J,ae,oe):xy(J,HA,oe)}function UG(J,ae,oe,Te){for(var Xe=oe-1,Nt=J.length;++Xe<Nt;)if(Te(J[Xe],ae))return Xe;return-1}function HA(J){return J!==J}function WA(J,ae){var oe=J==null?0:J.length;return oe?z2(J,ae)/oe:G}function B2(J){return function(ae){return ae==null?n:ae[J]}}function U2(J){return function(ae){return J==null?n:J[ae]}}function qA(J,ae,oe,Te,Xe){return Xe(J,function(Nt,ar,en){oe=Te?(Te=!1,Nt):ae(oe,Nt,ar,en)}),oe}function zG(J,ae){var oe=J.length;for(J.sort(ae);oe--;)J[oe]=J[oe].value;return J}function z2(J,ae){for(var oe,Te=-1,Xe=J.length;++Te<Xe;){var Nt=ae(J[Te]);Nt!==n&&(oe=oe===n?Nt:oe+Nt)}return oe}function V2(J,ae){for(var oe=-1,Te=Array(J);++oe<J;)Te[oe]=ae(oe);return Te}function VG(J,ae){return yn(ae,function(oe){return[oe,J[oe]]})}function KA(J){return J&&J.slice(0,ZA(J)+1).replace(fo,"")}function Hi(J){return function(ae){return J(ae)}}function j2(J,ae){return yn(ae,function(oe){return J[oe]})}function Ih(J,ae){return J.has(ae)}function XA(J,ae){for(var oe=-1,Te=J.length;++oe<Te&&ed(ae,J[oe],0)>-1;);return oe}function YA(J,ae){for(var oe=J.length;oe--&&ed(ae,J[oe],0)>-1;);return oe}function jG(J,ae){for(var oe=J.length,Te=0;oe--;)J[oe]===ae&&++Te;return Te}var GG=U2(Sy),HG=U2(L2);function WG(J){return"\\"+Y[J]}function qG(J,ae){return J==null?n:J[ae]}function td(J){return M2.test(J)}function KG(J){return _y.test(J)}function XG(J){for(var ae,oe=[];!(ae=J.next()).done;)oe.push(ae.value);return oe}function G2(J){var ae=-1,oe=Array(J.size);return J.forEach(function(Te,Xe){oe[++ae]=[Xe,Te]}),oe}function QA(J,ae){return function(oe){return J(ae(oe))}}function al(J,ae){for(var oe=-1,Te=J.length,Xe=0,Nt=[];++oe<Te;){var ar=J[oe];(ar===ae||ar===d)&&(J[oe]=d,Nt[Xe++]=oe)}return Nt}function Cy(J){var ae=-1,oe=Array(J.size);return J.forEach(function(Te){oe[++ae]=Te}),oe}function YG(J){var ae=-1,oe=Array(J.size);return J.forEach(function(Te){oe[++ae]=[Te,Te]}),oe}function QG(J,ae,oe){for(var Te=oe-1,Xe=J.length;++Te<Xe;)if(J[Te]===ae)return Te;return-1}function ZG(J,ae,oe){for(var Te=oe+1;Te--;)if(J[Te]===ae)return Te;return Te}function nd(J){return td(J)?eH(J):$G(J)}function Wo(J){return td(J)?tH(J):FG(J)}function ZA(J){for(var ae=J.length;ae--&&tl.test(J.charAt(ae)););return ae}var JG=U2(H);function eH(J){for(var ae=Ho.lastIndex=0;Ho.test(J);)++ae;return ae}function tH(J){return J.match(Ho)||[]}function nH(J){return J.match(Tu)||[]}var rH=function J(ae){ae=ae==null?et:rd.defaults(et.Object(),ae,rd.pick(et,N2));var oe=ae.Array,Te=ae.Date,Xe=ae.Error,Nt=ae.Function,ar=ae.Math,en=ae.Object,H2=ae.RegExp,iH=ae.String,po=ae.TypeError,Ty=oe.prototype,oH=Nt.prototype,id=en.prototype,Ey=ae["__core-js_shared__"],Ay=oH.toString,zt=id.hasOwnProperty,sH=0,JA=function(){var c=/[^.]+$/.exec(Ey&&Ey.keys&&Ey.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),Py=id.toString,aH=Ay.call(en),lH=et._,uH=H2("^"+Ay.call(zt).replace(ji,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ry=li?ae.Buffer:n,ll=ae.Symbol,Oy=ae.Uint8Array,e6=Ry?Ry.allocUnsafe:n,ky=QA(en.getPrototypeOf,en),t6=en.create,n6=id.propertyIsEnumerable,Iy=Ty.splice,r6=ll?ll.isConcatSpreadable:n,Mh=ll?ll.iterator:n,Eu=ll?ll.toStringTag:n,My=function(){try{var c=ku(en,"defineProperty");return c({},"",{}),c}catch{}}(),cH=ae.clearTimeout!==et.clearTimeout&&ae.clearTimeout,dH=Te&&Te.now!==et.Date.now&&Te.now,fH=ae.setTimeout!==et.setTimeout&&ae.setTimeout,Ny=ar.ceil,Ly=ar.floor,W2=en.getOwnPropertySymbols,hH=Ry?Ry.isBuffer:n,i6=ae.isFinite,pH=Ty.join,gH=QA(en.keys,en),lr=ar.max,Wr=ar.min,mH=Te.now,yH=ae.parseInt,o6=ar.random,vH=Ty.reverse,q2=ku(ae,"DataView"),Nh=ku(ae,"Map"),K2=ku(ae,"Promise"),od=ku(ae,"Set"),Lh=ku(ae,"WeakMap"),Dh=ku(en,"create"),Dy=Lh&&new Lh,sd={},_H=Iu(q2),bH=Iu(Nh),SH=Iu(K2),wH=Iu(od),xH=Iu(Lh),$y=ll?ll.prototype:n,$h=$y?$y.valueOf:n,s6=$y?$y.toString:n;function F(c){if(Mn(c)&&!Qe(c)&&!(c instanceof _t)){if(c instanceof go)return c;if(zt.call(c,"__wrapped__"))return aP(c)}return new go(c)}var ad=function(){function c(){}return function(p){if(!xn(p))return{};if(t6)return t6(p);c.prototype=p;var w=new c;return c.prototype=n,w}}();function Fy(){}function go(c,p){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}F.templateSettings={escape:yr,evaluate:Or,interpolate:kr,variable:"",imports:{_:F}},F.prototype=Fy.prototype,F.prototype.constructor=F,go.prototype=ad(Fy.prototype),go.prototype.constructor=go;function _t(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function CH(){var c=new _t(this.__wrapped__);return c.__actions__=Ti(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ti(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ti(this.__views__),c}function TH(){if(this.__filtered__){var c=new _t(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function EH(){var c=this.__wrapped__.value(),p=this.__dir__,w=Qe(c),R=p<0,I=w?c.length:0,z=FW(0,I,this.__views__),K=z.start,X=z.end,te=X-K,ce=R?X:K-1,de=this.__iteratees__,he=de.length,be=0,Ne=Wr(te,this.__takeCount__);if(!w||!R&&I==te&&Ne==te)return O6(c,this.__actions__);var je=[];e:for(;te--&&be<Ne;){ce+=p;for(var st=-1,Ge=c[ce];++st<he;){var gt=de[st],Ct=gt.iteratee,Ki=gt.type,di=Ct(Ge);if(Ki==N)Ge=di;else if(!di){if(Ki==A)continue e;break e}}je[be++]=Ge}return je}_t.prototype=ad(Fy.prototype),_t.prototype.constructor=_t;function Au(c){var p=-1,w=c==null?0:c.length;for(this.clear();++p<w;){var R=c[p];this.set(R[0],R[1])}}function AH(){this.__data__=Dh?Dh(null):{},this.size=0}function PH(c){var p=this.has(c)&&delete this.__data__[c];return this.size-=p?1:0,p}function RH(c){var p=this.__data__;if(Dh){var w=p[c];return w===l?n:w}return zt.call(p,c)?p[c]:n}function OH(c){var p=this.__data__;return Dh?p[c]!==n:zt.call(p,c)}function kH(c,p){var w=this.__data__;return this.size+=this.has(c)?0:1,w[c]=Dh&&p===n?l:p,this}Au.prototype.clear=AH,Au.prototype.delete=PH,Au.prototype.get=RH,Au.prototype.has=OH,Au.prototype.set=kH;function aa(c){var p=-1,w=c==null?0:c.length;for(this.clear();++p<w;){var R=c[p];this.set(R[0],R[1])}}function IH(){this.__data__=[],this.size=0}function MH(c){var p=this.__data__,w=By(p,c);if(w<0)return!1;var R=p.length-1;return w==R?p.pop():Iy.call(p,w,1),--this.size,!0}function NH(c){var p=this.__data__,w=By(p,c);return w<0?n:p[w][1]}function LH(c){return By(this.__data__,c)>-1}function DH(c,p){var w=this.__data__,R=By(w,c);return R<0?(++this.size,w.push([c,p])):w[R][1]=p,this}aa.prototype.clear=IH,aa.prototype.delete=MH,aa.prototype.get=NH,aa.prototype.has=LH,aa.prototype.set=DH;function la(c){var p=-1,w=c==null?0:c.length;for(this.clear();++p<w;){var R=c[p];this.set(R[0],R[1])}}function $H(){this.size=0,this.__data__={hash:new Au,map:new(Nh||aa),string:new Au}}function FH(c){var p=Qy(this,c).delete(c);return this.size-=p?1:0,p}function BH(c){return Qy(this,c).get(c)}function UH(c){return Qy(this,c).has(c)}function zH(c,p){var w=Qy(this,c),R=w.size;return w.set(c,p),this.size+=w.size==R?0:1,this}la.prototype.clear=$H,la.prototype.delete=FH,la.prototype.get=BH,la.prototype.has=UH,la.prototype.set=zH;function Pu(c){var p=-1,w=c==null?0:c.length;for(this.__data__=new la;++p<w;)this.add(c[p])}function VH(c){return this.__data__.set(c,l),this}function jH(c){return this.__data__.has(c)}Pu.prototype.add=Pu.prototype.push=VH,Pu.prototype.has=jH;function qo(c){var p=this.__data__=new aa(c);this.size=p.size}function GH(){this.__data__=new aa,this.size=0}function HH(c){var p=this.__data__,w=p.delete(c);return this.size=p.size,w}function WH(c){return this.__data__.get(c)}function qH(c){return this.__data__.has(c)}function KH(c,p){var w=this.__data__;if(w instanceof aa){var R=w.__data__;if(!Nh||R.length<i-1)return R.push([c,p]),this.size=++w.size,this;w=this.__data__=new la(R)}return w.set(c,p),this.size=w.size,this}qo.prototype.clear=GH,qo.prototype.delete=HH,qo.prototype.get=WH,qo.prototype.has=qH,qo.prototype.set=KH;function a6(c,p){var w=Qe(c),R=!w&&Mu(c),I=!w&&!R&&hl(c),z=!w&&!R&&!I&&dd(c),K=w||R||I||z,X=K?V2(c.length,iH):[],te=X.length;for(var ce in c)(p||zt.call(c,ce))&&!(K&&(ce=="length"||I&&(ce=="offset"||ce=="parent")||z&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||fa(ce,te)))&&X.push(ce);return X}function l6(c){var p=c.length;return p?c[ow(0,p-1)]:n}function XH(c,p){return Zy(Ti(c),Ru(p,0,c.length))}function YH(c){return Zy(Ti(c))}function X2(c,p,w){(w!==n&&!Ko(c[p],w)||w===n&&!(p in c))&&ua(c,p,w)}function Fh(c,p,w){var R=c[p];(!(zt.call(c,p)&&Ko(R,w))||w===n&&!(p in c))&&ua(c,p,w)}function By(c,p){for(var w=c.length;w--;)if(Ko(c[w][0],p))return w;return-1}function QH(c,p,w,R){return ul(c,function(I,z,K){p(R,I,w(I),K)}),R}function u6(c,p){return c&&xs(p,_r(p),c)}function ZH(c,p){return c&&xs(p,Ai(p),c)}function ua(c,p,w){p=="__proto__"&&My?My(c,p,{configurable:!0,enumerable:!0,value:w,writable:!0}):c[p]=w}function Y2(c,p){for(var w=-1,R=p.length,I=oe(R),z=c==null;++w<R;)I[w]=z?n:Ow(c,p[w]);return I}function Ru(c,p,w){return c===c&&(w!==n&&(c=c<=w?c:w),p!==n&&(c=c>=p?c:p)),c}function mo(c,p,w,R,I,z){var K,X=p&f,te=p&h,ce=p&g;if(w&&(K=I?w(c,R,I,z):w(c)),K!==n)return K;if(!xn(c))return c;var de=Qe(c);if(de){if(K=UW(c),!X)return Ti(c,K)}else{var he=qr(c),be=he==ye||he==Je;if(hl(c))return M6(c,X);if(he==_e||he==se||be&&!I){if(K=te||be?{}:Z6(c),!X)return te?RW(c,ZH(K,c)):PW(c,u6(K,c))}else{if(!Kt[he])return I?c:{};K=zW(c,he,X)}}z||(z=new qo);var Ne=z.get(c);if(Ne)return Ne;z.set(c,K),AP(c)?c.forEach(function(Ge){K.add(mo(Ge,p,w,Ge,c,z))}):TP(c)&&c.forEach(function(Ge,gt){K.set(gt,mo(Ge,p,w,gt,c,z))});var je=ce?te?mw:gw:te?Ai:_r,st=de?n:je(c);return ho(st||c,function(Ge,gt){st&&(gt=Ge,Ge=c[gt]),Fh(K,gt,mo(Ge,p,w,gt,c,z))}),K}function JH(c){var p=_r(c);return function(w){return c6(w,c,p)}}function c6(c,p,w){var R=w.length;if(c==null)return!R;for(c=en(c);R--;){var I=w[R],z=p[I],K=c[I];if(K===n&&!(I in c)||!z(K))return!1}return!0}function d6(c,p,w){if(typeof c!="function")throw new po(s);return Hh(function(){c.apply(n,w)},p)}function Bh(c,p,w,R){var I=-1,z=wy,K=!0,X=c.length,te=[],ce=p.length;if(!X)return te;w&&(p=yn(p,Hi(w))),R?(z=D2,K=!1):p.length>=i&&(z=Ih,K=!1,p=new Pu(p));e:for(;++I<X;){var de=c[I],he=w==null?de:w(de);if(de=R||de!==0?de:0,K&&he===he){for(var be=ce;be--;)if(p[be]===he)continue e;te.push(de)}else z(p,he,R)||te.push(de)}return te}var ul=F6(ws),f6=F6(Z2,!0);function eW(c,p){var w=!0;return ul(c,function(R,I,z){return w=!!p(R,I,z),w}),w}function Uy(c,p,w){for(var R=-1,I=c.length;++R<I;){var z=c[R],K=p(z);if(K!=null&&(X===n?K===K&&!qi(K):w(K,X)))var X=K,te=z}return te}function tW(c,p,w,R){var I=c.length;for(w=rt(w),w<0&&(w=-w>I?0:I+w),R=R===n||R>I?I:rt(R),R<0&&(R+=I),R=w>R?0:RP(R);w<R;)c[w++]=p;return c}function h6(c,p){var w=[];return ul(c,function(R,I,z){p(R,I,z)&&w.push(R)}),w}function Lr(c,p,w,R,I){var z=-1,K=c.length;for(w||(w=jW),I||(I=[]);++z<K;){var X=c[z];p>0&&w(X)?p>1?Lr(X,p-1,w,R,I):sl(I,X):R||(I[I.length]=X)}return I}var Q2=B6(),p6=B6(!0);function ws(c,p){return c&&Q2(c,p,_r)}function Z2(c,p){return c&&p6(c,p,_r)}function zy(c,p){return ol(p,function(w){return ha(c[w])})}function Ou(c,p){p=dl(p,c);for(var w=0,R=p.length;c!=null&&w<R;)c=c[Cs(p[w++])];return w&&w==R?c:n}function g6(c,p,w){var R=p(c);return Qe(c)?R:sl(R,w(c))}function ui(c){return c==null?c===n?Gr:vt:Eu&&Eu in en(c)?$W(c):YW(c)}function J2(c,p){return c>p}function nW(c,p){return c!=null&&zt.call(c,p)}function rW(c,p){return c!=null&&p in en(c)}function iW(c,p,w){return c>=Wr(p,w)&&c<lr(p,w)}function ew(c,p,w){for(var R=w?D2:wy,I=c[0].length,z=c.length,K=z,X=oe(z),te=1/0,ce=[];K--;){var de=c[K];K&&p&&(de=yn(de,Hi(p))),te=Wr(de.length,te),X[K]=!w&&(p||I>=120&&de.length>=120)?new Pu(K&&de):n}de=c[0];var he=-1,be=X[0];e:for(;++he<I&&ce.length<te;){var Ne=de[he],je=p?p(Ne):Ne;if(Ne=w||Ne!==0?Ne:0,!(be?Ih(be,je):R(ce,je,w))){for(K=z;--K;){var st=X[K];if(!(st?Ih(st,je):R(c[K],je,w)))continue e}be&&be.push(je),ce.push(Ne)}}return ce}function oW(c,p,w,R){return ws(c,function(I,z,K){p(R,w(I),z,K)}),R}function Uh(c,p,w){p=dl(p,c),c=nP(c,p);var R=c==null?c:c[Cs(vo(p))];return R==null?n:Gi(R,c,w)}function m6(c){return Mn(c)&&ui(c)==se}function sW(c){return Mn(c)&&ui(c)==In}function aW(c){return Mn(c)&&ui(c)==fe}function zh(c,p,w,R,I){return c===p?!0:c==null||p==null||!Mn(c)&&!Mn(p)?c!==c&&p!==p:lW(c,p,w,R,zh,I)}function lW(c,p,w,R,I,z){var K=Qe(c),X=Qe(p),te=K?le:qr(c),ce=X?le:qr(p);te=te==se?_e:te,ce=ce==se?_e:ce;var de=te==_e,he=ce==_e,be=te==ce;if(be&&hl(c)){if(!hl(p))return!1;K=!0,de=!1}if(be&&!de)return z||(z=new qo),K||dd(c)?X6(c,p,w,R,I,z):LW(c,p,te,w,R,I,z);if(!(w&m)){var Ne=de&&zt.call(c,"__wrapped__"),je=he&&zt.call(p,"__wrapped__");if(Ne||je){var st=Ne?c.value():c,Ge=je?p.value():p;return z||(z=new qo),I(st,Ge,w,R,z)}}return be?(z||(z=new qo),DW(c,p,w,R,I,z)):!1}function uW(c){return Mn(c)&&qr(c)==Fe}function tw(c,p,w,R){var I=w.length,z=I,K=!R;if(c==null)return!z;for(c=en(c);I--;){var X=w[I];if(K&&X[2]?X[1]!==c[X[0]]:!(X[0]in c))return!1}for(;++I<z;){X=w[I];var te=X[0],ce=c[te],de=X[1];if(K&&X[2]){if(ce===n&&!(te in c))return!1}else{var he=new qo;if(R)var be=R(ce,de,te,c,p,he);if(!(be===n?zh(de,ce,m|v,R,he):be))return!1}}return!0}function y6(c){if(!xn(c)||HW(c))return!1;var p=ha(c)?uH:Gc;return p.test(Iu(c))}function cW(c){return Mn(c)&&ui(c)==qt}function dW(c){return Mn(c)&&qr(c)==ht}function fW(c){return Mn(c)&&i0(c.length)&&!!Jt[ui(c)]}function v6(c){return typeof c=="function"?c:c==null?Pi:typeof c=="object"?Qe(c)?S6(c[0],c[1]):b6(c):UP(c)}function nw(c){if(!Gh(c))return gH(c);var p=[];for(var w in en(c))zt.call(c,w)&&w!="constructor"&&p.push(w);return p}function hW(c){if(!xn(c))return XW(c);var p=Gh(c),w=[];for(var R in c)R=="constructor"&&(p||!zt.call(c,R))||w.push(R);return w}function rw(c,p){return c<p}function _6(c,p){var w=-1,R=Ei(c)?oe(c.length):[];return ul(c,function(I,z,K){R[++w]=p(I,z,K)}),R}function b6(c){var p=vw(c);return p.length==1&&p[0][2]?eP(p[0][0],p[0][1]):function(w){return w===c||tw(w,c,p)}}function S6(c,p){return bw(c)&&J6(p)?eP(Cs(c),p):function(w){var R=Ow(w,c);return R===n&&R===p?kw(w,c):zh(p,R,m|v)}}function Vy(c,p,w,R,I){c!==p&&Q2(p,function(z,K){if(I||(I=new qo),xn(z))pW(c,p,K,w,Vy,R,I);else{var X=R?R(ww(c,K),z,K+"",c,p,I):n;X===n&&(X=z),X2(c,K,X)}},Ai)}function pW(c,p,w,R,I,z,K){var X=ww(c,w),te=ww(p,w),ce=K.get(te);if(ce){X2(c,w,ce);return}var de=z?z(X,te,w+"",c,p,K):n,he=de===n;if(he){var be=Qe(te),Ne=!be&&hl(te),je=!be&&!Ne&&dd(te);de=te,be||Ne||je?Qe(X)?de=X:Fn(X)?de=Ti(X):Ne?(he=!1,de=M6(te,!0)):je?(he=!1,de=N6(te,!0)):de=[]:Wh(te)||Mu(te)?(de=X,Mu(X)?de=OP(X):(!xn(X)||ha(X))&&(de=Z6(te))):he=!1}he&&(K.set(te,de),I(de,te,R,z,K),K.delete(te)),X2(c,w,de)}function w6(c,p){var w=c.length;if(w)return p+=p<0?w:0,fa(p,w)?c[p]:n}function x6(c,p,w){p.length?p=yn(p,function(z){return Qe(z)?function(K){return Ou(K,z.length===1?z[0]:z)}:z}):p=[Pi];var R=-1;p=yn(p,Hi(Ve()));var I=_6(c,function(z,K,X){var te=yn(p,function(ce){return ce(z)});return{criteria:te,index:++R,value:z}});return zG(I,function(z,K){return AW(z,K,w)})}function gW(c,p){return C6(c,p,function(w,R){return kw(c,R)})}function C6(c,p,w){for(var R=-1,I=p.length,z={};++R<I;){var K=p[R],X=Ou(c,K);w(X,K)&&Vh(z,dl(K,c),X)}return z}function mW(c){return function(p){return Ou(p,c)}}function iw(c,p,w,R){var I=R?UG:ed,z=-1,K=p.length,X=c;for(c===p&&(p=Ti(p)),w&&(X=yn(c,Hi(w)));++z<K;)for(var te=0,ce=p[z],de=w?w(ce):ce;(te=I(X,de,te,R))>-1;)X!==c&&Iy.call(X,te,1),Iy.call(c,te,1);return c}function T6(c,p){for(var w=c?p.length:0,R=w-1;w--;){var I=p[w];if(w==R||I!==z){var z=I;fa(I)?Iy.call(c,I,1):lw(c,I)}}return c}function ow(c,p){return c+Ly(o6()*(p-c+1))}function yW(c,p,w,R){for(var I=-1,z=lr(Ny((p-c)/(w||1)),0),K=oe(z);z--;)K[R?z:++I]=c,c+=w;return K}function sw(c,p){var w="";if(!c||p<1||p>$)return w;do p%2&&(w+=c),p=Ly(p/2),p&&(c+=c);while(p);return w}function lt(c,p){return xw(tP(c,p,Pi),c+"")}function vW(c){return l6(fd(c))}function _W(c,p){var w=fd(c);return Zy(w,Ru(p,0,w.length))}function Vh(c,p,w,R){if(!xn(c))return c;p=dl(p,c);for(var I=-1,z=p.length,K=z-1,X=c;X!=null&&++I<z;){var te=Cs(p[I]),ce=w;if(te==="__proto__"||te==="constructor"||te==="prototype")return c;if(I!=K){var de=X[te];ce=R?R(de,te,X):n,ce===n&&(ce=xn(de)?de:fa(p[I+1])?[]:{})}Fh(X,te,ce),X=X[te]}return c}var E6=Dy?function(c,p){return Dy.set(c,p),c}:Pi,bW=My?function(c,p){return My(c,"toString",{configurable:!0,enumerable:!1,value:Mw(p),writable:!0})}:Pi;function SW(c){return Zy(fd(c))}function yo(c,p,w){var R=-1,I=c.length;p<0&&(p=-p>I?0:I+p),w=w>I?I:w,w<0&&(w+=I),I=p>w?0:w-p>>>0,p>>>=0;for(var z=oe(I);++R<I;)z[R]=c[R+p];return z}function wW(c,p){var w;return ul(c,function(R,I,z){return w=p(R,I,z),!w}),!!w}function jy(c,p,w){var R=0,I=c==null?R:c.length;if(typeof p=="number"&&p===p&&I<=ee){for(;R<I;){var z=R+I>>>1,K=c[z];K!==null&&!qi(K)&&(w?K<=p:K<p)?R=z+1:I=z}return I}return aw(c,p,Pi,w)}function aw(c,p,w,R){var I=0,z=c==null?0:c.length;if(z===0)return 0;p=w(p);for(var K=p!==p,X=p===null,te=qi(p),ce=p===n;I<z;){var de=Ly((I+z)/2),he=w(c[de]),be=he!==n,Ne=he===null,je=he===he,st=qi(he);if(K)var Ge=R||je;else ce?Ge=je&&(R||be):X?Ge=je&&be&&(R||!Ne):te?Ge=je&&be&&!Ne&&(R||!st):Ne||st?Ge=!1:Ge=R?he<=p:he<p;Ge?I=de+1:z=de}return Wr(z,Z)}function A6(c,p){for(var w=-1,R=c.length,I=0,z=[];++w<R;){var K=c[w],X=p?p(K):K;if(!w||!Ko(X,te)){var te=X;z[I++]=K===0?0:K}}return z}function P6(c){return typeof c=="number"?c:qi(c)?G:+c}function Wi(c){if(typeof c=="string")return c;if(Qe(c))return yn(c,Wi)+"";if(qi(c))return s6?s6.call(c):"";var p=c+"";return p=="0"&&1/c==-U?"-0":p}function cl(c,p,w){var R=-1,I=wy,z=c.length,K=!0,X=[],te=X;if(w)K=!1,I=D2;else if(z>=i){var ce=p?null:MW(c);if(ce)return Cy(ce);K=!1,I=Ih,te=new Pu}else te=p?[]:X;e:for(;++R<z;){var de=c[R],he=p?p(de):de;if(de=w||de!==0?de:0,K&&he===he){for(var be=te.length;be--;)if(te[be]===he)continue e;p&&te.push(he),X.push(de)}else I(te,he,w)||(te!==X&&te.push(he),X.push(de))}return X}function lw(c,p){return p=dl(p,c),c=nP(c,p),c==null||delete c[Cs(vo(p))]}function R6(c,p,w,R){return Vh(c,p,w(Ou(c,p)),R)}function Gy(c,p,w,R){for(var I=c.length,z=R?I:-1;(R?z--:++z<I)&&p(c[z],z,c););return w?yo(c,R?0:z,R?z+1:I):yo(c,R?z+1:0,R?I:z)}function O6(c,p){var w=c;return w instanceof _t&&(w=w.value()),$2(p,function(R,I){return I.func.apply(I.thisArg,sl([R],I.args))},w)}function uw(c,p,w){var R=c.length;if(R<2)return R?cl(c[0]):[];for(var I=-1,z=oe(R);++I<R;)for(var K=c[I],X=-1;++X<R;)X!=I&&(z[I]=Bh(z[I]||K,c[X],p,w));return cl(Lr(z,1),p,w)}function k6(c,p,w){for(var R=-1,I=c.length,z=p.length,K={};++R<I;){var X=R<z?p[R]:n;w(K,c[R],X)}return K}function cw(c){return Fn(c)?c:[]}function dw(c){return typeof c=="function"?c:Pi}function dl(c,p){return Qe(c)?c:bw(c,p)?[c]:sP(Bt(c))}var xW=lt;function fl(c,p,w){var R=c.length;return w=w===n?R:w,!p&&w>=R?c:yo(c,p,w)}var I6=cH||function(c){return et.clearTimeout(c)};function M6(c,p){if(p)return c.slice();var w=c.length,R=e6?e6(w):new c.constructor(w);return c.copy(R),R}function fw(c){var p=new c.constructor(c.byteLength);return new Oy(p).set(new Oy(c)),p}function CW(c,p){var w=p?fw(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.byteLength)}function TW(c){var p=new c.constructor(c.source,jo.exec(c));return p.lastIndex=c.lastIndex,p}function EW(c){return $h?en($h.call(c)):{}}function N6(c,p){var w=p?fw(c.buffer):c.buffer;return new c.constructor(w,c.byteOffset,c.length)}function L6(c,p){if(c!==p){var w=c!==n,R=c===null,I=c===c,z=qi(c),K=p!==n,X=p===null,te=p===p,ce=qi(p);if(!X&&!ce&&!z&&c>p||z&&K&&te&&!X&&!ce||R&&K&&te||!w&&te||!I)return 1;if(!R&&!z&&!ce&&c<p||ce&&w&&I&&!R&&!z||X&&w&&I||!K&&I||!te)return-1}return 0}function AW(c,p,w){for(var R=-1,I=c.criteria,z=p.criteria,K=I.length,X=w.length;++R<K;){var te=L6(I[R],z[R]);if(te){if(R>=X)return te;var ce=w[R];return te*(ce=="desc"?-1:1)}}return c.index-p.index}function D6(c,p,w,R){for(var I=-1,z=c.length,K=w.length,X=-1,te=p.length,ce=lr(z-K,0),de=oe(te+ce),he=!R;++X<te;)de[X]=p[X];for(;++I<K;)(he||I<z)&&(de[w[I]]=c[I]);for(;ce--;)de[X++]=c[I++];return de}function $6(c,p,w,R){for(var I=-1,z=c.length,K=-1,X=w.length,te=-1,ce=p.length,de=lr(z-X,0),he=oe(de+ce),be=!R;++I<de;)he[I]=c[I];for(var Ne=I;++te<ce;)he[Ne+te]=p[te];for(;++K<X;)(be||I<z)&&(he[Ne+w[K]]=c[I++]);return he}function Ti(c,p){var w=-1,R=c.length;for(p||(p=oe(R));++w<R;)p[w]=c[w];return p}function xs(c,p,w,R){var I=!w;w||(w={});for(var z=-1,K=p.length;++z<K;){var X=p[z],te=R?R(w[X],c[X],X,w,c):n;te===n&&(te=c[X]),I?ua(w,X,te):Fh(w,X,te)}return w}function PW(c,p){return xs(c,_w(c),p)}function RW(c,p){return xs(c,Y6(c),p)}function Hy(c,p){return function(w,R){var I=Qe(w)?NG:QH,z=p?p():{};return I(w,c,Ve(R,2),z)}}function ld(c){return lt(function(p,w){var R=-1,I=w.length,z=I>1?w[I-1]:n,K=I>2?w[2]:n;for(z=c.length>3&&typeof z=="function"?(I--,z):n,K&&ci(w[0],w[1],K)&&(z=I<3?n:z,I=1),p=en(p);++R<I;){var X=w[R];X&&c(p,X,R,z)}return p})}function F6(c,p){return function(w,R){if(w==null)return w;if(!Ei(w))return c(w,R);for(var I=w.length,z=p?I:-1,K=en(w);(p?z--:++z<I)&&R(K[z],z,K)!==!1;);return w}}function B6(c){return function(p,w,R){for(var I=-1,z=en(p),K=R(p),X=K.length;X--;){var te=K[c?X:++I];if(w(z[te],te,z)===!1)break}return p}}function OW(c,p,w){var R=p&x,I=jh(c);function z(){var K=this&&this!==et&&this instanceof z?I:c;return K.apply(R?w:this,arguments)}return z}function U6(c){return function(p){p=Bt(p);var w=td(p)?Wo(p):n,R=w?w[0]:p.charAt(0),I=w?fl(w,1).join(""):p.slice(1);return R[c]()+I}}function ud(c){return function(p){return $2(FP($P(p).replace(Oh,"")),c,"")}}function jh(c){return function(){var p=arguments;switch(p.length){case 0:return new c;case 1:return new c(p[0]);case 2:return new c(p[0],p[1]);case 3:return new c(p[0],p[1],p[2]);case 4:return new c(p[0],p[1],p[2],p[3]);case 5:return new c(p[0],p[1],p[2],p[3],p[4]);case 6:return new c(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new c(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var w=ad(c.prototype),R=c.apply(w,p);return xn(R)?R:w}}function kW(c,p,w){var R=jh(c);function I(){for(var z=arguments.length,K=oe(z),X=z,te=cd(I);X--;)K[X]=arguments[X];var ce=z<3&&K[0]!==te&&K[z-1]!==te?[]:al(K,te);if(z-=ce.length,z<w)return H6(c,p,Wy,I.placeholder,n,K,ce,n,n,w-z);var de=this&&this!==et&&this instanceof I?R:c;return Gi(de,this,K)}return I}function z6(c){return function(p,w,R){var I=en(p);if(!Ei(p)){var z=Ve(w,3);p=_r(p),w=function(X){return z(I[X],X,I)}}var K=c(p,w,R);return K>-1?I[z?p[K]:K]:n}}function V6(c){return da(function(p){var w=p.length,R=w,I=go.prototype.thru;for(c&&p.reverse();R--;){var z=p[R];if(typeof z!="function")throw new po(s);if(I&&!K&&Yy(z)=="wrapper")var K=new go([],!0)}for(R=K?R:w;++R<w;){z=p[R];var X=Yy(z),te=X=="wrapper"?yw(z):n;te&&Sw(te[0])&&te[1]==(E|y|C|P)&&!te[4].length&&te[9]==1?K=K[Yy(te[0])].apply(K,te[3]):K=z.length==1&&Sw(z)?K[X]():K.thru(z)}return function(){var ce=arguments,de=ce[0];if(K&&ce.length==1&&Qe(de))return K.plant(de).value();for(var he=0,be=w?p[he].apply(this,ce):de;++he<w;)be=p[he].call(this,be);return be}})}function Wy(c,p,w,R,I,z,K,X,te,ce){var de=p&E,he=p&x,be=p&_,Ne=p&(y|S),je=p&k,st=be?n:jh(c);function Ge(){for(var gt=arguments.length,Ct=oe(gt),Ki=gt;Ki--;)Ct[Ki]=arguments[Ki];if(Ne)var di=cd(Ge),Xi=jG(Ct,di);if(R&&(Ct=D6(Ct,R,I,Ne)),z&&(Ct=$6(Ct,z,K,Ne)),gt-=Xi,Ne&><ce){var Bn=al(Ct,di);return H6(c,p,Wy,Ge.placeholder,w,Ct,Bn,X,te,ce-gt)}var Xo=he?w:this,ga=be?Xo[c]:c;return gt=Ct.length,X?Ct=QW(Ct,X):je&>>1&&Ct.reverse(),de&&te<gt&&(Ct.length=te),this&&this!==et&&this instanceof Ge&&(ga=st||jh(ga)),ga.apply(Xo,Ct)}return Ge}function j6(c,p){return function(w,R){return oW(w,c,p(R),{})}}function qy(c,p){return function(w,R){var I;if(w===n&&R===n)return p;if(w!==n&&(I=w),R!==n){if(I===n)return R;typeof w=="string"||typeof R=="string"?(w=Wi(w),R=Wi(R)):(w=P6(w),R=P6(R)),I=c(w,R)}return I}}function hw(c){return da(function(p){return p=yn(p,Hi(Ve())),lt(function(w){var R=this;return c(p,function(I){return Gi(I,R,w)})})})}function Ky(c,p){p=p===n?" ":Wi(p);var w=p.length;if(w<2)return w?sw(p,c):p;var R=sw(p,Ny(c/nd(p)));return td(p)?fl(Wo(R),0,c).join(""):R.slice(0,c)}function IW(c,p,w,R){var I=p&x,z=jh(c);function K(){for(var X=-1,te=arguments.length,ce=-1,de=R.length,he=oe(de+te),be=this&&this!==et&&this instanceof K?z:c;++ce<de;)he[ce]=R[ce];for(;te--;)he[ce++]=arguments[++X];return Gi(be,I?w:this,he)}return K}function G6(c){return function(p,w,R){return R&&typeof R!="number"&&ci(p,w,R)&&(w=R=n),p=pa(p),w===n?(w=p,p=0):w=pa(w),R=R===n?p<w?1:-1:pa(R),yW(p,w,R,c)}}function Xy(c){return function(p,w){return typeof p=="string"&&typeof w=="string"||(p=_o(p),w=_o(w)),c(p,w)}}function H6(c,p,w,R,I,z,K,X,te,ce){var de=p&y,he=de?K:n,be=de?n:K,Ne=de?z:n,je=de?n:z;p|=de?C:T,p&=~(de?T:C),p&b||(p&=~(x|_));var st=[c,p,I,Ne,he,je,be,X,te,ce],Ge=w.apply(n,st);return Sw(c)&&rP(Ge,st),Ge.placeholder=R,iP(Ge,c,p)}function pw(c){var p=ar[c];return function(w,R){if(w=_o(w),R=R==null?0:Wr(rt(R),292),R&&i6(w)){var I=(Bt(w)+"e").split("e"),z=p(I[0]+"e"+(+I[1]+R));return I=(Bt(z)+"e").split("e"),+(I[0]+"e"+(+I[1]-R))}return p(w)}}var MW=od&&1/Cy(new od([,-0]))[1]==U?function(c){return new od(c)}:Dw;function W6(c){return function(p){var w=qr(p);return w==Fe?G2(p):w==ht?YG(p):VG(p,c(p))}}function ca(c,p,w,R,I,z,K,X){var te=p&_;if(!te&&typeof c!="function")throw new po(s);var ce=R?R.length:0;if(ce||(p&=~(C|T),R=I=n),K=K===n?K:lr(rt(K),0),X=X===n?X:rt(X),ce-=I?I.length:0,p&T){var de=R,he=I;R=I=n}var be=te?n:yw(c),Ne=[c,p,w,R,I,de,he,z,K,X];if(be&&KW(Ne,be),c=Ne[0],p=Ne[1],w=Ne[2],R=Ne[3],I=Ne[4],X=Ne[9]=Ne[9]===n?te?0:c.length:lr(Ne[9]-ce,0),!X&&p&(y|S)&&(p&=~(y|S)),!p||p==x)var je=OW(c,p,w);else p==y||p==S?je=kW(c,p,X):(p==C||p==(x|C))&&!I.length?je=IW(c,p,w,R):je=Wy.apply(n,Ne);var st=be?E6:rP;return iP(st(je,Ne),c,p)}function q6(c,p,w,R){return c===n||Ko(c,id[w])&&!zt.call(R,w)?p:c}function K6(c,p,w,R,I,z){return xn(c)&&xn(p)&&(z.set(p,c),Vy(c,p,n,K6,z),z.delete(p)),c}function NW(c){return Wh(c)?n:c}function X6(c,p,w,R,I,z){var K=w&m,X=c.length,te=p.length;if(X!=te&&!(K&&te>X))return!1;var ce=z.get(c),de=z.get(p);if(ce&&de)return ce==p&&de==c;var he=-1,be=!0,Ne=w&v?new Pu:n;for(z.set(c,p),z.set(p,c);++he<X;){var je=c[he],st=p[he];if(R)var Ge=K?R(st,je,he,p,c,z):R(je,st,he,c,p,z);if(Ge!==n){if(Ge)continue;be=!1;break}if(Ne){if(!F2(p,function(gt,Ct){if(!Ih(Ne,Ct)&&(je===gt||I(je,gt,w,R,z)))return Ne.push(Ct)})){be=!1;break}}else if(!(je===st||I(je,st,w,R,z))){be=!1;break}}return z.delete(c),z.delete(p),be}function LW(c,p,w,R,I,z,K){switch(w){case gn:if(c.byteLength!=p.byteLength||c.byteOffset!=p.byteOffset)return!1;c=c.buffer,p=p.buffer;case In:return!(c.byteLength!=p.byteLength||!z(new Oy(c),new Oy(p)));case ne:case fe:case Ae:return Ko(+c,+p);case ve:return c.name==p.name&&c.message==p.message;case qt:case At:return c==p+"";case Fe:var X=G2;case ht:var te=R&m;if(X||(X=Cy),c.size!=p.size&&!te)return!1;var ce=K.get(c);if(ce)return ce==p;R|=v,K.set(c,p);var de=X6(X(c),X(p),R,I,z,K);return K.delete(c),de;case un:if($h)return $h.call(c)==$h.call(p)}return!1}function DW(c,p,w,R,I,z){var K=w&m,X=gw(c),te=X.length,ce=gw(p),de=ce.length;if(te!=de&&!K)return!1;for(var he=te;he--;){var be=X[he];if(!(K?be in p:zt.call(p,be)))return!1}var Ne=z.get(c),je=z.get(p);if(Ne&&je)return Ne==p&&je==c;var st=!0;z.set(c,p),z.set(p,c);for(var Ge=K;++he<te;){be=X[he];var gt=c[be],Ct=p[be];if(R)var Ki=K?R(Ct,gt,be,p,c,z):R(gt,Ct,be,c,p,z);if(!(Ki===n?gt===Ct||I(gt,Ct,w,R,z):Ki)){st=!1;break}Ge||(Ge=be=="constructor")}if(st&&!Ge){var di=c.constructor,Xi=p.constructor;di!=Xi&&"constructor"in c&&"constructor"in p&&!(typeof di=="function"&&di instanceof di&&typeof Xi=="function"&&Xi instanceof Xi)&&(st=!1)}return z.delete(c),z.delete(p),st}function da(c){return xw(tP(c,n,cP),c+"")}function gw(c){return g6(c,_r,_w)}function mw(c){return g6(c,Ai,Y6)}var yw=Dy?function(c){return Dy.get(c)}:Dw;function Yy(c){for(var p=c.name+"",w=sd[p],R=zt.call(sd,p)?w.length:0;R--;){var I=w[R],z=I.func;if(z==null||z==c)return I.name}return p}function cd(c){var p=zt.call(F,"placeholder")?F:c;return p.placeholder}function Ve(){var c=F.iteratee||Nw;return c=c===Nw?v6:c,arguments.length?c(arguments[0],arguments[1]):c}function Qy(c,p){var w=c.__data__;return GW(p)?w[typeof p=="string"?"string":"hash"]:w.map}function vw(c){for(var p=_r(c),w=p.length;w--;){var R=p[w],I=c[R];p[w]=[R,I,J6(I)]}return p}function ku(c,p){var w=qG(c,p);return y6(w)?w:n}function $W(c){var p=zt.call(c,Eu),w=c[Eu];try{c[Eu]=n;var R=!0}catch{}var I=Py.call(c);return R&&(p?c[Eu]=w:delete c[Eu]),I}var _w=W2?function(c){return c==null?[]:(c=en(c),ol(W2(c),function(p){return n6.call(c,p)}))}:$w,Y6=W2?function(c){for(var p=[];c;)sl(p,_w(c)),c=ky(c);return p}:$w,qr=ui;(q2&&qr(new q2(new ArrayBuffer(1)))!=gn||Nh&&qr(new Nh)!=Fe||K2&&qr(K2.resolve())!=Qt||od&&qr(new od)!=ht||Lh&&qr(new Lh)!=Pr)&&(qr=function(c){var p=ui(c),w=p==_e?c.constructor:n,R=w?Iu(w):"";if(R)switch(R){case _H:return gn;case bH:return Fe;case SH:return Qt;case wH:return ht;case xH:return Pr}return p});function FW(c,p,w){for(var R=-1,I=w.length;++R<I;){var z=w[R],K=z.size;switch(z.type){case"drop":c+=K;break;case"dropRight":p-=K;break;case"take":p=Wr(p,c+K);break;case"takeRight":c=lr(c,p-K);break}}return{start:c,end:p}}function BW(c){var p=c.match(Mr);return p?p[1].split(oa):[]}function Q6(c,p,w){p=dl(p,c);for(var R=-1,I=p.length,z=!1;++R<I;){var K=Cs(p[R]);if(!(z=c!=null&&w(c,K)))break;c=c[K]}return z||++R!=I?z:(I=c==null?0:c.length,!!I&&i0(I)&&fa(K,I)&&(Qe(c)||Mu(c)))}function UW(c){var p=c.length,w=new c.constructor(p);return p&&typeof c[0]=="string"&&zt.call(c,"index")&&(w.index=c.index,w.input=c.input),w}function Z6(c){return typeof c.constructor=="function"&&!Gh(c)?ad(ky(c)):{}}function zW(c,p,w){var R=c.constructor;switch(p){case In:return fw(c);case ne:case fe:return new R(+c);case gn:return CW(c,w);case ir:case mn:case Zt:case Rr:case Hr:case si:case Vi:case $n:case ai:return N6(c,w);case Fe:return new R;case Ae:case At:return new R(c);case qt:return TW(c);case ht:return new R;case un:return EW(c)}}function VW(c,p){var w=p.length;if(!w)return c;var R=w-1;return p[R]=(w>1?"& ":"")+p[R],p=p.join(w>2?", ":" "),c.replace(Vo,`{
|
||
/* [wrapped with `+p+`] */
|
||
`)}function jW(c){return Qe(c)||Mu(c)||!!(r6&&c&&c[r6])}function fa(c,p){var w=typeof c;return p=p??$,!!p&&(w=="number"||w!="symbol"&&bh.test(c))&&c>-1&&c%1==0&&c<p}function ci(c,p,w){if(!xn(w))return!1;var R=typeof p;return(R=="number"?Ei(w)&&fa(p,w.length):R=="string"&&p in w)?Ko(w[p],c):!1}function bw(c,p){if(Qe(c))return!1;var w=typeof c;return w=="number"||w=="symbol"||w=="boolean"||c==null||qi(c)?!0:Ir.test(c)||!co.test(c)||p!=null&&c in en(p)}function GW(c){var p=typeof c;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?c!=="__proto__":c===null}function Sw(c){var p=Yy(c),w=F[p];if(typeof w!="function"||!(p in _t.prototype))return!1;if(c===w)return!0;var R=yw(w);return!!R&&c===R[0]}function HW(c){return!!JA&&JA in c}var WW=Ey?ha:Fw;function Gh(c){var p=c&&c.constructor,w=typeof p=="function"&&p.prototype||id;return c===w}function J6(c){return c===c&&!xn(c)}function eP(c,p){return function(w){return w==null?!1:w[c]===p&&(p!==n||c in en(w))}}function qW(c){var p=n0(c,function(R){return w.size===u&&w.clear(),R}),w=p.cache;return p}function KW(c,p){var w=c[1],R=p[1],I=w|R,z=I<(x|_|E),K=R==E&&w==y||R==E&&w==P&&c[7].length<=p[8]||R==(E|P)&&p[7].length<=p[8]&&w==y;if(!(z||K))return c;R&x&&(c[2]=p[2],I|=w&x?0:b);var X=p[3];if(X){var te=c[3];c[3]=te?D6(te,X,p[4]):X,c[4]=te?al(c[3],d):p[4]}return X=p[5],X&&(te=c[5],c[5]=te?$6(te,X,p[6]):X,c[6]=te?al(c[5],d):p[6]),X=p[7],X&&(c[7]=X),R&E&&(c[8]=c[8]==null?p[8]:Wr(c[8],p[8])),c[9]==null&&(c[9]=p[9]),c[0]=p[0],c[1]=I,c}function XW(c){var p=[];if(c!=null)for(var w in en(c))p.push(w);return p}function YW(c){return Py.call(c)}function tP(c,p,w){return p=lr(p===n?c.length-1:p,0),function(){for(var R=arguments,I=-1,z=lr(R.length-p,0),K=oe(z);++I<z;)K[I]=R[p+I];I=-1;for(var X=oe(p+1);++I<p;)X[I]=R[I];return X[p]=w(K),Gi(c,this,X)}}function nP(c,p){return p.length<2?c:Ou(c,yo(p,0,-1))}function QW(c,p){for(var w=c.length,R=Wr(p.length,w),I=Ti(c);R--;){var z=p[R];c[R]=fa(z,w)?I[z]:n}return c}function ww(c,p){if(!(p==="constructor"&&typeof c[p]=="function")&&p!="__proto__")return c[p]}var rP=oP(E6),Hh=fH||function(c,p){return et.setTimeout(c,p)},xw=oP(bW);function iP(c,p,w){var R=p+"";return xw(c,VW(R,ZW(BW(R),w)))}function oP(c){var p=0,w=0;return function(){var R=mH(),I=B-(R-w);if(w=R,I>0){if(++p>=V)return arguments[0]}else p=0;return c.apply(n,arguments)}}function Zy(c,p){var w=-1,R=c.length,I=R-1;for(p=p===n?R:p;++w<p;){var z=ow(w,I),K=c[z];c[z]=c[w],c[w]=K}return c.length=p,c}var sP=qW(function(c){var p=[];return c.charCodeAt(0)===46&&p.push(""),c.replace(sr,function(w,R,I,z){p.push(I?z.replace(gh,"$1"):R||w)}),p});function Cs(c){if(typeof c=="string"||qi(c))return c;var p=c+"";return p=="0"&&1/c==-U?"-0":p}function Iu(c){if(c!=null){try{return Ay.call(c)}catch{}try{return c+""}catch{}}return""}function ZW(c,p){return ho(ie,function(w){var R="_."+w[0];p&w[1]&&!wy(c,R)&&c.push(R)}),c.sort()}function aP(c){if(c instanceof _t)return c.clone();var p=new go(c.__wrapped__,c.__chain__);return p.__actions__=Ti(c.__actions__),p.__index__=c.__index__,p.__values__=c.__values__,p}function JW(c,p,w){(w?ci(c,p,w):p===n)?p=1:p=lr(rt(p),0);var R=c==null?0:c.length;if(!R||p<1)return[];for(var I=0,z=0,K=oe(Ny(R/p));I<R;)K[z++]=yo(c,I,I+=p);return K}function eq(c){for(var p=-1,w=c==null?0:c.length,R=0,I=[];++p<w;){var z=c[p];z&&(I[R++]=z)}return I}function tq(){var c=arguments.length;if(!c)return[];for(var p=oe(c-1),w=arguments[0],R=c;R--;)p[R-1]=arguments[R];return sl(Qe(w)?Ti(w):[w],Lr(p,1))}var nq=lt(function(c,p){return Fn(c)?Bh(c,Lr(p,1,Fn,!0)):[]}),rq=lt(function(c,p){var w=vo(p);return Fn(w)&&(w=n),Fn(c)?Bh(c,Lr(p,1,Fn,!0),Ve(w,2)):[]}),iq=lt(function(c,p){var w=vo(p);return Fn(w)&&(w=n),Fn(c)?Bh(c,Lr(p,1,Fn,!0),n,w):[]});function oq(c,p,w){var R=c==null?0:c.length;return R?(p=w||p===n?1:rt(p),yo(c,p<0?0:p,R)):[]}function sq(c,p,w){var R=c==null?0:c.length;return R?(p=w||p===n?1:rt(p),p=R-p,yo(c,0,p<0?0:p)):[]}function aq(c,p){return c&&c.length?Gy(c,Ve(p,3),!0,!0):[]}function lq(c,p){return c&&c.length?Gy(c,Ve(p,3),!0):[]}function uq(c,p,w,R){var I=c==null?0:c.length;return I?(w&&typeof w!="number"&&ci(c,p,w)&&(w=0,R=I),tW(c,p,w,R)):[]}function lP(c,p,w){var R=c==null?0:c.length;if(!R)return-1;var I=w==null?0:rt(w);return I<0&&(I=lr(R+I,0)),xy(c,Ve(p,3),I)}function uP(c,p,w){var R=c==null?0:c.length;if(!R)return-1;var I=R-1;return w!==n&&(I=rt(w),I=w<0?lr(R+I,0):Wr(I,R-1)),xy(c,Ve(p,3),I,!0)}function cP(c){var p=c==null?0:c.length;return p?Lr(c,1):[]}function cq(c){var p=c==null?0:c.length;return p?Lr(c,U):[]}function dq(c,p){var w=c==null?0:c.length;return w?(p=p===n?1:rt(p),Lr(c,p)):[]}function fq(c){for(var p=-1,w=c==null?0:c.length,R={};++p<w;){var I=c[p];R[I[0]]=I[1]}return R}function dP(c){return c&&c.length?c[0]:n}function hq(c,p,w){var R=c==null?0:c.length;if(!R)return-1;var I=w==null?0:rt(w);return I<0&&(I=lr(R+I,0)),ed(c,p,I)}function pq(c){var p=c==null?0:c.length;return p?yo(c,0,-1):[]}var gq=lt(function(c){var p=yn(c,cw);return p.length&&p[0]===c[0]?ew(p):[]}),mq=lt(function(c){var p=vo(c),w=yn(c,cw);return p===vo(w)?p=n:w.pop(),w.length&&w[0]===c[0]?ew(w,Ve(p,2)):[]}),yq=lt(function(c){var p=vo(c),w=yn(c,cw);return p=typeof p=="function"?p:n,p&&w.pop(),w.length&&w[0]===c[0]?ew(w,n,p):[]});function vq(c,p){return c==null?"":pH.call(c,p)}function vo(c){var p=c==null?0:c.length;return p?c[p-1]:n}function _q(c,p,w){var R=c==null?0:c.length;if(!R)return-1;var I=R;return w!==n&&(I=rt(w),I=I<0?lr(R+I,0):Wr(I,R-1)),p===p?ZG(c,p,I):xy(c,HA,I,!0)}function bq(c,p){return c&&c.length?w6(c,rt(p)):n}var Sq=lt(fP);function fP(c,p){return c&&c.length&&p&&p.length?iw(c,p):c}function wq(c,p,w){return c&&c.length&&p&&p.length?iw(c,p,Ve(w,2)):c}function xq(c,p,w){return c&&c.length&&p&&p.length?iw(c,p,n,w):c}var Cq=da(function(c,p){var w=c==null?0:c.length,R=Y2(c,p);return T6(c,yn(p,function(I){return fa(I,w)?+I:I}).sort(L6)),R});function Tq(c,p){var w=[];if(!(c&&c.length))return w;var R=-1,I=[],z=c.length;for(p=Ve(p,3);++R<z;){var K=c[R];p(K,R,c)&&(w.push(K),I.push(R))}return T6(c,I),w}function Cw(c){return c==null?c:vH.call(c)}function Eq(c,p,w){var R=c==null?0:c.length;return R?(w&&typeof w!="number"&&ci(c,p,w)?(p=0,w=R):(p=p==null?0:rt(p),w=w===n?R:rt(w)),yo(c,p,w)):[]}function Aq(c,p){return jy(c,p)}function Pq(c,p,w){return aw(c,p,Ve(w,2))}function Rq(c,p){var w=c==null?0:c.length;if(w){var R=jy(c,p);if(R<w&&Ko(c[R],p))return R}return-1}function Oq(c,p){return jy(c,p,!0)}function kq(c,p,w){return aw(c,p,Ve(w,2),!0)}function Iq(c,p){var w=c==null?0:c.length;if(w){var R=jy(c,p,!0)-1;if(Ko(c[R],p))return R}return-1}function Mq(c){return c&&c.length?A6(c):[]}function Nq(c,p){return c&&c.length?A6(c,Ve(p,2)):[]}function Lq(c){var p=c==null?0:c.length;return p?yo(c,1,p):[]}function Dq(c,p,w){return c&&c.length?(p=w||p===n?1:rt(p),yo(c,0,p<0?0:p)):[]}function $q(c,p,w){var R=c==null?0:c.length;return R?(p=w||p===n?1:rt(p),p=R-p,yo(c,p<0?0:p,R)):[]}function Fq(c,p){return c&&c.length?Gy(c,Ve(p,3),!1,!0):[]}function Bq(c,p){return c&&c.length?Gy(c,Ve(p,3)):[]}var Uq=lt(function(c){return cl(Lr(c,1,Fn,!0))}),zq=lt(function(c){var p=vo(c);return Fn(p)&&(p=n),cl(Lr(c,1,Fn,!0),Ve(p,2))}),Vq=lt(function(c){var p=vo(c);return p=typeof p=="function"?p:n,cl(Lr(c,1,Fn,!0),n,p)});function jq(c){return c&&c.length?cl(c):[]}function Gq(c,p){return c&&c.length?cl(c,Ve(p,2)):[]}function Hq(c,p){return p=typeof p=="function"?p:n,c&&c.length?cl(c,n,p):[]}function Tw(c){if(!(c&&c.length))return[];var p=0;return c=ol(c,function(w){if(Fn(w))return p=lr(w.length,p),!0}),V2(p,function(w){return yn(c,B2(w))})}function hP(c,p){if(!(c&&c.length))return[];var w=Tw(c);return p==null?w:yn(w,function(R){return Gi(p,n,R)})}var Wq=lt(function(c,p){return Fn(c)?Bh(c,p):[]}),qq=lt(function(c){return uw(ol(c,Fn))}),Kq=lt(function(c){var p=vo(c);return Fn(p)&&(p=n),uw(ol(c,Fn),Ve(p,2))}),Xq=lt(function(c){var p=vo(c);return p=typeof p=="function"?p:n,uw(ol(c,Fn),n,p)}),Yq=lt(Tw);function Qq(c,p){return k6(c||[],p||[],Fh)}function Zq(c,p){return k6(c||[],p||[],Vh)}var Jq=lt(function(c){var p=c.length,w=p>1?c[p-1]:n;return w=typeof w=="function"?(c.pop(),w):n,hP(c,w)});function pP(c){var p=F(c);return p.__chain__=!0,p}function eK(c,p){return p(c),c}function Jy(c,p){return p(c)}var tK=da(function(c){var p=c.length,w=p?c[0]:0,R=this.__wrapped__,I=function(z){return Y2(z,c)};return p>1||this.__actions__.length||!(R instanceof _t)||!fa(w)?this.thru(I):(R=R.slice(w,+w+(p?1:0)),R.__actions__.push({func:Jy,args:[I],thisArg:n}),new go(R,this.__chain__).thru(function(z){return p&&!z.length&&z.push(n),z}))});function nK(){return pP(this)}function rK(){return new go(this.value(),this.__chain__)}function iK(){this.__values__===n&&(this.__values__=PP(this.value()));var c=this.__index__>=this.__values__.length,p=c?n:this.__values__[this.__index__++];return{done:c,value:p}}function oK(){return this}function sK(c){for(var p,w=this;w instanceof Fy;){var R=aP(w);R.__index__=0,R.__values__=n,p?I.__wrapped__=R:p=R;var I=R;w=w.__wrapped__}return I.__wrapped__=c,p}function aK(){var c=this.__wrapped__;if(c instanceof _t){var p=c;return this.__actions__.length&&(p=new _t(this)),p=p.reverse(),p.__actions__.push({func:Jy,args:[Cw],thisArg:n}),new go(p,this.__chain__)}return this.thru(Cw)}function lK(){return O6(this.__wrapped__,this.__actions__)}var uK=Hy(function(c,p,w){zt.call(c,w)?++c[w]:ua(c,w,1)});function cK(c,p,w){var R=Qe(c)?jA:eW;return w&&ci(c,p,w)&&(p=n),R(c,Ve(p,3))}function dK(c,p){var w=Qe(c)?ol:h6;return w(c,Ve(p,3))}var fK=z6(lP),hK=z6(uP);function pK(c,p){return Lr(e0(c,p),1)}function gK(c,p){return Lr(e0(c,p),U)}function mK(c,p,w){return w=w===n?1:rt(w),Lr(e0(c,p),w)}function gP(c,p){var w=Qe(c)?ho:ul;return w(c,Ve(p,3))}function mP(c,p){var w=Qe(c)?LG:f6;return w(c,Ve(p,3))}var yK=Hy(function(c,p,w){zt.call(c,w)?c[w].push(p):ua(c,w,[p])});function vK(c,p,w,R){c=Ei(c)?c:fd(c),w=w&&!R?rt(w):0;var I=c.length;return w<0&&(w=lr(I+w,0)),o0(c)?w<=I&&c.indexOf(p,w)>-1:!!I&&ed(c,p,w)>-1}var _K=lt(function(c,p,w){var R=-1,I=typeof p=="function",z=Ei(c)?oe(c.length):[];return ul(c,function(K){z[++R]=I?Gi(p,K,w):Uh(K,p,w)}),z}),bK=Hy(function(c,p,w){ua(c,w,p)});function e0(c,p){var w=Qe(c)?yn:_6;return w(c,Ve(p,3))}function SK(c,p,w,R){return c==null?[]:(Qe(p)||(p=p==null?[]:[p]),w=R?n:w,Qe(w)||(w=w==null?[]:[w]),x6(c,p,w))}var wK=Hy(function(c,p,w){c[w?0:1].push(p)},function(){return[[],[]]});function xK(c,p,w){var R=Qe(c)?$2:qA,I=arguments.length<3;return R(c,Ve(p,4),w,I,ul)}function CK(c,p,w){var R=Qe(c)?DG:qA,I=arguments.length<3;return R(c,Ve(p,4),w,I,f6)}function TK(c,p){var w=Qe(c)?ol:h6;return w(c,r0(Ve(p,3)))}function EK(c){var p=Qe(c)?l6:vW;return p(c)}function AK(c,p,w){(w?ci(c,p,w):p===n)?p=1:p=rt(p);var R=Qe(c)?XH:_W;return R(c,p)}function PK(c){var p=Qe(c)?YH:SW;return p(c)}function RK(c){if(c==null)return 0;if(Ei(c))return o0(c)?nd(c):c.length;var p=qr(c);return p==Fe||p==ht?c.size:nw(c).length}function OK(c,p,w){var R=Qe(c)?F2:wW;return w&&ci(c,p,w)&&(p=n),R(c,Ve(p,3))}var kK=lt(function(c,p){if(c==null)return[];var w=p.length;return w>1&&ci(c,p[0],p[1])?p=[]:w>2&&ci(p[0],p[1],p[2])&&(p=[p[0]]),x6(c,Lr(p,1),[])}),t0=dH||function(){return et.Date.now()};function IK(c,p){if(typeof p!="function")throw new po(s);return c=rt(c),function(){if(--c<1)return p.apply(this,arguments)}}function yP(c,p,w){return p=w?n:p,p=c&&p==null?c.length:p,ca(c,E,n,n,n,n,p)}function vP(c,p){var w;if(typeof p!="function")throw new po(s);return c=rt(c),function(){return--c>0&&(w=p.apply(this,arguments)),c<=1&&(p=n),w}}var Ew=lt(function(c,p,w){var R=x;if(w.length){var I=al(w,cd(Ew));R|=C}return ca(c,R,p,w,I)}),_P=lt(function(c,p,w){var R=x|_;if(w.length){var I=al(w,cd(_P));R|=C}return ca(p,R,c,w,I)});function bP(c,p,w){p=w?n:p;var R=ca(c,y,n,n,n,n,n,p);return R.placeholder=bP.placeholder,R}function SP(c,p,w){p=w?n:p;var R=ca(c,S,n,n,n,n,n,p);return R.placeholder=SP.placeholder,R}function wP(c,p,w){var R,I,z,K,X,te,ce=0,de=!1,he=!1,be=!0;if(typeof c!="function")throw new po(s);p=_o(p)||0,xn(w)&&(de=!!w.leading,he="maxWait"in w,z=he?lr(_o(w.maxWait)||0,p):z,be="trailing"in w?!!w.trailing:be);function Ne(Bn){var Xo=R,ga=I;return R=I=n,ce=Bn,K=c.apply(ga,Xo),K}function je(Bn){return ce=Bn,X=Hh(gt,p),de?Ne(Bn):K}function st(Bn){var Xo=Bn-te,ga=Bn-ce,zP=p-Xo;return he?Wr(zP,z-ga):zP}function Ge(Bn){var Xo=Bn-te,ga=Bn-ce;return te===n||Xo>=p||Xo<0||he&&ga>=z}function gt(){var Bn=t0();if(Ge(Bn))return Ct(Bn);X=Hh(gt,st(Bn))}function Ct(Bn){return X=n,be&&R?Ne(Bn):(R=I=n,K)}function Ki(){X!==n&&I6(X),ce=0,R=te=I=X=n}function di(){return X===n?K:Ct(t0())}function Xi(){var Bn=t0(),Xo=Ge(Bn);if(R=arguments,I=this,te=Bn,Xo){if(X===n)return je(te);if(he)return I6(X),X=Hh(gt,p),Ne(te)}return X===n&&(X=Hh(gt,p)),K}return Xi.cancel=Ki,Xi.flush=di,Xi}var MK=lt(function(c,p){return d6(c,1,p)}),NK=lt(function(c,p,w){return d6(c,_o(p)||0,w)});function LK(c){return ca(c,k)}function n0(c,p){if(typeof c!="function"||p!=null&&typeof p!="function")throw new po(s);var w=function(){var R=arguments,I=p?p.apply(this,R):R[0],z=w.cache;if(z.has(I))return z.get(I);var K=c.apply(this,R);return w.cache=z.set(I,K)||z,K};return w.cache=new(n0.Cache||la),w}n0.Cache=la;function r0(c){if(typeof c!="function")throw new po(s);return function(){var p=arguments;switch(p.length){case 0:return!c.call(this);case 1:return!c.call(this,p[0]);case 2:return!c.call(this,p[0],p[1]);case 3:return!c.call(this,p[0],p[1],p[2])}return!c.apply(this,p)}}function DK(c){return vP(2,c)}var $K=xW(function(c,p){p=p.length==1&&Qe(p[0])?yn(p[0],Hi(Ve())):yn(Lr(p,1),Hi(Ve()));var w=p.length;return lt(function(R){for(var I=-1,z=Wr(R.length,w);++I<z;)R[I]=p[I].call(this,R[I]);return Gi(c,this,R)})}),Aw=lt(function(c,p){var w=al(p,cd(Aw));return ca(c,C,n,p,w)}),xP=lt(function(c,p){var w=al(p,cd(xP));return ca(c,T,n,p,w)}),FK=da(function(c,p){return ca(c,P,n,n,n,p)});function BK(c,p){if(typeof c!="function")throw new po(s);return p=p===n?p:rt(p),lt(c,p)}function UK(c,p){if(typeof c!="function")throw new po(s);return p=p==null?0:lr(rt(p),0),lt(function(w){var R=w[p],I=fl(w,0,p);return R&&sl(I,R),Gi(c,this,I)})}function zK(c,p,w){var R=!0,I=!0;if(typeof c!="function")throw new po(s);return xn(w)&&(R="leading"in w?!!w.leading:R,I="trailing"in w?!!w.trailing:I),wP(c,p,{leading:R,maxWait:p,trailing:I})}function VK(c){return yP(c,1)}function jK(c,p){return Aw(dw(p),c)}function GK(){if(!arguments.length)return[];var c=arguments[0];return Qe(c)?c:[c]}function HK(c){return mo(c,g)}function WK(c,p){return p=typeof p=="function"?p:n,mo(c,g,p)}function qK(c){return mo(c,f|g)}function KK(c,p){return p=typeof p=="function"?p:n,mo(c,f|g,p)}function XK(c,p){return p==null||c6(c,p,_r(p))}function Ko(c,p){return c===p||c!==c&&p!==p}var YK=Xy(J2),QK=Xy(function(c,p){return c>=p}),Mu=m6(function(){return arguments}())?m6:function(c){return Mn(c)&&zt.call(c,"callee")&&!n6.call(c,"callee")},Qe=oe.isArray,ZK=Zc?Hi(Zc):sW;function Ei(c){return c!=null&&i0(c.length)&&!ha(c)}function Fn(c){return Mn(c)&&Ei(c)}function JK(c){return c===!0||c===!1||Mn(c)&&ui(c)==ne}var hl=hH||Fw,eX=Jc?Hi(Jc):aW;function tX(c){return Mn(c)&&c.nodeType===1&&!Wh(c)}function nX(c){if(c==null)return!0;if(Ei(c)&&(Qe(c)||typeof c=="string"||typeof c.splice=="function"||hl(c)||dd(c)||Mu(c)))return!c.length;var p=qr(c);if(p==Fe||p==ht)return!c.size;if(Gh(c))return!nw(c).length;for(var w in c)if(zt.call(c,w))return!1;return!0}function rX(c,p){return zh(c,p)}function iX(c,p,w){w=typeof w=="function"?w:n;var R=w?w(c,p):n;return R===n?zh(c,p,n,w):!!R}function Pw(c){if(!Mn(c))return!1;var p=ui(c);return p==ve||p==pe||typeof c.message=="string"&&typeof c.name=="string"&&!Wh(c)}function oX(c){return typeof c=="number"&&i6(c)}function ha(c){if(!xn(c))return!1;var p=ui(c);return p==ye||p==Je||p==W||p==rr}function CP(c){return typeof c=="number"&&c==rt(c)}function i0(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=$}function xn(c){var p=typeof c;return c!=null&&(p=="object"||p=="function")}function Mn(c){return c!=null&&typeof c=="object"}var TP=kh?Hi(kh):uW;function sX(c,p){return c===p||tw(c,p,vw(p))}function aX(c,p,w){return w=typeof w=="function"?w:n,tw(c,p,vw(p),w)}function lX(c){return EP(c)&&c!=+c}function uX(c){if(WW(c))throw new Xe(o);return y6(c)}function cX(c){return c===null}function dX(c){return c==null}function EP(c){return typeof c=="number"||Mn(c)&&ui(c)==Ae}function Wh(c){if(!Mn(c)||ui(c)!=_e)return!1;var p=ky(c);if(p===null)return!0;var w=zt.call(p,"constructor")&&p.constructor;return typeof w=="function"&&w instanceof w&&Ay.call(w)==aH}var Rw=UA?Hi(UA):cW;function fX(c){return CP(c)&&c>=-$&&c<=$}var AP=zA?Hi(zA):dW;function o0(c){return typeof c=="string"||!Qe(c)&&Mn(c)&&ui(c)==At}function qi(c){return typeof c=="symbol"||Mn(c)&&ui(c)==un}var dd=VA?Hi(VA):fW;function hX(c){return c===n}function pX(c){return Mn(c)&&qr(c)==Pr}function gX(c){return Mn(c)&&ui(c)==Ci}var mX=Xy(rw),yX=Xy(function(c,p){return c<=p});function PP(c){if(!c)return[];if(Ei(c))return o0(c)?Wo(c):Ti(c);if(Mh&&c[Mh])return XG(c[Mh]());var p=qr(c),w=p==Fe?G2:p==ht?Cy:fd;return w(c)}function pa(c){if(!c)return c===0?c:0;if(c=_o(c),c===U||c===-U){var p=c<0?-1:1;return p*j}return c===c?c:0}function rt(c){var p=pa(c),w=p%1;return p===p?w?p-w:p:0}function RP(c){return c?Ru(rt(c),0,q):0}function _o(c){if(typeof c=="number")return c;if(qi(c))return G;if(xn(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=xn(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=KA(c);var w=vh.test(c);return w||_h.test(c)?xe(c.slice(2),w?2:8):yh.test(c)?G:+c}function OP(c){return xs(c,Ai(c))}function vX(c){return c?Ru(rt(c),-$,$):c===0?c:0}function Bt(c){return c==null?"":Wi(c)}var _X=ld(function(c,p){if(Gh(p)||Ei(p)){xs(p,_r(p),c);return}for(var w in p)zt.call(p,w)&&Fh(c,w,p[w])}),kP=ld(function(c,p){xs(p,Ai(p),c)}),s0=ld(function(c,p,w,R){xs(p,Ai(p),c,R)}),bX=ld(function(c,p,w,R){xs(p,_r(p),c,R)}),SX=da(Y2);function wX(c,p){var w=ad(c);return p==null?w:u6(w,p)}var xX=lt(function(c,p){c=en(c);var w=-1,R=p.length,I=R>2?p[2]:n;for(I&&ci(p[0],p[1],I)&&(R=1);++w<R;)for(var z=p[w],K=Ai(z),X=-1,te=K.length;++X<te;){var ce=K[X],de=c[ce];(de===n||Ko(de,id[ce])&&!zt.call(c,ce))&&(c[ce]=z[ce])}return c}),CX=lt(function(c){return c.push(n,K6),Gi(IP,n,c)});function TX(c,p){return GA(c,Ve(p,3),ws)}function EX(c,p){return GA(c,Ve(p,3),Z2)}function AX(c,p){return c==null?c:Q2(c,Ve(p,3),Ai)}function PX(c,p){return c==null?c:p6(c,Ve(p,3),Ai)}function RX(c,p){return c&&ws(c,Ve(p,3))}function OX(c,p){return c&&Z2(c,Ve(p,3))}function kX(c){return c==null?[]:zy(c,_r(c))}function IX(c){return c==null?[]:zy(c,Ai(c))}function Ow(c,p,w){var R=c==null?n:Ou(c,p);return R===n?w:R}function MX(c,p){return c!=null&&Q6(c,p,nW)}function kw(c,p){return c!=null&&Q6(c,p,rW)}var NX=j6(function(c,p,w){p!=null&&typeof p.toString!="function"&&(p=Py.call(p)),c[p]=w},Mw(Pi)),LX=j6(function(c,p,w){p!=null&&typeof p.toString!="function"&&(p=Py.call(p)),zt.call(c,p)?c[p].push(w):c[p]=[w]},Ve),DX=lt(Uh);function _r(c){return Ei(c)?a6(c):nw(c)}function Ai(c){return Ei(c)?a6(c,!0):hW(c)}function $X(c,p){var w={};return p=Ve(p,3),ws(c,function(R,I,z){ua(w,p(R,I,z),R)}),w}function FX(c,p){var w={};return p=Ve(p,3),ws(c,function(R,I,z){ua(w,I,p(R,I,z))}),w}var BX=ld(function(c,p,w){Vy(c,p,w)}),IP=ld(function(c,p,w,R){Vy(c,p,w,R)}),UX=da(function(c,p){var w={};if(c==null)return w;var R=!1;p=yn(p,function(z){return z=dl(z,c),R||(R=z.length>1),z}),xs(c,mw(c),w),R&&(w=mo(w,f|h|g,NW));for(var I=p.length;I--;)lw(w,p[I]);return w});function zX(c,p){return MP(c,r0(Ve(p)))}var VX=da(function(c,p){return c==null?{}:gW(c,p)});function MP(c,p){if(c==null)return{};var w=yn(mw(c),function(R){return[R]});return p=Ve(p),C6(c,w,function(R,I){return p(R,I[0])})}function jX(c,p,w){p=dl(p,c);var R=-1,I=p.length;for(I||(I=1,c=n);++R<I;){var z=c==null?n:c[Cs(p[R])];z===n&&(R=I,z=w),c=ha(z)?z.call(c):z}return c}function GX(c,p,w){return c==null?c:Vh(c,p,w)}function HX(c,p,w,R){return R=typeof R=="function"?R:n,c==null?c:Vh(c,p,w,R)}var NP=W6(_r),LP=W6(Ai);function WX(c,p,w){var R=Qe(c),I=R||hl(c)||dd(c);if(p=Ve(p,4),w==null){var z=c&&c.constructor;I?w=R?new z:[]:xn(c)?w=ha(z)?ad(ky(c)):{}:w={}}return(I?ho:ws)(c,function(K,X,te){return p(w,K,X,te)}),w}function qX(c,p){return c==null?!0:lw(c,p)}function KX(c,p,w){return c==null?c:R6(c,p,dw(w))}function XX(c,p,w,R){return R=typeof R=="function"?R:n,c==null?c:R6(c,p,dw(w),R)}function fd(c){return c==null?[]:j2(c,_r(c))}function YX(c){return c==null?[]:j2(c,Ai(c))}function QX(c,p,w){return w===n&&(w=p,p=n),w!==n&&(w=_o(w),w=w===w?w:0),p!==n&&(p=_o(p),p=p===p?p:0),Ru(_o(c),p,w)}function ZX(c,p,w){return p=pa(p),w===n?(w=p,p=0):w=pa(w),c=_o(c),iW(c,p,w)}function JX(c,p,w){if(w&&typeof w!="boolean"&&ci(c,p,w)&&(p=w=n),w===n&&(typeof p=="boolean"?(w=p,p=n):typeof c=="boolean"&&(w=c,c=n)),c===n&&p===n?(c=0,p=1):(c=pa(c),p===n?(p=c,c=0):p=pa(p)),c>p){var R=c;c=p,p=R}if(w||c%1||p%1){var I=o6();return Wr(c+I*(p-c+re("1e-"+((I+"").length-1))),p)}return ow(c,p)}var eY=ud(function(c,p,w){return p=p.toLowerCase(),c+(w?DP(p):p)});function DP(c){return Iw(Bt(c).toLowerCase())}function $P(c){return c=Bt(c),c&&c.replace(Sh,GG).replace(vy,"")}function tY(c,p,w){c=Bt(c),p=Wi(p);var R=c.length;w=w===n?R:Ru(rt(w),0,R);var I=w;return w-=p.length,w>=0&&c.slice(w,I)==p}function nY(c){return c=Bt(c),c&&qn.test(c)?c.replace(Ft,HG):c}function rY(c){return c=Bt(c),c&&bs.test(c)?c.replace(ji,"\\$&"):c}var iY=ud(function(c,p,w){return c+(w?"-":"")+p.toLowerCase()}),oY=ud(function(c,p,w){return c+(w?" ":"")+p.toLowerCase()}),sY=U6("toLowerCase");function aY(c,p,w){c=Bt(c),p=rt(p);var R=p?nd(c):0;if(!p||R>=p)return c;var I=(p-R)/2;return Ky(Ly(I),w)+c+Ky(Ny(I),w)}function lY(c,p,w){c=Bt(c),p=rt(p);var R=p?nd(c):0;return p&&R<p?c+Ky(p-R,w):c}function uY(c,p,w){c=Bt(c),p=rt(p);var R=p?nd(c):0;return p&&R<p?Ky(p-R,w)+c:c}function cY(c,p,w){return w||p==null?p=0:p&&(p=+p),yH(Bt(c).replace(fo,""),p||0)}function dY(c,p,w){return(w?ci(c,p,w):p===n)?p=1:p=rt(p),sw(Bt(c),p)}function fY(){var c=arguments,p=Bt(c[0]);return c.length<3?p:p.replace(c[1],c[2])}var hY=ud(function(c,p,w){return c+(w?"_":"")+p.toLowerCase()});function pY(c,p,w){return w&&typeof w!="number"&&ci(c,p,w)&&(p=w=n),w=w===n?q:w>>>0,w?(c=Bt(c),c&&(typeof p=="string"||p!=null&&!Rw(p))&&(p=Wi(p),!p&&td(c))?fl(Wo(c),0,w):c.split(p,w)):[]}var gY=ud(function(c,p,w){return c+(w?" ":"")+Iw(p)});function mY(c,p,w){return c=Bt(c),w=w==null?0:Ru(rt(w),0,c.length),p=Wi(p),c.slice(w,w+p.length)==p}function yY(c,p,w){var R=F.templateSettings;w&&ci(c,p,w)&&(p=n),c=Bt(c),p=s0({},p,R,q6);var I=s0({},p.imports,R.imports,q6),z=_r(I),K=j2(I,z),X,te,ce=0,de=p.interpolate||Ss,he="__p += '",be=H2((p.escape||Ss).source+"|"+de.source+"|"+(de===kr?mh:Ss).source+"|"+(p.evaluate||Ss).source+"|$","g"),Ne="//# sourceURL="+(zt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++by+"]")+`
|
||
`;c.replace(be,function(Ge,gt,Ct,Ki,di,Xi){return Ct||(Ct=Ki),he+=c.slice(ce,Xi).replace(wh,WG),gt&&(X=!0,he+=`' +
|
||
__e(`+gt+`) +
|
||
'`),di&&(te=!0,he+=`';
|
||
`+di+`;
|
||
__p += '`),Ct&&(he+=`' +
|
||
((__t = (`+Ct+`)) == null ? '' : __t) +
|
||
'`),ce=Xi+Ge.length,Ge}),he+=`';
|
||
`;var je=zt.call(p,"variable")&&p.variable;if(!je)he=`with (obj) {
|
||
`+he+`
|
||
}
|
||
`;else if(ph.test(je))throw new Xe(a);he=(te?he.replace(ra,""):he).replace(uo,"$1").replace(ia,"$1;"),he="function("+(je||"obj")+`) {
|
||
`+(je?"":`obj || (obj = {});
|
||
`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(te?`, __j = Array.prototype.join;
|
||
function print() { __p += __j.call(arguments, '') }
|
||
`:`;
|
||
`)+he+`return __p
|
||
}`;var st=BP(function(){return Nt(z,Ne+"return "+he).apply(n,K)});if(st.source=he,Pw(st))throw st;return st}function vY(c){return Bt(c).toLowerCase()}function _Y(c){return Bt(c).toUpperCase()}function bY(c,p,w){if(c=Bt(c),c&&(w||p===n))return KA(c);if(!c||!(p=Wi(p)))return c;var R=Wo(c),I=Wo(p),z=XA(R,I),K=YA(R,I)+1;return fl(R,z,K).join("")}function SY(c,p,w){if(c=Bt(c),c&&(w||p===n))return c.slice(0,ZA(c)+1);if(!c||!(p=Wi(p)))return c;var R=Wo(c),I=YA(R,Wo(p))+1;return fl(R,0,I).join("")}function wY(c,p,w){if(c=Bt(c),c&&(w||p===n))return c.replace(fo,"");if(!c||!(p=Wi(p)))return c;var R=Wo(c),I=XA(R,Wo(p));return fl(R,I).join("")}function xY(c,p){var w=O,R=M;if(xn(p)){var I="separator"in p?p.separator:I;w="length"in p?rt(p.length):w,R="omission"in p?Wi(p.omission):R}c=Bt(c);var z=c.length;if(td(c)){var K=Wo(c);z=K.length}if(w>=z)return c;var X=w-nd(R);if(X<1)return R;var te=K?fl(K,0,X).join(""):c.slice(0,X);if(I===n)return te+R;if(K&&(X+=te.length-X),Rw(I)){if(c.slice(X).search(I)){var ce,de=te;for(I.global||(I=H2(I.source,Bt(jo.exec(I))+"g")),I.lastIndex=0;ce=I.exec(de);)var he=ce.index;te=te.slice(0,he===n?X:he)}}else if(c.indexOf(Wi(I),X)!=X){var be=te.lastIndexOf(I);be>-1&&(te=te.slice(0,be))}return te+R}function CY(c){return c=Bt(c),c&&or.test(c)?c.replace(nn,JG):c}var TY=ud(function(c,p,w){return c+(w?" ":"")+p.toUpperCase()}),Iw=U6("toUpperCase");function FP(c,p,w){return c=Bt(c),p=w?n:p,p===n?KG(c)?nH(c):BG(c):c.match(p)||[]}var BP=lt(function(c,p){try{return Gi(c,n,p)}catch(w){return Pw(w)?w:new Xe(w)}}),EY=da(function(c,p){return ho(p,function(w){w=Cs(w),ua(c,w,Ew(c[w],c))}),c});function AY(c){var p=c==null?0:c.length,w=Ve();return c=p?yn(c,function(R){if(typeof R[1]!="function")throw new po(s);return[w(R[0]),R[1]]}):[],lt(function(R){for(var I=-1;++I<p;){var z=c[I];if(Gi(z[0],this,R))return Gi(z[1],this,R)}})}function PY(c){return JH(mo(c,f))}function Mw(c){return function(){return c}}function RY(c,p){return c==null||c!==c?p:c}var OY=V6(),kY=V6(!0);function Pi(c){return c}function Nw(c){return v6(typeof c=="function"?c:mo(c,f))}function IY(c){return b6(mo(c,f))}function MY(c,p){return S6(c,mo(p,f))}var NY=lt(function(c,p){return function(w){return Uh(w,c,p)}}),LY=lt(function(c,p){return function(w){return Uh(c,w,p)}});function Lw(c,p,w){var R=_r(p),I=zy(p,R);w==null&&!(xn(p)&&(I.length||!R.length))&&(w=p,p=c,c=this,I=zy(p,_r(p)));var z=!(xn(w)&&"chain"in w)||!!w.chain,K=ha(c);return ho(I,function(X){var te=p[X];c[X]=te,K&&(c.prototype[X]=function(){var ce=this.__chain__;if(z||ce){var de=c(this.__wrapped__),he=de.__actions__=Ti(this.__actions__);return he.push({func:te,args:arguments,thisArg:c}),de.__chain__=ce,de}return te.apply(c,sl([this.value()],arguments))})}),c}function DY(){return et._===this&&(et._=lH),this}function Dw(){}function $Y(c){return c=rt(c),lt(function(p){return w6(p,c)})}var FY=hw(yn),BY=hw(jA),UY=hw(F2);function UP(c){return bw(c)?B2(Cs(c)):mW(c)}function zY(c){return function(p){return c==null?n:Ou(c,p)}}var VY=G6(),jY=G6(!0);function $w(){return[]}function Fw(){return!1}function GY(){return{}}function HY(){return""}function WY(){return!0}function qY(c,p){if(c=rt(c),c<1||c>$)return[];var w=q,R=Wr(c,q);p=Ve(p),c-=q;for(var I=V2(R,p);++w<c;)p(w);return I}function KY(c){return Qe(c)?yn(c,Cs):qi(c)?[c]:Ti(sP(Bt(c)))}function XY(c){var p=++sH;return Bt(c)+p}var YY=qy(function(c,p){return c+p},0),QY=pw("ceil"),ZY=qy(function(c,p){return c/p},1),JY=pw("floor");function eQ(c){return c&&c.length?Uy(c,Pi,J2):n}function tQ(c,p){return c&&c.length?Uy(c,Ve(p,2),J2):n}function nQ(c){return WA(c,Pi)}function rQ(c,p){return WA(c,Ve(p,2))}function iQ(c){return c&&c.length?Uy(c,Pi,rw):n}function oQ(c,p){return c&&c.length?Uy(c,Ve(p,2),rw):n}var sQ=qy(function(c,p){return c*p},1),aQ=pw("round"),lQ=qy(function(c,p){return c-p},0);function uQ(c){return c&&c.length?z2(c,Pi):0}function cQ(c,p){return c&&c.length?z2(c,Ve(p,2)):0}return F.after=IK,F.ary=yP,F.assign=_X,F.assignIn=kP,F.assignInWith=s0,F.assignWith=bX,F.at=SX,F.before=vP,F.bind=Ew,F.bindAll=EY,F.bindKey=_P,F.castArray=GK,F.chain=pP,F.chunk=JW,F.compact=eq,F.concat=tq,F.cond=AY,F.conforms=PY,F.constant=Mw,F.countBy=uK,F.create=wX,F.curry=bP,F.curryRight=SP,F.debounce=wP,F.defaults=xX,F.defaultsDeep=CX,F.defer=MK,F.delay=NK,F.difference=nq,F.differenceBy=rq,F.differenceWith=iq,F.drop=oq,F.dropRight=sq,F.dropRightWhile=aq,F.dropWhile=lq,F.fill=uq,F.filter=dK,F.flatMap=pK,F.flatMapDeep=gK,F.flatMapDepth=mK,F.flatten=cP,F.flattenDeep=cq,F.flattenDepth=dq,F.flip=LK,F.flow=OY,F.flowRight=kY,F.fromPairs=fq,F.functions=kX,F.functionsIn=IX,F.groupBy=yK,F.initial=pq,F.intersection=gq,F.intersectionBy=mq,F.intersectionWith=yq,F.invert=NX,F.invertBy=LX,F.invokeMap=_K,F.iteratee=Nw,F.keyBy=bK,F.keys=_r,F.keysIn=Ai,F.map=e0,F.mapKeys=$X,F.mapValues=FX,F.matches=IY,F.matchesProperty=MY,F.memoize=n0,F.merge=BX,F.mergeWith=IP,F.method=NY,F.methodOf=LY,F.mixin=Lw,F.negate=r0,F.nthArg=$Y,F.omit=UX,F.omitBy=zX,F.once=DK,F.orderBy=SK,F.over=FY,F.overArgs=$K,F.overEvery=BY,F.overSome=UY,F.partial=Aw,F.partialRight=xP,F.partition=wK,F.pick=VX,F.pickBy=MP,F.property=UP,F.propertyOf=zY,F.pull=Sq,F.pullAll=fP,F.pullAllBy=wq,F.pullAllWith=xq,F.pullAt=Cq,F.range=VY,F.rangeRight=jY,F.rearg=FK,F.reject=TK,F.remove=Tq,F.rest=BK,F.reverse=Cw,F.sampleSize=AK,F.set=GX,F.setWith=HX,F.shuffle=PK,F.slice=Eq,F.sortBy=kK,F.sortedUniq=Mq,F.sortedUniqBy=Nq,F.split=pY,F.spread=UK,F.tail=Lq,F.take=Dq,F.takeRight=$q,F.takeRightWhile=Fq,F.takeWhile=Bq,F.tap=eK,F.throttle=zK,F.thru=Jy,F.toArray=PP,F.toPairs=NP,F.toPairsIn=LP,F.toPath=KY,F.toPlainObject=OP,F.transform=WX,F.unary=VK,F.union=Uq,F.unionBy=zq,F.unionWith=Vq,F.uniq=jq,F.uniqBy=Gq,F.uniqWith=Hq,F.unset=qX,F.unzip=Tw,F.unzipWith=hP,F.update=KX,F.updateWith=XX,F.values=fd,F.valuesIn=YX,F.without=Wq,F.words=FP,F.wrap=jK,F.xor=qq,F.xorBy=Kq,F.xorWith=Xq,F.zip=Yq,F.zipObject=Qq,F.zipObjectDeep=Zq,F.zipWith=Jq,F.entries=NP,F.entriesIn=LP,F.extend=kP,F.extendWith=s0,Lw(F,F),F.add=YY,F.attempt=BP,F.camelCase=eY,F.capitalize=DP,F.ceil=QY,F.clamp=QX,F.clone=HK,F.cloneDeep=qK,F.cloneDeepWith=KK,F.cloneWith=WK,F.conformsTo=XK,F.deburr=$P,F.defaultTo=RY,F.divide=ZY,F.endsWith=tY,F.eq=Ko,F.escape=nY,F.escapeRegExp=rY,F.every=cK,F.find=fK,F.findIndex=lP,F.findKey=TX,F.findLast=hK,F.findLastIndex=uP,F.findLastKey=EX,F.floor=JY,F.forEach=gP,F.forEachRight=mP,F.forIn=AX,F.forInRight=PX,F.forOwn=RX,F.forOwnRight=OX,F.get=Ow,F.gt=YK,F.gte=QK,F.has=MX,F.hasIn=kw,F.head=dP,F.identity=Pi,F.includes=vK,F.indexOf=hq,F.inRange=ZX,F.invoke=DX,F.isArguments=Mu,F.isArray=Qe,F.isArrayBuffer=ZK,F.isArrayLike=Ei,F.isArrayLikeObject=Fn,F.isBoolean=JK,F.isBuffer=hl,F.isDate=eX,F.isElement=tX,F.isEmpty=nX,F.isEqual=rX,F.isEqualWith=iX,F.isError=Pw,F.isFinite=oX,F.isFunction=ha,F.isInteger=CP,F.isLength=i0,F.isMap=TP,F.isMatch=sX,F.isMatchWith=aX,F.isNaN=lX,F.isNative=uX,F.isNil=dX,F.isNull=cX,F.isNumber=EP,F.isObject=xn,F.isObjectLike=Mn,F.isPlainObject=Wh,F.isRegExp=Rw,F.isSafeInteger=fX,F.isSet=AP,F.isString=o0,F.isSymbol=qi,F.isTypedArray=dd,F.isUndefined=hX,F.isWeakMap=pX,F.isWeakSet=gX,F.join=vq,F.kebabCase=iY,F.last=vo,F.lastIndexOf=_q,F.lowerCase=oY,F.lowerFirst=sY,F.lt=mX,F.lte=yX,F.max=eQ,F.maxBy=tQ,F.mean=nQ,F.meanBy=rQ,F.min=iQ,F.minBy=oQ,F.stubArray=$w,F.stubFalse=Fw,F.stubObject=GY,F.stubString=HY,F.stubTrue=WY,F.multiply=sQ,F.nth=bq,F.noConflict=DY,F.noop=Dw,F.now=t0,F.pad=aY,F.padEnd=lY,F.padStart=uY,F.parseInt=cY,F.random=JX,F.reduce=xK,F.reduceRight=CK,F.repeat=dY,F.replace=fY,F.result=jX,F.round=aQ,F.runInContext=J,F.sample=EK,F.size=RK,F.snakeCase=hY,F.some=OK,F.sortedIndex=Aq,F.sortedIndexBy=Pq,F.sortedIndexOf=Rq,F.sortedLastIndex=Oq,F.sortedLastIndexBy=kq,F.sortedLastIndexOf=Iq,F.startCase=gY,F.startsWith=mY,F.subtract=lQ,F.sum=uQ,F.sumBy=cQ,F.template=yY,F.times=qY,F.toFinite=pa,F.toInteger=rt,F.toLength=RP,F.toLower=vY,F.toNumber=_o,F.toSafeInteger=vX,F.toString=Bt,F.toUpper=_Y,F.trim=bY,F.trimEnd=SY,F.trimStart=wY,F.truncate=xY,F.unescape=CY,F.uniqueId=XY,F.upperCase=TY,F.upperFirst=Iw,F.each=gP,F.eachRight=mP,F.first=dP,Lw(F,function(){var c={};return ws(F,function(p,w){zt.call(F.prototype,w)||(c[w]=p)}),c}(),{chain:!1}),F.VERSION=r,ho(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){F[c].placeholder=F}),ho(["drop","take"],function(c,p){_t.prototype[c]=function(w){w=w===n?1:lr(rt(w),0);var R=this.__filtered__&&!p?new _t(this):this.clone();return R.__filtered__?R.__takeCount__=Wr(w,R.__takeCount__):R.__views__.push({size:Wr(w,q),type:c+(R.__dir__<0?"Right":"")}),R},_t.prototype[c+"Right"]=function(w){return this.reverse()[c](w).reverse()}}),ho(["filter","map","takeWhile"],function(c,p){var w=p+1,R=w==A||w==D;_t.prototype[c]=function(I){var z=this.clone();return z.__iteratees__.push({iteratee:Ve(I,3),type:w}),z.__filtered__=z.__filtered__||R,z}}),ho(["head","last"],function(c,p){var w="take"+(p?"Right":"");_t.prototype[c]=function(){return this[w](1).value()[0]}}),ho(["initial","tail"],function(c,p){var w="drop"+(p?"":"Right");_t.prototype[c]=function(){return this.__filtered__?new _t(this):this[w](1)}}),_t.prototype.compact=function(){return this.filter(Pi)},_t.prototype.find=function(c){return this.filter(c).head()},_t.prototype.findLast=function(c){return this.reverse().find(c)},_t.prototype.invokeMap=lt(function(c,p){return typeof c=="function"?new _t(this):this.map(function(w){return Uh(w,c,p)})}),_t.prototype.reject=function(c){return this.filter(r0(Ve(c)))},_t.prototype.slice=function(c,p){c=rt(c);var w=this;return w.__filtered__&&(c>0||p<0)?new _t(w):(c<0?w=w.takeRight(-c):c&&(w=w.drop(c)),p!==n&&(p=rt(p),w=p<0?w.dropRight(-p):w.take(p-c)),w)},_t.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},_t.prototype.toArray=function(){return this.take(q)},ws(_t.prototype,function(c,p){var w=/^(?:filter|find|map|reject)|While$/.test(p),R=/^(?:head|last)$/.test(p),I=F[R?"take"+(p=="last"?"Right":""):p],z=R||/^find/.test(p);I&&(F.prototype[p]=function(){var K=this.__wrapped__,X=R?[1]:arguments,te=K instanceof _t,ce=X[0],de=te||Qe(K),he=function(gt){var Ct=I.apply(F,sl([gt],X));return R&&be?Ct[0]:Ct};de&&w&&typeof ce=="function"&&ce.length!=1&&(te=de=!1);var be=this.__chain__,Ne=!!this.__actions__.length,je=z&&!be,st=te&&!Ne;if(!z&&de){K=st?K:new _t(this);var Ge=c.apply(K,X);return Ge.__actions__.push({func:Jy,args:[he],thisArg:n}),new go(Ge,be)}return je&&st?c.apply(this,X):(Ge=this.thru(he),je?R?Ge.value()[0]:Ge.value():Ge)})}),ho(["pop","push","shift","sort","splice","unshift"],function(c){var p=Ty[c],w=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",R=/^(?:pop|shift)$/.test(c);F.prototype[c]=function(){var I=arguments;if(R&&!this.__chain__){var z=this.value();return p.apply(Qe(z)?z:[],I)}return this[w](function(K){return p.apply(Qe(K)?K:[],I)})}}),ws(_t.prototype,function(c,p){var w=F[p];if(w){var R=w.name+"";zt.call(sd,R)||(sd[R]=[]),sd[R].push({name:p,func:w})}}),sd[Wy(n,_).name]=[{name:"wrapper",func:n}],_t.prototype.clone=CH,_t.prototype.reverse=TH,_t.prototype.value=EH,F.prototype.at=tK,F.prototype.chain=nK,F.prototype.commit=rK,F.prototype.next=iK,F.prototype.plant=sK,F.prototype.reverse=aK,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=lK,F.prototype.first=F.prototype.head,Mh&&(F.prototype[Mh]=oK),F},rd=rH();Rt?((Rt.exports=rd)._=rd,at._=rd):et._=rd}).call(Ze)})(L1,L1.exports);var yce=L1.exports,D1=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},$1=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},vce=Object.defineProperty,_ce=Object.defineProperties,bce=Object.getOwnPropertyDescriptors,F1=Object.getOwnPropertySymbols,E$=Object.prototype.hasOwnProperty,A$=Object.prototype.propertyIsEnumerable,nR=function(e,t,n){return t in e?vce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Vn=function(e,t){for(var n in t||(t={}))E$.call(t,n)&&nR(e,n,t[n]);if(F1)for(var r=0,i=F1(t);r<i.length;r++){var n=i[r];A$.call(t,n)&&nR(e,n,t[n])}return e},Fs=function(e,t){return _ce(e,bce(t))},rR=function(e,t){var n={};for(var r in e)E$.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&F1)for(var i=0,o=F1(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&A$.call(e,r)&&(n[r]=e[r])}return n},B1=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{a(n.next(l))}catch(u){i(u)}},s=function(l){try{a(n.throw(l))}catch(u){i(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,s)};a((n=n.apply(e,t)).next())})},vn;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(vn||(vn={}));function Sce(e){return{status:e,isUninitialized:e===vn.uninitialized,isLoading:e===vn.pending,isSuccess:e===vn.fulfilled,isError:e===vn.rejected}}function wce(e){return new RegExp("(^|:)//").test(e)}var xce=function(e){return e.replace(/\/$/,"")},Cce=function(e){return e.replace(/^\//,"")};function Tce(e,t){if(!e)return t;if(!t)return e;if(wce(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=xce(e),t=Cce(t),""+e+n+t}var iR=function(e){return[].concat.apply([],e)};function Ece(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Ace(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var oR=hs;function P$(e,t){if(e===t||!(oR(e)&&oR(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,o=Array.isArray(t)?[]:{},s=0,a=n;s<a.length;s++){var l=a[s];o[l]=P$(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var sR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},Pce=function(e){return e.status>=200&&e.status<=299},Rce=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function aR(e){if(!hs(e))return e;for(var t=Vn({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],s=i[1];s===void 0&&delete t[o]}return t}function Oce(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(y){return y}:i,s=n.fetchFn,a=s===void 0?sR:s,l=n.paramsSerializer,u=n.isJsonContentType,d=u===void 0?Rce:u,f=n.jsonContentType,h=f===void 0?"application/json":f,g=n.jsonReplacer,m=n.timeout,v=n.responseHandler,x=n.validateStatus,_=rR(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&a===sR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(y,S){return B1(t,null,function(){var C,T,E,P,k,O,M,V,B,A,N,D,U,$,j,G,q,Z,ee,ie,se,le,W,ne,fe,pe,ve,ye,Je,Fe,Ae,vt,_e,Qt,rr,qt;return D1(this,function(ht){switch(ht.label){case 0:return C=S.signal,T=S.getState,E=S.extra,P=S.endpoint,k=S.forced,O=S.type,V=typeof y=="string"?{url:y}:y,B=V.url,A=V.headers,N=A===void 0?new Headers(_.headers):A,D=V.params,U=D===void 0?void 0:D,$=V.responseHandler,j=$===void 0?v??"json":$,G=V.validateStatus,q=G===void 0?x??Pce:G,Z=V.timeout,ee=Z===void 0?m:Z,ie=rR(V,["url","headers","params","responseHandler","validateStatus","timeout"]),se=Vn(Fs(Vn({},_),{signal:C}),ie),N=new Headers(aR(N)),le=se,[4,o(N,{getState:T,extra:E,endpoint:P,forced:k,type:O})];case 1:le.headers=ht.sent()||N,W=function(At){return typeof At=="object"&&(hs(At)||Array.isArray(At)||typeof At.toJSON=="function")},!se.headers.has("content-type")&&W(se.body)&&se.headers.set("content-type",h),W(se.body)&&d(se.headers)&&(se.body=JSON.stringify(se.body,g)),U&&(ne=~B.indexOf("?")?"&":"?",fe=l?l(U):new URLSearchParams(aR(U)),B+=ne+fe),B=Tce(r,B),pe=new Request(B,se),ve=pe.clone(),M={request:ve},Je=!1,Fe=ee&&setTimeout(function(){Je=!0,S.abort()},ee),ht.label=2;case 2:return ht.trys.push([2,4,5,6]),[4,a(pe)];case 3:return ye=ht.sent(),[3,6];case 4:return Ae=ht.sent(),[2,{error:{status:Je?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ae)},meta:M}];case 5:return Fe&&clearTimeout(Fe),[7];case 6:vt=ye.clone(),M.response=vt,Qt="",ht.label=7;case 7:return ht.trys.push([7,9,,10]),[4,Promise.all([b(ye,j).then(function(At){return _e=At},function(At){return rr=At}),vt.text().then(function(At){return Qt=At},function(){})])];case 8:if(ht.sent(),rr)throw rr;return[3,10];case 9:return qt=ht.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ye.status,data:Qt,error:String(qt)},meta:M}];case 10:return[2,q(ye,_e)?{data:_e,meta:M}:{error:{status:ye.status,data:_e},meta:M}]}})})};function b(y,S){return B1(this,null,function(){var C;return D1(this,function(T){switch(T.label){case 0:return typeof S=="function"?[2,S(y)]:(S==="content-type"&&(S=d(y.headers)?"json":"text"),S!=="json"?[3,2]:[4,y.text()]);case 1:return C=T.sent(),[2,C.length?JSON.parse(C):null];case 2:return[2,y.text()]}})})}}var lR=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),UT=Me("__rtkq/focused"),R$=Me("__rtkq/unfocused"),zT=Me("__rtkq/online"),O$=Me("__rtkq/offline"),Ys;(function(e){e.query="query",e.mutation="mutation"})(Ys||(Ys={}));function k$(e){return e.type===Ys.query}function kce(e){return e.type===Ys.mutation}function I$(e,t,n,r,i,o){return Ice(e)?e(t,n,r,i).map(z3).map(o):Array.isArray(e)?e.map(z3).map(o):[]}function Ice(e){return typeof e=="function"}function z3(e){return typeof e=="string"?{type:e}:e}function wx(e){return e!=null}var Fg=Symbol("forceQueryFn"),V3=function(e){return typeof e[Fg]=="function"};function Mce(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,s=new Map,a=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,d=l.removeMutationResult,f=l.updateSubscriptionOptions;return{buildInitiateQuery:b,buildInitiateMutation:y,getRunningQueryThunk:m,getRunningMutationThunk:v,getRunningQueriesThunk:x,getRunningMutationsThunk:_,getRunningOperationPromises:g,removalWarning:h};function h(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
|
||
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
|
||
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function g(){typeof process<"u";var S=function(C){return Array.from(C.values()).flatMap(function(T){return T?Object.values(T):[]})};return $1($1([],S(s)),S(a)).filter(wx)}function m(S,C){return function(T){var E,P=o.endpointDefinitions[S],k=t({queryArgs:C,endpointDefinition:P,endpointName:S});return(E=s.get(T))==null?void 0:E[k]}}function v(S,C){return function(T){var E;return(E=a.get(T))==null?void 0:E[C]}}function x(){return function(S){return Object.values(s.get(S)||{}).filter(wx)}}function _(){return function(S){return Object.values(a.get(S)||{}).filter(wx)}}function b(S,C){var T=function(E,P){var k=P===void 0?{}:P,O=k.subscribe,M=O===void 0?!0:O,V=k.forceRefetch,B=k.subscriptionOptions,A=Fg,N=k[A];return function(D,U){var $,j,G=t({queryArgs:E,endpointDefinition:C,endpointName:S}),q=n(($={type:"query",subscribe:M,forceRefetch:V,subscriptionOptions:B,endpointName:S,originalArgs:E,queryCacheKey:G},$[Fg]=N,$)),Z=i.endpoints[S].select(E),ee=D(q),ie=Z(U()),se=ee.requestId,le=ee.abort,W=ie.requestId!==se,ne=(j=s.get(D))==null?void 0:j[G],fe=function(){return Z(U())},pe=Object.assign(N?ee.then(fe):W&&!ne?Promise.resolve(ie):Promise.all([ne,ee]).then(fe),{arg:E,requestId:se,subscriptionOptions:B,queryCacheKey:G,abort:le,unwrap:function(){return B1(this,null,function(){var ye;return D1(this,function(Je){switch(Je.label){case 0:return[4,pe];case 1:if(ye=Je.sent(),ye.isError)throw ye.error;return[2,ye.data]}})})},refetch:function(){return D(T(E,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){M&&D(u({queryCacheKey:G,requestId:se}))},updateSubscriptionOptions:function(ye){pe.subscriptionOptions=ye,D(f({endpointName:S,requestId:se,queryCacheKey:G,options:ye}))}});if(!ne&&!W&&!N){var ve=s.get(D)||{};ve[G]=pe,s.set(D,ve),pe.then(function(){delete ve[G],Object.keys(ve).length||s.delete(D)})}return pe}};return T}function y(S){return function(C,T){var E=T===void 0?{}:T,P=E.track,k=P===void 0?!0:P,O=E.fixedCacheKey;return function(M,V){var B=r({type:"mutation",endpointName:S,originalArgs:C,track:k,fixedCacheKey:O}),A=M(B),N=A.requestId,D=A.abort,U=A.unwrap,$=A.unwrap().then(function(Z){return{data:Z}}).catch(function(Z){return{error:Z}}),j=function(){M(d({requestId:N,fixedCacheKey:O}))},G=Object.assign($,{arg:A.arg,requestId:N,abort:D,unwrap:U,unsubscribe:j,reset:j}),q=a.get(M)||{};return a.set(M,q),q[N]=G,G.then(function(){delete q[N],Object.keys(q).length||a.delete(M)}),O&&(q[O]=G,G.then(function(){q[O]===G&&(delete q[O],Object.keys(q).length||a.delete(M))})),G}}}}function uR(e){return e}function Nce(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,s=e.api,a=function(y,S,C){return function(T){var E=i[y];T(s.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:S,endpointDefinition:E,endpointName:y}),patches:C}))}},l=function(y,S,C){return function(T,E){var P,k,O=s.endpoints[y].select(S)(E()),M={patches:[],inversePatches:[],undo:function(){return T(s.util.patchQueryData(y,S,M.inversePatches))}};if(O.status===vn.uninitialized)return M;if("data"in O)if(Fi(O.data)){var V=pT(O.data,C),B=V[1],A=V[2];(P=M.patches).push.apply(P,B),(k=M.inversePatches).push.apply(k,A)}else{var N=C(O.data);M.patches.push({op:"replace",path:[],value:N}),M.inversePatches.push({op:"replace",path:[],value:O.data})}return T(s.util.patchQueryData(y,S,M.patches)),M}},u=function(y,S,C){return function(T){var E;return T(s.endpoints[y].initiate(S,(E={subscribe:!1,forceRefetch:!0},E[Fg]=function(){return{data:C}},E)))}},d=function(y,S){return B1(t,[y,S],function(C,T){var E,P,k,O,M,V,B,A,N,D,U,$,j,G,q,Z,ee,ie,se=T.signal,le=T.abort,W=T.rejectWithValue,ne=T.fulfillWithValue,fe=T.dispatch,pe=T.getState,ve=T.extra;return D1(this,function(ye){switch(ye.label){case 0:E=i[C.endpointName],ye.label=1;case 1:return ye.trys.push([1,8,,13]),P=uR,k=void 0,O={signal:se,abort:le,dispatch:fe,getState:pe,extra:ve,endpoint:C.endpointName,type:C.type,forced:C.type==="query"?f(C,pe()):void 0},M=C.type==="query"?C[Fg]:void 0,M?(k=M(),[3,6]):[3,2];case 2:return E.query?[4,r(E.query(C.originalArgs),O,E.extraOptions)]:[3,4];case 3:return k=ye.sent(),E.transformResponse&&(P=E.transformResponse),[3,6];case 4:return[4,E.queryFn(C.originalArgs,O,E.extraOptions,function(Je){return r(Je,O,E.extraOptions)})];case 5:k=ye.sent(),ye.label=6;case 6:if(typeof process<"u",k.error)throw new lR(k.error,k.meta);return U=ne,[4,P(k.data,k.meta,C.originalArgs)];case 7:return[2,U.apply(void 0,[ye.sent(),(ee={fulfilledTimeStamp:Date.now(),baseQueryMeta:k.meta},ee[Yu]=!0,ee)])];case 8:if($=ye.sent(),j=$,!(j instanceof lR))return[3,12];G=uR,E.query&&E.transformErrorResponse&&(G=E.transformErrorResponse),ye.label=9;case 9:return ye.trys.push([9,11,,12]),q=W,[4,G(j.value,j.meta,C.originalArgs)];case 10:return[2,q.apply(void 0,[ye.sent(),(ie={baseQueryMeta:j.meta},ie[Yu]=!0,ie)])];case 11:return Z=ye.sent(),j=Z,[3,12];case 12:throw typeof process<"u",console.error(j),j;case 13:return[2]}})})};function f(y,S){var C,T,E,P,k=(T=(C=S[n])==null?void 0:C.queries)==null?void 0:T[y.queryCacheKey],O=(E=S[n])==null?void 0:E.config.refetchOnMountOrArgChange,M=k==null?void 0:k.fulfilledTimeStamp,V=(P=y.forceRefetch)!=null?P:y.subscribe&&O;return V?V===!0||(Number(new Date)-Number(M))/1e3>=V:!1}var h=Jl(n+"/executeQuery",d,{getPendingMeta:function(){var y;return y={startedTimeStamp:Date.now()},y[Yu]=!0,y},condition:function(y,S){var C=S.getState,T,E,P,k=C(),O=(E=(T=k[n])==null?void 0:T.queries)==null?void 0:E[y.queryCacheKey],M=O==null?void 0:O.fulfilledTimeStamp,V=y.originalArgs,B=O==null?void 0:O.originalArgs,A=i[y.endpointName];return V3(y)?!0:(O==null?void 0:O.status)==="pending"?!1:f(y,k)||k$(A)&&((P=A==null?void 0:A.forceRefetch)!=null&&P.call(A,{currentArg:V,previousArg:B,endpointState:O,state:k}))?!0:!M},dispatchConditionRejection:!0}),g=Jl(n+"/executeMutation",d,{getPendingMeta:function(){var y;return y={startedTimeStamp:Date.now()},y[Yu]=!0,y}}),m=function(y){return"force"in y},v=function(y){return"ifOlderThan"in y},x=function(y,S,C){return function(T,E){var P=m(C)&&C.force,k=v(C)&&C.ifOlderThan,O=function(A){return A===void 0&&(A=!0),s.endpoints[y].initiate(S,{forceRefetch:A})},M=s.endpoints[y].select(S)(E());if(P)T(O());else if(k){var V=M==null?void 0:M.fulfilledTimeStamp;if(!V){T(O());return}var B=(Number(new Date)-Number(new Date(V)))/1e3>=k;B&&T(O())}else T(O(!1))}};function _(y){return function(S){var C,T;return((T=(C=S==null?void 0:S.meta)==null?void 0:C.arg)==null?void 0:T.endpointName)===y}}function b(y,S){return{matchPending:lf(ib(y),_(S)),matchFulfilled:lf(pu(y),_(S)),matchRejected:lf(If(y),_(S))}}return{queryThunk:h,mutationThunk:g,prefetch:x,updateQueryData:l,upsertQueryData:u,patchQueryData:a,buildMatchThunkActions:b}}function M$(e,t,n,r){return I$(n[e.meta.arg.endpointName][t],pu(e)?e.payload:void 0,Sm(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function R0(e,t,n){var r=e[t];r&&n(r)}function Bg(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function cR(e,t,n){var r=e[Bg(t)];r&&n(r)}var rp={};function Lce(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,s=i.apiUid,a=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,d=e.config,f=Me(t+"/resetApiState"),h=An({name:t+"/queries",initialState:rp,reducers:{removeQueryResult:{reducer:function(C,T){var E=T.payload.queryCacheKey;delete C[E]},prepare:wv()},queryResultPatched:function(C,T){var E=T.payload,P=E.queryCacheKey,k=E.patches;R0(C,P,function(O){O.data=x3(O.data,k.concat())})}},extraReducers:function(C){C.addCase(n.pending,function(T,E){var P=E.meta,k=E.meta.arg,O,M,V=V3(k);(k.subscribe||V)&&((M=T[O=k.queryCacheKey])!=null||(T[O]={status:vn.uninitialized,endpointName:k.endpointName})),R0(T,k.queryCacheKey,function(B){B.status=vn.pending,B.requestId=V&&B.requestId?B.requestId:P.requestId,k.originalArgs!==void 0&&(B.originalArgs=k.originalArgs),B.startedTimeStamp=P.startedTimeStamp})}).addCase(n.fulfilled,function(T,E){var P=E.meta,k=E.payload;R0(T,P.arg.queryCacheKey,function(O){var M;if(!(O.requestId!==P.requestId&&!V3(P.arg))){var V=o[P.arg.endpointName].merge;if(O.status=vn.fulfilled,V)if(O.data!==void 0){var B=P.fulfilledTimeStamp,A=P.arg,N=P.baseQueryMeta,D=P.requestId,U=fu(O.data,function($){return V($,k,{arg:A.originalArgs,baseQueryMeta:N,fulfilledTimeStamp:B,requestId:D})});O.data=U}else O.data=k;else O.data=(M=o[P.arg.endpointName].structuralSharing)==null||M?P$(yi(O.data)?aT(O.data):O.data,k):k;delete O.error,O.fulfilledTimeStamp=P.fulfilledTimeStamp}})}).addCase(n.rejected,function(T,E){var P=E.meta,k=P.condition,O=P.arg,M=P.requestId,V=E.error,B=E.payload;R0(T,O.queryCacheKey,function(A){if(!k){if(A.requestId!==M)return;A.status=vn.rejected,A.error=B??V}})}).addMatcher(l,function(T,E){for(var P=a(E).queries,k=0,O=Object.entries(P);k<O.length;k++){var M=O[k],V=M[0],B=M[1];((B==null?void 0:B.status)===vn.fulfilled||(B==null?void 0:B.status)===vn.rejected)&&(T[V]=B)}})}}),g=An({name:t+"/mutations",initialState:rp,reducers:{removeMutationResult:{reducer:function(C,T){var E=T.payload,P=Bg(E);P in C&&delete C[P]},prepare:wv()}},extraReducers:function(C){C.addCase(r.pending,function(T,E){var P=E.meta,k=E.meta,O=k.requestId,M=k.arg,V=k.startedTimeStamp;M.track&&(T[Bg(P)]={requestId:O,status:vn.pending,endpointName:M.endpointName,startedTimeStamp:V})}).addCase(r.fulfilled,function(T,E){var P=E.payload,k=E.meta;k.arg.track&&cR(T,k,function(O){O.requestId===k.requestId&&(O.status=vn.fulfilled,O.data=P,O.fulfilledTimeStamp=k.fulfilledTimeStamp)})}).addCase(r.rejected,function(T,E){var P=E.payload,k=E.error,O=E.meta;O.arg.track&&cR(T,O,function(M){M.requestId===O.requestId&&(M.status=vn.rejected,M.error=P??k)})}).addMatcher(l,function(T,E){for(var P=a(E).mutations,k=0,O=Object.entries(P);k<O.length;k++){var M=O[k],V=M[0],B=M[1];((B==null?void 0:B.status)===vn.fulfilled||(B==null?void 0:B.status)===vn.rejected)&&V!==(B==null?void 0:B.requestId)&&(T[V]=B)}})}}),m=An({name:t+"/invalidation",initialState:rp,reducers:{},extraReducers:function(C){C.addCase(h.actions.removeQueryResult,function(T,E){for(var P=E.payload.queryCacheKey,k=0,O=Object.values(T);k<O.length;k++)for(var M=O[k],V=0,B=Object.values(M);V<B.length;V++){var A=B[V],N=A.indexOf(P);N!==-1&&A.splice(N,1)}}).addMatcher(l,function(T,E){for(var P,k,O,M,V=a(E).provided,B=0,A=Object.entries(V);B<A.length;B++)for(var N=A[B],D=N[0],U=N[1],$=0,j=Object.entries(U);$<j.length;$++)for(var G=j[$],q=G[0],Z=G[1],ee=(M=(k=(P=T[D])!=null?P:T[D]={})[O=q||"__internal_without_id"])!=null?M:k[O]=[],ie=0,se=Z;ie<se.length;ie++){var le=se[ie],W=ee.includes(le);W||ee.push(le)}}).addMatcher(Lo(pu(n),Sm(n)),function(T,E){for(var P,k,O,M,V=M$(E,"providesTags",o,u),B=E.meta.arg.queryCacheKey,A=0,N=Object.values(T);A<N.length;A++)for(var D=N[A],U=0,$=Object.values(D);U<$.length;U++){var j=$[U],G=j.indexOf(B);G!==-1&&j.splice(G,1)}for(var q=0,Z=V;q<Z.length;q++){var ee=Z[q],ie=ee.type,se=ee.id,le=(M=(k=(P=T[ie])!=null?P:T[ie]={})[O=se||"__internal_without_id"])!=null?M:k[O]=[],W=le.includes(B);W||le.push(B)}})}}),v=An({name:t+"/subscriptions",initialState:rp,reducers:{updateSubscriptionOptions:function(C,T){},unsubscribeQueryResult:function(C,T){},internal_probeSubscription:function(C,T){}}}),x=An({name:t+"/internalSubscriptions",initialState:rp,reducers:{subscriptionsUpdated:{reducer:function(C,T){return x3(C,T.payload)},prepare:wv()}}}),_=An({name:t+"/config",initialState:Vn({online:Ece(),focused:Ace(),middlewareRegistered:!1},d),reducers:{middlewareRegistered:function(C,T){var E=T.payload;C.middlewareRegistered=C.middlewareRegistered==="conflict"||s!==E?"conflict":!0}},extraReducers:function(C){C.addCase(zT,function(T){T.online=!0}).addCase(O$,function(T){T.online=!1}).addCase(UT,function(T){T.focused=!0}).addCase(R$,function(T){T.focused=!1}).addMatcher(l,function(T){return Vn({},T)})}}),b=Qf({queries:h.reducer,mutations:g.reducer,provided:m.reducer,subscriptions:x.reducer,config:_.reducer}),y=function(C,T){return b(f.match(T)?void 0:C,T)},S=Fs(Vn(Vn(Vn(Vn(Vn({},_.actions),h.actions),v.actions),x.actions),g.actions),{unsubscribeMutationResult:g.actions.removeMutationResult,resetApiState:f});return{reducer:y,actions:S}}var Qu=Symbol.for("RTKQ/skipToken"),N$={status:vn.uninitialized},dR=fu(N$,function(){}),fR=fu(N$,function(){});function Dce(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(d){return dR},i=function(d){return fR};return{buildQuerySelector:a,buildMutationSelector:l,selectInvalidatedBy:u};function o(d){return Vn(Vn({},d),Sce(d.status))}function s(d){var f=d[n];return f}function a(d,f){return function(h){var g=t({queryArgs:h,endpointDefinition:f,endpointName:d}),m=function(x){var _,b,y;return(y=(b=(_=s(x))==null?void 0:_.queries)==null?void 0:b[g])!=null?y:dR},v=h===Qu?r:m;return mi(v,o)}}function l(){return function(d){var f,h;typeof d=="object"?h=(f=Bg(d))!=null?f:Qu:h=d;var g=function(v){var x,_,b;return(b=(_=(x=s(v))==null?void 0:x.mutations)==null?void 0:_[h])!=null?b:fR},m=h===Qu?i:g;return mi(m,o)}}function u(d,f){for(var h,g=d[n],m=new Set,v=0,x=f.map(z3);v<x.length;v++){var _=x[v],b=g.provided[_.type];if(b)for(var y=(h=_.id!==void 0?b[_.id]:iR(Object.values(b)))!=null?h:[],S=0,C=y;S<C.length;S++){var T=C[S];m.add(T)}}return iR(Array.from(m.values()).map(function(E){var P=g.queries[E];return P?[{queryCacheKey:E,endpointName:P.endpointName,originalArgs:P.originalArgs}]:[]}))}}var O0=WeakMap?new WeakMap:void 0,hR=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=O0==null?void 0:O0.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return hs(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});hs(n)&&(O0==null||O0.set(n,o)),r=o}return t+"("+r+")"};function $ce(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=b1(function(d){var f,h;return(h=r.extractRehydrationInfo)==null?void 0:h.call(r,d,{reducerPath:(f=r.reducerPath)!=null?f:"api"})}),o=Fs(Vn({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(d){var f=hR;if("serializeQueryArgs"in d.endpointDefinition){var h=d.endpointDefinition.serializeQueryArgs;f=function(g){var m=h(g);return typeof m=="string"?m:hR(Fs(Vn({},g),{queryArgs:m}))}}else r.serializeQueryArgs&&(f=r.serializeQueryArgs);return f(d)},tagTypes:$1([],r.tagTypes||[])}),s={endpointDefinitions:{},batch:function(d){d()},apiUid:nb(),extractRehydrationInfo:i,hasRehydrationInfo:b1(function(d){return i(d)!=null})},a={injectEndpoints:u,enhanceEndpoints:function(d){var f=d.addTagTypes,h=d.endpoints;if(f)for(var g=0,m=f;g<m.length;g++){var v=m[g];o.tagTypes.includes(v)||o.tagTypes.push(v)}if(h)for(var x=0,_=Object.entries(h);x<_.length;x++){var b=_[x],y=b[0],S=b[1];typeof S=="function"?S(s.endpointDefinitions[y]):Object.assign(s.endpointDefinitions[y]||{},S)}return a}},l=e.map(function(d){return d.init(a,o,s)});function u(d){for(var f=d.endpoints({query:function(S){return Fs(Vn({},S),{type:Ys.query})},mutation:function(S){return Fs(Vn({},S),{type:Ys.mutation})}}),h=0,g=Object.entries(f);h<g.length;h++){var m=g[h],v=m[0],x=m[1];if(!d.overrideExisting&&v in s.endpointDefinitions){typeof process<"u";continue}s.endpointDefinitions[v]=x;for(var _=0,b=l;_<b.length;_++){var y=b[_];y.injectEndpoint(v,x)}}return a}return a.injectEndpoints({endpoints:r.endpoints})}}function Fce(e){for(var t in e)return!1;return!0}var Bce=2147483647/1e3-1,Uce=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,s=o.removeQueryResult,a=o.unsubscribeQueryResult;function l(h){var g=i.currentSubscriptions[h];return!!g&&!Fce(g)}var u={},d=function(h,g,m){var v;if(a.match(h)){var x=g.getState()[t],_=h.payload.queryCacheKey;f(_,(v=x.queries[_])==null?void 0:v.endpointName,g,x.config)}if(n.util.resetApiState.match(h))for(var b=0,y=Object.entries(u);b<y.length;b++){var S=y[b],C=S[0],T=S[1];T&&clearTimeout(T),delete u[C]}if(r.hasRehydrationInfo(h))for(var x=g.getState()[t],E=r.extractRehydrationInfo(h).queries,P=0,k=Object.entries(E);P<k.length;P++){var O=k[P],_=O[0],M=O[1];f(_,M==null?void 0:M.endpointName,g,x.config)}};function f(h,g,m,v){var x,_=r.endpointDefinitions[g],b=(x=_==null?void 0:_.keepUnusedDataFor)!=null?x:v.keepUnusedDataFor;if(b!==1/0){var y=Math.max(0,Math.min(b,Bce));if(!l(h)){var S=u[h];S&&clearTimeout(S),u[h]=setTimeout(function(){l(h)||m.dispatch(s({queryCacheKey:h})),delete u[h]},y*1e3)}}}return d},zce=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,s=e.assertTagType,a=e.refetchQuery,l=o.internalActions.removeQueryResult,u=Lo(pu(i),Sm(i)),d=function(h,g){u(h)&&f(M$(h,"invalidatesTags",r,s),g),o.util.invalidateTags.match(h)&&f(I$(h.payload,void 0,void 0,void 0,void 0,s),g)};function f(h,g){var m=g.getState(),v=m[t],x=o.util.selectInvalidatedBy(m,h);n.batch(function(){for(var _,b=Array.from(x.values()),y=0,S=b;y<S.length;y++){var C=S[y].queryCacheKey,T=v.queries[C],E=(_=v.subscriptions[C])!=null?_:{};T&&(Object.keys(E).length===0?g.dispatch(l({queryCacheKey:C})):T.status!==vn.uninitialized&&g.dispatch(a(T,C)))}})}return d},Vce=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,s={},a=function(g,m){(r.internalActions.updateSubscriptionOptions.match(g)||r.internalActions.unsubscribeQueryResult.match(g))&&u(g.payload,m),(n.pending.match(g)||n.rejected.match(g)&&g.meta.condition)&&u(g.meta.arg,m),(n.fulfilled.match(g)||n.rejected.match(g)&&!g.meta.condition)&&l(g.meta.arg,m),r.util.resetApiState.match(g)&&f()};function l(g,m){var v=g.queryCacheKey,x=m.getState()[t],_=x.queries[v],b=o.currentSubscriptions[v];if(!(!_||_.status===vn.uninitialized)){var y=h(b);if(Number.isFinite(y)){var S=s[v];S!=null&&S.timeout&&(clearTimeout(S.timeout),S.timeout=void 0);var C=Date.now()+y,T=s[v]={nextPollTimestamp:C,pollingInterval:y,timeout:setTimeout(function(){T.timeout=void 0,m.dispatch(i(_,v))},y)}}}}function u(g,m){var v=g.queryCacheKey,x=m.getState()[t],_=x.queries[v],b=o.currentSubscriptions[v];if(!(!_||_.status===vn.uninitialized)){var y=h(b);if(!Number.isFinite(y)){d(v);return}var S=s[v],C=Date.now()+y;(!S||C<S.nextPollTimestamp)&&l({queryCacheKey:v},m)}}function d(g){var m=s[g];m!=null&&m.timeout&&clearTimeout(m.timeout),delete s[g]}function f(){for(var g=0,m=Object.keys(s);g<m.length;g++){var v=m[g];d(v)}}function h(g){g===void 0&&(g={});var m=Number.POSITIVE_INFINITY;for(var v in g)g[v].pollingInterval&&(m=Math.min(g[v].pollingInterval,m));return m}return a},jce=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,s=r.internalActions.removeQueryResult,a=function(u,d){UT.match(u)&&l(d,"refetchOnFocus"),zT.match(u)&&l(d,"refetchOnReconnect")};function l(u,d){var f=u.getState()[t],h=f.queries,g=o.currentSubscriptions;n.batch(function(){for(var m=0,v=Object.keys(g);m<v.length;m++){var x=v[m],_=h[x],b=g[x];if(!(!b||!_)){var y=Object.values(b).some(function(S){return S[d]===!0})||Object.values(b).every(function(S){return S[d]===void 0})&&f.config[d];y&&(Object.keys(b).length===0?u.dispatch(s({queryCacheKey:x})):_.status!==vn.uninitialized&&u.dispatch(i(_,x)))}}})}return a},pR=new Error("Promise never resolved before cacheEntryRemoved."),Gce=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var s=S1(i),a=S1(o),l=pu(i,o),u={},d=function(g,m,v){var x=f(g);if(i.pending.match(g)){var _=v[n].queries[x],b=m.getState()[n].queries[x];!_&&b&&h(g.meta.arg.endpointName,g.meta.arg.originalArgs,x,m,g.meta.requestId)}else if(o.pending.match(g)){var b=m.getState()[n].mutations[x];b&&h(g.meta.arg.endpointName,g.meta.arg.originalArgs,x,m,g.meta.requestId)}else if(l(g)){var y=u[x];y!=null&&y.valueResolved&&(y.valueResolved({data:g.payload,meta:g.meta.baseQueryMeta}),delete y.valueResolved)}else if(t.internalActions.removeQueryResult.match(g)||t.internalActions.removeMutationResult.match(g)){var y=u[x];y&&(delete u[x],y.cacheEntryRemoved())}else if(t.util.resetApiState.match(g))for(var S=0,C=Object.entries(u);S<C.length;S++){var T=C[S],E=T[0],y=T[1];delete u[E],y.cacheEntryRemoved()}};function f(g){return s(g)?g.meta.arg.queryCacheKey:a(g)?g.meta.requestId:t.internalActions.removeQueryResult.match(g)?g.payload.queryCacheKey:t.internalActions.removeMutationResult.match(g)?Bg(g.payload):""}function h(g,m,v,x,_){var b=r.endpointDefinitions[g],y=b==null?void 0:b.onCacheEntryAdded;if(y){var S={},C=new Promise(function(M){S.cacheEntryRemoved=M}),T=Promise.race([new Promise(function(M){S.valueResolved=M}),C.then(function(){throw pR})]);T.catch(function(){}),u[v]=S;var E=t.endpoints[g].select(b.type===Ys.query?m:v),P=x.dispatch(function(M,V,B){return B}),k=Fs(Vn({},x),{getCacheEntry:function(){return E(x.getState())},requestId:_,extra:P,updateCachedData:b.type===Ys.query?function(M){return x.dispatch(t.util.updateQueryData(g,m,M))}:void 0,cacheDataLoaded:T,cacheEntryRemoved:C}),O=y(m,k);Promise.resolve(O).catch(function(M){if(M!==pR)throw M})}}return d},Hce=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=ib(r,i),s=If(r,i),a=pu(r,i),l={},u=function(d,f){var h,g,m;if(o(d)){var v=d.meta,x=v.requestId,_=v.arg,b=_.endpointName,y=_.originalArgs,S=n.endpointDefinitions[b],C=S==null?void 0:S.onQueryStarted;if(C){var T={},E=new Promise(function(N,D){T.resolve=N,T.reject=D});E.catch(function(){}),l[x]=T;var P=t.endpoints[b].select(S.type===Ys.query?y:x),k=f.dispatch(function(N,D,U){return U}),O=Fs(Vn({},f),{getCacheEntry:function(){return P(f.getState())},requestId:x,extra:k,updateCachedData:S.type===Ys.query?function(N){return f.dispatch(t.util.updateQueryData(b,y,N))}:void 0,queryFulfilled:E});C(y,O)}}else if(a(d)){var M=d.meta,x=M.requestId,V=M.baseQueryMeta;(h=l[x])==null||h.resolve({data:d.payload,meta:V}),delete l[x]}else if(s(d)){var B=d.meta,x=B.requestId,A=B.rejectedWithValue,V=B.baseQueryMeta;(m=l[x])==null||m.reject({error:(g=d.payload)!=null?g:d.error,isUnhandledError:!A,meta:V}),delete l[x]}};return u},Wce=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var s,a;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},gR,qce=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(gR||(gR=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Kce=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,s=!1,a=t.internalActions,l=a.updateSubscriptionOptions,u=a.unsubscribeQueryResult,d=function(f,h){var g,m,v,x,_,b,y,S,C;if(l.match(h)){var T=h.payload,E=T.queryCacheKey,P=T.requestId,k=T.options;return(g=f==null?void 0:f[E])!=null&&g[P]&&(f[E][P]=k),!0}if(u.match(h)){var O=h.payload,E=O.queryCacheKey,P=O.requestId;return f[E]&&delete f[E][P],!0}if(t.internalActions.removeQueryResult.match(h))return delete f[h.payload.queryCacheKey],!0;if(n.pending.match(h)){var M=h.meta,V=M.arg,P=M.requestId;if(V.subscribe){var B=(v=f[m=V.queryCacheKey])!=null?v:f[m]={};return B[P]=(_=(x=V.subscriptionOptions)!=null?x:B[P])!=null?_:{},!0}}if(n.rejected.match(h)){var A=h.meta,N=A.condition,V=A.arg,P=A.requestId;if(N&&V.subscribe){var B=(y=f[b=V.queryCacheKey])!=null?y:f[b]={};return B[P]=(C=(S=V.subscriptionOptions)!=null?S:B[P])!=null?C:{},!0}}return!1};return function(f,h){var g,m;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(f))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(f)){var v=f.payload,x=v.queryCacheKey,_=v.requestId,b=!!((g=r.currentSubscriptions[x])!=null&&g[_]);return[!1,b]}var y=d(r.currentSubscriptions,f);if(y){s||(qce(function(){var E=JSON.parse(JSON.stringify(r.currentSubscriptions)),P=pT(o,function(){return E}),k=P[1];h.next(t.internalActions.subscriptionsUpdated(k)),o=E,s=!1}),s=!0);var S=!!((m=f.type)!=null&&m.startsWith(i)),C=n.rejected.match(f)&&f.meta.condition&&!!f.meta.arg.subscribe,T=!S&&!C;return[T,!1]}return[!0,!1]}};function Xce(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,s={invalidateTags:Me(t+"/invalidateTags")},a=function(f){return!!f&&typeof f.type=="string"&&f.type.startsWith(t+"/")},l=[Wce,Uce,zce,Vce,Gce,Hce],u=function(f){var h=!1,g={currentSubscriptions:{}},m=Fs(Vn({},e),{internalState:g,refetchQuery:d}),v=l.map(function(b){return b(m)}),x=Kce(m),_=jce(m);return function(b){return function(y){h||(h=!0,f.dispatch(r.internalActions.middlewareRegistered(o)));var S=Fs(Vn({},f),{next:b}),C=f.getState(),T=x(y,S,C),E=T[0],P=T[1],k;if(E?k=b(y):k=P,f.getState()[t]&&(_(y,S,C),a(y)||i.hasRehydrationInfo(y)))for(var O=0,M=v;O<M.length;O++){var V=M[O];V(y,S,C)}return k}}};return{middleware:u,actions:s};function d(f,h,g){return g===void 0&&(g={}),n(Vn({type:"query",endpointName:f.endpointName,originalArgs:f.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:h},g))}}function gl(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,$1([e],t))}var mR=Symbol(),Yce=function(){return{name:mR,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,s=t.serializeQueryArgs,a=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,d=t.refetchOnReconnect;fT();var f=function(ee){return typeof process<"u",ee};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:zT,onOffline:O$,onFocus:UT,onFocusLost:R$},util:{}});var h=Nce({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:s}),g=h.queryThunk,m=h.mutationThunk,v=h.patchQueryData,x=h.updateQueryData,_=h.upsertQueryData,b=h.prefetch,y=h.buildMatchThunkActions,S=Lce({context:n,queryThunk:g,mutationThunk:m,reducerPath:o,assertTagType:f,config:{refetchOnFocus:u,refetchOnReconnect:d,refetchOnMountOrArgChange:l,keepUnusedDataFor:a,reducerPath:o}}),C=S.reducer,T=S.actions;gl(e.util,{patchQueryData:v,updateQueryData:x,upsertQueryData:_,prefetch:b,resetApiState:T.resetApiState}),gl(e.internalActions,T);var E=Xce({reducerPath:o,context:n,queryThunk:g,mutationThunk:m,api:e,assertTagType:f}),P=E.middleware,k=E.actions;gl(e.util,k),gl(e,{reducer:C,middleware:P});var O=Dce({serializeQueryArgs:s,reducerPath:o}),M=O.buildQuerySelector,V=O.buildMutationSelector,B=O.selectInvalidatedBy;gl(e.util,{selectInvalidatedBy:B});var A=Mce({queryThunk:g,mutationThunk:m,api:e,serializeQueryArgs:s,context:n}),N=A.buildInitiateQuery,D=A.buildInitiateMutation,U=A.getRunningMutationThunk,$=A.getRunningMutationsThunk,j=A.getRunningQueriesThunk,G=A.getRunningQueryThunk,q=A.getRunningOperationPromises,Z=A.removalWarning;return gl(e.util,{getRunningOperationPromises:q,getRunningOperationPromise:Z,getRunningMutationThunk:U,getRunningMutationsThunk:$,getRunningQueryThunk:G,getRunningQueriesThunk:j}),{name:mR,injectEndpoint:function(ee,ie){var se,le,W=e;(le=(se=W.endpoints)[ee])!=null||(se[ee]={}),k$(ie)?gl(W.endpoints[ee],{name:ee,select:M(ee,ie),initiate:N(ee,ie)},y(g,ee)):kce(ie)&&gl(W.endpoints[ee],{name:ee,select:V(),initiate:D(ee)},y(m,ee))}}}}},L$={exports:{}},D$={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var $f=L;function Qce(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zce=typeof Object.is=="function"?Object.is:Qce,Jce=$f.useState,ede=$f.useEffect,tde=$f.useLayoutEffect,nde=$f.useDebugValue;function rde(e,t){var n=t(),r=Jce({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return tde(function(){i.value=n,i.getSnapshot=t,xx(i)&&o({inst:i})},[e,n,t]),ede(function(){return xx(i)&&o({inst:i}),e(function(){xx(i)&&o({inst:i})})},[e]),nde(n),n}function xx(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zce(e,n)}catch{return!0}}function ide(e,t){return t()}var ode=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ide:rde;D$.useSyncExternalStore=$f.useSyncExternalStore!==void 0?$f.useSyncExternalStore:ode;L$.exports=D$;var sde=L$.exports,$$={exports:{}},F$={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim/with-selector.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var bb=L,ade=sde;function lde(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ude=typeof Object.is=="function"?Object.is:lde,cde=ade.useSyncExternalStore,dde=bb.useRef,fde=bb.useEffect,hde=bb.useMemo,pde=bb.useDebugValue;F$.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=dde(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=hde(function(){function l(g){if(!u){if(u=!0,d=g,g=r(g),i!==void 0&&s.hasValue){var m=s.value;if(i(m,g))return f=m}return f=g}if(m=f,ude(d,g))return m;var v=r(g);return i!==void 0&&i(m,v)?m:(d=g,f=v)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,i]);var a=cde(e,o[0],o[1]);return fde(function(){s.hasValue=!0,s.value=a},[a]),pde(a),a};$$.exports=F$;var B$=$$.exports;const gde=Tc(B$);function mde(e){e()}let U$=mde;const yde=e=>U$=e,vde=()=>U$,yR=Symbol.for(`react-redux-context-${L.version}`),vR=globalThis;function _de(){let e=vR[yR];return e||(e=L.createContext(null),vR[yR]=e),e}const ru=new Proxy({},new Proxy({},{get(e,t){const n=_de();return(r,...i)=>Reflect[t](n,...i)}}));function VT(e=ru){return function(){return L.useContext(e)}}const z$=VT(),bde=()=>{throw new Error("uSES not initialized!")};let V$=bde;const Sde=e=>{V$=e},wde=(e,t)=>e===t;function xde(e=ru){const t=e===ru?z$:VT(e);return function(r,i={}){const{equalityFn:o=wde,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:d,stabilityCheck:f,noopCheck:h}=t();L.useRef(!0);const g=L.useCallback({[r.name](v){return r(v)}}[r.name],[r,f,s]),m=V$(u.addNestedSub,l.getState,d||l.getState,g,o);return L.useDebugValue(m),m}}const j$=xde();function U1(){return U1=Object.assign?Object.assign.bind():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},U1.apply(this,arguments)}var G$={exports:{}},Ht={};/** @license React v16.13.1
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ar=typeof Symbol=="function"&&Symbol.for,jT=Ar?Symbol.for("react.element"):60103,GT=Ar?Symbol.for("react.portal"):60106,Sb=Ar?Symbol.for("react.fragment"):60107,wb=Ar?Symbol.for("react.strict_mode"):60108,xb=Ar?Symbol.for("react.profiler"):60114,Cb=Ar?Symbol.for("react.provider"):60109,Tb=Ar?Symbol.for("react.context"):60110,HT=Ar?Symbol.for("react.async_mode"):60111,Eb=Ar?Symbol.for("react.concurrent_mode"):60111,Ab=Ar?Symbol.for("react.forward_ref"):60112,Pb=Ar?Symbol.for("react.suspense"):60113,Cde=Ar?Symbol.for("react.suspense_list"):60120,Rb=Ar?Symbol.for("react.memo"):60115,Ob=Ar?Symbol.for("react.lazy"):60116,Tde=Ar?Symbol.for("react.block"):60121,Ede=Ar?Symbol.for("react.fundamental"):60117,Ade=Ar?Symbol.for("react.responder"):60118,Pde=Ar?Symbol.for("react.scope"):60119;function lo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case jT:switch(e=e.type,e){case HT:case Eb:case Sb:case xb:case wb:case Pb:return e;default:switch(e=e&&e.$$typeof,e){case Tb:case Ab:case Ob:case Rb:case Cb:return e;default:return t}}case GT:return t}}}function H$(e){return lo(e)===Eb}Ht.AsyncMode=HT;Ht.ConcurrentMode=Eb;Ht.ContextConsumer=Tb;Ht.ContextProvider=Cb;Ht.Element=jT;Ht.ForwardRef=Ab;Ht.Fragment=Sb;Ht.Lazy=Ob;Ht.Memo=Rb;Ht.Portal=GT;Ht.Profiler=xb;Ht.StrictMode=wb;Ht.Suspense=Pb;Ht.isAsyncMode=function(e){return H$(e)||lo(e)===HT};Ht.isConcurrentMode=H$;Ht.isContextConsumer=function(e){return lo(e)===Tb};Ht.isContextProvider=function(e){return lo(e)===Cb};Ht.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===jT};Ht.isForwardRef=function(e){return lo(e)===Ab};Ht.isFragment=function(e){return lo(e)===Sb};Ht.isLazy=function(e){return lo(e)===Ob};Ht.isMemo=function(e){return lo(e)===Rb};Ht.isPortal=function(e){return lo(e)===GT};Ht.isProfiler=function(e){return lo(e)===xb};Ht.isStrictMode=function(e){return lo(e)===wb};Ht.isSuspense=function(e){return lo(e)===Pb};Ht.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Sb||e===Eb||e===xb||e===wb||e===Pb||e===Cde||typeof e=="object"&&e!==null&&(e.$$typeof===Ob||e.$$typeof===Rb||e.$$typeof===Cb||e.$$typeof===Tb||e.$$typeof===Ab||e.$$typeof===Ede||e.$$typeof===Ade||e.$$typeof===Pde||e.$$typeof===Tde)};Ht.typeOf=lo;G$.exports=Ht;var Rde=G$.exports,W$=Rde,Ode={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},kde={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},q$={};q$[W$.ForwardRef]=Ode;q$[W$.Memo]=kde;var Yt={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var WT=Symbol.for("react.element"),qT=Symbol.for("react.portal"),kb=Symbol.for("react.fragment"),Ib=Symbol.for("react.strict_mode"),Mb=Symbol.for("react.profiler"),Nb=Symbol.for("react.provider"),Lb=Symbol.for("react.context"),Ide=Symbol.for("react.server_context"),Db=Symbol.for("react.forward_ref"),$b=Symbol.for("react.suspense"),Fb=Symbol.for("react.suspense_list"),Bb=Symbol.for("react.memo"),Ub=Symbol.for("react.lazy"),Mde=Symbol.for("react.offscreen"),K$;K$=Symbol.for("react.module.reference");function Do(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case WT:switch(e=e.type,e){case kb:case Mb:case Ib:case $b:case Fb:return e;default:switch(e=e&&e.$$typeof,e){case Ide:case Lb:case Db:case Ub:case Bb:case Nb:return e;default:return t}}case qT:return t}}}Yt.ContextConsumer=Lb;Yt.ContextProvider=Nb;Yt.Element=WT;Yt.ForwardRef=Db;Yt.Fragment=kb;Yt.Lazy=Ub;Yt.Memo=Bb;Yt.Portal=qT;Yt.Profiler=Mb;Yt.StrictMode=Ib;Yt.Suspense=$b;Yt.SuspenseList=Fb;Yt.isAsyncMode=function(){return!1};Yt.isConcurrentMode=function(){return!1};Yt.isContextConsumer=function(e){return Do(e)===Lb};Yt.isContextProvider=function(e){return Do(e)===Nb};Yt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===WT};Yt.isForwardRef=function(e){return Do(e)===Db};Yt.isFragment=function(e){return Do(e)===kb};Yt.isLazy=function(e){return Do(e)===Ub};Yt.isMemo=function(e){return Do(e)===Bb};Yt.isPortal=function(e){return Do(e)===qT};Yt.isProfiler=function(e){return Do(e)===Mb};Yt.isStrictMode=function(e){return Do(e)===Ib};Yt.isSuspense=function(e){return Do(e)===$b};Yt.isSuspenseList=function(e){return Do(e)===Fb};Yt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kb||e===Mb||e===Ib||e===$b||e===Fb||e===Mde||typeof e=="object"&&e!==null&&(e.$$typeof===Ub||e.$$typeof===Bb||e.$$typeof===Nb||e.$$typeof===Lb||e.$$typeof===Db||e.$$typeof===K$||e.getModuleId!==void 0)};Yt.typeOf=Do;function Nde(){const e=vde();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const _R={notify(){},get:()=>[]};function Lde(e,t){let n,r=_R;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function s(){d.onStateChange&&d.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=Nde())}function u(){n&&(n(),n=void 0,r.clear(),r=_R)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const Dde=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$de=Dde?L.useLayoutEffect:L.useEffect;function bR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function z1(e,t){if(bR(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!bR(e[n[i]],t[n[i]]))return!1;return!0}function Fde({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const s=L.useMemo(()=>{const u=Lde(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),a=L.useMemo(()=>e.getState(),[e]);$de(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,a]);const l=t||ru;return jt.createElement(l.Provider,{value:s},n)}function X$(e=ru){const t=e===ru?z$:VT(e);return function(){const{store:r}=t();return r}}const Y$=X$();function Bde(e=ru){const t=e===ru?Y$:X$(e);return function(){return t().dispatch}}const Q$=Bde();Sde(B$.useSyncExternalStoreWithSelector);yde(Ms.unstable_batchedUpdates);var Ude=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},zde=Object.defineProperty,Vde=Object.defineProperties,jde=Object.getOwnPropertyDescriptors,SR=Object.getOwnPropertySymbols,Gde=Object.prototype.hasOwnProperty,Hde=Object.prototype.propertyIsEnumerable,wR=function(e,t,n){return t in e?zde(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wa=function(e,t){for(var n in t||(t={}))Gde.call(t,n)&&wR(e,n,t[n]);if(SR)for(var r=0,i=SR(t);r<i.length;r++){var n=i[r];Hde.call(t,n)&&wR(e,n,t[n])}return e},Cv=function(e,t){return Vde(e,jde(t))};function xR(e,t,n,r){var i=L.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=L.useRef(i);return L.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var Cx=Symbol();function Tx(e){var t=L.useRef(e);return L.useEffect(function(){z1(t.current,e)||(t.current=e)},[e]),z1(t.current,e)?t.current:e}var k0=WeakMap?new WeakMap:void 0,Wde=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=k0==null?void 0:k0.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(s,a){return hs(a)?Object.keys(a).sort().reduce(function(l,u){return l[u]=a[u],l},{}):a});hs(n)&&(k0==null||k0.set(n,o)),r=o}return t+"("+r+")"},qde=typeof window<"u"&&window.document&&window.document.createElement?L.useLayoutEffect:L.useEffect,Kde=function(e){return e},Xde=function(e){return e.isUninitialized?Cv(wa({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:vn.pending}):e};function Yde(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,s=n.useStore,a=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,d=a?function(v){return v()}:L.useEffect;return{buildQueryHooks:g,buildMutationHook:m,usePrefetch:h};function f(v,x,_){if(x!=null&&x.endpointName&&v.isUninitialized){var b=x.endpointName,y=u.endpointDefinitions[b];l({queryArgs:x.originalArgs,endpointDefinition:y,endpointName:b})===l({queryArgs:_,endpointDefinition:y,endpointName:b})&&(x=void 0)}var S=v.isSuccess?v.data:x==null?void 0:x.data;S===void 0&&(S=v.data);var C=S!==void 0,T=v.isLoading,E=!C&&T,P=v.isSuccess||T&&C;return Cv(wa({},v),{data:S,currentData:v.data,isFetching:T,isLoading:E,isSuccess:P})}function h(v,x){var _=i(),b=Tx(x);return L.useCallback(function(y,S){return _(t.util.prefetch(v,y,wa(wa({},b),S)))},[v,_,b])}function g(v){var x=function(y,S){var C=S===void 0?{}:S,T=C.refetchOnReconnect,E=C.refetchOnFocus,P=C.refetchOnMountOrArgChange,k=C.skip,O=k===void 0?!1:k,M=C.pollingInterval,V=M===void 0?0:M,B=t.endpoints[v].initiate,A=i(),N=xR(O?Qu:y,Wde,u.endpointDefinitions[v],v),D=Tx({refetchOnReconnect:T,refetchOnFocus:E,pollingInterval:V}),U=L.useRef(!1),$=L.useRef(),j=$.current||{},G=j.queryCacheKey,q=j.requestId,Z=!1;if(G&&q){var ee=A(t.internalActions.internal_probeSubscription({queryCacheKey:G,requestId:q}));Z=!!ee}var ie=!Z&&U.current;return d(function(){U.current=Z}),d(function(){ie&&($.current=void 0)},[ie]),d(function(){var se,le=$.current;if(typeof process<"u",N===Qu){le==null||le.unsubscribe(),$.current=void 0;return}var W=(se=$.current)==null?void 0:se.subscriptionOptions;if(!le||le.arg!==N){le==null||le.unsubscribe();var ne=A(B(N,{subscriptionOptions:D,forceRefetch:P}));$.current=ne}else D!==W&&le.updateSubscriptionOptions(D)},[A,B,P,N,D,ie]),L.useEffect(function(){return function(){var se;(se=$.current)==null||se.unsubscribe(),$.current=void 0}},[]),L.useMemo(function(){return{refetch:function(){var se;if(!$.current)throw new Error("Cannot refetch a query that has not been started yet.");return(se=$.current)==null?void 0:se.refetch()}}},[])},_=function(y){var S=y===void 0?{}:y,C=S.refetchOnReconnect,T=S.refetchOnFocus,E=S.pollingInterval,P=E===void 0?0:E,k=t.endpoints[v].initiate,O=i(),M=L.useState(Cx),V=M[0],B=M[1],A=L.useRef(),N=Tx({refetchOnReconnect:C,refetchOnFocus:T,pollingInterval:P});d(function(){var $,j,G=($=A.current)==null?void 0:$.subscriptionOptions;N!==G&&((j=A.current)==null||j.updateSubscriptionOptions(N))},[N]);var D=L.useRef(N);d(function(){D.current=N},[N]);var U=L.useCallback(function($,j){j===void 0&&(j=!1);var G;return r(function(){var q;(q=A.current)==null||q.unsubscribe(),A.current=G=O(k($,{subscriptionOptions:D.current,forceRefetch:!j})),B($)}),G},[O,k]);return L.useEffect(function(){return function(){var $;($=A==null?void 0:A.current)==null||$.unsubscribe()}},[]),L.useEffect(function(){V!==Cx&&!A.current&&U(V,!0)},[V,U]),L.useMemo(function(){return[U,V]},[U,V])},b=function(y,S){var C=S===void 0?{}:S,T=C.skip,E=T===void 0?!1:T,P=C.selectFromResult,k=t.endpoints[v].select,O=xR(E?Qu:y,l,u.endpointDefinitions[v],v),M=L.useRef(),V=L.useMemo(function(){return mi([k(O),function(U,$){return $},function(U){return O}],f)},[k,O]),B=L.useMemo(function(){return P?mi([V],P):V},[V,P]),A=o(function(U){return B(U,M.current)},z1),N=s(),D=V(N.getState(),M.current);return qde(function(){M.current=D},[D]),A};return{useQueryState:b,useQuerySubscription:x,useLazyQuerySubscription:_,useLazyQuery:function(y){var S=_(y),C=S[0],T=S[1],E=b(T,Cv(wa({},y),{skip:T===Cx})),P=L.useMemo(function(){return{lastArg:T}},[T]);return L.useMemo(function(){return[C,E,P]},[C,E,P])},useQuery:function(y,S){var C=x(y,S),T=b(y,wa({selectFromResult:y===Qu||S!=null&&S.skip?void 0:Xde},S)),E=T.data,P=T.status,k=T.isLoading,O=T.isSuccess,M=T.isError,V=T.error;return L.useDebugValue({data:E,status:P,isLoading:k,isSuccess:O,isError:M,error:V}),L.useMemo(function(){return wa(wa({},T),C)},[T,C])}}}function m(v){return function(x){var _=x===void 0?{}:x,b=_.selectFromResult,y=b===void 0?Kde:b,S=_.fixedCacheKey,C=t.endpoints[v],T=C.select,E=C.initiate,P=i(),k=L.useState(),O=k[0],M=k[1];L.useEffect(function(){return function(){O!=null&&O.arg.fixedCacheKey||O==null||O.reset()}},[O]);var V=L.useCallback(function(le){var W=P(E(le,{fixedCacheKey:S}));return M(W),W},[P,E,S]),B=(O||{}).requestId,A=L.useMemo(function(){return mi([T({fixedCacheKey:S,requestId:O==null?void 0:O.requestId})],y)},[T,O,y,S]),N=o(A,z1),D=S==null?O==null?void 0:O.arg.originalArgs:void 0,U=L.useCallback(function(){r(function(){O&&M(void 0),S&&P(t.internalActions.removeMutationResult({requestId:B,fixedCacheKey:S}))})},[P,S,O,B]),$=N.endpointName,j=N.data,G=N.status,q=N.isLoading,Z=N.isSuccess,ee=N.isError,ie=N.error;L.useDebugValue({endpointName:$,data:j,status:G,isLoading:q,isSuccess:Z,isError:ee,error:ie});var se=L.useMemo(function(){return Cv(wa({},N),{originalArgs:D,reset:U})},[N,D,U]);return L.useMemo(function(){return[V,se]},[V,se])}}}var V1;(function(e){e.query="query",e.mutation="mutation"})(V1||(V1={}));function Qde(e){return e.type===V1.query}function Zde(e){return e.type===V1.mutation}function Ex(e){return e.replace(e[0],e[0].toUpperCase())}function I0(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,Ude([e],t))}var Jde=Symbol(),efe=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?Ms.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?Q$:i,s=t.useSelector,a=s===void 0?j$:s,l=t.useStore,u=l===void 0?Y$:l,d=t.unstable__sideEffectsInRender,f=d===void 0?!1:d;return{name:Jde,init:function(h,g,m){var v=g.serializeQueryArgs,x=h,_=Yde({api:h,moduleOptions:{batch:r,useDispatch:o,useSelector:a,useStore:u,unstable__sideEffectsInRender:f},serializeQueryArgs:v,context:m}),b=_.buildQueryHooks,y=_.buildMutationHook,S=_.usePrefetch;return I0(x,{usePrefetch:S}),I0(m,{batch:r}),{injectEndpoint:function(C,T){if(Qde(T)){var E=b(C),P=E.useQuery,k=E.useLazyQuery,O=E.useLazyQuerySubscription,M=E.useQueryState,V=E.useQuerySubscription;I0(x.endpoints[C],{useQuery:P,useLazyQuery:k,useLazyQuerySubscription:O,useQueryState:M,useQuerySubscription:V}),h["use"+Ex(C)+"Query"]=P,h["useLazy"+Ex(C)+"Query"]=k}else if(Zde(T)){var B=y(C);I0(x.endpoints[C],{useMutation:B}),h["use"+Ex(C)+"Mutation"]=B}}}}}},tfe=$ce(Yce(),efe());const nfe=["Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","Model"],tt="LIST",rfe=async(e,t,n)=>{const r=$g.get(),i=Dg.get(),o=N1.get();return Oce({baseUrl:`${r??""}/api/v1`,prepareHeaders:a=>(i&&a.set("Authorization",`Bearer ${i}`),o&&a.set("project-id",o),a)})(e,t,n)},iu=tfe({baseQuery:rfe,reducerPath:"api",tagTypes:nfe,endpoints:()=>({})}),ife=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},Z$="%[a-f0-9]{2}",CR=new RegExp("("+Z$+")|([^%]+?)","gi"),TR=new RegExp("("+Z$+")+","gi");function j3(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],j3(n),j3(r))}function ofe(e){try{return decodeURIComponent(e)}catch{let t=e.match(CR)||[];for(let n=1;n<t.length;n++)e=j3(t,n).join(""),t=e.match(CR)||[];return e}}function sfe(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=TR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=ofe(n[0]);i!==n[0]&&(t[n[0]]=i)}n=TR.exec(e)}t["%C2"]="<22>";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function afe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return sfe(e)}}function J$(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function lfe(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const ufe=e=>e==null,cfe=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),G3=Symbol("encodeFragmentIdentifier");function dfe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Kn(t,e),"[",i,"]"].join("")]:[...n,[Kn(t,e),"[",Kn(i,e),"]=",Kn(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Kn(t,e),"[]"].join("")]:[...n,[Kn(t,e),"[]=",Kn(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Kn(t,e),":list="].join("")]:[...n,[Kn(t,e),":list=",Kn(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[Kn(n,e),t,Kn(i,e)].join("")]:[[r,Kn(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Kn(t,e)]:[...n,[Kn(t,e),"=",Kn(r,e)].join("")]}}function ffe(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),s=typeof r=="string"&&!o&&Ea(r,e).includes(e.arrayFormatSeparator);r=s?Ea(r,e):r;const a=o||s?r.split(e.arrayFormatSeparator).map(l=>Ea(l,e)):r===null?r:Ea(r,e);i[n]=a};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&Ea(r,e);return}const s=r===null?[]:r.split(e.arrayFormatSeparator).map(a=>Ea(a,e));if(i[n]===void 0){i[n]=s;return}i[n]=[...i[n],...s]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function eF(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Kn(e,t){return t.encode?t.strict?cfe(e):encodeURIComponent(e):e}function Ea(e,t){return t.decode?afe(e):e}function tF(e){return Array.isArray(e)?e.sort():typeof e=="object"?tF(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function nF(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function hfe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function ER(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function KT(e){e=nF(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function XT(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},eF(t.arrayFormatSeparator);const n=ffe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replace(/\+/g," "):i;let[s,a]=J$(o,"=");s===void 0&&(s=o),a=a===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:Ea(a,t),n(Ea(s,t),a,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[s,a]of Object.entries(o))o[s]=ER(a,t);else r[i]=ER(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const s=r[o];return s&&typeof s=="object"&&!Array.isArray(s)?i[o]=tF(s):i[o]=s,i},Object.create(null))}function rF(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},eF(t.arrayFormatSeparator);const n=s=>t.skipNull&&ufe(e[s])||t.skipEmptyString&&e[s]==="",r=dfe(t),i={};for(const[s,a]of Object.entries(e))n(s)||(i[s]=a);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(s=>{const a=e[s];return a===void 0?"":a===null?Kn(s,t):Array.isArray(a)?a.length===0&&t.arrayFormat==="bracket-separator"?Kn(s,t)+"[]":a.reduce(r(s),[]).join("&"):Kn(s,t)+"="+Kn(a,t)}).filter(s=>s.length>0).join("&")}function iF(e,t){var i;t={decode:!0,...t};let[n,r]=J$(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:XT(KT(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Ea(r,t)}:{}}}function oF(e,t){t={encode:!0,strict:!0,[G3]:!0,...t};const n=nF(e.url).split("?")[0]||"",r=KT(e.url),i={...XT(r,{sort:!1}),...e.query};let o=rF(i,t);o&&(o=`?${o}`);let s=hfe(e.url);if(e.fragmentIdentifier){const a=new URL(n);a.hash=e.fragmentIdentifier,s=t[G3]?a.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${s}`}function sF(e,t,n){n={parseFragmentIdentifier:!0,[G3]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=iF(e,n);return oF({url:r,query:lfe(i,t),fragmentIdentifier:o},n)}function pfe(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return sF(e,r,n)}const Tv=Object.freeze(Object.defineProperty({__proto__:null,exclude:pfe,extract:KT,parse:XT,parseUrl:iF,pick:sF,stringify:rF,stringifyUrl:oF},Symbol.toStringTag,{value:"Module"})),ip=(e,t)=>{if(!e)return!1;const n=j1.selectAll(e);if(n.length>1){const r=new Date(t.created_at),i=n[n.length-1];if(!i)return!1;const o=new Date(i.created_at);return r>=o}else if([0,1].includes(n.length))return!0;return!1},ml=e=>Jr.includes(e.image_category)?Jr:Ll,Cn=hu({selectId:e=>e.image_name,sortComparer:(e,t)=>ife(t.updated_at,e.updated_at)}),j1=Cn.getSelectors(),Jo=e=>`images/?${Tv.stringify(e,{arrayFormat:"none"})}`,Yi=iu.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:(t,n,r)=>{const i=[{type:"Board",id:tt}];return t&&i.push(...t.items.map(({board_id:o})=>({type:"Board",id:o}))),i}}),listAllBoards:e.query({query:()=>({url:"boards/",params:{all:!0}}),providesTags:(t,n,r)=>{const i=[{type:"Board",id:tt}];return t&&i.push(...t.map(({board_id:o})=>({type:"Board",id:o}))),i}}),listAllImageNamesForBoard:e.query({query:t=>({url:`boards/${t}/image_names`}),providesTags:(t,n,r)=>[{type:"ImageNameList",id:r}],keepUnusedDataFor:0}),getBoardImagesTotal:e.query({query:t=>({url:Jo({board_id:t??"none",categories:Jr,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>t.total}),getBoardAssetsTotal:e.query({query:t=>({url:Jo({board_id:t??"none",categories:Ll,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>t.total}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:tt}]}),updateBoard:e.mutation({query:({board_id:t,changes:n})=>({url:`boards/${t}`,method:"PATCH",body:n}),invalidatesTags:(t,n,r)=>[{type:"Board",id:r.board_id}]})})}),{useListBoardsQuery:oIe,useListAllBoardsQuery:sIe,useGetBoardImagesTotalQuery:aIe,useGetBoardAssetsTotalQuery:lIe,useCreateBoardMutation:uIe,useUpdateBoardMutation:cIe,useListAllImageNamesForBoardQuery:dIe}=Yi,we=iu.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:Jo(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:Jo({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return Jo({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Cn.addMany(Cn.getInitialState(),n)},merge:(t,n)=>{Cn.addMany(t,j1.selectAll(n))},forceRefetch({currentArg:t,previousArg:n}){return(t==null?void 0:t.offset)!==(n==null?void 0:n.offset)},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;j1.selectAll(i).forEach(o=>{n(we.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:Jo({is_intermediate:!0})}),providesTags:["IntermediatesCount"],transformResponse:t=>t.total}),getImageDTO:e.query({query:t=>({url:`images/i/${t}`}),providesTags:(t,n,r)=>[{type:"Image",id:r}],keepUnusedDataFor:86400}),getImageMetadata:e.query({query:t=>({url:`images/i/${t}/metadata`}),providesTags:(t,n,r)=>[{type:"ImageMetadata",id:r}],keepUnusedDataFor:86400}),clearIntermediates:e.mutation({query:()=>({url:"images/clear-intermediates",method:"POST"}),invalidatesTags:["IntermediatesCount"]}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),invalidatesTags:(t,n,{board_id:r})=>[{type:"BoardImagesTotal",id:r??"none"},{type:"BoardAssetsTotal",id:r??"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,s={board_id:o??"none",categories:ml(t)},a=n(we.util.updateQueryData("listImages",s,l=>{Cn.removeOne(l,i)}));try{await r}catch{a.undo()}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{var o;const i=(o=r[0])==null?void 0:o.board_id;return[{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"}]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=yce.keyBy(t,"image_name");i.deleted_images.forEach(s=>{const a=o[s];if(a){const l={board_id:a.board_id??"none",categories:ml(a)};n(we.util.updateQueryData("listImages",l,u=>{Cn.removeOne(u,s)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),invalidatesTags:(t,n,{imageDTO:r})=>[{type:"BoardImagesTotal",id:r.board_id??"none"},{type:"BoardAssetsTotal",id:r.board_id??"none"}],async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const s=[];s.push(r(we.util.updateQueryData("getImageDTO",t.image_name,l=>{Object.assign(l,{is_intermediate:n})})));const a=ml(t);if(n)s.push(r(we.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:a},l=>{Cn.removeOne(l,t.image_name)})));else{const l={board_id:t.board_id??"none",categories:a},u=we.endpoints.listImages.select(l)(o()),{data:d}=Jr.includes(t.image_category)?Yi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Yi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=u.data&&u.data.ids.length>=(d??0),h=ip(u.data,t);(f||h)&&s.push(r(we.util.updateQueryData("listImages",l,g=>{Cn.upsertOne(g,t)})))}try{await i}catch{s.forEach(l=>l.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),invalidatesTags:(t,n,{imageDTO:r})=>[{type:"BoardImagesTotal",id:r.board_id??"none"},{type:"BoardAssetsTotal",id:r.board_id??"none"}],async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i,getState:o}){const s=[];s.push(r(we.util.updateQueryData("getImageDTO",t.image_name,a=>{Object.assign(a,{session_id:n})})));try{await i}catch{s.forEach(a=>a.undo())}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:s})=>{const a=new FormData;return a.append("file",t),{url:"images/upload",method:"POST",body:a,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:s}}},async onQueryStarted({file:t,image_category:n,is_intermediate:r,postUploadAction:i,session_id:o,board_id:s},{dispatch:a,queryFulfilled:l}){try{const{data:u}=await l;if(u.is_intermediate)return;a(we.util.upsertQueryData("getImageDTO",u.image_name,u));const d=ml(u);a(we.util.updateQueryData("listImages",{board_id:u.board_id??"none",categories:d},f=>{Cn.addOne(f,u)})),a(we.util.invalidateTags([{type:"BoardImagesTotal",id:u.board_id??"none"},{type:"BoardAssetsTotal",id:u.board_id??"none"}]))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:(t,n,r)=>[{type:"Board",id:tt},{type:"ImageList",id:Jo({board_id:"none",categories:Jr})},{type:"ImageList",id:Jo({board_id:"none",categories:Ll})},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{deleted_board_images:s}=o;s.forEach(u=>{n(we.util.updateQueryData("getImageDTO",u,d=>{d.board_id=void 0}))});const a=[{categories:Jr},{categories:Ll}],l=s.map(u=>({id:u,changes:{board_id:void 0}}));a.forEach(u=>{n(we.util.updateQueryData("listImages",u,d=>{Cn.updateMany(d,l)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:(t,n,r)=>[{type:"Board",id:tt},{type:"ImageList",id:Jo({board_id:"none",categories:Jr})},{type:"ImageList",id:Jo({board_id:"none",categories:Ll})},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{deleted_images:s}=o;[{categories:Jr},{categories:Ll}].forEach(l=>{n(we.util.updateQueryData("listImages",l,u=>{Cn.removeMany(u,s)}))})}catch{}}}),addImageToBoard:e.mutation({query:({board_id:t,imageDTO:n})=>{const{image_name:r}=n;return{url:"board_images/",method:"POST",body:{board_id:t,image_name:r}}},invalidatesTags:(t,n,{board_id:r,imageDTO:i})=>[{type:"Board",id:r},{type:"BoardImagesTotal",id:r},{type:"BoardAssetsTotal",id:r},{type:"BoardImagesTotal",id:i.board_id??"none"},{type:"BoardAssetsTotal",id:i.board_id??"none"}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const s=[],a=ml(n);if(s.push(r(we.util.updateQueryData("getImageDTO",n.image_name,l=>{l.board_id=t}))),!n.is_intermediate){s.push(r(we.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:a},g=>{Cn.removeOne(g,n.image_name)})));const l={board_id:t??"none",categories:a},u=we.endpoints.listImages.select(l)(o()),{data:d}=Jr.includes(n.image_category)?Yi.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Yi.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=u.data&&u.data.ids.length>=(d??0),h=ip(u.data,n);(f||h)&&s.push(r(we.util.updateQueryData("listImages",l,g=>{Cn.addOne(g,n)})))}try{await i}catch{s.forEach(l=>l.undo())}}}),removeImageFromBoard:e.mutation({query:({imageDTO:t})=>{const{image_name:n}=t;return{url:"board_images/",method:"DELETE",body:{image_name:n}}},invalidatesTags:(t,n,{imageDTO:r})=>{const{board_id:i}=r;return[{type:"Board",id:i??"none"},{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=ml(t),s=[];s.push(n(we.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),s.push(n(we.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Cn.removeOne(h,t.image_name)})));const a={board_id:"none",categories:o},l=we.endpoints.listImages.select(a)(i()),{data:u}=Jr.includes(t.image_category)?Yi.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Yi.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=l.data&&l.data.ids.length>=(u??0),f=ip(l.data,t);(d||f)&&s.push(n(we.util.updateQueryData("listImages",a,h=>{Cn.upsertOne(h,t)})));try{await r}catch{s.forEach(h=>h.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{imageDTOs:r,board_id:i})=>{var s;const o=(s=r[0])==null?void 0:s.board_id;return[{type:"Board",id:i??"none"},{type:"BoardImagesTotal",id:i??"none"},{type:"BoardAssetsTotal",id:i??"none"},{type:"BoardImagesTotal",id:o??"none"},{type:"BoardAssetsTotal",id:o??"none"},{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}]},async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:s}=await i,{added_image_names:a}=s;a.forEach(l=>{r(we.util.updateQueryData("getImageDTO",l,_=>{_.board_id=t}));const u=n.find(_=>_.image_name===l);if(!u)return;const d=ml(u),f=u.board_id;r(we.util.updateQueryData("listImages",{board_id:f??"none",categories:d},_=>{Cn.removeOne(_,u.image_name)}));const h={board_id:t,categories:d},g=we.endpoints.listImages.select(h)(o()),{data:m}=Jr.includes(u.image_category)?Yi.endpoints.getBoardImagesTotal.select(t??"none")(o()):Yi.endpoints.getBoardAssetsTotal.select(t??"none")(o()),v=g.data&&g.data.ids.length>=(m??0),x=(m||0)>=tR?ip(g.data,u):!0;(v||x)&&r(we.util.updateQueryData("listImages",h,_=>{Cn.upsertOne(_,{...u,board_id:t})}))})}catch{}}}),removeImagesFromBoard:e.mutation({query:({imageDTOs:t})=>({url:"board_images/batch/delete",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{const i=[],o=[{type:"BoardImagesTotal",id:"none"},{type:"BoardAssetsTotal",id:"none"}];return t==null||t.removed_image_names.forEach(s=>{var l;const a=(l=r.find(u=>u.image_name===s))==null?void 0:l.board_id;!a||i.includes(a)||(o.push({type:"Board",id:a}),o.push({type:"BoardImagesTotal",id:a}),o.push({type:"BoardAssetsTotal",id:a}))}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:s}=o;s.forEach(a=>{n(we.util.updateQueryData("getImageDTO",a,v=>{v.board_id=void 0}));const l=t.find(v=>v.image_name===a);if(!l)return;const u=ml(l);n(we.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},v=>{Cn.removeOne(v,l.image_name)}));const d={board_id:"none",categories:u},f=we.endpoints.listImages.select(d)(i()),{data:h}=Jr.includes(l.image_category)?Yi.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):Yi.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),g=f.data&&f.data.ids.length>=(h??0),m=(h||0)>=tR?ip(f.data,l):!0;(g||m)&&n(we.util.updateQueryData("listImages",d,v=>{Cn.upsertOne(v,{...l,board_id:"none"})}))})}catch{}}})})}),{useGetIntermediatesCountQuery:fIe,useListImagesQuery:hIe,useLazyListImagesQuery:pIe,useGetImageDTOQuery:gIe,useGetImageMetadataQuery:mIe,useDeleteImageMutation:yIe,useDeleteImagesMutation:vIe,useUploadImageMutation:_Ie,useClearIntermediatesMutation:bIe,useAddImagesToBoardMutation:SIe,useRemoveImagesFromBoardMutation:wIe,useAddImageToBoardMutation:xIe,useRemoveImageFromBoardMutation:CIe,useChangeImageIsIntermediateMutation:TIe,useChangeImageSessionIdMutation:EIe,useDeleteBoardAndImagesMutation:AIe,useDeleteBoardMutation:PIe}=we,aF=Me("socket/socketConnected"),lF=Me("socket/appSocketConnected"),uF=Me("socket/socketDisconnected"),cF=Me("socket/appSocketDisconnected"),YT=Me("socket/socketSubscribed"),dF=Me("socket/appSocketSubscribed"),fF=Me("socket/socketUnsubscribed"),hF=Me("socket/appSocketUnsubscribed"),pF=Me("socket/socketInvocationStarted"),gF=Me("socket/appSocketInvocationStarted"),QT=Me("socket/socketInvocationComplete"),mF=Me("socket/appSocketInvocationComplete"),yF=Me("socket/socketInvocationError"),ZT=Me("socket/appSocketInvocationError"),vF=Me("socket/socketGraphExecutionStateComplete"),_F=Me("socket/appSocketGraphExecutionStateComplete"),bF=Me("socket/socketGeneratorProgress"),SF=Me("socket/appSocketGeneratorProgress"),wF=Me("socket/socketModelLoadStarted"),gfe=Me("socket/appSocketModelLoadStarted"),xF=Me("socket/socketModelLoadCompleted"),mfe=Me("socket/appSocketModelLoadCompleted"),CF=Me("socket/socketSessionRetrievalError"),TF=Me("socket/appSocketSessionRetrievalError"),EF=Me("socket/socketInvocationRetrievalError"),AF=Me("socket/appSocketInvocationRetrievalError"),JT=Me("controlNet/imageProcessed"),kd={none:{type:"none",label:"none",description:"",default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",label:"Canny",description:"",default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",label:"Content Shuffle",description:"",default:{id:"content_shuffle_image_processor",type:"content_shuffle_image_processor",detect_resolution:512,image_resolution:512,h:512,w:512,f:256}},hed_image_processor:{type:"hed_image_processor",label:"HED",description:"",default:{id:"hed_image_processor",type:"hed_image_processor",detect_resolution:512,image_resolution:512,scribble:!1}},lineart_anime_image_processor:{type:"lineart_anime_image_processor",label:"Lineart Anime",description:"",default:{id:"lineart_anime_image_processor",type:"lineart_anime_image_processor",detect_resolution:512,image_resolution:512}},lineart_image_processor:{type:"lineart_image_processor",label:"Lineart",description:"",default:{id:"lineart_image_processor",type:"lineart_image_processor",detect_resolution:512,image_resolution:512,coarse:!1}},mediapipe_face_processor:{type:"mediapipe_face_processor",label:"Mediapipe Face",description:"",default:{id:"mediapipe_face_processor",type:"mediapipe_face_processor",max_faces:1,min_confidence:.5}},midas_depth_image_processor:{type:"midas_depth_image_processor",label:"Depth (Midas)",description:"",default:{id:"midas_depth_image_processor",type:"midas_depth_image_processor",a_mult:2,bg_th:.1}},mlsd_image_processor:{type:"mlsd_image_processor",label:"M-LSD",description:"",default:{id:"mlsd_image_processor",type:"mlsd_image_processor",detect_resolution:512,image_resolution:512,thr_d:.1,thr_v:.1}},normalbae_image_processor:{type:"normalbae_image_processor",label:"Normal BAE",description:"",default:{id:"normalbae_image_processor",type:"normalbae_image_processor",detect_resolution:512,image_resolution:512}},openpose_image_processor:{type:"openpose_image_processor",label:"Openpose",description:"",default:{id:"openpose_image_processor",type:"openpose_image_processor",detect_resolution:512,image_resolution:512,hand_and_face:!1}},pidi_image_processor:{type:"pidi_image_processor",label:"PIDI",description:"",default:{id:"pidi_image_processor",type:"pidi_image_processor",detect_resolution:512,image_resolution:512,scribble:!1,safe:!1}},zoe_depth_image_processor:{type:"zoe_depth_image_processor",label:"Depth (Zoe)",description:"",default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},M0={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",lineart:"lineart_image_processor",lineart_anime:"lineart_anime_image_processor",softedge:"hed_image_processor",shuffle:"content_shuffle_image_processor",openpose:"openpose_image_processor",mediapipe:"mediapipe_face_processor"},AR={isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:kd.canny_image_processor.default,shouldAutoConfig:!0},H3={controlNets:{},isEnabled:!1,pendingControlImages:[]},PF=An({name:"controlNet",initialState:H3,reducers:{isControlNetEnabledToggled:e=>{e.isEnabled=!e.isEnabled},controlNetAdded:(e,t)=>{const{controlNetId:n,controlNet:r}=t.payload;e.controlNets[n]={...r??AR,controlNetId:n}},controlNetDuplicated:(e,t)=>{const{sourceControlNetId:n,newControlNetId:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=Qr(i);o.controlNetId=r,e.controlNets[r]=o},controlNetAddedFromImage:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload;e.controlNets[n]={...AR,controlNetId:n,controlImage:r}},controlNetRemoved:(e,t)=>{const{controlNetId:n}=t.payload;delete e.controlNets[n]},controlNetToggled:(e,t)=>{const{controlNetId:n}=t.payload,r=e.controlNets[n];r&&(r.isEnabled=!r.isEnabled)},controlNetImageChanged:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload,i=e.controlNets[n];i&&(i.controlImage=r,i.processedControlImage=null,r!==null&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlNetProcessedImageChanged:(e,t)=>{const{controlNetId:n,processedControlImage:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=r,e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlNetModelChanged:(e,t)=>{const{controlNetId:n,model:r}=t.payload,i=e.controlNets[n];if(i&&(i.model=r,i.processedControlImage=null,i.shouldAutoConfig)){let o;for(const s in M0)if(r.model_name.includes(s)){o=M0[s];break}o?(i.processorType=o,i.processorNode=kd[o].default):(i.processorType="none",i.processorNode=kd.none.default)}},controlNetWeightChanged:(e,t)=>{const{controlNetId:n,weight:r}=t.payload,i=e.controlNets[n];i&&(i.weight=r)},controlNetBeginStepPctChanged:(e,t)=>{const{controlNetId:n,beginStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.beginStepPct=r)},controlNetEndStepPctChanged:(e,t)=>{const{controlNetId:n,endStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.endStepPct=r)},controlNetControlModeChanged:(e,t)=>{const{controlNetId:n,controlMode:r}=t.payload,i=e.controlNets[n];i&&(i.controlMode=r)},controlNetResizeModeChanged:(e,t)=>{const{controlNetId:n,resizeMode:r}=t.payload,i=e.controlNets[n];i&&(i.resizeMode=r)},controlNetProcessorParamsChanged:(e,t)=>{const{controlNetId:n,changes:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=i.processorNode;i.processorNode={...o,...r},i.shouldAutoConfig=!1},controlNetProcessorTypeChanged:(e,t)=>{const{controlNetId:n,processorType:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=null,i.processorType=r,i.processorNode=kd[r].default,i.shouldAutoConfig=!1)},controlNetAutoConfigToggled:(e,t)=>{var o;const{controlNetId:n}=t.payload,r=e.controlNets[n];if(!r)return;const i=!r.shouldAutoConfig;if(i){let s;for(const a in M0)if((o=r.model)!=null&&o.model_name.includes(a)){s=M0[a];break}s?(r.processorType=s,r.processorNode=kd[s].default):(r.processorType="none",r.processorNode=kd.none.default)}r.shouldAutoConfig=i},controlNetReset:()=>({...H3})},extraReducers:e=>{e.addCase(JT,(t,n)=>{const r=t.controlNets[n.payload.controlNetId];r&&r.controlImage!==null&&t.pendingControlImages.push(n.payload.controlNetId)}),e.addCase(ZT,t=>{t.pendingControlImages=[]}),e.addMatcher(S$,t=>{t.pendingControlImages=[]}),e.addMatcher(we.endpoints.deleteImage.matchFulfilled,(t,n)=>{const{image_name:r}=n.meta.arg.originalArgs;gc(t.controlNets,i=>{i.controlImage===r&&(i.controlImage=null,i.processedControlImage=null),i.processedControlImage===r&&(i.processedControlImage=null)})})}}),{isControlNetEnabledToggled:RIe,controlNetAdded:OIe,controlNetDuplicated:kIe,controlNetAddedFromImage:IIe,controlNetRemoved:RF,controlNetImageChanged:eE,controlNetProcessedImageChanged:yfe,controlNetToggled:MIe,controlNetModelChanged:PR,controlNetWeightChanged:NIe,controlNetBeginStepPctChanged:LIe,controlNetEndStepPctChanged:DIe,controlNetControlModeChanged:$Ie,controlNetResizeModeChanged:FIe,controlNetProcessorParamsChanged:vfe,controlNetProcessorTypeChanged:_fe,controlNetReset:tE,controlNetAutoConfigToggled:RR}=PF.actions,bfe=PF.reducer,OF={isEnabled:!1,maxPrompts:100,combinatorial:!0},Sfe=OF,kF=An({name:"dynamicPrompts",initialState:Sfe,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=OF.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},isEnabledToggled:e=>{e.isEnabled=!e.isEnabled}}}),{isEnabledToggled:BIe,maxPromptsChanged:UIe,maxPromptsReset:zIe,combinatorialToggled:VIe}=kF.actions,wfe=kF.reducer,IF={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",shouldShowDeleteButton:!1,boardSearchText:""},MF=An({name:"gallery",initialState:IF,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=t.payload},shouldAutoSwitchChanged:(e,t)=>{e.shouldAutoSwitch=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},autoAssignBoardOnClickChanged:(e,t)=>{e.autoAssignBoardOnClick=t.payload},boardIdSelected:(e,t)=>{e.selectedBoardId=t.payload,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},shouldShowDeleteButtonChanged:(e,t)=>{e.shouldShowDeleteButton=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(Cfe,(t,n)=>{const r=n.meta.arg.originalArgs;r===t.selectedBoardId&&(t.selectedBoardId="none",t.galleryView="images"),r===t.autoAddBoardId&&(t.autoAddBoardId="none")}),e.addMatcher(Yi.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:Gs,shouldAutoSwitchChanged:jIe,autoAssignBoardOnClickChanged:GIe,setGalleryImageMinimumWidth:HIe,boardIdSelected:W3,autoAddBoardIdChanged:WIe,galleryViewChanged:G1,selectionChanged:qIe,shouldShowDeleteButtonChanged:KIe,boardSearchTextChanged:XIe}=MF.actions,xfe=MF.reducer,Cfe=Lo(we.endpoints.deleteBoard.matchFulfilled,we.endpoints.deleteBoardAndImages.matchFulfilled),Tfe={imagesToDelete:[],isModalOpen:!1},NF=An({name:"deleteImageModal",initialState:Tfe,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:nE,imagesToDeleteSelected:Efe,imageDeletionCanceled:YIe}=NF.actions,Afe=NF.reducer,Pfe={isModalOpen:!1,imagesToChange:[]},LF=An({name:"changeBoardModal",initialState:Pfe,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:QIe,imagesToChangeSelected:ZIe,changeBoardReset:JIe}=LF.actions,Rfe=LF.reducer,OR={weight:.75},Ofe={loras:{}},DF=An({name:"lora",initialState:Ofe,reducers:{loraAdded:(e,t)=>{const{model_name:n,id:r,base_model:i}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,...OR}},loraRemoved:(e,t)=>{const n=t.payload;delete e.loras[n]},lorasCleared:e=>{e.loras={}},loraWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload,i=e.loras[n];i&&(i.weight=r)},loraWeightReset:(e,t)=>{const n=t.payload,r=e.loras[n];r&&(r.weight=OR.weight)}}}),{loraAdded:e7e,loraRemoved:$F,loraWeightChanged:t7e,loraWeightReset:n7e,lorasCleared:r7e}=DF.actions,kfe=DF.reducer;function $o(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=$o(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const kR=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??typeof d!="object"?d:Object.assign({},t,d),n.forEach(h=>h(t,f))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},Ife=e=>e?kR(e):kR,{useSyncExternalStoreWithSelector:Mfe}=gde;function Nfe(e,t=e.getState,n){const r=Mfe(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return L.useDebugValue(r),r}function Bi(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,i]of e)if(!Object.is(i,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 Lfe={value:()=>{}};function zb(){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 Ev(n)}function Ev(e){this._=e}function Dfe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ev.prototype=zb.prototype={constructor:Ev,on:function(e,t){var n=this._,r=Dfe(e+"",n),i,o=-1,s=r.length;if(arguments.length<2){for(;++o<s;)if((i=(e=r[o]).type)&&(i=$fe(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<s;)if(i=(e=r[o]).type)n[i]=IR(n[i],e.name,t);else if(t==null)for(i in n)n[i]=IR(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ev(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[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],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function $fe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function IR(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Lfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var q3="http://www.w3.org/1999/xhtml";const MR={svg:"http://www.w3.org/2000/svg",xhtml:q3,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Vb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),MR.hasOwnProperty(t)?{space:MR[t],local:e}:e}function Ffe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===q3&&t.documentElement.namespaceURI===q3?t.createElement(e):t.createElementNS(n,e)}}function Bfe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function FF(e){var t=Vb(e);return(t.local?Bfe:Ffe)(t)}function Ufe(){}function rE(e){return e==null?Ufe:function(){return this.querySelector(e)}}function zfe(e){typeof e!="function"&&(e=rE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=new Array(s),l,u,d=0;d<s;++d)(l=o[d])&&(u=e.call(l,l.__data__,d,o))&&("__data__"in l&&(u.__data__=l.__data__),a[d]=u);return new io(r,this._parents)}function Vfe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function jfe(){return[]}function BF(e){return e==null?jfe:function(){return this.querySelectorAll(e)}}function Gfe(e){return function(){return Vfe(e.apply(this,arguments))}}function Hfe(e){typeof e=="function"?e=Gfe(e):e=BF(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var s=t[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),i.push(l));return new io(r,i)}function UF(e){return function(){return this.matches(e)}}function zF(e){return function(t){return t.matches(e)}}var Wfe=Array.prototype.find;function qfe(e){return function(){return Wfe.call(this.children,e)}}function Kfe(){return this.firstElementChild}function Xfe(e){return this.select(e==null?Kfe:qfe(typeof e=="function"?e:zF(e)))}var Yfe=Array.prototype.filter;function Qfe(){return Array.from(this.children)}function Zfe(e){return function(){return Yfe.call(this.children,e)}}function Jfe(e){return this.selectAll(e==null?Qfe:Zfe(typeof e=="function"?e:zF(e)))}function ehe(e){typeof e!="function"&&(e=UF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new io(r,this._parents)}function VF(e){return new Array(e.length)}function the(){return new io(this._enter||this._groups.map(VF),this._parents)}function H1(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}H1.prototype={constructor:H1,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 nhe(e){return function(){return e}}function rhe(e,t,n,r,i,o){for(var s=0,a,l=t.length,u=o.length;s<u;++s)(a=t[s])?(a.__data__=o[s],r[s]=a):n[s]=new H1(e,o[s]);for(;s<l;++s)(a=t[s])&&(i[s]=a)}function ihe(e,t,n,r,i,o,s){var a,l,u=new Map,d=t.length,f=o.length,h=new Array(d),g;for(a=0;a<d;++a)(l=t[a])&&(h[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?i[a]=l:u.set(g,l));for(a=0;a<f;++a)g=s.call(e,o[a],a,o)+"",(l=u.get(g))?(r[a]=l,l.__data__=o[a],u.delete(g)):n[a]=new H1(e,o[a]);for(a=0;a<d;++a)(l=t[a])&&u.get(h[a])===l&&(i[a]=l)}function ohe(e){return e.__data__}function she(e,t){if(!arguments.length)return Array.from(this,ohe);var n=t?ihe:rhe,r=this._parents,i=this._groups;typeof e!="function"&&(e=nhe(e));for(var o=i.length,s=new Array(o),a=new Array(o),l=new Array(o),u=0;u<o;++u){var d=r[u],f=i[u],h=f.length,g=ahe(e.call(d,d&&d.__data__,u,r)),m=g.length,v=a[u]=new Array(m),x=s[u]=new Array(m),_=l[u]=new Array(h);n(d,f,v,x,_,g,t);for(var b=0,y=0,S,C;b<m;++b)if(S=v[b]){for(b>=y&&(y=b+1);!(C=x[y])&&++y<m;);S._next=C||null}}return s=new io(s,r),s._enter=a,s._exit=l,s}function ahe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lhe(){return new io(this._exit||this._groups.map(VF),this._parents)}function uhe(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function che(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,s=Math.min(i,o),a=new Array(i),l=0;l<s;++l)for(var u=n[l],d=r[l],f=u.length,h=a[l]=new Array(f),g,m=0;m<f;++m)(g=u[m]||d[m])&&(h[m]=g);for(;l<i;++l)a[l]=n[l];return new io(a,this._parents)}function dhe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],s;--i>=0;)(s=r[i])&&(o&&s.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(s,o),o=s);return this}function fhe(e){e||(e=hhe);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var s=n[o],a=s.length,l=i[o]=new Array(a),u,d=0;d<a;++d)(u=s[d])&&(l[d]=u);l.sort(t)}return new io(i,this._parents).order()}function hhe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function phe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ghe(){return Array.from(this)}function mhe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var s=r[i];if(s)return s}return null}function yhe(){let e=0;for(const t of this)++e;return e}function vhe(){return!this.node()}function _he(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,s=i.length,a;o<s;++o)(a=i[o])&&e.call(a,a.__data__,o,i);return this}function bhe(e){return function(){this.removeAttribute(e)}}function She(e){return function(){this.removeAttributeNS(e.space,e.local)}}function whe(e,t){return function(){this.setAttribute(e,t)}}function xhe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Che(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function The(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 Ehe(e,t){var n=Vb(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?She:bhe:typeof t=="function"?n.local?The:Che:n.local?xhe:whe)(n,t))}function jF(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ahe(e){return function(){this.style.removeProperty(e)}}function Phe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Rhe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ohe(e,t,n){return arguments.length>1?this.each((t==null?Ahe:typeof t=="function"?Rhe:Phe)(e,t,n??"")):Ff(this.node(),e)}function Ff(e,t){return e.style.getPropertyValue(t)||jF(e).getComputedStyle(e,null).getPropertyValue(t)}function khe(e){return function(){delete this[e]}}function Ihe(e,t){return function(){this[e]=t}}function Mhe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Nhe(e,t){return arguments.length>1?this.each((t==null?khe:typeof t=="function"?Mhe:Ihe)(e,t)):this.node()[e]}function GF(e){return e.trim().split(/^|\s+/)}function iE(e){return e.classList||new HF(e)}function HF(e){this._node=e,this._names=GF(e.getAttribute("class")||"")}HF.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 WF(e,t){for(var n=iE(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function qF(e,t){for(var n=iE(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Lhe(e){return function(){WF(this,e)}}function Dhe(e){return function(){qF(this,e)}}function $he(e,t){return function(){(t.apply(this,arguments)?WF:qF)(this,e)}}function Fhe(e,t){var n=GF(e+"");if(arguments.length<2){for(var r=iE(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?$he:t?Lhe:Dhe)(n,t))}function Bhe(){this.textContent=""}function Uhe(e){return function(){this.textContent=e}}function zhe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Vhe(e){return arguments.length?this.each(e==null?Bhe:(typeof e=="function"?zhe:Uhe)(e)):this.node().textContent}function jhe(){this.innerHTML=""}function Ghe(e){return function(){this.innerHTML=e}}function Hhe(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Whe(e){return arguments.length?this.each(e==null?jhe:(typeof e=="function"?Hhe:Ghe)(e)):this.node().innerHTML}function qhe(){this.nextSibling&&this.parentNode.appendChild(this)}function Khe(){return this.each(qhe)}function Xhe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Yhe(){return this.each(Xhe)}function Qhe(e){var t=typeof e=="function"?e:FF(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Zhe(){return null}function Jhe(e,t){var n=typeof e=="function"?e:FF(e),r=t==null?Zhe:typeof t=="function"?t:rE(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function epe(){var e=this.parentNode;e&&e.removeChild(this)}function tpe(){return this.each(epe)}function npe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rpe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ipe(e){return this.select(e?rpe:npe)}function ope(e){return arguments.length?this.property("__data__",e):this.node().__data__}function spe(e){return function(t){e.call(this,t,this.__data__)}}function ape(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 lpe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function upe(e,t,n){return function(){var r=this.__on,i,o=spe(t);if(r){for(var s=0,a=r.length;s<a;++s)if((i=r[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function cpe(e,t,n){var r=ape(e+""),i,o=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,d;l<u;++l)for(i=0,d=a[l];i<o;++i)if((s=r[i]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?upe:lpe,i=0;i<o;++i)this.each(a(r[i],t,n));return this}function KF(e,t,n){var r=jF(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function dpe(e,t){return function(){return KF(this,e,t)}}function fpe(e,t){return function(){return KF(this,e,t.apply(this,arguments))}}function hpe(e,t){return this.each((typeof t=="function"?fpe:dpe)(e,t))}function*ppe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,s;i<o;++i)(s=r[i])&&(yield s)}var XF=[null];function io(e,t){this._groups=e,this._parents=t}function Im(){return new io([[document.documentElement]],XF)}function gpe(){return this}io.prototype=Im.prototype={constructor:io,select:zfe,selectAll:Hfe,selectChild:Xfe,selectChildren:Jfe,filter:ehe,data:she,enter:the,exit:lhe,join:uhe,merge:che,selection:gpe,order:dhe,sort:fhe,call:phe,nodes:ghe,node:mhe,size:yhe,empty:vhe,each:_he,attr:Ehe,style:Ohe,property:Nhe,classed:Fhe,text:Vhe,html:Whe,raise:Khe,lower:Yhe,append:Qhe,insert:Jhe,remove:tpe,clone:ipe,datum:ope,on:cpe,dispatch:hpe,[Symbol.iterator]:ppe};function rs(e){return typeof e=="string"?new io([[document.querySelector(e)]],[document.documentElement]):new io([[e]],XF)}function mpe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Rs(e,t){if(e=mpe(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const ype={passive:!1},Ug={capture:!0,passive:!1};function Ax(e){e.stopImmediatePropagation()}function hf(e){e.preventDefault(),e.stopImmediatePropagation()}function YF(e){var t=e.document.documentElement,n=rs(e).on("dragstart.drag",hf,Ug);"onselectstart"in t?n.on("selectstart.drag",hf,Ug):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function QF(e,t){var n=e.document.documentElement,r=rs(e).on("dragstart.drag",null);t&&(r.on("click.drag",hf,Ug),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 N0=e=>()=>e;function K3(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:s,y:a,dx:l,dy:u,dispatch:d}){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:i,enumerable:!0,configurable:!0},active:{value:o,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:d}})}K3.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function vpe(e){return!e.ctrlKey&&!e.button}function _pe(){return this.parentNode}function bpe(e,t){return t??{x:e.x,y:e.y}}function Spe(){return navigator.maxTouchPoints||"ontouchstart"in this}function wpe(){var e=vpe,t=_pe,n=bpe,r=Spe,i={},o=zb("start","drag","end"),s=0,a,l,u,d,f=0;function h(S){S.on("mousedown.drag",g).filter(r).on("touchstart.drag",x).on("touchmove.drag",_,ype).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(S,C){if(!(d||!e.call(this,S,C))){var T=y(this,t.call(this,S,C),S,C,"mouse");T&&(rs(S.view).on("mousemove.drag",m,Ug).on("mouseup.drag",v,Ug),YF(S.view),Ax(S),u=!1,a=S.clientX,l=S.clientY,T("start",S))}}function m(S){if(hf(S),!u){var C=S.clientX-a,T=S.clientY-l;u=C*C+T*T>f}i.mouse("drag",S)}function v(S){rs(S.view).on("mousemove.drag mouseup.drag",null),QF(S.view,u),hf(S),i.mouse("end",S)}function x(S,C){if(e.call(this,S,C)){var T=S.changedTouches,E=t.call(this,S,C),P=T.length,k,O;for(k=0;k<P;++k)(O=y(this,E,S,C,T[k].identifier,T[k]))&&(Ax(S),O("start",S,T[k]))}}function _(S){var C=S.changedTouches,T=C.length,E,P;for(E=0;E<T;++E)(P=i[C[E].identifier])&&(hf(S),P("drag",S,C[E]))}function b(S){var C=S.changedTouches,T=C.length,E,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),E=0;E<T;++E)(P=i[C[E].identifier])&&(Ax(S),P("end",S,C[E]))}function y(S,C,T,E,P,k){var O=o.copy(),M=Rs(k||T,C),V,B,A;if((A=n.call(S,new K3("beforestart",{sourceEvent:T,target:h,identifier:P,active:s,x:M[0],y:M[1],dx:0,dy:0,dispatch:O}),E))!=null)return V=A.x-M[0]||0,B=A.y-M[1]||0,function N(D,U,$){var j=M,G;switch(D){case"start":i[P]=N,G=s++;break;case"end":delete i[P],--s;case"drag":M=Rs($||U,C),G=s;break}O.call(D,S,new K3(D,{sourceEvent:U,subject:A,target:h,identifier:P,active:G,x:M[0]+V,y:M[1]+B,dx:M[0]-j[0],dy:M[1]-j[1],dispatch:O}),E)}}return h.filter=function(S){return arguments.length?(e=typeof S=="function"?S:N0(!!S),h):e},h.container=function(S){return arguments.length?(t=typeof S=="function"?S:N0(S),h):t},h.subject=function(S){return arguments.length?(n=typeof S=="function"?S:N0(S),h):n},h.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:N0(!!S),h):r},h.on=function(){var S=o.on.apply(o,arguments);return S===o?h:S},h.clickDistance=function(S){return arguments.length?(f=(S=+S)*S,h):Math.sqrt(f)},h}function oE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ZF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Mm(){}var zg=.7,W1=1/zg,pf="\\s*([+-]?\\d+)\\s*",Vg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xpe=/^#([0-9a-f]{3,8})$/,Cpe=new RegExp(`^rgb\\(${pf},${pf},${pf}\\)$`),Tpe=new RegExp(`^rgb\\(${Hs},${Hs},${Hs}\\)$`),Epe=new RegExp(`^rgba\\(${pf},${pf},${pf},${Vg}\\)$`),Ape=new RegExp(`^rgba\\(${Hs},${Hs},${Hs},${Vg}\\)$`),Ppe=new RegExp(`^hsl\\(${Vg},${Hs},${Hs}\\)$`),Rpe=new RegExp(`^hsla\\(${Vg},${Hs},${Hs},${Vg}\\)$`),NR={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};oE(Mm,jg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LR,formatHex:LR,formatHex8:Ope,formatHsl:kpe,formatRgb:DR,toString:DR});function LR(){return this.rgb().formatHex()}function Ope(){return this.rgb().formatHex8()}function kpe(){return JF(this).formatHsl()}function DR(){return this.rgb().formatRgb()}function jg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xpe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$R(t):n===3?new Mi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?L0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?L0(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=Cpe.exec(e))?new Mi(t[1],t[2],t[3],1):(t=Tpe.exec(e))?new Mi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Epe.exec(e))?L0(t[1],t[2],t[3],t[4]):(t=Ape.exec(e))?L0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ppe.exec(e))?UR(t[1],t[2]/100,t[3]/100,1):(t=Rpe.exec(e))?UR(t[1],t[2]/100,t[3]/100,t[4]):NR.hasOwnProperty(e)?$R(NR[e]):e==="transparent"?new Mi(NaN,NaN,NaN,0):null}function $R(e){return new Mi(e>>16&255,e>>8&255,e&255,1)}function L0(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mi(e,t,n,r)}function Ipe(e){return e instanceof Mm||(e=jg(e)),e?(e=e.rgb(),new Mi(e.r,e.g,e.b,e.opacity)):new Mi}function X3(e,t,n,r){return arguments.length===1?Ipe(e):new Mi(e,t,n,r??1)}function Mi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}oE(Mi,X3,ZF(Mm,{brighter(e){return e=e==null?W1:Math.pow(W1,e),new Mi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zg:Math.pow(zg,e),new Mi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mi(oc(this.r),oc(this.g),oc(this.b),q1(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:FR,formatHex:FR,formatHex8:Mpe,formatRgb:BR,toString:BR}));function FR(){return`#${Zu(this.r)}${Zu(this.g)}${Zu(this.b)}`}function Mpe(){return`#${Zu(this.r)}${Zu(this.g)}${Zu(this.b)}${Zu((isNaN(this.opacity)?1:this.opacity)*255)}`}function BR(){const e=q1(this.opacity);return`${e===1?"rgb(":"rgba("}${oc(this.r)}, ${oc(this.g)}, ${oc(this.b)}${e===1?")":`, ${e})`}`}function q1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function oc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zu(e){return e=oc(e),(e<16?"0":"")+e.toString(16)}function UR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new is(e,t,n,r)}function JF(e){if(e instanceof is)return new is(e.h,e.s,e.l,e.opacity);if(e instanceof Mm||(e=jg(e)),!e)return new is;if(e instanceof is)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(t===o?s=(n-r)/a+(n<r)*6:n===o?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new is(s,a,l,e.opacity)}function Npe(e,t,n,r){return arguments.length===1?JF(e):new is(e,t,n,r??1)}function is(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}oE(is,Npe,ZF(Mm,{brighter(e){return e=e==null?W1:Math.pow(W1,e),new is(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zg:Math.pow(zg,e),new is(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,i=2*n-r;return new Mi(Px(e>=240?e-240:e+120,i,r),Px(e,i,r),Px(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new is(zR(this.h),D0(this.s),D0(this.l),q1(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=q1(this.opacity);return`${e===1?"hsl(":"hsla("}${zR(this.h)}, ${D0(this.s)*100}%, ${D0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function zR(e){return e=(e||0)%360,e<0?e+360:e}function D0(e){return Math.max(0,Math.min(1,e||0))}function Px(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 eB=e=>()=>e;function Lpe(e,t){return function(n){return e+n*t}}function Dpe(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 $pe(e){return(e=+e)==1?tB:function(t,n){return n-t?Dpe(t,n,e):eB(isNaN(t)?n:t)}}function tB(e,t){var n=t-e;return n?Lpe(e,n):eB(isNaN(e)?t:e)}const VR=function e(t){var n=$pe(t);function r(i,o){var s=n((i=X3(i)).r,(o=X3(o)).r),a=n(i.g,o.g),l=n(i.b,o.b),u=tB(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=a(d),i.b=l(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function xl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Y3=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rx=new RegExp(Y3.source,"g");function Fpe(e){return function(){return e}}function Bpe(e){return function(t){return e(t)+""}}function Upe(e,t){var n=Y3.lastIndex=Rx.lastIndex=0,r,i,o,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Y3.exec(e))&&(i=Rx.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),a[s]?a[s]+=o:a[++s]=o),(r=r[0])===(i=i[0])?a[s]?a[s]+=i:a[++s]=i:(a[++s]=null,l.push({i:s,x:xl(r,i)})),n=Rx.lastIndex;return n<t.length&&(o=t.slice(n),a[s]?a[s]+=o:a[++s]=o),a.length<2?l[0]?Bpe(l[0].x):Fpe(t):(t=l.length,function(u){for(var d=0,f;d<t;++d)a[(f=l[d]).i]=f.x(u);return a.join("")})}var jR=180/Math.PI,Q3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nB(e,t,n,r,i,o){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:i,translateY:o,rotate:Math.atan2(t,e)*jR,skewX:Math.atan(l)*jR,scaleX:s,scaleY:a}}var $0;function zpe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Q3:nB(t.a,t.b,t.c,t.d,t.e,t.f)}function Vpe(e){return e==null||($0||($0=document.createElementNS("http://www.w3.org/2000/svg","g")),$0.setAttribute("transform",e),!(e=$0.transform.baseVal.consolidate()))?Q3:(e=e.matrix,nB(e.a,e.b,e.c,e.d,e.e,e.f))}function rB(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,d,f,h,g,m){if(u!==f||d!==h){var v=g.push("translate(",null,t,null,n);m.push({i:v-4,x:xl(u,f)},{i:v-2,x:xl(d,h)})}else(f||h)&&g.push("translate("+f+t+h+n)}function s(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:xl(u,d)})):d&&f.push(i(f)+"rotate("+d+r)}function a(u,d,f,h){u!==d?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:xl(u,d)}):d&&f.push(i(f)+"skewX("+d+r)}function l(u,d,f,h,g,m){if(u!==f||d!==h){var v=g.push(i(g)+"scale(",null,",",null,")");m.push({i:v-4,x:xl(u,f)},{i:v-2,x:xl(d,h)})}else(f!==1||h!==1)&&g.push(i(g)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),o(u.translateX,u.translateY,d.translateX,d.translateY,f,h),s(u.rotate,d.rotate,f,h),a(u.skewX,d.skewX,f,h),l(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(g){for(var m=-1,v=h.length,x;++m<v;)f[(x=h[m]).i]=x.x(g);return f.join("")}}}var jpe=rB(zpe,"px, ","px)","deg)"),Gpe=rB(Vpe,", ",")",")"),Hpe=1e-12;function GR(e){return((e=Math.exp(e))+1/e)/2}function Wpe(e){return((e=Math.exp(e))-1/e)/2}function qpe(e){return((e=Math.exp(2*e))-1)/(e+1)}const Kpe=function e(t,n,r){function i(o,s){var a=o[0],l=o[1],u=o[2],d=s[0],f=s[1],h=s[2],g=d-a,m=f-l,v=g*g+m*m,x,_;if(v<Hpe)_=Math.log(h/u)/t,x=function(E){return[a+E*g,l+E*m,u*Math.exp(t*E*_)]};else{var b=Math.sqrt(v),y=(h*h-u*u+r*v)/(2*u*n*b),S=(h*h-u*u-r*v)/(2*h*n*b),C=Math.log(Math.sqrt(y*y+1)-y),T=Math.log(Math.sqrt(S*S+1)-S);_=(T-C)/t,x=function(E){var P=E*_,k=GR(C),O=u/(n*b)*(k*qpe(t*P+C)-Wpe(C));return[a+O*g,l+O*m,u*k/GR(t*P+C)]}}return x.duration=_*1e3*t/Math.SQRT2,x}return i.rho=function(o){var s=Math.max(.001,+o),a=s*s,l=a*a;return e(s,a,l)},i}(Math.SQRT2,2,4);var Bf=0,Ep=0,op=0,iB=1e3,K1,Ap,X1=0,_c=0,jb=0,Gg=typeof performance=="object"&&performance.now?performance:Date,oB=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sE(){return _c||(oB(Xpe),_c=Gg.now()+jb)}function Xpe(){_c=0}function Y1(){this._call=this._time=this._next=null}Y1.prototype=sB.prototype={constructor:Y1,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?sE():+n)+(t==null?0:+t),!this._next&&Ap!==this&&(Ap?Ap._next=this:K1=this,Ap=this),this._call=e,this._time=n,Z3()},stop:function(){this._call&&(this._call=null,this._time=1/0,Z3())}};function sB(e,t,n){var r=new Y1;return r.restart(e,t,n),r}function Ype(){sE(),++Bf;for(var e=K1,t;e;)(t=_c-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Bf}function HR(){_c=(X1=Gg.now())+jb,Bf=Ep=0;try{Ype()}finally{Bf=0,Zpe(),_c=0}}function Qpe(){var e=Gg.now(),t=e-X1;t>iB&&(jb-=t,X1=e)}function Zpe(){for(var e,t=K1,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:K1=n);Ap=e,Z3(r)}function Z3(e){if(!Bf){Ep&&(Ep=clearTimeout(Ep));var t=e-_c;t>24?(e<1/0&&(Ep=setTimeout(HR,e-Gg.now()-jb)),op&&(op=clearInterval(op))):(op||(X1=Gg.now(),op=setInterval(Qpe,iB)),Bf=1,oB(HR))}}function WR(e,t,n){var r=new Y1;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Jpe=zb("start","end","cancel","interrupt"),ege=[],aB=0,qR=1,J3=2,Av=3,KR=4,e5=5,Pv=6;function Gb(e,t,n,r,i,o){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;tge(e,n,{name:t,index:r,group:i,on:Jpe,tween:ege,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:aB})}function aE(e,t){var n=vs(e,t);if(n.state>aB)throw new Error("too late; already scheduled");return n}function ea(e,t){var n=vs(e,t);if(n.state>Av)throw new Error("too late; already running");return n}function vs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function tge(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=sB(o,0,n.time);function o(u){n.state=qR,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var d,f,h,g;if(n.state!==qR)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Av)return WR(s);g.state===KR?(g.state=Pv,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=Pv,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(WR(function(){n.state===Av&&(n.state=KR,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=J3,n.on.call("start",e,e.__data__,n.index,n.group),n.state===J3){for(n.state=Av,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=g);i.length=f+1}}function a(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=e5,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===e5&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Pv,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Rv(e,t){var n=e.__transition,r,i,o=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){o=!1;continue}i=r.state>J3&&r.state<e5,r.state=Pv,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}o&&delete e.__transition}}function nge(e){return this.each(function(){Rv(this,e)})}function rge(e,t){var n,r;return function(){var i=ea(this,e),o=i.tween;if(o!==n){r=n=o;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}i.tween=r}}function ige(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=ea(this,e),s=o.tween;if(s!==r){i=(r=s).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}o.tween=i}}function oge(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=vs(this.node(),n).tween,i=0,o=r.length,s;i<o;++i)if((s=r[i]).name===e)return s.value;return null}return this.each((t==null?rge:ige)(n,e,t))}function lE(e,t,n){var r=e._id;return e.each(function(){var i=ea(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return vs(i,r).value[t]}}function lB(e,t){var n;return(typeof t=="number"?xl:t instanceof jg?VR:(n=jg(t))?(t=n,VR):Upe)(e,t)}function sge(e){return function(){this.removeAttribute(e)}}function age(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lge(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttribute(e);return s===i?null:s===r?o:o=t(r=s,n)}}function uge(e,t,n){var r,i=n+"",o;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===r?o:o=t(r=s,n)}}function cge(e,t,n){var r,i,o;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===i?o:(i=l,o=t(r=s,a)))}}function dge(e,t,n){var r,i,o;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===i?o:(i=l,o=t(r=s,a)))}}function fge(e,t){var n=Vb(e),r=n==="transform"?Gpe:lB;return this.attrTween(e,typeof t=="function"?(n.local?dge:cge)(n,r,lE(this,"attr."+e,t)):t==null?(n.local?age:sge)(n):(n.local?uge:lge)(n,r,t))}function hge(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function pge(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gge(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&pge(e,o)),n}return i._value=t,i}function mge(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&hge(e,o)),n}return i._value=t,i}function yge(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=Vb(e);return this.tween(n,(r.local?gge:mge)(r,t))}function vge(e,t){return function(){aE(this,e).delay=+t.apply(this,arguments)}}function _ge(e,t){return t=+t,function(){aE(this,e).delay=t}}function bge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vge:_ge)(t,e)):vs(this.node(),t).delay}function Sge(e,t){return function(){ea(this,e).duration=+t.apply(this,arguments)}}function wge(e,t){return t=+t,function(){ea(this,e).duration=t}}function xge(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Sge:wge)(t,e)):vs(this.node(),t).duration}function Cge(e,t){if(typeof t!="function")throw new Error;return function(){ea(this,e).ease=t}}function Tge(e){var t=this._id;return arguments.length?this.each(Cge(t,e)):vs(this.node(),t).ease}function Ege(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ea(this,e).ease=n}}function Age(e){if(typeof e!="function")throw new Error;return this.each(Ege(this._id,e))}function Pge(e){typeof e!="function"&&(e=UF(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],s=o.length,a=r[i]=[],l,u=0;u<s;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&a.push(l);return new Ha(r,this._parents,this._name,this._id)}function Rge(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),s=new Array(r),a=0;a<o;++a)for(var l=t[a],u=n[a],d=l.length,f=s[a]=new Array(d),h,g=0;g<d;++g)(h=l[g]||u[g])&&(f[g]=h);for(;a<r;++a)s[a]=t[a];return new Ha(s,this._parents,this._name,this._id)}function Oge(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 kge(e,t,n){var r,i,o=Oge(t)?aE:ea;return function(){var s=o(this,e),a=s.on;a!==r&&(i=(r=a).copy()).on(t,n),s.on=i}}function Ige(e,t){var n=this._id;return arguments.length<2?vs(this.node(),n).on.on(e):this.each(kge(n,e,t))}function Mge(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Nge(){return this.on("end.remove",Mge(this._id))}function Lge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rE(e));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var a=r[s],l=a.length,u=o[s]=new Array(l),d,f,h=0;h<l;++h)(d=a[h])&&(f=e.call(d,d.__data__,h,a))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Gb(u[h],t,n,h,u,vs(d,n)));return new Ha(o,this._parents,t,n)}function Dge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=BF(e));for(var r=this._groups,i=r.length,o=[],s=[],a=0;a<i;++a)for(var l=r[a],u=l.length,d,f=0;f<u;++f)if(d=l[f]){for(var h=e.call(d,d.__data__,f,l),g,m=vs(d,n),v=0,x=h.length;v<x;++v)(g=h[v])&&Gb(g,t,n,v,h,m);o.push(h),s.push(d)}return new Ha(o,s,t,n)}var $ge=Im.prototype.constructor;function Fge(){return new $ge(this._groups,this._parents)}function Bge(e,t){var n,r,i;return function(){var o=Ff(this,e),s=(this.style.removeProperty(e),Ff(this,e));return o===s?null:o===n&&s===r?i:i=t(n=o,r=s)}}function uB(e){return function(){this.style.removeProperty(e)}}function Uge(e,t,n){var r,i=n+"",o;return function(){var s=Ff(this,e);return s===i?null:s===r?o:o=t(r=s,n)}}function zge(e,t,n){var r,i,o;return function(){var s=Ff(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Ff(this,e))),s===l?null:s===r&&l===i?o:(i=l,o=t(r=s,a))}}function Vge(e,t){var n,r,i,o="style."+t,s="end."+o,a;return function(){var l=ea(this,e),u=l.on,d=l.value[o]==null?a||(a=uB(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(s,i=d),l.on=r}}function jge(e,t,n){var r=(e+="")=="transform"?jpe:lB;return t==null?this.styleTween(e,Bge(e,r)).on("end.style."+e,uB(e)):typeof t=="function"?this.styleTween(e,zge(e,r,lE(this,"style."+e,t))).each(Vge(this._id,e)):this.styleTween(e,Uge(e,r,t),n).on("end.style."+e,null)}function Gge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Hge(e,t,n){var r,i;function o(){var s=t.apply(this,arguments);return s!==i&&(r=(i=s)&&Gge(e,s,n)),r}return o._value=t,o}function Wge(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,Hge(e,t,n??""))}function qge(e){return function(){this.textContent=e}}function Kge(e){return function(){var t=e(this);this.textContent=t??""}}function Xge(e){return this.tween("text",typeof e=="function"?Kge(lE(this,"text",e)):qge(e==null?"":e+""))}function Yge(e){return function(t){this.textContent=e.call(this,t)}}function Qge(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Yge(i)),t}return r._value=e,r}function Zge(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,Qge(e))}function Jge(){for(var e=this._name,t=this._id,n=cB(),r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var d=vs(l,t);Gb(l,e,n,u,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ha(r,this._parents,e,n)}function eme(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,s){var a={value:s},l={value:function(){--i===0&&o()}};n.each(function(){var u=ea(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&o()})}var tme=0;function Ha(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function cB(){return++tme}var ma=Im.prototype;Ha.prototype={constructor:Ha,select:Lge,selectAll:Dge,selectChild:ma.selectChild,selectChildren:ma.selectChildren,filter:Pge,merge:Rge,selection:Fge,transition:Jge,call:ma.call,nodes:ma.nodes,node:ma.node,size:ma.size,empty:ma.empty,each:ma.each,on:Ige,attr:fge,attrTween:yge,style:jge,styleTween:Wge,text:Xge,textTween:Zge,remove:Nge,tween:oge,delay:bge,duration:xge,ease:Tge,easeVarying:Age,end:eme,[Symbol.iterator]:ma[Symbol.iterator]};function nme(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rme={time:null,delay:0,duration:250,ease:nme};function ime(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 ome(e){var t,n;e instanceof Ha?(t=e._id,e=e._name):(t=cB(),(n=rme).time=sE(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var s=r[o],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Gb(l,e,t,u,s,n||ime(l,t));return new Ha(r,this._parents,e,t)}Im.prototype.interrupt=nge;Im.prototype.transition=ome;const F0=e=>()=>e;function sme(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Oa(e,t,n){this.k=e,this.x=t,this.y=n}Oa.prototype={constructor:Oa,scale:function(e){return e===1?this:new Oa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Oa(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 Hl=new Oa(1,0,0);Oa.prototype;function Ox(e){e.stopImmediatePropagation()}function sp(e){e.preventDefault(),e.stopImmediatePropagation()}function ame(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lme(){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 XR(){return this.__zoom||Hl}function ume(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cme(){return navigator.maxTouchPoints||"ontouchstart"in this}function dme(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s))}function fme(){var e=ame,t=lme,n=dme,r=ume,i=cme,o=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Kpe,u=zb("start","zoom","end"),d,f,h,g=500,m=150,v=0,x=10;function _(A){A.property("__zoom",XR).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",O).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(A,N,D,U){var $=A.selection?A.selection():A;$.property("__zoom",XR),A!==$?C(A,N,D,U):$.interrupt().each(function(){T(this,arguments).event(U).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},_.scaleBy=function(A,N,D,U){_.scaleTo(A,function(){var $=this.__zoom.k,j=typeof N=="function"?N.apply(this,arguments):N;return $*j},D,U)},_.scaleTo=function(A,N,D,U){_.transform(A,function(){var $=t.apply(this,arguments),j=this.__zoom,G=D==null?S($):typeof D=="function"?D.apply(this,arguments):D,q=j.invert(G),Z=typeof N=="function"?N.apply(this,arguments):N;return n(y(b(j,Z),G,q),$,s)},D,U)},_.translateBy=function(A,N,D,U){_.transform(A,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),s)},null,U)},_.translateTo=function(A,N,D,U,$){_.transform(A,function(){var j=t.apply(this,arguments),G=this.__zoom,q=U==null?S(j):typeof U=="function"?U.apply(this,arguments):U;return n(Hl.translate(q[0],q[1]).scale(G.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof D=="function"?-D.apply(this,arguments):-D),j,s)},U,$)};function b(A,N){return N=Math.max(o[0],Math.min(o[1],N)),N===A.k?A:new Oa(N,A.x,A.y)}function y(A,N,D){var U=N[0]-D[0]*A.k,$=N[1]-D[1]*A.k;return U===A.x&&$===A.y?A:new Oa(A.k,U,$)}function S(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function C(A,N,D,U){A.on("start.zoom",function(){T(this,arguments).event(U).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(U).end()}).tween("zoom",function(){var $=this,j=arguments,G=T($,j).event(U),q=t.apply($,j),Z=D==null?S(q):typeof D=="function"?D.apply($,j):D,ee=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),ie=$.__zoom,se=typeof N=="function"?N.apply($,j):N,le=l(ie.invert(Z).concat(ee/ie.k),se.invert(Z).concat(ee/se.k));return function(W){if(W===1)W=se;else{var ne=le(W),fe=ee/ne[2];W=new Oa(fe,Z[0]-ne[0]*fe,Z[1]-ne[1]*fe)}G.zoom(null,W)}})}function T(A,N,D){return!D&&A.__zooming||new E(A,N)}function E(A,N){this.that=A,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,N),this.taps=0}E.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,N){return this.mouse&&A!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var N=rs(this.that).datum();u.call(A,this.that,new sme(A,{sourceEvent:this.sourceEvent,target:_,type:A,transform:this.that.__zoom,dispatch:u}),N)}};function P(A,...N){if(!e.apply(this,arguments))return;var D=T(this,N).event(A),U=this.__zoom,$=Math.max(o[0],Math.min(o[1],U.k*Math.pow(2,r.apply(this,arguments)))),j=Rs(A);if(D.wheel)(D.mouse[0][0]!==j[0]||D.mouse[0][1]!==j[1])&&(D.mouse[1]=U.invert(D.mouse[0]=j)),clearTimeout(D.wheel);else{if(U.k===$)return;D.mouse=[j,U.invert(j)],Rv(this),D.start()}sp(A),D.wheel=setTimeout(G,m),D.zoom("mouse",n(y(b(U,$),D.mouse[0],D.mouse[1]),D.extent,s));function G(){D.wheel=null,D.end()}}function k(A,...N){if(h||!e.apply(this,arguments))return;var D=A.currentTarget,U=T(this,N,!0).event(A),$=rs(A.view).on("mousemove.zoom",Z,!0).on("mouseup.zoom",ee,!0),j=Rs(A,D),G=A.clientX,q=A.clientY;YF(A.view),Ox(A),U.mouse=[j,this.__zoom.invert(j)],Rv(this),U.start();function Z(ie){if(sp(ie),!U.moved){var se=ie.clientX-G,le=ie.clientY-q;U.moved=se*se+le*le>v}U.event(ie).zoom("mouse",n(y(U.that.__zoom,U.mouse[0]=Rs(ie,D),U.mouse[1]),U.extent,s))}function ee(ie){$.on("mousemove.zoom mouseup.zoom",null),QF(ie.view,U.moved),sp(ie),U.event(ie).end()}}function O(A,...N){if(e.apply(this,arguments)){var D=this.__zoom,U=Rs(A.changedTouches?A.changedTouches[0]:A,this),$=D.invert(U),j=D.k*(A.shiftKey?.5:2),G=n(y(b(D,j),U,$),t.apply(this,N),s);sp(A),a>0?rs(this).transition().duration(a).call(C,G,U,A):rs(this).call(_.transform,G,U,A)}}function M(A,...N){if(e.apply(this,arguments)){var D=A.touches,U=D.length,$=T(this,N,A.changedTouches.length===U).event(A),j,G,q,Z;for(Ox(A),G=0;G<U;++G)q=D[G],Z=Rs(q,this),Z=[Z,this.__zoom.invert(Z),q.identifier],$.touch0?!$.touch1&&$.touch0[2]!==Z[2]&&($.touch1=Z,$.taps=0):($.touch0=Z,j=!0,$.taps=1+!!d);d&&(d=clearTimeout(d)),j&&($.taps<2&&(f=Z[0],d=setTimeout(function(){d=null},g)),Rv(this),$.start())}}function V(A,...N){if(this.__zooming){var D=T(this,N).event(A),U=A.changedTouches,$=U.length,j,G,q,Z;for(sp(A),j=0;j<$;++j)G=U[j],q=Rs(G,this),D.touch0&&D.touch0[2]===G.identifier?D.touch0[0]=q:D.touch1&&D.touch1[2]===G.identifier&&(D.touch1[0]=q);if(G=D.that.__zoom,D.touch1){var ee=D.touch0[0],ie=D.touch0[1],se=D.touch1[0],le=D.touch1[1],W=(W=se[0]-ee[0])*W+(W=se[1]-ee[1])*W,ne=(ne=le[0]-ie[0])*ne+(ne=le[1]-ie[1])*ne;G=b(G,Math.sqrt(W/ne)),q=[(ee[0]+se[0])/2,(ee[1]+se[1])/2],Z=[(ie[0]+le[0])/2,(ie[1]+le[1])/2]}else if(D.touch0)q=D.touch0[0],Z=D.touch0[1];else return;D.zoom("touch",n(y(G,q,Z),D.extent,s))}}function B(A,...N){if(this.__zooming){var D=T(this,N).event(A),U=A.changedTouches,$=U.length,j,G;for(Ox(A),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),j=0;j<$;++j)G=U[j],D.touch0&&D.touch0[2]===G.identifier?delete D.touch0:D.touch1&&D.touch1[2]===G.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&&(G=Rs(G,this),Math.hypot(f[0]-G[0],f[1]-G[1])<x)){var q=rs(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return _.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:F0(+A),_):r},_.filter=function(A){return arguments.length?(e=typeof A=="function"?A:F0(!!A),_):e},_.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:F0(!!A),_):i},_.extent=function(A){return arguments.length?(t=typeof A=="function"?A:F0([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),_):t},_.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],_):[o[0],o[1]]},_.translateExtent=function(A){return arguments.length?(s[0][0]=+A[0][0],s[1][0]=+A[1][0],s[0][1]=+A[0][1],s[1][1]=+A[1][1],_):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},_.constrain=function(A){return arguments.length?(n=A,_):n},_.duration=function(A){return arguments.length?(a=+A,_):a},_.interpolate=function(A){return arguments.length?(l=A,_):l},_.on=function(){var A=u.on.apply(u,arguments);return A===u?_:A},_.clickDistance=function(A){return arguments.length?(v=(A=+A)*A,_):Math.sqrt(v)},_.tapDistance=function(A){return arguments.length?(x=+A,_):x},_}const Hb=L.createContext(null),hme=Hb.Provider,ou={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".`},dB=ou.error001();function Gn(e,t){const n=L.useContext(Hb);if(n===null)throw new Error(dB);return Nfe(n,e,t)}const ii=()=>{const e=L.useContext(Hb);if(e===null)throw new Error(dB);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},pme=e=>e.userSelectionActive?"none":"all";function gme({position:e,children:t,className:n,style:r,...i}){const o=Gn(pme),s=`${e}`.split("-");return ue.jsx("div",{className:$o(["react-flow__panel",n,...s]),style:{...r,pointerEvents:o},...i,children:t})}function mme({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ue.jsx(gme,{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:ue.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const yme=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...d})=>{const f=L.useRef(null),[h,g]=L.useState({x:0,y:0,width:0,height:0}),m=$o(["react-flow__edge-textwrapper",u]);return L.useEffect(()=>{if(f.current){const v=f.current.getBBox();g({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:ue.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:m,visibility:h.width?"visible":"hidden",...d,children:[i&&ue.jsx("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),ue.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:f,style:r,children:n}),l]})};var vme=L.memo(yme);const uE=e=>({width:e.offsetWidth,height:e.offsetHeight}),Uf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),cE=(e={x:0,y:0},t)=>({x:Uf(e.x,t[0][0],t[1][0]),y:Uf(e.y,t[0][1],t[1][1])}),YR=(e,t,n)=>e<t?Uf(Math.abs(e-t),1,50)/50:e>n?-Uf(Math.abs(e-n),1,50)/50:0,fB=(e,t)=>{const n=YR(e.x,35,t.width-35)*20,r=YR(e.y,35,t.height-35)*20;return[n,r]},hB=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pB=(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)}),Q1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),gB=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),QR=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),i7e=(e,t)=>gB(pB(Q1(e),Q1(t))),t5=(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)},_me=e=>Ro(e.width)&&Ro(e.height)&&Ro(e.x)&&Ro(e.y),Ro=e=>!isNaN(e)&&isFinite(e),pr=Symbol.for("internals"),mB=["Enter"," ","Escape"],bme=(e,t)=>{},Sme=e=>"nativeEvent"in e;function n5(e){var i,o;const t=Sme(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[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 yB=e=>"clientX"in e,Wl=(e,t)=>{var o,s;const n=yB(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Nm=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:g=20})=>ue.jsxs(ue.Fragment,{children:[ue.jsx("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:h}),g&&ue.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}),i&&Ro(n)&&Ro(r)?ue.jsx(vme,{x:n,y:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u}):null]});Nm.displayName="BaseEdge";function ap(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function vB({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[o,a,i,s]}function _B({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:s,targetControlY:a}){const l=e*.125+i*.375+s*.375+n*.125,u=t*.125+o*.375+a*.375+r*.125,d=Math.abs(l-e),f=Math.abs(u-t);return[l,u,d,f]}var bc;(function(e){e.Strict="strict",e.Loose="loose"})(bc||(bc={}));var gf;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(gf||(gf={}));var Hg;(function(e){e.Partial="partial",e.Full="full"})(Hg||(Hg={}));var Ol;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ol||(Ol={}));var Z1;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Z1||(Z1={}));var Ue;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ue||(Ue={}));function ZR({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Ue.Left||e===Ue.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function bB({sourceX:e,sourceY:t,sourcePosition:n=Ue.Bottom,targetX:r,targetY:i,targetPosition:o=Ue.Top}){const[s,a]=ZR({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=ZR({pos:o,x1:r,y1:i,x2:e,y2:t}),[d,f,h,g]=_B({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${i}`,d,f,h,g]}const dE=L.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Ue.Bottom,targetPosition:o=Ue.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:m,interactionWidth:v})=>{const[x,_,b]=bB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return ue.jsx(Nm,{path:x,labelX:_,labelY:b,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:m,interactionWidth:v})});dE.displayName="SimpleBezierEdge";const JR={[Ue.Left]:{x:-1,y:0},[Ue.Right]:{x:1,y:0},[Ue.Top]:{x:0,y:-1},[Ue.Bottom]:{x:0,y:1}},wme=({source:e,sourcePosition:t=Ue.Bottom,target:n})=>t===Ue.Left||t===Ue.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},eO=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function xme({source:e,sourcePosition:t=Ue.Bottom,target:n,targetPosition:r=Ue.Top,center:i,offset:o}){const s=JR[t],a=JR[r],l={x:e.x+s.x*o,y:e.y+s.y*o},u={x:n.x+a.x*o,y:n.y+a.y*o},d=wme({source:l,sourcePosition:t,target:u}),f=d.x!==0?"x":"y",h=d[f];let g=[],m,v;const[x,_,b,y]=vB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){m=i.x||x,v=i.y||_;const C=[{x:m,y:l.y},{x:m,y:u.y}],T=[{x:l.x,y:v},{x:u.x,y:v}];s[f]===h?g=f==="x"?C:T:g=f==="x"?T:C}else{const C=[{x:l.x,y:u.y}],T=[{x:u.x,y:l.y}];if(f==="x"?g=s.x===h?T:C:g=s.y===h?C:T,t!==r){const E=f==="x"?"y":"x",P=s[f]===a[E],k=l[E]>u[E],O=l[E]<u[E];(s[f]===1&&(!P&&k||P&&O)||s[f]!==1&&(!P&&O||P&&k))&&(g=f==="x"?C:T)}m=g[0].x,v=g[0].y}return[[e,l,...g,u,n],m,v,b,y]}function Cme(e,t,n,r){const i=Math.min(eO(e,t)/2,eO(t,n)/2,r),{x:o,y:s}=t;if(e.x===o&&o===n.x||e.y===s&&s===n.y)return`L${o} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${o+i*u},${s}Q ${o},${s} ${o},${s+i*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${s+i*l}Q ${o},${s} ${o+i*a},${s}`}function r5({sourceX:e,sourceY:t,sourcePosition:n=Ue.Bottom,targetX:r,targetY:i,targetPosition:o=Ue.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[d,f,h,g,m]=xme({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:a,y:l},offset:u});return[d.reduce((x,_,b)=>{let y="";return b>0&&b<d.length-1?y=Cme(d[b-1],_,d[b+1],s):y=`${b===0?"M":"L"}${_.x} ${_.y}`,x+=y,x},""),f,h,g,m]}const Wb=L.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:d,sourcePosition:f=Ue.Bottom,targetPosition:h=Ue.Top,markerEnd:g,markerStart:m,pathOptions:v,interactionWidth:x})=>{const[_,b,y]=r5({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:h,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return ue.jsx(Nm,{path:_,labelX:b,labelY:y,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:d,markerEnd:g,markerStart:m,interactionWidth:x})});Wb.displayName="SmoothStepEdge";const fE=L.memo(e=>{var t;return ue.jsx(Wb,{...e,pathOptions:L.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});fE.displayName="StepEdge";function Tme({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,s,a]=vB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,s,a]}const hE=L.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:g})=>{const[m,v,x]=Tme({sourceX:e,sourceY:t,targetX:n,targetY:r});return ue.jsx(Nm,{path:m,labelX:v,labelY:x,label:i,labelStyle:o,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:h,interactionWidth:g})});hE.displayName="StraightEdge";function B0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function tO({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case Ue.Left:return[t-B0(t-r,o),n];case Ue.Right:return[t+B0(r-t,o),n];case Ue.Top:return[t,n-B0(n-i,o)];case Ue.Bottom:return[t,n+B0(i-n,o)]}}function SB({sourceX:e,sourceY:t,sourcePosition:n=Ue.Bottom,targetX:r,targetY:i,targetPosition:o=Ue.Top,curvature:s=.25}){const[a,l]=tO({pos:n,x1:e,y1:t,x2:r,y2:i,c:s}),[u,d]=tO({pos:o,x1:r,y1:i,x2:e,y2:t,c:s}),[f,h,g,m]=_B({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${a},${l} ${u},${d} ${r},${i}`,f,h,g,m]}const J1=L.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=Ue.Bottom,targetPosition:o=Ue.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:m,pathOptions:v,interactionWidth:x})=>{const[_,b,y]=SB({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:v==null?void 0:v.curvature});return ue.jsx(Nm,{path:_,labelX:b,labelY:y,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:m,interactionWidth:x})});J1.displayName="BezierEdge";const pE=L.createContext(null),Eme=pE.Provider;pE.Consumer;const Ame=()=>L.useContext(pE),Pme=e=>"id"in e&&"source"in e&&"target"in e,Rme=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,i5=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Ome=(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)),wB=(e,t)=>{if(!e.source||!e.target)return t;let n;return Pme(e)?n={...e}:n={...e,id:Rme(e)},Ome(n,t)?t:t.concat(n)},xB=({x:e,y:t},[n,r,i],o,[s,a])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},kme=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),mf=(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],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},CB=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:s}=mf(i,t).positionAbsolute;return pB(r,Q1({x:o,y:s,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return gB(n)},TB=(e,t,[n,r,i]=[0,0,1],o=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(d=>{const{width:f,height:h,selectable:g=!0,hidden:m=!1}=d;if(s&&!g||m)return!1;const{positionAbsolute:v}=mf(d,a),x={x:v.x,y:v.y,width:f||0,height:h||0},_=t5(l,x),b=typeof f>"u"||typeof h>"u"||f===null||h===null,y=o&&_>0,S=(f||0)*(h||0);(b||y||_>=S||d.dragging)&&u.push(d)}),u},EB=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},AB=(e,t,n,r,i,o=.1)=>{const s=t/(e.width*(1+o)),a=n/(e.height*(1+o)),l=Math.min(s,a),u=Uf(l,r,i),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*u,g=n/2-f*u;return[h,g,u]},Vu=(e,t=0)=>e.transition().duration(t);function nO(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var s,a;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+o.x+o.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+o.y+o.height/2}),i},[])}function Ime(e,t,n,r,i,o){const{x:s,y:a}=Wl(e),u=t.elementsFromPoint(s,a).find(m=>m.classList.contains("react-flow__handle"));if(u){const m=u.getAttribute("data-nodeid");if(m){const v=gE(void 0,u),x=u.getAttribute("data-handleid"),_=o({nodeId:m,id:x,type:v});if(_)return{handle:{id:x,type:v,nodeId:m,x:n.x,y:n.y},validHandleResult:_}}}let d=[],f=1/0;if(i.forEach(m=>{const v=Math.sqrt((m.x-n.x)**2+(m.y-n.y)**2);if(v<=r){const x=o(m);v<=f&&(v<f?d=[{handle:m,validHandleResult:x}]:v===f&&d.push({handle:m,validHandleResult:x}),f=v)}}),!d.length)return{handle:null,validHandleResult:PB()};if(d.length===1)return d[0];const h=d.some(({validHandleResult:m})=>m.isValid),g=d.some(({handle:m})=>m.type==="target");return d.find(({handle:m,validHandleResult:v})=>g?m.type==="target":h?v.isValid:!0)||d[0]}const Mme={source:null,target:null,sourceHandle:null,targetHandle:null},PB=()=>({handleDomNode:null,isValid:!1,connection:Mme,endHandle:null});function RB(e,t,n,r,i,o,s){const a=i==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...PB(),handleDomNode:l};if(l){const d=gE(void 0,l),f=l.getAttribute("data-nodeid"),h=l.getAttribute("data-handleid"),g=l.classList.contains("connectable"),m=l.classList.contains("connectableend"),v={source:a?f:n,sourceHandle:a?h:r,target:a?n:f,targetHandle:a?r:h};u.connection=v,g&&m&&(t===bc.Strict?a&&d==="source"||!a&&d==="target":f!==n||h!==r)&&(u.endHandle={nodeId:f,handleId:h,type:d},u.isValid=o(v))}return u}function Nme({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[pr]){const{handleBounds:s}=o[pr];let a=[],l=[];s&&(a=nO(o,s,"source",`${t}-${n}-${r}`),l=nO(o,s,"target",`${t}-${n}-${r}`)),i.push(...a,...l)}return i},[])}function gE(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function kx(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Lme(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function OB({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const d=hB(e.target),{connectionMode:f,domNode:h,autoPanOnConnect:g,connectionRadius:m,onConnectStart:v,panBy:x,getNodes:_,cancelConnection:b}=o();let y=0,S;const{x:C,y:T}=Wl(e),E=d==null?void 0:d.elementFromPoint(C,T),P=gE(l,E),k=h==null?void 0:h.getBoundingClientRect();if(!k||!P)return;let O,M=Wl(e,k),V=!1,B=null,A=!1,N=null;const D=Nme({nodes:_(),nodeId:n,handleId:t,handleType:P}),U=()=>{if(!g)return;const[G,q]=fB(M,k);x({x:G,y:q}),y=requestAnimationFrame(U)};s({connectionPosition:M,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:P,connectionStartHandle:{nodeId:n,handleId:t,type:P},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:P});function $(G){const{transform:q}=o();M=Wl(G,k);const{handle:Z,validHandleResult:ee}=Ime(G,d,xB(M,q,!1,[1,1]),m,D,ie=>RB(ie,f,n,t,i?"target":"source",a,d));if(S=Z,V||(U(),V=!0),N=ee.handleDomNode,B=ee.connection,A=ee.isValid,s({connectionPosition:S&&A?kme({x:S.x,y:S.y},q):M,connectionStatus:Lme(!!S,A),connectionEndHandle:ee.endHandle}),!S&&!A&&!N)return kx(O);B.source!==B.target&&N&&(kx(O),O=N,N.classList.add("connecting","react-flow__handle-connecting"),N.classList.toggle("valid",A),N.classList.toggle("react-flow__handle-valid",A))}function j(G){var q,Z;(S||N)&&B&&A&&(r==null||r(B)),(Z=(q=o()).onConnectEnd)==null||Z.call(q,G),l&&(u==null||u(G)),kx(O),b(),cancelAnimationFrame(y),V=!1,A=!1,B=null,N=null,d.removeEventListener("mousemove",$),d.removeEventListener("mouseup",j),d.removeEventListener("touchmove",$),d.removeEventListener("touchend",j)}d.addEventListener("mousemove",$),d.addEventListener("mouseup",j),d.addEventListener("touchmove",$),d.addEventListener("touchend",j)}const rO=()=>!0,Dme=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),$me=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:s}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},kB=L.forwardRef(({type:e="source",position:t=Ue.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:d,onTouchStart:f,...h},g)=>{var k,O;const m=s||null,v=e==="target",x=ii(),_=Ame(),{connectOnClick:b,noPanClassName:y}=Gn(Dme,Bi),{connecting:S,clickConnecting:C}=Gn($me(_,m,e),Bi);_||(O=(k=x.getState()).onError)==null||O.call(k,"010",ou.error010());const T=M=>{const{defaultEdgeOptions:V,onConnect:B,hasDefaultEdges:A}=x.getState(),N={...V,...M};if(A){const{edges:D,setEdges:U}=x.getState();U(wB(N,D))}B==null||B(N),a==null||a(N)},E=M=>{if(!_)return;const V=yB(M);i&&(V&&M.button===0||!V)&&OB({event:M,handleId:m,nodeId:_,onConnect:T,isTarget:v,getState:x.getState,setState:x.setState,isValidConnection:n||x.getState().isValidConnection||rO}),V?d==null||d(M):f==null||f(M)},P=M=>{const{onClickConnectStart:V,onClickConnectEnd:B,connectionClickStartHandle:A,connectionMode:N,isValidConnection:D}=x.getState();if(!_||!A&&!i)return;if(!A){V==null||V(M,{nodeId:_,handleId:m,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:_,type:e,handleId:m}});return}const U=hB(M.target),$=n||D||rO,{connection:j,isValid:G}=RB({nodeId:_,id:m,type:e},N,A.nodeId,A.handleId||null,A.type,$,U);G&&T(j),B==null||B(M),x.setState({connectionClickStartHandle:null})};return ue.jsx("div",{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${_}-${m}-${e}`,className:$o(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:o,connecting:C,connectionindicator:r&&(i&&!S||o&&S)}]),onMouseDown:E,onTouchStart:E,onClick:b?P:void 0,ref:g,...h,children:l})});kB.displayName="Handle";var e_=L.memo(kB);const IB=({data:e,isConnectable:t,targetPosition:n=Ue.Top,sourcePosition:r=Ue.Bottom})=>ue.jsxs(ue.Fragment,{children:[ue.jsx(e_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,ue.jsx(e_,{type:"source",position:r,isConnectable:t})]});IB.displayName="DefaultNode";var o5=L.memo(IB);const MB=({data:e,isConnectable:t,sourcePosition:n=Ue.Bottom})=>ue.jsxs(ue.Fragment,{children:[e==null?void 0:e.label,ue.jsx(e_,{type:"source",position:n,isConnectable:t})]});MB.displayName="InputNode";var NB=L.memo(MB);const LB=({data:e,isConnectable:t,targetPosition:n=Ue.Top})=>ue.jsxs(ue.Fragment,{children:[ue.jsx(e_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});LB.displayName="OutputNode";var DB=L.memo(LB);const mE=()=>null;mE.displayName="GroupNode";const Fme=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),U0=e=>e.id;function Bme(e,t){return Bi(e.selectedNodes.map(U0),t.selectedNodes.map(U0))&&Bi(e.selectedEdges.map(U0),t.selectedEdges.map(U0))}const $B=L.memo(({onSelectionChange:e})=>{const t=ii(),{selectedNodes:n,selectedEdges:r}=Gn(Fme,Bme);return L.useEffect(()=>{var o,s;const i={nodes:n,edges:r};e==null||e(i),(s=(o=t.getState()).onSelectionChange)==null||s.call(o,i)},[n,r,e]),null});$B.displayName="SelectionListener";const Ume=e=>!!e.onSelectionChange;function zme({onSelectionChange:e}){const t=Gn(Ume);return e||t?ue.jsx($B,{onSelectionChange:e}):null}const Vme=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 md(e,t){L.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function mt(e,t,n){L.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const jme=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:h,edgesUpdatable:g,elevateNodesOnSelect:m,minZoom:v,maxZoom:x,nodeExtent:_,onNodesChange:b,onEdgesChange:y,elementsSelectable:S,connectionMode:C,snapGrid:T,snapToGrid:E,translateExtent:P,connectOnClick:k,defaultEdgeOptions:O,fitView:M,fitViewOptions:V,onNodesDelete:B,onEdgesDelete:A,onNodeDrag:N,onNodeDragStart:D,onNodeDragStop:U,onSelectionDrag:$,onSelectionDragStart:j,onSelectionDragStop:G,noPanClassName:q,nodeOrigin:Z,rfId:ee,autoPanOnConnect:ie,autoPanOnNodeDrag:se,onError:le,connectionRadius:W,isValidConnection:ne})=>{const{setNodes:fe,setEdges:pe,setDefaultNodesAndEdges:ve,setMinZoom:ye,setMaxZoom:Je,setTranslateExtent:Fe,setNodeExtent:Ae,reset:vt}=Gn(Vme,Bi),_e=ii();return L.useEffect(()=>{const Qt=r==null?void 0:r.map(rr=>({...rr,...O}));return ve(n,Qt),()=>{vt()}},[]),mt("defaultEdgeOptions",O,_e.setState),mt("connectionMode",C,_e.setState),mt("onConnect",i,_e.setState),mt("onConnectStart",o,_e.setState),mt("onConnectEnd",s,_e.setState),mt("onClickConnectStart",a,_e.setState),mt("onClickConnectEnd",l,_e.setState),mt("nodesDraggable",u,_e.setState),mt("nodesConnectable",d,_e.setState),mt("nodesFocusable",f,_e.setState),mt("edgesFocusable",h,_e.setState),mt("edgesUpdatable",g,_e.setState),mt("elementsSelectable",S,_e.setState),mt("elevateNodesOnSelect",m,_e.setState),mt("snapToGrid",E,_e.setState),mt("snapGrid",T,_e.setState),mt("onNodesChange",b,_e.setState),mt("onEdgesChange",y,_e.setState),mt("connectOnClick",k,_e.setState),mt("fitViewOnInit",M,_e.setState),mt("fitViewOnInitOptions",V,_e.setState),mt("onNodesDelete",B,_e.setState),mt("onEdgesDelete",A,_e.setState),mt("onNodeDrag",N,_e.setState),mt("onNodeDragStart",D,_e.setState),mt("onNodeDragStop",U,_e.setState),mt("onSelectionDrag",$,_e.setState),mt("onSelectionDragStart",j,_e.setState),mt("onSelectionDragStop",G,_e.setState),mt("noPanClassName",q,_e.setState),mt("nodeOrigin",Z,_e.setState),mt("rfId",ee,_e.setState),mt("autoPanOnConnect",ie,_e.setState),mt("autoPanOnNodeDrag",se,_e.setState),mt("onError",le,_e.setState),mt("connectionRadius",W,_e.setState),mt("isValidConnection",ne,_e.setState),md(e,fe),md(t,pe),md(v,ye),md(x,Je),md(P,Fe),md(_,Ae),null},iO={display:"none"},Gme={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},FB="react-flow__node-desc",BB="react-flow__edge-desc",Hme="react-flow__aria-live",Wme=e=>e.ariaLiveMessage;function qme({rfId:e}){const t=Gn(Wme);return ue.jsx("div",{id:`${Hme}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Gme,children:t})}function Kme({rfId:e,disableKeyboardA11y:t}){return ue.jsxs(ue.Fragment,{children:[ue.jsxs("div",{id:`${FB}-${e}`,style:iO,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."," "]}),ue.jsx("div",{id:`${BB}-${e}`,style:iO,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&ue.jsx(qme,{rfId:e})]})}const Xme=(e,t,n)=>n===Ue.Left?e-t:n===Ue.Right?e+t:e,Yme=(e,t,n)=>n===Ue.Top?e-t:n===Ue.Bottom?e+t:e,oO="react-flow__edgeupdater",sO=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:s,type:a})=>ue.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:s,className:$o([oO,`${oO}-${a}`]),cx:Xme(t,r,e),cy:Yme(n,r,e),r,stroke:"transparent",fill:"transparent"}),Qme=()=>!0;var yd=e=>{const t=({id:n,className:r,type:i,data:o,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:v,style:x,source:_,target:b,sourceX:y,sourceY:S,targetX:C,targetY:T,sourcePosition:E,targetPosition:P,elementsSelectable:k,hidden:O,sourceHandleId:M,targetHandleId:V,onContextMenu:B,onMouseEnter:A,onMouseMove:N,onMouseLeave:D,edgeUpdaterRadius:U,onEdgeUpdate:$,onEdgeUpdateStart:j,onEdgeUpdateEnd:G,markerEnd:q,markerStart:Z,rfId:ee,ariaLabel:ie,isFocusable:se,isUpdatable:le,pathOptions:W,interactionWidth:ne})=>{const fe=L.useRef(null),[pe,ve]=L.useState(!1),[ye,Je]=L.useState(!1),Fe=ii(),Ae=L.useMemo(()=>`url(#${i5(Z,ee)})`,[Z,ee]),vt=L.useMemo(()=>`url(#${i5(q,ee)})`,[q,ee]);if(O)return null;const _e=mn=>{const{edges:Zt,addSelectedEdges:Rr}=Fe.getState();if(k&&(Fe.setState({nodesSelectionActive:!1}),Rr([n])),s){const Hr=Zt.find(si=>si.id===n);s(mn,Hr)}},Qt=ap(n,Fe.getState,a),rr=ap(n,Fe.getState,B),qt=ap(n,Fe.getState,A),ht=ap(n,Fe.getState,N),At=ap(n,Fe.getState,D),un=(mn,Zt)=>{if(mn.button!==0)return;const{edges:Rr,isValidConnection:Hr}=Fe.getState(),si=Zt?b:_,Vi=(Zt?V:M)||null,$n=Zt?"target":"source",ai=Hr||Qme,ra=Zt,uo=Rr.find(Ft=>Ft.id===n);Je(!0),j==null||j(mn,uo,$n);const ia=Ft=>{Je(!1),G==null||G(Ft,uo,$n)};OB({event:mn,handleId:Vi,nodeId:si,onConnect:Ft=>$==null?void 0:$(uo,Ft),isTarget:ra,getState:Fe.getState,setState:Fe.setState,isValidConnection:ai,edgeUpdaterType:$n,onEdgeUpdateEnd:ia})},Gr=mn=>un(mn,!0),Pr=mn=>un(mn,!1),Ci=()=>ve(!0),In=()=>ve(!1),gn=!k&&!s,ir=mn=>{var Zt;if(mB.includes(mn.key)&&k){const{unselectNodesAndEdges:Rr,addSelectedEdges:Hr,edges:si}=Fe.getState();mn.key==="Escape"?((Zt=fe.current)==null||Zt.blur(),Rr({edges:[si.find($n=>$n.id===n)]})):Hr([n])}};return ue.jsxs("g",{className:$o(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:gn,updating:pe}]),onClick:_e,onDoubleClick:Qt,onContextMenu:rr,onMouseEnter:qt,onMouseMove:ht,onMouseLeave:At,onKeyDown:se?ir:void 0,tabIndex:se?0:void 0,role:se?"button":void 0,"data-testid":`rf__edge-${n}`,"aria-label":ie===null?void 0:ie||`Edge from ${_} to ${b}`,"aria-describedby":se?`${BB}-${ee}`:void 0,ref:fe,children:[!ye&&ue.jsx(e,{id:n,source:_,target:b,selected:l,animated:u,label:d,labelStyle:f,labelShowBg:h,labelBgStyle:g,labelBgPadding:m,labelBgBorderRadius:v,data:o,style:x,sourceX:y,sourceY:S,targetX:C,targetY:T,sourcePosition:E,targetPosition:P,sourceHandleId:M,targetHandleId:V,markerStart:Ae,markerEnd:vt,pathOptions:W,interactionWidth:ne}),le&&ue.jsxs(ue.Fragment,{children:[(le==="source"||le===!0)&&ue.jsx(sO,{position:E,centerX:y,centerY:S,radius:U,onMouseDown:Gr,onMouseEnter:Ci,onMouseOut:In,type:"source"}),(le==="target"||le===!0)&&ue.jsx(sO,{position:P,centerX:C,centerY:T,radius:U,onMouseDown:Pr,onMouseEnter:Ci,onMouseOut:In,type:"target"})]})]})};return t.displayName="EdgeWrapper",L.memo(t)};function Zme(e){const t={default:yd(e.default||J1),straight:yd(e.bezier||hE),step:yd(e.step||fE),smoothstep:yd(e.step||Wb),simplebezier:yd(e.simplebezier||dE)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=yd(e[o]||J1),i),n);return{...t,...r}}function aO(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case Ue.Top:return{x:r+o/2,y:i};case Ue.Right:return{x:r+o,y:i+s/2};case Ue.Bottom:return{x:r+o/2,y:i+s};case Ue.Left:return{x:r,y:i+s/2}}}function lO(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Jme=(e,t,n,r,i,o)=>{const s=aO(n,e,t),a=aO(o,r,i);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function eye({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,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+i),y2:Math.max(e.y+r,t.y+o)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const d=Q1({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(d.x2,u.x2)-Math.max(d.x,u.x)),h=Math.max(0,Math.min(d.y2,u.y2)-Math.max(d.y,u.y));return Math.ceil(f*h)>0}function uO(e){var r,i,o,s,a;const t=((r=e==null?void 0:e[pr])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.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 UB(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:UB(n,t):!1}function cO(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 tye(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!UB(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,s;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((s=i.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height}})}function nye(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function zB(e,t,n,r,i=[0,0],o){const s=nye(e,e.extent||r);let a=s;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const d=n.get(e.parentNode),{x:f,y:h}=mf(d,i).positionAbsolute;a=d&&Ro(f)&&Ro(h)&&Ro(d.width)&&Ro(d.height)?[[f+e.width*i[0],h+e.height*i[1]],[f+d.width-e.width+e.width*i[0],h+d.height-e.height+e.height*i[1]]]:a}else o==null||o("005",ou.error005()),a=s;else if(e.extent&&e.parentNode){const d=n.get(e.parentNode),{x:f,y:h}=mf(d,i).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+h],[e.extent[1][0]+f,e.extent[1][1]+h]]}let l={x:0,y:0};if(e.parentNode){const d=n.get(e.parentNode);l=mf(d,i).positionAbsolute}const u=a?cE(t,a):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function Ix({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const dO=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return o.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,...uE(l)}})};function lp(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);n(r,{...i})}}function s5({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:s,nodeInternals:a}=t.getState(),l=a.get(e);t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(o({nodes:[l]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([e])}function rye(){const e=ii();return L.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=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:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function Mx(e){return(t,n,r)=>e==null?void 0:e(t,r)}function VB({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:s}){const a=ii(),[l,u]=L.useState(!1),d=L.useRef([]),f=L.useRef({x:null,y:null}),h=L.useRef(0),g=L.useRef(null),m=L.useRef({x:0,y:0}),v=L.useRef(null),x=L.useRef(!1),_=rye();return L.useEffect(()=>{if(e!=null&&e.current){const b=rs(e.current),y=({x:C,y:T})=>{const{nodeInternals:E,onNodeDrag:P,onSelectionDrag:k,updateNodePositions:O,nodeExtent:M,snapGrid:V,snapToGrid:B,nodeOrigin:A,onError:N}=a.getState();f.current={x:C,y:T};let D=!1;if(d.current=d.current.map($=>{const j={x:C-$.distance.x,y:T-$.distance.y};B&&(j.x=V[0]*Math.round(j.x/V[0]),j.y=V[1]*Math.round(j.y/V[1]));const G=zB($,j,E,M,A,N);return D=D||$.position.x!==G.position.x||$.position.y!==G.position.y,$.position=G.position,$.positionAbsolute=G.positionAbsolute,$}),!D)return;O(d.current,!0,!0),u(!0);const U=i?P:Mx(k);if(U&&v.current){const[$,j]=Ix({nodeId:i,dragItems:d.current,nodeInternals:E});U(v.current,$,j)}},S=()=>{if(!g.current)return;const[C,T]=fB(m.current,g.current);if(C!==0||T!==0){const{transform:E,panBy:P}=a.getState();f.current.x=(f.current.x??0)-C/E[2],f.current.y=(f.current.y??0)-T/E[2],P({x:C,y:T})&&y(f.current)}h.current=requestAnimationFrame(S)};if(t)b.on(".drag",null);else{const C=wpe().on("start",T=>{var D;const{nodeInternals:E,multiSelectionActive:P,domNode:k,nodesDraggable:O,unselectNodesAndEdges:M,onNodeDragStart:V,onSelectionDragStart:B}=a.getState(),A=i?V:Mx(B);!s&&!P&&i&&((D=E.get(i))!=null&&D.selected||M()),i&&o&&s&&s5({id:i,store:a,nodeRef:e});const N=_(T);if(f.current=N,d.current=tye(E,O,N,i),A&&d.current){const[U,$]=Ix({nodeId:i,dragItems:d.current,nodeInternals:E});A(T.sourceEvent,U,$)}g.current=(k==null?void 0:k.getBoundingClientRect())||null,m.current=Wl(T.sourceEvent,g.current)}).on("drag",T=>{const E=_(T),{autoPanOnNodeDrag:P}=a.getState();!x.current&&P&&(x.current=!0,S()),(f.current.x!==E.xSnapped||f.current.y!==E.ySnapped)&&d.current&&(v.current=T.sourceEvent,m.current=Wl(T.sourceEvent,g.current),y(E))}).on("end",T=>{if(u(!1),x.current=!1,cancelAnimationFrame(h.current),d.current){const{updateNodePositions:E,nodeInternals:P,onNodeDragStop:k,onSelectionDragStop:O}=a.getState(),M=i?k:Mx(O);if(E(d.current,!1,!1),M){const[V,B]=Ix({nodeId:i,dragItems:d.current,nodeInternals:P});M(T.sourceEvent,V,B)}}}).filter(T=>{const E=T.target;return!T.button&&(!n||!cO(E,`.${n}`,e))&&(!r||cO(E,r,e))});return b.call(C),()=>{b.on(".drag",null)}}}},[e,t,n,r,o,a,i,s,_]),l}function jB(){const e=ii();return L.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:d}=e.getState(),f=s().filter(b=>b.selected&&(b.draggable||d&&typeof b.draggable>"u")),h=a?l[0]:5,g=a?l[1]:5,m=n.isShiftPressed?4:1,v=n.x*h*m,x=n.y*g*m,_=f.map(b=>{if(b.positionAbsolute){const y={x:b.positionAbsolute.x+v,y:b.positionAbsolute.y+x};a&&(y.x=l[0]*Math.round(y.x/l[0]),y.y=l[1]*Math.round(y.y/l[1]));const{positionAbsolute:S,position:C}=zB(b,y,r,i,void 0,u);b.position=C,b.positionAbsolute=S}return b});o(_,!0,!1)},[])}const yf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var up=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:d,onMouseEnter:f,onMouseMove:h,onMouseLeave:g,onContextMenu:m,onDoubleClick:v,style:x,className:_,isDraggable:b,isSelectable:y,isConnectable:S,isFocusable:C,selectNodesOnDrag:T,sourcePosition:E,targetPosition:P,hidden:k,resizeObserver:O,dragHandle:M,zIndex:V,isParent:B,noDragClassName:A,noPanClassName:N,initialized:D,disableKeyboardA11y:U,ariaLabel:$,rfId:j})=>{const G=ii(),q=L.useRef(null),Z=L.useRef(E),ee=L.useRef(P),ie=L.useRef(r),se=y||b||d||f||h||g,le=jB(),W=lp(n,G.getState,f),ne=lp(n,G.getState,h),fe=lp(n,G.getState,g),pe=lp(n,G.getState,m),ve=lp(n,G.getState,v),ye=Ae=>{if(y&&(!T||!b)&&s5({id:n,store:G,nodeRef:q}),d){const vt=G.getState().nodeInternals.get(n);d(Ae,{...vt})}},Je=Ae=>{if(!n5(Ae))if(mB.includes(Ae.key)&&y){const vt=Ae.key==="Escape";s5({id:n,store:G,unselect:vt,nodeRef:q})}else!U&&b&&u&&Object.prototype.hasOwnProperty.call(yf,Ae.key)&&(G.setState({ariaLiveMessage:`Moved selected node ${Ae.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~s}`}),le({x:yf[Ae.key].x,y:yf[Ae.key].y,isShiftPressed:Ae.shiftKey}))};L.useEffect(()=>{if(q.current&&!k){const Ae=q.current;return O==null||O.observe(Ae),()=>O==null?void 0:O.unobserve(Ae)}},[k]),L.useEffect(()=>{const Ae=ie.current!==r,vt=Z.current!==E,_e=ee.current!==P;q.current&&(Ae||vt||_e)&&(Ae&&(ie.current=r),vt&&(Z.current=E),_e&&(ee.current=P),G.getState().updateNodeDimensions([{id:n,nodeElement:q.current,forceUpdate:!0}]))},[n,r,E,P]);const Fe=VB({nodeRef:q,disabled:k||!b,noDragClassName:A,handleSelector:M,nodeId:n,isSelectable:y,selectNodesOnDrag:T});return k?null:ue.jsx("div",{className:$o(["react-flow__node",`react-flow__node-${r}`,{[N]:b},_,{selected:u,selectable:y,parent:B,dragging:Fe}]),ref:q,style:{zIndex:V,transform:`translate(${a}px,${l}px)`,pointerEvents:se?"all":"none",visibility:D?"visible":"hidden",...x},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:W,onMouseMove:ne,onMouseLeave:fe,onContextMenu:pe,onClick:ye,onDoubleClick:ve,onKeyDown:C?Je:void 0,tabIndex:C?0:void 0,role:C?"button":void 0,"aria-describedby":U?void 0:`${FB}-${j}`,"aria-label":$,children:ue.jsx(Eme,{value:n,children:ue.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:s,selected:u,isConnectable:S,sourcePosition:E,targetPosition:P,dragging:Fe,dragHandle:M,zIndex:V})})})};return t.displayName="NodeWrapper",L.memo(t)};function iye(e){const t={input:up(e.input||NB),default:up(e.default||o5),output:up(e.output||DB),group:up(e.group||mE)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=up(e[o]||o5),i),n);return{...t,...r}}const oye=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},sye=typeof document<"u"?document:null;var Wg=(e=null,t={target:sye})=>{const[n,r]=L.useState(!1),i=L.useRef(!1),o=L.useRef(new Set([])),[s,a]=L.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return L.useEffect(()=>{var l,u;if(e!==null){const d=g=>{if(i.current=g.ctrlKey||g.metaKey||g.shiftKey,!i.current&&n5(g))return!1;const m=hO(g.code,a);o.current.add(g[m]),fO(s,o.current,!1)&&(g.preventDefault(),r(!0))},f=g=>{if(!i.current&&n5(g))return!1;const m=hO(g.code,a);fO(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(g[m]),i.current=!1},h=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",d),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",f),window.addEventListener("blur",h),()=>{var g,m;(g=t==null?void 0:t.target)==null||g.removeEventListener("keydown",d),(m=t==null?void 0:t.target)==null||m.removeEventListener("keyup",f),window.removeEventListener("blur",h)}}},[e,r]),n};function fO(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function hO(e,t){return t.includes(e)?"code":"key"}function GB(e,t,n,r){var s,a;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=mf(i,r);return GB(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((s=i[pr])==null?void 0:s.z)??0)>(n.z??0)?((a=i[pr])==null?void 0:a.z)??0:n.z??0},r)}function HB(e,t,n){e.forEach(r=>{var i;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:o,y:s,z:a}=GB(r,e,{...r.position,z:((i=r[pr])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:s},r[pr].z=a,n!=null&&n[r.id]&&(r[pr].isParent=!0)}})}function Nx(e,t,n,r){const i=new Map,o={},s=r?1e3:0;return e.forEach(a=>{var f;const l=(Ro(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),d={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&&(d.parentNode=a.parentNode,o[a.parentNode]=!0),Object.defineProperty(d,pr,{enumerable:!1,value:{handleBounds:(f=u==null?void 0:u[pr])==null?void 0:f.handleBounds,z:l}}),i.set(a.id,d)}),HB(i,n,o),i}function WB(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:d,nodeOrigin:f}=e(),h=t.initial&&!u&&d;if(a&&l&&(h||!t.initial)){const m=n().filter(x=>{var b;const _=t.includeHiddenNodes?x.width&&x.height:!x.hidden;return(b=t.nodes)!=null&&b.length?_&&t.nodes.some(y=>y.id===x.id):_}),v=m.every(x=>x.width&&x.height);if(m.length>0&&v){const x=CB(m,f),[_,b,y]=AB(x,r,i,t.minZoom??o,t.maxZoom??s,t.padding??.1),S=Hl.translate(_,b).scale(y);return typeof t.duration=="number"&&t.duration>0?a.transform(Vu(l,t.duration),S):a.transform(l,S),!0}}return!1}function aye(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[pr]:r[pr],selected:n.selected})}),new Map(t)}function lye(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function z0({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:aye(e,i)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:lye(t,o)}),a==null||a(t))}const vd=()=>{},uye={zoomIn:vd,zoomOut:vd,zoomTo:vd,getZoom:()=>1,setViewport:vd,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:vd,fitBounds:vd,project:e=>e,viewportInitialized:!1},cye=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),dye=()=>{const e=ii(),{d3Zoom:t,d3Selection:n}=Gn(cye,Bi);return L.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Vu(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Vu(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Vu(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[s,a,l]=e.getState().transform,u=Hl.translate(i.x??s,i.y??a).scale(i.zoom??l);t.transform(Vu(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,s]=e.getState().transform;return{x:i,y:o,zoom:s}},fitView:i=>WB(e.getState,i),setCenter:(i,o,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=a/2-i*d,h=l/2-o*d,g=Hl.translate(f,h).scale(d);t.transform(Vu(n,s==null?void 0:s.duration),g)},fitBounds:(i,o)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),[d,f,h]=AB(i,s,a,l,u,(o==null?void 0:o.padding)??.1),g=Hl.translate(d,f).scale(h);t.transform(Vu(n,o==null?void 0:o.duration),g)},project:i=>{const{transform:o,snapToGrid:s,snapGrid:a}=e.getState();return xB(i,o,s,a)},viewportInitialized:!0}:uye,[t,n])};function qB(){const e=dye(),t=ii(),n=L.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=L.useCallback(v=>t.getState().nodeInternals.get(v),[]),i=L.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(x=>({...x}))},[]),o=L.useCallback(v=>{const{edges:x=[]}=t.getState();return x.find(_=>_.id===v)},[]),s=L.useCallback(v=>{const{getNodes:x,setNodes:_,hasDefaultNodes:b,onNodesChange:y}=t.getState(),S=x(),C=typeof v=="function"?v(S):v;if(b)_(C);else if(y){const T=C.length===0?S.map(E=>({type:"remove",id:E.id})):C.map(E=>({item:E,type:"reset"}));y(T)}},[]),a=L.useCallback(v=>{const{edges:x=[],setEdges:_,hasDefaultEdges:b,onEdgesChange:y}=t.getState(),S=typeof v=="function"?v(x):v;if(b)_(S);else if(y){const C=S.length===0?x.map(T=>({type:"remove",id:T.id})):S.map(T=>({item:T,type:"reset"}));y(C)}},[]),l=L.useCallback(v=>{const x=Array.isArray(v)?v:[v],{getNodes:_,setNodes:b,hasDefaultNodes:y,onNodesChange:S}=t.getState();if(y){const T=[..._(),...x];b(T)}else if(S){const C=x.map(T=>({item:T,type:"add"}));S(C)}},[]),u=L.useCallback(v=>{const x=Array.isArray(v)?v:[v],{edges:_=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:S}=t.getState();if(y)b([..._,...x]);else if(S){const C=x.map(T=>({item:T,type:"add"}));S(C)}},[]),d=L.useCallback(()=>{const{getNodes:v,edges:x=[],transform:_}=t.getState(),[b,y,S]=_;return{nodes:v().map(C=>({...C})),edges:x.map(C=>({...C})),viewport:{x:b,y,zoom:S}}},[]),f=L.useCallback(({nodes:v,edges:x})=>{const{nodeInternals:_,getNodes:b,edges:y,hasDefaultNodes:S,hasDefaultEdges:C,onNodesDelete:T,onEdgesDelete:E,onNodesChange:P,onEdgesChange:k}=t.getState(),O=(v||[]).map(N=>N.id),M=(x||[]).map(N=>N.id),V=b().reduce((N,D)=>{const U=!O.includes(D.id)&&D.parentNode&&N.find(j=>j.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(O.includes(D.id)||U)&&N.push(D),N},[]),B=y.filter(N=>typeof N.deletable=="boolean"?N.deletable:!0),A=B.filter(N=>M.includes(N.id));if(V||A){const N=EB(V,B),D=[...A,...N],U=D.reduce(($,j)=>($.includes(j.id)||$.push(j.id),$),[]);if((C||S)&&(C&&t.setState({edges:y.filter($=>!U.includes($.id))}),S&&(V.forEach($=>{_.delete($.id)}),t.setState({nodeInternals:new Map(_)}))),U.length>0&&(E==null||E(D),k&&k(U.map($=>({id:$,type:"remove"})))),V.length>0&&(T==null||T(V),P)){const $=V.map(j=>({id:j.id,type:"remove"}));P($)}}},[]),h=L.useCallback(v=>{const x=_me(v),_=x?null:t.getState().nodeInternals.get(v.id);return[x?v:QR(_),_,x]},[]),g=L.useCallback((v,x=!0,_)=>{const[b,y,S]=h(v);return b?(_||t.getState().getNodes()).filter(C=>{if(!S&&(C.id===y.id||!C.positionAbsolute))return!1;const T=QR(C),E=t5(T,b);return x&&E>0||E>=v.width*v.height}):[]},[]),m=L.useCallback((v,x,_=!0)=>{const[b]=h(v);if(!b)return!1;const y=t5(b,x);return _&&y>0||y>=v.width*v.height},[]);return L.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:d,deleteElements:f,getIntersectingNodes:g,isNodeIntersecting:m}),[e,n,r,i,o,s,a,l,u,d,f,g,m])}var fye=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ii(),{deleteElements:r}=qB(),i=Wg(e),o=Wg(t);L.useEffect(()=>{if(i){const{edges:s,getNodes:a}=n.getState(),l=a().filter(d=>d.selected),u=s.filter(d=>d.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),L.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function hye(e){const t=ii();L.useEffect(()=>{let n;const r=()=>{var o,s;if(!e.current)return;const i=uE(e.current);(i.height===0||i.width===0)&&((s=(o=t.getState()).onError)==null||s.call(o,"004",ou.error004())),t.setState({width:i.width||500,height:i.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 yE={position:"absolute",width:"100%",height:"100%",top:0,left:0},pye=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Lx=e=>({x:e.x,y:e.y,zoom:e.k}),_d=(e,t)=>e.target.closest(`.${t}`),pO=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),gye=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),mye=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=gf.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:h,translateExtent:g,minZoom:m,maxZoom:v,zoomActivationKeyCode:x,preventScrolling:_=!0,children:b,noWheelClassName:y,noPanClassName:S})=>{const C=L.useRef(),T=ii(),E=L.useRef(!1),P=L.useRef(!1),k=L.useRef(null),O=L.useRef({x:0,y:0,zoom:0}),{d3Zoom:M,d3Selection:V,d3ZoomHandler:B,userSelectionActive:A}=Gn(gye,Bi),N=Wg(x),D=L.useRef(0);return hye(k),L.useEffect(()=>{if(k.current){const U=k.current.getBoundingClientRect(),$=fme().scaleExtent([m,v]).translateExtent(g),j=rs(k.current).call($),G=Hl.translate(h.x,h.y).scale(Uf(h.zoom,m,v)),q=[[0,0],[U.width,U.height]],Z=$.constrain()(G,q,g);$.transform(j,Z),T.setState({d3Zoom:$,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:k.current.closest(".react-flow")})}},[]),L.useEffect(()=>{V&&M&&(s&&!N&&!A?V.on("wheel.zoom",U=>{if(_d(U,y))return!1;U.preventDefault(),U.stopImmediatePropagation();const $=V.property("__zoom").k||1;if(U.ctrlKey&&o){const Z=Rs(U),ee=-U.deltaY*(U.deltaMode===1?.05:U.deltaMode?1:.002)*10,ie=$*Math.pow(2,ee);M.scaleTo(V,ie,Z);return}const j=U.deltaMode===1?20:1,G=l===gf.Vertical?0:U.deltaX*j,q=l===gf.Horizontal?0:U.deltaY*j;M.translateBy(V,-(G/$)*a,-(q/$)*a)},{passive:!1}):typeof B<"u"&&V.on("wheel.zoom",function(U,$){if(!_||_d(U,y))return null;U.preventDefault(),B.call(this,U,$)},{passive:!1}))},[A,s,l,V,M,B,N,o,_,y]),L.useEffect(()=>{M&&M.on("start",U=>{var j;if(!U.sourceEvent)return null;D.current=U.sourceEvent.button;const{onViewportChangeStart:$}=T.getState();if(E.current=!0,((j=U.sourceEvent)==null?void 0:j.type)==="mousedown"&&T.setState({paneDragging:!0}),t||$){const G=Lx(U.transform);O.current=G,$==null||$(G),t==null||t(U.sourceEvent,G)}})},[M,t]),L.useEffect(()=>{M&&(A&&!E.current?M.on("zoom",null):A||M.on("zoom",U=>{const{onViewportChange:$}=T.getState();if(T.setState({transform:[U.transform.x,U.transform.y,U.transform.k]}),P.current=!!(r&&pO(f,D.current??0)),e||$){const j=Lx(U.transform);$==null||$(j),e==null||e(U.sourceEvent,j)}}))},[A,M,e,f,r]),L.useEffect(()=>{M&&M.on("end",U=>{if(!U.sourceEvent)return null;const{onViewportChangeEnd:$}=T.getState();if(E.current=!1,T.setState({paneDragging:!1}),r&&pO(f,D.current??0)&&!P.current&&r(U.sourceEvent),P.current=!1,(n||$)&&pye(O.current,U.transform)){const j=Lx(U.transform);O.current=j,clearTimeout(C.current),C.current=setTimeout(()=>{$==null||$(j),n==null||n(U.sourceEvent,j)},s?150:0)}})},[M,s,f,n,r]),L.useEffect(()=>{M&&M.filter(U=>{const $=N||i,j=o&&U.ctrlKey;if(U.button===1&&U.type==="mousedown"&&(_d(U,"react-flow__node")||_d(U,"react-flow__edge")))return!0;if(!f&&!$&&!s&&!u&&!o||A||!u&&U.type==="dblclick"||_d(U,y)&&U.type==="wheel"||_d(U,S)&&U.type!=="wheel"||!o&&U.ctrlKey&&U.type==="wheel"||!$&&!s&&!j&&U.type==="wheel"||!f&&(U.type==="mousedown"||U.type==="touchstart")||Array.isArray(f)&&!f.includes(U.button)&&(U.type==="mousedown"||U.type==="touchstart"))return!1;const G=Array.isArray(f)&&f.includes(U.button)||!U.button||U.button<=1;return(!U.ctrlKey||U.type==="wheel")&&G})},[A,M,i,o,s,u,f,d,N]),ue.jsx("div",{className:"react-flow__renderer",ref:k,style:yE,children:b})},yye=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function vye(){const{userSelectionActive:e,userSelectionRect:t}=Gn(yye,Bi);return e&&t?ue.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function gO(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>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),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function KB(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,i)=>{const o=e.filter(a=>a.id===i.id);if(o.length===0)return r.push(i),r;const s={...i};for(const a of o)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&&gO(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&&gO(r,s);break}case"remove":return r}return r.push(s),r},n)}function XB(e,t){return KB(e,t)}function _ye(e,t){return KB(e,t)}const Cl=(e,t)=>({id:e,type:"select",selected:t});function qd(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Cl(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Cl(r.id,!1))),n},[])}const Dx=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},bye=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),YB=L.memo(({isSelecting:e,selectionMode:t=Hg.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:d,children:f})=>{const h=L.useRef(null),g=ii(),m=L.useRef(0),v=L.useRef(0),x=L.useRef(),{userSelectionActive:_,elementsSelectable:b,dragging:y}=Gn(bye,Bi),S=()=>{g.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,v.current=0},C=B=>{o==null||o(B),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},T=B=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){B.preventDefault();return}s==null||s(B)},E=a?B=>a(B):void 0,P=B=>{const{resetSelectedElements:A,domNode:N}=g.getState();if(x.current=N==null?void 0:N.getBoundingClientRect(),!b||!e||B.button!==0||B.target!==h.current||!x.current)return;const{x:D,y:U}=Wl(B,x.current);A(),g.setState({userSelectionRect:{width:0,height:0,startX:D,startY:U,x:D,y:U}}),r==null||r(B)},k=B=>{const{userSelectionRect:A,nodeInternals:N,edges:D,transform:U,onNodesChange:$,onEdgesChange:j,nodeOrigin:G,getNodes:q}=g.getState();if(!e||!x.current||!A)return;g.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Z=Wl(B,x.current),ee=A.startX??0,ie=A.startY??0,se={...A,x:Z.x<ee?Z.x:ee,y:Z.y<ie?Z.y:ie,width:Math.abs(Z.x-ee),height:Math.abs(Z.y-ie)},le=q(),W=TB(N,se,U,t===Hg.Partial,!0,G),ne=EB(W,D).map(pe=>pe.id),fe=W.map(pe=>pe.id);if(m.current!==fe.length){m.current=fe.length;const pe=qd(le,fe);pe.length&&($==null||$(pe))}if(v.current!==ne.length){v.current=ne.length;const pe=qd(D,ne);pe.length&&(j==null||j(pe))}g.setState({userSelectionRect:se})},O=B=>{if(B.button!==0)return;const{userSelectionRect:A}=g.getState();!_&&A&&B.target===h.current&&(C==null||C(B)),g.setState({nodesSelectionActive:m.current>0}),S(),i==null||i(B)},M=B=>{_&&(g.setState({nodesSelectionActive:m.current>0}),i==null||i(B)),S()},V=b&&(e||_);return ue.jsxs("div",{className:$o(["react-flow__pane",{dragging:y,selection:e}]),onClick:V?void 0:Dx(C,h),onContextMenu:Dx(T,h),onWheel:Dx(E,h),onMouseEnter:V?void 0:l,onMouseDown:V?P:void 0,onMouseMove:V?k:u,onMouseUp:V?O:void 0,onMouseLeave:V?M:d,ref:h,style:yE,children:[f,ue.jsx(vye,{})]})});YB.displayName="Pane";const Sye=e=>{const t=e.getNodes().filter(n=>n.selected);return{...CB(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function wye({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ii(),{width:i,height:o,x:s,y:a,transformString:l,userSelectionActive:u}=Gn(Sye,Bi),d=jB(),f=L.useRef(null);if(L.useEffect(()=>{var m;n||(m=f.current)==null||m.focus({preventScroll:!0})},[n]),VB({nodeRef:f}),u||!i||!o)return null;const h=e?m=>{const v=r.getState().getNodes().filter(x=>x.selected);e(m,v)}:void 0,g=m=>{Object.prototype.hasOwnProperty.call(yf,m.key)&&d({x:yf[m.key].x,y:yf[m.key].y,isShiftPressed:m.shiftKey})};return ue.jsx("div",{className:$o(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:ue.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:o,top:a,left:s}})})}var xye=L.memo(wye);const Cye=e=>e.nodesSelectionActive,QB=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:h,selectionMode:g,onSelectionStart:m,onSelectionEnd:v,multiSelectionKeyCode:x,panActivationKeyCode:_,zoomActivationKeyCode:b,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:C,panOnScroll:T,panOnScrollSpeed:E,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:O,defaultViewport:M,translateExtent:V,minZoom:B,maxZoom:A,preventScrolling:N,onSelectionContextMenu:D,noWheelClassName:U,noPanClassName:$,disableKeyboardA11y:j})=>{const G=Gn(Cye),q=Wg(f),ee=Wg(_)||O,ie=q||h&&ee!==!0;return fye({deleteKeyCode:a,multiSelectionKeyCode:x}),ue.jsx(mye,{onMove:l,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:o,elementsSelectable:y,zoomOnScroll:S,zoomOnPinch:C,panOnScroll:T,panOnScrollSpeed:E,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:!q&&ee,defaultViewport:M,translateExtent:V,minZoom:B,maxZoom:A,zoomActivationKeyCode:b,preventScrolling:N,noWheelClassName:U,noPanClassName:$,children:ue.jsxs(YB,{onSelectionStart:m,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:ee,isSelecting:!!ie,selectionMode:g,children:[e,G&&ue.jsx(xye,{onSelectionContextMenu:D,noPanClassName:$,disableKeyboardA11y:j})]})})};QB.displayName="FlowRenderer";var Tye=L.memo(QB);function Eye(e){return Gn(L.useCallback(n=>e?TB(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}const Aye=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ZB=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:s}=Gn(Aye,Bi),a=Eye(e.onlyRenderVisibleElements),l=L.useRef(),u=L.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const h=f.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));o(h)});return l.current=d,d},[]);return L.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),ue.jsx("div",{className:"react-flow__nodes",style:yE,children:a.map(d=>{var C,T;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",ou.error003(f)),f="default");const h=e.nodeTypes[f]||e.nodeTypes.default,g=!!(d.draggable||t&&typeof d.draggable>"u"),m=!!(d.selectable||i&&typeof d.selectable>"u"),v=!!(d.connectable||n&&typeof d.connectable>"u"),x=!!(d.focusable||r&&typeof d.focusable>"u"),_=e.nodeExtent?cE(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,b=(_==null?void 0:_.x)??0,y=(_==null?void 0:_.y)??0,S=oye({x:b,y,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return ue.jsx(h,{id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||Ue.Bottom,targetPosition:d.targetPosition||Ue.Top,hidden:d.hidden,xPos:b,yPos:y,xPosOrigin:S.x,yPosOrigin:S.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:g,isSelectable:m,isConnectable:v,isFocusable:x,resizeObserver:u,dragHandle:d.dragHandle,zIndex:((C=d[pr])==null?void 0:C.z)??0,isParent:!!((T=d[pr])!=null&&T.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};ZB.displayName="NodeRenderer";var Pye=L.memo(ZB);const Rye=[{level:0,isMaxLevel:!0,edges:[]}];function Oye(e,t,n=!1){let r=-1;const i=e.reduce((s,a)=>{var d,f;const l=Ro(a.zIndex);let u=l?a.zIndex:0;if(n){const h=t.get(a.target),g=t.get(a.source),m=a.selected||(h==null?void 0:h.selected)||(g==null?void 0:g.selected),v=Math.max(((d=g==null?void 0:g[pr])==null?void 0:d.z)||0,((f=h==null?void 0:h[pr])==null?void 0:f.z)||0,1e3);u=(l?a.zIndex:0)+(m?v:0)}return s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),o=Object.entries(i).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return o.length===0?Rye:o}function kye(e,t,n){const r=Gn(L.useCallback(i=>e?i.edges.filter(o=>{const s=t.get(o.source),a=t.get(o.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)&&eye({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:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return Oye(r,t,n)}const Iye=({color:e="none",strokeWidth:t=1})=>ue.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),Mye=({color:e="none",strokeWidth:t=1})=>ue.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),mO={[Z1.Arrow]:Iye,[Z1.ArrowClosed]:Mye};function Nye(e){const t=ii();return L.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(mO,e)?mO[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",ou.error009(e)),null)},[e])}const Lye=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Nye(t);return l?ue.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:ue.jsx(l,{color:n,strokeWidth:s})}):null},Dye=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=i5(s,t);r.includes(a)||(i.push({id:a,color:s.color||e,...s}),r.push(a))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},JB=({defaultColor:e,rfId:t})=>{const n=Gn(L.useCallback(Dye({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,s)=>o.id!==i[s].id)));return ue.jsx("defs",{children:n.map(r=>ue.jsx(Lye,{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))})};JB.displayName="MarkerDefinitions";var $ye=L.memo(JB);const Fye=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}),eU=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:d,onEdgeClick:f,edgeUpdaterRadius:h,onEdgeDoubleClick:g,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,children:x})=>{const{edgesFocusable:_,edgesUpdatable:b,elementsSelectable:y,width:S,height:C,connectionMode:T,nodeInternals:E,onError:P}=Gn(Fye,Bi),k=kye(t,E,n);return S?ue.jsxs(ue.Fragment,{children:[k.map(({level:O,edges:M,isMaxLevel:V})=>ue.jsxs("svg",{style:{zIndex:O},width:S,height:C,className:"react-flow__edges react-flow__container",children:[V&&ue.jsx($ye,{defaultColor:e,rfId:r}),ue.jsx("g",{children:M.map(B=>{const[A,N,D]=uO(E.get(B.source)),[U,$,j]=uO(E.get(B.target));if(!D||!j)return null;let G=B.type||"default";i[G]||(P==null||P("011",ou.error011(G)),G="default");const q=i[G]||i.default,Z=T===bc.Strict?$.target:($.target??[]).concat($.source??[]),ee=lO(N.source,B.sourceHandle),ie=lO(Z,B.targetHandle),se=(ee==null?void 0:ee.position)||Ue.Bottom,le=(ie==null?void 0:ie.position)||Ue.Top,W=!!(B.focusable||_&&typeof B.focusable>"u"),ne=typeof s<"u"&&(B.updatable||b&&typeof B.updatable>"u");if(!ee||!ie)return P==null||P("008",ou.error008(ee,B)),null;const{sourceX:fe,sourceY:pe,targetX:ve,targetY:ye}=Jme(A,ee,se,U,ie,le);return ue.jsx(q,{id:B.id,className:$o([B.className,o]),type:G,data:B.data,selected:!!B.selected,animated:!!B.animated,hidden:!!B.hidden,label:B.label,labelStyle:B.labelStyle,labelShowBg:B.labelShowBg,labelBgStyle:B.labelBgStyle,labelBgPadding:B.labelBgPadding,labelBgBorderRadius:B.labelBgBorderRadius,style:B.style,source:B.source,target:B.target,sourceHandleId:B.sourceHandle,targetHandleId:B.targetHandle,markerEnd:B.markerEnd,markerStart:B.markerStart,sourceX:fe,sourceY:pe,targetX:ve,targetY:ye,sourcePosition:se,targetPosition:le,elementsSelectable:y,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:u,onMouseLeave:d,onClick:f,edgeUpdaterRadius:h,onEdgeDoubleClick:g,onEdgeUpdateStart:m,onEdgeUpdateEnd:v,rfId:r,ariaLabel:B.ariaLabel,isFocusable:W,isUpdatable:ne,pathOptions:"pathOptions"in B?B.pathOptions:void 0,interactionWidth:B.interactionWidth},B.id)})})]},O)),x]}):null};eU.displayName="EdgeRenderer";var Bye=L.memo(eU);const Uye=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function zye({children:e}){const t=Gn(Uye);return ue.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function Vye(e){const t=qB(),n=L.useRef(!1);L.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const jye={[Ue.Left]:Ue.Right,[Ue.Right]:Ue.Left,[Ue.Top]:Ue.Bottom,[Ue.Bottom]:Ue.Top},tU=({nodeId:e,handleType:t,style:n,type:r=Ol.Bezier,CustomComponent:i,connectionStatus:o})=>{var T,E,P;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:d}=Gn(L.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),Bi),f=(T=s==null?void 0:s[pr])==null?void 0:T.handleBounds;let h=f==null?void 0:f[t];if(d===bc.Loose&&(h=h||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!h)return null;const g=a?h.find(k=>k.id===a):h[0],m=g?g.x+g.width/2:(s.width??0)/2,v=g?g.y+g.height/2:s.height??0,x=(((E=s.positionAbsolute)==null?void 0:E.x)??0)+m,_=(((P=s.positionAbsolute)==null?void 0:P.y)??0)+v,b=g==null?void 0:g.position,y=b?jye[b]:null;if(!b||!y)return null;if(i)return ue.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:g,fromX:x,fromY:_,toX:l,toY:u,fromPosition:b,toPosition:y,connectionStatus:o});let S="";const C={sourceX:x,sourceY:_,sourcePosition:b,targetX:l,targetY:u,targetPosition:y};return r===Ol.Bezier?[S]=SB(C):r===Ol.Step?[S]=r5({...C,borderRadius:0}):r===Ol.SmoothStep?[S]=r5(C):r===Ol.SimpleBezier?[S]=bB(C):S=`M${x},${_} ${l},${u}`,ue.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};tU.displayName="ConnectionLine";const Gye=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Hye({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:s,width:a,height:l,connectionStatus:u}=Gn(Gye,Bi);return!(i&&o&&a&&s)?null:ue.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:ue.jsx("g",{className:$o(["react-flow__connection",u]),children:ue.jsx(tU,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}const nU=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:v,onSelectionEnd:x,connectionLineType:_,connectionLineStyle:b,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:C,selectionOnDrag:T,selectionMode:E,multiSelectionKeyCode:P,panActivationKeyCode:k,zoomActivationKeyCode:O,deleteKeyCode:M,onlyRenderVisibleElements:V,elementsSelectable:B,selectNodesOnDrag:A,defaultViewport:N,translateExtent:D,minZoom:U,maxZoom:$,preventScrolling:j,defaultMarkerColor:G,zoomOnScroll:q,zoomOnPinch:Z,panOnScroll:ee,panOnScrollSpeed:ie,panOnScrollMode:se,zoomOnDoubleClick:le,panOnDrag:W,onPaneClick:ne,onPaneMouseEnter:fe,onPaneMouseMove:pe,onPaneMouseLeave:ve,onPaneScroll:ye,onPaneContextMenu:Je,onEdgeUpdate:Fe,onEdgeContextMenu:Ae,onEdgeMouseEnter:vt,onEdgeMouseMove:_e,onEdgeMouseLeave:Qt,edgeUpdaterRadius:rr,onEdgeUpdateStart:qt,onEdgeUpdateEnd:ht,noDragClassName:At,noWheelClassName:un,noPanClassName:Gr,elevateEdgesOnSelect:Pr,disableKeyboardA11y:Ci,nodeOrigin:In,nodeExtent:gn,rfId:ir})=>(Vye(o),ue.jsx(Tye,{onPaneClick:ne,onPaneMouseEnter:fe,onPaneMouseMove:pe,onPaneMouseLeave:ve,onPaneContextMenu:Je,onPaneScroll:ye,deleteKeyCode:M,selectionKeyCode:C,selectionOnDrag:T,selectionMode:E,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:P,panActivationKeyCode:k,zoomActivationKeyCode:O,elementsSelectable:B,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:q,zoomOnPinch:Z,zoomOnDoubleClick:le,panOnScroll:ee,panOnScrollSpeed:ie,panOnScrollMode:se,panOnDrag:W,defaultViewport:N,translateExtent:D,minZoom:U,maxZoom:$,onSelectionContextMenu:m,preventScrolling:j,noDragClassName:At,noWheelClassName:un,noPanClassName:Gr,disableKeyboardA11y:Ci,children:ue.jsxs(zye,{children:[ue.jsx(Bye,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:Fe,onlyRenderVisibleElements:V,onEdgeContextMenu:Ae,onEdgeMouseEnter:vt,onEdgeMouseMove:_e,onEdgeMouseLeave:Qt,onEdgeUpdateStart:qt,onEdgeUpdateEnd:ht,edgeUpdaterRadius:rr,defaultMarkerColor:G,noPanClassName:Gr,elevateEdgesOnSelect:!!Pr,disableKeyboardA11y:Ci,rfId:ir,children:ue.jsx(Hye,{style:b,type:_,component:y,containerStyle:S})}),ue.jsx("div",{className:"react-flow__edgelabel-renderer"}),ue.jsx(Pye,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,selectNodesOnDrag:A,onlyRenderVisibleElements:V,noPanClassName:Gr,noDragClassName:At,disableKeyboardA11y:Ci,nodeOrigin:In,nodeExtent:gn,rfId:ir})]})}));nU.displayName="GraphView";var Wye=L.memo(nU);const a5=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],yl={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:a5,nodeExtent:a5,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:bc.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:bme,isValidConnection:void 0},qye=()=>Ife((e,t)=>({...yl,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:Nx(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",s=i?Nx(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:h}=new window.DOMMatrixReadOnly(f.transform),g=n.reduce((v,x)=>{const _=i.get(x.id);if(_){const b=uE(x.nodeElement);!!(b.width&&b.height&&(_.width!==b.width||_.height!==b.height||x.forceUpdate))&&(i.set(_.id,{..._,[pr]:{..._[pr],handleBounds:{source:dO(".source",x.nodeElement,h,u),target:dO(".target",x.nodeElement,h,u)}},...b}),v.push({id:_.id,type:"dimensions",dimensions:b}))}return v},[]);HB(i,u);const m=s||o&&!s&&WB(t,{initial:!0,...a});e({nodeInternals:new Map(i),fitViewOnInitDone:m}),(g==null?void 0:g.length)>0&&(r==null||r(g))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:i};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});o(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const u=XB(n,a()),d=Nx(u,i,s,l);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>Cl(l,!0)):(s=qd(o(),n),a=qd(i,[])),z0({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let s,a=null;r?s=n.map(l=>Cl(l,!0)):(s=qd(i,n),a=qd(o(),[])),z0({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),s=n||o(),a=r||i,l=s.map(d=>(d.selected=!1,Cl(d.id,!1))),u=a.map(d=>Cl(d.id,!1));z0({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,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(),o=r().filter(a=>a.selected).map(a=>Cl(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Cl(a.id,!1));z0({changedNodes:o,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=cE(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const u=Hl.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[i,o]],f=s==null?void 0:s.constrain()(u,d,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:yl.connectionNodeId,connectionHandleId:yl.connectionHandleId,connectionHandleType:yl.connectionHandleType,connectionStatus:yl.connectionStatus,connectionStartHandle:yl.connectionStartHandle,connectionEndHandle:yl.connectionEndHandle}),reset:()=>e({...yl})})),rU=({children:e})=>{const t=L.useRef(null);return t.current||(t.current=qye()),ue.jsx(hme,{value:t.current,children:e})};rU.displayName="ReactFlowProvider";const iU=({children:e})=>L.useContext(Hb)?ue.jsx(ue.Fragment,{children:e}):ue.jsx(rU,{children:e});iU.displayName="ReactFlowWrapper";function yO(e,t){return L.useRef(null),L.useMemo(()=>t(e),[e])}const Kye={input:NB,default:o5,output:DB,group:mE},Xye={default:J1,straight:hE,step:fE,smoothstep:Wb,simplebezier:dE},Yye=[0,0],Qye=[15,15],Zye={x:0,y:0,zoom:1},Jye={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},e0e=L.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=Kye,edgeTypes:s=Xye,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:g,onConnectStart:m,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:_,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:T,onNodeDragStart:E,onNodeDrag:P,onNodeDragStop:k,onNodesDelete:O,onEdgesDelete:M,onSelectionChange:V,onSelectionDragStart:B,onSelectionDrag:A,onSelectionDragStop:N,onSelectionContextMenu:D,onSelectionStart:U,onSelectionEnd:$,connectionMode:j=bc.Strict,connectionLineType:G=Ol.Bezier,connectionLineStyle:q,connectionLineComponent:Z,connectionLineContainerStyle:ee,deleteKeyCode:ie="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:le=!1,selectionMode:W=Hg.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:fe="Meta",zoomActivationKeyCode:pe="Meta",snapToGrid:ve=!1,snapGrid:ye=Qye,onlyRenderVisibleElements:Je=!1,selectNodesOnDrag:Fe=!0,nodesDraggable:Ae,nodesConnectable:vt,nodesFocusable:_e,nodeOrigin:Qt=Yye,edgesFocusable:rr,edgesUpdatable:qt,elementsSelectable:ht,defaultViewport:At=Zye,minZoom:un=.5,maxZoom:Gr=2,translateExtent:Pr=a5,preventScrolling:Ci=!0,nodeExtent:In,defaultMarkerColor:gn="#b1b1b7",zoomOnScroll:ir=!0,zoomOnPinch:mn=!0,panOnScroll:Zt=!1,panOnScrollSpeed:Rr=.5,panOnScrollMode:Hr=gf.Free,zoomOnDoubleClick:si=!0,panOnDrag:Vi=!0,onPaneClick:$n,onPaneMouseEnter:ai,onPaneMouseMove:ra,onPaneMouseLeave:uo,onPaneScroll:ia,onPaneContextMenu:nn,children:Ft,onEdgeUpdate:or,onEdgeContextMenu:qn,onEdgeDoubleClick:yr,onEdgeMouseEnter:Or,onEdgeMouseMove:kr,onEdgeMouseLeave:co,onEdgeUpdateStart:Ir,onEdgeUpdateEnd:sr,edgeUpdaterRadius:ji=10,onNodesChange:bs,onEdgesChange:fo,noDragClassName:tl="nodrag",noWheelClassName:Vo="nowheel",noPanClassName:Mr="nopan",fitView:oa=!1,fitViewOptions:hh,connectOnClick:ph=!0,attributionPosition:gh,proOptions:mh,defaultEdgeOptions:jo,elevateNodesOnSelect:yh=!0,elevateEdgesOnSelect:vh=!1,disableKeyboardA11y:Gc=!1,autoPanOnConnect:_h=!0,autoPanOnNodeDrag:bh=!0,connectionRadius:Sh=20,isValidConnection:Ss,onError:wh,style:Go,id:nl,...xh},rl)=>{const Cu=yO(o,iye),Hc=yO(s,Zme),il=nl||"1";return ue.jsx("div",{...xh,style:{...Go,...Jye},ref:rl,className:$o(["react-flow",i]),"data-testid":"rf__wrapper",id:nl,children:ue.jsxs(iU,{children:[ue.jsx(Wye,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:S,onNodeContextMenu:C,onNodeDoubleClick:T,nodeTypes:Cu,edgeTypes:Hc,connectionLineType:G,connectionLineStyle:q,connectionLineComponent:Z,connectionLineContainerStyle:ee,selectionKeyCode:se,selectionOnDrag:le,selectionMode:W,deleteKeyCode:ie,multiSelectionKeyCode:fe,panActivationKeyCode:ne,zoomActivationKeyCode:pe,onlyRenderVisibleElements:Je,selectNodesOnDrag:Fe,defaultViewport:At,translateExtent:Pr,minZoom:un,maxZoom:Gr,preventScrolling:Ci,zoomOnScroll:ir,zoomOnPinch:mn,zoomOnDoubleClick:si,panOnScroll:Zt,panOnScrollSpeed:Rr,panOnScrollMode:Hr,panOnDrag:Vi,onPaneClick:$n,onPaneMouseEnter:ai,onPaneMouseMove:ra,onPaneMouseLeave:uo,onPaneScroll:ia,onPaneContextMenu:nn,onSelectionContextMenu:D,onSelectionStart:U,onSelectionEnd:$,onEdgeUpdate:or,onEdgeContextMenu:qn,onEdgeDoubleClick:yr,onEdgeMouseEnter:Or,onEdgeMouseMove:kr,onEdgeMouseLeave:co,onEdgeUpdateStart:Ir,onEdgeUpdateEnd:sr,edgeUpdaterRadius:ji,defaultMarkerColor:gn,noDragClassName:tl,noWheelClassName:Vo,noPanClassName:Mr,elevateEdgesOnSelect:vh,rfId:il,disableKeyboardA11y:Gc,nodeOrigin:Qt,nodeExtent:In}),ue.jsx(jme,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:m,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:_,nodesDraggable:Ae,nodesConnectable:vt,nodesFocusable:_e,edgesFocusable:rr,edgesUpdatable:qt,elementsSelectable:ht,elevateNodesOnSelect:yh,minZoom:un,maxZoom:Gr,nodeExtent:In,onNodesChange:bs,onEdgesChange:fo,snapToGrid:ve,snapGrid:ye,connectionMode:j,translateExtent:Pr,connectOnClick:ph,defaultEdgeOptions:jo,fitView:oa,fitViewOptions:hh,onNodesDelete:O,onEdgesDelete:M,onNodeDragStart:E,onNodeDrag:P,onNodeDragStop:k,onSelectionDrag:A,onSelectionDragStart:B,onSelectionDragStop:N,noPanClassName:Mr,nodeOrigin:Qt,rfId:il,autoPanOnConnect:_h,autoPanOnNodeDrag:bh,onError:wh,connectionRadius:Sh,isValidConnection:Ss}),ue.jsx(zme,{onSelectionChange:V}),Ft,ue.jsx(mme,{proOptions:mh,position:gh}),ue.jsx(Kme,{rfId:il,disableKeyboardA11y:Gc})]})})});e0e.displayName="ReactFlow";var oU={},qb={},Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});Kb.createLogMethods=void 0;var t0e=function(){return{debug:console.debug.bind(console),error:console.error.bind(console),fatal:console.error.bind(console),info:console.info.bind(console),trace:console.debug.bind(console),warn:console.warn.bind(console)}};Kb.createLogMethods=t0e;var vE={},Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});Xb.boolean=void 0;const n0e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};Xb.boolean=n0e;var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0});Yb.isBooleanable=void 0;const r0e=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};Yb.isBooleanable=r0e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=Xb;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=Yb;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(vE);var vO=Object.prototype.toString,sU=function(t){var n=vO.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&vO.call(t.callee)==="[object Function]"),r},$x,_O;function i0e(){if(_O)return $x;_O=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=sU,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var g=h.constructor;return g&&g.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&t.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),f=function(h){if(typeof window>"u"||!d)return l(h);try{return l(h)}catch{return!1}};e=function(g){var m=g!==null&&typeof g=="object",v=n.call(g)==="[object Function]",x=r(g),_=m&&n.call(g)==="[object String]",b=[];if(!m&&!v&&!x)throw new TypeError("Object.keys called on a non-object");var y=s&&v;if(_&&g.length>0&&!t.call(g,0))for(var S=0;S<g.length;++S)b.push(String(S));if(x&&g.length>0)for(var C=0;C<g.length;++C)b.push(String(C));else for(var T in g)!(y&&T==="prototype")&&t.call(g,T)&&b.push(String(T));if(o)for(var E=f(g),P=0;P<a.length;++P)!(E&&a[P]==="constructor")&&t.call(g,a[P])&&b.push(a[P]);return b}}return $x=e,$x}var o0e=Array.prototype.slice,s0e=sU,bO=Object.keys,Ov=bO?function(t){return bO(t)}:i0e(),SO=Object.keys;Ov.shim=function(){if(Object.keys){var t=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);t||(Object.keys=function(r){return s0e(r)?SO(o0e.call(r)):SO(r)})}else Object.keys=Ov;return Object.keys||Ov};var a0e=Ov,l0e=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},wO=typeof Symbol<"u"&&Symbol,u0e=l0e,c0e=function(){return typeof wO!="function"||typeof Symbol!="function"||typeof wO("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:u0e()},xO={foo:{}},d0e=Object,f0e=function(){return{__proto__:xO}.foo===xO.foo&&!({__proto__:null}instanceof d0e)},h0e="Function.prototype.bind called on incompatible ",Fx=Array.prototype.slice,p0e=Object.prototype.toString,g0e="[object Function]",m0e=function(t){var n=this;if(typeof n!="function"||p0e.call(n)!==g0e)throw new TypeError(h0e+n);for(var r=Fx.call(arguments,1),i,o=function(){if(this instanceof i){var d=n.apply(this,r.concat(Fx.call(arguments)));return Object(d)===d?d:this}else return n.apply(t,r.concat(Fx.call(arguments)))},s=Math.max(0,n.length-r.length),a=[],l=0;l<s;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},y0e=m0e,aU=Function.prototype.bind||y0e,v0e=aU,_0e=v0e.call(Function.call,Object.prototype.hasOwnProperty),St,zf=SyntaxError,lU=Function,vf=TypeError,Bx=function(e){try{return lU('"use strict"; return ('+e+").constructor;")()}catch{}},sc=Object.getOwnPropertyDescriptor;if(sc)try{sc({},"")}catch{sc=null}var Ux=function(){throw new vf},b0e=sc?function(){try{return arguments.callee,Ux}catch{try{return sc(arguments,"callee").get}catch{return Ux}}}():Ux,bd=c0e(),S0e=f0e(),Sr=Object.getPrototypeOf||(S0e?function(e){return e.__proto__}:null),Id={},w0e=typeof Uint8Array>"u"||!Sr?St:Sr(Uint8Array),ac={"%AggregateError%":typeof AggregateError>"u"?St:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?St:ArrayBuffer,"%ArrayIteratorPrototype%":bd&&Sr?Sr([][Symbol.iterator]()):St,"%AsyncFromSyncIteratorPrototype%":St,"%AsyncFunction%":Id,"%AsyncGenerator%":Id,"%AsyncGeneratorFunction%":Id,"%AsyncIteratorPrototype%":Id,"%Atomics%":typeof Atomics>"u"?St:Atomics,"%BigInt%":typeof BigInt>"u"?St:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?St:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?St:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?St:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?St:Float32Array,"%Float64Array%":typeof Float64Array>"u"?St:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?St:FinalizationRegistry,"%Function%":lU,"%GeneratorFunction%":Id,"%Int8Array%":typeof Int8Array>"u"?St:Int8Array,"%Int16Array%":typeof Int16Array>"u"?St:Int16Array,"%Int32Array%":typeof Int32Array>"u"?St:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":bd&&Sr?Sr(Sr([][Symbol.iterator]())):St,"%JSON%":typeof JSON=="object"?JSON:St,"%Map%":typeof Map>"u"?St:Map,"%MapIteratorPrototype%":typeof Map>"u"||!bd||!Sr?St:Sr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?St:Promise,"%Proxy%":typeof Proxy>"u"?St:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?St:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?St:Set,"%SetIteratorPrototype%":typeof Set>"u"||!bd||!Sr?St:Sr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?St:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":bd&&Sr?Sr(""[Symbol.iterator]()):St,"%Symbol%":bd?Symbol:St,"%SyntaxError%":zf,"%ThrowTypeError%":b0e,"%TypedArray%":w0e,"%TypeError%":vf,"%Uint8Array%":typeof Uint8Array>"u"?St:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?St:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?St:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?St:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?St:WeakMap,"%WeakRef%":typeof WeakRef>"u"?St:WeakRef,"%WeakSet%":typeof WeakSet>"u"?St:WeakSet};if(Sr)try{null.error}catch(e){var x0e=Sr(Sr(e));ac["%Error.prototype%"]=x0e}var C0e=function e(t){var n;if(t==="%AsyncFunction%")n=Bx("async function () {}");else if(t==="%GeneratorFunction%")n=Bx("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Bx("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Sr&&(n=Sr(i.prototype))}return ac[t]=n,n},CO={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Lm=aU,t_=_0e,T0e=Lm.call(Function.call,Array.prototype.concat),E0e=Lm.call(Function.apply,Array.prototype.splice),TO=Lm.call(Function.call,String.prototype.replace),n_=Lm.call(Function.call,String.prototype.slice),A0e=Lm.call(Function.call,RegExp.prototype.exec),P0e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R0e=/\\(\\)?/g,O0e=function(t){var n=n_(t,0,1),r=n_(t,-1);if(n==="%"&&r!=="%")throw new zf("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new zf("invalid intrinsic syntax, expected opening `%`");var i=[];return TO(t,P0e,function(o,s,a,l){i[i.length]=a?TO(l,R0e,"$1"):s||o}),i},k0e=function(t,n){var r=t,i;if(t_(CO,r)&&(i=CO[r],r="%"+i[0]+"%"),t_(ac,r)){var o=ac[r];if(o===Id&&(o=C0e(r)),typeof o>"u"&&!n)throw new vf("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new zf("intrinsic "+t+" does not exist!")},I0e=function(t,n){if(typeof t!="string"||t.length===0)throw new vf("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new vf('"allowMissing" argument must be a boolean');if(A0e(/^%?[^%]*%?$/,t)===null)throw new zf("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O0e(t),i=r.length>0?r[0]:"",o=k0e("%"+i+"%",n),s=o.name,a=o.value,l=!1,u=o.alias;u&&(i=u[0],E0e(r,T0e([0,1],u)));for(var d=1,f=!0;d<r.length;d+=1){var h=r[d],g=n_(h,0,1),m=n_(h,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new zf("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(l=!0),i+="."+h,s="%"+i+"%",t_(ac,s))a=ac[s];else if(a!=null){if(!(h in a)){if(!n)throw new vf("base intrinsic for "+t+" exists, but the property is not available.");return}if(sc&&d+1>=r.length){var v=sc(a,h);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?a=v.get:a=a[h]}else f=t_(a,h),a=a[h];f&&!l&&(ac[s]=a)}}return a},M0e=I0e,l5=M0e("%Object.defineProperty%",!0),u5=function(){if(l5)try{return l5({},"a",{value:1}),!0}catch{return!1}return!1};u5.hasArrayLengthDefineBug=function(){if(!u5())return null;try{return l5([],"length",{value:1}).length!==1}catch{return!0}};var N0e=u5,L0e=a0e,D0e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",$0e=Object.prototype.toString,F0e=Array.prototype.concat,uU=Object.defineProperty,B0e=function(e){return typeof e=="function"&&$0e.call(e)==="[object Function]"},U0e=N0e(),cU=uU&&U0e,z0e=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!B0e(r)||!r())return}cU?uU(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},dU=function(e,t){var n=arguments.length>2?arguments[2]:{},r=L0e(t);D0e&&(r=F0e.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)z0e(e,r[i],t[r[i]],n[r[i]])};dU.supportsDescriptors=!!cU;var fU=dU,kv={exports:{}};typeof self<"u"?kv.exports=self:typeof window<"u"?kv.exports=window:kv.exports=Function("return this")();var hU=kv.exports,V0e=hU,pU=function(){return typeof Ze!="object"||!Ze||Ze.Math!==Math||Ze.Array!==Array?V0e:Ze},j0e=fU,G0e=pU,H0e=function(){var t=G0e();if(j0e.supportsDescriptors){var n=Object.getOwnPropertyDescriptor(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},W0e=fU,q0e=hU,gU=pU,K0e=H0e,X0e=gU(),mU=function(){return X0e};W0e(mU,{getPolyfill:gU,implementation:q0e,shim:K0e});var _E=mU,yU={},Dm={},bE={},Qb={},Zb={};Object.defineProperty(Zb,"__esModule",{value:!0});Zb.convertWildcardToRegex=void 0;var Y0e=/\*+/g,Q0e=function(e){return new RegExp(e.replace(Y0e,"(.+?)"))};Zb.convertWildcardToRegex=Q0e;var $m={};Object.defineProperty($m,"__esModule",{value:!0});$m.escapeRegexString=void 0;var Z0e=/[$()*+.?[\\\]^{|}]/g,J0e=/-/g,eve=function(e){return e.replace(Z0e,"\\$&").replace(J0e,"\\x2d")};$m.escapeRegexString=eve;var Jb={};Object.defineProperty(Jb,"__esModule",{value:!0});Jb.parseRegex=void 0;var tve=/(\/?)(.+)\1([a-z]*)/,nve=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,rve=function(e){var t=tve.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!nve.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};Jb.parseRegex=rve;Object.defineProperty(Qb,"__esModule",{value:!0});Qb.createStringTest=void 0;var ive=Zb,ove=$m,sve=Jb,zx=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,sve.parseRegex)(t),function(r){var i,o;return(o=(i=r.match(n))===null||i===void 0?void 0:i[0])!==null&&o!==void 0?o:!1}},ave=function(e,t){if(t.type!=="Tag")throw new Error("Expected a tag expression.");var n=t.expression;if(n.type==="RangeExpression")throw new Error("Unexpected range expression.");if(n.type==="RegexExpression")return zx(e,n.value);if(n.type!=="LiteralExpression")throw new Error("Expected a literal expression.");var r=String(n.value);return r.includes("*")&&n.quoted===!1?zx(e,String((0,ive.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):zx(e,"/("+(0,ove.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};Qb.createStringTest=ave;var eS={};Object.defineProperty(eS,"__esModule",{value:!0});eS.testComparisonRange=void 0;var lve=function(e,t,n){switch(n){case":=":return t===e;case":>":return t>e;case":<":return t<e;case":>=":return t>=e;case":<=":return t<=e;default:throw new Error("Unimplemented comparison operator: ".concat(n))}};eS.testComparisonRange=lve;var tS={};Object.defineProperty(tS,"__esModule",{value:!0});tS.testRange=void 0;var uve=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};tS.testRange=uve;(function(e){var t=Ze&&Ze.__assign||function(){return t=Object.assign||function(d){for(var f,h=1,g=arguments.length;h<g;h++){f=arguments[h];for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&(d[m]=f[m])}return d},t.apply(this,arguments)},n=Ze&&Ze.__spreadArray||function(d,f,h){if(h||arguments.length===2)for(var g=0,m=f.length,v;g<m;g++)(v||!(g in f))&&(v||(v=Array.prototype.slice.call(f,0,g)),v[g]=f[g]);return d.concat(v||Array.prototype.slice.call(f))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=Qb,i=eS,o=tS,s=function(d){if(d.type!=="Tag")throw new Error("Expected a tag expression.");var f=d.expression;if(f.type==="RangeExpression")return function(v){return(0,o.testRange)(v,f.range)};if(f.type==="EmptyExpression")return function(){return!1};var h=f.value;if(d.operator&&d.operator.operator!==":"){var g=d.operator;if(typeof h!="number")throw new TypeError("Expected a number.");return function(v){return typeof v!="number"?!1:(0,i.testComparisonRange)(h,v,g.operator)}}else{if(typeof h=="boolean")return function(v){return v===h};if(h===null)return function(v){return v===null};var m=(0,r.createStringTest)({},d);return function(v){return m(String(v))}}},a=function(d,f,h,g,m){if(Array.isArray(f)){for(var v=!1,x=0,_=0,b=f;_<b.length;_++){var y=b[_];if(a(d,y,h,n(n([],g,!0),[String(x++)],!1),m)){if(h)return!0;v=!0}}return v}else if(typeof f=="object"&&f!==null){var v=!1;for(var S in f)if(a(d,f[S],h,n(n([],g,!0),[S],!1),m)){if(h)return!0;v=!0}return v}if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(!d.test)throw new Error("Expected test to be defined.");var C=d.test(f);return C?(m.push(t(t({},typeof C=="string"&&{keyword:C}),{path:g.join(".")})),!0):!!C},l=function(d,f,h,g,m){if(f.type!=="Tag")throw new Error("Expected a tag expression.");if(f.test||(f.test=s(f)),f.field.type==="ImplicitField"){var v=!1;for(var x in d)if(a(t(t({},f),{field:{location:{end:-1,start:-1},name:x,quoted:!0,quotes:"double",type:"Field"}}),d[x],h,n(n([],g,!0),[x],!1),m)){if(h)return!0;v=!0}return v}if(f.field.name in d)return a(f,d[f.field.name],h,g,m);if(f.getValue&&f.field.path)return a(f,f.getValue(d),h,f.field.path,m);if(f.field.path){for(var _=d,b=0,y=f.field.path;b<y.length;b++){var S=y[b];if(typeof _!="object"||_===null)return!1;if(S in _)_=_[S];else return!1}return a(f,_,h,f.field.path,m)}else return!1},u=function(d,f,h,g,m){if(h===void 0&&(h=!0),g===void 0&&(g=[]),m===void 0&&(m=[]),d.type==="Tag")return f.filter(function(b){return l(b,d,h,d.field.type==="ImplicitField"?g:n(n([],g,!0),[d.field.name],!1),m)});if(d.type==="UnaryOperator"){var v=(0,e.internalFilter)(d.operand,f,h,g,[]);return f.filter(function(b){return!v.includes(b)})}if(!d.left)throw new Error("Expected left to be defined.");var x=(0,e.internalFilter)(d.left,f,h,g,m);if(!d.right)throw new Error("Expected right to be defined.");if(d.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(d.operator.operator==="OR"){var _=(0,e.internalFilter)(d.right,f,h,g,m);return Array.from(new Set(n(n([],x,!0),_,!0)))}else if(d.operator.operator==="AND")return(0,e.internalFilter)(d.right,x,h,g,m);throw new Error("Unexpected state.")};e.internalFilter=u})(bE);Object.defineProperty(Dm,"__esModule",{value:!0});Dm.filter=void 0;var cve=bE,dve=function(e,t){return(0,cve.internalFilter)(e,t)};Dm.filter=dve;var nS={};Object.defineProperty(nS,"__esModule",{value:!0});nS.highlight=void 0;var fve=$m,hve=bE,pve=function(e,t){var n=[];(0,hve.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(d){return d.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,s=n;o<s.length;o++){var a=s[o];i(a)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,fve.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};nS.highlight=pve;var rS={},vU={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(Ze,function(){function t(u,d,f){return this.id=++t.highestId,this.name=u,this.symbols=d,this.postprocess=f,this}t.highestId=0,t.prototype.toString=function(u){var d=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+d};function n(u,d,f,h){this.rule=u,this.dot=d,this.reference=f,this.data=[],this.wantedBy=h,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var d=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return d.left=this,d.right=u,d.isComplete&&(d.data=d.build(),d.right=void 0),d},n.prototype.build=function(){var u=[],d=this;do u.push(d.right.data),d=d.left;while(d.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function r(u,d){this.grammar=u,this.index=d,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var d=this.states,f=this.wants,h=this.completed,g=0;g<d.length;g++){var m=d[g];if(m.isComplete){if(m.finish(),m.data!==s.fail){for(var v=m.wantedBy,x=v.length;x--;){var _=v[x];this.complete(_,m)}if(m.reference===this.index){var b=m.rule.name;(this.completed[b]=this.completed[b]||[]).push(m)}}}else{var b=m.rule.symbols[m.dot];if(typeof b!="string"){this.scannable.push(m);continue}if(f[b]){if(f[b].push(m),h.hasOwnProperty(b))for(var y=h[b],x=0;x<y.length;x++){var S=y[x];this.complete(m,S)}}else f[b]=[m],this.predict(b)}}},r.prototype.predict=function(u){for(var d=this.grammar.byName[u]||[],f=0;f<d.length;f++){var h=d[f],g=this.wants[u],m=new n(h,0,this.index,g);this.states.push(m)}},r.prototype.complete=function(u,d){var f=u.nextState(d);this.states.push(f)};function i(u,d){this.rules=u,this.start=d||this.rules[0].name;var f=this.byName={};this.rules.forEach(function(h){f.hasOwnProperty(h.name)||(f[h.name]=[]),f[h.name].push(h)})}i.fromCompiled=function(h,d){var f=h.Lexer;h.ParserStart&&(d=h.ParserStart,h=h.ParserRules);var h=h.map(function(m){return new t(m.name,m.symbols,m.postprocess)}),g=new i(h,d);return g.lexer=f,g};function o(){this.reset("")}o.prototype.reset=function(u,d){this.buffer=u,this.index=0,this.line=d?d.line:1,this.lastLineBreak=d?-d.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var u=this.buffer[this.index++];return u===`
|
||
`&&(this.line+=1,this.lastLineBreak=this.index),{value:u}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(u,d){var f=this.buffer;if(typeof f=="string"){var h=f.split(`
|
||
`).slice(Math.max(0,this.line-5),this.line),g=f.indexOf(`
|
||
`,this.index);g===-1&&(g=f.length);var m=this.index-this.lastLineBreak,v=String(this.line).length;return d+=" at line "+this.line+" col "+m+`:
|
||
|
||
`,d+=h.map(function(_,b){return x(this.line-h.length+b+1,v)+" "+_},this).join(`
|
||
`),d+=`
|
||
`+x("",v+m)+`^
|
||
`,d}else return d+" at index "+(this.index-1);function x(_,b){var y=String(_);return Array(b-y.length+1).join(" ")+y}};function s(u,d,f){if(u instanceof i)var h=u,f=d;else var h=i.fromCompiled(u,d);this.grammar=h,this.options={keepHistory:!1,lexer:h.lexer||new o};for(var g in f||{})this.options[g]=f[g];this.lexer=this.options.lexer,this.lexerState=void 0;var m=new r(h,0);this.table=[m],m.wants[h.start]=[],m.predict(h.start),m.process(),this.current=0}s.fail={},s.prototype.feed=function(u){var d=this.lexer;d.reset(u,this.lexerState);for(var f;;){try{if(f=d.next(),!f)break}catch(E){var v=new r(this.grammar,this.current+1);this.table.push(v);var h=new Error(this.reportLexerError(E));throw h.offset=this.current,h.token=E.token,h}var g=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var m=this.current+1,v=new r(this.grammar,m);this.table.push(v);for(var x=f.text!==void 0?f.text:f.value,_=d.constructor===o?f.value:f,b=g.scannable,y=b.length;y--;){var S=b[y],C=S.rule.symbols[S.dot];if(C.test?C.test(_):C.type?C.type===f.type:C.literal===x){var T=S.nextState({data:_,token:f,isToken:!0,reference:m-1});v.states.push(T)}}if(v.process(),v.states.length===0){var h=new Error(this.reportError(f));throw h.offset=this.current,h.token=f,h}this.options.keepHistory&&(g.lexerState=d.save()),this.current++}return g&&(this.lexerState=d.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(u){var d,f,h=u.token;return h?(d="input "+JSON.stringify(h.text[0])+" (lexer error)",f=this.lexer.formatError(h,"Syntax error")):(d="input (lexer error)",f=u.message),this.reportErrorCommon(f,d)},s.prototype.reportError=function(u){var d=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),f=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(f,d)},s.prototype.reportErrorCommon=function(u,d){var f=[];f.push(u);var h=this.table.length-2,g=this.table[h],m=g.states.filter(function(x){var _=x.rule.symbols[x.dot];return _&&typeof _!="string"});if(m.length===0)f.push("Unexpected "+d+`. I did not expect any more input. Here is the state of my parse table:
|
||
`),this.displayStateStack(g.states,f);else{f.push("Unexpected "+d+`. Instead, I was expecting to see one of the following:
|
||
`);var v=m.map(function(x){return this.buildFirstStateStack(x,[])||[x]},this);v.forEach(function(x){var _=x[0],b=_.rule.symbols[_.dot],y=this.getSymbolDisplay(b);f.push("A "+y+" based on:"),this.displayStateStack(x,f)},this)}return f.push(""),f.join(`
|
||
`)},s.prototype.displayStateStack=function(u,d){for(var f,h=0,g=0;g<u.length;g++){var m=u[g],v=m.rule.toString(m.dot);v===f?h++:(h>0&&d.push(" ^ "+h+" more lines identical to this"),h=0,d.push(" "+v)),f=v}},s.prototype.getSymbolDisplay=function(u){return a(u)},s.prototype.buildFirstStateStack=function(u,d){if(d.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var f=u.wantedBy[0],h=[u].concat(d),g=this.buildFirstStateStack(f,h);return g===null?null:[u].concat(g)},s.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},s.prototype.restore=function(u){var d=u.index;this.current=d,this.table[d]=u,this.table.splice(d+1),this.lexerState=u.lexerState,this.results=this.finish()},s.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},s.prototype.finish=function(){var u=[],d=this.grammar.start,f=this.table[this.table.length-1];return f.states.forEach(function(h){h.rule.name===d&&h.dot===h.rule.symbols.length&&h.reference===0&&h.data!==s.fail&&u.push(h)}),u.map(function(h){return h.data})};function a(u){var d=typeof u;if(d==="string")return u;if(d==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var d=typeof u;if(d==="string")return u;if(d==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:s,Grammar:i,Rule:t}})})(vU);var gve=vU.exports,Sc={},_U={},mu={};mu.__esModule=void 0;mu.__esModule=!0;var mve=typeof Object.setPrototypeOf=="function",yve=typeof Object.getPrototypeOf=="function",vve=typeof Object.defineProperty=="function",_ve=typeof Object.create=="function",bve=typeof Object.prototype.hasOwnProperty=="function",Sve=function(t,n){mve?Object.setPrototypeOf(t,n):t.__proto__=n};mu.setPrototypeOf=Sve;var wve=function(t){return yve?Object.getPrototypeOf(t):t.__proto__||t.prototype};mu.getPrototypeOf=wve;var EO=!1,xve=function e(t,n,r){if(vve&&!EO)try{Object.defineProperty(t,n,r)}catch{EO=!0,e(t,n,r)}else t[n]=r.value};mu.defineProperty=xve;var bU=function(t,n){return bve?t.hasOwnProperty(t,n):t[n]===void 0};mu.hasOwnProperty=bU;var Cve=function(t,n){if(_ve)return Object.create(t,n);var r=function(){};r.prototype=t;var i=new r;if(typeof n>"u")return i;if(typeof n=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof n=="object")for(var o in n)bU(n,o)&&(i[o]=n[o].value);return i};mu.objectCreate=Cve;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=mu,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,s=new Error().toString()==="[object Error]",a="";function l(u){var d=this.constructor,f=d.name||function(){var x=d.toString().match(/^function\s*([^\s(]+)/);return x===null?a||"Error":x[1]}(),h=f==="Error",g=h?a:f,m=Error.apply(this,arguments);if(n(m,r(this)),!(m instanceof d)||!(m instanceof l)){var m=this;Error.apply(this,arguments),i(m,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(m,"name",{configurable:!0,enumerable:!1,value:g,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(m,h?l:d),m.stack===void 0){var v=new Error(u);v.name=m.name,m.stack=v.stack}return s&&i(m,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),m}a=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(_U);var SU=Ze&&Ze.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Sc,"__esModule",{value:!0});Sc.SyntaxError=Sc.LiqeError=void 0;var Tve=_U,wU=function(e){SU(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Tve.ExtendableError);Sc.LiqeError=wU;var Eve=function(e){SU(t,e);function t(n,r,i,o){var s=e.call(this,n)||this;return s.message=n,s.offset=r,s.line=i,s.column=o,s}return t}(wU);Sc.SyntaxError=Eve;var SE={},r_=Ze&&Ze.__assign||function(){return r_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},r_.apply(this,arguments)};Object.defineProperty(SE,"__esModule",{value:!0});function ya(e){return e[0]}var Ave={Lexer:void 0,ParserRules:[{name:"main",symbols:["_","logical_expression","_"],postprocess:function(e){return e[1]}},{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"__$ebnf$1",symbols:["whitespace_character"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"whitespace_character",symbols:[/[ \t\n\v\f]/],postprocess:ya},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:ya},{name:"decimal$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"decimal$ebnf$2",symbols:[/[0-9]/]},{name:"decimal$ebnf$2",symbols:["decimal$ebnf$2",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:[/[0-9]/]},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:["decimal$ebnf$3$subexpression$1$ebnf$1",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1",symbols:[{literal:"."},"decimal$ebnf$3$subexpression$1$ebnf$1"]},{name:"decimal$ebnf$3",symbols:["decimal$ebnf$3$subexpression$1"],postprocess:ya},{name:"decimal$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"decimal",symbols:["decimal$ebnf$1","decimal$ebnf$2","decimal$ebnf$3"],postprocess:function(e){return parseFloat((e[0]||"")+e[1].join("")+(e[2]?"."+e[2][1].join(""):""))}},{name:"dqstring$ebnf$1",symbols:[]},{name:"dqstring$ebnf$1",symbols:["dqstring$ebnf$1","dstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"dqstring",symbols:[{literal:'"'},"dqstring$ebnf$1",{literal:'"'}],postprocess:function(e){return e[1].join("")}},{name:"sqstring$ebnf$1",symbols:[]},{name:"sqstring$ebnf$1",symbols:["sqstring$ebnf$1","sstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"sqstring",symbols:[{literal:"'"},"sqstring$ebnf$1",{literal:"'"}],postprocess:function(e){return e[1].join("")}},{name:"dstrchar",symbols:[/[^\\"\n]/],postprocess:ya},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:ya},{name:"sstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar$string$1",symbols:[{literal:"\\"},{literal:"'"}],postprocess:function(e){return e.join("")}},{name:"sstrchar",symbols:["sstrchar$string$1"],postprocess:function(){return"'"}},{name:"strescape",symbols:[/["\\/bfnrt]/],postprocess:ya},{name:"strescape",symbols:[{literal:"u"},/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/],postprocess:function(e){return e.join("")}},{name:"logical_expression",symbols:["two_op_logical_expression"],postprocess:ya},{name:"two_op_logical_expression",symbols:["pre_two_op_logical_expression","boolean_operator","post_one_op_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:e[1],left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["pre_two_op_implicit_logical_expression","__","post_one_op_implicit_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:{operator:"AND",type:"ImplicitBooleanOperator"},left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["two_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"post_one_op_implicit_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"post_one_op_implicit_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"pre_two_op_logical_expression",symbols:["two_op_logical_expression","__"],postprocess:function(e){return e[0]}},{name:"pre_two_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[2].location.start+1},type:"ParenthesizedExpression",expression:{type:"EmptyExpression",location:{start:e[0].location.start+1,end:e[0].location.start+1}}}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression$string$1",symbols:[{literal:"N"},{literal:"O"},{literal:"T"}],postprocess:function(e){return e.join("")}},{name:"one_op_logical_expression",symbols:["one_op_logical_expression$string$1","post_boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"NOT",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:[{literal:"-"},"boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"-",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:["boolean_primary"],postprocess:function(e){return e[0]}},{name:"post_one_op_logical_expression",symbols:["__","one_op_logical_expression"],postprocess:function(e){return e[1]}},{name:"post_one_op_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location,end:e[4].location+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"parentheses_open",symbols:[{literal:"("}],postprocess:function(e,t){return{location:{start:t}}}},{name:"parentheses_close",symbols:[{literal:")"}],postprocess:function(e,t){return{location:{start:t}}}},{name:"boolean_operator$string$1",symbols:[{literal:"O"},{literal:"R"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$1"],postprocess:function(e,t){return{location:{start:t,end:t+2},operator:"OR",type:"BooleanOperator"}}},{name:"boolean_operator$string$2",symbols:[{literal:"A"},{literal:"N"},{literal:"D"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$2"],postprocess:function(e,t){return{location:{start:t,end:t+3},operator:"AND",type:"BooleanOperator"}}},{name:"boolean_primary",symbols:["tag_expression"],postprocess:ya},{name:"post_boolean_primary",symbols:["__","parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[1].location.start,end:e[5].location.start+1},type:"ParenthesizedExpression",expression:e[3]}}},{name:"post_boolean_primary",symbols:["__","boolean_primary"],postprocess:function(e){return e[1]}},{name:"tag_expression",symbols:["field","comparison_operator","expression"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,r_({location:{start:t,end:e[2].expression.location.end},field:n,operator:e[1]},e[2])}},{name:"tag_expression",symbols:["field","comparison_operator"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,{type:"Tag",location:{start:t,end:e[1].location.end},field:n,operator:e[1],expression:{type:"EmptyExpression",location:{start:e[1].location.end,end:e[1].location.end}}}}},{name:"tag_expression",symbols:["expression"],postprocess:function(e,t){return r_({location:{start:t,end:e[0].expression.location.end},field:{type:"ImplicitField"}},e[0])}},{name:"field$ebnf$1",symbols:[]},{name:"field$ebnf$1",symbols:["field$ebnf$1",/[a-zA-Z\d_$.]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"field",symbols:[/[_a-zA-Z$]/,"field$ebnf$1"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0]+e[1].join(""),quoted:!1,location:{start:t,end:t+(e[0]+e[1].join("")).length}}}},{name:"field",symbols:["sqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"single",location:{start:t,end:t+e[0].length+2}}}},{name:"field",symbols:["dqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"double",location:{start:t,end:t+e[0].length+2}}}},{name:"expression",symbols:["decimal"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"LiteralExpression",quoted:!1,value:Number(e.join(""))}}}},{name:"expression",symbols:["regex"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"RegexExpression",value:e.join("")}}}},{name:"expression",symbols:["range"],postprocess:function(e){return e[0]}},{name:"expression",symbols:["unquoted_value"],postprocess:function(e,t,n){var r=e.join("");if(e[0]==="AND"||e[0]==="OR"||e[0]==="NOT")return n;var i;return r==="true"?i=!0:r==="false"?i=!1:r==="null"?i=null:i=r,{type:"Tag",expression:{location:{start:t,end:t+r.length},type:"LiteralExpression",quoted:!1,value:i}}}},{name:"expression",symbols:["sqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"single",value:e.join("")}}}},{name:"expression",symbols:["dqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"double",value:e.join("")}}}},{name:"range$string$1",symbols:[{literal:" "},{literal:"T"},{literal:"O"},{literal:" "}],postprocess:function(e){return e.join("")}},{name:"range",symbols:["range_open","decimal","range$string$1","decimal","range_close"],postprocess:function(e,t){return{location:{start:t},type:"Tag",expression:{location:{start:e[0].location.start,end:e[4].location.start+1},type:"RangeExpression",range:{min:e[1],minInclusive:e[0].inclusive,maxInclusive:e[4].inclusive,max:e[3]}}}}},{name:"range_open",symbols:[{literal:"["}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_open",symbols:[{literal:"{"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"range_close",symbols:[{literal:"]"}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_close",symbols:[{literal:"}"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"comparison_operator$subexpression$1",symbols:[{literal:":"}]},{name:"comparison_operator$subexpression$1$string$1",symbols:[{literal:":"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$1"]},{name:"comparison_operator$subexpression$1$string$2",symbols:[{literal:":"},{literal:">"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$2"]},{name:"comparison_operator$subexpression$1$string$3",symbols:[{literal:":"},{literal:"<"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$3"]},{name:"comparison_operator$subexpression$1$string$4",symbols:[{literal:":"},{literal:">"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$4"]},{name:"comparison_operator$subexpression$1$string$5",symbols:[{literal:":"},{literal:"<"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$5"]},{name:"comparison_operator",symbols:["comparison_operator$subexpression$1"],postprocess:function(e,t){return{location:{start:t,end:t+e[0][0].length},type:"ComparisonOperator",operator:e[0][0]}}},{name:"regex",symbols:["regex_body","regex_flags"],postprocess:function(e){return e.join("")}},{name:"regex_body$ebnf$1",symbols:[]},{name:"regex_body$ebnf$1",symbols:["regex_body$ebnf$1","regex_body_char"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_body",symbols:[{literal:"/"},"regex_body$ebnf$1",{literal:"/"}],postprocess:function(e){return"/"+e[1].join("")+"/"}},{name:"regex_body_char",symbols:[/[^\\]/],postprocess:ya},{name:"regex_body_char",symbols:[{literal:"\\"},/[^\\]/],postprocess:function(e){return"\\"+e[1]}},{name:"regex_flags",symbols:[]},{name:"regex_flags$ebnf$1",symbols:[/[gmiyusd]/]},{name:"regex_flags$ebnf$1",symbols:["regex_flags$ebnf$1",/[gmiyusd]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_flags",symbols:["regex_flags$ebnf$1"],postprocess:function(e){return e[0].join("")}},{name:"unquoted_value$ebnf$1",symbols:[]},{name:"unquoted_value$ebnf$1",symbols:["unquoted_value$ebnf$1",/[a-zA-Z\.\-_*@#$]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"unquoted_value",symbols:[/[a-zA-Z_*@#$]/,"unquoted_value$ebnf$1"],postprocess:function(e){return e[0]+e[1].join("")}}],ParserStart:"main"};SE.default=Ave;var xU={},iS={},Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});Fm.isSafePath=void 0;var Pve=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Rve=function(e){return Pve.test(e)};Fm.isSafePath=Rve;Object.defineProperty(iS,"__esModule",{value:!0});iS.createGetValueFunctionBody=void 0;var Ove=Fm,kve=function(e){if(!(0,Ove.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};iS.createGetValueFunctionBody=kve;(function(e){var t=Ze&&Ze.__assign||function(){return t=Object.assign||function(o){for(var s,a=1,l=arguments.length;a<l;a++){s=arguments[a];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(o[u]=s[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=iS,r=Fm,i=function(o){var s=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(s.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(s.left=(0,e.hydrateAst)(o.left)),"right"in o&&(s.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(s.operand=(0,e.hydrateAst)(o.operand)),s};e.hydrateAst=i})(xU);var CU=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rS,"__esModule",{value:!0});rS.parse=void 0;var TU=CU(gve),Ive=Sc,Mve=CU(SE),Nve=xU,Lve=TU.default.Grammar.fromCompiled(Mve.default),Dve=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,$ve=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new TU.default.Parser(Lve),n;try{n=t.feed(e).results}catch(o){if(typeof(o==null?void 0:o.message)=="string"&&typeof(o==null?void 0:o.offset)=="number"){var r=o.message.match(Dve);throw r?new Ive.SyntaxError("Syntax error at line ".concat(r.groups.line," column ").concat(r.groups.column),o.offset,Number(r.groups.line),Number(r.groups.column)):o}throw o}if(n.length===0)throw new Error("Found no parsings.");if(n.length>1)throw new Error("Ambiguous results.");var i=(0,Nve.hydrateAst)(n[0]);return i};rS.parse=$ve;var oS={};Object.defineProperty(oS,"__esModule",{value:!0});oS.test=void 0;var Fve=Dm,Bve=function(e,t){return(0,Fve.filter)(e,[t]).length===1};oS.test=Bve;var EU={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,s){return s==="double"?'"'.concat(o,'"'):s==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var s=o.range,a=s.min,l=s.max,u=s.minInclusive,d=s.maxInclusive;return"".concat(u?"[":"{").concat(a," TO ").concat(l).concat(d?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var s=o.field,a=o.expression,l=o.operator;if(s.type==="ImplicitField")return n(a);var u=s.quoted?t(s.name,s.quotes):s.name,d=" ".repeat(a.location.start-l.location.end);return u+l.operator+d+n(a)},i=function(o){if(o.type==="ParenthesizedExpression"){if(!("location"in o.expression))throw new Error("Expected location in expression.");if(!o.location.end)throw new Error("Expected location end.");var s=" ".repeat(o.expression.location.start-(o.location.start+1)),a=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(s).concat((0,e.serialize)(o.expression)).concat(a,")")}if(o.type==="Tag")return r(o);if(o.type==="LogicalExpression"){var l="";return o.operator.type==="BooleanOperator"?(l+=" ".repeat(o.operator.location.start-o.left.location.end),l+=o.operator.operator,l+=" ".repeat(o.right.location.start-o.operator.location.end)):l=" ".repeat(o.right.location.start-o.left.location.end),"".concat((0,e.serialize)(o.left)).concat(l).concat((0,e.serialize)(o.right))}if(o.type==="UnaryOperator")return(o.operator==="NOT"?"NOT ":o.operator)+(0,e.serialize)(o.operand);if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")};e.serialize=i})(EU);var sS={};Object.defineProperty(sS,"__esModule",{value:!0});sS.isSafeUnquotedExpression=void 0;var Uve=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};sS.isSafeUnquotedExpression=Uve;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isSafeUnquotedExpression=e.serialize=e.SyntaxError=e.LiqeError=e.test=e.parse=e.highlight=e.filter=void 0;var t=Dm;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=nS;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=rS;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=oS;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Sc;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var s=EU;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return s.serialize}});var a=sS;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return a.isSafeUnquotedExpression}})})(yU);var Bm={},AU={},wc={};Object.defineProperty(wc,"__esModule",{value:!0});wc.ROARR_LOG_FORMAT_VERSION=wc.ROARR_VERSION=void 0;wc.ROARR_VERSION="5.0.0";wc.ROARR_LOG_FORMAT_VERSION="2.0.0";var Um={};Object.defineProperty(Um,"__esModule",{value:!0});Um.logLevels=void 0;Um.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var PU={},aS={};Object.defineProperty(aS,"__esModule",{value:!0});aS.hasOwnProperty=void 0;const zve=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);aS.hasOwnProperty=zve;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=aS;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(PU);var RU={},lS={},uS={};Object.defineProperty(uS,"__esModule",{value:!0});uS.tokenize=void 0;const Vve=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,jve=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=Vve.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const s=t[0];i=t.index+s.length,s==="\\%"||s==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):t.groups&&(o={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:s,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(o))}return i<=e.length-1&&(o&&o.type==="literal"?o.literal+=e.slice(i):n.push({literal:e.slice(i),type:"literal"})),n};uS.tokenize=jve;Object.defineProperty(lS,"__esModule",{value:!0});lS.createPrintf=void 0;const AO=vE,Gve=uS,Hve=(e,t)=>t.placeholder,Wve=e=>{var t;const n=(o,s,a)=>a==="-"?o.padEnd(s," "):a==="-+"?((Number(o)>=0?"+":"")+o).padEnd(s," "):a==="+"?((Number(o)>=0?"+":"")+o).padStart(s," "):a==="0"?o.padStart(s,"0"):o.padStart(s," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:Hve,i={};return(o,...s)=>{let a=i[o];a||(a=i[o]=Gve.tokenize(o));let l="";for(const u of a)if(u.type==="literal")l+=u.literal;else{let d=s[u.position];if(d===void 0)l+=r(o,u,s);else if(u.conversion==="b")l+=AO.boolean(d)?"true":"false";else if(u.conversion==="B")l+=AO.boolean(d)?"TRUE":"FALSE";else if(u.conversion==="c")l+=d;else if(u.conversion==="C")l+=String(d).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")d=String(Math.trunc(d)),u.width!==null&&(d=n(d,u.width,u.flag)),l+=d;else if(u.conversion==="e")l+=Number(d).toExponential();else if(u.conversion==="E")l+=Number(d).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(d=Number(d).toFixed(u.precision)),u.width!==null&&(d=n(String(d),u.width,u.flag)),l+=d;else if(u.conversion==="o")l+=(Number.parseInt(String(d),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(d=n(String(d),u.width,u.flag)),l+=d;else if(u.conversion==="S")u.width!==null&&(d=n(String(d),u.width,u.flag)),l+=String(d).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(d),10)>>>0;else if(u.conversion==="x")d=(Number.parseInt(String(d),10)>>>0).toString(16),u.width!==null&&(d=n(String(d),u.width,u.flag)),l+=d;else throw new Error("Unknown format specifier.")}return l}};lS.createPrintf=Wve;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=lS;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(RU);var c5={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=x();r.configure=x,r.stringify=r,r.default=r,t.stringify=r,t.configure=x,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(_){return _.length<5e3&&!i.test(_)?`"${_}"`:JSON.stringify(_)}function s(_){if(_.length>200)return _.sort();for(let b=1;b<_.length;b++){const y=_[b];let S=b;for(;S!==0&&_[S-1]>y;)_[S]=_[S-1],S--;_[S]=y}return _}const a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(_){return a.call(_)!==void 0&&_.length!==0}function u(_,b,y){_.length<y&&(y=_.length);const S=b===","?"":" ";let C=`"0":${S}${_[0]}`;for(let T=1;T<y;T++)C+=`${b}"${T}":${S}${_[T]}`;return C}function d(_){if(n.call(_,"circularValue")){const b=_.circularValue;if(typeof b=="string")return`"${b}"`;if(b==null)return b;if(b===Error||b===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(_,b){let y;if(n.call(_,b)&&(y=_[b],typeof y!="boolean"))throw new TypeError(`The "${b}" argument must be of type boolean`);return y===void 0?!0:y}function h(_,b){let y;if(n.call(_,b)){if(y=_[b],typeof y!="number")throw new TypeError(`The "${b}" argument must be of type number`);if(!Number.isInteger(y))throw new TypeError(`The "${b}" argument must be an integer`);if(y<1)throw new RangeError(`The "${b}" argument must be >= 1`)}return y===void 0?1/0:y}function g(_){return _===1?"1 item":`${_} items`}function m(_){const b=new Set;for(const y of _)(typeof y=="string"||typeof y=="number")&&b.add(String(y));return b}function v(_){if(n.call(_,"strict")){const b=_.strict;if(typeof b!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(b)return y=>{let S=`Object can not safely be stringified. Received type ${typeof y}`;throw typeof y!="function"&&(S+=` (${y.toString()})`),new Error(S)}}}function x(_){_={..._};const b=v(_);b&&(_.bigint===void 0&&(_.bigint=!1),"circularValue"in _||(_.circularValue=Error));const y=d(_),S=f(_,"bigint"),C=f(_,"deterministic"),T=h(_,"maximumDepth"),E=h(_,"maximumBreadth");function P(B,A,N,D,U,$){let j=A[B];switch(typeof j=="object"&&j!==null&&typeof j.toJSON=="function"&&(j=j.toJSON(B)),j=D.call(A,B,j),typeof j){case"string":return o(j);case"object":{if(j===null)return"null";if(N.indexOf(j)!==-1)return y;let G="",q=",";const Z=$;if(Array.isArray(j)){if(j.length===0)return"[]";if(T<N.length+1)return'"[Array]"';N.push(j),U!==""&&($+=U,G+=`
|
||
${$}`,q=`,
|
||
${$}`);const ne=Math.min(j.length,E);let fe=0;for(;fe<ne-1;fe++){const ve=P(String(fe),j,N,D,U,$);G+=ve!==void 0?ve:"null",G+=q}const pe=P(String(fe),j,N,D,U,$);if(G+=pe!==void 0?pe:"null",j.length-1>E){const ve=j.length-E-1;G+=`${q}"... ${g(ve)} not stringified"`}return U!==""&&(G+=`
|
||
${Z}`),N.pop(),`[${G}]`}let ee=Object.keys(j);const ie=ee.length;if(ie===0)return"{}";if(T<N.length+1)return'"[Object]"';let se="",le="";U!==""&&($+=U,q=`,
|
||
${$}`,se=" ");const W=Math.min(ie,E);C&&!l(j)&&(ee=s(ee)),N.push(j);for(let ne=0;ne<W;ne++){const fe=ee[ne],pe=P(fe,j,N,D,U,$);pe!==void 0&&(G+=`${le}${o(fe)}:${se}${pe}`,le=q)}if(ie>E){const ne=ie-E;G+=`${le}"...":${se}"${g(ne)} not stringified"`,le=q}return U!==""&&le.length>1&&(G=`
|
||
${$}${G}
|
||
${Z}`),N.pop(),`{${G}}`}case"number":return isFinite(j)?String(j):b?b(j):"null";case"boolean":return j===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(j);default:return b?b(j):void 0}}function k(B,A,N,D,U,$){switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(B)),typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(N.indexOf(A)!==-1)return y;const j=$;let G="",q=",";if(Array.isArray(A)){if(A.length===0)return"[]";if(T<N.length+1)return'"[Array]"';N.push(A),U!==""&&($+=U,G+=`
|
||
${$}`,q=`,
|
||
${$}`);const ie=Math.min(A.length,E);let se=0;for(;se<ie-1;se++){const W=k(String(se),A[se],N,D,U,$);G+=W!==void 0?W:"null",G+=q}const le=k(String(se),A[se],N,D,U,$);if(G+=le!==void 0?le:"null",A.length-1>E){const W=A.length-E-1;G+=`${q}"... ${g(W)} not stringified"`}return U!==""&&(G+=`
|
||
${j}`),N.pop(),`[${G}]`}N.push(A);let Z="";U!==""&&($+=U,q=`,
|
||
${$}`,Z=" ");let ee="";for(const ie of D){const se=k(ie,A[ie],N,D,U,$);se!==void 0&&(G+=`${ee}${o(ie)}:${Z}${se}`,ee=q)}return U!==""&&ee.length>1&&(G=`
|
||
${$}${G}
|
||
${j}`),N.pop(),`{${G}}`}case"number":return isFinite(A)?String(A):b?b(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(A);default:return b?b(A):void 0}}function O(B,A,N,D,U){switch(typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(typeof A.toJSON=="function"){if(A=A.toJSON(B),typeof A!="object")return O(B,A,N,D,U);if(A===null)return"null"}if(N.indexOf(A)!==-1)return y;const $=U;if(Array.isArray(A)){if(A.length===0)return"[]";if(T<N.length+1)return'"[Array]"';N.push(A),U+=D;let se=`
|
||
${U}`;const le=`,
|
||
${U}`,W=Math.min(A.length,E);let ne=0;for(;ne<W-1;ne++){const pe=O(String(ne),A[ne],N,D,U);se+=pe!==void 0?pe:"null",se+=le}const fe=O(String(ne),A[ne],N,D,U);if(se+=fe!==void 0?fe:"null",A.length-1>E){const pe=A.length-E-1;se+=`${le}"... ${g(pe)} not stringified"`}return se+=`
|
||
${$}`,N.pop(),`[${se}]`}let j=Object.keys(A);const G=j.length;if(G===0)return"{}";if(T<N.length+1)return'"[Object]"';U+=D;const q=`,
|
||
${U}`;let Z="",ee="",ie=Math.min(G,E);l(A)&&(Z+=u(A,q,E),j=j.slice(A.length),ie-=A.length,ee=q),C&&(j=s(j)),N.push(A);for(let se=0;se<ie;se++){const le=j[se],W=O(le,A[le],N,D,U);W!==void 0&&(Z+=`${ee}${o(le)}: ${W}`,ee=q)}if(G>E){const se=G-E;Z+=`${ee}"...": "${g(se)} not stringified"`,ee=q}return ee!==""&&(Z=`
|
||
${U}${Z}
|
||
${$}`),N.pop(),`{${Z}}`}case"number":return isFinite(A)?String(A):b?b(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(A);default:return b?b(A):void 0}}function M(B,A,N){switch(typeof A){case"string":return o(A);case"object":{if(A===null)return"null";if(typeof A.toJSON=="function"){if(A=A.toJSON(B),typeof A!="object")return M(B,A,N);if(A===null)return"null"}if(N.indexOf(A)!==-1)return y;let D="";if(Array.isArray(A)){if(A.length===0)return"[]";if(T<N.length+1)return'"[Array]"';N.push(A);const q=Math.min(A.length,E);let Z=0;for(;Z<q-1;Z++){const ie=M(String(Z),A[Z],N);D+=ie!==void 0?ie:"null",D+=","}const ee=M(String(Z),A[Z],N);if(D+=ee!==void 0?ee:"null",A.length-1>E){const ie=A.length-E-1;D+=`,"... ${g(ie)} not stringified"`}return N.pop(),`[${D}]`}let U=Object.keys(A);const $=U.length;if($===0)return"{}";if(T<N.length+1)return'"[Object]"';let j="",G=Math.min($,E);l(A)&&(D+=u(A,",",E),U=U.slice(A.length),G-=A.length,j=","),C&&(U=s(U)),N.push(A);for(let q=0;q<G;q++){const Z=U[q],ee=M(Z,A[Z],N);ee!==void 0&&(D+=`${j}${o(Z)}:${ee}`,j=",")}if($>E){const q=$-E;D+=`${j}"...":"${g(q)} not stringified"`}return N.pop(),`{${D}}`}case"number":return isFinite(A)?String(A):b?b(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(S)return String(A);default:return b?b(A):void 0}}function V(B,A,N){if(arguments.length>1){let D="";if(typeof N=="number"?D=" ".repeat(Math.min(N,10)):typeof N=="string"&&(D=N.slice(0,10)),A!=null){if(typeof A=="function")return P("",{"":B},[],A,D,"");if(Array.isArray(A))return k("",B,[],m(A),D,"")}if(D.length!==0)return O("",B,[],D,"")}return M("",B,[])}return V}})(c5,c5.exports);var qve=c5.exports;(function(e){var t=Ze&&Ze.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=wc,r=Um,i=PU,o=RU,s=t(_E),a=t(qve);let l=!1;const u=(0,s.default)(),d=()=>u.ROARR,f=()=>({messageContext:{},transforms:[]}),h=()=>{const y=d().asyncLocalStorage;if(!y)throw new Error("AsyncLocalContext is unavailable.");const S=y.getStore();return S||f()},g=()=>!!d().asyncLocalStorage,m=()=>{if(g()){const y=h();return(0,i.hasOwnProperty)(y,"sequenceRoot")&&(0,i.hasOwnProperty)(y,"sequence")&&typeof y.sequence=="number"?String(y.sequenceRoot)+"."+String(y.sequence++):String(d().sequence++)}return String(d().sequence++)},v=(y,S)=>(C,T,E,P,k,O,M,V,B,A)=>{y.child({logLevel:S})(C,T,E,P,k,O,M,V,B,A)},x=1e3,_=(y,S)=>(C,T,E,P,k,O,M,V,B,A)=>{const N=(0,a.default)({a:C,b:T,c:E,d:P,e:k,f:O,g:M,h:V,i:B,j:A,logLevel:S});if(!N)throw new Error("Expected key to be a string");const D=d().onceLog;D.has(N)||(D.add(N),D.size>x&&D.clear(),y.child({logLevel:S})(C,T,E,P,k,O,M,V,B,A))},b=(y,S={},C=[])=>{const T=(E,P,k,O,M,V,B,A,N,D)=>{const U=Date.now(),$=m();let j;g()?j=h():j=f();let G,q;if(typeof E=="string"?G={...j.messageContext,...S}:G={...j.messageContext,...S,...E},typeof E=="string"&&P===void 0)q=E;else if(typeof E=="string"){if(!E.includes("%"))throw new Error("When a string parameter is followed by other arguments, then it is assumed that you are attempting to format a message using printf syntax. You either forgot to add printf bindings or if you meant to add context to the log message, pass them in an object as the first parameter.");q=(0,o.printf)(E,P,k,O,M,V,B,A,N,D)}else{let ee=P;if(typeof P!="string")if(P===void 0)ee="";else throw new TypeError("Message must be a string. Received "+typeof P+".");q=(0,o.printf)(ee,k,O,M,V,B,A,N,D)}let Z={context:G,message:q,sequence:$,time:U,version:n.ROARR_LOG_FORMAT_VERSION};for(const ee of[...j.transforms,...C])if(Z=ee(Z),typeof Z!="object"||Z===null)throw new Error("Message transform function must return a message object.");y(Z)};return T.child=E=>{let P;return g()?P=h():P=f(),typeof E=="function"?(0,e.createLogger)(y,{...P.messageContext,...S,...E},[E,...C]):(0,e.createLogger)(y,{...P.messageContext,...S,...E},C)},T.getContext=()=>{let E;return g()?E=h():E=f(),{...E.messageContext,...S}},T.adopt=async(E,P)=>{if(!g())return l===!1&&(l=!0,y({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:m(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),E();const k=h();let O;(0,i.hasOwnProperty)(k,"sequenceRoot")&&(0,i.hasOwnProperty)(k,"sequence")&&typeof k.sequence=="number"?O=k.sequenceRoot+"."+String(k.sequence++):O=String(d().sequence++);let M={...k.messageContext};const V=[...k.transforms];typeof P=="function"?V.push(P):M={...M,...P};const B=d().asyncLocalStorage;if(!B)throw new Error("Async local context unavailable.");return B.run({messageContext:M,sequence:0,sequenceRoot:O,transforms:V},()=>E())},T.debug=v(T,r.logLevels.debug),T.debugOnce=_(T,r.logLevels.debug),T.error=v(T,r.logLevels.error),T.errorOnce=_(T,r.logLevels.error),T.fatal=v(T,r.logLevels.fatal),T.fatalOnce=_(T,r.logLevels.fatal),T.info=v(T,r.logLevels.info),T.infoOnce=_(T,r.logLevels.info),T.trace=v(T,r.logLevels.trace),T.traceOnce=_(T,r.logLevels.trace),T.warn=v(T,r.logLevels.warn),T.warnOnce=_(T,r.logLevels.warn),T};e.createLogger=b})(AU);var cS={},Kve=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var s=Number(r[o]),a=Number(i[o]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return 0},Xve=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cS,"__esModule",{value:!0});cS.createRoarrInitialGlobalStateBrowser=void 0;const PO=wc,RO=Xve(Kve),Yve=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(RO.default),t.includes(PO.ROARR_VERSION)||t.push(PO.ROARR_VERSION),t.sort(RO.default),{sequence:0,...e,versions:t}};cS.createRoarrInitialGlobalStateBrowser=Yve;var dS={};Object.defineProperty(dS,"__esModule",{value:!0});dS.getLogLevelName=void 0;const Qve=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";dS.getLogLevelName=Qve;(function(e){var t=Ze&&Ze.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const n=AU,r=cS,o=(0,t(_E).default)(),s=(0,r.createRoarrInitialGlobalStateBrowser)(o.ROARR||{});e.ROARR=s,o.ROARR=s;const a=f=>JSON.stringify(f),l=(0,n.createLogger)(f=>{var h;s.write&&s.write(((h=s.serializeMessage)!==null&&h!==void 0?h:a)(f))});e.Roarr=l;var u=Um;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var d=dS;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return d.getLogLevelName}})})(Bm);var Zve=Ze&&Ze.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Jve=Ze&&Ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qb,"__esModule",{value:!0});qb.createLogWriter=void 0;var e1e=Kb,t1e=vE,n1e=Jve(_E),OU=yU,r1e=Bm,OO=(0,n1e.default)(),i1e={debug:{backgroundColor:"#712bde",color:"#fff"},error:{backgroundColor:"#f05033",color:"#fff"},fatal:{backgroundColor:"#f05033",color:"#fff"},info:{backgroundColor:"#3174f1",color:"#fff"},trace:{backgroundColor:"#666",color:"#fff"},warn:{backgroundColor:"#f5a623",color:"#000"}},o1e={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},s1e=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,OU.parse)(t):null},a1e=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:OO.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,e1e.createLogMethods)();if(!r&&!OO.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,t1e.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=s1e(r);return function(s){var a=JSON.parse(s),l=a.context,u=l.logLevel,d=l.namespace,f=Zve(l,["logLevel","namespace"]);if(!(o&&!(0,OU.test)(o,a))){var h=(0,r1e.getLogLevelName)(Number(u)),g=i[h],m=i1e[h],v=`
|
||
background-color: `.concat(m.backgroundColor,`;
|
||
color: `).concat(m.color,`;
|
||
font-weight: bold;
|
||
`),x=`
|
||
color: `.concat(o1e[h].color,`;
|
||
`),_=`
|
||
color: inherit;
|
||
`;Object.keys(f).length>0?g("%c ".concat(h," %c").concat(d?" [".concat(String(d),"]:"):"","%c ").concat(a.message," %O"),v,x,_,f):g("%c ".concat(h," %c").concat(d?" [".concat(String(d),"]:"):"","%c ").concat(a.message),v,x,_)}}};qb.createLogWriter=a1e;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=qb;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(oU);Bm.ROARR.write=oU.createLogWriter();const kU={};Bm.Roarr.child(kU);const fS=Om(Bm.Roarr.child(kU)),ke=e=>fS.get().child({namespace:e}),o7e=["trace","debug","info","warn","error","fatal"],s7e={trace:10,debug:20,info:30,warn:40,error:50,fatal:60};function l1e(){const e=[];return function(t,n){if(typeof n!="object"||n===null)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}const qg=Jl("nodes/receivedOpenAPISchema",async(e,{dispatch:t,rejectWithValue:n})=>{const r=ke("system");try{const o=await(await fetch("openapi.json")).json();return r.info({openAPISchema:o},"Received OpenAPI schema"),JSON.parse(JSON.stringify(o,l1e()))}catch(i){return n({error:i})}}),IU={nodes:[],edges:[],schema:null,invocationTemplates:{},connectionStartParams:null,shouldShowGraphOverlay:!1,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,editorInstance:void 0,progressNodeSize:{width:512,height:512}},MU=An({name:"nodes",initialState:IU,reducers:{nodesChanged:(e,t)=>{e.nodes=XB(t.payload,e.nodes)},nodeAdded:(e,t)=>{e.nodes.push(t.payload)},edgesChanged:(e,t)=>{e.edges=_ye(t.payload,e.edges)},connectionStarted:(e,t)=>{e.connectionStartParams=t.payload},connectionMade:(e,t)=>{e.edges=wB(t.payload,e.edges)},connectionEnded:e=>{e.connectionStartParams=null},fieldValueChanged:(e,t)=>{var a,l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n),s=(u=(l=(a=e.nodes)==null?void 0:a[o])==null?void 0:l.data)==null?void 0:u.inputs[r];s&&o>-1&&(s.value=i)},imageCollectionFieldValueChanged:(e,t)=>{var l,u,d;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(f=>f.id===n);if(o===-1)return;const s=(d=(u=(l=e.nodes)==null?void 0:l[o])==null?void 0:u.data)==null?void 0:d.inputs[r];if(!s)return;const a=Qr(s.value);if(!a){s.value=i;return}s.value=wle(a.concat(i),"image_name")},shouldShowGraphOverlayChanged:(e,t)=>{e.shouldShowGraphOverlay=t.payload},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.invocationTemplates=t.payload},nodeEditorReset:e=>{e.nodes=[],e.edges=[]},setEditorInstance:(e,t)=>{e.editorInstance=t.payload},loadFileNodes:(e,t)=>{e.nodes=t.payload},loadFileEdges:(e,t)=>{e.edges=t.payload},setProgressNodeSize:(e,t)=>{e.progressNodeSize=t.payload}},extraReducers:e=>{e.addCase(qg.fulfilled,(t,n)=>{t.schema=n.payload})}}),{nodesChanged:a7e,edgesChanged:l7e,nodeAdded:u7e,fieldValueChanged:NU,connectionMade:c7e,connectionStarted:d7e,connectionEnded:f7e,shouldShowGraphOverlayChanged:h7e,shouldShowFieldTypeLegendChanged:p7e,shouldShowMinimapPanelChanged:g7e,nodeTemplatesBuilt:wE,nodeEditorReset:xE,imageCollectionFieldValueChanged:m7e,setEditorInstance:y7e,loadFileNodes:v7e,loadFileEdges:_7e,setProgressNodeSize:b7e}=MU.actions,u1e=MU.reducer,LU={esrganModelName:"RealESRGAN_x4plus.pth"},DU=An({name:"postprocessing",initialState:LU,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:S7e}=DU.actions,c1e=DU.reducer,d1e={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.7},$U=An({name:"sdxl",initialState:d1e,reducers:{setPositiveStylePromptSDXL:(e,t)=>{e.positiveStylePrompt=t.payload},setNegativeStylePromptSDXL:(e,t)=>{e.negativeStylePrompt=t.payload},setShouldConcatSDXLStylePrompt:(e,t)=>{e.shouldConcatSDXLStylePrompt=t.payload},setShouldUseSDXLRefiner:(e,t)=>{e.shouldUseSDXLRefiner=t.payload},setSDXLImg2ImgDenoisingStrength:(e,t)=>{e.sdxlImg2ImgDenoisingStrength=t.payload},refinerModelChanged:(e,t)=>{e.refinerModel=t.payload},setRefinerSteps:(e,t)=>{e.refinerSteps=t.payload},setRefinerCFGScale:(e,t)=>{e.refinerCFGScale=t.payload},setRefinerScheduler:(e,t)=>{e.refinerScheduler=t.payload},setRefinerPositiveAestheticScore:(e,t)=>{e.refinerPositiveAestheticScore=t.payload},setRefinerNegativeAestheticScore:(e,t)=>{e.refinerNegativeAestheticScore=t.payload},setRefinerStart:(e,t)=>{e.refinerStart=t.payload}}}),{setPositiveStylePromptSDXL:w7e,setNegativeStylePromptSDXL:x7e,setShouldConcatSDXLStylePrompt:C7e,setShouldUseSDXLRefiner:f1e,setSDXLImg2ImgDenoisingStrength:T7e,refinerModelChanged:kO,setRefinerSteps:E7e,setRefinerCFGScale:A7e,setRefinerScheduler:P7e,setRefinerPositiveAestheticScore:R7e,setRefinerNegativeAestheticScore:O7e,setRefinerStart:k7e}=$U.actions,h1e=$U.reducer,zm=Me("app/userInvoked"),p1e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class i_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||p1e,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new i_(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new i_(this.logger,t)}}var Bs=new i_;class hS{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(s=>{s(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(s=>{s.apply(s,[t,...r])})}}function cp(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function IO(e){return e==null?"":""+e}function g1e(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function CE(e,t,n){function r(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const s=r(o.shift());!e[s]&&n&&(e[s]=new n),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function MO(e,t,n){const{obj:r,k:i}=CE(e,t,Object);r[i]=n}function m1e(e,t,n,r){const{obj:i,k:o}=CE(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function o_(e,t){const{obj:n,k:r}=CE(e,t);if(n)return n[r]}function y1e(e,t,n){const r=o_(e,n);return r!==void 0?r:o_(t,n)}function FU(e,t,n){for(const 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]):FU(e[r],t[r],n):e[r]=t[r]);return e}function Sd(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var v1e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function _1e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>v1e[t]):e}const b1e=[" ",",","?","!",";"];function S1e(e,t,n){t=t||"",n=n||"";const r=b1e.filter(s=>t.indexOf(s)<0&&n.indexOf(s)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(e);if(!o){const s=e.indexOf(n);s>0&&!i.test(e.substring(0,s))&&(o=!0)}return o}function s_(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let s=2,a=r.slice(o,o+s).join(n),l=i[a];for(;l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[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]}const u=r.slice(o+s).join(n);return u?s_(l,u,n):void 0}i=i[r[o]]}return i}function a_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class NO extends hS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a=[t,n];r&&typeof r!="string"&&(a=a.concat(r)),r&&typeof r=="string"&&(a=a.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(a=t.split("."));const l=o_(this.data,a);return l||!s||typeof r!="string"?l:s_(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[t,n];r&&(a=a.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(a=t.split("."),i=n,n=a[1]),this.addNamespaces(n),MO(this.data,a,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Object.prototype.toString.apply(r[o])==="[object Array]")&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},a=[t,n];t.indexOf(".")>-1&&(a=t.split("."),i=r,r=n,n=a[1]),this.addNamespaces(n);let l=o_(this.data,a)||{};i?FU(l,r,o):l={...l,...r},MO(this.data,a,l),s.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var BU={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const LO={};class l_ extends hS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),g1e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Bs.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const s=r&&t.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!S1e(t,r,i);if(s&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],n),l=a[a.length-1],u=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(d){const S=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${S}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l}:`${l}${S}${s}`}return i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l}:s}const f=this.resolve(t,n);let h=f&&f.res;const g=f&&f.usedKey||s,m=f&&f.exactUsedKey||s,v=Object.prototype.toString.apply(h),x=["[object Number]","[object Function]","[object RegExp]"],_=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&h&&(typeof h!="string"&&typeof h!="boolean"&&typeof h!="number")&&x.indexOf(v)<0&&!(typeof _=="string"&&v==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,h,{...n,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(f.res=S,f):S}if(o){const S=v==="[object Array]",C=S?[]:{},T=S?m:g;for(const E in h)if(Object.prototype.hasOwnProperty.call(h,E)){const P=`${T}${o}${E}`;C[E]=this.translate(P,{...n,joinArrays:!1,ns:a}),C[E]===P&&(C[E]=h[E])}h=C}}else if(b&&typeof _=="string"&&v==="[object Array]")h=h.join(_),h&&(h=this.extendTranslation(h,t,n,r));else{let S=!1,C=!1;const T=n.count!==void 0&&typeof n.count!="string",E=l_.hasDefaultValue(n),P=T?this.pluralResolver.getSuffix(u,n.count,n):"",k=n.ordinal&&T?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",O=n[`defaultValue${P}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(h)&&E&&(S=!0,h=O),this.isValidLookup(h)||(C=!0,h=s);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:h,B=E&&O!==h&&this.options.updateMissing;if(C||S||B){if(this.logger.log(B?"updateKey":"missingKey",u,l,s,B?O:h),o){const U=this.resolve(s,{...n,keySeparator:!1});U&&U.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.")}let A=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let U=0;U<N.length;U++)A.push(N[U]);else this.options.saveMissingTo==="all"?A=this.languageUtils.toResolveHierarchy(n.lng||this.language):A.push(n.lng||this.language);const D=(U,$,j)=>{const G=E&&j!==h?j:V;this.options.missingKeyHandler?this.options.missingKeyHandler(U,l,$,G,B,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(U,l,$,G,B,n),this.emit("missingKey",U,l,$,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?A.forEach(U=>{this.pluralResolver.getSuffixes(U,n).forEach($=>{D([U],s+$,n[`defaultValue${$}`]||O)})}):D(A,s,O))}h=this.extendTranslation(h,t,n,f,r),C&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}:${s}`),(C||S)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${s}`:s,S?h:void 0):h=this.options.parseMissingKeyHandler(h))}return i?(f.res=h,f):h}extendTranslation(t,n,r,i,o){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const h=t.match(this.interpolator.nestingRegexp);d=h&&h.length}let f=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language,r),u){const h=t.match(this.interpolator.nestingRegexp),g=h&&h.length;d<g&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var h=arguments.length,g=new Array(h),m=0;m<h;m++)g[m]=arguments[m];return o&&o[0]===g[0]&&!r.context?(s.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):s.translate(...g,n)},r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,l=typeof a=="string"?[a]:a;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=BU.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,s,a;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&typeof n.count!="string",g=h&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",v=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(x=>{this.isValidLookup(r)||(a=x,!LO[`${v[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(LO[`${v[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${v.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),v.forEach(_=>{if(this.isValidLookup(r))return;s=_;const b=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(b,d,_,x,n);else{let S;h&&(S=this.pluralResolver.getSuffix(_,n.count,n));const C=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(b.push(d+S),n.ordinal&&S.indexOf(T)===0&&b.push(d+S.replace(T,this.options.pluralSeparator)),g&&b.push(d+C)),m){const E=`${d}${this.options.contextSeparator}${n.context}`;b.push(E),h&&(b.push(E+S),n.ordinal&&S.indexOf(T)===0&&b.push(E+S.replace(T,this.options.pluralSeparator)),g&&b.push(E+C))}}let y;for(;y=b.pop();)this.isValidLookup(r)||(o=y,r=this.getResource(_,x,y,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function Vx(e){return e.charAt(0).toUpperCase()+e.slice(1)}class DO{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Bs.create("languageUtils")}getScriptPartFromCode(t){if(t=a_(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=a_(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Vx(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=Vx(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=Vx(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}let w1e=[{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}],x1e={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const C1e=["v1","v2","v3"],T1e=["v4"],$O={zero:0,one:1,two:2,few:3,many:4,other:5};function E1e(){const e={};return w1e.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:x1e[t.fc]}})}),e}class A1e{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Bs.create("pluralResolver"),(!this.options.compatibilityJSON||T1e.includes(this.options.compatibilityJSON))&&(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=E1e()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(a_(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>$O[i]-$O[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!C1e.includes(this.options.compatibilityJSON)}}function FO(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=y1e(e,t,n);return!o&&i&&typeof n=="string"&&(o=s_(e,n,r),o===void 0&&(o=s_(t,n,r))),o}class P1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Bs.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:_1e,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Sd(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Sd(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Sd(n.nestingPrefix):n.nestingPrefixEscaped||Sd("$t("),this.nestingSuffix=n.nestingSuffix?Sd(n.nestingSuffix):n.nestingSuffixEscaped||Sd(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,s,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(m){return m.replace(/\$/g,"$$$$")}const d=m=>{if(m.indexOf(this.formatSeparator)<0){const b=FO(n,l,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...i,...n,interpolationkey:m}):b}const v=m.split(this.formatSeparator),x=v.shift().trim(),_=v.join(this.formatSeparator).trim();return this.format(FO(n,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),_,r,{...i,...n,interpolationkey:x})};this.resetRegExp();const f=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>u(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?u(this.escape(m)):u(m)}].forEach(m=>{for(a=0;o=m.regex.exec(t);){const v=o[1].trim();if(s=d(v),s===void 0)if(typeof f=="function"){const _=f(t,o,i);s=typeof _=="string"?_:""}else if(i&&Object.prototype.hasOwnProperty.call(i,v))s="";else if(h){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=IO(s));const x=m.safeValue(s);if(t=t.replace(o[0],x),h?(m.regex.lastIndex+=s.length,m.regex.lastIndex-=o[0].length):m.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,s;function a(l,u){const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;l=f[0],h=this.interpolate(h,s);const g=h.match(/'/g),m=h.match(/"/g);(g&&g.length%2===0&&!m||m.length%2!==0)&&(h=h.replace(/'/g,'"'));try{s=JSON.parse(h),u&&(s={...u,...s})}catch(v){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,v),`${l}${d}${h}`}return delete s.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];s={...r},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(f=>f.trim());i[1]=d.shift(),l=d,u=!0}if(o=n(a.call(this,i[1].trim(),s),s),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=IO(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function R1e(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(s=>{if(!s)return;const[a,...l]=s.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[a.trim()]||(n[a.trim()]=u),u==="false"&&(n[a.trim()]=!1),u==="true"&&(n[a.trim()]=!0),isNaN(u)||(n[a.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function wd(e){const t={};return function(r,i,o){const s=i+JSON.stringify(o);let a=t[s];return a||(a=e(a_(i),o),t[s]=a),a(r)}}class O1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Bs.create("formatter"),this.options=t,this.formats={number:wd((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:wd((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:wd((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:wd((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:wd((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=wd(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((a,l)=>{const{formatName:u,formatOptions:d}=R1e(l);if(this.formats[u]){let f=a;try{const h=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},g=h.locale||h.lng||i.locale||i.lng||r;f=this.formats[u](a,g,{...d,...i,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},t)}}function k1e(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class I1e extends hS{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Bs.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},s={},a={},l={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?s[h]===void 0&&(s[h]=!0):(this.state[h]=1,d=!1,s[h]===void 0&&(s[h]=!0),o[h]===void 0&&(o[h]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(a[u]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],s=i[1];n&&this.emit("failedLoading",o,s,n),r&&this.store.addResourceBundle(o,s,r),this.state[t]=n?-1:2;const a={};this.queue.forEach(l=>{m1e(l.loaded,[o],s),k1e(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const d=l.loaded[u];d.length&&d.forEach(f=>{a[u][f]===void 0&&(a[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,s)},o);return}s(u,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return l(t,n,a)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,s),!s&&a&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,a),this.loaded(t,s,a)})}saveMissing(t,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...s,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(t,n,r,i,l):d=u(t,n,r,i),d&&typeof d.then=="function"?d.then(f=>a(null,f)).catch(a):a(null,d)}catch(d){a(d)}else u(t,n,r,i,a,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function BO(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(i=>{n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function UO(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 V0(){}function M1e(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Kg extends hS{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=UO(t),this.services={},this.logger=Bs,this.modules={external:[]},M1e(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=BO();this.options={...i,...this.options,...UO(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?Bs.init(o(this.modules.logger),this.options):Bs.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl<"u"&&(d=O1e);const f=new DO(this.options);this.store=new NO(this.options.resources,this.options);const h=this.services;h.logger=Bs,h.resourceStore=this.store,h.languageUtils=f,h.pluralResolver=new A1e(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(h.formatter=o(d),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new P1e(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new I1e(o(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(g){for(var m=arguments.length,v=new Array(m>1?m-1:0),x=1;x<m;x++)v[x-1]=arguments[x];t.emit(g,...v)}),this.modules.languageDetector&&(h.languageDetector=o(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=o(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new l_(this.services,this.options),this.translator.on("*",function(g){for(var m=arguments.length,v=new Array(m>1?m-1:0),x=1;x<m;x++)v[x-1]=arguments[x];t.emit(g,...v)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,r||(r=V0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const l=cp(),u=()=>{const d=(f,h)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(h),r(f,h)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V0;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return r();const o=[],s=a=>{if(!a)return;this.services.languageUtils.toResolveHierarchy(a).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>s(l)),this.options.preload&&this.options.preload.forEach(a=>s(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,n,r){const i=cp();return t||(t=this.languages),n||(n=this.options.ns),r||(r=V0),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&BU.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=cp();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},s=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,d=>{s(d,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),i}getFixedT(t,n,r){var i=this;const o=function(s,a){let l;if(typeof a!="object"){for(var u=arguments.length,d=new Array(u>2?u-2:0),f=2;f<u;f++)d[f-2]=arguments[f];l=i.options.overloadTranslationOptionHandler([s,a].concat(d))}else l={...a};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||r||o.keyPrefix;const h=i.options.keySeparator||".";let g;return l.keyPrefix&&Array.isArray(s)?g=s.map(m=>`${l.keyPrefix}${h}${m}`):g=l.keyPrefix?`${l.keyPrefix}${h}${s}`:s,i.t(g,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=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;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===2};if(n.precheck){const a=n.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}loadNamespaces(t,n){const r=cp();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=cp();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(s=>i.indexOf(s)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new DO(BO());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Kg(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V0;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Kg(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new NO(this.store.data,i),o.services.resourceStore=o.store),o.translator=new l_(o.services,i),o.translator.on("*",function(a){for(var l=arguments.length,u=new Array(l>1?l-1:0),d=1;d<l;d++)u[d-1]=arguments[d];o.emit(a,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const oi=Kg.createInstance();oi.createInstance=Kg.createInstance;oi.createInstance;oi.dir;oi.init;oi.loadResources;oi.reloadResources;oi.use;oi.changeLanguage;oi.getFixedT;const jp=oi.t;oi.exists;oi.setDefaultNamespace;oi.hasLoadedNamespace;oi.loadNamespaces;oi.loadLanguages;const lc=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},UU={isConnected:!1,isProcessing:!1,isGFPGANAvailable:!0,isESRGANAvailable:!0,shouldConfirmOnDelete:!0,currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatusHasSteps:!1,isCancelable:!0,enableImageDebugging:!1,toastQueue:[],progressImage:null,shouldAntialiasProgressImage:!1,sessionId:null,cancelType:"immediate",isCancelScheduled:!1,subscribedNodeIds:[],wereModelsReceived:!1,wasSchemaParsed:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,statusTranslationKey:"common.statusDisconnected",canceledSession:"",isPersisted:!1,language:"en",isUploading:!1,isNodesEnabled:!1,shouldUseNSFWChecker:!1,shouldUseWatermarker:!1},zU=An({name:"system",initialState:UU,reducers:{setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.statusTranslationKey=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},cancelScheduled:e=>{e.isCancelScheduled=!0},scheduledCancelAborted:e=>{e.isCancelScheduled=!1},cancelTypeChanged:(e,t)=>{e.cancelType=t.payload},subscribedNodeIdsSet:(e,t)=>{e.subscribedNodeIds=t.payload},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},isPersistedChanged:(e,t)=>{e.isPersisted=t.payload},languageChanged:(e,t)=>{e.language=t.payload},progressImageSet(e,t){e.progressImage=t.payload},setIsNodesEnabled(e,t){e.isNodesEnabled=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload}},extraReducers(e){e.addCase(dF,(t,n)=>{t.sessionId=n.payload.sessionId,t.canceledSession=""}),e.addCase(hF,t=>{t.sessionId=null}),e.addCase(lF,t=>{t.isConnected=!0,t.isCancelable=!0,t.isProcessing=!1,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.statusTranslationKey="common.statusConnected"}),e.addCase(cF,t=>{t.isConnected=!1,t.isProcessing=!1,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusDisconnected"}),e.addCase(gF,t=>{t.isCancelable=!0,t.isProcessing=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusGenerating"}),e.addCase(SF,(t,n)=>{const{step:r,total_steps:i,progress_image:o}=n.payload.data;t.isProcessing=!0,t.isCancelable=!0,t.currentStatusHasSteps=!0,t.currentStep=r+1,t.totalSteps=i,t.progressImage=o??null,t.statusTranslationKey="common.statusGenerating"}),e.addCase(mF,(t,n)=>{const{data:r}=n.payload;t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusProcessingComplete",t.canceledSession===r.graph_execution_state_id&&(t.isProcessing=!1,t.isCancelable=!0)}),e.addCase(_F,t=>{t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null}),e.addCase(zm,t=>{t.isProcessing=!0,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.statusTranslationKey="common.statusPreparing"}),e.addCase(Oc.fulfilled,(t,n)=>{t.canceledSession=n.meta.arg.session_id,t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null,t.toastQueue.push(lc({title:jp("toast.canceled"),status:"warning"}))}),e.addCase(wE,t=>{t.wasSchemaParsed=!0}),e.addMatcher(S$,(t,n)=>{var i,o,s;t.isProcessing=!1,t.isCancelable=!1,t.isCancelScheduled=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusConnected",t.progressImage=null;let r;((i=n.payload)==null?void 0:i.status)===422?r="Validation Error":(o=n.payload)!=null&&o.error&&(r=(s=n.payload)==null?void 0:s.error),t.toastQueue.push(lc({title:jp("toast.serverError"),status:"error",description:r}))}),e.addMatcher(F1e,(t,n)=>{t.isProcessing=!1,t.isCancelable=!0,t.currentStatusHasSteps=!1,t.currentStep=0,t.totalSteps=0,t.statusTranslationKey="common.statusError",t.progressImage=null,t.toastQueue.push(lc({title:jp("toast.serverError"),status:"error",description:mle(n.payload.data.error_type)}))})}}),{setIsProcessing:I7e,setShouldConfirmOnDelete:M7e,setCurrentStatus:N7e,setIsCancelable:L7e,setEnableImageDebugging:D7e,addToast:Yn,clearToastQueue:$7e,cancelScheduled:F7e,scheduledCancelAborted:B7e,cancelTypeChanged:U7e,subscribedNodeIdsSet:z7e,consoleLogLevelChanged:V7e,shouldLogToConsoleChanged:j7e,isPersistedChanged:G7e,shouldAntialiasProgressImageChanged:H7e,languageChanged:W7e,progressImageSet:N1e,setIsNodesEnabled:q7e,shouldUseNSFWCheckerChanged:L1e,shouldUseWatermarkerChanged:D1e}=zU.actions,$1e=zU.reducer,F1e=Lo(ZT,TF,AF),B1e={searchFolder:null,advancedAddScanModel:null},VU=An({name:"modelmanager",initialState:B1e,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:K7e,setAdvancedAddScanModel:X7e}=VU.actions,U1e=VU.reducer,jU={shift:!1},GU=An({name:"hotkeys",initialState:jU,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload}}}),{shiftKeyPressed:Y7e}=GU.actions,z1e=GU.reducer,V1e=dQ(tee);HU=d5=void 0;var j1e=V1e,G1e=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(d){return function(f){return j1e.compose.apply(void 0,n)(d)(f)}}},o=function(){for(var u,d,f=arguments.length,h=Array(f),g=0;g<f;g++)h[g]=arguments[g];(u=n).push.apply(u,h.map(function(m){return m(r)})),(d=t).push.apply(d,h)},s=function(u){var d=t.findIndex(function(f){return f===u});if(d===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(f,h){return h!==d}),n=n.filter(function(f,h){return h!==d})},a=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:s,resetMiddlewares:a}},pS=G1e(),H1e=pS.enhancer,W1e=pS.addMiddleware;pS.removeMiddleware;var q1e=pS.resetMiddlewares,d5=W1e,HU=q1e,f5="@@REMEMBER_REHYDRATED",K1e="@@REMEMBER_PERSISTED";function h5(e){"@babel/helpers - typeof";return h5=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},h5(e)}var WU=function(t,n){if(t===null||h5(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},X1e=function(t,n){var r=0,i;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,s);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,s),clearTimeout(i),i=null},u)}},Y1e=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function zO(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function TE(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){zO(o,r,i,s,a,"next",l)}function a(l){zO(o,r,i,s,a,"throw",l)}s(void 0)})}}var Q1e=function(){var e=TE(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,s=yield r.getItem("".concat(i,"rootState"));return s==null?{}:WU(o(s,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),Z1e=function(){var e=TE(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,s=yield Promise.all(n.map(function(a){return r.getItem("".concat(i).concat(a))}));return n.reduce(function(a,l,u){return s[u]!==null&&s[u]!==void 0&&(a[l]=o(s[u],l)),a},{})});return function(n){return e.apply(this,arguments)}}(),J1e=function(){var e=TE(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.unserialize,l={};try{var u=s?Q1e:Z1e;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:a})}catch(d){console.warn("redux-remember: rehydrate error",d)}t.dispatch({type:f5,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function jx(e,t){return n_e(e)||t_e(e,t)||qU(e,t)||e_e()}function e_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t_e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}}function n_e(e){if(Array.isArray(e))return e}function Gx(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=qU(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function qU(e,t){if(e){if(typeof e=="string")return VO(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 VO(e,t)}}function VO(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 u_(e){"@babel/helpers - typeof";return u_=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},u_(e)}var jO=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},GO=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},r_e=function e(t,n){if(t===n)return!0;if(u_(t)!=="object"||u_(n)!=="object"||t===null||t===void 0||n===null||n===void 0)return t!==t&&n!==n;if(t.constructor!==n.constructor)return!1;if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(var r=t.length;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(GO(t)&&GO(n)){if(t.byteLength!==n.byteLength)return!1;for(var i=t.byteLength;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}var o=jO(t),s=jO(n);if(o==="DataView"&&s==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&s==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&s==="Map"){if(t.size!==n.size)return!1;var a=Gx(t.entries()),l;try{for(a.s();!(l=a.n()).done;){var u=jx(l.value,1),d=u[0];if(!n.has(d))return!1}}catch(P){a.e(P)}finally{a.f()}var f=Gx(t.entries()),h;try{for(f.s();!(h=f.n()).done;){var g=jx(h.value,2),m=g[0],v=g[1];if(!e(v,n.get(m)))return!1}}catch(P){f.e(P)}finally{f.f()}return!0}if(o==="Set"&&s==="Set"){if(t.size!==n.size)return!1;var x=Gx(t.entries()),_;try{for(x.s();!(_=x.n()).done;){var b=jx(_.value,1),y=b[0];if(!n.has(y))return!1}}catch(P){x.e(P)}finally{x.f()}return!0}if(o==="Date"&&s==="Date")return+t==+n;var S=Object.keys(t);if(S.length!==Object.keys(n).length)return!1;for(var C=S.length;C--!==0;)if(!Object.prototype.hasOwnProperty.call(n,S[C]))return!1;for(var T=S.length;T--!==0;){var E=S[T];if(!e(t[E],n[E]))return!1}return o!=="Object"&&s!=="Object"?t===n:!0};const EE=r_e;function HO(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function KU(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){HO(o,r,i,s,a,"next",l)}function a(l){HO(o,r,i,s,a,"throw",l)}s(void 0)})}}var i_e=function(){var e=KU(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;if(!EE(t,n))return o.setItem("".concat(i,"rootState"),s(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),o_e=function(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize;return Promise.all(Object.keys(t).map(function(a){return EE(t[a],n[a])?Promise.resolve():o.setItem("".concat(i).concat(a),s(t[a],a))}))},s_e=function(){var e=KU(function*(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=r.prefix,o=r.driver,s=r.persistWholeStore,a=r.serialize;try{var l=s?i_e:o_e;yield l(t,n,{prefix:i,driver:o,serialize:a})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function WO(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){n(u);return}a.done?t(l):Promise.resolve(l).then(r,i)}function qO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){WO(o,r,i,s,a,"next",l)}function a(l){WO(o,r,i,s,a,"throw",l)}s(void 0)})}}var a_e=function(){var e=qO(function*(t,n,r){var i=r.prefix,o=r.driver,s=r.serialize,a=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,d=r.persistWholeStore;yield J1e(t,n,{prefix:i,driver:o,unserialize:a,persistWholeStore:d});var f={},h=function(){var g=qO(function*(){var m=WU(t.getState(),n);yield s_e(m,f,{prefix:i,driver:o,serialize:s,persistWholeStore:d}),EE(m,f)||t.dispatch({type:K1e,payload:m}),f=m});return function(){return g.apply(this,arguments)}}();u&&u>0?t.subscribe(Y1e(h,u)):t.subscribe(X1e(h,l))});return function(n,r,i){return e.apply(this,arguments)}}();const l_e=a_e;function Xg(e){"@babel/helpers - typeof";return Xg=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},Xg(e)}function KO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KO(Object(n),!0).forEach(function(r){u_e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u_e(e,t,n){return t=c_e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c_e(e){var t=d_e(e,"string");return Xg(t)==="symbol"?t:String(t)}function d_e(e,t){if(Xg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var f_e=function(t){var n={state:{}};return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,i=arguments.length>1?arguments[1]:void 0;i.type&&(i.type==="@@INIT"||i.type.startsWith("@@redux/INIT"))&&(n.state=Hx({},r));var o=typeof t=="function"?t:Qf(t);switch(i.type){case f5:return n.state=o(Hx(Hx({},n.state),i.payload||{}),{type:f5}),n.state;default:return o(r,i)}}},h_e=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,s=r.serialize,a=s===void 0?function(x,_){return JSON.stringify(x)}:s,l=r.unserialize,u=l===void 0?function(x,_){return JSON.parse(x)}:l,d=r.persistThrottle,f=d===void 0?100:d,h=r.persistDebounce,g=r.persistWholeStore,m=g===void 0?!1:g;if(!t)throw Error("redux-remember error: driver required");if(!Array.isArray(n))throw Error("redux-remember error: rememberedKeys needs to be an array");var v=function(_){return function(b,y,S){var C=_(b,y,S);return l_e(C,n,{driver:t,prefix:o,serialize:a,unserialize:u,persistThrottle:f,persistDebounce:h,persistWholeStore:m}),C}};return v};const Q7e=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],p_e="@@invokeai-",g_e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"],m_e=["pendingControlImages"],y_e=["selection","selectedBoardId","galleryView"],v_e=["schema","invocationTemplates"],__e=[],b_e=[],S_e=["currentIteration","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","totalIterations","totalSteps","isCancelScheduled","progressImage","wereModelsReceived","wasSchemaParsed","isPersisted","isUploading"],w_e=["shouldShowImageDetails"],x_e={canvas:g_e,gallery:y_e,generation:__e,nodes:v_e,postprocessing:b_e,system:S_e,ui:w_e,controlNet:m_e},C_e=(e,t)=>{const n=mb(e,x_e[t]??[]);return JSON.stringify(n)},T_e={canvas:x$,gallery:IF,generation:ys,nodes:IU,postprocessing:LU,system:UU,config:r$,ui:v$,hotkeys:jU,controlNet:H3},E_e=(e,t)=>Lae(JSON.parse(e),T_e[t]),XU=Me("nodes/textToImageGraphBuilt"),YU=Me("nodes/imageToImageGraphBuilt"),QU=Me("nodes/canvasGraphBuilt"),ZU=Me("nodes/nodesGraphBuilt"),A_e=Lo(XU,YU,QU,ZU),P_e=e=>{if(A_e(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return qg.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:wE.match(e)?{...e,payload:"<Node templates omitted>"}:e},R_e=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","hotkeys/shiftKeyPressed","@@REMEMBER_PERSISTED"],O_e=e=>e,k_e=()=>{Oe({actionCreator:dce,effect:async(e,{dispatch:t,getState:n})=>{const r=ke("canvas"),i=n(),{sessionId:o,isProcessing:s}=i.system,a=e.payload;if(s){if(!a){r.debug("No canvas session, skipping cancel");return}if(a!==o){r.debug({canvasSessionId:a,session_id:o},"Canvas session does not match global session, skipping cancel");return}t(Oc({session_id:o}))}}})};Me("app/appStarted");const I_e=()=>{Oe({matcher:we.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==Jo({board_id:"none",categories:Jr}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Cn.getSelectors().selectAll(i)[0];t(Gs(o??null))}}})},AE=iu.injectEndpoints({endpoints:e=>({getAppVersion:e.query({query:()=>({url:"app/version",method:"GET"}),providesTags:["AppVersion"],keepUnusedDataFor:864e5}),getAppConfig:e.query({query:()=>({url:"app/config",method:"GET"}),providesTags:["AppConfig"],keepUnusedDataFor:864e5})})}),{useGetAppVersionQuery:Z7e,useGetAppConfigQuery:J7e}=AE,M_e=()=>{Oe({matcher:AE.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,s=t().generation.infillMethod;r.includes(s)||n(jue(r[0])),i.includes("nsfw_checker")||n(L1e(!1)),o.includes("invisible_watermark")||n(D1e(!1))}})},N_e=Me("app/appStarted"),L_e=()=>{Oe({actionCreator:N_e,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},PE={memoizeOptions:{resultEqualityCheck:gb}},JU=(e,t)=>{var f;const{generation:n,canvas:r,nodes:i,controlNet:o}=e,s=((f=n.initialImage)==null?void 0:f.imageName)===t,a=r.layerState.objects.some(h=>h.kind==="image"&&h.imageName===t),l=i.nodes.some(h=>Hu(h.data.inputs,g=>{var m;return g.type==="image"&&((m=g.value)==null?void 0:m.image_name)===t})),u=Hu(o.controlNets,h=>h.controlImage===t||h.processedControlImage===t);return{isInitialImage:s,isCanvasImage:a,isNodesImage:l,isControlNetImage:u}},D_e=mi([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>JU(e,r.image_name)):[]},PE),$_e=()=>{Oe({matcher:we.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,s=!1,a=!1;const l=n();r.forEach(u=>{const d=JU(l,u);d.isInitialImage&&!i&&(t(FT()),i=!0),d.isCanvasImage&&!o&&(t(BT()),o=!0),d.isNodesImage&&!s&&(t(xE()),s=!0),d.isControlNetImage&&!a&&(t(tE()),a=!0)})}})},F_e=()=>{Oe({matcher:Lo(W3,G1),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),s=W3.match(e)?e.payload:o.gallery.selectedBoardId,l=(G1.match(e)?e.payload:o.gallery.galleryView)==="images"?Jr:Ll,u={board_id:s??"none",categories:l};if(await r(()=>we.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:f}=we.endpoints.listImages.select(u)(t());if(f){const h=j1.selectAll(f)[0];n(Gs(h??null))}else n(Gs(null))}else n(Gs(null))}})},B_e=Me("canvas/canvasSavedToGallery"),U_e=Me("canvas/canvasCopiedToClipboard"),z_e=Me("canvas/canvasDownloadedAsImage"),V_e=Me("canvas/canvasMerged"),j_e=Me("canvas/stagingAreaImageSaved");let ez=null,tz=null;const eMe=e=>{ez=e},gS=()=>ez,tMe=e=>{tz=e},G_e=()=>tz,H_e=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),c_=async(e,t)=>await H_e(e.toCanvas(t)),RE=async e=>{const t=gS();if(!t)return;const{shouldCropToBoundingBoxOnSave:n,boundingBoxCoordinates:r,boundingBoxDimensions:i}=e.canvas,o=t.clone();o.scale({x:1,y:1});const s=o.getAbsolutePosition(),a=n?{x:r.x+s.x,y:r.y+s.y,width:i.width,height:i.height}:o.getClientRect();return c_(o,a)},W_e=e=>{navigator.clipboard.write([new ClipboardItem({[e.type]:e})])},q_e=()=>{Oe({actionCreator:U_e,effect:async(e,{dispatch:t,getState:n})=>{const r=fS.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n(),o=await RE(i);if(!o){r.error("Problem getting base layer blob"),t(Yn({title:"Problem Copying Canvas",description:"Unable to export base layer",status:"error"}));return}W_e(o),t(Yn({title:"Canvas Copied to Clipboard",status:"success"}))}})},K_e=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),r.remove()},X_e=()=>{Oe({actionCreator:z_e,effect:async(e,{dispatch:t,getState:n})=>{const r=fS.get().child({namespace:"canvasSavedToGalleryListener"}),i=n(),o=await RE(i);if(!o){r.error("Problem getting base layer blob"),t(Yn({title:"Problem Downloading Canvas",description:"Unable to export base layer",status:"error"}));return}K_e(o,"canvas.png"),t(Yn({title:"Canvas Downloaded",status:"success"}))}})},Y_e=async()=>{const e=gS();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),c_(t,t.getClientRect())},Q_e=()=>{Oe({actionCreator:V_e,effect:async(e,{dispatch:t})=>{const n=fS.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await Y_e();if(!r){n.error("Problem getting base layer blob"),t(Yn({title:"Problem Merging Canvas",description:"Unable to export base layer",status:"error"}));return}const i=gS();if(!i){n.error("Problem getting canvas base layer"),t(Yn({title:"Problem Merging Canvas",description:"Unable to export base layer",status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),s=await t(we.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:"Canvas Merged"}}})).unwrap(),{image_name:a}=s;t(fce({kind:"image",layer:"base",imageName:a,...o}))}})},Z_e=()=>{Oe({actionCreator:B_e,effect:async(e,{dispatch:t,getState:n})=>{const r=ke("canvas"),i=n(),o=await RE(i);if(!o){r.error("Problem getting base layer blob"),t(Yn({title:"Problem Saving Canvas",description:"Unable to export base layer",status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(we.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:"Canvas Saved to Gallery"}}}))}})},J_e=(e,t,n)=>{var f;if(!(vfe.match(e)||PR.match(e)||eE.match(e)||_fe.match(e)||RR.match(e))||RR.match(e)&&((f=n.controlNet.controlNets[e.payload.controlNetId])==null?void 0:f.shouldAutoConfig)===!0)return!1;const i=t.controlNet.controlNets[e.payload.controlNetId];if(!i)return!1;const{controlImage:o,processorType:s,shouldAutoConfig:a}=i;if(PR.match(e)&&!a)return!1;const l=s!=="none",u=t.system.isProcessing;return l&&!u&&!!o},ebe=()=>{Oe({predicate:J_e,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=ke("session"),{controlNetId:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(JT({controlNetId:o}))}})},kc=Me("system/sessionReadyToInvoke"),nz=e=>(e==null?void 0:e.type)==="image_output",tbe=()=>{Oe({actionCreator:JT,effect:async(e,{dispatch:t,getState:n,take:r})=>{const i=ke("session"),{controlNetId:o}=e.payload,s=n().controlNet.controlNets[o];if(!(s!=null&&s.controlImage)){i.error("Unable to process ControlNet image");return}const a={nodes:{[s.processorNode.id]:{...s.processorNode,is_intermediate:!0,image:{image_name:s.controlImage}}}},l=t(jr({graph:a})),[u]=await r(h=>jr.fulfilled.match(h)&&h.meta.requestId===l.requestId),d=u.payload.id;t(kc());const[f]=await r(h=>QT.match(h)&&h.payload.data.graph_execution_state_id===d);if(nz(f.payload.data.result)){const{image_name:h}=f.payload.data.result.image,[{payload:g}]=await r(v=>we.endpoints.getImageDTO.matchFulfilled(v)&&v.payload.image_name===h),m=g;i.debug({controlNetId:e.payload,processedControlImage:m},"ControlNet image processed"),t(yfe({controlNetId:o,processedControlImage:m.image_name}))}}})},nbe=()=>{Oe({matcher:we.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=ke("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},rbe=()=>{Oe({matcher:we.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=ke("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},OE=Me("deleteImageModal/imageDeletionConfirmed"),nMe=e=>e.gallery,rMe=mi(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],PE),rz=mi([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?Jr:Ll,offset:0,limit:mce,is_intermediate:!1}},PE),ibe=()=>{Oe({actionCreator:OE,effect:async(e,{dispatch:t,getState:n,condition:r})=>{var h;const{imageDTOs:i,imagesUsage:o}=e.payload;if(i.length!==1||o.length!==1)return;const s=i[0],a=o[0];if(!s||!a)return;t(nE(!1));const l=n(),u=(h=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:h.image_name;if(s&&(s==null?void 0:s.image_name)===u){const{image_name:g}=s,m=rz(l),{data:v}=we.endpoints.listImages.select(m)(l),x=v?Cn.getSelectors().selectAll(v):[],_=x.findIndex(C=>C.image_name===g),b=x.filter(C=>C.image_name!==g),y=Ml(_,0,b.length-1),S=b[y];t(Gs(S||null))}a.isCanvasImage&&t(BT()),a.isControlNetImage&&t(tE()),a.isInitialImage&&t(FT()),a.isNodesImage&&t(xE());const{requestId:d}=t(we.endpoints.deleteImage.initiate(s));await r(g=>we.endpoints.deleteImage.matchFulfilled(g)&&g.meta.requestId===d,3e4)&&t(iu.util.invalidateTags([{type:"Board",id:s.board_id}]))}})},obe=()=>{Oe({actionCreator:OE,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<1||i.length<1))try{await t(we.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),s=rz(o),{data:a}=we.endpoints.listImages.select(s)(o),l=a?Cn.getSelectors().selectAll(a)[0]:void 0;t(Gs(l||null)),t(nE(!1)),i.some(u=>u.isCanvasImage)&&t(BT()),i.some(u=>u.isControlNetImage)&&t(tE()),i.some(u=>u.isInitialImage)&&t(FT()),i.some(u=>u.isNodesImage)&&t(xE())}catch{}}})},sbe=()=>{Oe({matcher:we.endpoints.deleteImage.matchPending,effect:()=>{}})},abe=()=>{Oe({matcher:we.endpoints.deleteImage.matchFulfilled,effect:e=>{ke("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},lbe=()=>{Oe({matcher:we.endpoints.deleteImage.matchRejected,effect:e=>{ke("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},iz=Me("dnd/dndDropped"),ube=()=>{Oe({actionCreator:iz,effect:async(e,{dispatch:t})=>{const n=ke("images"),{activeData:r,overData:i}=e.payload;if(r.payloadType==="IMAGE_DTO"?n.debug({activeData:r,overData:i},"Image dropped"):r.payloadType==="IMAGE_DTOS"?n.debug({activeData:r,overData:i},`Images (${r.payload.imageDTOs.length}) dropped`):n.debug({activeData:r,overData:i},"Unknown payload dropped"),i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(Gs(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(vb(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROLNET_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{controlNetId:o}=i.context;t(eE({controlImage:r.payload.imageDTO.image_name,controlNetId:o}));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(T$(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:s}=i.context;t(NU({nodeId:s,fieldName:o,value:r.payload.imageDTO}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload,{boardId:s}=i.context;t(we.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:s}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(we.endpoints.removeImageFromBoard.initiate({imageDTO:o}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload,{boardId:s}=i.context;t(we.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:s}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(we.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},cbe=()=>{Oe({matcher:we.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=ke("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},dbe=()=>{Oe({matcher:we.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=ke("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},fbe=()=>{Oe({actionCreator:Efe,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,s=D_e(n()),a=s.some(l=>l.isCanvasImage)||s.some(l=>l.isInitialImage)||s.some(l=>l.isControlNetImage)||s.some(l=>l.isNodesImage);if(o||a){t(nE(!0));return}t(OE({imageDTOs:r,imagesUsage:s}))}})},xd={title:"Image Uploaded",status:"success"},hbe=()=>{Oe({matcher:we.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=ke("images"),i=e.payload,o=n(),{autoAddBoardId:s}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:a}=e.meta.arg.originalArgs;if(!(e.payload.is_intermediate&&!a)){if((a==null?void 0:a.type)==="TOAST"){const{toastOptions:l}=a;if(!s||s==="none")t(Yn({...xd,...l}));else{t(we.endpoints.addImageToBoard.initiate({board_id:s,imageDTO:i}));const{data:u}=Yi.endpoints.listAllBoards.select()(o),d=u==null?void 0:u.find(h=>h.board_id===s),f=d?`Added to board ${d.board_name}`:`Added to board ${s}`;t(Yn({...xd,description:f}))}return}if((a==null?void 0:a.type)==="SET_CANVAS_INITIAL_IMAGE"){t(T$(i)),t(Yn({...xd,description:"Set as canvas initial image"}));return}if((a==null?void 0:a.type)==="SET_CONTROLNET_IMAGE"){const{controlNetId:l}=a;t(eE({controlNetId:l,controlImage:i.image_name})),t(Yn({...xd,description:"Set as control image"}));return}if((a==null?void 0:a.type)==="SET_INITIAL_IMAGE"){t(vb(i)),t(Yn({...xd,description:"Set as initial image"}));return}if((a==null?void 0:a.type)==="SET_NODES_IMAGE"){const{nodeId:l,fieldName:u}=a;t(NU({nodeId:l,fieldName:u,value:i})),t(Yn({...xd,description:`Set as node field ${u}`}));return}}}})},pbe=()=>{Oe({matcher:we.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=ke("images"),r={arg:{...mb(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(Yn({title:"Image Upload Failed",description:e.error.message,status:"error"}))}})},gbe=Me("generation/initialImageSelected"),mbe=Me("generation/modelSelected"),ybe=()=>{Oe({actionCreator:gbe,effect:(e,{dispatch:t})=>{if(!e.payload){t(Yn(lc({title:jp("toast.imageNotLoadedDesc"),status:"error"})));return}t(vb(e.payload)),t(Yn(lc(jp("toast.sentToImageToImage"))))}})},vbe=()=>{Oe({actionCreator:mbe,effect:(e,{getState:t,dispatch:n})=>{var l;const r=ke("models"),i=t(),o=p$.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const s=o.data,{base_model:a}=s;if(((l=i.generation.model)==null?void 0:l.base_model)!==a){let u=0;gc(i.lora.loras,(h,g)=>{h.base_model!==a&&(n($F(g)),u+=1)});const{vae:d}=i.generation;d&&d.base_model!==a&&(n(m$(null)),u+=1);const{controlNets:f}=i.controlNet;gc(f,(h,g)=>{var m;((m=h.model)==null?void 0:m.base_model)!==a&&(n(RF({controlNetId:g})),u+=1)}),u>0&&n(Yn(lc({title:`Base model changed, cleared ${u} incompatible submodel${u===1?"":"s"}`,status:"warning"})))}n(Nl(s))}})},p5=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),XO=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),YO=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),QO=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),ZO=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),g5=hu({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),_be=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,Cd=e=>{const t=[];return e.forEach(n=>{const r={...Qr(n),id:_be(n)};t.push(r)}),t},Aa=iu.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${Tv.stringify(n,{arrayFormat:"none"})}`},providesTags:(t,n,r)=>{const i=[{type:"OnnxModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"OnnxModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return XO.setAll(XO.getInitialState(),i)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${Tv.stringify(n,{arrayFormat:"none"})}`},providesTags:(t,n,r)=>{const i=[{type:"MainModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"MainModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return p5.setAll(p5.getInitialState(),i)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),convertMainModels:e.mutation({query:({base_model:t,model_name:n,convert_dest_directory:r})=>({url:`models/convert/${t}/main/${n}`,method:"PUT",params:{convert_dest_directory:r}}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:[{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"OnnxModel",id:tt}]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:(t,n,r)=>{const i=[{type:"LoRAModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"LoRAModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return YO.setAll(YO.getInitialState(),i)}}),updateLoRAModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/lora/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"LoRAModel",id:tt}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:tt}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:(t,n,r)=>{const i=[{type:"ControlNetModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"ControlNetModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return QO.setAll(QO.getInitialState(),i)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:(t,n,r)=>{const i=[{type:"VaeModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"VaeModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return g5.setAll(g5.getInitialState(),i)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:(t,n,r)=>{const i=[{type:"TextualInversionModel",id:tt}];return t&&i.push(...t.ids.map(o=>({type:"TextualInversionModel",id:o}))),i},transformResponse:(t,n,r)=>{const i=Cd(t.models);return ZO.setAll(ZO.getInitialState(),i)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${Tv.stringify(t,{})}`}),providesTags:(t,n,r)=>{const i=[{type:"ScannedModels",id:tt}];return t&&i.push(...t.map(o=>({type:"ScannedModels",id:o}))),i}}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:iMe,useGetOnnxModelsQuery:oMe,useGetControlNetModelsQuery:sMe,useGetLoRAModelsQuery:aMe,useGetTextualInversionModelsQuery:lMe,useGetVaeModelsQuery:uMe,useUpdateMainModelsMutation:cMe,useDeleteMainModelsMutation:dMe,useImportMainModelsMutation:fMe,useAddMainModelsMutation:hMe,useConvertMainModelsMutation:pMe,useMergeMainModelsMutation:gMe,useDeleteLoRAModelsMutation:mMe,useUpdateLoRAModelsMutation:yMe,useSyncModelsMutation:vMe,useGetModelsInFolderQuery:_Me,useGetCheckpointConfigsQuery:bMe}=Aa,bbe=()=>{Oe({predicate:(e,t)=>Aa.endpoints.getMainModels.matchFulfilled(t)&&!t.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=ke("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model;if(Hu(e.payload.entities,u=>(u==null?void 0:u.model_name)===(i==null?void 0:i.model_name)&&(u==null?void 0:u.base_model)===(i==null?void 0:i.base_model)&&(u==null?void 0:u.model_type)===(i==null?void 0:i.model_type)))return;const s=e.payload.ids[0],a=e.payload.entities[s];if(!a){n(Nl(null));return}const l=p$.safeParse(a);if(!l.success){r.error({error:l.error.format()},"Failed to parse main model");return}n(Nl(l.data))}}),Oe({predicate:(e,t)=>Aa.endpoints.getMainModels.matchFulfilled(t)&&t.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=ke("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel;if(Hu(e.payload.entities,u=>(u==null?void 0:u.model_name)===(i==null?void 0:i.model_name)&&(u==null?void 0:u.base_model)===(i==null?void 0:i.base_model)&&(u==null?void 0:u.model_type)===(i==null?void 0:i.model_type)))return;const s=e.payload.ids[0],a=e.payload.entities[s];if(!a){n(kO(null)),n(f1e(!1));return}const l=h$.safeParse(a);if(!l.success){r.error({error:l.error.format()},"Failed to parse SDXL Refiner Model");return}n(kO(l.data))}}),Oe({matcher:Aa.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=ke("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||Hu(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const s=g5.getSelectors().selectAll(e.payload)[0];if(!s){n(Nl(null));return}const a=$ue.safeParse(s);if(!a.success){r.error({error:a.error.format()},"Failed to parse VAE model");return}n(m$(a.data))}}),Oe({matcher:Aa.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ke("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;gc(i,(o,s)=>{Hu(e.payload.entities,l=>(l==null?void 0:l.model_name)===(o==null?void 0:o.model_name)&&(l==null?void 0:l.base_model)===(o==null?void 0:o.base_model))||n($F(s))})}}),Oe({matcher:Aa.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{ke("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`);const i=t().controlNet.controlNets;gc(i,(o,s)=>{Hu(e.payload.entities,l=>{var u,d;return(l==null?void 0:l.model_name)===((u=o==null?void 0:o.model)==null?void 0:u.model_name)&&(l==null?void 0:l.base_model)===((d=o==null?void 0:o.model)==null?void 0:d.base_model)})||n(RF({controlNetId:s}))})}}),Oe({matcher:Aa.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{ke("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},Ya=e=>JSON.parse(JSON.stringify(e)),m5=e=>!("$ref"in e),Sbe=e=>!("$ref"in e),SMe=500,wbe={integer:"integer",float:"float",number:"float",string:"string",boolean:"boolean",enum:"enum",ImageField:"image",image_collection:"image_collection",LatentsField:"latents",ConditioningField:"conditioning",UNetField:"unet",ClipField:"clip",VaeField:"vae",model:"model",refiner_model:"refiner_model",vae_model:"vae_model",lora_model:"lora_model",controlnet_model:"controlnet_model",ControlNetModelField:"controlnet_model",array:"array",item:"item",ColorField:"color",ControlField:"control",control:"control",cfg_scale:"float",control_weight:"float"},xbe=500,Un=e=>`var(--invokeai-colors-${e}-${xbe})`,wMe={integer:{color:"red",colorCssVar:Un("red"),title:"Integer",description:"Integers are whole numbers, without a decimal point."},float:{color:"orange",colorCssVar:Un("orange"),title:"Float",description:"Floats are numbers with a decimal point."},string:{color:"yellow",colorCssVar:Un("yellow"),title:"String",description:"Strings are text."},boolean:{color:"green",colorCssVar:Un("green"),title:"Boolean",description:"Booleans are true or false."},enum:{color:"blue",colorCssVar:Un("blue"),title:"Enum",description:"Enums are values that may be one of a number of options."},image:{color:"purple",colorCssVar:Un("purple"),title:"Image",description:"Images may be passed between nodes."},image_collection:{color:"purple",colorCssVar:Un("purple"),title:"Image Collection",description:"A collection of images."},latents:{color:"pink",colorCssVar:Un("pink"),title:"Latents",description:"Latents may be passed between nodes."},conditioning:{color:"cyan",colorCssVar:Un("cyan"),title:"Conditioning",description:"Conditioning may be passed between nodes."},unet:{color:"red",colorCssVar:Un("red"),title:"UNet",description:"UNet submodel."},clip:{color:"green",colorCssVar:Un("green"),title:"Clip",description:"Tokenizer and text_encoder submodels."},vae:{color:"blue",colorCssVar:Un("blue"),title:"Vae",description:"Vae submodel."},control:{color:"cyan",colorCssVar:Un("cyan"),title:"Control",description:"Control info passed between nodes."},model:{color:"teal",colorCssVar:Un("teal"),title:"Model",description:"Models are models."},refiner_model:{color:"teal",colorCssVar:Un("teal"),title:"Refiner Model",description:"Models are models."},vae_model:{color:"teal",colorCssVar:Un("teal"),title:"VAE",description:"Models are models."},lora_model:{color:"teal",colorCssVar:Un("teal"),title:"LoRA",description:"Models are models."},controlnet_model:{color:"teal",colorCssVar:Un("teal"),title:"ControlNet",description:"Models are models."},array:{color:"gray",colorCssVar:Un("gray"),title:"Array",description:"TODO: Array type description."},item:{color:"gray",colorCssVar:Un("gray"),title:"Collection Item",description:"TODO: Collection Item type description."},color:{color:"gray",colorCssVar:Un("gray"),title:"Color",description:"A RGBA color."}},xMe=250,Wx=e=>{const t=e.$ref.split("/").slice(-1)[0];return t||"UNKNOWN FIELD TYPE"},Cbe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",inputRequirement:"always",inputKind:"any",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},Tbe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",inputRequirement:"always",inputKind:"any",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},Ebe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",inputRequirement:"always",inputKind:"any",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},Abe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",inputRequirement:"always",inputKind:"any",default:e.default??!1}),Pbe=({schemaObject:e,baseField:t})=>({...t,type:"model",inputRequirement:"always",inputKind:"direct",default:e.default??void 0}),Rbe=({schemaObject:e,baseField:t})=>({...t,type:"refiner_model",inputRequirement:"always",inputKind:"direct",default:e.default??void 0}),Obe=({schemaObject:e,baseField:t})=>({...t,type:"vae_model",inputRequirement:"always",inputKind:"direct",default:e.default??void 0}),kbe=({schemaObject:e,baseField:t})=>({...t,type:"lora_model",inputRequirement:"always",inputKind:"direct",default:e.default??void 0}),Ibe=({schemaObject:e,baseField:t})=>({...t,type:"controlnet_model",inputRequirement:"always",inputKind:"direct",default:e.default??void 0}),Mbe=({schemaObject:e,baseField:t})=>({...t,type:"image",inputRequirement:"always",inputKind:"any",default:e.default??void 0}),Nbe=({schemaObject:e,baseField:t})=>({...t,type:"image_collection",inputRequirement:"always",inputKind:"any",default:e.default??void 0}),Lbe=({schemaObject:e,baseField:t})=>({...t,type:"latents",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),Dbe=({schemaObject:e,baseField:t})=>({...t,type:"conditioning",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),$be=({schemaObject:e,baseField:t})=>({...t,type:"unet",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),Fbe=({schemaObject:e,baseField:t})=>({...t,type:"clip",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),Bbe=({schemaObject:e,baseField:t})=>({...t,type:"vae",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),Ube=({schemaObject:e,baseField:t})=>({...t,type:"control",inputRequirement:"always",inputKind:"connection",default:e.default??void 0}),zbe=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",enumType:e.type??"string",options:n,inputRequirement:"always",inputKind:"direct",default:e.default??n[0]}},JO=({baseField:e})=>({...e,type:"array",inputRequirement:"always",inputKind:"direct",default:[]}),ek=({baseField:e})=>({...e,type:"item",inputRequirement:"always",inputKind:"direct",default:void 0}),Vbe=({schemaObject:e,baseField:t})=>({...t,type:"color",inputRequirement:"always",inputKind:"direct",default:e.default??{r:127,g:127,b:127,a:255}}),oz=(e,t,n)=>{let r="";n&&t in n?r=n[t]??"UNKNOWN FIELD TYPE":e.type?e.enum?r="enum":e.type&&(r=e.type):e.allOf?r=Wx(e.allOf[0]):e.anyOf?r=Wx(e.anyOf[0]):e.oneOf&&(r=Wx(e.oneOf[0]));const i=wbe[r];if(!i)throw`Field type "${r}" is unknown!`;return i},jbe=(e,t,n)=>{const r=oz(e,t,n),i={name:t,title:e.title??"",description:e.description??""};if(["image"].includes(r))return Mbe({schemaObject:e,baseField:i});if(["image_collection"].includes(r))return Nbe({schemaObject:e,baseField:i});if(["latents"].includes(r))return Lbe({schemaObject:e,baseField:i});if(["conditioning"].includes(r))return Dbe({schemaObject:e,baseField:i});if(["unet"].includes(r))return $be({schemaObject:e,baseField:i});if(["clip"].includes(r))return Fbe({schemaObject:e,baseField:i});if(["vae"].includes(r))return Bbe({schemaObject:e,baseField:i});if(["control"].includes(r))return Ube({schemaObject:e,baseField:i});if(["model"].includes(r))return Pbe({schemaObject:e,baseField:i});if(["refiner_model"].includes(r))return Rbe({schemaObject:e,baseField:i});if(["vae_model"].includes(r))return Obe({schemaObject:e,baseField:i});if(["lora_model"].includes(r))return kbe({schemaObject:e,baseField:i});if(["controlnet_model"].includes(r))return Ibe({schemaObject:e,baseField:i});if(["enum"].includes(r))return zbe({schemaObject:e,baseField:i});if(["integer"].includes(r))return Cbe({schemaObject:e,baseField:i});if(["number","float"].includes(r))return Tbe({schemaObject:e,baseField:i});if(["string"].includes(r))return Ebe({schemaObject:e,baseField:i});if(["boolean"].includes(r))return Abe({schemaObject:e,baseField:i});if(["array"].includes(r))return JO({schemaObject:e,baseField:i});if(["item"].includes(r))return ek({schemaObject:e,baseField:i});if(["color"].includes(r))return Vbe({schemaObject:e,baseField:i});if(["array"].includes(r))return JO({schemaObject:e,baseField:i});if(["item"].includes(r))return ek({schemaObject:e,baseField:i})},Gbe=(e,t,n)=>{const r=e.$ref.split("/").slice(-1)[0];if(!r)throw ke("nodes").error({refObject:Ya(e)},"No output schema name found in ref object"),"No output schema name found in ref object";const i=t.components.schemas[r];if(!i)throw ke("nodes").error({outputSchemaName:r},"Output schema not found"),"Output schema not found";return m5(i)?LT(i.properties,(s,a,l)=>{if(!["type","id"].includes(l)&&!["object"].includes(a.type)&&m5(a)){const u=oz(a,l,n);s[l]={name:l,title:a.title??"",description:a.description??"",type:u}}return s},{}):{}},Hbe=e=>e==="l2i"?["id","type","metadata"]:["id","type","is_intermediate","metadata"],Wbe=["Graph","InvocationMeta","MetadataAccumulatorInvocation"],qbe=e=>{var r;return XD((r=e.components)==null?void 0:r.schemas,(i,o)=>o.includes("Invocation")&&!o.includes("InvocationOutput")&&!Wbe.some(s=>o.includes(s))).reduce((i,o)=>{var s,a,l,u,d;if(Sbe(o)){const f=o.properties.type.default,h=Hbe(f),g=((s=o.ui)==null?void 0:s.title)??o.title.replace("Invocation",""),m=(a=o.ui)==null?void 0:a.type_hints,v={};if(f==="collect"){const y=o.properties.item;v.item={type:"item",name:"item",description:y.description??"",title:"Collection Item",inputKind:"connection",inputRequirement:"always",default:void 0}}else if(f==="iterate"){const y=o.properties.collection;v.collection={type:"array",name:"collection",title:y.title??"",default:[],description:y.description??"",inputRequirement:"always",inputKind:"connection"}}else LT(o.properties,(y,S,C)=>{if(!h.includes(C)&&m5(S)){const T=jbe(S,C,m);T&&(y[C]=T)}return y},v);const x=o.output;let _;if(f==="iterate"){const y=(u=(l=e.components)==null?void 0:l.schemas)==null?void 0:u.IterateInvocationOutput;_={item:{name:"item",title:(y==null?void 0:y.title)??"",description:(y==null?void 0:y.description)??"",type:"array"}}}else _=Gbe(x,e,m);const b={title:g,type:f,tags:((d=o.ui)==null?void 0:d.tags)??[],description:o.description??"",inputs:v,outputs:_};Object.assign(i,{[f]:b})}return i},{})},Kbe=()=>{Oe({actionCreator:qg.fulfilled,effect:(e,{dispatch:t})=>{const n=ke("system"),r=e.payload;n.debug({schemaJSON:r},"Dereferenced OpenAPI schema");const i=qbe(r);n.debug({nodeTemplates:Ya(i)},`Built ${DT(i)} node templates`),t(wE(i))}}),Oe({actionCreator:qg.rejected,effect:()=>{ke("system").error("Problem dereferencing OpenAPI Schema")}})},Xbe=[EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,globalThis.DOMException,globalThis.AssertionError,globalThis.SystemError].filter(Boolean).map(e=>[e.name,e]),Ybe=new Map(Xbe),Qbe=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1}],y5=Symbol(".toJSON was called"),Zbe=e=>{e[y5]=!0;const t=e.toJSON();return delete e[y5],t},Jbe=e=>Ybe.get(e)??Error,sz=({from:e,seen:t,to:n,forceEnumerable:r,maxDepth:i,depth:o,useToJSON:s,serialize:a})=>{if(!n)if(Array.isArray(e))n=[];else if(!a&&tk(e)){const u=Jbe(e.name);n=new u}else n={};if(t.push(e),o>=i)return n;if(s&&typeof e.toJSON=="function"&&e[y5]!==!0)return Zbe(e);const l=u=>sz({from:u,seen:[...t],forceEnumerable:r,maxDepth:i,depth:o,useToJSON:s,serialize:a});for(const[u,d]of Object.entries(e)){if(typeof Buffer=="function"&&Buffer.isBuffer(d)){n[u]="[object Buffer]";continue}if(d!==null&&typeof d=="object"&&typeof d.pipe=="function"){n[u]="[object Stream]";continue}if(typeof d!="function"){if(!d||typeof d!="object"){n[u]=d;continue}if(!t.includes(e[u])){o++,n[u]=l(e[u]);continue}n[u]="[Circular]"}}for(const{property:u,enumerable:d}of Qbe)typeof e[u]<"u"&&e[u]!==null&&Object.defineProperty(n,u,{value:tk(e[u])?l(e[u]):e[u],enumerable:r?!0:d,configurable:!0,writable:!0});return n};function kE(e,t={}){const{maxDepth:n=Number.POSITIVE_INFINITY,useToJSON:r=!0}=t;return typeof e=="object"&&e!==null?sz({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0,useToJSON:r,serialize:!0}):typeof e=="function"?`[Function: ${e.name??"anonymous"}]`:e}function tk(e){return!!e&&typeof e=="object"&&"name"in e&&"message"in e&&"stack"in e}const eSe=()=>{Oe({actionCreator:Oc.pending,effect:()=>{}})},tSe=()=>{Oe({actionCreator:Oc.fulfilled,effect:e=>{const t=ke("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session canceled (${n})`)}})},nSe=()=>{Oe({actionCreator:Oc.rejected,effect:e=>{const t=ke("session"),{session_id:n}=e.meta.arg;if(e.payload){const{error:r}=e.payload;t.error({session_id:n,error:kE(r)},"Problem canceling session")}}})},rSe=()=>{Oe({actionCreator:jr.pending,effect:()=>{}})},iSe=()=>{Oe({actionCreator:jr.fulfilled,effect:e=>{const t=ke("session"),n=e.payload;t.debug({session:Ya(n)},`Session created (${n.id})`)}})},oSe=()=>{Oe({actionCreator:jr.rejected,effect:e=>{const t=ke("session");if(e.payload){const{error:n,status:r}=e.payload,i=Ya(e.meta.arg);t.error({graph:i,status:r,error:kE(n)},"Problem creating session")}}})},sSe=()=>{Oe({actionCreator:km.pending,effect:()=>{}})},aSe=()=>{Oe({actionCreator:km.fulfilled,effect:e=>{const t=ke("session"),{session_id:n}=e.meta.arg;t.debug({session_id:n},`Session invoked (${n})`)}})},lSe=()=>{Oe({actionCreator:km.rejected,effect:e=>{const t=ke("session"),{session_id:n}=e.meta.arg;if(e.payload){const{error:r}=e.payload;t.error({session_id:n,error:kE(r)},"Problem invoking session")}}})},uSe=()=>{Oe({actionCreator:kc,effect:(e,{getState:t,dispatch:n})=>{const r=ke("session"),{sessionId:i}=t().system;i&&(r.debug({session_id:i},`Session ready to invoke (${i})})`),n(km({session_id:i})))}})},cSe=()=>{Oe({actionCreator:aF,effect:(e,{dispatch:t,getState:n})=>{ke("socketio").debug("Connected");const{nodes:i,config:o}=n(),{disabledTabs:s}=o;!i.schema&&!s.includes("nodes")&&t(qg()),t(lF(e.payload)),t(Aa.util.invalidateTags([{type:"MainModel",id:tt},{type:"SDXLRefinerModel",id:tt},{type:"LoRAModel",id:tt},{type:"ControlNetModel",id:tt},{type:"VaeModel",id:tt},{type:"TextualInversionModel",id:tt},{type:"ScannedModels",id:tt}])),t(AE.util.invalidateTags(["AppConfig","AppVersion"]))}})},dSe=()=>{Oe({actionCreator:uF,effect:(e,{dispatch:t})=>{ke("socketio").debug("Disconnected"),t(cF(e.payload))}})},fSe=()=>{Oe({actionCreator:bF,effect:(e,{dispatch:t,getState:n})=>{const r=ke("socketio");if(n().system.canceledSession===e.payload.data.graph_execution_state_id){r.trace(e.payload,"Ignored generator progress for canceled session");return}r.trace(e.payload,`Generator progress (${e.payload.data.node.type})`),t(SF(e.payload))}})},hSe=()=>{Oe({actionCreator:vF,effect:(e,{dispatch:t})=>{ke("socketio").debug(e.payload,"Session complete"),t(_F(e.payload))}})},$e="positive_conditioning",Be="negative_conditioning",Le="denoise_latents",it="latents_to_image",Kd="nsfw_checker",dp="invisible_watermark",Se="noise",dr="rand_int",bn="range_of_size",sn="iterate",an="main_model_loader",mS="onnx_model_loader",Lu="vae_loader",az="lora_loader",It="clip_skip",Vt="image_to_latents",Jn="resize_image",Ie="canvas_output",hn="inpaint_image",ko="inpaint_image_resize_up",ti="inpaint_image_resize_down",Nn="inpaint_infill",Ls="inpaint_infill_resize_down",_f="tomask",ut="mask_blur",Ds="mask_combine",Ni="mask_resize_up",er="mask_resize_down",wt="color_correct",j0="control_net_collect",qx="dynamic_prompt",yt="metadata_accumulator",nk="esrgan",We="sdxl_model_loader",Re="sdxl_denoise_latents",fp="sdxl_refiner_model_loader",G0="sdxl_refiner_positive_conditioning",H0="sdxl_refiner_negative_conditioning",va="sdxl_refiner_denoise_latents",lz="text_to_image_graph",v5="image_to_image_graph",uz="canvas_text_to_image_graph",_5="canvas_image_to_image_graph",cz="canvas_inpaint_graph",dz="canvas_outpaint_graph",fz="sdxl_text_to_image_graph",b5="sxdl_image_to_image_graph",IE="sdxl_canvas_text_to_image_graph",d_="sdxl_canvas_image_to_image_graph",ME="sdxl_canvas_inpaint_graph",NE="sdxl_canvas_outpaint_graph",pSe=["dataURL_image"],gSe=()=>{Oe({actionCreator:QT,effect:async(e,{dispatch:t,getState:n})=>{const r=ke("socketio"),{data:i}=e.payload;r.debug({data:Ya(i)},`Invocation complete (${e.payload.data.node.type})`);const o=e.payload.data.graph_execution_state_id,{cancelType:s,isCancelScheduled:a}=n().system;s==="scheduled"&&a&&t(Oc({session_id:o}));const{result:l,node:u,graph_execution_state_id:d}=i;if(nz(l)&&!pSe.includes(u.type)){const{image_name:f}=l.image,{canvas:h,gallery:g}=n(),m=await t(we.endpoints.getImageDTO.initiate(f)).unwrap();if(d===h.layerState.stagingArea.sessionId&&[Ie].includes(i.source_node_id)&&t(cce(m)),!m.is_intermediate){const{autoAddBoardId:v}=g;t(v&&v!=="none"?we.endpoints.addImageToBoard.initiate({board_id:v,imageDTO:m}):we.util.updateQueryData("listImages",{board_id:"none",categories:Jr},b=>{Cn.addOne(b,m)})),t(we.util.invalidateTags([{type:"BoardImagesTotal",id:v},{type:"BoardAssetsTotal",id:v}]));const{selectedBoardId:x,shouldAutoSwitch:_}=g;_&&(v&&v!==x?(t(W3(v)),t(G1("images"))):v||t(G1("images")),t(Gs(m)))}t(N1e(null))}t(mF(e.payload))}})},mSe=()=>{Oe({actionCreator:yF,effect:(e,{dispatch:t})=>{ke("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(ZT(e.payload))}})},ySe=()=>{Oe({actionCreator:EF,effect:(e,{dispatch:t})=>{ke("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(AF(e.payload))}})},vSe=()=>{Oe({actionCreator:pF,effect:(e,{dispatch:t,getState:n})=>{const r=ke("socketio");if(n().system.canceledSession===e.payload.data.graph_execution_state_id){r.trace(e.payload,"Ignored invocation started for canceled session");return}r.debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(gF(e.payload))}})},_Se=()=>{Oe({actionCreator:wF,effect:(e,{dispatch:t})=>{const n=ke("socketio"),{base_model:r,model_name:i,model_type:o,submodel:s}=e.payload.data;let a=`Model load started: ${r}/${o}/${i}`;s&&(a=a.concat(`/${s}`)),n.debug(e.payload,a),t(gfe(e.payload))}}),Oe({actionCreator:xF,effect:(e,{dispatch:t})=>{const n=ke("socketio"),{base_model:r,model_name:i,model_type:o,submodel:s}=e.payload.data;let a=`Model load complete: ${r}/${o}/${i}`;s&&(a=a.concat(`/${s}`)),n.debug(e.payload,a),t(mfe(e.payload))}})},bSe=()=>{Oe({actionCreator:CF,effect:(e,{dispatch:t})=>{ke("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(TF(e.payload))}})},SSe=()=>{Oe({actionCreator:YT,effect:(e,{dispatch:t})=>{ke("socketio").debug(e.payload,"Subscribed"),t(dF(e.payload))}})},wSe=()=>{Oe({actionCreator:fF,effect:(e,{dispatch:t})=>{ke("socketio").debug(e.payload,"Unsubscribed"),t(hF(e.payload))}})},xSe=()=>{Oe({actionCreator:j_e,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(we.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(we.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(Yn({title:"Image Saved",status:"success"}))}catch(i){t(Yn({title:"Image Saving Failed",description:i==null?void 0:i.message,status:"error"}))}}})},CMe=["sd-1","sd-2","sdxl","sdxl-refiner"],CSe=["sd-1","sd-2","sdxl"],TMe=["sdxl-refiner"],TSe=()=>{Oe({actionCreator:b$,effect:async(e,{getState:t,dispatch:n})=>{var i;if(e.payload==="unifiedCanvas"){const o=(i=t().generation.model)==null?void 0:i.base_model;if(o&&["sd-1","sd-2","sdxl"].includes(o))return;try{const s=n(Aa.endpoints.getMainModels.initiate(CSe)),a=await s.unwrap();if(s.unsubscribe(),!a.ids.length){n(Nl(null));return}const u=p5.getSelectors().selectAll(a).filter(g=>["sd-1","sd-2","sxdl"].includes(g.base_model))[0];if(!u){n(Nl(null));return}const{base_model:d,model_name:f,model_type:h}=u;n(Nl({base_model:d,model_name:f,model_type:h}))}catch{n(Nl(null))}}}})},ESe=({image_name:e,esrganModelName:t})=>{const n={id:nk,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!1};return{id:"adhoc-esrgan-graph",nodes:{[nk]:n},edges:[]}},ASe=Me("upscale/upscaleRequested"),PSe=()=>{Oe({actionCreator:ASe,effect:async(e,{dispatch:t,getState:n,take:r})=>{const{image_name:i}=e.payload,{esrganModelName:o}=n().postprocessing,s=ESe({image_name:i,esrganModelName:o});t(jr({graph:s})),await r(jr.fulfilled.match),t(kc())}})},RSe=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("</br>"),t.document.write(r.outerHTML),t.document.write("</br></br>")})},rk=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>t(r.result),r.onerror=i=>n(r.error),r.onabort=i=>n(new Error("Read aborted")),r.readAsDataURL(e)});var LE={exports:{}},yS={},hz={},ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof Ze<"u"?Ze:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.0",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const r=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(ft);var kn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ft;class n{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){var C=this.m;return{x:C[0]*S.x+C[2]*S.y+C[4],y:C[1]*S.x+C[3]*S.y+C[5]}}translate(S,C){return this.m[4]+=this.m[0]*S+this.m[2]*C,this.m[5]+=this.m[1]*S+this.m[3]*C,this}scale(S,C){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=C,this.m[3]*=C,this}rotate(S){var C=Math.cos(S),T=Math.sin(S),E=this.m[0]*C+this.m[2]*T,P=this.m[1]*C+this.m[3]*T,k=this.m[0]*-T+this.m[2]*C,O=this.m[1]*-T+this.m[3]*C;return this.m[0]=E,this.m[1]=P,this.m[2]=k,this.m[3]=O,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,C){var T=this.m[0]+this.m[2]*C,E=this.m[1]+this.m[3]*C,P=this.m[2]+this.m[0]*S,k=this.m[3]+this.m[1]*S;return this.m[0]=T,this.m[1]=E,this.m[2]=P,this.m[3]=k,this}multiply(S){var C=this.m[0]*S.m[0]+this.m[2]*S.m[1],T=this.m[1]*S.m[0]+this.m[3]*S.m[1],E=this.m[0]*S.m[2]+this.m[2]*S.m[3],P=this.m[1]*S.m[2]+this.m[3]*S.m[3],k=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],O=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=C,this.m[1]=T,this.m[2]=E,this.m[3]=P,this.m[4]=k,this.m[5]=O,this}invert(){var S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),C=this.m[3]*S,T=-this.m[1]*S,E=-this.m[2]*S,P=this.m[0]*S,k=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),O=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=C,this.m[1]=T,this.m[2]=E,this.m[3]=P,this.m[4]=k,this.m[5]=O,this}getMatrix(){return this.m}decompose(){var S=this.m[0],C=this.m[1],T=this.m[2],E=this.m[3],P=this.m[4],k=this.m[5],O=S*E-C*T;let M={x:P,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||C!=0){var V=Math.sqrt(S*S+C*C);M.rotation=C>0?Math.acos(S/V):-Math.acos(S/V),M.scaleX=V,M.scaleY=O/V,M.skewX=(S*T+C*E)/O,M.skewY=0}else if(T!=0||E!=0){var B=Math.sqrt(T*T+E*E);M.rotation=Math.PI/2-(E>0?Math.acos(-T/B):-Math.acos(T/B)),M.scaleX=O/B,M.scaleY=B,M.skewX=0,M.skewY=(S*T+C*E)/O}return M.rotation=e.Util._getRotation(M.rotation),M}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",s="[object Boolean]",a=Math.PI/180,l=180/Math.PI,u="#",d="",f="0",h="Konva warning: ",g="Konva error: ",m="rgb(",v={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},x=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,_=[];const b=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(y){setTimeout(y,60)};e.Util={_isElement(y){return!!(y&&y.nodeType==1)},_isFunction(y){return!!(y&&y.constructor&&y.call&&y.apply)},_isPlainObject(y){return!!y&&y.constructor===Object},_isArray(y){return Object.prototype.toString.call(y)===r},_isNumber(y){return Object.prototype.toString.call(y)===i&&!isNaN(y)&&isFinite(y)},_isString(y){return Object.prototype.toString.call(y)===o},_isBoolean(y){return Object.prototype.toString.call(y)===s},isObject(y){return y instanceof Object},isValidSelector(y){if(typeof y!="string")return!1;var S=y[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(y){return y===0||y>0?1:-1},requestAnimFrame(y){_.push(y),_.length===1&&b(function(){const S=_;_=[],S.forEach(function(C){C()})})},createCanvasElement(){var y=document.createElement("canvas");try{y.style=y.style||{}}catch{}return y},createImageElement(){return document.createElement("img")},_isInDocument(y){for(;y=y.parentNode;)if(y==document)return!0;return!1},_urlToImage(y,S){var C=e.Util.createImageElement();C.onload=function(){S(C)},C.src=y},_rgbToHex(y,S,C){return((1<<24)+(y<<16)+(S<<8)+C).toString(16).slice(1)},_hexToRgb(y){y=y.replace(u,d);var S=parseInt(y,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){for(var y=(Math.random()*16777215<<0).toString(16);y.length<6;)y=f+y;return u+y},getRGB(y){var S;return y in v?(S=v[y],{r:S[0],g:S[1],b:S[2]}):y[0]===u?this._hexToRgb(y.substring(1)):y.substr(0,4)===m?(S=x.exec(y.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(y){return y=y||"black",e.Util._namedColorToRBA(y)||e.Util._hex3ColorToRGBA(y)||e.Util._hex4ColorToRGBA(y)||e.Util._hex6ColorToRGBA(y)||e.Util._hex8ColorToRGBA(y)||e.Util._rgbColorToRGBA(y)||e.Util._rgbaColorToRGBA(y)||e.Util._hslColorToRGBA(y)},_namedColorToRBA(y){var S=v[y.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(y){if(y.indexOf("rgb(")===0){y=y.match(/rgb\(([^)]+)\)/)[1];var S=y.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(y){if(y.indexOf("rgba(")===0){y=y.match(/rgba\(([^)]+)\)/)[1];var S=y.split(/ *, */).map((C,T)=>C.slice(-1)==="%"?T===3?parseInt(C)/100:parseInt(C)/100*255:Number(C));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(y){if(y[0]==="#"&&y.length===9)return{r:parseInt(y.slice(1,3),16),g:parseInt(y.slice(3,5),16),b:parseInt(y.slice(5,7),16),a:parseInt(y.slice(7,9),16)/255}},_hex6ColorToRGBA(y){if(y[0]==="#"&&y.length===7)return{r:parseInt(y.slice(1,3),16),g:parseInt(y.slice(3,5),16),b:parseInt(y.slice(5,7),16),a:1}},_hex4ColorToRGBA(y){if(y[0]==="#"&&y.length===5)return{r:parseInt(y[1]+y[1],16),g:parseInt(y[2]+y[2],16),b:parseInt(y[3]+y[3],16),a:parseInt(y[4]+y[4],16)/255}},_hex3ColorToRGBA(y){if(y[0]==="#"&&y.length===4)return{r:parseInt(y[1]+y[1],16),g:parseInt(y[2]+y[2],16),b:parseInt(y[3]+y[3],16),a:1}},_hslColorToRGBA(y){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(y)){const[S,...C]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(y),T=Number(C[0])/360,E=Number(C[1])/100,P=Number(C[2])/100;let k,O,M;if(E===0)return M=P*255,{r:Math.round(M),g:Math.round(M),b:Math.round(M),a:1};P<.5?k=P*(1+E):k=P+E-P*E;const V=2*P-k,B=[0,0,0];for(let A=0;A<3;A++)O=T+1/3*-(A-1),O<0&&O++,O>1&&O--,6*O<1?M=V+(k-V)*6*O:2*O<1?M=k:3*O<2?M=V+(k-V)*(2/3-O)*6:M=V,B[A]=M*255;return{r:Math.round(B[0]),g:Math.round(B[1]),b:Math.round(B[2]),a:1}}},haveIntersection(y,S){return!(S.x>y.x+y.width||S.x+S.width<y.x||S.y>y.y+y.height||S.y+S.height<y.y)},cloneObject(y){var S={};for(var C in y)this._isPlainObject(y[C])?S[C]=this.cloneObject(y[C]):this._isArray(y[C])?S[C]=this.cloneArray(y[C]):S[C]=y[C];return S},cloneArray(y){return y.slice(0)},degToRad(y){return y*a},radToDeg(y){return y*l},_degToRad(y){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(y)},_radToDeg(y){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(y)},_getRotation(y){return t.Konva.angleDeg?e.Util.radToDeg(y):y},_capitalize(y){return y.charAt(0).toUpperCase()+y.slice(1)},throw(y){throw new Error(g+y)},error(y){console.error(g+y)},warn(y){t.Konva.showWarnings&&console.warn(h+y)},each(y,S){for(var C in y)S(C,y[C])},_inRange(y,S,C){return S<=y&&y<C},_getProjectionToSegment(y,S,C,T,E,P){var k,O,M,V=(y-C)*(y-C)+(S-T)*(S-T);if(V==0)k=y,O=S,M=(E-C)*(E-C)+(P-T)*(P-T);else{var B=((E-y)*(C-y)+(P-S)*(T-S))/V;B<0?(k=y,O=S,M=(y-E)*(y-E)+(S-P)*(S-P)):B>1?(k=C,O=T,M=(C-E)*(C-E)+(T-P)*(T-P)):(k=y+B*(C-y),O=S+B*(T-S),M=(k-E)*(k-E)+(O-P)*(O-P))}return[k,O,M]},_getProjectionToLine(y,S,C){var T=e.Util.cloneObject(y),E=Number.MAX_VALUE;return S.forEach(function(P,k){if(!(!C&&k===S.length-1)){var O=S[(k+1)%S.length],M=e.Util._getProjectionToSegment(P.x,P.y,O.x,O.y,y.x,y.y),V=M[0],B=M[1],A=M[2];A<E&&(T.x=V,T.y=B,E=A)}}),T},_prepareArrayForTween(y,S,C){var T,E=[],P=[];if(y.length>S.length){var k=S;S=y,y=k}for(T=0;T<y.length;T+=2)E.push({x:y[T],y:y[T+1]});for(T=0;T<S.length;T+=2)P.push({x:S[T],y:S[T+1]});var O=[];return P.forEach(function(M){var V=e.Util._getProjectionToLine(M,E,C);O.push(V.x),O.push(V.y)}),O},_prepareToStringify(y){var S;y.visitedByCircularReferenceRemoval=!0;for(var C in y)if(y.hasOwnProperty(C)&&y[C]&&typeof y[C]=="object"){if(S=Object.getOwnPropertyDescriptor(y,C),y[C].visitedByCircularReferenceRemoval||e.Util._isElement(y[C]))if(S.configurable)delete y[C];else return null;else if(e.Util._prepareToStringify(y[C])===null)if(S.configurable)delete y[C];else return null}return delete y.visitedByCircularReferenceRemoval,y},_assign(y,S){for(var C in S)y[C]=S[C];return y},_getFirstPointerId(y){return y.touches?y.changedTouches[0].identifier:y.pointerId||999},releaseCanvas(...y){t.Konva.releaseCanvasOnDestroy&&y.forEach(S=>{S.width=0,S.height=0})},drawRoundedRectPath(y,S,C,T){let E=0,P=0,k=0,O=0;typeof T=="number"?E=P=k=O=Math.min(T,S/2,C/2):(E=Math.min(T[0]||0,S/2,C/2),P=Math.min(T[1]||0,S/2,C/2),O=Math.min(T[2]||0,S/2,C/2),k=Math.min(T[3]||0,S/2,C/2)),y.moveTo(E,0),y.lineTo(S-P,0),y.arc(S-P,P,P,Math.PI*3/2,0,!1),y.lineTo(S,C-O),y.arc(S-O,C-O,O,0,Math.PI/2,!1),y.lineTo(k,C),y.arc(k,C-k,k,Math.PI/2,Math.PI,!1),y.lineTo(0,E),y.arc(E,E,E,Math.PI,Math.PI*3/2,!1)}}})(kn);var wn={},dt={},De={};Object.defineProperty(De,"__esModule",{value:!0});De.getComponentValidator=De.getBooleanValidator=De.getNumberArrayValidator=De.getFunctionValidator=De.getStringOrGradientValidator=De.getStringValidator=De.getNumberOrAutoValidator=De.getNumberOrArrayOfNumbersValidator=De.getNumberValidator=De.alphaComponent=De.RGBComponent=void 0;const Qa=ft,Dn=kn;function Za(e){return Dn.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Dn.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function OSe(e){return e>255?255:e<0?0:Math.round(e)}De.RGBComponent=OSe;function kSe(e){return e>1?1:e<1e-4?1e-4:e}De.alphaComponent=kSe;function ISe(){if(Qa.Konva.isUnminified)return function(e,t){return Dn.Util._isNumber(e)||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}De.getNumberValidator=ISe;function MSe(e){if(Qa.Konva.isUnminified)return function(t,n){let r=Dn.Util._isNumber(t),i=Dn.Util._isArray(t)&&t.length==e;return!r&&!i&&Dn.Util.warn(Za(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}De.getNumberOrArrayOfNumbersValidator=MSe;function NSe(){if(Qa.Konva.isUnminified)return function(e,t){var n=Dn.Util._isNumber(e),r=e==="auto";return n||r||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}De.getNumberOrAutoValidator=NSe;function LSe(){if(Qa.Konva.isUnminified)return function(e,t){return Dn.Util._isString(e)||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}De.getStringValidator=LSe;function DSe(){if(Qa.Konva.isUnminified)return function(e,t){const n=Dn.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}De.getStringOrGradientValidator=DSe;function $Se(){if(Qa.Konva.isUnminified)return function(e,t){return Dn.Util._isFunction(e)||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}De.getFunctionValidator=$Se;function FSe(){if(Qa.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(Dn.Util._isArray(e)?e.forEach(function(r){Dn.Util._isNumber(r)||Dn.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}De.getNumberArrayValidator=FSe;function BSe(){if(Qa.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||Dn.Util.warn(Za(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}De.getBooleanValidator=BSe;function USe(e){if(Qa.Konva.isUnminified)return function(t,n){return t==null||Dn.Util.isObject(t)||Dn.Util.warn(Za(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}De.getComponentValidator=USe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=kn,n=De;var r="get",i="set";e.Factory={addGetterSetter(o,s,a,l,u){e.Factory.addGetter(o,s,a),e.Factory.addSetter(o,s,l,u),e.Factory.addOverloadedGetterSetter(o,s)},addGetter(o,s,a){var l=r+t.Util._capitalize(s);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[s];return u===void 0?a:u}},addSetter(o,s,a,l){var u=i+t.Util._capitalize(s);o.prototype[u]||e.Factory.overWriteSetter(o,s,a,l)},overWriteSetter(o,s,a,l){var u=i+t.Util._capitalize(s);o.prototype[u]=function(d){return a&&d!==void 0&&d!==null&&(d=a.call(this,d,s)),this._setAttr(s,d),l&&l.call(this),this}},addComponentsGetterSetter(o,s,a,l,u){var d=a.length,f=t.Util._capitalize,h=r+f(s),g=i+f(s),m,v;o.prototype[h]=function(){var _={};for(m=0;m<d;m++)v=a[m],_[v]=this.getAttr(s+f(v));return _};var x=(0,n.getComponentValidator)(a);o.prototype[g]=function(_){var b=this.attrs[s],y;l&&(_=l.call(this,_)),x&&x.call(this,_,s);for(y in _)_.hasOwnProperty(y)&&this._setAttr(s+f(y),_[y]);return _||a.forEach(S=>{this._setAttr(s+f(S),void 0)}),this._fireChangeEvent(s,b,_),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,s)},addOverloadedGetterSetter(o,s){var a=t.Util._capitalize(s),l=i+a,u=r+a;o.prototype[s]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,s,a,l){t.Util.error("Adding deprecated "+s);var u=r+t.Util._capitalize(s),d=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(d);var f=this.attrs[s];return f===void 0?a:f},e.Factory.addSetter(o,s,l,function(){t.Util.error(d)}),e.Factory.addOverloadedGetterSetter(o,s)},backCompat(o,s){t.Util.each(s,function(a,l){var u=o.prototype[l],d=r+t.Util._capitalize(a),f=i+t.Util._capitalize(a);function h(){u.apply(this,arguments),t.Util.error('"'+a+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[a]=h,o.prototype[d]=h,o.prototype[f]=h})},afterSetFilter(){this._filterUpToDate=!1}}})(dt);var ds={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});Na.HitContext=Na.SceneContext=Na.Context=void 0;const pz=kn,zSe=ft;function VSe(e){var t=[],n=e.length,r=pz.Util,i,o;for(i=0;i<n;i++)o=e[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var ik=",",jSe="(",GSe=")",HSe="([",WSe="])",qSe=";",KSe="()",XSe="=",ok=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],YSe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const QSe=100;class vS{constructor(t){this.canvas=t,zSe.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",s,a,l,u;for(s=0;s<i;s++)a=r[s],l=a.method,l?(u=a.args,o+=l,t?o+=KSe:pz.Util._isArray(u[0])?o+=HSe+u.join(ik)+WSe:(n&&(u=u.map(d=>typeof d=="number"?Math.floor(d):d)),o+=jSe+u.join(ik)+GSe)):(o+=a.property,t||(o+=XSe+a.val)),o+=qSe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=QSe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,s){this._context.arc(t,n,r,i,o,s)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,s){this._context.bezierCurveTo(t,n,r,i,o,s)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,s){return this._context.createRadialGradient(t,n,r,i,o,s)}drawImage(t,n,r,i,o,s,a,l,u){var d=arguments,f=this._context;d.length===3?f.drawImage(t,n,r):d.length===5?f.drawImage(t,n,r,i,o):d.length===9&&f.drawImage(t,n,r,i,o,s,a,l,u)}ellipse(t,n,r,i,o,s,a,l){this._context.ellipse(t,n,r,i,o,s,a,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,s){this._context.setTransform(t,n,r,i,o,s)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,s){this._context.transform(t,n,r,i,o,s)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=ok.length,r=this.setAttr,i,o,s=function(a){var l=t[a],u;t[a]=function(){return o=VSe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:a,args:o}),u}};for(i=0;i<n;i++)s(ok[i]);t.setAttr=function(){r.apply(t,arguments);var a=arguments[0],l=arguments[1];(a==="shadowOffsetX"||a==="shadowOffsetY"||a==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:a,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}Na.Context=vS;YSe.forEach(function(e){Object.defineProperty(vS.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class ZSe extends vS{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const s=t.getFillRadialGradientColorStops();if(s&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):s&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var s=0;s<i.length;s+=2)o.addColorStop(i[s],i[s+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",s=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,a=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),d=l.x*u,f=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",s*Math.min(Math.abs(d),Math.abs(f))),this.setAttr("shadowOffsetX",a.x*d),this.setAttr("shadowOffsetY",a.y*f)}}Na.SceneContext=ZSe;class JSe extends vS{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),i=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}Na.HitContext=JSe;Object.defineProperty(ds,"__esModule",{value:!0});ds.HitCanvas=ds.SceneCanvas=ds.Canvas=void 0;const f_=kn,gz=Na,mz=ft,e2e=dt,t2e=De;var W0;function n2e(){if(W0)return W0;var e=f_.Util.createCanvasElement(),t=e.getContext("2d");return W0=function(){var n=mz.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),f_.Util.releaseCanvas(e),W0}class _S{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||mz.Konva.pixelRatio||n2e();this.pixelRatio=r,this._canvas=f_.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch{try{return this._canvas.toDataURL()}catch(i){return f_.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}ds.Canvas=_S;e2e.Factory.addGetterSetter(_S,"pixelRatio",void 0,(0,t2e.getNumberValidator)());class r2e extends _S{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new gz.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}ds.SceneCanvas=r2e;class i2e extends _S{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new gz.HitContext(this),this.setSize(t.width,t.height)}}ds.HitCanvas=i2e;var bS={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=ft,n=kn;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,s)=>{const{node:a}=o,l=a.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(h=>h.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var d=a.dragDistance(),f=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(f<d||(a.startDrag({evt:r}),!a.isDragging()))return}a._setDragPosition(r,o),i.push(a)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:s}=o,a=s.getStage();if(r&&a.setPointersPositions(r),!a._changedPointerPositions.find(d=>d.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&i.indexOf(u)===-1&&i.push(u)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(bS);Object.defineProperty(wn,"__esModule",{value:!0});wn.Node=void 0;const bt=kn,Vm=dt,q0=ds,Du=ft,bo=bS,Hn=De;var Iv="absoluteOpacity",K0="allEventListeners",xa="absoluteTransform",sk="absoluteScale",$u="canvas",o2e="Change",s2e="children",a2e="konva",S5="listening",ak="mouseenter",lk="mouseleave",uk="set",ck="Shape",Mv=" ",dk="stage",_l="transform",l2e="Stage",w5="visible",u2e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Mv);let c2e=1;class Ke{constructor(t){this._id=c2e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===_l||t===xa)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===_l||t===xa,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(Mv);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get($u)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===xa&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has($u)){const{scene:t,filter:n,hit:r}=this._cache.get($u);bt.Util.releaseCanvas(t,n,r),this._cache.delete($u)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),s=n.pixelRatio,a=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,f=n.hitCanvasPixelRatio||1;if(!i||!o){bt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,a-=u,l-=u;var h=new q0.SceneCanvas({pixelRatio:s,width:i,height:o}),g=new q0.SceneCanvas({pixelRatio:s,width:0,height:0,willReadFrequently:!0}),m=new q0.HitCanvas({pixelRatio:f,width:i,height:o}),v=h.getContext(),x=m.getContext();return m.isCache=!0,h.isCache=!0,this._cache.delete($u),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(h.getContext()._context.imageSmoothingEnabled=!1,g.getContext()._context.imageSmoothingEnabled=!1),v.save(),x.save(),v.translate(-a,-l),x.translate(-a,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Iv),this._clearSelfAndDescendantCache(sk),this.drawScene(h,this),this.drawHit(m,this),this._isUnderCache=!1,v.restore(),x.restore(),d&&(v.save(),v.beginPath(),v.rect(0,0,i,o),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set($u,{scene:h,filter:g,hit:m,x:a,y:l}),this._requestDraw(),this}isCached(){return this._cache.has($u)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,s,a,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=s=d.x,o=a=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),s=Math.max(s,d.x),a=Math.max(a,d.y)}),{x:i,y:o,width:s-i,height:a-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),s,a,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(s=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),a=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<s;l++){if(u=t[l],typeof u!="function"){bt.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,a),o.putImageData(a,0,0)}}catch(f){bt.Util.error("Unable to apply filter. "+f.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(t,n){if(this._cache&&this._cache.delete(K0),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(Mv),i=r.length,o,s,a,l,u;for(o=0;o<i;o++)s=r[o],a=s.split("."),l=a[0],u=a[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(Mv),i=r.length,o,s,a,l,u,d;if(this._cache&&this._cache.delete(K0),!t)for(s in this.eventListeners)this._off(s);for(o=0;o<i;o++)if(a=r[o],l=a.split("."),u=l[0],d=l[1],u)this.eventListeners[u]&&this._off(u,d,n);else for(s in this.eventListeners)this._off(s,d,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var s=o.target.findAncestors(n,!0,i),a=0;a<s.length;a++)o=bt.Util.cloneObject(o),o.currentTarget=s[a],r.call(s[a],o)})}remove(){return this.isDragging()&&this.stopDrag(),bo.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(xa),this._clearSelfAndDescendantCache(Iv),this._clearSelfAndDescendantCache(sk),this._clearSelfAndDescendantCache(dk),this._clearSelfAndDescendantCache(w5),this._clearSelfAndDescendantCache(S5)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+bt.Util._capitalize(t);return bt.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==s2e&&(r=uk+bt.Util._capitalize(n),bt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(S5,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(w5,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;bo.DD._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(s.node.nodeType==="Stage"||s.node.getLayer()===r)&&(i=!0)});var o=!n&&!Du.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,s,a;function l(u){for(i=[],o=u.length,s=0;s<o;s++)a=u[s],r++,a.nodeType!==ck&&(i=i.concat(a.getChildren().slice())),a._id===n._id&&(s=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==l2e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(_l),this._clearSelfAndDescendantCache(xa)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new bt.Transform,s=this.offset();return o.m=i.slice(),o.translate(s.x,s.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(_l);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(_l),this._clearSelfAndDescendantCache(xa),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,s;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,s=0;s<o;s++)t(r[s])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return bt.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return bt.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return bt.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return bt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return bt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&bt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Iv,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,s,a;t.attrs={};for(r in n)i=n[r],a=bt.Util.isObject(i)&&!bt.Util._isPlainObject(i)&&!bt.Util._isArray(i),!a&&(o=typeof this[r]=="function"&&this[r],delete n[r],s=o?o.call(this):null,n[r]=i,s!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),bt.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],bt.Util.isValidSelector(o)||(bt.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),bt.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),bt.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(dk,this._getStage)}_getStage(){var t=this.getParent();if(t)return t.getStage()}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(xa,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new bt.Transform,this._eachAncestorReverse(function(i){var o=i.transformsEnabled();o==="all"?n.multiply(i.getTransform()):o==="position"&&n.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),n;n=this._cache.get(xa)||new bt.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,s=this.attrs.offsetX||0,a=this.attrs.offsetY||0;n.translate(i-s,o-a)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(_l,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(_l)||new bt.Transform;r.reset();var i=this.x(),o=this.y(),s=Du.Konva.getAngle(this.rotation()),a=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,d=this.attrs.skewY||0,f=this.attrs.offsetX||0,h=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),s!==0&&r.rotate(s),(u!==0||d!==0)&&r.skew(u,d),(a!==1||l!==1)&&r.scale(a,l),(f!==0||h!==0)&&r.translate(-1*f,-1*h),r.dirty=!1,r}clone(t){var n=bt.Util.cloneObject(this.attrs),r,i,o,s,a;for(r in t)n[r]=t[r];var l=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,s=0;s<o;s++)a=i[s],a.name.indexOf(a2e)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(a));return l}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),s=t.pixelRatio||1,a=new q0.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:s}),l=a.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(a),l.restore(),a}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,bt.Util._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Du.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,s,a;for(o=0;o<i.length;o++)if(s=i[o].name,a=i[o].handler,(s!=="konva"||n==="konva")&&(!n||s===n)&&(!r||r===a)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+o2e,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[uk+bt.Util._capitalize(t)];return bt.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(Du.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!bt.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===ck&&(n.target=this);var i=(t===ak||t===lk)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===ak||t===lk)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,i;const o=(n=this._cache.get(K0))!==null&&n!==void 0?n:{};let s=o==null?void 0:o[t];if(s===void 0){s=[];let a=Object.getPrototypeOf(this);for(;a;){const l=(i=(r=a.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];s.push(...l),a=Object.getPrototypeOf(a)}o[t]=s,this._cache.set(K0,o)}return s}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),o=r._getPointerById(n)||r._changedPointerPositions[0]||i;bo.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(t,n=!0){bo.DD._dragElements.has(this._id)||this._createDragElement(t);const r=bo.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const s=o.call(this,i,t);s?i=s:bt.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const n=bo.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),bo.DD._endDragBefore(t),bo.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=bo.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||Du.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;bo.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=bo.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&bo.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return bt.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return bt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=Ke.prototype.getClassName.call(t),i=t.children,o,s,a;n&&(t.attrs.container=n),Du.Konva[r]||(bt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Du.Konva[r];if(o=new l(t.attrs),i)for(s=i.length,a=0;a<s;a++)o.add(Ke._createNode(i[a]));return o}}wn.Node=Ke;Ke.prototype.nodeType="Node";Ke.prototype._attrsAffectingSize=[];Ke.prototype.eventListeners={};Ke.prototype.on.call(Ke.prototype,u2e,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(_l),this._clearSelfAndDescendantCache(xa)});Ke.prototype.on.call(Ke.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(w5)});Ke.prototype.on.call(Ke.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(S5)});Ke.prototype.on.call(Ke.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Iv)});const tn=Vm.Factory.addGetterSetter;tn(Ke,"zIndex");tn(Ke,"absolutePosition");tn(Ke,"position");tn(Ke,"x",0,(0,Hn.getNumberValidator)());tn(Ke,"y",0,(0,Hn.getNumberValidator)());tn(Ke,"globalCompositeOperation","source-over",(0,Hn.getStringValidator)());tn(Ke,"opacity",1,(0,Hn.getNumberValidator)());tn(Ke,"name","",(0,Hn.getStringValidator)());tn(Ke,"id","",(0,Hn.getStringValidator)());tn(Ke,"rotation",0,(0,Hn.getNumberValidator)());Vm.Factory.addComponentsGetterSetter(Ke,"scale",["x","y"]);tn(Ke,"scaleX",1,(0,Hn.getNumberValidator)());tn(Ke,"scaleY",1,(0,Hn.getNumberValidator)());Vm.Factory.addComponentsGetterSetter(Ke,"skew",["x","y"]);tn(Ke,"skewX",0,(0,Hn.getNumberValidator)());tn(Ke,"skewY",0,(0,Hn.getNumberValidator)());Vm.Factory.addComponentsGetterSetter(Ke,"offset",["x","y"]);tn(Ke,"offsetX",0,(0,Hn.getNumberValidator)());tn(Ke,"offsetY",0,(0,Hn.getNumberValidator)());tn(Ke,"dragDistance",null,(0,Hn.getNumberValidator)());tn(Ke,"width",0,(0,Hn.getNumberValidator)());tn(Ke,"height",0,(0,Hn.getNumberValidator)());tn(Ke,"listening",!0,(0,Hn.getBooleanValidator)());tn(Ke,"preventDefault",!0,(0,Hn.getBooleanValidator)());tn(Ke,"filters",null,function(e){return this._filterUpToDate=!1,e});tn(Ke,"visible",!0,(0,Hn.getBooleanValidator)());tn(Ke,"transformsEnabled","all",(0,Hn.getStringValidator)());tn(Ke,"size");tn(Ke,"dragBoundFunc");tn(Ke,"draggable",!1,(0,Hn.getBooleanValidator)());Vm.Factory.backCompat(Ke,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Ic={};Object.defineProperty(Ic,"__esModule",{value:!0});Ic.Container=void 0;const eh=dt,Kx=wn,SS=De;class Mc extends Kx.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(i){t(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Kx.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Kx.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),s=this._getCanvasCache(),a=s&&s.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(a){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),s=this._getCanvasCache(),a=s&&s.hit;if(a){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),s=this.clipWidth(),a=this.clipHeight(),l=this.clipFunc(),u=s&&a||l;const d=r===this;if(u){o.save();var f=this.getAbsoluteTransform(r),h=f.getMatrix();o.transform(h[0],h[1],h[2],h[3],h[4],h[5]),o.beginPath();let x;if(l)x=l.call(this,o,this);else{var g=this.clipX(),m=this.clipY();o.rect(g,m,s,a)}o.clip.apply(o,x),h=f.copy().invert().getMatrix(),o.transform(h[0],h[1],h[2],h[3],h[4],h[5])}var v=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(x){x[t](n,r)}),v&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,s,a,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(v){if(v.visible()){var x=v.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});x.width===0&&x.height===0||(o===void 0?(o=x.x,s=x.y,a=x.x+x.width,l=x.y+x.height):(o=Math.min(o,x.x),s=Math.min(s,x.y),a=Math.max(a,x.x+x.width),l=Math.max(l,x.y+x.height)))}});for(var f=this.find("Shape"),h=!1,g=0;g<f.length;g++){var m=f[g];if(m._isVisible(this)){h=!0;break}}return h&&o!==void 0?u={x:o,y:s,width:a-o,height:l-s}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}}Ic.Container=Mc;eh.Factory.addComponentsGetterSetter(Mc,"clip",["x","y","width","height"]);eh.Factory.addGetterSetter(Mc,"clipX",void 0,(0,SS.getNumberValidator)());eh.Factory.addGetterSetter(Mc,"clipY",void 0,(0,SS.getNumberValidator)());eh.Factory.addGetterSetter(Mc,"clipWidth",void 0,(0,SS.getNumberValidator)());eh.Factory.addGetterSetter(Mc,"clipHeight",void 0,(0,SS.getNumberValidator)());eh.Factory.addGetterSetter(Mc,"clipFunc");var yz={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.releaseCapture=Zi.setPointerCapture=Zi.hasPointerCapture=Zi.createEvent=Zi.getCapturedShape=void 0;const d2e=ft,Yg=new Map,vz=d2e.Konva._global.PointerEvent!==void 0;function f2e(e){return Yg.get(e)}Zi.getCapturedShape=f2e;function DE(e){return{evt:e,pointerId:e.pointerId}}Zi.createEvent=DE;function h2e(e,t){return Yg.get(e)===t}Zi.hasPointerCapture=h2e;function p2e(e,t){_z(e),t.getStage()&&(Yg.set(e,t),vz&&t._fire("gotpointercapture",DE(new PointerEvent("gotpointercapture"))))}Zi.setPointerCapture=p2e;function _z(e,t){const n=Yg.get(e);if(!n)return;const r=n.getStage();r&&r.content,Yg.delete(e),vz&&n._fire("lostpointercapture",DE(new PointerEvent("lostpointercapture")))}Zi.releaseCapture=_z;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=kn,n=dt,r=Ic,i=ft,o=ds,s=bS,a=ft,l=Zi;var u="Stage",d="string",f="px",h="mouseout",g="mouseleave",m="mouseover",v="mouseenter",x="mousemove",_="mousedown",b="mouseup",y="pointermove",S="pointerdown",C="pointerup",T="pointercancel",E="lostpointercapture",P="pointerout",k="pointerleave",O="pointerover",M="pointerenter",V="contextmenu",B="touchstart",A="touchend",N="touchmove",D="touchcancel",U="wheel",$=5,j=[[v,"_pointerenter"],[_,"_pointerdown"],[x,"_pointermove"],[b,"_pointerup"],[g,"_pointerleave"],[B,"_pointerdown"],[N,"_pointermove"],[A,"_pointerup"],[D,"_pointercancel"],[m,"_pointerover"],[U,"_wheel"],[V,"_contextmenu"],[S,"_pointerdown"],[y,"_pointermove"],[C,"_pointerup"],[T,"_pointercancel"],[E,"_lostpointercapture"]];const G={mouse:{[P]:h,[k]:g,[O]:m,[M]:v,[y]:x,[S]:_,[C]:b,[T]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[P]:"touchout",[k]:"touchleave",[O]:"touchover",[M]:"touchenter",[y]:N,[S]:B,[C]:A,[T]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[P]:P,[k]:k,[O]:O,[M]:M,[y]:y,[S]:S,[C]:C,[T]:T,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},q=le=>le.indexOf("pointer")>=0?"pointer":le.indexOf("touch")>=0?"touch":"mouse",Z=le=>{const W=q(le);if(W==="pointer")return i.Konva.pointerEventsEnabled&&G.pointer;if(W==="touch")return G.touch;if(W==="mouse")return G.mouse};function ee(le={}){return(le.clipFunc||le.clipWidth||le.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),le}const ie="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";e.stages=[];class se extends r.Container{constructor(W){super(ee(W)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{ee(this.attrs)}),this._checkVisibility()}_validateAdd(W){const ne=W.getType()==="Layer",fe=W.getType()==="FastLayer";ne||fe||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const W=this.visible()?"":"none";this.content.style.display=W}setContainer(W){if(typeof W===d){if(W.charAt(0)==="."){var ne=W.slice(1);W=document.getElementsByClassName(ne)[0]}else{var fe;W.charAt(0)!=="#"?fe=W:fe=W.slice(1),W=document.getElementById(fe)}if(!W)throw"Can not find container in document with id "+fe}return this._setAttr("container",W),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),W.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var W=this.children,ne=W.length,fe;for(fe=0;fe<ne;fe++)W[fe].clear();return this}clone(W){return W||(W={}),W.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,W)}destroy(){super.destroy();var W=this.content;W&&t.Util._isInDocument(W)&&this.container().removeChild(W);var ne=e.stages.indexOf(this);return ne>-1&&e.stages.splice(ne,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const W=this._pointerPositions[0]||this._changedPointerPositions[0];return W?{x:W.x,y:W.y}:(t.Util.warn(ie),null)}_getPointerById(W){return this._pointerPositions.find(ne=>ne.id===W)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(W){W=W||{},W.x=W.x||0,W.y=W.y||0,W.width=W.width||this.width(),W.height=W.height||this.height();var ne=new o.SceneCanvas({width:W.width,height:W.height,pixelRatio:W.pixelRatio||1}),fe=ne.getContext()._context,pe=this.children;return(W.x||W.y)&&fe.translate(-1*W.x,-1*W.y),pe.forEach(function(ve){if(ve.isVisible()){var ye=ve._toKonvaCanvas(W);fe.drawImage(ye._canvas,W.x,W.y,ye.getWidth()/ye.getPixelRatio(),ye.getHeight()/ye.getPixelRatio())}}),ne}getIntersection(W){if(!W)return null;var ne=this.children,fe=ne.length,pe=fe-1,ve;for(ve=pe;ve>=0;ve--){const ye=ne[ve].getIntersection(W);if(ye)return ye}return null}_resizeDOM(){var W=this.width(),ne=this.height();this.content&&(this.content.style.width=W+f,this.content.style.height=ne+f),this.bufferCanvas.setSize(W,ne),this.bufferHitCanvas.setSize(W,ne),this.children.forEach(fe=>{fe.setSize({width:W,height:ne}),fe.draw()})}add(W,...ne){if(arguments.length>1){for(var fe=0;fe<arguments.length;fe++)this.add(arguments[fe]);return this}super.add(W);var pe=this.children.length;return pe>$&&t.Util.warn("The stage has "+pe+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),W.setSize({width:this.width(),height:this.height()}),W.draw(),i.Konva.isBrowser&&this.content.appendChild(W.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(W){return l.hasPointerCapture(W,this)}setPointerCapture(W){l.setPointerCapture(W,this)}releaseCapture(W){l.releaseCapture(W,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&j.forEach(([W,ne])=>{this.content.addEventListener(W,fe=>{this[ne](fe)},{passive:!1})})}_pointerenter(W){this.setPointersPositions(W);const ne=Z(W.type);this._fire(ne.pointerenter,{evt:W,target:this,currentTarget:this})}_pointerover(W){this.setPointersPositions(W);const ne=Z(W.type);this._fire(ne.pointerover,{evt:W,target:this,currentTarget:this})}_getTargetShape(W){let ne=this[W+"targetShape"];return ne&&!ne.getStage()&&(ne=null),ne}_pointerleave(W){const ne=Z(W.type),fe=q(W.type);if(ne){this.setPointersPositions(W);var pe=this._getTargetShape(fe),ve=!s.DD.isDragging||i.Konva.hitOnDragEnabled;pe&&ve?(pe._fireAndBubble(ne.pointerout,{evt:W}),pe._fireAndBubble(ne.pointerleave,{evt:W}),this._fire(ne.pointerleave,{evt:W,target:this,currentTarget:this}),this[fe+"targetShape"]=null):ve&&(this._fire(ne.pointerleave,{evt:W,target:this,currentTarget:this}),this._fire(ne.pointerout,{evt:W,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(W){const ne=Z(W.type),fe=q(W.type);if(ne){this.setPointersPositions(W);var pe=!1;this._changedPointerPositions.forEach(ve=>{var ye=this.getIntersection(ve);if(s.DD.justDragged=!1,i.Konva["_"+fe+"ListenClick"]=!0,!(ye&&ye.isListening()))return;i.Konva.capturePointerEventsEnabled&&ye.setPointerCapture(ve.id),this[fe+"ClickStartShape"]=ye,ye._fireAndBubble(ne.pointerdown,{evt:W,pointerId:ve.id}),pe=!0;const Fe=W.type.indexOf("touch")>=0;ye.preventDefault()&&W.cancelable&&Fe&&W.preventDefault()}),pe||this._fire(ne.pointerdown,{evt:W,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(W){const ne=Z(W.type),fe=q(W.type);if(!ne)return;s.DD.isDragging&&s.DD.node.preventDefault()&&W.cancelable&&W.preventDefault(),this.setPointersPositions(W);var pe=!s.DD.isDragging||i.Konva.hitOnDragEnabled;if(!pe)return;var ve={};let ye=!1;var Je=this._getTargetShape(fe);this._changedPointerPositions.forEach(Fe=>{const Ae=l.getCapturedShape(Fe.id)||this.getIntersection(Fe),vt=Fe.id,_e={evt:W,pointerId:vt};var Qt=Je!==Ae;if(Qt&&Je&&(Je._fireAndBubble(ne.pointerout,Object.assign({},_e),Ae),Je._fireAndBubble(ne.pointerleave,Object.assign({},_e),Ae)),Ae){if(ve[Ae._id])return;ve[Ae._id]=!0}Ae&&Ae.isListening()?(ye=!0,Qt&&(Ae._fireAndBubble(ne.pointerover,Object.assign({},_e),Je),Ae._fireAndBubble(ne.pointerenter,Object.assign({},_e),Je),this[fe+"targetShape"]=Ae),Ae._fireAndBubble(ne.pointermove,Object.assign({},_e))):Je&&(this._fire(ne.pointerover,{evt:W,target:this,currentTarget:this,pointerId:vt}),this[fe+"targetShape"]=null)}),ye||this._fire(ne.pointermove,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(W){const ne=Z(W.type),fe=q(W.type);if(!ne)return;this.setPointersPositions(W);const pe=this[fe+"ClickStartShape"],ve=this[fe+"ClickEndShape"];var ye={};let Je=!1;this._changedPointerPositions.forEach(Fe=>{const Ae=l.getCapturedShape(Fe.id)||this.getIntersection(Fe);if(Ae){if(Ae.releaseCapture(Fe.id),ye[Ae._id])return;ye[Ae._id]=!0}const vt=Fe.id,_e={evt:W,pointerId:vt};let Qt=!1;i.Konva["_"+fe+"InDblClickWindow"]?(Qt=!0,clearTimeout(this[fe+"DblTimeout"])):s.DD.justDragged||(i.Konva["_"+fe+"InDblClickWindow"]=!0,clearTimeout(this[fe+"DblTimeout"])),this[fe+"DblTimeout"]=setTimeout(function(){i.Konva["_"+fe+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Ae&&Ae.isListening()?(Je=!0,this[fe+"ClickEndShape"]=Ae,Ae._fireAndBubble(ne.pointerup,Object.assign({},_e)),i.Konva["_"+fe+"ListenClick"]&&pe&&pe===Ae&&(Ae._fireAndBubble(ne.pointerclick,Object.assign({},_e)),Qt&&ve&&ve===Ae&&Ae._fireAndBubble(ne.pointerdblclick,Object.assign({},_e)))):(this[fe+"ClickEndShape"]=null,i.Konva["_"+fe+"ListenClick"]&&this._fire(ne.pointerclick,{evt:W,target:this,currentTarget:this,pointerId:vt}),Qt&&this._fire(ne.pointerdblclick,{evt:W,target:this,currentTarget:this,pointerId:vt}))}),Je||this._fire(ne.pointerup,{evt:W,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+fe+"ListenClick"]=!1,W.cancelable&&fe!=="touch"&&W.preventDefault()}_contextmenu(W){this.setPointersPositions(W);var ne=this.getIntersection(this.getPointerPosition());ne&&ne.isListening()?ne._fireAndBubble(V,{evt:W}):this._fire(V,{evt:W,target:this,currentTarget:this})}_wheel(W){this.setPointersPositions(W);var ne=this.getIntersection(this.getPointerPosition());ne&&ne.isListening()?ne._fireAndBubble(U,{evt:W}):this._fire(U,{evt:W,target:this,currentTarget:this})}_pointercancel(W){this.setPointersPositions(W);const ne=l.getCapturedShape(W.pointerId)||this.getIntersection(this.getPointerPosition());ne&&ne._fireAndBubble(C,l.createEvent(W)),l.releaseCapture(W.pointerId)}_lostpointercapture(W){l.releaseCapture(W.pointerId)}setPointersPositions(W){var ne=this._getContentPosition(),fe=null,pe=null;W=W||window.event,W.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(W.touches,ve=>{this._pointerPositions.push({id:ve.identifier,x:(ve.clientX-ne.left)/ne.scaleX,y:(ve.clientY-ne.top)/ne.scaleY})}),Array.prototype.forEach.call(W.changedTouches||W.touches,ve=>{this._changedPointerPositions.push({id:ve.identifier,x:(ve.clientX-ne.left)/ne.scaleX,y:(ve.clientY-ne.top)/ne.scaleY})})):(fe=(W.clientX-ne.left)/ne.scaleX,pe=(W.clientY-ne.top)/ne.scaleY,this.pointerPos={x:fe,y:pe},this._pointerPositions=[{x:fe,y:pe,id:t.Util._getFirstPointerId(W)}],this._changedPointerPositions=[{x:fe,y:pe,id:t.Util._getFirstPointerId(W)}])}_setPointerPosition(W){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(W)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var W=this.content.getBoundingClientRect();return{top:W.top,left:W.left,scaleX:W.width/this.content.clientWidth||1,scaleY:W.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var W=this.container();if(!W)throw"Stage has no container. A container is required.";W.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),W.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(W){W.batchDraw()}),this}}e.Stage=se,se.prototype.nodeType=u,(0,a._registerNode)(se),n.Factory.addGetterSetter(se,"container")})(yz);var jm={},gr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ft,n=kn,r=dt,i=wn,o=De,s=ft,a=Zi;var l="hasShadow",u="shadowRGBA",d="patternImage",f="linearGradient",h="radialGradient";let g;function m(){return g||(g=n.Util.createCanvasElement().getContext("2d"),g)}e.shapes={};function v(k){const O=this.attrs.fillRule;O?k.fill(O):k.fill()}function x(k){k.stroke()}function _(k){k.fill()}function b(k){k.stroke()}function y(){this._clearCache(l)}function S(){this._clearCache(u)}function C(){this._clearCache(d)}function T(){this._clearCache(f)}function E(){this._clearCache(h)}class P extends i.Node{constructor(O){super(O);let M;for(;M=n.Util.getRandomColor(),!(M&&!(M in e.shapes)););this.colorKey=M,e.shapes[M]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(d,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var O=m();const M=O.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(M&&M.setTransform){const V=new n.Transform;V.translate(this.fillPatternX(),this.fillPatternY()),V.rotate(t.Konva.getAngle(this.fillPatternRotation())),V.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),V.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const B=V.getMatrix(),A=typeof DOMMatrix>"u"?{a:B[0],b:B[1],c:B[2],d:B[3],e:B[4],f:B[5]}:new DOMMatrix(B);M.setTransform(A)}return M}}_getLinearGradient(){return this._getCache(f,this.__getLinearGradient)}__getLinearGradient(){var O=this.fillLinearGradientColorStops();if(O){for(var M=m(),V=this.fillLinearGradientStartPoint(),B=this.fillLinearGradientEndPoint(),A=M.createLinearGradient(V.x,V.y,B.x,B.y),N=0;N<O.length;N+=2)A.addColorStop(O[N],O[N+1]);return A}}_getRadialGradient(){return this._getCache(h,this.__getRadialGradient)}__getRadialGradient(){var O=this.fillRadialGradientColorStops();if(O){for(var M=m(),V=this.fillRadialGradientStartPoint(),B=this.fillRadialGradientEndPoint(),A=M.createRadialGradient(V.x,V.y,this.fillRadialGradientStartRadius(),B.x,B.y,this.fillRadialGradientEndRadius()),N=0;N<O.length;N+=2)A.addColorStop(O[N],O[N+1]);return A}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var O=n.Util.colorToRGBA(this.shadowColor());if(O)return"rgba("+O.r+","+O.g+","+O.b+","+O.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const O=this.hitStrokeWidth();return O==="auto"?this.hasStroke():this.strokeEnabled()&&!!O}intersects(O){var M=this.getStage(),V=M.bufferHitCanvas,B;return V.getContext().clear(),this.drawHit(V,null,!0),B=V.context.getImageData(Math.round(O.x),Math.round(O.y),1,1).data,B[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(O){var M;if(!this.getStage()||!((M=this.attrs.perfectDrawEnabled)!==null&&M!==void 0?M:!0))return!1;const B=O||this.hasFill(),A=this.hasStroke(),N=this.getAbsoluteOpacity()!==1;if(B&&A&&N)return!0;const D=this.hasShadow(),U=this.shadowForStrokeEnabled();return!!(B&&A&&D&&U)}setStrokeHitEnabled(O){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),O?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var O=this.size();return{x:this._centroid?-O.width/2:0,y:this._centroid?-O.height/2:0,width:O.width,height:O.height}}getClientRect(O={}){const M=O.skipTransform,V=O.relativeTo,B=this.getSelfRect(),N=!O.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=B.width+N,U=B.height+N,$=!O.skipShadow&&this.hasShadow(),j=$?this.shadowOffsetX():0,G=$?this.shadowOffsetY():0,q=D+Math.abs(j),Z=U+Math.abs(G),ee=$&&this.shadowBlur()||0,ie=q+ee*2,se=Z+ee*2,le={width:ie,height:se,x:-(N/2+ee)+Math.min(j,0)+B.x,y:-(N/2+ee)+Math.min(G,0)+B.y};return M?le:this._transformedRect(le,V)}drawScene(O,M){var V=this.getLayer(),B=O||V.getCanvas(),A=B.getContext(),N=this._getCanvasCache(),D=this.getSceneFunc(),U=this.hasShadow(),$,j,G,q=B.isCache,Z=M===this;if(!this.isVisible()&&!Z)return this;if(N){A.save();var ee=this.getAbsoluteTransform(M).getMatrix();return A.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(A),A.restore(),this}if(!D)return this;if(A.save(),this._useBufferCanvas()&&!q){$=this.getStage(),j=$.bufferCanvas,G=j.getContext(),G.clear(),G.save(),G._applyLineJoin(this);var ie=this.getAbsoluteTransform(M).getMatrix();G.transform(ie[0],ie[1],ie[2],ie[3],ie[4],ie[5]),D.call(this,G,this),G.restore();var se=j.pixelRatio;U&&A._applyShadow(this),A._applyOpacity(this),A._applyGlobalCompositeOperation(this),A.drawImage(j._canvas,0,0,j.width/se,j.height/se)}else{if(A._applyLineJoin(this),!Z){var ie=this.getAbsoluteTransform(M).getMatrix();A.transform(ie[0],ie[1],ie[2],ie[3],ie[4],ie[5]),A._applyOpacity(this),A._applyGlobalCompositeOperation(this)}U&&A._applyShadow(this),D.call(this,A,this)}return A.restore(),this}drawHit(O,M,V=!1){if(!this.shouldDrawHit(M,V))return this;var B=this.getLayer(),A=O||B.hitCanvas,N=A&&A.getContext(),D=this.hitFunc()||this.sceneFunc(),U=this._getCanvasCache(),$=U&&U.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),$){N.save();var j=this.getAbsoluteTransform(M).getMatrix();return N.transform(j[0],j[1],j[2],j[3],j[4],j[5]),this._drawCachedHitCanvas(N),N.restore(),this}if(!D)return this;if(N.save(),N._applyLineJoin(this),!(this===M)){var q=this.getAbsoluteTransform(M).getMatrix();N.transform(q[0],q[1],q[2],q[3],q[4],q[5])}return D.call(this,N,this),N.restore(),this}drawHitFromCache(O=0){var M=this._getCanvasCache(),V=this._getCachedSceneCanvas(),B=M.hit,A=B.getContext(),N=B.getWidth(),D=B.getHeight(),U,$,j,G,q,Z;A.clear(),A.drawImage(V._canvas,0,0,N,D);try{for(U=A.getImageData(0,0,N,D),$=U.data,j=$.length,G=n.Util._hexToRgb(this.colorKey),q=0;q<j;q+=4)Z=$[q+3],Z>O?($[q]=G.r,$[q+1]=G.g,$[q+2]=G.b,$[q+3]=255):$[q+3]=0;A.putImageData(U,0,0)}catch(ee){n.Util.error("Unable to draw hit graph from cached scene canvas. "+ee.message)}return this}hasPointerCapture(O){return a.hasPointerCapture(O,this)}setPointerCapture(O){a.setPointerCapture(O,this)}releaseCapture(O){a.releaseCapture(O,this)}}e.Shape=P,P.prototype._fillFunc=v,P.prototype._strokeFunc=x,P.prototype._fillFuncHit=_,P.prototype._strokeFuncHit=b,P.prototype._centroid=!1,P.prototype.nodeType="Shape",(0,s._registerNode)(P),P.prototype.eventListeners={},P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",y),P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",C),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",T),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",E),r.Factory.addGetterSetter(P,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(P,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(P,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(P,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(P,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(P,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(P,"lineJoin"),r.Factory.addGetterSetter(P,"lineCap"),r.Factory.addGetterSetter(P,"sceneFunc"),r.Factory.addGetterSetter(P,"hitFunc"),r.Factory.addGetterSetter(P,"dash"),r.Factory.addGetterSetter(P,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(P,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(P,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternImage"),r.Factory.addGetterSetter(P,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(P,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(P,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(P,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(P,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(P,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(P,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(P,"fillEnabled",!0),r.Factory.addGetterSetter(P,"strokeEnabled",!0),r.Factory.addGetterSetter(P,"shadowEnabled",!0),r.Factory.addGetterSetter(P,"dashEnabled",!0),r.Factory.addGetterSetter(P,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(P,"fillPriority","color"),r.Factory.addComponentsGetterSetter(P,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(P,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(P,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(P,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(P,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(P,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(P,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(P,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(P,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(P,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(P,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(P,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(P,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(P,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(P,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(P,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(P,"fillPatternRotation",0),r.Factory.addGetterSetter(P,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(P,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(gr);Object.defineProperty(jm,"__esModule",{value:!0});jm.Layer=void 0;const _a=kn,Xx=Ic,Td=wn,$E=dt,fk=ds,g2e=De,m2e=gr,y2e=ft;var v2e="#",_2e="beforeDraw",b2e="draw",bz=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],S2e=bz.length;class th extends Xx.Container{constructor(t){super(t),this.canvas=new fk.SceneCanvas,this.hitCanvas=new fk.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Td.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=Td.Node.prototype.moveUp.call(this);if(!t)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Td.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Td.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return Td.Node.prototype.remove.call(this),t&&t.parentNode&&_a.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&_a.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),Td.Node.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){_a.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){_a.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,_a.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<S2e;i++){const o=bz[i],s=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),a=s.shape;if(a)return a;if(r=!!s.antialiased,!s.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=_a.Util._rgbToHex(r[0],r[1],r[2]),s=m2e.shapes[v2e+o];return s?{shape:s}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(_2e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Xx.Container.prototype.drawScene.call(this,i,n),this._fire(b2e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Xx.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){_a.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return _a.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return _a.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}jm.Layer=th;th.prototype.nodeType="Layer";(0,y2e._registerNode)(th);$E.Factory.addGetterSetter(th,"imageSmoothingEnabled",!0);$E.Factory.addGetterSetter(th,"clearBeforeDraw",!0);$E.Factory.addGetterSetter(th,"hitGraphEnabled",!0,(0,g2e.getBooleanValidator)());var wS={};Object.defineProperty(wS,"__esModule",{value:!0});wS.FastLayer=void 0;const w2e=kn,x2e=jm,C2e=ft;class FE extends x2e.Layer{constructor(t){super(t),this.listening(!1),w2e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}wS.FastLayer=FE;FE.prototype.nodeType="FastLayer";(0,C2e._registerNode)(FE);var nh={};Object.defineProperty(nh,"__esModule",{value:!0});nh.Group=void 0;const T2e=kn,E2e=Ic,A2e=ft;class BE extends E2e.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&T2e.Util.throw("You may only add groups and shapes to groups.")}}nh.Group=BE;BE.prototype.nodeType="Group";(0,A2e._registerNode)(BE);var rh={};Object.defineProperty(rh,"__esModule",{value:!0});rh.Animation=void 0;const Yx=ft,hk=kn;var Qx=function(){return Yx.glob.performance&&Yx.glob.performance.now?function(){return Yx.glob.performance.now()}:function(){return new Date().getTime()}}();class $s{constructor(t,n){this.id=$s.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Qx(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t=$s,n=t.animations,r=n.length,i;for(i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=Qx(),$s._addAnimation(this),this}stop(){return $s._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var n=t.id,r=this.animations,i=r.length,o;for(o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){var t={},n=this.animations,r,i,o,s,a,l,u,d,f;for(s=0;s<n.length;s++)if(r=n[s],i=r.layers,o=r.func,r._updateFrameObject(Qx()),l=i.length,o?f=o.call(r,r.frame)!==!1:f=!0,!!f)for(a=0;a<l;a++)u=i[a],u._id!==void 0&&(t[u._id]=u);for(d in t)t.hasOwnProperty(d)&&t[d].batchDraw()}static _animationLoop(){var t=$s;t.animations.length?(t._runFrames(),hk.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,hk.Util.requestAnimFrame(this._animationLoop))}}rh.Animation=$s;$s.animations=[];$s.animIdCounter=0;$s.animRunning=!1;var Sz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=kn,n=rh,r=wn,i=ft;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,a=2,l=3,u=0,d=["fill","stroke","shadowColor"];class f{constructor(m,v,x,_,b,y,S){this.prop=m,this.propFunc=v,this.begin=_,this._pos=_,this.duration=y,this._change=0,this.prevPos=0,this.yoyo=S,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=x,this._change=b-this.begin,this.pause()}fire(m){var v=this[m];v&&v()}setTime(m){m>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():m<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=m,this.update())}getTime(){return this._time}setPosition(m){this.prevPos=this._pos,this.propFunc(m),this._pos=m}getPosition(m){return m===void 0&&(m=this._time),this.func(m,this.begin,this._change,this.duration)}play(){this.state=a,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(m){this.pause(),this._time=m,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var m=this.getTimer()-this._startTime;this.state===a?this.setTime(m):this.state===l&&this.setTime(this.duration-m)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}}class h{constructor(m){var v=this,x=m.node,_=x._id,b,y=m.easing||e.Easings.Linear,S=!!m.yoyo,C;typeof m.duration>"u"?b=.3:m.duration===0?b=.001:b=m.duration,this.node=x,this._id=u++;var T=x.getLayer()||(x instanceof i.Konva.Stage?x.getLayers():null);T||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){v.tween.onEnterFrame()},T),this.tween=new f(C,function(E){v._tweenFunc(E)},y,0,1,b*1e3,S),this._addListeners(),h.attrs[_]||(h.attrs[_]={}),h.attrs[_][this._id]||(h.attrs[_][this._id]={}),h.tweens[_]||(h.tweens[_]={});for(C in m)o[C]===void 0&&this._addAttr(C,m[C]);this.reset(),this.onFinish=m.onFinish,this.onReset=m.onReset,this.onUpdate=m.onUpdate}_addAttr(m,v){var x=this.node,_=x._id,b,y,S,C,T,E,P,k;if(S=h.tweens[_][m],S&&delete h.attrs[_][S][m],b=x.getAttr(m),t.Util._isArray(v))if(y=[],T=Math.max(v.length,b.length),m==="points"&&v.length!==b.length&&(v.length>b.length?(P=b,b=t.Util._prepareArrayForTween(b,v,x.closed())):(E=v,v=t.Util._prepareArrayForTween(v,b,x.closed()))),m.indexOf("fill")===0)for(C=0;C<T;C++)if(C%2===0)y.push(v[C]-b[C]);else{var O=t.Util.colorToRGBA(b[C]);k=t.Util.colorToRGBA(v[C]),b[C]=O,y.push({r:k.r-O.r,g:k.g-O.g,b:k.b-O.b,a:k.a-O.a})}else for(C=0;C<T;C++)y.push(v[C]-b[C]);else d.indexOf(m)!==-1?(b=t.Util.colorToRGBA(b),k=t.Util.colorToRGBA(v),y={r:k.r-b.r,g:k.g-b.g,b:k.b-b.b,a:k.a-b.a}):y=v-b;h.attrs[_][this._id][m]={start:b,diff:y,end:v,trueEnd:E,trueStart:P},h.tweens[_][m]=this._id}_tweenFunc(m){var v=this.node,x=h.attrs[v._id][this._id],_,b,y,S,C,T,E,P;for(_ in x){if(b=x[_],y=b.start,S=b.diff,P=b.end,t.Util._isArray(y))if(C=[],E=Math.max(y.length,P.length),_.indexOf("fill")===0)for(T=0;T<E;T++)T%2===0?C.push((y[T]||0)+S[T]*m):C.push("rgba("+Math.round(y[T].r+S[T].r*m)+","+Math.round(y[T].g+S[T].g*m)+","+Math.round(y[T].b+S[T].b*m)+","+(y[T].a+S[T].a*m)+")");else for(T=0;T<E;T++)C.push((y[T]||0)+S[T]*m);else d.indexOf(_)!==-1?C="rgba("+Math.round(y.r+S.r*m)+","+Math.round(y.g+S.g*m)+","+Math.round(y.b+S.b*m)+","+(y.a+S.a*m)+")":C=y+S*m;v.setAttr(_,C)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var m=this.node,v=h.attrs[m._id][this._id];v.points&&v.points.trueEnd&&m.setAttr("points",v.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var m=this.node,v=h.attrs[m._id][this._id];v.points&&v.points.trueStart&&m.points(v.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(m){return this.tween.seek(m*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var m=this.node._id,v=this._id,x=h.tweens[m],_;this.pause();for(_ in x)delete h.tweens[m][_];delete h.attrs[m][v]}}e.Tween=h,h.attrs={},h.tweens={},r.Node.prototype.to=function(g){var m=g.onFinish;g.node=this,g.onFinish=function(){this.destroy(),m&&m()};var v=new h(g);v.play()},e.Easings={BackEaseIn(g,m,v,x){var _=1.70158;return v*(g/=x)*g*((_+1)*g-_)+m},BackEaseOut(g,m,v,x){var _=1.70158;return v*((g=g/x-1)*g*((_+1)*g+_)+1)+m},BackEaseInOut(g,m,v,x){var _=1.70158;return(g/=x/2)<1?v/2*(g*g*(((_*=1.525)+1)*g-_))+m:v/2*((g-=2)*g*(((_*=1.525)+1)*g+_)+2)+m},ElasticEaseIn(g,m,v,x,_,b){var y=0;return g===0?m:(g/=x)===1?m+v:(b||(b=x*.3),!_||_<Math.abs(v)?(_=v,y=b/4):y=b/(2*Math.PI)*Math.asin(v/_),-(_*Math.pow(2,10*(g-=1))*Math.sin((g*x-y)*(2*Math.PI)/b))+m)},ElasticEaseOut(g,m,v,x,_,b){var y=0;return g===0?m:(g/=x)===1?m+v:(b||(b=x*.3),!_||_<Math.abs(v)?(_=v,y=b/4):y=b/(2*Math.PI)*Math.asin(v/_),_*Math.pow(2,-10*g)*Math.sin((g*x-y)*(2*Math.PI)/b)+v+m)},ElasticEaseInOut(g,m,v,x,_,b){var y=0;return g===0?m:(g/=x/2)===2?m+v:(b||(b=x*(.3*1.5)),!_||_<Math.abs(v)?(_=v,y=b/4):y=b/(2*Math.PI)*Math.asin(v/_),g<1?-.5*(_*Math.pow(2,10*(g-=1))*Math.sin((g*x-y)*(2*Math.PI)/b))+m:_*Math.pow(2,-10*(g-=1))*Math.sin((g*x-y)*(2*Math.PI)/b)*.5+v+m)},BounceEaseOut(g,m,v,x){return(g/=x)<1/2.75?v*(7.5625*g*g)+m:g<2/2.75?v*(7.5625*(g-=1.5/2.75)*g+.75)+m:g<2.5/2.75?v*(7.5625*(g-=2.25/2.75)*g+.9375)+m:v*(7.5625*(g-=2.625/2.75)*g+.984375)+m},BounceEaseIn(g,m,v,x){return v-e.Easings.BounceEaseOut(x-g,0,v,x)+m},BounceEaseInOut(g,m,v,x){return g<x/2?e.Easings.BounceEaseIn(g*2,0,v,x)*.5+m:e.Easings.BounceEaseOut(g*2-x,0,v,x)*.5+v*.5+m},EaseIn(g,m,v,x){return v*(g/=x)*g+m},EaseOut(g,m,v,x){return-v*(g/=x)*(g-2)+m},EaseInOut(g,m,v,x){return(g/=x/2)<1?v/2*g*g+m:-v/2*(--g*(g-2)-1)+m},StrongEaseIn(g,m,v,x){return v*(g/=x)*g*g*g*g+m},StrongEaseOut(g,m,v,x){return v*((g=g/x-1)*g*g*g*g+1)+m},StrongEaseInOut(g,m,v,x){return(g/=x/2)<1?v/2*g*g*g*g*g+m:v/2*((g-=2)*g*g*g*g+2)+m},Linear(g,m,v,x){return v*g/x+m}}})(Sz);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=ft,n=kn,r=wn,i=Ic,o=yz,s=jm,a=wS,l=nh,u=bS,d=gr,f=rh,h=Sz,g=Na,m=ds;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:s.Layer,FastLayer:a.FastLayer,Group:l.Group,DD:u.DD,Shape:d.Shape,shapes:d.shapes,Animation:f.Animation,Tween:h.Tween,Easings:h.Easings,Context:g.Context,Canvas:m.Canvas}),e.default=e.Konva})(hz);var xS={};Object.defineProperty(xS,"__esModule",{value:!0});xS.Arc=void 0;const CS=dt,P2e=gr,pk=ft,TS=De,R2e=ft;class Ja extends P2e.Shape{_sceneFunc(t){var n=pk.Konva.getAngle(this.angle()),r=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,n,r),t.arc(0,0,this.innerRadius(),n,0,!r),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=pk.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),s=1,a=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),u=o*(o>0?t:n),d=s*n,f=a*(a>0?t:n),h=l*(l>0?n:t);return{x:u,y:r?-1*h:f,width:d-u,height:h-f}}}xS.Arc=Ja;Ja.prototype._centroid=!0;Ja.prototype.className="Arc";Ja.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,R2e._registerNode)(Ja);CS.Factory.addGetterSetter(Ja,"innerRadius",0,(0,TS.getNumberValidator)());CS.Factory.addGetterSetter(Ja,"outerRadius",0,(0,TS.getNumberValidator)());CS.Factory.addGetterSetter(Ja,"angle",0,(0,TS.getNumberValidator)());CS.Factory.addGetterSetter(Ja,"clockwise",!1,(0,TS.getBooleanValidator)());var ES={},Gm={};Object.defineProperty(Gm,"__esModule",{value:!0});Gm.Line=void 0;const AS=dt,O2e=gr,wz=De,k2e=ft;function x5(e,t,n,r,i,o,s){var a=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=s*a/(a+l),d=s*l/(a+l),f=n-u*(i-e),h=r-u*(o-t),g=n+d*(i-e),m=r+d*(o-t);return[f,h,g,m]}function gk(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=x5(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(o[0])&&(r.push(o[0]),r.push(o[1]),r.push(e[i]),r.push(e[i+1]),r.push(o[2]),r.push(o[3]));return r}class yu extends O2e.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),s=this.bezier(),a,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(a=this.getTensionPoints(),l=a.length,u=o?0:4,o||t.quadraticCurveTo(a[0],a[1],a[2],a[3]);u<l-2;)t.bezierCurveTo(a[u++],a[u++],a[u++],a[u++],a[u++],a[u++]);o||t.quadraticCurveTo(a[l-2],a[l-1],n[r-2],n[r-1])}else if(s)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():gk(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=x5(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=x5(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),s=gk(t,r),a=[i[2],i[3]].concat(s).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return a}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],i=t[1],o=t[1],s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,a),o=Math.max(o,a);return{x:n,y:i,width:r-n,height:o-i}}}Gm.Line=yu;yu.prototype.className="Line";yu.prototype._attrsAffectingSize=["points","bezier","tension"];(0,k2e._registerNode)(yu);AS.Factory.addGetterSetter(yu,"closed",!1);AS.Factory.addGetterSetter(yu,"bezier",!1);AS.Factory.addGetterSetter(yu,"tension",0,(0,wz.getNumberValidator)());AS.Factory.addGetterSetter(yu,"points",[],(0,wz.getNumberArrayValidator)());var ih={},xz={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(s,a,l)=>{let u,d,f;u=l/2,d=0;for(let g=0;g<20;g++)f=u*e.tValues[20][g]+u,d+=e.cValues[20][g]*r(s,a,f);return u*d};e.getCubicArcLength=t;const n=(s,a,l)=>{l===void 0&&(l=1);const u=s[0]-2*s[1]+s[2],d=a[0]-2*a[1]+a[2],f=2*s[1]-2*s[0],h=2*a[1]-2*a[0],g=4*(u*u+d*d),m=4*(u*f+d*h),v=f*f+h*h;if(g===0)return l*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(a[2]-a[0],2));const x=m/(2*g),_=v/g,b=l+x,y=_-x*x,S=b*b+y>0?Math.sqrt(b*b+y):0,C=x*x+y>0?Math.sqrt(x*x+y):0,T=x+Math.sqrt(x*x+y)!==0?y*Math.log(Math.abs((b+S)/(x+C))):0;return Math.sqrt(g)/2*(b*S-x*C+T)};e.getQuadraticArcLength=n;function r(s,a,l){const u=i(1,l,s),d=i(1,l,a),f=u*u+d*d;return Math.sqrt(f)}const i=(s,a,l)=>{const u=l.length-1;let d,f;if(u===0)return 0;if(s===0){f=0;for(let h=0;h<=u;h++)f+=e.binomialCoefficients[u][h]*Math.pow(1-a,u-h)*Math.pow(a,h)*l[h];return f}else{d=new Array(u);for(let h=0;h<u;h++)d[h]=u*(l[h+1]-l[h]);return i(s-1,a,d)}},o=(s,a,l)=>{let u=1,d=s/a,f=(s-l(d))/a,h=0;for(;u>.001;){const g=l(d+f),m=Math.abs(s-g)/a;if(m<u)u=m,d+=f;else{const v=l(d-f),x=Math.abs(s-v)/a;x<u?(u=x,d-=f):f/=2}if(h++,h>500)break}return d};e.t2length=o})(xz);Object.defineProperty(ih,"__esModule",{value:!0});ih.Path=void 0;const I2e=dt,M2e=gr,N2e=ft,Ed=xz;class ur extends M2e.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=ur.parsePathData(this.data()),this.pathLength=ur.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,s=n[i].points;switch(o){case"L":t.lineTo(s[0],s[1]);break;case"M":t.moveTo(s[0],s[1]);break;case"C":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"Q":t.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case"A":var a=s[0],l=s[1],u=s[2],d=s[3],f=s[4],h=s[5],g=s[6],m=s[7],v=u>d?u:d,x=u>d?1:u/d,_=u>d?d/u:1;t.translate(a,l),t.rotate(g),t.scale(x,_),t.arc(0,0,v,f,f+h,1-m),t.scale(1/x,1/_),t.rotate(-g),t.translate(-a,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],f=u.points[5],h=u.points[4]+f,g=Math.PI/180;if(Math.abs(d-h)<g&&(g=Math.abs(d-h)),f<0)for(let m=d-g;m>h;m-=g){const v=ur.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],m,0);t.push(v.x,v.y)}else for(let m=d+g;m<h;m+=g){const v=ur.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],m,0);t.push(v.x,v.y)}}else if(u.command==="C")for(let m=0;m<=1;m+=.01){const v=ur.getPointOnCubicBezier(m,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(v.x,v.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],isNaN(s)||(n=Math.min(n,s),r=Math.max(r,s)),isNaN(a)||(i=Math.min(i,a),o=Math.max(o,a));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return ur.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};var s=n[i],a=s.points;switch(s.command){case"L":return ur.getPointOnLine(t,s.start.x,s.start.y,a[0],a[1]);case"C":return ur.getPointOnCubicBezier((0,Ed.t2length)(t,ur.getPathLength(n),v=>(0,Ed.getCubicArcLength)([s.start.x,a[0],a[2],a[4]],[s.start.y,a[1],a[3],a[5]],v)),s.start.x,s.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return ur.getPointOnQuadraticBezier((0,Ed.t2length)(t,ur.getPathLength(n),v=>(0,Ed.getQuadraticArcLength)([s.start.x,a[0],a[2]],[s.start.y,a[1],a[3]],v)),s.start.x,s.start.y,a[0],a[1],a[2],a[3]);case"A":var l=a[0],u=a[1],d=a[2],f=a[3],h=a[4],g=a[5],m=a[6];return h+=g*t/s.pathLength,ur.getPointOnEllipticalArc(l,u,d,f,h,m)}return null}static getPointOnLine(t,n,r,i,o,s,a){s===void 0&&(s=n),a===void 0&&(a=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var d=l*u,f;if(i===n)f={x:s,y:a+d};else if((a-r)/(s-n+1e-8)===l)f={x:s+u,y:a+d};else{var h,g,m=this.getLineLength(n,r,i,o),v=(s-n)*(i-n)+(a-r)*(o-r);v=v/(m*m),h=n+v*(i-n),g=r+v*(o-r);var x=this.getLineLength(s,a,h,g),_=Math.sqrt(t*t-x*x);u=Math.sqrt(_*_/(1+l*l)),i<n&&(u*=-1),d=l*u,f={x:h+u,y:g+d}}return f}static getPointOnCubicBezier(t,n,r,i,o,s,a,l,u){function d(x){return x*x*x}function f(x){return 3*x*x*(1-x)}function h(x){return 3*x*(1-x)*(1-x)}function g(x){return(1-x)*(1-x)*(1-x)}var m=l*d(t)+s*f(t)+i*h(t)+n*g(t),v=u*d(t)+a*f(t)+o*h(t)+r*g(t);return{x:m,y:v}}static getPointOnQuadraticBezier(t,n,r,i,o,s,a){function l(g){return g*g}function u(g){return 2*g*(1-g)}function d(g){return(1-g)*(1-g)}var f=s*l(t)+i*u(t)+n*d(t),h=a*l(t)+o*u(t)+r*d(t);return{x:f,y:h}}static getPointOnEllipticalArc(t,n,r,i,o,s){var a=Math.cos(s),l=Math.sin(s),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*a-u.y*l),y:n+(u.x*l+u.y*a)}}static parsePathData(t){if(!t)return[];var n=t,r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var o=n.split("|"),s=[],a=[],l=0,u=0,d=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,f;for(i=1;i<o.length;i++){var h=o[i],g=h.charAt(0);for(h=h.slice(1),a.length=0;f=d.exec(h);)a.push(f[0]);for(var m=[],v=0,x=a.length;v<x;v++){if(a[v]==="00"){m.push(0,0);continue}var _=parseFloat(a[v]);isNaN(_)?m.push(0):m.push(_)}for(;m.length>0&&!isNaN(m[0]);){var b=null,y=[],S=l,C=u,T,E,P,k,O,M,V,B,A,N;switch(g){case"l":l+=m.shift(),u+=m.shift(),b="L",y.push(l,u);break;case"L":l=m.shift(),u=m.shift(),y.push(l,u);break;case"m":var D=m.shift(),U=m.shift();if(l+=D,u+=U,b="M",s.length>2&&s[s.length-1].command==="z"){for(var $=s.length-2;$>=0;$--)if(s[$].command==="M"){l=s[$].points[0]+D,u=s[$].points[1]+U;break}}y.push(l,u),g="l";break;case"M":l=m.shift(),u=m.shift(),b="M",y.push(l,u),g="L";break;case"h":l+=m.shift(),b="L",y.push(l,u);break;case"H":l=m.shift(),b="L",y.push(l,u);break;case"v":u+=m.shift(),b="L",y.push(l,u);break;case"V":u=m.shift(),b="L",y.push(l,u);break;case"C":y.push(m.shift(),m.shift(),m.shift(),m.shift()),l=m.shift(),u=m.shift(),y.push(l,u);break;case"c":y.push(l+m.shift(),u+m.shift(),l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),b="C",y.push(l,u);break;case"S":E=l,P=u,T=s[s.length-1],T.command==="C"&&(E=l+(l-T.points[2]),P=u+(u-T.points[3])),y.push(E,P,m.shift(),m.shift()),l=m.shift(),u=m.shift(),b="C",y.push(l,u);break;case"s":E=l,P=u,T=s[s.length-1],T.command==="C"&&(E=l+(l-T.points[2]),P=u+(u-T.points[3])),y.push(E,P,l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),b="C",y.push(l,u);break;case"Q":y.push(m.shift(),m.shift()),l=m.shift(),u=m.shift(),y.push(l,u);break;case"q":y.push(l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),b="Q",y.push(l,u);break;case"T":E=l,P=u,T=s[s.length-1],T.command==="Q"&&(E=l+(l-T.points[0]),P=u+(u-T.points[1])),l=m.shift(),u=m.shift(),b="Q",y.push(E,P,l,u);break;case"t":E=l,P=u,T=s[s.length-1],T.command==="Q"&&(E=l+(l-T.points[0]),P=u+(u-T.points[1])),l+=m.shift(),u+=m.shift(),b="Q",y.push(E,P,l,u);break;case"A":k=m.shift(),O=m.shift(),M=m.shift(),V=m.shift(),B=m.shift(),A=l,N=u,l=m.shift(),u=m.shift(),b="A",y=this.convertEndpointToCenterParameterization(A,N,l,u,V,B,k,O,M);break;case"a":k=m.shift(),O=m.shift(),M=m.shift(),V=m.shift(),B=m.shift(),A=l,N=u,l+=m.shift(),u+=m.shift(),b="A",y=this.convertEndpointToCenterParameterization(A,N,l,u,V,B,k,O,M);break}s.push({command:b||g,points:y,start:{x:S,y:C},pathLength:this.calcLength(S,C,b||g,y)})}(g==="z"||g==="Z")&&s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(t,n,r,i){var o,s,a,l,u=ur;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,Ed.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Ed.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var d=i[4],f=i[5],h=i[4]+f,g=Math.PI/180;if(Math.abs(d-h)<g&&(g=Math.abs(d-h)),s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],d,0),f<0)for(l=d-g;l>h;l-=g)a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),s=a;else for(l=d+g;l<h;l+=g)a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),s=a;return a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),o+=u.getLineLength(s.x,s.y,a.x,a.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,s,a,l,u){var d=u*(Math.PI/180),f=Math.cos(d)*(t-r)/2+Math.sin(d)*(n-i)/2,h=-1*Math.sin(d)*(t-r)/2+Math.cos(d)*(n-i)/2,g=f*f/(a*a)+h*h/(l*l);g>1&&(a*=Math.sqrt(g),l*=Math.sqrt(g));var m=Math.sqrt((a*a*(l*l)-a*a*(h*h)-l*l*(f*f))/(a*a*(h*h)+l*l*(f*f)));o===s&&(m*=-1),isNaN(m)&&(m=0);var v=m*a*h/l,x=m*-l*f/a,_=(t+r)/2+Math.cos(d)*v-Math.sin(d)*x,b=(n+i)/2+Math.sin(d)*v+Math.cos(d)*x,y=function(O){return Math.sqrt(O[0]*O[0]+O[1]*O[1])},S=function(O,M){return(O[0]*M[0]+O[1]*M[1])/(y(O)*y(M))},C=function(O,M){return(O[0]*M[1]<O[1]*M[0]?-1:1)*Math.acos(S(O,M))},T=C([1,0],[(f-v)/a,(h-x)/l]),E=[(f-v)/a,(h-x)/l],P=[(-1*f-v)/a,(-1*h-x)/l],k=C(E,P);return S(E,P)<=-1&&(k=Math.PI),S(E,P)>=1&&(k=0),s===0&&k>0&&(k=k-2*Math.PI),s===1&&k<0&&(k=k+2*Math.PI),[_,b,a,l,T,k,d,s]}}ih.Path=ur;ur.prototype.className="Path";ur.prototype._attrsAffectingSize=["data"];(0,N2e._registerNode)(ur);I2e.Factory.addGetterSetter(ur,"data");Object.defineProperty(ES,"__esModule",{value:!0});ES.Arrow=void 0;const PS=dt,L2e=Gm,Cz=De,D2e=ft,mk=ih;class Nc extends L2e.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var s=this.pointerLength(),a=r.length,l,u;if(o){const h=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[a-2],r[a-1]],g=mk.Path.calcLength(i[i.length-4],i[i.length-3],"C",h),m=mk.Path.getPointOnQuadraticBezier(Math.min(1,1-s/g),h[0],h[1],h[2],h[3],h[4],h[5]);l=r[a-2]-m.x,u=r[a-1]-m.y}else l=r[a-2]-r[a-4],u=r[a-1]-r[a-3];var d=(Math.atan2(u,l)+n)%n,f=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[a-2],r[a-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-s,f/2),t.lineTo(-s,-f/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-s,f/2),t.lineTo(-s,-f/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}ES.Arrow=Nc;Nc.prototype.className="Arrow";(0,D2e._registerNode)(Nc);PS.Factory.addGetterSetter(Nc,"pointerLength",10,(0,Cz.getNumberValidator)());PS.Factory.addGetterSetter(Nc,"pointerWidth",10,(0,Cz.getNumberValidator)());PS.Factory.addGetterSetter(Nc,"pointerAtBeginning",!1);PS.Factory.addGetterSetter(Nc,"pointerAtEnding",!0);var RS={};Object.defineProperty(RS,"__esModule",{value:!0});RS.Circle=void 0;const $2e=dt,F2e=gr,B2e=De,U2e=ft;let oh=class extends F2e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};RS.Circle=oh;oh.prototype._centroid=!0;oh.prototype.className="Circle";oh.prototype._attrsAffectingSize=["radius"];(0,U2e._registerNode)(oh);$2e.Factory.addGetterSetter(oh,"radius",0,(0,B2e.getNumberValidator)());var OS={};Object.defineProperty(OS,"__esModule",{value:!0});OS.Ellipse=void 0;const UE=dt,z2e=gr,Tz=De,V2e=ft;class vu extends z2e.Shape{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}OS.Ellipse=vu;vu.prototype.className="Ellipse";vu.prototype._centroid=!0;vu.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,V2e._registerNode)(vu);UE.Factory.addComponentsGetterSetter(vu,"radius",["x","y"]);UE.Factory.addGetterSetter(vu,"radiusX",0,(0,Tz.getNumberValidator)());UE.Factory.addGetterSetter(vu,"radiusY",0,(0,Tz.getNumberValidator)());var kS={};Object.defineProperty(kS,"__esModule",{value:!0});kS.Image=void 0;const Zx=kn,Lc=dt,j2e=gr,G2e=ft,Hm=De;let ta=class Ez extends j2e.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let s;if(o){const a=this.attrs.cropWidth,l=this.attrs.cropHeight;a&&l?s=[o,this.cropX(),this.cropY(),a,l,0,0,n,r]:s=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?Zx.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,s))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?Zx.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=Zx.Util.createImageElement();i.onload=function(){var o=new Ez({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};kS.Image=ta;ta.prototype.className="Image";(0,G2e._registerNode)(ta);Lc.Factory.addGetterSetter(ta,"cornerRadius",0,(0,Hm.getNumberOrArrayOfNumbersValidator)(4));Lc.Factory.addGetterSetter(ta,"image");Lc.Factory.addComponentsGetterSetter(ta,"crop",["x","y","width","height"]);Lc.Factory.addGetterSetter(ta,"cropX",0,(0,Hm.getNumberValidator)());Lc.Factory.addGetterSetter(ta,"cropY",0,(0,Hm.getNumberValidator)());Lc.Factory.addGetterSetter(ta,"cropWidth",0,(0,Hm.getNumberValidator)());Lc.Factory.addGetterSetter(ta,"cropHeight",0,(0,Hm.getNumberValidator)());var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.Tag=Vf.Label=void 0;const IS=dt,H2e=gr,W2e=nh,zE=De,Az=ft;var Pz=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],q2e="Change.konva",K2e="none",C5="up",T5="right",E5="down",A5="left",X2e=Pz.length;class VE extends W2e.Group{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r<X2e;r++)t.on(Pz[r]+q2e,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,s,a,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),s=n.pointerWidth(),u=n.pointerHeight(),a=0,l=0,o){case C5:a=r/2,l=-1*u;break;case T5:a=r+s,l=i/2;break;case E5:a=r/2,l=i+u;break;case A5:a=-1*s,l=i/2;break}n.setAttrs({x:-1*a,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*a,y:-1*l})}}}Vf.Label=VE;VE.prototype.className="Label";(0,Az._registerNode)(VE);class Dc extends H2e.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),s=this.pointerHeight(),a=this.cornerRadius();let l=0,u=0,d=0,f=0;typeof a=="number"?l=u=d=f=Math.min(a,n/2,r/2):(l=Math.min(a[0]||0,n/2,r/2),u=Math.min(a[1]||0,n/2,r/2),f=Math.min(a[2]||0,n/2,r/2),d=Math.min(a[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===C5&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*s),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===T5&&(t.lineTo(n,(r-s)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+s)/2)),t.lineTo(n,r-f),t.arc(n-f,r-f,f,0,Math.PI/2,!1),i===E5&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+s),t.lineTo((n-o)/2,r)),t.lineTo(d,r),t.arc(d,r-d,d,Math.PI/2,Math.PI,!1),i===A5&&(t.lineTo(0,(r+s)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-s)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),s=this.width(),a=this.height();return o===C5?(n-=i,a+=i):o===E5?a+=i:o===A5?(t-=r*1.5,s+=r):o===T5&&(s+=r*1.5),{x:t,y:n,width:s,height:a}}}Vf.Tag=Dc;Dc.prototype.className="Tag";(0,Az._registerNode)(Dc);IS.Factory.addGetterSetter(Dc,"pointerDirection",K2e);IS.Factory.addGetterSetter(Dc,"pointerWidth",0,(0,zE.getNumberValidator)());IS.Factory.addGetterSetter(Dc,"pointerHeight",0,(0,zE.getNumberValidator)());IS.Factory.addGetterSetter(Dc,"cornerRadius",0,(0,zE.getNumberOrArrayOfNumbersValidator)(4));var Wm={};Object.defineProperty(Wm,"__esModule",{value:!0});Wm.Rect=void 0;const Y2e=dt,Q2e=gr,Z2e=ft,J2e=kn,ewe=De;let MS=class extends Q2e.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?J2e.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};Wm.Rect=MS;MS.prototype.className="Rect";(0,Z2e._registerNode)(MS);Y2e.Factory.addGetterSetter(MS,"cornerRadius",0,(0,ewe.getNumberOrArrayOfNumbersValidator)(4));var NS={};Object.defineProperty(NS,"__esModule",{value:!0});NS.RegularPolygon=void 0;const Rz=dt,twe=gr,Oz=De,nwe=ft;class $c extends twe.Shape{_sceneFunc(t){const n=this._getPoints();t.beginPath(),t.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)t.lineTo(n[r].x,n[r].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(var i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();var n=t[0].x,r=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(s=>{n=Math.min(n,s.x),r=Math.max(r,s.x),i=Math.min(i,s.y),o=Math.max(o,s.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}NS.RegularPolygon=$c;$c.prototype.className="RegularPolygon";$c.prototype._centroid=!0;$c.prototype._attrsAffectingSize=["radius"];(0,nwe._registerNode)($c);Rz.Factory.addGetterSetter($c,"radius",0,(0,Oz.getNumberValidator)());Rz.Factory.addGetterSetter($c,"sides",0,(0,Oz.getNumberValidator)());var LS={};Object.defineProperty(LS,"__esModule",{value:!0});LS.Ring=void 0;const kz=dt,rwe=gr,Iz=De,iwe=ft;var yk=Math.PI*2;class Fc extends rwe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,yk,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),yk,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}LS.Ring=Fc;Fc.prototype.className="Ring";Fc.prototype._centroid=!0;Fc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,iwe._registerNode)(Fc);kz.Factory.addGetterSetter(Fc,"innerRadius",0,(0,Iz.getNumberValidator)());kz.Factory.addGetterSetter(Fc,"outerRadius",0,(0,Iz.getNumberValidator)());var DS={};Object.defineProperty(DS,"__esModule",{value:!0});DS.Sprite=void 0;const Bc=dt,owe=gr,swe=rh,Mz=De,awe=ft;class na extends owe.Shape{constructor(t){super(t),this._updated=!0,this.anim=new swe.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],f=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),f)if(s){var h=s[n],g=r*2;t.drawImage(f,a,l,u,d,h[g+0],h[g+1],u,d)}else t.drawImage(f,a,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],s=this.frameOffsets(),a=o[i+2],l=o[i+3];if(t.beginPath(),s){var u=s[n],d=r*2;t.rect(u[d+0],u[d+1],a,l)}else t.rect(0,0,a,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t<o-1?this.frameIndex(t+1):this.frameIndex(0)}}DS.Sprite=na;na.prototype.className="Sprite";(0,awe._registerNode)(na);Bc.Factory.addGetterSetter(na,"animation");Bc.Factory.addGetterSetter(na,"animations");Bc.Factory.addGetterSetter(na,"frameOffsets");Bc.Factory.addGetterSetter(na,"image");Bc.Factory.addGetterSetter(na,"frameIndex",0,(0,Mz.getNumberValidator)());Bc.Factory.addGetterSetter(na,"frameRate",17,(0,Mz.getNumberValidator)());Bc.Factory.backCompat(na,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var $S={};Object.defineProperty($S,"__esModule",{value:!0});$S.Star=void 0;const jE=dt,lwe=gr,GE=De,uwe=ft;class _u extends lwe.Shape{_sceneFunc(t){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(var o=1;o<i*2;o++){var s=o%2===0?r:n,a=s*Math.sin(o*Math.PI/i),l=-1*s*Math.cos(o*Math.PI/i);t.lineTo(a,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}$S.Star=_u;_u.prototype.className="Star";_u.prototype._centroid=!0;_u.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,uwe._registerNode)(_u);jE.Factory.addGetterSetter(_u,"numPoints",5,(0,GE.getNumberValidator)());jE.Factory.addGetterSetter(_u,"innerRadius",0,(0,GE.getNumberValidator)());jE.Factory.addGetterSetter(_u,"outerRadius",0,(0,GE.getNumberValidator)());var xc={};Object.defineProperty(xc,"__esModule",{value:!0});xc.Text=xc.stringToArray=void 0;const P5=kn,wi=dt,cwe=gr,bu=De,dwe=ft;function Nz(e){return Array.from(e)}xc.stringToArray=Nz;var Ad="auto",fwe="center",hp="justify",hwe="Change.konva",pwe="2d",vk="-",Lz="left",gwe="text",mwe="Text",ywe="top",vwe="bottom",_k="middle",Dz="normal",_we="px ",X0=" ",bwe="right",Swe="word",wwe="char",bk="none",Jx="…",$z=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],xwe=$z.length;function Cwe(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Y0;function eC(){return Y0||(Y0=P5.Util.createCanvasElement().getContext(pwe),Y0)}function Twe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Ewe(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Awe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Wn extends cwe.Shape{constructor(t){super(Awe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<xwe;n++)this.on($z[n]+hwe,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),s=this.lineHeight()*o,a=this.verticalAlign(),l=0,u=this.align(),d=this.getWidth(),f=this.letterSpacing(),h=this.fill(),g=this.textDecoration(),m=g.indexOf("underline")!==-1,v=g.indexOf("line-through")!==-1,x,_=0,_=s/2,b=0,y=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",_k),t.setAttr("textAlign",Lz),a===_k?l=(this.getHeight()-r*s-i*2)/2:a===vwe&&(l=this.getHeight()-r*s-i*2),t.translate(i,l+i),x=0;x<r;x++){var b=0,y=0,S=n[x],C=S.text,T=S.width,E=S.lastInParagraph,P,k,O;if(t.save(),u===bwe?b+=d-T-i*2:u===fwe&&(b+=(d-T-i*2)/2),m){t.save(),t.beginPath(),t.moveTo(b,_+y+Math.round(o/2)),P=C.split(" ").length-1,k=P===0,O=u===hp&&!E?d-i*2:T,t.lineTo(b+Math.round(O),_+y+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||h,t.stroke(),t.restore()}if(v){t.save(),t.beginPath(),t.moveTo(b,_+y),P=C.split(" ").length-1,k=P===0,O=u===hp&&E&&!k?d-i*2:T,t.lineTo(b+Math.round(O),_+y),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||h,t.stroke(),t.restore()}if(f!==0||u===hp){P=C.split(" ").length-1;for(var M=Nz(C),V=0;V<M.length;V++){var B=M[V];B===" "&&!E&&u===hp&&(b+=(d-i*2-T)/P),this._partialTextX=b,this._partialTextY=_+y,this._partialText=B,t.fillStrokeShape(this),b+=this.measureSize(B).width+f}}else this._partialTextX=b,this._partialTextY=_+y,this._partialText=C,t.fillStrokeShape(this);t.restore(),r>1&&(_+=s)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=P5.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(gwe,n),this}getWidth(){var t=this.attrs.width===Ad||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Ad||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return P5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=eC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+X0+this.fontVariant()+X0+(this.fontSize()+_we)+Cwe(this.fontFamily())}_addTextLine(t){this.align()===hp&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return eC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
|
||
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,s=this.attrs.height,a=o!==Ad&&o!==void 0,l=s!==Ad&&s!==void 0,u=this.padding(),d=o-u*2,f=s-u*2,h=0,g=this.wrap(),m=g!==bk,v=g!==wwe&&m,x=this.ellipsis();this.textArr=[],eC().font=this._getContextFont();for(var _=x?this._getTextWidth(Jx):0,b=0,y=t.length;b<y;++b){var S=t[b],C=this._getTextWidth(S);if(a&&C>d)for(;S.length>0;){for(var T=0,E=S.length,P="",k=0;T<E;){var O=T+E>>>1,M=S.slice(0,O+1),V=this._getTextWidth(M)+_;V<=d?(T=O+1,P=M,k=V):E=O}if(P){if(v){var B,A=S[P.length],N=A===X0||A===vk;N&&k<=d?B=P.length:B=Math.max(P.lastIndexOf(X0),P.lastIndexOf(vk))+1,B>0&&(T=B,P=P.slice(0,T),k=this._getTextWidth(P))}P=P.trimRight(),this._addTextLine(P),r=Math.max(r,k),h+=i;var D=this._shouldHandleEllipsis(h);if(D){this._tryToAddEllipsisToLastLine();break}if(S=S.slice(T),S=S.trimLeft(),S.length>0&&(C=this._getTextWidth(S),C<=d)){this._addTextLine(S),h+=i,r=Math.max(r,C);break}}else break}else this._addTextLine(S),h+=i,r=Math.max(r,C),this._shouldHandleEllipsis(h)&&b<y-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&h+i>f)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Ad&&i!==void 0,s=this.padding(),a=i-s*2,l=this.wrap(),u=l!==bk;return!u||o&&t+r>a}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Ad&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),s=this.textArr[this.textArr.length-1];if(!(!s||!o)){if(n){var a=this._getTextWidth(s.text+Jx)<i;a||(s.text=s.text.slice(0,s.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(s.text+Jx)}}getStrokeScaleEnabled(){return!0}}xc.Text=Wn;Wn.prototype._fillFunc=Twe;Wn.prototype._strokeFunc=Ewe;Wn.prototype.className=mwe;Wn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,dwe._registerNode)(Wn);wi.Factory.overWriteSetter(Wn,"width",(0,bu.getNumberOrAutoValidator)());wi.Factory.overWriteSetter(Wn,"height",(0,bu.getNumberOrAutoValidator)());wi.Factory.addGetterSetter(Wn,"fontFamily","Arial");wi.Factory.addGetterSetter(Wn,"fontSize",12,(0,bu.getNumberValidator)());wi.Factory.addGetterSetter(Wn,"fontStyle",Dz);wi.Factory.addGetterSetter(Wn,"fontVariant",Dz);wi.Factory.addGetterSetter(Wn,"padding",0,(0,bu.getNumberValidator)());wi.Factory.addGetterSetter(Wn,"align",Lz);wi.Factory.addGetterSetter(Wn,"verticalAlign",ywe);wi.Factory.addGetterSetter(Wn,"lineHeight",1,(0,bu.getNumberValidator)());wi.Factory.addGetterSetter(Wn,"wrap",Swe);wi.Factory.addGetterSetter(Wn,"ellipsis",!1,(0,bu.getBooleanValidator)());wi.Factory.addGetterSetter(Wn,"letterSpacing",0,(0,bu.getNumberValidator)());wi.Factory.addGetterSetter(Wn,"text","",(0,bu.getStringValidator)());wi.Factory.addGetterSetter(Wn,"textDecoration","");var FS={};Object.defineProperty(FS,"__esModule",{value:!0});FS.TextPath=void 0;const tC=kn,_s=dt,Pwe=gr,pp=ih,nC=xc,Fz=De,Rwe=ft;var Owe="",Bz="normal";function Uz(e){e.fillText(this.partialText,0,0)}function zz(e){e.strokeText(this.partialText,0,0)}class mr extends Pwe.Shape{constructor(t){super(t),this.dummyCanvas=tC.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return pp.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:pp.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=pp.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&t.beginPath();for(var s=0;s<o.length;s++){t.save();var a=o[s].p0;t.translate(a.x,a.y),t.rotate(o[s].rotation),this.partialText=o[s].text,t.fillStrokeShape(this),n==="underline"&&(s===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}n==="underline"&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var o=n[i].p1;t.lineTo(o.x,o.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return tC.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return nC.Text.prototype.setText.call(this,t)}_getContextFont(){return nC.Text.prototype._getContextFont.call(this)}_getTextSize(t){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),s=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let a=0;i==="center"&&(a=Math.max(0,this.pathLength/2-s/2)),i==="right"&&(a=Math.max(0,this.pathLength-s));const l=(0,nC.stringToArray)(this.text());let u=a;for(var d=0;d<l.length;d++){const f=this._getPointAtLength(u);if(!f)return;let h=this._getTextSize(l[d]).width+r;if(l[d]===" "&&i==="justify"){const b=this.text().split(" ").length-1;h+=(this.pathLength-s)/b}const g=this._getPointAtLength(u+h);if(!g)return;const m=pp.Path.getLineLength(f.x,f.y,g.x,g.y);let v=0;if(o)try{v=o(l[d-1],l[d])*this.fontSize()}catch{v=0}f.x+=v,g.x+=v,this.textWidth+=v;const x=pp.Path.getPointOnLine(v+m/2,f.x,f.y,g.x,g.y),_=Math.atan2(g.y-f.y,g.x-f.x);this.glyphInfo.push({transposeX:x.x,transposeY:x.y,text:l[d],rotation:_,p0:f,p1:g}),u+=h}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(d){t.push(d.p0.x),t.push(d.p0.y),t.push(d.p1.x),t.push(d.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,s,a,l=0;l<t.length/2;l++)s=t[l*2],a=t[l*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,a),o=Math.max(o,a);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return tC.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}FS.TextPath=mr;mr.prototype._fillFunc=Uz;mr.prototype._strokeFunc=zz;mr.prototype._fillFuncHit=Uz;mr.prototype._strokeFuncHit=zz;mr.prototype.className="TextPath";mr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,Rwe._registerNode)(mr);_s.Factory.addGetterSetter(mr,"data");_s.Factory.addGetterSetter(mr,"fontFamily","Arial");_s.Factory.addGetterSetter(mr,"fontSize",12,(0,Fz.getNumberValidator)());_s.Factory.addGetterSetter(mr,"fontStyle",Bz);_s.Factory.addGetterSetter(mr,"align","left");_s.Factory.addGetterSetter(mr,"letterSpacing",0,(0,Fz.getNumberValidator)());_s.Factory.addGetterSetter(mr,"textBaseline","middle");_s.Factory.addGetterSetter(mr,"fontVariant",Bz);_s.Factory.addGetterSetter(mr,"text",Owe);_s.Factory.addGetterSetter(mr,"textDecoration",null);_s.Factory.addGetterSetter(mr,"kerningFunc",null);var BS={};Object.defineProperty(BS,"__esModule",{value:!0});BS.Transformer=void 0;const Xt=kn,Wt=dt,Sk=wn,kwe=gr,Iwe=Wm,wk=nh,Qo=ft,Su=De,Mwe=ft;var Vz="tr-konva",Nwe=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${Vz}`).join(" "),xk="nodesRect",Lwe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Dwe={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const $we="ontouchstart"in Qo.Konva._global;function Fwe(e,t){if(e==="rotater")return"crosshair";t+=Xt.Util.degToRad(Dwe[e]||0);var n=(Xt.Util.radToDeg(t)%360+360)%360;return Xt.Util._inRange(n,315+22.5,360)||Xt.Util._inRange(n,0,22.5)?"ns-resize":Xt.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":Xt.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":Xt.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":Xt.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":Xt.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":Xt.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":Xt.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(Xt.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var h_=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],Ck=1e8;function Bwe(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function jz(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function Uwe(e,t){const n=Bwe(e);return jz(e,t,n)}function zwe(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=Qo.Konva.getAngle(e[i]),s=Math.abs(o-t)%(Math.PI*2);Math.min(s,Math.PI*2-s)<n&&(r=o)}return r}class Mt extends wk.Group{constructor(t){super(t),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Nwe,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return Xt.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Vz+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(Xt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},s=i._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");i.on(s,o),i.on(Lwe.map(a=>a+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache();var r=!!this.findOne(".top-left");return r&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,s=i.y-n.y;this.nodes().forEach(a=>{if(a===t||a.isDragging())return;const l=a.getAbsolutePosition();a.setAbsolutePosition({x:l.x+o,y:l.y+s}),a.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(xk),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(xk,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),s=t.getAbsolutePosition(r),a=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(Qo.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:s.x+a*Math.cos(u)+l*Math.sin(-u),y:s.y+l*Math.cos(u)+a*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return jz(d,-Qo.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-Ck,y:-Ck,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var f=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],h=u.getAbsoluteTransform();f.forEach(function(g){var m=h.point(g);n.push(m)})});const r=new Xt.Transform;r.rotate(-Qo.Konva.getAngle(this.rotation()));var i,o,s,a;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=s=d.x,o=a=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),s=Math.max(s,d.x),a=Math.max(a,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:s-i,height:a-o,rotation:Qo.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),h_.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new Iwe.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:$we?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=Qo.Konva.getAngle(this.rotation()),o=Fwe(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new kwe.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*Xt.Util._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var s=t.target.getAbsolutePosition(),a=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-s.x,y:a.y-s.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),s=o.getStage();s.setPointersPositions(t);const a=s.getPointerPosition();let l={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var f=this._getNodeRect();n=o.x()-f.width/2,r=-o.y()+f.height/2;let B=Math.atan2(-r,n)+Math.PI/2;f.height<0&&(B-=Math.PI);var h=Qo.Konva.getAngle(this.rotation());const A=h+B,N=Qo.Konva.getAngle(this.rotationSnapTolerance()),U=zwe(this.rotationSnaps(),A,N)-f.rotation,$=Uwe(f,U);this._fitNodesInto($,t);return}var g=this.shiftBehavior(),m;g==="inverted"?m=this.keepRatio()&&!t.shiftKey:g==="none"?m=this.keepRatio():m=this.keepRatio()||t.shiftKey;var y=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(m){var v=y?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(v.x-o.x(),2)+Math.pow(v.y-o.y(),2));var x=this.findOne(".top-left").x()>v.x?-1:1,_=this.findOne(".top-left").y()>v.y?-1:1;n=i*this.cos*x,r=i*this.sin*_,this.findOne(".top-left").x(v.x-n),this.findOne(".top-left").y(v.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(m){var v=y?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-v.x,2)+Math.pow(v.y-o.y(),2));var x=this.findOne(".top-right").x()<v.x?-1:1,_=this.findOne(".top-right").y()>v.y?-1:1;n=i*this.cos*x,r=i*this.sin*_,this.findOne(".top-right").x(v.x+n),this.findOne(".top-right").y(v.y-r)}var b=o.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(m){var v=y?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(v.x-o.x(),2)+Math.pow(o.y()-v.y,2));var x=v.x<o.x()?-1:1,_=o.y()<v.y?-1:1;n=i*this.cos*x,r=i*this.sin*_,o.x(v.x-n),o.y(v.y+r)}b=o.position(),this.findOne(".top-left").x(b.x),this.findOne(".bottom-right").y(b.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(m){var v=y?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-v.x,2)+Math.pow(o.y()-v.y,2));var x=this.findOne(".bottom-right").x()<v.x?-1:1,_=this.findOne(".bottom-right").y()<v.y?-1:1;n=i*this.cos*x,r=i*this.sin*_,this.findOne(".bottom-right").x(v.x+n),this.findOne(".bottom-right").y(v.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var y=this.centeredScaling()||t.altKey;if(y){var S=this.findOne(".top-left"),C=this.findOne(".bottom-right"),T=S.x(),E=S.y(),P=this.getWidth()-C.x(),k=this.getHeight()-C.y();C.move({x:-T,y:-E}),S.move({x:P,y:k})}var O=this.findOne(".top-left").getAbsolutePosition();n=O.x,r=O.y;var M=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),V=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:M,height:V,rotation:Qo.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();this._fire("transformend",{evt:t,target:n}),n&&this._nodes.forEach(r=>{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(Xt.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(Xt.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var s=new Xt.Transform;if(s.rotate(Qo.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const f=s.point({x:-this.padding()*2,y:0});if(t.x+=f.x,t.y+=f.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const f=s.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const f=s.point({x:0,y:-this.padding()*2});if(t.x+=f.x,t.y+=f.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const f=s.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const f=this.boundBoxFunc()(r,t);f?t=f:Xt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const a=1e7,l=new Xt.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/a,r.height/a);const u=new Xt.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/a,t.height/a);const d=u.multiply(l.invert());this._nodes.forEach(f=>{var h;const g=f.getParent().getAbsoluteTransform(),m=f.getTransform().copy();m.translate(f.offsetX(),f.offsetY());const v=new Xt.Transform;v.multiply(g.copy().invert()).multiply(d).multiply(g).multiply(m);const x=v.decompose();f.setAttrs(x),this._fire("transform",{evt:n,target:f}),f._fire("transform",{evt:n,target:f}),(h=f.getLayer())===null||h===void 0||h.batchDraw()}),this.rotation(Xt.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(Xt.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),s=this.resizeEnabled(),a=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(f=>{f.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+a,offsetY:l/2+a,visible:s&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+a,visible:s&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-a,offsetY:l/2+a,visible:s&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+a,visible:s&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-a,visible:s&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+a,offsetY:l/2-a,visible:s&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-a,visible:s&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-a,offsetY:l/2-a,visible:s&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Xt.Util._sign(i)-a,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const d=this.anchorStyleFunc();d&&u.forEach(f=>{d(f)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),wk.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Sk.Node.prototype.toObject.call(this)}clone(t){var n=Sk.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}BS.Transformer=Mt;function Vwe(e){return e instanceof Array||Xt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){h_.indexOf(t)===-1&&Xt.Util.warn("Unknown anchor name: "+t+". Available names are: "+h_.join(", "))}),e||[]}Mt.prototype.className="Transformer";(0,Mwe._registerNode)(Mt);Wt.Factory.addGetterSetter(Mt,"enabledAnchors",h_,Vwe);Wt.Factory.addGetterSetter(Mt,"flipEnabled",!0,(0,Su.getBooleanValidator)());Wt.Factory.addGetterSetter(Mt,"resizeEnabled",!0);Wt.Factory.addGetterSetter(Mt,"anchorSize",10,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"rotateEnabled",!0);Wt.Factory.addGetterSetter(Mt,"rotationSnaps",[]);Wt.Factory.addGetterSetter(Mt,"rotateAnchorOffset",50,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"rotationSnapTolerance",5,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"borderEnabled",!0);Wt.Factory.addGetterSetter(Mt,"anchorStroke","rgb(0, 161, 255)");Wt.Factory.addGetterSetter(Mt,"anchorStrokeWidth",1,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"anchorFill","white");Wt.Factory.addGetterSetter(Mt,"anchorCornerRadius",0,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"borderStroke","rgb(0, 161, 255)");Wt.Factory.addGetterSetter(Mt,"borderStrokeWidth",1,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"borderDash");Wt.Factory.addGetterSetter(Mt,"keepRatio",!0);Wt.Factory.addGetterSetter(Mt,"shiftBehavior","default");Wt.Factory.addGetterSetter(Mt,"centeredScaling",!1);Wt.Factory.addGetterSetter(Mt,"ignoreStroke",!1);Wt.Factory.addGetterSetter(Mt,"padding",0,(0,Su.getNumberValidator)());Wt.Factory.addGetterSetter(Mt,"node");Wt.Factory.addGetterSetter(Mt,"nodes");Wt.Factory.addGetterSetter(Mt,"boundBoxFunc");Wt.Factory.addGetterSetter(Mt,"anchorDragBoundFunc");Wt.Factory.addGetterSetter(Mt,"anchorStyleFunc");Wt.Factory.addGetterSetter(Mt,"shouldOverdrawWholeArea",!1);Wt.Factory.addGetterSetter(Mt,"useSingleNodeRotation",!0);Wt.Factory.backCompat(Mt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var US={};Object.defineProperty(US,"__esModule",{value:!0});US.Wedge=void 0;const zS=dt,jwe=gr,Gwe=ft,Gz=De,Hwe=ft;class el extends jwe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Gwe.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}US.Wedge=el;el.prototype.className="Wedge";el.prototype._centroid=!0;el.prototype._attrsAffectingSize=["radius"];(0,Hwe._registerNode)(el);zS.Factory.addGetterSetter(el,"radius",0,(0,Gz.getNumberValidator)());zS.Factory.addGetterSetter(el,"angle",0,(0,Gz.getNumberValidator)());zS.Factory.addGetterSetter(el,"clockwise",!1);zS.Factory.backCompat(el,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var VS={};Object.defineProperty(VS,"__esModule",{value:!0});VS.Blur=void 0;const Tk=dt,Wwe=wn,qwe=De;function Ek(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Kwe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Xwe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Ywe(e,t){var n=e.data,r=e.width,i=e.height,o,s,a,l,u,d,f,h,g,m,v,x,_,b,y,S,C,T,E,P,k,O,M,V,B=t+t+1,A=r-1,N=i-1,D=t+1,U=D*(D+1)/2,$=new Ek,j=null,G=$,q=null,Z=null,ee=Kwe[t],ie=Xwe[t];for(a=1;a<B;a++)G=G.next=new Ek,a===D&&(j=G);for(G.next=$,f=d=0,s=0;s<i;s++){for(S=C=T=E=h=g=m=v=0,x=D*(P=n[d]),_=D*(k=n[d+1]),b=D*(O=n[d+2]),y=D*(M=n[d+3]),h+=U*P,g+=U*k,m+=U*O,v+=U*M,G=$,a=0;a<D;a++)G.r=P,G.g=k,G.b=O,G.a=M,G=G.next;for(a=1;a<D;a++)l=d+((A<a?A:a)<<2),h+=(G.r=P=n[l])*(V=D-a),g+=(G.g=k=n[l+1])*V,m+=(G.b=O=n[l+2])*V,v+=(G.a=M=n[l+3])*V,S+=P,C+=k,T+=O,E+=M,G=G.next;for(q=$,Z=j,o=0;o<r;o++)n[d+3]=M=v*ee>>ie,M!==0?(M=255/M,n[d]=(h*ee>>ie)*M,n[d+1]=(g*ee>>ie)*M,n[d+2]=(m*ee>>ie)*M):n[d]=n[d+1]=n[d+2]=0,h-=x,g-=_,m-=b,v-=y,x-=q.r,_-=q.g,b-=q.b,y-=q.a,l=f+((l=o+t+1)<A?l:A)<<2,S+=q.r=n[l],C+=q.g=n[l+1],T+=q.b=n[l+2],E+=q.a=n[l+3],h+=S,g+=C,m+=T,v+=E,q=q.next,x+=P=Z.r,_+=k=Z.g,b+=O=Z.b,y+=M=Z.a,S-=P,C-=k,T-=O,E-=M,Z=Z.next,d+=4;f+=r}for(o=0;o<r;o++){for(C=T=E=S=g=m=v=h=0,d=o<<2,x=D*(P=n[d]),_=D*(k=n[d+1]),b=D*(O=n[d+2]),y=D*(M=n[d+3]),h+=U*P,g+=U*k,m+=U*O,v+=U*M,G=$,a=0;a<D;a++)G.r=P,G.g=k,G.b=O,G.a=M,G=G.next;for(u=r,a=1;a<=t;a++)d=u+o<<2,h+=(G.r=P=n[d])*(V=D-a),g+=(G.g=k=n[d+1])*V,m+=(G.b=O=n[d+2])*V,v+=(G.a=M=n[d+3])*V,S+=P,C+=k,T+=O,E+=M,G=G.next,a<N&&(u+=r);for(d=o,q=$,Z=j,s=0;s<i;s++)l=d<<2,n[l+3]=M=v*ee>>ie,M>0?(M=255/M,n[l]=(h*ee>>ie)*M,n[l+1]=(g*ee>>ie)*M,n[l+2]=(m*ee>>ie)*M):n[l]=n[l+1]=n[l+2]=0,h-=x,g-=_,m-=b,v-=y,x-=q.r,_-=q.g,b-=q.b,y-=q.a,l=o+((l=s+D)<N?l:N)*r<<2,h+=S+=q.r=n[l],g+=C+=q.g=n[l+1],m+=T+=q.b=n[l+2],v+=E+=q.a=n[l+3],q=q.next,x+=P=Z.r,_+=k=Z.g,b+=O=Z.b,y+=M=Z.a,S-=P,C-=k,T-=O,E-=M,Z=Z.next,d+=r}}const Qwe=function(t){var n=Math.round(this.blurRadius());n>0&&Ywe(t,n)};VS.Blur=Qwe;Tk.Factory.addGetterSetter(Wwe.Node,"blurRadius",0,(0,qwe.getNumberValidator)(),Tk.Factory.afterSetFilter);var jS={};Object.defineProperty(jS,"__esModule",{value:!0});jS.Brighten=void 0;const Ak=dt,Zwe=wn,Jwe=De,exe=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};jS.Brighten=exe;Ak.Factory.addGetterSetter(Zwe.Node,"brightness",0,(0,Jwe.getNumberValidator)(),Ak.Factory.afterSetFilter);var GS={};Object.defineProperty(GS,"__esModule",{value:!0});GS.Contrast=void 0;const Pk=dt,txe=wn,nxe=De,rxe=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,s=150,a;for(a=0;a<r;a+=4)i=n[a],o=n[a+1],s=n[a+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,s/=255,s-=.5,s*=t,s+=.5,s*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,s=s<0?0:s>255?255:s,n[a]=i,n[a+1]=o,n[a+2]=s};GS.Contrast=rxe;Pk.Factory.addGetterSetter(txe.Node,"contrast",0,(0,nxe.getNumberValidator)(),Pk.Factory.afterSetFilter);var HS={};Object.defineProperty(HS,"__esModule",{value:!0});HS.Emboss=void 0;const su=dt,WS=wn,ixe=kn,Hz=De,oxe=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,s=0,a=e.data,l=e.width,u=e.height,d=l*4,f=u;switch(r){case"top-left":o=-1,s=-1;break;case"top":o=-1,s=0;break;case"top-right":o=-1,s=1;break;case"right":o=0,s=1;break;case"bottom-right":o=1,s=1;break;case"bottom":o=1,s=0;break;case"bottom-left":o=1,s=-1;break;case"left":o=0,s=-1;break;default:ixe.Util.error("Unknown emboss direction: "+r)}do{var h=(f-1)*d,g=o;f+g<1&&(g=0),f+g>u&&(g=0);var m=(f-1+g)*l*4,v=l;do{var x=h+(v-1)*4,_=s;v+_<1&&(_=0),v+_>l&&(_=0);var b=m+(v-1+_)*4,y=a[x]-a[b],S=a[x+1]-a[b+1],C=a[x+2]-a[b+2],T=y,E=T>0?T:-T,P=S>0?S:-S,k=C>0?C:-C;if(P>E&&(T=S),k>E&&(T=C),T*=t,i){var O=a[x]+T,M=a[x+1]+T,V=a[x+2]+T;a[x]=O>255?255:O<0?0:O,a[x+1]=M>255?255:M<0?0:M,a[x+2]=V>255?255:V<0?0:V}else{var B=n-T;B<0?B=0:B>255&&(B=255),a[x]=a[x+1]=a[x+2]=B}}while(--v)}while(--f)};HS.Emboss=oxe;su.Factory.addGetterSetter(WS.Node,"embossStrength",.5,(0,Hz.getNumberValidator)(),su.Factory.afterSetFilter);su.Factory.addGetterSetter(WS.Node,"embossWhiteLevel",.5,(0,Hz.getNumberValidator)(),su.Factory.afterSetFilter);su.Factory.addGetterSetter(WS.Node,"embossDirection","top-left",null,su.Factory.afterSetFilter);su.Factory.addGetterSetter(WS.Node,"embossBlend",!1,null,su.Factory.afterSetFilter);var qS={};Object.defineProperty(qS,"__esModule",{value:!0});qS.Enhance=void 0;const Rk=dt,sxe=wn,axe=De;function rC(e,t,n,r,i){var o=n-t,s=i-r,a;return o===0?r+s/2:s===0?r:(a=(e-t)/o,a=s*a+r,a)}const lxe=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,s=t[1],a=s,l,u=t[2],d=u,f,h,g=this.enhance();if(g!==0){for(h=0;h<n;h+=4)o=t[h+0],o<r?r=o:o>i&&(i=o),l=t[h+1],l<s?s=l:l>a&&(a=l),f=t[h+2],f<u?u=f:f>d&&(d=f);i===r&&(i=255,r=0),a===s&&(a=255,s=0),d===u&&(d=255,u=0);var m,v,x,_,b,y,S,C,T;for(g>0?(v=i+g*(255-i),x=r-g*(r-0),b=a+g*(255-a),y=s-g*(s-0),C=d+g*(255-d),T=u-g*(u-0)):(m=(i+r)*.5,v=i+g*(i-m),x=r+g*(r-m),_=(a+s)*.5,b=a+g*(a-_),y=s+g*(s-_),S=(d+u)*.5,C=d+g*(d-S),T=u+g*(u-S)),h=0;h<n;h+=4)t[h+0]=rC(t[h+0],r,i,x,v),t[h+1]=rC(t[h+1],s,a,y,b),t[h+2]=rC(t[h+2],u,d,T,C)}};qS.Enhance=lxe;Rk.Factory.addGetterSetter(sxe.Node,"enhance",0,(0,axe.getNumberValidator)(),Rk.Factory.afterSetFilter);var KS={};Object.defineProperty(KS,"__esModule",{value:!0});KS.Grayscale=void 0;const uxe=function(e){var t=e.data,n=t.length,r,i;for(r=0;r<n;r+=4)i=.34*t[r]+.5*t[r+1]+.16*t[r+2],t[r]=i,t[r+1]=i,t[r+2]=i};KS.Grayscale=uxe;var XS={};Object.defineProperty(XS,"__esModule",{value:!0});XS.HSL=void 0;const jf=dt,HE=wn,WE=De;jf.Factory.addGetterSetter(HE.Node,"hue",0,(0,WE.getNumberValidator)(),jf.Factory.afterSetFilter);jf.Factory.addGetterSetter(HE.Node,"saturation",0,(0,WE.getNumberValidator)(),jf.Factory.afterSetFilter);jf.Factory.addGetterSetter(HE.Node,"luminance",0,(0,WE.getNumberValidator)(),jf.Factory.afterSetFilter);const cxe=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s=this.luminance()*127,a,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),d=.299*r+.701*l+.167*u,f=.587*r-.587*l+.33*u,h=.114*r-.114*l-.497*u,g=.299*r-.299*l-.328*u,m=.587*r+.413*l+.035*u,v=.114*r-.114*l+.293*u,x=.299*r-.3*l+1.25*u,_=.587*r-.586*l-1.05*u,b=.114*r+.886*l-.2*u,y,S,C,T;for(a=0;a<n;a+=4)y=t[a+0],S=t[a+1],C=t[a+2],T=t[a+3],t[a+0]=d*y+f*S+h*C+s,t[a+1]=g*y+m*S+v*C+s,t[a+2]=x*y+_*S+b*C+s,t[a+3]=T};XS.HSL=cxe;var YS={};Object.defineProperty(YS,"__esModule",{value:!0});YS.HSV=void 0;const Gf=dt,qE=wn,KE=De,dxe=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,s,a=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*a+.167*l,d=.587*r-.587*a+.33*l,f=.114*r-.114*a-.497*l,h=.299*r-.299*a-.328*l,g=.587*r+.413*a+.035*l,m=.114*r-.114*a+.293*l,v=.299*r-.3*a+1.25*l,x=.587*r-.586*a-1.05*l,_=.114*r+.886*a-.2*l,b,y,S,C;for(s=0;s<n;s+=4)b=t[s+0],y=t[s+1],S=t[s+2],C=t[s+3],t[s+0]=u*b+d*y+f*S,t[s+1]=h*b+g*y+m*S,t[s+2]=v*b+x*y+_*S,t[s+3]=C};YS.HSV=dxe;Gf.Factory.addGetterSetter(qE.Node,"hue",0,(0,KE.getNumberValidator)(),Gf.Factory.afterSetFilter);Gf.Factory.addGetterSetter(qE.Node,"saturation",0,(0,KE.getNumberValidator)(),Gf.Factory.afterSetFilter);Gf.Factory.addGetterSetter(qE.Node,"value",0,(0,KE.getNumberValidator)(),Gf.Factory.afterSetFilter);var QS={};Object.defineProperty(QS,"__esModule",{value:!0});QS.Invert=void 0;const fxe=function(e){var t=e.data,n=t.length,r;for(r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]};QS.Invert=fxe;var ZS={};Object.defineProperty(ZS,"__esModule",{value:!0});ZS.Kaleidoscope=void 0;const p_=dt,Wz=wn,Ok=kn,qz=De;var hxe=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,u,d,f,h=0,g=0,m=0,v=0,x,_=Math.sqrt(a*a+l*l);d=o-a,f=s-l,x=Math.sqrt(d*d+f*f),_=x>_?x:_;var b=s,y=o,S,C,T=360/y*Math.PI/180,E,P;for(C=0;C<y;C+=1)for(E=Math.sin(C*T),P=Math.cos(C*T),S=0;S<b;S+=1)d=Math.floor(a+_*S/b*P),f=Math.floor(l+_*S/b*E),u=(f*o+d)*4,h=r[u+0],g=r[u+1],m=r[u+2],v=r[u+3],u=(C+S*o)*4,i[u+0]=h,i[u+1]=g,i[u+2]=m,i[u+3]=v},pxe=function(e,t,n){var r=e.data,i=t.data,o=e.width,s=e.height,a=n.polarCenterX||o/2,l=n.polarCenterY||s/2,u,d,f,h,g,m=0,v=0,x=0,_=0,b,y=Math.sqrt(a*a+l*l);d=o-a,f=s-l,b=Math.sqrt(d*d+f*f),y=b>y?b:y;var S=s,C=o,T,E,P=n.polarRotation||0,k,O;for(d=0;d<o;d+=1)for(f=0;f<s;f+=1)h=d-a,g=f-l,T=Math.sqrt(h*h+g*g)*S/y,E=(Math.atan2(g,h)*180/Math.PI+360+P)%360,E=E*C/360,k=Math.floor(E),O=Math.floor(T),u=(O*o+k)*4,m=r[u+0],v=r[u+1],x=r[u+2],_=r[u+3],u=(f*o+d)*4,i[u+0]=m,i[u+1]=v,i[u+2]=x,i[u+3]=_};const gxe=function(e){var t=e.width,n=e.height,r,i,o,s,a,l,u,d,f,h,g=Math.round(this.kaleidoscopePower()),m=Math.round(this.kaleidoscopeAngle()),v=Math.floor(t*(m%360)/360);if(!(g<1)){var x=Ok.Util.createCanvasElement();x.width=t,x.height=n;var _=x.getContext("2d").getImageData(0,0,t,n);Ok.Util.releaseCanvas(x),hxe(e,_,{polarCenterX:t/2,polarCenterY:n/2});for(var b=t/Math.pow(2,g);b<=8;)b=b*2,g-=1;b=Math.ceil(b);var y=b,S=0,C=y,T=1;for(v+b>t&&(S=y,C=0,T=-1),i=0;i<n;i+=1)for(r=S;r!==C;r+=T)o=Math.round(r+v)%t,f=(t*i+o)*4,a=_.data[f+0],l=_.data[f+1],u=_.data[f+2],d=_.data[f+3],h=(t*i+r)*4,_.data[h+0]=a,_.data[h+1]=l,_.data[h+2]=u,_.data[h+3]=d;for(i=0;i<n;i+=1)for(y=Math.floor(b),s=0;s<g;s+=1){for(r=0;r<y+1;r+=1)f=(t*i+r)*4,a=_.data[f+0],l=_.data[f+1],u=_.data[f+2],d=_.data[f+3],h=(t*i+y*2-r-1)*4,_.data[h+0]=a,_.data[h+1]=l,_.data[h+2]=u,_.data[h+3]=d;y*=2}pxe(_,e,{polarRotation:0})}};ZS.Kaleidoscope=gxe;p_.Factory.addGetterSetter(Wz.Node,"kaleidoscopePower",2,(0,qz.getNumberValidator)(),p_.Factory.afterSetFilter);p_.Factory.addGetterSetter(Wz.Node,"kaleidoscopeAngle",0,(0,qz.getNumberValidator)(),p_.Factory.afterSetFilter);var JS={};Object.defineProperty(JS,"__esModule",{value:!0});JS.Mask=void 0;const kk=dt,mxe=wn,yxe=De;function Q0(e,t,n){var r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function gp(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function vxe(e){for(var t=[0,0,0],n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function _xe(e,t){var n=Q0(e,0,0),r=Q0(e,e.width-1,0),i=Q0(e,0,e.height-1),o=Q0(e,e.width-1,e.height-1),s=t||10;if(gp(n,r)<s&&gp(r,o)<s&&gp(o,i)<s&&gp(i,n)<s){for(var a=vxe([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var d=gp(a,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=d<s?0:255}return l}}function bxe(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function Sxe(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,d=0,f=0;f<i;f++)for(var h=0;h<i;h++){var g=a+f-o,m=l+h-o;if(g>=0&&g<n&&m>=0&&m<t){var v=g*t+m,x=r[f*i+h];d+=e[v]*x}}s[u]=d===255*8?255:0}return s}function wxe(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,d=0,f=0;f<i;f++)for(var h=0;h<i;h++){var g=a+f-o,m=l+h-o;if(g>=0&&g<n&&m>=0&&m<t){var v=g*t+m,x=r[f*i+h];d+=e[v]*x}}s[u]=d>=255*4?255:0}return s}function xxe(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),s=[],a=0;a<n;a++)for(var l=0;l<t;l++){for(var u=a*t+l,d=0,f=0;f<i;f++)for(var h=0;h<i;h++){var g=a+f-o,m=l+h-o;if(g>=0&&g<n&&m>=0&&m<t){var v=g*t+m,x=r[f*i+h];d+=e[v]*x}}s[u]=d}return s}const Cxe=function(e){var t=this.threshold(),n=_xe(e,t);return n&&(n=Sxe(n,e.width,e.height),n=wxe(n,e.width,e.height),n=xxe(n,e.width,e.height),bxe(e,n)),e};JS.Mask=Cxe;kk.Factory.addGetterSetter(mxe.Node,"threshold",0,(0,yxe.getNumberValidator)(),kk.Factory.afterSetFilter);var e2={};Object.defineProperty(e2,"__esModule",{value:!0});e2.Noise=void 0;const Ik=dt,Txe=wn,Exe=De,Axe=function(e){var t=this.noise()*255,n=e.data,r=n.length,i=t/2,o;for(o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};e2.Noise=Axe;Ik.Factory.addGetterSetter(Txe.Node,"noise",.2,(0,Exe.getNumberValidator)(),Ik.Factory.afterSetFilter);var t2={};Object.defineProperty(t2,"__esModule",{value:!0});t2.Pixelate=void 0;const Mk=dt,Pxe=kn,Rxe=wn,Oxe=De,kxe=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,s,a,l,u,d,f=Math.ceil(n/t),h=Math.ceil(r/t),g,m,v,x,_,b,y,S=e.data;if(t<=0){Pxe.Util.error("pixelSize value can not be <= 0");return}for(_=0;_<f;_+=1)for(b=0;b<h;b+=1){for(a=0,l=0,u=0,d=0,g=_*t,m=g+t,v=b*t,x=v+t,y=0,i=g;i<m;i+=1)if(!(i>=n))for(o=v;o<x;o+=1)o>=r||(s=(n*o+i)*4,a+=S[s+0],l+=S[s+1],u+=S[s+2],d+=S[s+3],y+=1);for(a=a/y,l=l/y,u=u/y,d=d/y,i=g;i<m;i+=1)if(!(i>=n))for(o=v;o<x;o+=1)o>=r||(s=(n*o+i)*4,S[s+0]=a,S[s+1]=l,S[s+2]=u,S[s+3]=d)}};t2.Pixelate=kxe;Mk.Factory.addGetterSetter(Rxe.Node,"pixelSize",8,(0,Oxe.getNumberValidator)(),Mk.Factory.afterSetFilter);var n2={};Object.defineProperty(n2,"__esModule",{value:!0});n2.Posterize=void 0;const Nk=dt,Ixe=wn,Mxe=De,Nxe=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};n2.Posterize=Nxe;Nk.Factory.addGetterSetter(Ixe.Node,"levels",.5,(0,Mxe.getNumberValidator)(),Nk.Factory.afterSetFilter);var r2={};Object.defineProperty(r2,"__esModule",{value:!0});r2.RGB=void 0;const g_=dt,XE=wn,Lxe=De,Dxe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),s,a;for(s=0;s<n;s+=4)a=(.34*t[s]+.5*t[s+1]+.16*t[s+2])/255,t[s]=a*r,t[s+1]=a*i,t[s+2]=a*o,t[s+3]=t[s+3]};r2.RGB=Dxe;g_.Factory.addGetterSetter(XE.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});g_.Factory.addGetterSetter(XE.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});g_.Factory.addGetterSetter(XE.Node,"blue",0,Lxe.RGBComponent,g_.Factory.afterSetFilter);var i2={};Object.defineProperty(i2,"__esModule",{value:!0});i2.RGBA=void 0;const Qg=dt,o2=wn,$xe=De,Fxe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),s=this.alpha(),a,l;for(a=0;a<n;a+=4)l=1-s,t[a]=r*s+t[a]*l,t[a+1]=i*s+t[a+1]*l,t[a+2]=o*s+t[a+2]*l};i2.RGBA=Fxe;Qg.Factory.addGetterSetter(o2.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qg.Factory.addGetterSetter(o2.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});Qg.Factory.addGetterSetter(o2.Node,"blue",0,$xe.RGBComponent,Qg.Factory.afterSetFilter);Qg.Factory.addGetterSetter(o2.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var s2={};Object.defineProperty(s2,"__esModule",{value:!0});s2.Sepia=void 0;const Bxe=function(e){var t=e.data,n=t.length,r,i,o,s;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],s=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+s*.189),t[r+1]=Math.min(255,i*.349+o*.686+s*.168),t[r+2]=Math.min(255,i*.272+o*.534+s*.131)};s2.Sepia=Bxe;var a2={};Object.defineProperty(a2,"__esModule",{value:!0});a2.Solarize=void 0;const Uxe=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var s=(o-1)*i,a=n;do{var l=s+(a-1)*4,u=t[l],d=t[l+1],f=t[l+2];u>127&&(u=255-u),d>127&&(d=255-d),f>127&&(f=255-f),t[l]=u,t[l+1]=d,t[l+2]=f}while(--a)}while(--o)};a2.Solarize=Uxe;var l2={};Object.defineProperty(l2,"__esModule",{value:!0});l2.Threshold=void 0;const Lk=dt,zxe=wn,Vxe=De,jxe=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=1)n[i]=n[i]<t?0:255};l2.Threshold=jxe;Lk.Factory.addGetterSetter(zxe.Node,"threshold",.5,(0,Vxe.getNumberValidator)(),Lk.Factory.afterSetFilter);Object.defineProperty(yS,"__esModule",{value:!0});yS.Konva=void 0;const Dk=hz,Gxe=xS,Hxe=ES,Wxe=RS,qxe=OS,Kxe=kS,$k=Vf,Xxe=Gm,Yxe=ih,Qxe=Wm,Zxe=NS,Jxe=LS,eCe=DS,tCe=$S,nCe=xc,rCe=FS,iCe=BS,oCe=US,sCe=VS,aCe=jS,lCe=GS,uCe=HS,cCe=qS,dCe=KS,fCe=XS,hCe=YS,pCe=QS,gCe=ZS,mCe=JS,yCe=e2,vCe=t2,_Ce=n2,bCe=r2,SCe=i2,wCe=s2,xCe=a2,CCe=l2;yS.Konva=Dk.Konva.Util._assign(Dk.Konva,{Arc:Gxe.Arc,Arrow:Hxe.Arrow,Circle:Wxe.Circle,Ellipse:qxe.Ellipse,Image:Kxe.Image,Label:$k.Label,Tag:$k.Tag,Line:Xxe.Line,Path:Yxe.Path,Rect:Qxe.Rect,RegularPolygon:Zxe.RegularPolygon,Ring:Jxe.Ring,Sprite:eCe.Sprite,Star:tCe.Star,Text:nCe.Text,TextPath:rCe.TextPath,Transformer:iCe.Transformer,Wedge:oCe.Wedge,Filters:{Blur:sCe.Blur,Brighten:aCe.Brighten,Contrast:lCe.Contrast,Emboss:uCe.Emboss,Enhance:cCe.Enhance,Grayscale:dCe.Grayscale,HSL:fCe.HSL,HSV:hCe.HSV,Invert:pCe.Invert,Kaleidoscope:gCe.Kaleidoscope,Mask:mCe.Mask,Noise:yCe.Noise,Pixelate:vCe.Pixelate,Posterize:_Ce.Posterize,RGB:bCe.RGB,RGBA:SCe.RGBA,Sepia:wCe.Sepia,Solarize:xCe.Solarize,Threshold:CCe.Threshold}});var TCe=LE.exports;Object.defineProperty(TCe,"__esModule",{value:!0});const ECe=yS;LE.exports=ECe.Konva;var ACe=LE.exports;const mp=Tc(ACe),PCe=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),s=new mp.Stage({container:o,width:r,height:i}),a=new mp.Layer,l=new mp.Layer;return a.add(new mp.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new mp.Line({points:u.points,stroke:n?"white":"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),s.add(a),s.add(l),o.remove(),s},RCe=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const s=o.getContext("2d"),a=new Image;if(!s){o.remove(),i("Unable to get context");return}a.onload=function(){s.drawImage(a,0,0),o.remove(),r(s.getImageData(0,0,t,n))},a.src=e}),Fk=async(e,t)=>{const n=e.toDataURL(t);return await RCe(n,t.width,t.height)},OCe=async(e,t,n,r,i)=>{const o=ke("canvas"),s=gS(),a=G_e();if(!s||!a){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=s.clone();u.scale({x:1,y:1});const d=u.getAbsolutePosition(),f={x:l.x+d.x,y:l.y+d.y,width:l.width,height:l.height},h=await c_(u,f),g=await Fk(u,f),m=await PCe(r?e.objects.filter(w$):[],l,i),v=await c_(m,l),x=await Fk(m,l);return{baseBlob:h,baseImageData:g,maskBlob:v,maskImageData:x}},kCe=e=>{let t=!0,n=!1;const r=e.length;let i=3;for(i;i<r;i+=4)if(e[i]===255?t=!1:n=!0,!t&&n)return{isFullyTransparent:t,isPartiallyTransparent:n};return{isFullyTransparent:t,isPartiallyTransparent:n}},ICe=e=>{const t=e.length;let n=0;for(n;n<t;)if(e[n++]===0&&e[n++]===0&&e[n++]===0&&e[n++]===255)return!0;return!1},MCe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=kCe(e.data),i=ICe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},NCe=e=>XD(e,n=>n.isEnabled&&(!!n.processedControlImage||n.processorType==="none"&&!!n.controlImage)),Fo=(e,t,n)=>{const{isEnabled:r,controlNets:i}=e.controlNet,o=NCe(i),s=t.nodes[yt];if(r&&o.length&&o.length){const a={id:j0,type:"collect",is_intermediate:!0};t.nodes[j0]=a,t.edges.push({source:{node_id:j0,field:"collection"},destination:{node_id:n,field:"control"}}),o.forEach(l=>{const{controlNetId:u,controlImage:d,processedControlImage:f,beginStepPct:h,endStepPct:g,controlMode:m,resizeMode:v,model:x,processorType:_,weight:b}=l,y={id:`control_net_${u}`,type:"controlnet",is_intermediate:!0,begin_step_percent:h,end_step_percent:g,control_mode:m,resize_mode:v,control_model:x,control_weight:b};if(f&&_!=="none")y.image={image_name:f};else if(d)y.image={image_name:d};else return;if(t.nodes[y.id]=y,s){const S=mb(y,["id","type"]);s.controlnets.push(S)}t.edges.push({source:{node_id:y.id,field:"control"},destination:{node_id:j0,field:"item"}})})}},wu=(e,t)=>{const{positivePrompt:n,iterations:r,seed:i,shouldRandomizeSeed:o}=e.generation,{combinatorial:s,isEnabled:a,maxPrompts:l}=e.dynamicPrompts,u=t.nodes[yt];if(a){xle(t.nodes[$e],"prompt");const d={id:qx,type:"dynamic_prompt",is_intermediate:!0,max_prompts:s?l:r,combinatorial:s,prompt:n},f={id:sn,type:"iterate",is_intermediate:!0};if(t.nodes[qx]=d,t.nodes[sn]=f,t.edges.push({source:{node_id:qx,field:"prompt_collection"},destination:{node_id:sn,field:"collection"}},{source:{node_id:sn,field:"item"},destination:{node_id:$e,field:"prompt"}}),u&&t.edges.push({source:{node_id:sn,field:"item"},destination:{node_id:yt,field:"positive_prompt"}}),o){const h={id:dr,type:"rand_int",is_intermediate:!0};t.nodes[dr]=h,t.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:Se,field:"seed"}}),u&&t.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:yt,field:"seed"}})}else t.nodes[Se].seed=i,u&&(u.seed=i)}else{u&&(u.positive_prompt=n);const d={id:bn,type:"range_of_size",is_intermediate:!0,size:r,step:1},f={id:sn,type:"iterate",is_intermediate:!0};if(t.nodes[sn]=f,t.nodes[bn]=d,t.edges.push({source:{node_id:bn,field:"collection"},destination:{node_id:sn,field:"collection"}}),t.edges.push({source:{node_id:sn,field:"item"},destination:{node_id:Se,field:"seed"}}),u&&t.edges.push({source:{node_id:sn,field:"item"},destination:{node_id:yt,field:"seed"}}),o){const h={id:dr,type:"rand_int",is_intermediate:!0};t.nodes[dr]=h,t.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:bn,field:"start"}})}else d.start=i}},sh=(e,t,n,r=an)=>{const{loras:i}=e.lora,o=DT(i),s=t.nodes[yt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))),t.edges=t.edges.filter(u=>!(u.source.node_id===It&&["clip"].includes(u.source.field))));let a="",l=0;gc(i,u=>{const{model_name:d,base_model:f,weight:h}=u,g=`${az}_${d.replace(".","_")}`,m={type:"lora_loader",id:g,is_intermediate:!0,lora:{model_name:d,base_model:f},weight:h};s&&s.loras.push({lora:{model_name:d,base_model:f},weight:h}),t.nodes[g]=m,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:It,field:"clip"},destination:{node_id:g,field:"clip"}})):(t.edges.push({source:{node_id:a,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:a,field:"clip"},destination:{node_id:g,field:"clip"}})),l===o-1&&(t.edges.push({source:{node_id:g,field:"unet"},destination:{node_id:n,field:"unet"}}),t.edges.push({source:{node_id:g,field:"clip"},destination:{node_id:$e,field:"clip"}}),t.edges.push({source:{node_id:g,field:"clip"},destination:{node_id:Be,field:"clip"}})),a=g,l+=1})},Kz=mi(e=>e.ui,e=>y$[e.activeTab],{memoizeOptions:{equalityCheck:gb}}),PMe=mi(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:gb}}),RMe=mi(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:gb}}),Bo=(e,t,n=it)=>{const i=Kz(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[yt];if(!o)return;o.is_intermediate=!0;const a={id:Kd,type:"img_nsfw",is_intermediate:i};t.nodes[Kd]=a,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Kd,field:"image"}}),s&&t.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:Kd,field:"metadata"}})},Uo=(e,t,n=an)=>{const{vae:r}=e.generation,i=!r,o=t.nodes[yt];i||(t.nodes[Lu]={type:"vae_loader",id:Lu,is_intermediate:!0,vae_model:r});const s=n==mS;(t.id===lz||t.id===v5||t.id===fz||t.id===b5)&&t.edges.push({source:{node_id:i?n:Lu,field:i&&s?"vae_decoder":"vae"},destination:{node_id:it,field:"vae"}}),(t.id===uz||t.id===_5||t.id===IE||t.id==d_)&&t.edges.push({source:{node_id:i?n:Lu,field:i&&s?"vae_decoder":"vae"},destination:{node_id:Ie,field:"vae"}}),(t.id===v5||t.id===b5||t.id===_5||t.id===d_)&&t.edges.push({source:{node_id:i?n:Lu,field:i&&s?"vae_decoder":"vae"},destination:{node_id:Vt,field:"vae"}}),(t.id===cz||t.id===dz||t.id===ME||t.id===NE)&&t.edges.push({source:{node_id:i?n:Lu,field:i&&s?"vae_decoder":"vae"},destination:{node_id:hn,field:"vae"}},{source:{node_id:i?n:Lu,field:i&&s?"vae_decoder":"vae"},destination:{node_id:it,field:"vae"}}),r&&o&&(o.vae=r)},zo=(e,t,n=it)=>{const i=Kz(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],s=t.nodes[Kd],a=t.nodes[yt];if(!o)return;const l={id:dp,type:"img_watermark",is_intermediate:i};t.nodes[dp]=l,o.is_intermediate=!0,s?(s.is_intermediate=!0,t.edges.push({source:{node_id:Kd,field:"image"},destination:{node_id:dp,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:dp,field:"image"}}),a&&t.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:dp,field:"metadata"}})},LCe=(e,t)=>{const n=ke("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,steps:l,img2imgStrength:u,clipSkip:d,shouldUseCpuNoise:f,shouldUseNoiseSettings:h}=e.generation,{width:g,height:m}=e.canvas.boundingBoxDimensions,{shouldAutoSave:v}=e.canvas;if(!o)throw n.error("No model found in state"),new Error("No model found in state");const x=h?f:ys.shouldUseCpuNoise,_={id:_5,nodes:{[an]:{type:"main_model_loader",id:an,is_intermediate:!0,model:o},[It]:{type:"clip_skip",id:It,is_intermediate:!0,skipped_layers:d},[$e]:{type:"compel",id:$e,is_intermediate:!0,prompt:r},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:i},[Se]:{type:"noise",id:Se,is_intermediate:!0,use_cpu:x},[Vt]:{type:"i2l",id:Vt,is_intermediate:!0},[Le]:{type:"denoise_latents",id:Le,is_intermediate:!0,cfg_scale:s,scheduler:a,steps:l,denoising_start:1-u,denoising_end:1},[Ie]:{type:"l2i",id:Ie,is_intermediate:!v}},edges:[{source:{node_id:an,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:an,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:Vt,field:"latents"},destination:{node_id:Le,field:"latents"}},{source:{node_id:Le,field:"latents"},destination:{node_id:Ie,field:"latents"}}]};if(t.width!==g||t.height!==m){const b={id:Jn,type:"img_resize",image:{image_name:t.image_name},is_intermediate:!0,width:g,height:m};_.nodes[Jn]=b,_.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Vt,field:"image"}}),_.edges.push({source:{node_id:Jn,field:"width"},destination:{node_id:Se,field:"width"}}),_.edges.push({source:{node_id:Jn,field:"height"},destination:{node_id:Se,field:"height"}})}else _.nodes[Vt].image={image_name:t.image_name},_.edges.push({source:{node_id:Vt,field:"width"},destination:{node_id:Se,field:"width"}}),_.edges.push({source:{node_id:Vt,field:"height"},destination:{node_id:Se,field:"height"}});return _.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,height:m,width:g,positive_prompt:"",negative_prompt:i,model:o,seed:0,steps:l,rand_device:x?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:d,strength:u,init_image:t.image_name},_.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:Ie,field:"metadata"}}),sh(e,_,Le),Uo(e,_,an),wu(e,_),Fo(e,_,Le),e.system.shouldUseNSFWChecker&&Bo(e,_,Ie),e.system.shouldUseWatermarker&&zo(e,_,Ie),_},DCe=(e,t,n)=>{const r=ke("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:d,iterations:f,seed:h,shouldRandomizeSeed:g,vaePrecision:m,shouldUseNoiseSettings:v,shouldUseCpuNoise:x,maskBlur:_,maskBlurMethod:b,clipSkip:y}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:S,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:T,boundingBoxScaleMethod:E,shouldAutoSave:P}=e.canvas,k=x,O={id:cz,nodes:{[an]:{type:"main_model_loader",id:an,is_intermediate:!0,model:s},[It]:{type:"clip_skip",id:It,is_intermediate:!0,skipped_layers:y},[$e]:{type:"compel",id:$e,is_intermediate:!0,prompt:i},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:o},[ut]:{type:"img_blur",id:ut,is_intermediate:!0,radius:_,blur_type:b},[hn]:{type:"i2l",id:hn,is_intermediate:!0,fp32:m==="fp32"},[Se]:{type:"noise",id:Se,use_cpu:k,is_intermediate:!0},[Le]:{type:"denoise_latents",id:Le,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-d,denoising_end:1},[it]:{type:"l2i",id:it,is_intermediate:!0,fp32:m==="fp32"},[wt]:{type:"color_correct",id:wt,is_intermediate:!0,reference:t},[Ie]:{type:"img_paste",id:Ie,is_intermediate:!P,base_image:t},[bn]:{type:"range_of_size",id:bn,is_intermediate:!0,size:f,step:1},[sn]:{type:"iterate",id:sn,is_intermediate:!0}},edges:[{source:{node_id:an,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:an,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:hn,field:"latents"},destination:{node_id:Le,field:"latents"}},{source:{node_id:ut,field:"image"},destination:{node_id:Le,field:"mask"}},{source:{node_id:bn,field:"collection"},destination:{node_id:sn,field:"collection"}},{source:{node_id:sn,field:"item"},destination:{node_id:Se,field:"seed"}},{source:{node_id:Le,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(["auto","manual"].includes(E)){const M=T.width,V=T.height;O.nodes[ko]={type:"img_resize",id:ko,is_intermediate:!0,width:M,height:V,image:t},O.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:M,height:V,image:n},O.nodes[ti]={type:"img_resize",id:ti,is_intermediate:!0,width:S,height:C},O.nodes[er]={type:"img_resize",id:er,is_intermediate:!0,width:S,height:C},O.nodes[Se]={...O.nodes[Se],width:M,height:V},O.edges.push({source:{node_id:ko,field:"image"},destination:{node_id:hn,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:it,field:"image"},destination:{node_id:ti,field:"image"}},{source:{node_id:ti,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:er,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:Ie,field:"mask"}})}else O.nodes[Se]={...O.nodes[Se],width:S,height:C},O.nodes[hn]={...O.nodes[hn],image:t},O.nodes[ut]={...O.nodes[ut],image:n},O.edges.push({source:{node_id:it,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:Ie,field:"mask"}});if(g){const M={id:dr,type:"rand_int"};O.nodes[dr]=M,O.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:bn,field:"start"}})}else O.nodes[bn].start=h;return Uo(e,O,an),sh(e,O,Le,an),Fo(e,O,Le),e.system.shouldUseNSFWChecker&&Bo(e,O,Ie),e.system.shouldUseWatermarker&&zo(e,O,Ie),O},$Ce=(e,t,n)=>{const r=ke("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,img2imgStrength:d,iterations:f,seed:h,shouldRandomizeSeed:g,vaePrecision:m,shouldUseNoiseSettings:v,shouldUseCpuNoise:x,maskBlur:_,maskBlurMethod:b,tileSize:y,infillMethod:S,clipSkip:C}=e.generation;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:T,height:E}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:k,shouldAutoSave:O}=e.canvas,M=x,V={id:dz,nodes:{[an]:{type:"main_model_loader",id:an,is_intermediate:!0,model:s},[It]:{type:"clip_skip",id:It,is_intermediate:!0,skipped_layers:C},[$e]:{type:"compel",id:$e,is_intermediate:!0,prompt:i},[Be]:{type:"compel",id:Be,is_intermediate:!0,prompt:o},[_f]:{type:"tomask",id:_f,is_intermediate:!0,image:t},[Ds]:{type:"mask_combine",id:Ds,is_intermediate:!0,mask2:n},[ut]:{type:"img_blur",id:ut,is_intermediate:!0,radius:_,blur_type:b},[Nn]:{type:"infill_tile",id:Nn,is_intermediate:!0,tile_size:y},[hn]:{type:"i2l",id:hn,is_intermediate:!0,fp32:m==="fp32"},[Se]:{type:"noise",id:Se,use_cpu:M,is_intermediate:!0},[Le]:{type:"denoise_latents",id:Le,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:1-d,denoising_end:1},[it]:{type:"l2i",id:it,is_intermediate:!0,fp32:m==="fp32"},[wt]:{type:"color_correct",id:wt,is_intermediate:!0},[Ie]:{type:"img_paste",id:Ie,is_intermediate:!O},[bn]:{type:"range_of_size",id:bn,is_intermediate:!0,size:f,step:1},[sn]:{type:"iterate",id:sn,is_intermediate:!0}},edges:[{source:{node_id:an,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:an,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Nn,field:"image"},destination:{node_id:hn,field:"image"}},{source:{node_id:_f,field:"mask"},destination:{node_id:Ds,field:"mask1"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:hn,field:"latents"},destination:{node_id:Le,field:"latents"}},{source:{node_id:ut,field:"image"},destination:{node_id:Le,field:"mask"}},{source:{node_id:bn,field:"collection"},destination:{node_id:sn,field:"collection"}},{source:{node_id:sn,field:"item"},destination:{node_id:Se,field:"seed"}},{source:{node_id:Le,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(S==="patchmatch"&&(V.nodes[Nn]={type:"infill_patchmatch",id:Nn,is_intermediate:!0}),["auto","manual"].includes(k)){const B=P.width,A=P.height;V.nodes[ko]={type:"img_resize",id:ko,is_intermediate:!0,width:B,height:A,image:t},V.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:B,height:A},V.nodes[ti]={type:"img_resize",id:ti,is_intermediate:!0,width:T,height:E},V.nodes[Ls]={type:"img_resize",id:Ls,is_intermediate:!0,width:T,height:E},V.nodes[er]={type:"img_resize",id:er,is_intermediate:!0,width:T,height:E},V.nodes[Se]={...V.nodes[Se],width:B,height:A},V.edges.push({source:{node_id:ko,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ds,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:it,field:"image"},destination:{node_id:ti,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:er,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ls,field:"image"}},{source:{node_id:Ls,field:"image"},destination:{node_id:wt,field:"reference"}},{source:{node_id:ti,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:Ls,field:"image"},destination:{node_id:Ie,field:"base_image"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:Ie,field:"mask"}})}else V.nodes[Nn]={...V.nodes[Nn],image:t},V.nodes[Se]={...V.nodes[Se],width:T,height:E},V.nodes[hn]={...V.nodes[hn],image:t},V.nodes[ut]={...V.nodes[ut],image:n},V.edges.push({source:{node_id:Ds,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:wt,field:"reference"}},{source:{node_id:it,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ie,field:"base_image"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:Ie,field:"mask"}});if(g){const B={id:dr,type:"rand_int"};V.nodes[dr]=B,V.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:bn,field:"start"}})}else V.nodes[bn].start=h;return Uo(e,V,an),sh(e,V,Le,an),Fo(e,V,Le),e.system.shouldUseNSFWChecker&&Bo(e,V,Ie),e.system.shouldUseWatermarker&&zo(e,V,Ie),V},ah=(e,t,n,r=We)=>{const{loras:i}=e.lora,o=DT(i),s=t.nodes[yt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))&&!(u.source.node_id===r&&["clip"].includes(u.source.field))&&!(u.source.node_id===r&&["clip2"].includes(u.source.field))));let a="",l=0;gc(i,u=>{const{model_name:d,base_model:f,weight:h}=u,g=`${az}_${d.replace(".","_")}`,m={type:"sdxl_lora_loader",id:g,is_intermediate:!0,lora:{model_name:d,base_model:f},weight:h};s&&s.loras.push({lora:{model_name:d,base_model:f},weight:h}),t.nodes[g]=m,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:r,field:"clip"},destination:{node_id:g,field:"clip"}}),t.edges.push({source:{node_id:r,field:"clip2"},destination:{node_id:g,field:"clip2"}})):(t.edges.push({source:{node_id:a,field:"unet"},destination:{node_id:g,field:"unet"}}),t.edges.push({source:{node_id:a,field:"clip"},destination:{node_id:g,field:"clip"}}),t.edges.push({source:{node_id:a,field:"clip2"},destination:{node_id:g,field:"clip2"}})),l===o-1&&(t.edges.push({source:{node_id:g,field:"unet"},destination:{node_id:n,field:"unet"}}),t.edges.push({source:{node_id:g,field:"clip"},destination:{node_id:$e,field:"clip"}}),t.edges.push({source:{node_id:g,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:g,field:"clip2"},destination:{node_id:$e,field:"clip2"}}),t.edges.push({source:{node_id:g,field:"clip2"},destination:{node_id:Be,field:"clip2"}})),a=g,l+=1})},Uc=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o}=e.sdxl;let s=i,a=o;return t&&(i.length>0?s=`${n} ${i}`:s=n,o.length>0?a=`${r} ${o}`:a=r),{craftedPositiveStylePrompt:s,craftedNegativeStylePrompt:a}},lh=(e,t,n)=>{const{refinerModel:r,refinerPositiveAestheticScore:i,refinerNegativeAestheticScore:o,refinerSteps:s,refinerScheduler:a,refinerCFGScale:l,refinerStart:u}=e.sdxl;if(!r)return;const d=t.nodes[yt];d&&(d.refiner_model=r,d.refiner_positive_aesthetic_score=i,d.refiner_negative_aesthetic_score=o,d.refiner_cfg_scale=l,d.refiner_scheduler=a,d.refiner_start=u,d.refiner_steps=s);const{craftedPositiveStylePrompt:f,craftedNegativeStylePrompt:h}=Uc(e,!0);t.edges=t.edges.filter(g=>!(g.source.node_id===n&&["latents"].includes(g.source.field))),t.edges=t.edges.filter(g=>!(g.source.node_id===We&&["vae"].includes(g.source.field))),t.nodes[fp]={type:"sdxl_refiner_model_loader",id:fp,model:r},t.nodes[G0]={type:"sdxl_refiner_compel_prompt",id:G0,style:f,aesthetic_score:i},t.nodes[H0]={type:"sdxl_refiner_compel_prompt",id:H0,style:h,aesthetic_score:o},t.nodes[va]={type:"denoise_latents",id:va,cfg_scale:l,steps:s,scheduler:a,denoising_start:u,denoising_end:1},t.edges.push({source:{node_id:fp,field:"unet"},destination:{node_id:va,field:"unet"}},{source:{node_id:fp,field:"clip2"},destination:{node_id:G0,field:"clip2"}},{source:{node_id:fp,field:"clip2"},destination:{node_id:H0,field:"clip2"}},{source:{node_id:G0,field:"conditioning"},destination:{node_id:va,field:"positive_conditioning"}},{source:{node_id:H0,field:"conditioning"},destination:{node_id:va,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:va,field:"latents"}}),t.id===IE||t.id===d_?t.edges.push({source:{node_id:va,field:"latents"},destination:{node_id:Ie,field:"latents"}}):t.edges.push({source:{node_id:va,field:"latents"},destination:{node_id:it,field:"latents"}}),(t.id===ME||t.id===NE)&&t.edges.push({source:{node_id:ut,field:"image"},destination:{node_id:va,field:"mask"}})},FCe=(e,t)=>{const n=ke("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:s,scheduler:a,steps:l,vaePrecision:u,clipSkip:d,shouldUseCpuNoise:f,shouldUseNoiseSettings:h}=e.generation,{shouldUseSDXLRefiner:g,refinerStart:m,sdxlImg2ImgDenoisingStrength:v,shouldConcatSDXLStylePrompt:x}=e.sdxl,{width:_,height:b}=e.canvas.boundingBoxDimensions,{shouldAutoSave:y}=e.canvas;if(!o)throw n.error("No model found in state"),new Error("No model found in state");const S=h?f:ys.shouldUseCpuNoise,{craftedPositiveStylePrompt:C,craftedNegativeStylePrompt:T}=Uc(e,x),E={id:d_,nodes:{[We]:{type:"sdxl_model_loader",id:We,model:o},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:r,style:C},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:T},[Se]:{type:"noise",id:Se,is_intermediate:!0,use_cpu:S},[Vt]:{type:"i2l",id:Vt,is_intermediate:!0,fp32:u==="fp32"},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,cfg_scale:s,scheduler:a,steps:l,denoising_start:g?Math.min(m,1-v):1-v,denoising_end:g?m:1},[Ie]:{type:"l2i",id:Ie,is_intermediate:!y,fp32:u==="fp32"}},edges:[{source:{node_id:We,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:We,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:We,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Vt,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Re,field:"latents"},destination:{node_id:Ie,field:"latents"}}]};if(t.width!==_||t.height!==b){const P={id:Jn,type:"img_resize",image:{image_name:t.image_name},is_intermediate:!0,width:_,height:b};E.nodes[Jn]=P,E.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Vt,field:"image"}}),E.edges.push({source:{node_id:Jn,field:"width"},destination:{node_id:Se,field:"width"}}),E.edges.push({source:{node_id:Jn,field:"height"},destination:{node_id:Se,field:"height"}})}else E.nodes[Vt].image={image_name:t.image_name},E.edges.push({source:{node_id:Vt,field:"width"},destination:{node_id:Se,field:"width"}}),E.edges.push({source:{node_id:Vt,field:"height"},destination:{node_id:Se,field:"height"}});return E.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:s,height:b,width:_,positive_prompt:"",negative_prompt:i,model:o,seed:0,steps:l,rand_device:S?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],clip_skip:d,strength:v,init_image:t.image_name},E.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:Ie,field:"metadata"}}),ah(e,E,Re,We),g&&lh(e,E,Re),Uo(e,E,We),wu(e,E),Fo(e,E,Re),e.system.shouldUseNSFWChecker&&Bo(e,E,Ie),e.system.shouldUseWatermarker&&zo(e,E,Ie),E},BCe=(e,t,n)=>{const r=ke("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,iterations:d,seed:f,shouldRandomizeSeed:h,vaePrecision:g,shouldUseNoiseSettings:m,shouldUseCpuNoise:v,maskBlur:x,maskBlurMethod:_}=e.generation,{sdxlImg2ImgDenoisingStrength:b,shouldUseSDXLRefiner:y,refinerStart:S,shouldConcatSDXLStylePrompt:C}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:T,height:E}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:k,shouldAutoSave:O}=e.canvas,M=v,{craftedPositiveStylePrompt:V,craftedNegativeStylePrompt:B}=Uc(e,C),A={id:ME,nodes:{[We]:{type:"sdxl_model_loader",id:We,model:s},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:i,style:V},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:o,style:B},[ut]:{type:"img_blur",id:ut,is_intermediate:!0,radius:x,blur_type:_},[hn]:{type:"i2l",id:hn,is_intermediate:!0,fp32:g==="fp32"},[Se]:{type:"noise",id:Se,use_cpu:M,is_intermediate:!0},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:y?Math.min(S,1-b):1-b,denoising_end:y?S:1},[it]:{type:"l2i",id:it,is_intermediate:!0,fp32:g==="fp32"},[wt]:{type:"color_correct",id:wt,is_intermediate:!0,reference:t},[Ie]:{type:"img_paste",id:Ie,is_intermediate:!O,base_image:t},[bn]:{type:"range_of_size",id:bn,is_intermediate:!0,size:d,step:1},[sn]:{type:"iterate",id:sn,is_intermediate:!0}},edges:[{source:{node_id:We,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:We,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:We,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:hn,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:ut,field:"image"},destination:{node_id:Re,field:"mask"}},{source:{node_id:bn,field:"collection"},destination:{node_id:sn,field:"collection"}},{source:{node_id:sn,field:"item"},destination:{node_id:Se,field:"seed"}},{source:{node_id:Re,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(["auto","manual"].includes(k)){const N=P.width,D=P.height;A.nodes[ko]={type:"img_resize",id:ko,is_intermediate:!0,width:N,height:D,image:t},A.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:N,height:D,image:n},A.nodes[ti]={type:"img_resize",id:ti,is_intermediate:!0,width:T,height:E},A.nodes[er]={type:"img_resize",id:er,is_intermediate:!0,width:T,height:E},A.nodes[Se]={...A.nodes[Se],width:N,height:D},A.edges.push({source:{node_id:ko,field:"image"},destination:{node_id:hn,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:it,field:"image"},destination:{node_id:ti,field:"image"}},{source:{node_id:ti,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:er,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:Ie,field:"mask"}})}else A.nodes[Se]={...A.nodes[Se],width:T,height:E},A.nodes[hn]={...A.nodes[hn],image:t},A.nodes[ut]={...A.nodes[ut],image:n},A.edges.push({source:{node_id:it,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:Ie,field:"mask"}});if(h){const N={id:dr,type:"rand_int"};A.nodes[dr]=N,A.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:bn,field:"start"}})}else A.nodes[bn].start=f;return y&&lh(e,A,Re),Uo(e,A,We),ah(e,A,Re,We),Fo(e,A,Re),e.system.shouldUseNSFWChecker&&Bo(e,A,Ie),e.system.shouldUseWatermarker&&zo(e,A,Ie),A},UCe=(e,t,n)=>{const r=ke("nodes"),{positivePrompt:i,negativePrompt:o,model:s,cfgScale:a,scheduler:l,steps:u,iterations:d,seed:f,shouldRandomizeSeed:h,vaePrecision:g,shouldUseNoiseSettings:m,shouldUseCpuNoise:v,maskBlur:x,maskBlurMethod:_,tileSize:b,infillMethod:y}=e.generation,{sdxlImg2ImgDenoisingStrength:S,shouldUseSDXLRefiner:C,refinerStart:T,shouldConcatSDXLStylePrompt:E}=e.sdxl;if(!s)throw r.error("No model found in state"),new Error("No model found in state");const{width:P,height:k}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:O,boundingBoxScaleMethod:M,shouldAutoSave:V}=e.canvas,B=v,{craftedPositiveStylePrompt:A,craftedNegativeStylePrompt:N}=Uc(e,E),D={id:NE,nodes:{[We]:{type:"sdxl_model_loader",id:We,model:s},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:i,style:A},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:o,style:N},[_f]:{type:"tomask",id:_f,is_intermediate:!0,image:t},[Ds]:{type:"mask_combine",id:Ds,is_intermediate:!0,mask2:n},[ut]:{type:"img_blur",id:ut,is_intermediate:!0,radius:x,blur_type:_},[Nn]:{type:"infill_tile",id:Nn,is_intermediate:!0,tile_size:b},[hn]:{type:"i2l",id:hn,is_intermediate:!0,fp32:g==="fp32"},[Se]:{type:"noise",id:Se,use_cpu:B,is_intermediate:!0},[Re]:{type:"denoise_latents",id:Re,is_intermediate:!0,steps:u,cfg_scale:a,scheduler:l,denoising_start:C?Math.min(T,1-S):1-S,denoising_end:C?T:1},[it]:{type:"l2i",id:it,is_intermediate:!0,fp32:g==="fp32"},[wt]:{type:"color_correct",id:wt,is_intermediate:!0},[Ie]:{type:"img_paste",id:Ie,is_intermediate:!V},[bn]:{type:"range_of_size",id:bn,is_intermediate:!0,size:d,step:1},[sn]:{type:"iterate",id:sn,is_intermediate:!0}},edges:[{source:{node_id:We,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:We,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:We,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:Nn,field:"image"},destination:{node_id:hn,field:"image"}},{source:{node_id:_f,field:"mask"},destination:{node_id:Ds,field:"mask1"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:hn,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:ut,field:"image"},destination:{node_id:Re,field:"mask"}},{source:{node_id:bn,field:"collection"},destination:{node_id:sn,field:"collection"}},{source:{node_id:sn,field:"item"},destination:{node_id:Se,field:"seed"}},{source:{node_id:Re,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(y==="patchmatch"&&(D.nodes[Nn]={type:"infill_patchmatch",id:Nn,is_intermediate:!0}),["auto","manual"].includes(M)){const U=O.width,$=O.height;D.nodes[ko]={type:"img_resize",id:ko,is_intermediate:!0,width:U,height:$,image:t},D.nodes[Ni]={type:"img_resize",id:Ni,is_intermediate:!0,width:U,height:$},D.nodes[ti]={type:"img_resize",id:ti,is_intermediate:!0,width:P,height:k},D.nodes[Ls]={type:"img_resize",id:Ls,is_intermediate:!0,width:P,height:k},D.nodes[er]={type:"img_resize",id:er,is_intermediate:!0,width:P,height:k},D.nodes[Se]={...D.nodes[Se],width:U,height:$},D.edges.push({source:{node_id:ko,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ds,field:"image"},destination:{node_id:Ni,field:"image"}},{source:{node_id:Ni,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:it,field:"image"},destination:{node_id:ti,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:er,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ls,field:"image"}},{source:{node_id:Ls,field:"image"},destination:{node_id:wt,field:"reference"}},{source:{node_id:ti,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:Ls,field:"image"},destination:{node_id:Ie,field:"base_image"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:er,field:"image"},destination:{node_id:Ie,field:"mask"}})}else D.nodes[Nn]={...D.nodes[Nn],image:t},D.nodes[Se]={...D.nodes[Se],width:P,height:k},D.nodes[hn]={...D.nodes[hn],image:t},D.nodes[ut]={...D.nodes[ut],image:n},D.edges.push({source:{node_id:Ds,field:"image"},destination:{node_id:ut,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:wt,field:"reference"}},{source:{node_id:it,field:"image"},destination:{node_id:wt,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:wt,field:"mask"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ie,field:"base_image"}},{source:{node_id:wt,field:"image"},destination:{node_id:Ie,field:"image"}},{source:{node_id:ut,field:"image"},destination:{node_id:Ie,field:"mask"}});if(h){const U={id:dr,type:"rand_int"};D.nodes[dr]=U,D.edges.push({source:{node_id:dr,field:"a"},destination:{node_id:bn,field:"start"}})}else D.nodes[bn].start=f;return C&&lh(e,D,Re),Uo(e,D,We),ah(e,D,Re,We),Fo(e,D,Re),e.system.shouldUseNSFWChecker&&Bo(e,D,Ie),e.system.shouldUseWatermarker&&zo(e,D,Ie),D},zCe=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,vaePrecision:l,clipSkip:u,shouldUseCpuNoise:d,shouldUseNoiseSettings:f}=e.generation,{width:h,height:g}=e.canvas.boundingBoxDimensions,{shouldAutoSave:m}=e.canvas,{shouldUseSDXLRefiner:v,refinerStart:x,shouldConcatSDXLStylePrompt:_}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const b=f?d:ys.shouldUseCpuNoise,y=i.model_type==="onnx",S=y?mS:We,C=y?"onnx_model_loader":"sdxl_model_loader",T=y?{type:"t2l_onnx",id:Re,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Re,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:v?x:1},{craftedPositiveStylePrompt:E,craftedNegativeStylePrompt:P}=Uc(e,_),k={id:IE,nodes:{[S]:{type:C,id:S,is_intermediate:!0,model:i},[$e]:{type:y?"prompt_onnx":"sdxl_compel_prompt",id:$e,is_intermediate:!0,prompt:n,style:E},[Be]:{type:y?"prompt_onnx":"sdxl_compel_prompt",id:Be,is_intermediate:!0,prompt:r,style:P},[Se]:{type:"noise",id:Se,is_intermediate:!0,width:h,height:g,use_cpu:b},[T.id]:T,[Ie]:{type:y?"l2i_onnx":"l2i",id:Ie,is_intermediate:!m,fp32:l==="fp32"}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:S,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:S,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:S,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Re,field:"latents"},destination:{node_id:Ie,field:"latents"}}]};return k.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:g,width:h,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:b?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:u},k.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:Ie,field:"metadata"}}),v&&lh(e,k,Re),ah(e,k,Re,S),Uo(e,k,S),wu(e,k),Fo(e,k,Re),e.system.shouldUseNSFWChecker&&Bo(e,k,Ie),e.system.shouldUseWatermarker&&zo(e,k,Ie),k},VCe=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,clipSkip:l,shouldUseCpuNoise:u,shouldUseNoiseSettings:d}=e.generation,{width:f,height:h}=e.canvas.boundingBoxDimensions,{shouldAutoSave:g}=e.canvas;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const m=d?u:ys.shouldUseCpuNoise,v=i.model_type==="onnx",x=v?mS:an,_=v?"onnx_model_loader":"main_model_loader",b=v?{type:"t2l_onnx",id:Le,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Le,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:1},y={id:uz,nodes:{[x]:{type:_,id:x,is_intermediate:!0,model:i},[It]:{type:"clip_skip",id:It,is_intermediate:!0,skipped_layers:l},[$e]:{type:v?"prompt_onnx":"compel",id:$e,is_intermediate:!0,prompt:n},[Be]:{type:v?"prompt_onnx":"compel",id:Be,is_intermediate:!0,prompt:r},[Se]:{type:"noise",id:Se,is_intermediate:!0,width:f,height:h,use_cpu:m},[b.id]:b,[Ie]:{type:v?"l2i_onnx":"l2i",id:Ie,is_intermediate:!g}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:Le,field:"latents"},destination:{node_id:Ie,field:"latents"}}]};return y.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:h,width:f,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:m?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:l},y.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:Ie,field:"metadata"}}),Uo(e,y,x),sh(e,y,Le,x),wu(e,y),Fo(e,y,Le),e.system.shouldUseNSFWChecker&&Bo(e,y,Ie),e.system.shouldUseWatermarker&&zo(e,y,Ie),y},jCe=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=zCe(e):i=VCe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=FCe(e,n):i=LCe(e,n)}else if(t==="inpaint"){if(!n||!r)throw new Error("Missing canvas init and mask images");e.generation.model&&e.generation.model.base_model==="sdxl"?i=BCe(e,n,r):i=DCe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=UCe(e,n,r):i=$Ce(e,n,r)}return i},GCe=()=>{Oe({predicate:e=>zm.match(e)&&e.payload==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=ke("session"),o=t(),{layerState:s,boundingBoxCoordinates:a,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:d}=o.canvas,f=await OCe(s,a,l,u,d);if(!f){i.error("Unable to create canvas data");return}const{baseBlob:h,baseImageData:g,maskBlob:m,maskImageData:v}=f,x=MCe(g,v);if(o.system.enableImageDebugging){const E=await rk(h),P=await rk(m);RSe([{base64:P,caption:"mask b64"},{base64:E,caption:"image b64"}])}i.debug(`Generation mode: ${x}`);let _,b;["img2img","inpaint","outpaint"].includes(x)&&(_=await n(we.endpoints.uploadImage.initiate({file:new File([h],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(x)&&(b=await n(we.endpoints.uploadImage.initiate({file:new File([m],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const y=jCe(o,x,_,b);i.debug({graph:Ya(y)},"Canvas graph built"),n(QU(y));const{requestId:S}=n(jr({graph:y})),[C]=await r(E=>jr.fulfilled.match(E)&&E.meta.requestId===S),T=C.payload.id;["img2img","inpaint"].includes(x)&&_&&n(we.endpoints.changeImageSessionId.initiate({imageDTO:_,session_id:T})),["inpaint"].includes(x)&&b&&n(we.endpoints.changeImageSessionId.initiate({imageDTO:b,session_id:T})),o.canvas.layerState.stagingArea.boundingBox||n(hce({sessionId:T,boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(pce(T)),n(kc())}})},HCe=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,initialImage:l,img2imgStrength:u,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:g,shouldUseCpuNoise:m,shouldUseNoiseSettings:v,vaePrecision:x}=e.generation;if(!l)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const _=v?m:ys.shouldUseCpuNoise,b={id:v5,nodes:{[an]:{type:"main_model_loader",id:an,model:i},[It]:{type:"clip_skip",id:It,skipped_layers:g},[$e]:{type:"compel",id:$e,prompt:n},[Be]:{type:"compel",id:Be,prompt:r},[Se]:{type:"noise",id:Se,use_cpu:_},[it]:{type:"l2i",id:it,fp32:x==="fp32"},[Le]:{type:"denoise_latents",id:Le,cfg_scale:o,scheduler:s,steps:a,denoising_start:1-u,denoising_end:1},[Vt]:{type:"i2l",id:Vt,fp32:x==="fp32"}},edges:[{source:{node_id:an,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:an,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:Vt,field:"latents"},destination:{node_id:Le,field:"latents"}},{source:{node_id:Le,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(d&&(l.width!==f||l.height!==h)){const y={id:Jn,type:"img_resize",image:{image_name:l.imageName},is_intermediate:!0,width:f,height:h};b.nodes[Jn]=y,b.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Vt,field:"image"}}),b.edges.push({source:{node_id:Jn,field:"width"},destination:{node_id:Se,field:"width"}}),b.edges.push({source:{node_id:Jn,field:"height"},destination:{node_id:Se,field:"height"}})}else b.nodes[Vt].image={image_name:l.imageName},b.edges.push({source:{node_id:Vt,field:"width"},destination:{node_id:Se,field:"width"}}),b.edges.push({source:{node_id:Vt,field:"height"},destination:{node_id:Se,field:"height"}});return b.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:_?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:g,strength:u,init_image:l.imageName},b.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:it,field:"metadata"}}),Uo(e,b,an),sh(e,b,Le),wu(e,b),Fo(e,b,Le),e.system.shouldUseNSFWChecker&&Bo(e,b),e.system.shouldUseWatermarker&&zo(e,b),b},WCe=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,initialImage:l,shouldFitToWidthHeight:u,width:d,height:f,clipSkip:h,shouldUseCpuNoise:g,shouldUseNoiseSettings:m,vaePrecision:v}=e.generation,{positiveStylePrompt:x,negativeStylePrompt:_,shouldConcatSDXLStylePrompt:b,shouldUseSDXLRefiner:y,refinerStart:S,sdxlImg2ImgDenoisingStrength:C}=e.sdxl;if(!l)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const T=m?g:ys.shouldUseCpuNoise,{craftedPositiveStylePrompt:E,craftedNegativeStylePrompt:P}=Uc(e,b),k={id:b5,nodes:{[We]:{type:"sdxl_model_loader",id:We,model:i},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:n,style:E},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:P},[Se]:{type:"noise",id:Se,use_cpu:T},[it]:{type:"l2i",id:it,fp32:v==="fp32"},[Re]:{type:"denoise_latents",id:Re,cfg_scale:o,scheduler:s,steps:a,denoising_start:y?Math.min(S,1-C):1-C,denoising_end:y?S:1},[Vt]:{type:"i2l",id:Vt,fp32:v==="fp32"}},edges:[{source:{node_id:We,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:We,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:We,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Vt,field:"latents"},destination:{node_id:Re,field:"latents"}},{source:{node_id:Re,field:"latents"},destination:{node_id:it,field:"latents"}}]};if(u&&(l.width!==d||l.height!==f)){const O={id:Jn,type:"img_resize",image:{image_name:l.imageName},is_intermediate:!0,width:d,height:f};k.nodes[Jn]=O,k.edges.push({source:{node_id:Jn,field:"image"},destination:{node_id:Vt,field:"image"}}),k.edges.push({source:{node_id:Jn,field:"width"},destination:{node_id:Se,field:"width"}}),k.edges.push({source:{node_id:Jn,field:"height"},destination:{node_id:Se,field:"height"}})}else k.nodes[Vt].image={image_name:l.imageName},k.edges.push({source:{node_id:Vt,field:"width"},destination:{node_id:Se,field:"width"}}),k.edges.push({source:{node_id:Vt,field:"height"},destination:{node_id:Se,field:"height"}});return k.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:T?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:h,strength:C,init_image:l.imageName,positive_style_prompt:x,negative_style_prompt:_},k.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:it,field:"metadata"}}),ah(e,k,Re,We),y&&lh(e,k,Re),Uo(e,k,We),Fo(e,k,Re),wu(e,k),e.system.shouldUseNSFWChecker&&Bo(e,k),e.system.shouldUseWatermarker&&zo(e,k),k},qCe=()=>{Oe({predicate:e=>zm.match(e)&&e.payload==="img2img",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=ke("session"),o=t(),s=o.generation.model;let a;s&&s.base_model==="sdxl"?a=WCe(o):a=HCe(o),n(YU(a)),i.debug({graph:Ya(a)},"Image to Image graph built"),n(jr({graph:a})),await r(jr.fulfilled.match),n(kc())}})};let Z0;const KCe=new Uint8Array(16);function XCe(){if(!Z0&&(Z0=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Z0))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Z0(KCe)}const $r=[];for(let e=0;e<256;++e)$r.push((e+256).toString(16).slice(1));function YCe(e,t=0){return($r[e[t+0]]+$r[e[t+1]]+$r[e[t+2]]+$r[e[t+3]]+"-"+$r[e[t+4]]+$r[e[t+5]]+"-"+$r[e[t+6]]+$r[e[t+7]]+"-"+$r[e[t+8]]+$r[e[t+9]]+"-"+$r[e[t+10]]+$r[e[t+11]]+$r[e[t+12]]+$r[e[t+13]]+$r[e[t+14]]+$r[e[t+15]]).toLowerCase()}const QCe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Bk={randomUUID:QCe};function ZCe(e,t,n){if(Bk.randomUUID&&!t&&!e)return Bk.randomUUID();e=e||{};const r=e.random||(e.rng||XCe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return YCe(r)}const JCe=e=>{if(e.type==="color"&&e.value){const t=Qr(e.value),{r:n,g:r,b:i,a:o}=e.value,s=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a:s}),t}return e.value},e3e=e=>{const{nodes:t,edges:n}=e.nodes,i=t.filter(a=>a.type!=="progress_image").reduce((a,l)=>{const{id:u,data:d}=l,{type:f,inputs:h}=d,g=LT(h,(v,x,_)=>{const b=JCe(x);return v[_]=b,v},{}),m={type:f,id:u,...g};return Object.assign(a,{[u]:m}),a},{}),o=n.reduce((a,l)=>{const{source:u,target:d,sourceHandle:f,targetHandle:h}=l;return a.push({source:{node_id:u,field:f},destination:{node_id:d,field:h}}),a},[]);return o.forEach(a=>{const l=i[a.destination.node_id],u=a.destination.field;i[a.destination.node_id]=mb(l,u)}),{id:ZCe(),nodes:i,edges:o}},t3e=()=>{Oe({predicate:e=>zm.match(e)&&e.payload==="nodes",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=ke("session"),o=t(),s=e3e(o);n(ZU(s)),i.debug({graph:Ya(s)},"Nodes graph built"),n(jr({graph:s})),await r(jr.fulfilled.match),n(kc())}})},n3e=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,width:l,height:u,clipSkip:d,shouldUseCpuNoise:f,shouldUseNoiseSettings:h,vaePrecision:g}=e.generation,{positiveStylePrompt:m,negativeStylePrompt:v,shouldUseSDXLRefiner:x,shouldConcatSDXLStylePrompt:_,refinerStart:b}=e.sdxl,y=h?f:ys.shouldUseCpuNoise;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const{craftedPositiveStylePrompt:S,craftedNegativeStylePrompt:C}=Uc(e,_),T={id:fz,nodes:{[We]:{type:"sdxl_model_loader",id:We,model:i},[$e]:{type:"sdxl_compel_prompt",id:$e,prompt:n,style:S},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:C},[Se]:{type:"noise",id:Se,width:l,height:u,use_cpu:y},[Re]:{type:"denoise_latents",id:Re,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:x?b:1},[it]:{type:"l2i",id:it,fp32:g==="fp32"}},edges:[{source:{node_id:We,field:"unet"},destination:{node_id:Re,field:"unet"}},{source:{node_id:We,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:$e,field:"clip2"}},{source:{node_id:We,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:We,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Re,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Re,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Re,field:"noise"}},{source:{node_id:Re,field:"latents"},destination:{node_id:it,field:"latents"}}]};return T.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:u,width:l,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:y?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:d,positive_style_prompt:m,negative_style_prompt:v},T.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:it,field:"metadata"}}),x&&lh(e,T,Re),Uo(e,T,We),ah(e,T,Re,We),Fo(e,T,Re),wu(e,T),e.system.shouldUseNSFWChecker&&Bo(e,T),e.system.shouldUseWatermarker&&zo(e,T),T},r3e=e=>{const t=ke("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:s,steps:a,width:l,height:u,clipSkip:d,shouldUseCpuNoise:f,shouldUseNoiseSettings:h,vaePrecision:g}=e.generation,m=h?f:ys.shouldUseCpuNoise;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const v=i.model_type==="onnx",x=v?mS:an,_=v?"onnx_model_loader":"main_model_loader",b=v?{type:"t2l_onnx",id:Le,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a}:{type:"denoise_latents",id:Le,is_intermediate:!0,cfg_scale:o,scheduler:s,steps:a,denoising_start:0,denoising_end:1},y={id:lz,nodes:{[x]:{type:_,id:x,is_intermediate:!0,model:i},[It]:{type:"clip_skip",id:It,skipped_layers:d,is_intermediate:!0},[$e]:{type:v?"prompt_onnx":"compel",id:$e,prompt:n,is_intermediate:!0},[Be]:{type:v?"prompt_onnx":"compel",id:Be,prompt:r,is_intermediate:!0},[Se]:{type:"noise",id:Se,width:l,height:u,use_cpu:m,is_intermediate:!0},[b.id]:b,[it]:{type:v?"l2i_onnx":"l2i",id:it,fp32:g==="fp32"}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Le,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:It,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:$e,field:"clip"}},{source:{node_id:It,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:$e,field:"conditioning"},destination:{node_id:Le,field:"positive_conditioning"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Le,field:"negative_conditioning"}},{source:{node_id:Se,field:"noise"},destination:{node_id:Le,field:"noise"}},{source:{node_id:Le,field:"latents"},destination:{node_id:it,field:"latents"}}]};return y.nodes[yt]={id:yt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:"",negative_prompt:r,model:i,seed:0,steps:a,rand_device:m?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],clip_skip:d},y.edges.push({source:{node_id:yt,field:"metadata"},destination:{node_id:it,field:"metadata"}}),Uo(e,y,x),sh(e,y,Le,x),wu(e,y),Fo(e,y,Le),e.system.shouldUseNSFWChecker&&Bo(e,y),e.system.shouldUseWatermarker&&zo(e,y),y},i3e=()=>{Oe({predicate:e=>zm.match(e)&&e.payload==="txt2img",effect:async(e,{getState:t,dispatch:n,take:r})=>{const i=ke("session"),o=t(),s=o.generation.model;let a;s&&s.base_model==="sdxl"?a=n3e(o):a=r3e(o),n(XU(a)),i.debug({graph:Ya(a)},"Text to Image graph built"),n(jr({graph:a})),await r(jr.fulfilled.match),n(kc())}})},Xz=$L(),Oe=Xz.startListening;hbe();pbe();ybe();ibe();obe();sbe();abe();lbe();$_e();fbe();GCe();t3e();i3e();qCe();uSe();Z_e();X_e();q_e();Q_e();xSe();k_e();fSe();hSe();gSe();mSe();vSe();cSe();dSe();SSe();wSe();_Se();bSe();ySe();rSe();iSe();oSe();sSe();aSe();lSe();eSe();tSe();nSe();tbe();ebe();nbe();rbe();cbe();dbe();F_e();Kbe();ube();vbe();L_e();bbe();M_e();I_e();PSe();TSe();const o3e={canvas:gce,gallery:xfe,generation:Wue,nodes:u1e,postprocessing:c1e,system:$1e,config:Tle,ui:Kue,hotkeys:z1e,controlNet:bfe,dynamicPrompts:wfe,deleteImageModal:Afe,changeBoardModal:Rfe,lora:kfe,modelmanager:U1e,sdxl:h1e,[iu.reducerPath]:iu.reducer},s3e=Qf(o3e),a3e=f_e(s3e),l3e=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlNet","dynamicPrompts","lora","modelmanager"],u3e=yL({reducer:a3e,enhancers:e=>e.concat(h_e(window.localStorage,l3e,{persistDebounce:300,serialize:C_e,unserialize:E_e,prefix:p_e})).concat(BL()),middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(iu.middleware).concat(H1e).prepend(Xz.middleware),devTools:{actionSanitizer:P_e,stateSanitizer:O_e,trace:!0,predicate:(e,t)=>!R_e.includes(t.type)}}),OMe=e=>e,c3e=e=>{const{socket:t,storeApi:n}=e,{dispatch:r,getState:i}=n;t.on("connect",()=>{ke("socketio").debug("Connected"),r(aF());const{sessionId:s}=i().system;s&&(t.emit("subscribe",{session:s}),r(YT({sessionId:s})))}),t.on("connect_error",o=>{o&&o.message&&o.data==="ERR_UNAUTHENTICATED"&&r(Yn(lc({title:o.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(uF())}),t.on("invocation_started",o=>{r(pF({data:o}))}),t.on("generator_progress",o=>{r(bF({data:o}))}),t.on("invocation_error",o=>{r(yF({data:o}))}),t.on("invocation_complete",o=>{r(QT({data:o}))}),t.on("graph_execution_state_complete",o=>{r(vF({data:o}))}),t.on("model_load_started",o=>{r(wF({data:o}))}),t.on("model_load_completed",o=>{r(xF({data:o}))}),t.on("session_retrieval_error",o=>{r(CF({data:o}))}),t.on("invocation_retrieval_error",o=>{r(EF({data:o}))})},Qs=Object.create(null);Qs.open="0";Qs.close="1";Qs.ping="2";Qs.pong="3";Qs.message="4";Qs.upgrade="5";Qs.noop="6";const Nv=Object.create(null);Object.keys(Qs).forEach(e=>{Nv[Qs[e]]=e});const d3e={type:"error",data:"parser error"},Yz=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Qz=typeof ArrayBuffer=="function",Zz=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,YE=({type:e,data:t},n,r)=>Yz&&t instanceof Blob?n?r(t):Uk(t,r):Qz&&(t instanceof ArrayBuffer||Zz(t))?n?r(t):Uk(new Blob([t]),r):r(Qs[e]+(t||"")),Uk=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function zk(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let iC;function f3e(e,t){if(Yz&&e.data instanceof Blob)return e.data.arrayBuffer().then(zk).then(t);if(Qz&&(e.data instanceof ArrayBuffer||Zz(e.data)))return t(zk(e.data));YE(e,!1,n=>{iC||(iC=new TextEncoder),t(iC.encode(n))})}const Vk="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pp=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Vk.length;e++)Pp[Vk.charCodeAt(e)]=e;const h3e=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)o=Pp[e.charCodeAt(r)],s=Pp[e.charCodeAt(r+1)],a=Pp[e.charCodeAt(r+2)],l=Pp[e.charCodeAt(r+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return u},p3e=typeof ArrayBuffer=="function",QE=(e,t)=>{if(typeof e!="string")return{type:"message",data:Jz(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:g3e(e.substring(1),t)}:Nv[n]?e.length>1?{type:Nv[n],data:e.substring(1)}:{type:Nv[n]}:d3e},g3e=(e,t)=>{if(p3e){const n=h3e(e);return Jz(n,t)}else return{base64:!0,data:e}},Jz=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},eV=String.fromCharCode(30),m3e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{YE(o,!1,a=>{r[s]=a,++i===n&&t(r.join(eV))})})},y3e=(e,t)=>{const n=e.split(eV),r=[];for(let i=0;i<n.length;i++){const o=QE(n[i],t);if(r.push(o),o.type==="error")break}return r};let oC;function v3e(e,t,n){oC||(oC=new TextDecoder);const r=t||e[0]<48||e[0]>54;return QE(r?e:oC.decode(e),n)}const tV=4;function nr(e){if(e)return _3e(e)}function _3e(e){for(var t in nr.prototype)e[t]=nr.prototype[t];return e}nr.prototype.on=nr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};nr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};nr.prototype.off=nr.prototype.removeListener=nr.prototype.removeAllListeners=nr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};nr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};nr.prototype.emitReserved=nr.prototype.emit;nr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};nr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ao=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function nV(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const b3e=Ao.setTimeout,S3e=Ao.clearTimeout;function u2(e,t){t.useNativeTimers?(e.setTimeoutFn=b3e.bind(Ao),e.clearTimeoutFn=S3e.bind(Ao)):(e.setTimeoutFn=Ao.setTimeout.bind(Ao),e.clearTimeoutFn=Ao.clearTimeout.bind(Ao))}const w3e=1.33;function x3e(e){return typeof e=="string"?C3e(e):Math.ceil((e.byteLength||e.size)*w3e)}function C3e(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function T3e(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function E3e(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class A3e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class ZE extends nr{constructor(t){super(),this.writable=!1,u2(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new A3e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=QE(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=T3e(t);return n.length?"?"+n:""}}const rV="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),R5=64,P3e={};let jk=0,J0=0,Gk;function Hk(e){let t="";do t=rV[e%R5]+t,e=Math.floor(e/R5);while(e>0);return t}function iV(){const e=Hk(+new Date);return e!==Gk?(jk=0,Gk=e):e+"."+Hk(jk++)}for(;J0<R5;J0++)P3e[rV[J0]]=J0;let oV=!1;try{oV=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const R3e=oV;function sV(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||R3e))return new XMLHttpRequest}catch{}if(!t)try{return new Ao[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function O3e(){}const k3e=function(){return new sV({xdomain:!1}).responseType!=null}();class I3e extends ZE{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=k3e&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};y3e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,m3e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=iV()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new bf(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let bf=class Lv extends nr{constructor(t,n){super(),u2(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=nV(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new sV(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Lv.requestsCount++,Lv.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=O3e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Lv.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};bf.requestsCount=0;bf.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Wk);else if(typeof addEventListener=="function"){const e="onpagehide"in Ao?"pagehide":"unload";addEventListener(e,Wk,!1)}}function Wk(){for(let e in bf.requests)bf.requests.hasOwnProperty(e)&&bf.requests[e].abort()}const JE=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),ev=Ao.WebSocket||Ao.MozWebSocket,qk=!0,M3e="arraybuffer",Kk=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class N3e extends ZE{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Kk?{}:nV(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=qk&&!Kk?n?new ev(t,n):new ev(t):new ev(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||M3e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;YE(r,this.supportsBinary,o=>{const s={};try{qk&&this.ws.send(o)}catch{}i&&JE(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=iV()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!ev}}function L3e(e,t){return e.type==="message"&&typeof e.data!="string"&&t[0]>=48&&t[0]<=54}class D3e extends ZE{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=t.readable.getReader();this.writer=t.writable.getWriter();let r;const i=()=>{n.read().then(({done:s,value:a})=>{s||(!r&&a.byteLength===1&&a[0]===54?r=!0:(this.onPacket(v3e(a,r,"arraybuffer")),r=!1),i())}).catch(s=>{})};i();const o=this.query.sid?`0{"sid":"${this.query.sid}"}`:"0";this.writer.write(new TextEncoder().encode(o)).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;f3e(r,o=>{L3e(r,o)&&this.writer.write(Uint8Array.of(54)),this.writer.write(o).then(()=>{i&&JE(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const $3e={websocket:N3e,webtransport:D3e,polling:I3e},F3e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,B3e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function O5(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=F3e.exec(e||""),o={},s=14;for(;s--;)o[B3e[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=U3e(o,o.path),o.queryKey=z3e(o,o.query),o}function U3e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function z3e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let aV=class Md extends nr{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=O5(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=O5(n.host).host),u2(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=E3e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=tV,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new $3e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Md.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Md.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Md.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const s=f=>{const h=new Error("probe error: "+f);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function u(f){n&&f.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Md.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=x3e(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Md.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};aV.protocol=tV;function V3e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=O5(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const j3e=typeof ArrayBuffer=="function",G3e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,lV=Object.prototype.toString,H3e=typeof Blob=="function"||typeof Blob<"u"&&lV.call(Blob)==="[object BlobConstructor]",W3e=typeof File=="function"||typeof File<"u"&&lV.call(File)==="[object FileConstructor]";function eA(e){return j3e&&(e instanceof ArrayBuffer||G3e(e))||H3e&&e instanceof Blob||W3e&&e instanceof File}function Dv(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dv(e[n]))return!0;return!1}if(eA(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dv(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dv(e[n]))return!0;return!1}function q3e(e){const t=[],n=e.data,r=e;return r.data=k5(n,t),r.attachments=t.length,{packet:r,buffers:t}}function k5(e,t){if(!e)return e;if(eA(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=k5(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=k5(e[r],t));return n}return e}function K3e(e,t){return e.data=I5(e.data,t),delete e.attachments,e}function I5(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=I5(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=I5(e[n],t));return e}const X3e=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Y3e=5;var Tt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Tt||(Tt={}));class Q3e{constructor(t){this.replacer=t}encode(t){return(t.type===Tt.EVENT||t.type===Tt.ACK)&&Dv(t)?this.encodeAsBinary({type:t.type===Tt.EVENT?Tt.BINARY_EVENT:Tt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Tt.BINARY_EVENT||t.type===Tt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=q3e(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Xk(e){return Object.prototype.toString.call(e)==="[object Object]"}class tA extends nr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Tt.BINARY_EVENT;r||n.type===Tt.BINARY_ACK?(n.type=r?Tt.EVENT:Tt.ACK,this.reconstructor=new Z3e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(eA(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Tt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Tt.BINARY_EVENT||r.type===Tt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(tA.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Tt.CONNECT:return Xk(n);case Tt.DISCONNECT:return n===void 0;case Tt.CONNECT_ERROR:return typeof n=="string"||Xk(n);case Tt.EVENT:case Tt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&X3e.indexOf(n[0])===-1);case Tt.ACK:case Tt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Z3e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=K3e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const J3e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:tA,Encoder:Q3e,get PacketType(){return Tt},protocol:Y3e},Symbol.toStringTag,{value:"Module"}));function ts(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const e5e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class uV extends nr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ts(t,"open",this.onopen.bind(this)),ts(t,"packet",this.onpacket.bind(this)),ts(t,"error",this.onerror.bind(this)),ts(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(e5e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Tt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Tt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Tt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Tt.EVENT:case Tt.BINARY_EVENT:this.onevent(t);break;case Tt.ACK:case Tt.BINARY_ACK:this.onack(t);break;case Tt.DISCONNECT:this.ondisconnect();break;case Tt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Tt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Tt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function uh(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}uh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};uh.prototype.reset=function(){this.attempts=0};uh.prototype.setMin=function(e){this.ms=e};uh.prototype.setMax=function(e){this.max=e};uh.prototype.setJitter=function(e){this.jitter=e};class M5 extends nr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,u2(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new uh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||J3e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new aV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=ts(n,"open",function(){r.onopen(),t&&t()}),o=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},s=ts(n,"error",o);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ts(t,"ping",this.onping.bind(this)),ts(t,"data",this.ondata.bind(this)),ts(t,"error",this.onerror.bind(this)),ts(t,"close",this.onclose.bind(this)),ts(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){JE(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new uV(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const yp={};function $v(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=V3e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=yp[i]&&o in yp[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new M5(r,t):(yp[i]||(yp[i]=new M5(r,t)),l=yp[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign($v,{Manager:M5,Socket:uV,io:$v,connect:$v});const Yk=()=>{let e=!1,n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;const r={timeout:6e4,path:"/ws/socket.io",autoConnect:!1};if(["nodes","package"].includes("production")){const s=$g.get();s&&(n=s.replace(/^https?\:\/\//i,""));const a=Dg.get();a&&(r.auth={token:a}),r.transports=["websocket","polling"]}const i=$v(n,r);return s=>a=>l=>{const{dispatch:u,getState:d}=s;if(e||(c3e({storeApi:s,socket:i}),e=!0,i.connect()),jr.fulfilled.match(l)){const f=l.payload.id,h=d().system.sessionId;h&&(i.emit("unsubscribe",{session:h}),u(fF({sessionId:h}))),i.emit("subscribe",{session:f}),u(YT({sessionId:f}))}a(l)}};function t5e(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function n5e(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var r5e=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(n5e(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=t5e(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Yr="-ms-",m_="-moz-",Dt="-webkit-",cV="comm",nA="rule",rA="decl",i5e="@import",dV="@keyframes",o5e="@layer",s5e=Math.abs,c2=String.fromCharCode,a5e=Object.assign;function l5e(e,t){return Ur(e,0)^45?(((t<<2^Ur(e,0))<<2^Ur(e,1))<<2^Ur(e,2))<<2^Ur(e,3):0}function fV(e){return e.trim()}function u5e(e,t){return(e=t.exec(e))?e[0]:e}function $t(e,t,n){return e.replace(t,n)}function N5(e,t){return e.indexOf(t)}function Ur(e,t){return e.charCodeAt(t)|0}function Zg(e,t,n){return e.slice(t,n)}function Os(e){return e.length}function iA(e){return e.length}function tv(e,t){return t.push(e),e}function c5e(e,t){return e.map(t).join("")}var d2=1,Hf=1,hV=0,Ui=0,Qn=0,ch="";function f2(e,t,n,r,i,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:d2,column:Hf,length:s,return:""}}function vp(e,t){return a5e(f2("",null,null,"",null,null,0),e,{length:-e.length},t)}function d5e(){return Qn}function f5e(){return Qn=Ui>0?Ur(ch,--Ui):0,Hf--,Qn===10&&(Hf=1,d2--),Qn}function to(){return Qn=Ui<hV?Ur(ch,Ui++):0,Hf++,Qn===10&&(Hf=1,d2++),Qn}function Ws(){return Ur(ch,Ui)}function Fv(){return Ui}function qm(e,t){return Zg(ch,e,t)}function Jg(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function pV(e){return d2=Hf=1,hV=Os(ch=e),Ui=0,[]}function gV(e){return ch="",e}function Bv(e){return fV(qm(Ui-1,L5(e===91?e+2:e===40?e+1:e)))}function h5e(e){for(;(Qn=Ws())&&Qn<33;)to();return Jg(e)>2||Jg(Qn)>3?"":" "}function p5e(e,t){for(;--t&&to()&&!(Qn<48||Qn>102||Qn>57&&Qn<65||Qn>70&&Qn<97););return qm(e,Fv()+(t<6&&Ws()==32&&to()==32))}function L5(e){for(;to();)switch(Qn){case e:return Ui;case 34:case 39:e!==34&&e!==39&&L5(Qn);break;case 40:e===41&&L5(e);break;case 92:to();break}return Ui}function g5e(e,t){for(;to()&&e+Qn!==47+10;)if(e+Qn===42+42&&Ws()===47)break;return"/*"+qm(t,Ui-1)+"*"+c2(e===47?e:to())}function m5e(e){for(;!Jg(Ws());)to();return qm(e,Ui)}function y5e(e){return gV(Uv("",null,null,null,[""],e=pV(e),0,[0],e))}function Uv(e,t,n,r,i,o,s,a,l){for(var u=0,d=0,f=s,h=0,g=0,m=0,v=1,x=1,_=1,b=0,y="",S=i,C=o,T=r,E=y;x;)switch(m=b,b=to()){case 40:if(m!=108&&Ur(E,f-1)==58){N5(E+=$t(Bv(b),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:E+=Bv(b);break;case 9:case 10:case 13:case 32:E+=h5e(m);break;case 92:E+=p5e(Fv()-1,7);continue;case 47:switch(Ws()){case 42:case 47:tv(v5e(g5e(to(),Fv()),t,n),l);break;default:E+="/"}break;case 123*v:a[u++]=Os(E)*_;case 125*v:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+d:_==-1&&(E=$t(E,/\f/g,"")),g>0&&Os(E)-f&&tv(g>32?Zk(E+";",r,n,f-1):Zk($t(E," ","")+";",r,n,f-2),l);break;case 59:E+=";";default:if(tv(T=Qk(E,t,n,u,d,i,a,y,S=[],C=[],f),o),b===123)if(d===0)Uv(E,t,T,T,S,o,f,a,C);else switch(h===99&&Ur(E,3)===110?100:h){case 100:case 108:case 109:case 115:Uv(e,T,T,r&&tv(Qk(e,T,T,0,0,i,a,y,i,S=[],f),C),i,C,f,a,r?S:C);break;default:Uv(E,T,T,T,[""],C,0,a,C)}}u=d=g=0,v=_=1,y=E="",f=s;break;case 58:f=1+Os(E),g=m;default:if(v<1){if(b==123)--v;else if(b==125&&v++==0&&f5e()==125)continue}switch(E+=c2(b),b*v){case 38:_=d>0?1:(E+="\f",-1);break;case 44:a[u++]=(Os(E)-1)*_,_=1;break;case 64:Ws()===45&&(E+=Bv(to())),h=Ws(),d=f=Os(y=E+=m5e(Fv())),b++;break;case 45:m===45&&Os(E)==2&&(v=0)}}return o}function Qk(e,t,n,r,i,o,s,a,l,u,d){for(var f=i-1,h=i===0?o:[""],g=iA(h),m=0,v=0,x=0;m<r;++m)for(var _=0,b=Zg(e,f+1,f=s5e(v=s[m])),y=e;_<g;++_)(y=fV(v>0?h[_]+" "+b:$t(b,/&\f/g,h[_])))&&(l[x++]=y);return f2(e,t,n,i===0?nA:a,l,u,d)}function v5e(e,t,n){return f2(e,t,n,cV,c2(d5e()),Zg(e,2,-2),0)}function Zk(e,t,n,r){return f2(e,t,n,rA,Zg(e,0,r),Zg(e,r+1,-1),r)}function Sf(e,t){for(var n="",r=iA(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function _5e(e,t,n,r){switch(e.type){case o5e:if(e.children.length)break;case i5e:case rA:return e.return=e.return||e.value;case cV:return"";case dV:return e.return=e.value+"{"+Sf(e.children,r)+"}";case nA:e.value=e.props.join(",")}return Os(n=Sf(e.children,r))?e.return=e.value+"{"+n+"}":""}function b5e(e){var t=iA(e);return function(n,r,i,o){for(var s="",a=0;a<t;a++)s+=e[a](n,r,i,o)||"";return s}}function S5e(e){return function(t){t.root||(t=t.return)&&e(t)}}var Jk=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=t(r);return n.set(r,i),i}};function mV(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var w5e=function(t,n,r){for(var i=0,o=0;i=o,o=Ws(),i===38&&o===12&&(n[r]=1),!Jg(o);)to();return qm(t,Ui)},x5e=function(t,n){var r=-1,i=44;do switch(Jg(i)){case 0:i===38&&Ws()===12&&(n[r]=1),t[r]+=w5e(Ui-1,n,r);break;case 2:t[r]+=Bv(i);break;case 4:if(i===44){t[++r]=Ws()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=c2(i)}while(i=to());return t},C5e=function(t,n){return gV(x5e(pV(t),n))},eI=new WeakMap,T5e=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!eI.get(r))&&!i){eI.set(t,!0);for(var o=[],s=C5e(n,o),a=r.props,l=0,u=0;l<s.length;l++)for(var d=0;d<a.length;d++,u++)t.props[u]=o[l]?s[l].replace(/&\f/g,a[d]):a[d]+" "+s[l]}}},E5e=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function yV(e,t){switch(l5e(e,t)){case 5103:return Dt+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Dt+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Dt+e+m_+e+Yr+e+e;case 6828:case 4268:return Dt+e+Yr+e+e;case 6165:return Dt+e+Yr+"flex-"+e+e;case 5187:return Dt+e+$t(e,/(\w+).+(:[^]+)/,Dt+"box-$1$2"+Yr+"flex-$1$2")+e;case 5443:return Dt+e+Yr+"flex-item-"+$t(e,/flex-|-self/,"")+e;case 4675:return Dt+e+Yr+"flex-line-pack"+$t(e,/align-content|flex-|-self/,"")+e;case 5548:return Dt+e+Yr+$t(e,"shrink","negative")+e;case 5292:return Dt+e+Yr+$t(e,"basis","preferred-size")+e;case 6060:return Dt+"box-"+$t(e,"-grow","")+Dt+e+Yr+$t(e,"grow","positive")+e;case 4554:return Dt+$t(e,/([^-])(transform)/g,"$1"+Dt+"$2")+e;case 6187:return $t($t($t(e,/(zoom-|grab)/,Dt+"$1"),/(image-set)/,Dt+"$1"),e,"")+e;case 5495:case 3959:return $t(e,/(image-set\([^]*)/,Dt+"$1$`$1");case 4968:return $t($t(e,/(.+:)(flex-)?(.*)/,Dt+"box-pack:$3"+Yr+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Dt+e+e;case 4095:case 3583:case 4068:case 2532:return $t(e,/(.+)-inline(.+)/,Dt+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Os(e)-1-t>6)switch(Ur(e,t+1)){case 109:if(Ur(e,t+4)!==45)break;case 102:return $t(e,/(.+:)(.+)-([^]+)/,"$1"+Dt+"$2-$3$1"+m_+(Ur(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~N5(e,"stretch")?yV($t(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ur(e,t+1)!==115)break;case 6444:switch(Ur(e,Os(e)-3-(~N5(e,"!important")&&10))){case 107:return $t(e,":",":"+Dt)+e;case 101:return $t(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Dt+(Ur(e,14)===45?"inline-":"")+"box$3$1"+Dt+"$2$3$1"+Yr+"$2box$3")+e}break;case 5936:switch(Ur(e,t+11)){case 114:return Dt+e+Yr+$t(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Dt+e+Yr+$t(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Dt+e+Yr+$t(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Dt+e+Yr+e+e}return e}var A5e=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case rA:t.return=yV(t.value,t.length);break;case dV:return Sf([vp(t,{value:$t(t.value,"@","@"+Dt)})],i);case nA:if(t.length)return c5e(t.props,function(o){switch(u5e(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sf([vp(t,{props:[$t(o,/:(read-\w+)/,":"+m_+"$1")]})],i);case"::placeholder":return Sf([vp(t,{props:[$t(o,/:(plac\w+)/,":"+Dt+"input-$1")]}),vp(t,{props:[$t(o,/:(plac\w+)/,":"+m_+"$1")]}),vp(t,{props:[$t(o,/:(plac\w+)/,Yr+"input-$1")]})],i)}return""})}},P5e=[A5e],R5e=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(v){var x=v.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=t.stylisPlugins||P5e,o={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(v){for(var x=v.getAttribute("data-emotion").split(" "),_=1;_<x.length;_++)o[x[_]]=!0;a.push(v)});var l,u=[T5e,E5e];{var d,f=[_5e,S5e(function(v){d.insert(v)})],h=b5e(u.concat(i,f)),g=function(x){return Sf(y5e(x),h)};l=function(x,_,b,y){d=b,g(x?x+"{"+_.styles+"}":_.styles),y&&(m.inserted[_.name]=!0)}}var m={key:n,sheet:new r5e({key:n,container:s,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return m.sheet.hydrate(a),m},O5e=!0;function k5e(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var vV=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||O5e===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},_V=function(t,n,r){vV(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function I5e(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var M5e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},N5e=/[A-Z]|^ms/g,L5e=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bV=function(t){return t.charCodeAt(1)===45},tI=function(t){return t!=null&&typeof t!="boolean"},sC=mV(function(e){return bV(e)?e:e.replace(N5e,"-$&").toLowerCase()}),nI=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(L5e,function(r,i,o){return ks={name:i,styles:o,next:ks},i})}return M5e[t]!==1&&!bV(t)&&typeof n=="number"&&n!==0?n+"px":n};function em(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return ks={name:n.name,styles:n.styles,next:ks},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)ks={name:r.name,styles:r.styles,next:ks},r=r.next;var i=n.styles+";";return i}return D5e(e,t,n)}case"function":{if(e!==void 0){var o=ks,s=n(e);return ks=o,em(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function D5e(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=em(e,t,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object")t!=null&&t[s]!==void 0?r+=o+"{"+t[s]+"}":tI(s)&&(r+=sC(o)+":"+nI(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(t==null||t[s[0]]===void 0))for(var a=0;a<s.length;a++)tI(s[a])&&(r+=sC(o)+":"+nI(o,s[a])+";");else{var l=em(e,t,s);switch(o){case"animation":case"animationName":{r+=sC(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var rI=/label:\s*([^\s;\n{]+)\s*(;|$)/g,ks,oA=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,o="";ks=void 0;var s=t[0];s==null||s.raw===void 0?(i=!1,o+=em(r,n,s)):o+=s[0];for(var a=1;a<t.length;a++)o+=em(r,n,t[a]),i&&(o+=s[a]);rI.lastIndex=0;for(var l="",u;(u=rI.exec(o))!==null;)l+="-"+u[1];var d=I5e(o)+l;return{name:d,styles:o,next:ks}},$5e=function(t){return t()},SV=HP["useInsertionEffect"]?HP["useInsertionEffect"]:!1,F5e=SV||$5e,iI=SV||L.useLayoutEffect,wV=L.createContext(typeof HTMLElement<"u"?R5e({key:"css"}):null);wV.Provider;var xV=function(t){return L.forwardRef(function(n,r){var i=L.useContext(wV);return t(n,i,r)})},tm=L.createContext({}),B5e=function(t,n){if(typeof n=="function"){var r=n(t);return r}return U1({},t,n)},U5e=Jk(function(e){return Jk(function(t){return B5e(e,t)})}),kMe=function(t){var n=L.useContext(tm);return t.theme!==n&&(n=U5e(n)(t.theme)),L.createElement(tm.Provider,{value:n},t.children)},IMe=xV(function(e,t){var n=e.styles,r=oA([n],void 0,L.useContext(tm)),i=L.useRef();return iI(function(){var o=t.key+"-global",s=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(s.before=t.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[t]),iI(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&_V(t,r.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}t.insert("",r,s,!1)},[t,r.name]),null});function z5e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return oA(t)}var V5e=function(){var t=z5e.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}},j5e=globalThis!=null&&globalThis.document?L.useLayoutEffect:L.useEffect;function CV(){const e=L.useContext(tm);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var TV=L.createContext({});TV.displayName="ColorModeContext";function sA(){const e=L.useContext(TV);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function MMe(e,t){const{colorMode:n}=sA();return n==="dark"?t:e}function G5e(){const e=sA(),t=CV();return{...e,theme:t}}function H5e(e,t,n){var r,i;if(t==null)return t;const o=s=>{var a,l;return(l=(a=e.__breakpoints)==null?void 0:a.asArray)==null?void 0:l[s]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function W5e(e,t,n){var r,i;if(t==null)return t;const o=s=>{var a,l;return(l=(a=e.__cssMap)==null?void 0:a[s])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function NMe(e,t,n){const r=CV();return q5e(e,t,n)(r)}function q5e(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const s=i.filter(Boolean),a=r.map((l,u)=>{var d,f;if(e==="breakpoints")return H5e(o,l,(d=s[u])!=null?d:l);const h=`${e}.${l}`;return W5e(o,h,(f=s[u])!=null?f:l)});return Array.isArray(t)?a:a[0]}}var EV=(...e)=>e.filter(Boolean).join(" ");function K5e(){return!1}function La(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var LMe=e=>{const{condition:t,message:n}=e;t&&K5e()&&console.warn(n)};function Ju(e,...t){return X5e(e)?e(...t):e}var X5e=e=>typeof e=="function",DMe=e=>e?"":void 0,$Me=e=>e?!0:void 0;function FMe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function BMe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var y_={exports:{}};y_.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",m="[object GeneratorFunction]",v="[object Map]",x="[object Number]",_="[object Null]",b="[object Object]",y="[object Proxy]",S="[object RegExp]",C="[object Set]",T="[object String]",E="[object Undefined]",P="[object WeakMap]",k="[object ArrayBuffer]",O="[object DataView]",M="[object Float32Array]",V="[object Float64Array]",B="[object Int8Array]",A="[object Int16Array]",N="[object Int32Array]",D="[object Uint8Array]",U="[object Uint8ClampedArray]",$="[object Uint16Array]",j="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,q=/^\[object .+?Constructor\]$/,Z=/^(?:0|[1-9]\d*)$/,ee={};ee[M]=ee[V]=ee[B]=ee[A]=ee[N]=ee[D]=ee[U]=ee[$]=ee[j]=!0,ee[a]=ee[l]=ee[k]=ee[d]=ee[O]=ee[f]=ee[h]=ee[g]=ee[v]=ee[x]=ee[b]=ee[S]=ee[C]=ee[T]=ee[P]=!1;var ie=typeof Ze=="object"&&Ze&&Ze.Object===Object&&Ze,se=typeof self=="object"&&self&&self.Object===Object&&self,le=ie||se||Function("return this")(),W=t&&!t.nodeType&&t,ne=W&&!0&&e&&!e.nodeType&&e,fe=ne&&ne.exports===W,pe=fe&&ie.process,ve=function(){try{var H=ne&&ne.require&&ne.require("util").types;return H||pe&&pe.binding&&pe.binding("util")}catch{}}(),ye=ve&&ve.isTypedArray;function Je(H,Y,re){switch(re.length){case 0:return H.call(Y);case 1:return H.call(Y,re[0]);case 2:return H.call(Y,re[0],re[1]);case 3:return H.call(Y,re[0],re[1],re[2])}return H.apply(Y,re)}function Fe(H,Y){for(var re=-1,xe=Array(H);++re<H;)xe[re]=Y(re);return xe}function Ae(H){return function(Y){return H(Y)}}function vt(H,Y){return H==null?void 0:H[Y]}function _e(H,Y){return function(re){return H(Y(re))}}var Qt=Array.prototype,rr=Function.prototype,qt=Object.prototype,ht=le["__core-js_shared__"],At=rr.toString,un=qt.hasOwnProperty,Gr=function(){var H=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||"");return H?"Symbol(src)_1."+H:""}(),Pr=qt.toString,Ci=At.call(Object),In=RegExp("^"+At.call(un).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gn=fe?le.Buffer:void 0,ir=le.Symbol,mn=le.Uint8Array,Zt=gn?gn.allocUnsafe:void 0,Rr=_e(Object.getPrototypeOf,Object),Hr=Object.create,si=qt.propertyIsEnumerable,Vi=Qt.splice,$n=ir?ir.toStringTag:void 0,ai=function(){try{var H=Kc(Object,"defineProperty");return H({},"",{}),H}catch{}}(),ra=gn?gn.isBuffer:void 0,uo=Math.max,ia=Date.now,nn=Kc(le,"Map"),Ft=Kc(Object,"create"),or=function(){function H(){}return function(Y){if(!Ho(Y))return{};if(Hr)return Hr(Y);H.prototype=Y;var re=new H;return H.prototype=void 0,re}}();function qn(H){var Y=-1,re=H==null?0:H.length;for(this.clear();++Y<re;){var xe=H[Y];this.set(xe[0],xe[1])}}function yr(){this.__data__=Ft?Ft(null):{},this.size=0}function Or(H){var Y=this.has(H)&&delete this.__data__[H];return this.size-=Y?1:0,Y}function kr(H){var Y=this.__data__;if(Ft){var re=Y[H];return re===r?void 0:re}return un.call(Y,H)?Y[H]:void 0}function co(H){var Y=this.__data__;return Ft?Y[H]!==void 0:un.call(Y,H)}function Ir(H,Y){var re=this.__data__;return this.size+=this.has(H)?0:1,re[H]=Ft&&Y===void 0?r:Y,this}qn.prototype.clear=yr,qn.prototype.delete=Or,qn.prototype.get=kr,qn.prototype.has=co,qn.prototype.set=Ir;function sr(H){var Y=-1,re=H==null?0:H.length;for(this.clear();++Y<re;){var xe=H[Y];this.set(xe[0],xe[1])}}function ji(){this.__data__=[],this.size=0}function bs(H){var Y=this.__data__,re=Go(Y,H);if(re<0)return!1;var xe=Y.length-1;return re==xe?Y.pop():Vi.call(Y,re,1),--this.size,!0}function fo(H){var Y=this.__data__,re=Go(Y,H);return re<0?void 0:Y[re][1]}function tl(H){return Go(this.__data__,H)>-1}function Vo(H,Y){var re=this.__data__,xe=Go(re,H);return xe<0?(++this.size,re.push([H,Y])):re[xe][1]=Y,this}sr.prototype.clear=ji,sr.prototype.delete=bs,sr.prototype.get=fo,sr.prototype.has=tl,sr.prototype.set=Vo;function Mr(H){var Y=-1,re=H==null?0:H.length;for(this.clear();++Y<re;){var xe=H[Y];this.set(xe[0],xe[1])}}function oa(){this.size=0,this.__data__={hash:new qn,map:new(nn||sr),string:new qn}}function hh(H){var Y=qc(this,H).delete(H);return this.size-=Y?1:0,Y}function ph(H){return qc(this,H).get(H)}function gh(H){return qc(this,H).has(H)}function mh(H,Y){var re=qc(this,H),xe=re.size;return re.set(H,Y),this.size+=re.size==xe?0:1,this}Mr.prototype.clear=oa,Mr.prototype.delete=hh,Mr.prototype.get=ph,Mr.prototype.has=gh,Mr.prototype.set=mh;function jo(H){var Y=this.__data__=new sr(H);this.size=Y.size}function yh(){this.__data__=new sr,this.size=0}function vh(H){var Y=this.__data__,re=Y.delete(H);return this.size=Y.size,re}function Gc(H){return this.__data__.get(H)}function _h(H){return this.__data__.has(H)}function bh(H,Y){var re=this.__data__;if(re instanceof sr){var xe=re.__data__;if(!nn||xe.length<n-1)return xe.push([H,Y]),this.size=++re.size,this;re=this.__data__=new Mr(xe)}return re.set(H,Y),this.size=re.size,this}jo.prototype.clear=yh,jo.prototype.delete=vh,jo.prototype.get=Gc,jo.prototype.has=_h,jo.prototype.set=bh;function Sh(H,Y){var re=Rh(H),xe=!re&&Ph(H),pt=!re&&!xe&&yy(H),Ut=!re&&!xe&&!pt&&_y(H),et=re||xe||pt||Ut,at=et?Fe(H.length,String):[],Rt=at.length;for(var li in H)(Y||un.call(H,li))&&!(et&&(li=="length"||pt&&(li=="offset"||li=="parent")||Ut&&(li=="buffer"||li=="byteLength"||li=="byteOffset")||cy(li,Rt)))&&at.push(li);return at}function Ss(H,Y,re){(re!==void 0&&!Yc(H[Y],re)||re===void 0&&!(Y in H))&&nl(H,Y,re)}function wh(H,Y,re){var xe=H[Y];(!(un.call(H,Y)&&Yc(xe,re))||re===void 0&&!(Y in H))&&nl(H,Y,re)}function Go(H,Y){for(var re=H.length;re--;)if(Yc(H[re][0],Y))return re;return-1}function nl(H,Y,re){Y=="__proto__"&&ai?ai(H,Y,{configurable:!0,enumerable:!0,value:re,writable:!0}):H[Y]=re}var xh=ly();function rl(H){return H==null?H===void 0?E:_:$n&&$n in Object(H)?uy(H):hy(H)}function Cu(H){return Tu(H)&&rl(H)==a}function Hc(H){if(!Ho(H)||Ah(H))return!1;var Y=Oh(H)?In:q;return Y.test(my(H))}function il(H){return Tu(H)&&vy(H.length)&&!!ee[rl(H)]}function A2(H){if(!Ho(H))return fy(H);var Y=sa(H),re=[];for(var xe in H)xe=="constructor"&&(Y||!un.call(H,xe))||re.push(xe);return re}function ry(H,Y,re,xe,pt){H!==Y&&xh(Y,function(Ut,et){if(pt||(pt=new jo),Ho(Ut))P2(H,Y,et,re,ry,xe,pt);else{var at=xe?xe(Xc(H,et),Ut,et+"",H,Y,pt):void 0;at===void 0&&(at=Ut),Ss(H,et,at)}},by)}function P2(H,Y,re,xe,pt,Ut,et){var at=Xc(H,re),Rt=Xc(Y,re),li=et.get(Rt);if(li){Ss(H,re,li);return}var Nr=Ut?Ut(at,Rt,re+"",H,Y,et):void 0,vr=Nr===void 0;if(vr){var Zc=Rh(Rt),Jc=!Zc&&yy(Rt),kh=!Zc&&!Jc&&_y(Rt);Nr=Rt,Zc||Jc||kh?Rh(at)?Nr=at:I2(at)?Nr=O2(at):Jc?(vr=!1,Nr=oy(Rt,!0)):kh?(vr=!1,Nr=Ch(Rt,!0)):Nr=[]:M2(Rt)||Ph(Rt)?(Nr=at,Ph(at)?Nr=N2(at):(!Ho(at)||Oh(at))&&(Nr=Th(Rt))):vr=!1}vr&&(et.set(Rt,Nr),pt(Nr,Rt,xe,Ut,et),et.delete(Rt)),Ss(H,re,Nr)}function R2(H,Y){return py(k2(H,Y,Sy),H+"")}var iy=ai?function(H,Y){return ai(H,"toString",{configurable:!0,enumerable:!1,value:Kt(Y),writable:!0})}:Sy;function oy(H,Y){if(Y)return H.slice();var re=H.length,xe=Zt?Zt(re):new H.constructor(re);return H.copy(xe),xe}function sy(H){var Y=new H.constructor(H.byteLength);return new mn(Y).set(new mn(H)),Y}function Ch(H,Y){var re=Y?sy(H.buffer):H.buffer;return new H.constructor(re,H.byteOffset,H.length)}function O2(H,Y){var re=-1,xe=H.length;for(Y||(Y=Array(xe));++re<xe;)Y[re]=H[re];return Y}function ay(H,Y,re,xe){var pt=!re;re||(re={});for(var Ut=-1,et=Y.length;++Ut<et;){var at=Y[Ut],Rt=xe?xe(re[at],H[at],at,re,H):void 0;Rt===void 0&&(Rt=H[at]),pt?nl(re,at,Rt):wh(re,at,Rt)}return re}function Wc(H){return R2(function(Y,re){var xe=-1,pt=re.length,Ut=pt>1?re[pt-1]:void 0,et=pt>2?re[2]:void 0;for(Ut=H.length>3&&typeof Ut=="function"?(pt--,Ut):void 0,et&&dy(re[0],re[1],et)&&(Ut=pt<3?void 0:Ut,pt=1),Y=Object(Y);++xe<pt;){var at=re[xe];at&&H(Y,at,xe,Ut)}return Y})}function ly(H){return function(Y,re,xe){for(var pt=-1,Ut=Object(Y),et=xe(Y),at=et.length;at--;){var Rt=et[H?at:++pt];if(re(Ut[Rt],Rt,Ut)===!1)break}return Y}}function qc(H,Y){var re=H.__data__;return Eh(Y)?re[typeof Y=="string"?"string":"hash"]:re.map}function Kc(H,Y){var re=vt(H,Y);return Hc(re)?re:void 0}function uy(H){var Y=un.call(H,$n),re=H[$n];try{H[$n]=void 0;var xe=!0}catch{}var pt=Pr.call(H);return xe&&(Y?H[$n]=re:delete H[$n]),pt}function Th(H){return typeof H.constructor=="function"&&!sa(H)?or(Rr(H)):{}}function cy(H,Y){var re=typeof H;return Y=Y??s,!!Y&&(re=="number"||re!="symbol"&&Z.test(H))&&H>-1&&H%1==0&&H<Y}function dy(H,Y,re){if(!Ho(re))return!1;var xe=typeof Y;return(xe=="number"?Qc(re)&&cy(Y,re.length):xe=="string"&&Y in re)?Yc(re[Y],H):!1}function Eh(H){var Y=typeof H;return Y=="string"||Y=="number"||Y=="symbol"||Y=="boolean"?H!=="__proto__":H===null}function Ah(H){return!!Gr&&Gr in H}function sa(H){var Y=H&&H.constructor,re=typeof Y=="function"&&Y.prototype||qt;return H===re}function fy(H){var Y=[];if(H!=null)for(var re in Object(H))Y.push(re);return Y}function hy(H){return Pr.call(H)}function k2(H,Y,re){return Y=uo(Y===void 0?H.length-1:Y,0),function(){for(var xe=arguments,pt=-1,Ut=uo(xe.length-Y,0),et=Array(Ut);++pt<Ut;)et[pt]=xe[Y+pt];pt=-1;for(var at=Array(Y+1);++pt<Y;)at[pt]=xe[pt];return at[Y]=re(et),Je(H,this,at)}}function Xc(H,Y){if(!(Y==="constructor"&&typeof H[Y]=="function")&&Y!="__proto__")return H[Y]}var py=gy(iy);function gy(H){var Y=0,re=0;return function(){var xe=ia(),pt=o-(xe-re);if(re=xe,pt>0){if(++Y>=i)return arguments[0]}else Y=0;return H.apply(void 0,arguments)}}function my(H){if(H!=null){try{return At.call(H)}catch{}try{return H+""}catch{}}return""}function Yc(H,Y){return H===Y||H!==H&&Y!==Y}var Ph=Cu(function(){return arguments}())?Cu:function(H){return Tu(H)&&un.call(H,"callee")&&!si.call(H,"callee")},Rh=Array.isArray;function Qc(H){return H!=null&&vy(H.length)&&!Oh(H)}function I2(H){return Tu(H)&&Qc(H)}var yy=ra||L2;function Oh(H){if(!Ho(H))return!1;var Y=rl(H);return Y==g||Y==m||Y==u||Y==y}function vy(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=s}function Ho(H){var Y=typeof H;return H!=null&&(Y=="object"||Y=="function")}function Tu(H){return H!=null&&typeof H=="object"}function M2(H){if(!Tu(H)||rl(H)!=b)return!1;var Y=Rr(H);if(Y===null)return!0;var re=un.call(Y,"constructor")&&Y.constructor;return typeof re=="function"&&re instanceof re&&At.call(re)==Ci}var _y=ye?Ae(ye):il;function N2(H){return ay(H,by(H))}function by(H){return Qc(H)?Sh(H,!0):A2(H)}var Jt=Wc(function(H,Y,re,xe){ry(H,Y,re,xe)});function Kt(H){return function(){return H}}function Sy(H){return H}function L2(){return!1}e.exports=Jt})(y_,y_.exports);var Y5e=y_.exports;const Us=Tc(Y5e);var Q5e=e=>/!(important)?$/.test(e),oI=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Z5e=(e,t)=>n=>{const r=String(t),i=Q5e(r),o=oI(r),s=e?`${e}.${o}`:o;let a=La(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=oI(a),i?`${a} !important`:a};function aA(e){const{scale:t,transform:n,compose:r}=e;return(o,s)=>{var a;const l=Z5e(t,o)(s);let u=(a=n==null?void 0:n(l,s))!=null?a:l;return r&&(u=r(u,s)),u}}var nv=(...e)=>t=>e.reduce((n,r)=>r(n),t);function So(e,t){return n=>{const r={property:n,scale:e};return r.transform=aA({scale:e,transform:t}),r}}var J5e=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function e4e(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:J5e(t),transform:n?aA({scale:n,compose:r}):r}}var AV=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function t4e(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...AV].join(" ")}function n4e(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...AV].join(" ")}var r4e={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},i4e={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function o4e(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var s4e={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},D5={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},a4e=new Set(Object.values(D5)),$5=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),l4e=e=>e.trim();function u4e(e,t){if(e==null||$5.has(e))return e;if(!(F5(e)||$5.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],s=i==null?void 0:i[2];if(!o||!s)return e;const a=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=s.split(",").map(l4e).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const d=l in D5?D5[l]:l;u.unshift(d);const f=u.map(h=>{if(a4e.has(h))return h;const g=h.indexOf(" "),[m,v]=g!==-1?[h.substr(0,g),h.substr(g+1)]:[h],x=F5(v)?v:v&&v.split(" "),_=`colors.${m}`,b=_ in t.__cssMap?t.__cssMap[_].varRef:m;return x?[b,...Array.isArray(x)?x:[x]].join(" "):b});return`${a}(${f.join(", ")})`}var F5=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),c4e=(e,t)=>u4e(e,t??{});function d4e(e){return/^var\(--.+\)$/.test(e)}var f4e=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Es=e=>t=>`${e}(${t})`,Ot={filter(e){return e!=="auto"?e:r4e},backdropFilter(e){return e!=="auto"?e:i4e},ring(e){return o4e(Ot.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?t4e():e==="auto-gpu"?n4e():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=f4e(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(d4e(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:c4e,blur:Es("blur"),opacity:Es("opacity"),brightness:Es("brightness"),contrast:Es("contrast"),dropShadow:Es("drop-shadow"),grayscale:Es("grayscale"),hueRotate:Es("hue-rotate"),invert:Es("invert"),saturate:Es("saturate"),sepia:Es("sepia"),bgImage(e){return e==null||F5(e)||$5.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=s4e[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},Q={borderWidths:So("borderWidths"),borderStyles:So("borderStyles"),colors:So("colors"),borders:So("borders"),gradients:So("gradients",Ot.gradient),radii:So("radii",Ot.px),space:So("space",nv(Ot.vh,Ot.px)),spaceT:So("space",nv(Ot.vh,Ot.px)),degreeT(e){return{property:e,transform:Ot.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:aA({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:So("sizes",nv(Ot.vh,Ot.px)),sizesT:So("sizes",nv(Ot.vh,Ot.fraction)),shadows:So("shadows"),logical:e4e,blur:So("blur",Ot.blur)},zv={background:Q.colors("background"),backgroundColor:Q.colors("backgroundColor"),backgroundImage:Q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Ot.bgClip},bgSize:Q.prop("backgroundSize"),bgPosition:Q.prop("backgroundPosition"),bg:Q.colors("background"),bgColor:Q.colors("backgroundColor"),bgPos:Q.prop("backgroundPosition"),bgRepeat:Q.prop("backgroundRepeat"),bgAttachment:Q.prop("backgroundAttachment"),bgGradient:Q.gradients("backgroundImage"),bgClip:{transform:Ot.bgClip}};Object.assign(zv,{bgImage:zv.backgroundImage,bgImg:zv.backgroundImage});var Lt={border:Q.borders("border"),borderWidth:Q.borderWidths("borderWidth"),borderStyle:Q.borderStyles("borderStyle"),borderColor:Q.colors("borderColor"),borderRadius:Q.radii("borderRadius"),borderTop:Q.borders("borderTop"),borderBlockStart:Q.borders("borderBlockStart"),borderTopLeftRadius:Q.radii("borderTopLeftRadius"),borderStartStartRadius:Q.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Q.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Q.radii("borderTopRightRadius"),borderStartEndRadius:Q.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Q.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Q.borders("borderRight"),borderInlineEnd:Q.borders("borderInlineEnd"),borderBottom:Q.borders("borderBottom"),borderBlockEnd:Q.borders("borderBlockEnd"),borderBottomLeftRadius:Q.radii("borderBottomLeftRadius"),borderBottomRightRadius:Q.radii("borderBottomRightRadius"),borderLeft:Q.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Q.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Q.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Q.borders(["borderLeft","borderRight"]),borderInline:Q.borders("borderInline"),borderY:Q.borders(["borderTop","borderBottom"]),borderBlock:Q.borders("borderBlock"),borderTopWidth:Q.borderWidths("borderTopWidth"),borderBlockStartWidth:Q.borderWidths("borderBlockStartWidth"),borderTopColor:Q.colors("borderTopColor"),borderBlockStartColor:Q.colors("borderBlockStartColor"),borderTopStyle:Q.borderStyles("borderTopStyle"),borderBlockStartStyle:Q.borderStyles("borderBlockStartStyle"),borderBottomWidth:Q.borderWidths("borderBottomWidth"),borderBlockEndWidth:Q.borderWidths("borderBlockEndWidth"),borderBottomColor:Q.colors("borderBottomColor"),borderBlockEndColor:Q.colors("borderBlockEndColor"),borderBottomStyle:Q.borderStyles("borderBottomStyle"),borderBlockEndStyle:Q.borderStyles("borderBlockEndStyle"),borderLeftWidth:Q.borderWidths("borderLeftWidth"),borderInlineStartWidth:Q.borderWidths("borderInlineStartWidth"),borderLeftColor:Q.colors("borderLeftColor"),borderInlineStartColor:Q.colors("borderInlineStartColor"),borderLeftStyle:Q.borderStyles("borderLeftStyle"),borderInlineStartStyle:Q.borderStyles("borderInlineStartStyle"),borderRightWidth:Q.borderWidths("borderRightWidth"),borderInlineEndWidth:Q.borderWidths("borderInlineEndWidth"),borderRightColor:Q.colors("borderRightColor"),borderInlineEndColor:Q.colors("borderInlineEndColor"),borderRightStyle:Q.borderStyles("borderRightStyle"),borderInlineEndStyle:Q.borderStyles("borderInlineEndStyle"),borderTopRadius:Q.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Q.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Q.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Q.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Lt,{rounded:Lt.borderRadius,roundedTop:Lt.borderTopRadius,roundedTopLeft:Lt.borderTopLeftRadius,roundedTopRight:Lt.borderTopRightRadius,roundedTopStart:Lt.borderStartStartRadius,roundedTopEnd:Lt.borderStartEndRadius,roundedBottom:Lt.borderBottomRadius,roundedBottomLeft:Lt.borderBottomLeftRadius,roundedBottomRight:Lt.borderBottomRightRadius,roundedBottomStart:Lt.borderEndStartRadius,roundedBottomEnd:Lt.borderEndEndRadius,roundedLeft:Lt.borderLeftRadius,roundedRight:Lt.borderRightRadius,roundedStart:Lt.borderInlineStartRadius,roundedEnd:Lt.borderInlineEndRadius,borderStart:Lt.borderInlineStart,borderEnd:Lt.borderInlineEnd,borderTopStartRadius:Lt.borderStartStartRadius,borderTopEndRadius:Lt.borderStartEndRadius,borderBottomStartRadius:Lt.borderEndStartRadius,borderBottomEndRadius:Lt.borderEndEndRadius,borderStartRadius:Lt.borderInlineStartRadius,borderEndRadius:Lt.borderInlineEndRadius,borderStartWidth:Lt.borderInlineStartWidth,borderEndWidth:Lt.borderInlineEndWidth,borderStartColor:Lt.borderInlineStartColor,borderEndColor:Lt.borderInlineEndColor,borderStartStyle:Lt.borderInlineStartStyle,borderEndStyle:Lt.borderInlineEndStyle});var h4e={color:Q.colors("color"),textColor:Q.colors("color"),fill:Q.colors("fill"),stroke:Q.colors("stroke")},B5={boxShadow:Q.shadows("boxShadow"),mixBlendMode:!0,blendMode:Q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Q.prop("backgroundBlendMode"),opacity:!0};Object.assign(B5,{shadow:B5.boxShadow});var p4e={filter:{transform:Ot.filter},blur:Q.blur("--chakra-blur"),brightness:Q.propT("--chakra-brightness",Ot.brightness),contrast:Q.propT("--chakra-contrast",Ot.contrast),hueRotate:Q.degreeT("--chakra-hue-rotate"),invert:Q.propT("--chakra-invert",Ot.invert),saturate:Q.propT("--chakra-saturate",Ot.saturate),dropShadow:Q.propT("--chakra-drop-shadow",Ot.dropShadow),backdropFilter:{transform:Ot.backdropFilter},backdropBlur:Q.blur("--chakra-backdrop-blur"),backdropBrightness:Q.propT("--chakra-backdrop-brightness",Ot.brightness),backdropContrast:Q.propT("--chakra-backdrop-contrast",Ot.contrast),backdropHueRotate:Q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:Q.propT("--chakra-backdrop-invert",Ot.invert),backdropSaturate:Q.propT("--chakra-backdrop-saturate",Ot.saturate)},v_={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Ot.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Q.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Q.space("gap"),rowGap:Q.space("rowGap"),columnGap:Q.space("columnGap")};Object.assign(v_,{flexDir:v_.flexDirection});var PV={gridGap:Q.space("gridGap"),gridColumnGap:Q.space("gridColumnGap"),gridRowGap:Q.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},g4e={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Ot.outline},outlineOffset:!0,outlineColor:Q.colors("outlineColor")},xo={width:Q.sizesT("width"),inlineSize:Q.sizesT("inlineSize"),height:Q.sizes("height"),blockSize:Q.sizes("blockSize"),boxSize:Q.sizes(["width","height"]),minWidth:Q.sizes("minWidth"),minInlineSize:Q.sizes("minInlineSize"),minHeight:Q.sizes("minHeight"),minBlockSize:Q.sizes("minBlockSize"),maxWidth:Q.sizes("maxWidth"),maxInlineSize:Q.sizes("maxInlineSize"),maxHeight:Q.sizes("maxHeight"),maxBlockSize:Q.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (min-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?i:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (max-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?i:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Q.propT("float",Ot.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(xo,{w:xo.width,h:xo.height,minW:xo.minWidth,maxW:xo.maxWidth,minH:xo.minHeight,maxH:xo.maxHeight,overscroll:xo.overscrollBehavior,overscrollX:xo.overscrollBehaviorX,overscrollY:xo.overscrollBehaviorY});var m4e={listStyleType:!0,listStylePosition:!0,listStylePos:Q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Q.prop("listStyleImage")};function y4e(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var v4e=e=>{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},_4e=v4e(y4e),b4e={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},S4e={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},aC=(e,t,n)=>{const r={},i=_4e(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},w4e={srOnly:{transform(e){return e===!0?b4e:e==="focusable"?S4e:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>aC(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>aC(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>aC(t,e,n)}},Gp={position:!0,pos:Q.prop("position"),zIndex:Q.prop("zIndex","zIndices"),inset:Q.spaceT("inset"),insetX:Q.spaceT(["left","right"]),insetInline:Q.spaceT("insetInline"),insetY:Q.spaceT(["top","bottom"]),insetBlock:Q.spaceT("insetBlock"),top:Q.spaceT("top"),insetBlockStart:Q.spaceT("insetBlockStart"),bottom:Q.spaceT("bottom"),insetBlockEnd:Q.spaceT("insetBlockEnd"),left:Q.spaceT("left"),insetInlineStart:Q.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:Q.spaceT("right"),insetInlineEnd:Q.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Gp,{insetStart:Gp.insetInlineStart,insetEnd:Gp.insetInlineEnd});var x4e={ring:{transform:Ot.ring},ringColor:Q.colors("--chakra-ring-color"),ringOffset:Q.prop("--chakra-ring-offset-width"),ringOffsetColor:Q.colors("--chakra-ring-offset-color"),ringInset:Q.prop("--chakra-ring-inset")},dn={margin:Q.spaceT("margin"),marginTop:Q.spaceT("marginTop"),marginBlockStart:Q.spaceT("marginBlockStart"),marginRight:Q.spaceT("marginRight"),marginInlineEnd:Q.spaceT("marginInlineEnd"),marginBottom:Q.spaceT("marginBottom"),marginBlockEnd:Q.spaceT("marginBlockEnd"),marginLeft:Q.spaceT("marginLeft"),marginInlineStart:Q.spaceT("marginInlineStart"),marginX:Q.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:Q.spaceT("marginInline"),marginY:Q.spaceT(["marginTop","marginBottom"]),marginBlock:Q.spaceT("marginBlock"),padding:Q.space("padding"),paddingTop:Q.space("paddingTop"),paddingBlockStart:Q.space("paddingBlockStart"),paddingRight:Q.space("paddingRight"),paddingBottom:Q.space("paddingBottom"),paddingBlockEnd:Q.space("paddingBlockEnd"),paddingLeft:Q.space("paddingLeft"),paddingInlineStart:Q.space("paddingInlineStart"),paddingInlineEnd:Q.space("paddingInlineEnd"),paddingX:Q.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:Q.space("paddingInline"),paddingY:Q.space(["paddingTop","paddingBottom"]),paddingBlock:Q.space("paddingBlock")};Object.assign(dn,{m:dn.margin,mt:dn.marginTop,mr:dn.marginRight,me:dn.marginInlineEnd,marginEnd:dn.marginInlineEnd,mb:dn.marginBottom,ml:dn.marginLeft,ms:dn.marginInlineStart,marginStart:dn.marginInlineStart,mx:dn.marginX,my:dn.marginY,p:dn.padding,pt:dn.paddingTop,py:dn.paddingY,px:dn.paddingX,pb:dn.paddingBottom,pl:dn.paddingLeft,ps:dn.paddingInlineStart,paddingStart:dn.paddingInlineStart,pr:dn.paddingRight,pe:dn.paddingInlineEnd,paddingEnd:dn.paddingInlineEnd});var C4e={textDecorationColor:Q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:Q.shadows("textShadow")},T4e={clipPath:!0,transform:Q.propT("transform",Ot.transform),transformOrigin:!0,translateX:Q.spaceT("--chakra-translate-x"),translateY:Q.spaceT("--chakra-translate-y"),skewX:Q.degreeT("--chakra-skew-x"),skewY:Q.degreeT("--chakra-skew-y"),scaleX:Q.prop("--chakra-scale-x"),scaleY:Q.prop("--chakra-scale-y"),scale:Q.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:Q.degreeT("--chakra-rotate")},E4e={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:Q.prop("transitionDuration","transition.duration"),transitionProperty:Q.prop("transitionProperty","transition.property"),transitionTimingFunction:Q.prop("transitionTimingFunction","transition.easing")},A4e={fontFamily:Q.prop("fontFamily","fonts"),fontSize:Q.prop("fontSize","fontSizes",Ot.px),fontWeight:Q.prop("fontWeight","fontWeights"),lineHeight:Q.prop("lineHeight","lineHeights"),letterSpacing:Q.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},P4e={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:Q.spaceT("scrollMargin"),scrollMarginTop:Q.spaceT("scrollMarginTop"),scrollMarginBottom:Q.spaceT("scrollMarginBottom"),scrollMarginLeft:Q.spaceT("scrollMarginLeft"),scrollMarginRight:Q.spaceT("scrollMarginRight"),scrollMarginX:Q.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:Q.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:Q.spaceT("scrollPadding"),scrollPaddingTop:Q.spaceT("scrollPaddingTop"),scrollPaddingBottom:Q.spaceT("scrollPaddingBottom"),scrollPaddingLeft:Q.spaceT("scrollPaddingLeft"),scrollPaddingRight:Q.spaceT("scrollPaddingRight"),scrollPaddingX:Q.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:Q.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function RV(e){return La(e)&&e.reference?e.reference:String(e)}var h2=(e,...t)=>t.map(RV).join(` ${e} `).replace(/calc/g,""),sI=(...e)=>`calc(${h2("+",...e)})`,aI=(...e)=>`calc(${h2("-",...e)})`,U5=(...e)=>`calc(${h2("*",...e)})`,lI=(...e)=>`calc(${h2("/",...e)})`,uI=e=>{const t=RV(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:U5(t,-1)},Wu=Object.assign(e=>({add:(...t)=>Wu(sI(e,...t)),subtract:(...t)=>Wu(aI(e,...t)),multiply:(...t)=>Wu(U5(e,...t)),divide:(...t)=>Wu(lI(e,...t)),negate:()=>Wu(uI(e)),toString:()=>e.toString()}),{add:sI,subtract:aI,multiply:U5,divide:lI,negate:uI});function R4e(e,t="-"){return e.replace(/\s+/g,t)}function O4e(e){const t=R4e(e.toString());return I4e(k4e(t))}function k4e(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function I4e(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function M4e(e,t=""){return[t,e].filter(Boolean).join("-")}function N4e(e,t){return`var(${e}${t?`, ${t}`:""})`}function L4e(e,t=""){return O4e(`--${M4e(e,t)}`)}function z5(e,t,n){const r=L4e(e,n);return{variable:r,reference:N4e(r,t)}}function UMe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=z5(`${e}-${i}`,o);continue}n[r]=z5(`${e}-${r}`)}return n}function D4e(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function $4e(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function V5(e){if(e==null)return e;const{unitless:t}=$4e(e);return t||typeof e=="number"?`${e}px`:e}var OV=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,lA=e=>Object.fromEntries(Object.entries(e).sort(OV));function cI(e){const t=lA(e);return Object.assign(Object.values(t),t)}function F4e(e){const t=Object.keys(lA(e));return new Set(t)}function dI(e){var t;if(!e)return e;e=(t=V5(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Rp(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${V5(e)})`),t&&n.push("and",`(max-width: ${V5(t)})`),n.join(" ")}function B4e(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=cI(e),r=Object.entries(e).sort(OV).map(([s,a],l,u)=>{var d;let[,f]=(d=u[l+1])!=null?d:[];return f=parseFloat(f)>0?dI(f):void 0,{_minW:dI(a),breakpoint:s,minW:a,maxW:f,maxWQuery:Rp(null,f),minWQuery:Rp(a),minMaxQuery:Rp(a,f)}}),i=F4e(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(s){const a=Object.keys(s);return a.length>0&&a.every(l=>i.has(l))},asObject:lA(e),asArray:cI(e),details:r,get(s){return r.find(a=>a.breakpoint===s)},media:[null,...n.map(s=>Rp(s)).slice(1)],toArrayValue(s){if(!La(s))throw new Error("toArrayValue: value must be an object");const a=o.map(l=>{var u;return(u=s[l])!=null?u:null});for(;D4e(a)===null;)a.pop();return a},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((a,l,u)=>{const d=o[u];return d!=null&&l!=null&&(a[d]=l),a},{})}}}var Dr={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},vl=e=>kV(t=>e(t,"&"),"[role=group]","[data-group]",".group"),ba=e=>kV(t=>e(t,"~ &"),"[data-peer]",".peer"),kV=(e,...t)=>t.map(e).join(", "),p2={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:vl(Dr.hover),_peerHover:ba(Dr.hover),_groupFocus:vl(Dr.focus),_peerFocus:ba(Dr.focus),_groupFocusVisible:vl(Dr.focusVisible),_peerFocusVisible:ba(Dr.focusVisible),_groupActive:vl(Dr.active),_peerActive:ba(Dr.active),_groupDisabled:vl(Dr.disabled),_peerDisabled:ba(Dr.disabled),_groupInvalid:vl(Dr.invalid),_peerInvalid:ba(Dr.invalid),_groupChecked:vl(Dr.checked),_peerChecked:ba(Dr.checked),_groupFocusWithin:vl(Dr.focusWithin),_peerFocusWithin:ba(Dr.focusWithin),_peerPlaceholderShown:ba(Dr.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},IV=Object.keys(p2);function fI(e,t){return z5(String(e).replace(/\./g,"-"),void 0,t)}function U4e(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:s,value:a}=o,{variable:l,reference:u}=fI(i,t==null?void 0:t.cssVarPrefix);if(!s){if(i.startsWith("space")){const h=i.split("."),[g,...m]=h,v=`${g}.-${m.join(".")}`,x=Wu.negate(a),_=Wu.negate(u);r[v]={value:x,var:l,varRef:_}}n[l]=a,r[i]={value:a,var:l,varRef:u};continue}const d=h=>{const m=[String(i).split(".")[0],h].join(".");if(!e[m])return h;const{reference:x}=fI(m,t==null?void 0:t.cssVarPrefix);return x},f=La(a)?a:{default:a};n=Us(n,Object.entries(f).reduce((h,[g,m])=>{var v,x;if(!m)return h;const _=d(`${m}`);if(g==="default")return h[l]=_,h;const b=(x=(v=p2)==null?void 0:v[g])!=null?x:g;return h[b]={[l]:_},h},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function z4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function V4e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function j4e(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function hI(e,t,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){var l;if(j4e(s)||Array.isArray(s)){const u={};for(const[d,f]of Object.entries(s)){const h=(l=i==null?void 0:i(d))!=null?l:d,g=[...a,h];if(r!=null&&r(s,g))return t(s,a);u[h]=o(f,g)}return u}return t(s,a)}return o(e)}var G4e=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function H4e(e){return V4e(e,G4e)}function W4e(e){return e.semanticTokens}function q4e(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var K4e=e=>IV.includes(e)||e==="default";function X4e({tokens:e,semanticTokens:t}){const n={};return hI(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),hI(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(K4e)}),n}function zMe(e){var t;const n=q4e(e),r=H4e(n),i=W4e(n),o=X4e({tokens:r,semanticTokens:i}),s=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:a,cssVars:l}=U4e(o,{cssVarPrefix:s});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:a,__breakpoints:B4e(n.breakpoints)}),n}var uA=Us({},zv,Lt,h4e,v_,xo,p4e,x4e,g4e,PV,w4e,Gp,B5,dn,P4e,A4e,C4e,T4e,m4e,E4e),Y4e=Object.assign({},dn,xo,v_,PV,Gp),VMe=Object.keys(Y4e),Q4e=[...Object.keys(uA),...IV],Z4e={...uA,...p2},J4e=e=>e in Z4e,eTe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const s in e){let a=Ju(e[s],t);if(a==null)continue;if(a=La(a)&&n(a)?r(a):a,!Array.isArray(a)){o[s]=a;continue}const l=a.slice(0,i.length).length;for(let u=0;u<l;u+=1){const d=i==null?void 0:i[u];if(!d){o[s]=a[u];continue}o[d]=o[d]||{},a[u]!=null&&(o[d][s]=a[u])}}return o};function tTe(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const o=e[i];o==="("?(r=!0,n+=o):o===")"?(r=!1,n+=o):o===","&&!r?(t.push(n),n=""):n+=o}return n=n.trim(),n&&t.push(n),t}function nTe(e){return/^var\(--.+\)$/.test(e)}var rTe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!nTe(t),iTe=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,d;return(d=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:d.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[s,a]=tTe(t);return t=(r=(n=i(s))!=null?n:o(a))!=null?r:o(t),t};function oTe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,s=!1)=>{var a,l,u;const d=Ju(o,r),f=eTe(d)(r);let h={};for(let g in f){const m=f[g];let v=Ju(m,r);g in n&&(g=n[g]),rTe(g,v)&&(v=iTe(r,v));let x=t[g];if(x===!0&&(x={property:g}),La(v)){h[g]=(a=h[g])!=null?a:{},h[g]=Us({},h[g],i(v,!0));continue}let _=(u=(l=x==null?void 0:x.transform)==null?void 0:l.call(x,v,r,d))!=null?u:v;_=x!=null&&x.processResult?i(_,!0):_;const b=Ju(x==null?void 0:x.property,r);if(!s&&(x!=null&&x.static)){const y=Ju(x.static,r);h=Us({},h,y)}if(b&&Array.isArray(b)){for(const y of b)h[y]=_;continue}if(b){b==="&"&&La(_)?h=Us({},h,_):h[b]=_;continue}if(La(_)){h=Us({},h,_);continue}h[g]=_}return h};return i}var sTe=e=>t=>oTe({theme:t,pseudos:p2,configs:uA})(e);function jMe(e){return e}function GMe(e){return e}function HMe(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function aTe(e,t){if(Array.isArray(e))return e;if(La(e))return t(e);if(e!=null)return[e]}function lTe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function uTe(e){const t=e.__breakpoints;return function(r,i,o,s){var a,l;if(!t)return;const u={},d=aTe(o,t.toArrayValue);if(!d)return u;const f=d.length,h=f===1,g=!!r.parts;for(let m=0;m<f;m++){const v=t.details[m],x=t.details[lTe(d,m)],_=Rp(v.minW,x==null?void 0:x._minW),b=Ju((a=r[i])==null?void 0:a[d[m]],s);if(b){if(g){(l=r.parts)==null||l.forEach(y=>{Us(u,{[y]:h?b[y]:{[_]:b[y]}})});continue}if(!g){h?Us(u,b):u[_]=b;continue}u[_]=b}}return u}}function cTe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,s=uTe(o);return Us({},Ju((n=e.baseStyle)!=null?n:{},t),s(e,"sizes",i,t),s(e,"variants",r,t))}}function WMe(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function MV(e){return z4e(e,["styleConfig","size","variant","colorScheme"])}function dTe(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function fTe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var hTe=e=>{const t=new WeakMap;return(r,i,o,s)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(i))return a.get(i);const l=e(r,i,o,s);return a.set(i,l),l}},pTe=hTe(fTe);function NV(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var LV=e=>NV(e,t=>t!=null);function gTe(e){return typeof e=="function"}function mTe(e,...t){return gTe(e)?e(...t):e}function qMe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var yTe=typeof Element<"u",vTe=typeof Map=="function",_Te=typeof Set=="function",bTe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Vv(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Vv(e[r],t[r]))return!1;return!0}var o;if(vTe&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Vv(r.value[1],t.get(r.value[0])))return!1;return!0}if(_Te&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(bTe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(yTe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!Vv(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var STe=function(t,n){try{return Vv(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const wTe=Tc(STe);function DV(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:s}=G5e(),a=e?pTe(o,`components.${e}`):void 0,l=r||a,u=Us({theme:o,colorMode:s},(n=l==null?void 0:l.defaultProps)!=null?n:{},LV(dTe(i,["children"]))),d=L.useRef({});if(l){const h=cTe(l)(u);wTe(d.current,h)||(d.current=h)}return d.current}function $V(e,t={}){return DV(e,t)}function KMe(e,t={}){return DV(e,t)}var xTe=new Set([...Q4e,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),CTe=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function TTe(e){return CTe.has(e)||!xTe.has(e)}function ETe(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}var ATe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,PTe=mV(function(e){return ATe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),RTe=PTe,OTe=function(t){return t!=="theme"},pI=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?RTe:OTe},gI=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(s){return t.__emotion_forwardProp(s)&&o(s)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},kTe=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return vV(n,r,i),F5e(function(){return _V(n,r,i)}),null},ITe=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,s;n!==void 0&&(o=n.label,s=n.target);var a=gI(t,n,r),l=a||pI(i),u=!l("as");return function(){var d=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)f.push.apply(f,d);else{f.push(d[0][0]);for(var h=d.length,g=1;g<h;g++)f.push(d[g],d[0][g])}var m=xV(function(v,x,_){var b=u&&v.as||i,y="",S=[],C=v;if(v.theme==null){C={};for(var T in v)C[T]=v[T];C.theme=L.useContext(tm)}typeof v.className=="string"?y=k5e(x.registered,S,v.className):v.className!=null&&(y=v.className+" ");var E=oA(f.concat(S),x.registered,C);y+=x.key+"-"+E.name,s!==void 0&&(y+=" "+s);var P=u&&a===void 0?pI(b):l,k={};for(var O in v)u&&O==="as"||P(O)&&(k[O]=v[O]);return k.className=y,k.ref=_,L.createElement(L.Fragment,null,L.createElement(kTe,{cache:x,serialized:E,isStringTag:typeof b=="string"}),L.createElement(b,k))});return m.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=i,m.__emotion_styles=f,m.__emotion_forwardProp=a,Object.defineProperty(m,"toString",{value:function(){return"."+s}}),m.withComponent=function(v,x){return e(v,U1({},n,x,{shouldForwardProp:gI(m,x,!0)})).apply(void 0,f)},m}},MTe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],__=ITe.bind();MTe.forEach(function(e){__[e]=__(e)});var mI,NTe=(mI=__.default)!=null?mI:__,LTe=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...s}=t,a=NV(s,(f,h)=>J4e(h)),l=mTe(e,t),u=ETe({},i,l,LV(a),o),d=sTe(u)(t.theme);return r?[d,r]:d};function lC(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=TTe);const i=LTe({baseStyle:n}),o=NTe(e,r)(i);return jt.forwardRef(function(l,u){const{colorMode:d,forced:f}=sA();return jt.createElement(o,{ref:u,"data-theme":f?d:void 0,...l})})}function DTe(){const e=new Map;return new Proxy(lC,{apply(t,n,r){return lC(...r)},get(t,n){return e.has(n)||e.set(n,lC(n)),e.get(n)}})}var Cc=DTe();function zc(e){return L.forwardRef(e)}const FV=L.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),g2=L.createContext({}),Km=L.createContext(null),m2=typeof document<"u",b_=m2?L.useLayoutEffect:L.useEffect,BV=L.createContext({strict:!1});function $Te(e,t,n,r){const{visualElement:i}=L.useContext(g2),o=L.useContext(BV),s=L.useContext(Km),a=L.useContext(FV).reducedMotion,l=L.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;return L.useInsertionEffect(()=>{u&&u.update(n,s)}),b_(()=>{u&&u.render()}),L.useEffect(()=>{u&&u.updateFeatures()}),(window.HandoffAppearAnimations?b_:L.useEffect)(()=>{u&&u.animationState&&u.animationState.animateChanges()}),u}function Xd(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FTe(e,t,n){return L.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Xd(n)&&(n.current=r))},[t])}function nm(e){return typeof e=="string"||Array.isArray(e)}function y2(e){return typeof e=="object"&&typeof e.start=="function"}const cA=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dA=["initial",...cA];function v2(e){return y2(e.animate)||dA.some(t=>nm(e[t]))}function UV(e){return!!(v2(e)||e.variants)}function BTe(e,t){if(v2(e)){const{initial:n,animate:r}=e;return{initial:n===!1||nm(n)?n:void 0,animate:nm(r)?r:void 0}}return e.inherit!==!1?t:{}}function UTe(e){const{initial:t,animate:n}=BTe(e,L.useContext(g2));return L.useMemo(()=>({initial:t,animate:n}),[yI(t),yI(n)])}function yI(e){return Array.isArray(e)?e.join(" "):e}const vI={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rm={};for(const e in vI)rm[e]={isEnabled:t=>vI[e].some(n=>!!t[n])};function zTe(e){for(const t in e)rm[t]={...rm[t],...e[t]}}const fA=L.createContext({}),zV=L.createContext({}),VTe=Symbol.for("motionComponentSymbol");function jTe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&zTe(e);function o(a,l){let u;const d={...L.useContext(FV),...a,layoutId:GTe(a)},{isStatic:f}=d,h=UTe(a),g=r(a,f);if(!f&&m2){h.visualElement=$Te(i,g,d,t);const m=L.useContext(zV),v=L.useContext(BV).strict;h.visualElement&&(u=h.visualElement.loadFeatures(d,v,e,m))}return L.createElement(g2.Provider,{value:h},u&&h.visualElement?L.createElement(u,{visualElement:h.visualElement,...d}):null,n(i,a,FTe(g,h.visualElement,l),g,f,h.visualElement))}const s=L.forwardRef(o);return s[VTe]=i,s}function GTe({layoutId:e}){const t=L.useContext(fA).id;return t&&e!==void 0?t+"-"+e:e}function HTe(e){function t(r,i={}){return jTe(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const WTe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hA(e){return typeof e!="string"||e.includes("-")?!1:!!(WTe.indexOf(e)>-1||/[A-Z]/.test(e))}const S_={};function qTe(e){Object.assign(S_,e)}const Xm=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vc=new Set(Xm);function VV(e,{layout:t,layoutId:n}){return Vc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!S_[e]||e==="opacity")}const zi=e=>!!(e&&e.getVelocity),KTe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},XTe=Xm.length;function YTe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let s=0;s<XTe;s++){const a=Xm[s];if(e[a]!==void 0){const l=KTe[a]||a;o+=`${l}(${e[a]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const jV=e=>t=>typeof t=="string"&&t.startsWith(e),GV=jV("--"),j5=jV("var(--"),QTe=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,ZTe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,au=(e,t,n)=>Math.min(Math.max(n,e),t),jc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hp={...jc,transform:e=>au(0,1,e)},rv={...jc,default:1},Wp=e=>Math.round(e*1e5)/1e5,_2=/(-)?([\d]*\.?[\d])+/g,HV=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,JTe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ym(e){return typeof e=="string"}const Qm=e=>({test:t=>Ym(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),bl=Qm("deg"),qs=Qm("%"),He=Qm("px"),eEe=Qm("vh"),tEe=Qm("vw"),_I={...qs,parse:e=>qs.parse(e)/100,transform:e=>qs.transform(e*100)},bI={...jc,transform:Math.round},WV={borderWidth:He,borderTopWidth:He,borderRightWidth:He,borderBottomWidth:He,borderLeftWidth:He,borderRadius:He,radius:He,borderTopLeftRadius:He,borderTopRightRadius:He,borderBottomRightRadius:He,borderBottomLeftRadius:He,width:He,maxWidth:He,height:He,maxHeight:He,size:He,top:He,right:He,bottom:He,left:He,padding:He,paddingTop:He,paddingRight:He,paddingBottom:He,paddingLeft:He,margin:He,marginTop:He,marginRight:He,marginBottom:He,marginLeft:He,rotate:bl,rotateX:bl,rotateY:bl,rotateZ:bl,scale:rv,scaleX:rv,scaleY:rv,scaleZ:rv,skew:bl,skewX:bl,skewY:bl,distance:He,translateX:He,translateY:He,translateZ:He,x:He,y:He,z:He,perspective:He,transformPerspective:He,opacity:Hp,originX:_I,originY:_I,originZ:He,zIndex:bI,fillOpacity:Hp,strokeOpacity:Hp,numOctaves:bI};function pA(e,t,n,r){const{style:i,vars:o,transform:s,transformOrigin:a}=e;let l=!1,u=!1,d=!0;for(const f in t){const h=t[f];if(GV(f)){o[f]=h;continue}const g=WV[f],m=ZTe(h,g);if(Vc.has(f)){if(l=!0,s[f]=m,!d)continue;h!==(g.default||0)&&(d=!1)}else f.startsWith("origin")?(u=!0,a[f]=m):i[f]=m}if(t.transform||(l||r?i.transform=YTe(e.transform,n,d,r):i.transform&&(i.transform="none")),u){const{originX:f="50%",originY:h="50%",originZ:g=0}=a;i.transformOrigin=`${f} ${h} ${g}`}}const gA=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qV(e,t,n){for(const r in t)!zi(t[r])&&!VV(r,n)&&(e[r]=t[r])}function nEe({transformTemplate:e},t,n){return L.useMemo(()=>{const r=gA();return pA(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function rEe(e,t,n){const r=e.style||{},i={};return qV(i,r,e),Object.assign(i,nEe(e,t,n)),e.transformValues?e.transformValues(i):i}function iEe(e,t,n){const r={},i=rEe(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const oEe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function w_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||oEe.has(e)}let KV=e=>!w_(e);function sEe(e){e&&(KV=t=>t.startsWith("on")?!w_(t):e(t))}try{sEe(require("@emotion/is-prop-valid").default)}catch{}function aEe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(KV(i)||n===!0&&w_(i)||!t&&!w_(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function SI(e,t,n){return typeof e=="string"?e:He.transform(t+n*e)}function lEe(e,t,n){const r=SI(t,e.x,e.width),i=SI(n,e.y,e.height);return`${r} ${i}`}const uEe={offset:"stroke-dashoffset",array:"stroke-dasharray"},cEe={offset:"strokeDashoffset",array:"strokeDasharray"};function dEe(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?uEe:cEe;e[o.offset]=He.transform(-r);const s=He.transform(t),a=He.transform(n);e[o.array]=`${s} ${a}`}function mA(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},d,f,h){if(pA(e,u,d,h),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:m,dimensions:v}=e;g.transform&&(v&&(m.transform=g.transform),delete g.transform),v&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=lEe(v,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),s!==void 0&&dEe(g,s,a,l,!1)}const XV=()=>({...gA(),attrs:{}}),yA=e=>typeof e=="string"&&e.toLowerCase()==="svg";function fEe(e,t,n,r){const i=L.useMemo(()=>{const o=XV();return mA(o,t,{enableHardwareAcceleration:!1},yA(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};qV(o,e.style,e),i.style={...o,...i.style}}return i}function hEe(e=!1){return(n,r,i,{latestValues:o},s)=>{const l=(hA(n)?fEe:iEe)(r,o,s,n),d={...aEe(r,typeof n=="string",e),...l,ref:i},{children:f}=r,h=L.useMemo(()=>zi(f)?f.get():f,[f]);return L.createElement(n,{...d,children:h})}}const vA=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function YV(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const QV=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ZV(e,t,n,r){YV(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(QV.has(i)?i:vA(i),t.attrs[i])}function _A(e,t){const{style:n}=e,r={};for(const i in n)(zi(n[i])||t.style&&zi(t.style[i])||VV(i,e))&&(r[i]=n[i]);return r}function JV(e,t){const n=_A(e,t);for(const r in e)if(zi(e[r])||zi(t[r])){const i=Xm.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function bA(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function ej(e){const t=L.useRef(null);return t.current===null&&(t.current=e()),t.current}const x_=e=>Array.isArray(e),pEe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),gEe=e=>x_(e)?e[e.length-1]||0:e;function jv(e){const t=zi(e)?e.get():e;return pEe(t)?t.toValue():t}function mEe({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const s={latestValues:yEe(r,i,o,e),renderState:t()};return n&&(s.mount=a=>n(r,a,s)),s}const tj=e=>(t,n)=>{const r=L.useContext(g2),i=L.useContext(Km),o=()=>mEe(e,t,r,i);return n?o():ej(o)};function yEe(e,t,n,r){const i={},o=r(e,{});for(const h in o)i[h]=jv(o[h]);let{initial:s,animate:a}=e;const l=v2(e),u=UV(e);t&&u&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||s===!1;const f=d?a:s;return f&&typeof f!="boolean"&&!y2(f)&&(Array.isArray(f)?f:[f]).forEach(g=>{const m=bA(e,g);if(!m)return;const{transitionEnd:v,transition:x,..._}=m;for(const b in _){let y=_[b];if(Array.isArray(y)){const S=d?y.length-1:0;y=y[S]}y!==null&&(i[b]=y)}for(const b in v)i[b]=v[b]}),i}const vEe={useVisualState:tj({scrapeMotionValuesFromProps:JV,createRenderState:XV,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}mA(n,r,{enableHardwareAcceleration:!1},yA(t.tagName),e.transformTemplate),ZV(t,n)}})},_Ee={useVisualState:tj({scrapeMotionValuesFromProps:_A,createRenderState:gA})};function bEe(e,{forwardMotionProps:t=!1},n,r){return{...hA(e)?vEe:_Ee,preloadedFeatures:n,useRender:hEe(t),createVisualElement:r,Component:e}}function ka(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const nj=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function b2(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const SEe=e=>t=>nj(t)&&e(t,b2(t));function Da(e,t,n,r){return ka(e,t,SEe(n),r)}const wEe=(e,t)=>n=>t(e(n)),ql=(...e)=>e.reduce(wEe);function rj(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const wI=rj("dragHorizontal"),xI=rj("dragVertical");function ij(e){let t=!1;if(e==="y")t=xI();else if(e==="x")t=wI();else{const n=wI(),r=xI();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function oj(){const e=ij(!0);return e?(e(),!1):!0}class xu{constructor(t){this.isMounted=!1,this.node=t}update(){}}const tr=e=>e;function xEe(e){let t=[],n=[],r=0,i=!1,o=!1;const s=new WeakSet,a={schedule:(l,u=!1,d=!1)=>{const f=d&&i,h=f?t:n;return u&&s.add(l),h.indexOf(l)===-1&&(h.push(l),f&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),s.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u<r;u++){const d=t[u];d(l),s.has(d)&&(a.schedule(d),e())}i=!1,o&&(o=!1,a.process(l))}};return a}const iv=["prepare","read","update","preRender","render","postRender"],CEe=40;function TEe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=iv.reduce((f,h)=>(f[h]=xEe(()=>n=!0),f),{}),s=f=>o[f].process(i),a=f=>{n=!1,i.delta=r?1e3/60:Math.max(Math.min(f-i.timestamp,CEe),1),i.timestamp=f,i.isProcessing=!0,iv.forEach(s),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:iv.reduce((f,h)=>{const g=o[h];return f[h]=(m,v=!1,x=!1)=>(n||l(),g.schedule(m,v,x)),f},{}),cancel:f=>iv.forEach(h=>o[h].cancel(f)),state:i,steps:o}}const{schedule:Sn,cancel:Wa,state:Zr,steps:uC}=TEe(typeof requestAnimationFrame<"u"?requestAnimationFrame:tr,!0);function CI(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,s)=>{if(o.type==="touch"||oj())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&Sn.update(()=>a[r](o,s))};return Da(e.current,n,i,{passive:!e.getProps()[r]})}class EEe extends xu{mount(){this.unmount=ql(CI(this.node,!0),CI(this.node,!1))}unmount(){}}class AEe extends xu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ql(ka(this.node.current,"focus",()=>this.onFocus()),ka(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const sj=(e,t)=>t?e===t?!0:sj(e,t.parentElement):!1;function cC(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,b2(n))}class PEe extends xu{constructor(){super(...arguments),this.removeStartListeners=tr,this.removeEndListeners=tr,this.removeAccessibleListeners=tr,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Da(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:d}=this.node.getProps();Sn.update(()=>{sj(this.node.current,a.target)?u&&u(a,l):d&&d(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),s=Da(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=ql(o,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||cC("up",(l,u)=>{const{onTap:d}=this.node.getProps();d&&Sn.update(()=>d(l,u))})};this.removeEndListeners(),this.removeEndListeners=ka(this.node.current,"keyup",s),cC("down",(a,l)=>{this.startPress(a,l)})},n=ka(this.node.current,"keydown",t),r=()=>{this.isPressing&&cC("cancel",(o,s)=>this.cancelPress(o,s))},i=ka(this.node.current,"blur",r);this.removeAccessibleListeners=ql(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Sn.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!oj()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Sn.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Da(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=ka(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ql(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const G5=new WeakMap,dC=new WeakMap,REe=e=>{const t=G5.get(e.target);t&&t(e)},OEe=e=>{e.forEach(REe)};function kEe({root:e,...t}){const n=e||document;dC.has(n)||dC.set(n,{});const r=dC.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(OEe,{root:e,...t})),r[i]}function IEe(e,t,n){const r=kEe(t);return G5.set(e,n),r.observe(e),()=>{G5.delete(e),r.unobserve(e)}}const MEe={some:0,all:1};class NEe extends xu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:MEe[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(l)};return IEe(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(LEe(t,n))&&this.startObserver()}unmount(){}}function LEe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const DEe={inView:{Feature:NEe},tap:{Feature:PEe},focus:{Feature:AEe},hover:{Feature:EEe}};function aj(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function $Ee(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function FEe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function S2(e,t,n){const r=e.getProps();return bA(r,t,n!==void 0?n:r.custom,$Ee(e),FEe(e))}const BEe="framerAppearId",UEe="data-"+vA(BEe);let zEe=tr,SA=tr;const Kl=e=>e*1e3,$a=e=>e/1e3,VEe={current:!1},lj=e=>Array.isArray(e)&&typeof e[0]=="number";function uj(e){return!!(!e||typeof e=="string"&&cj[e]||lj(e)||Array.isArray(e)&&e.every(uj))}const Op=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,cj={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Op([0,.65,.55,1]),circOut:Op([.55,0,1,.45]),backIn:Op([.31,.01,.66,-.59]),backOut:Op([.33,1.53,.69,.99])};function dj(e){if(e)return lj(e)?Op(e):Array.isArray(e)?e.map(dj):cj[e]}function jEe(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:s="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const d=dj(a);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}const TI={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},fC={},fj={};for(const e in TI)fj[e]=()=>(fC[e]===void 0&&(fC[e]=TI[e]()),fC[e]);function GEe(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const hj=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,HEe=1e-7,WEe=12;function qEe(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=hj(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>HEe&&++a<WEe);return s}function Zm(e,t,n,r){if(e===t&&n===r)return tr;const i=o=>qEe(o,0,1,e,n);return o=>o===0||o===1?o:hj(i(o),t,r)}const KEe=Zm(.42,0,1,1),XEe=Zm(0,0,.58,1),pj=Zm(.42,0,.58,1),YEe=e=>Array.isArray(e)&&typeof e[0]!="number",gj=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mj=e=>t=>1-e(1-t),yj=e=>1-Math.sin(Math.acos(e)),wA=mj(yj),QEe=gj(wA),vj=Zm(.33,1.53,.69,.99),xA=mj(vj),ZEe=gj(xA),JEe=e=>(e*=2)<1?.5*xA(e):.5*(2-Math.pow(2,-10*(e-1))),eAe={linear:tr,easeIn:KEe,easeInOut:pj,easeOut:XEe,circIn:yj,circInOut:QEe,circOut:wA,backIn:xA,backInOut:ZEe,backOut:vj,anticipate:JEe},EI=e=>{if(Array.isArray(e)){SA(e.length===4);const[t,n,r,i]=e;return Zm(t,n,r,i)}else if(typeof e=="string")return eAe[e];return e},CA=(e,t)=>n=>!!(Ym(n)&&JTe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),_j=(e,t,n)=>r=>{if(!Ym(r))return r;const[i,o,s,a]=r.match(_2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},tAe=e=>au(0,255,e),hC={...jc,transform:e=>Math.round(tAe(e))},ec={test:CA("rgb","red"),parse:_j("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+hC.transform(e)+", "+hC.transform(t)+", "+hC.transform(n)+", "+Wp(Hp.transform(r))+")"};function nAe(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const H5={test:CA("#"),parse:nAe,transform:ec.transform},Yd={test:CA("hsl","hue"),parse:_j("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qs.transform(Wp(t))+", "+qs.transform(Wp(n))+", "+Wp(Hp.transform(r))+")"},hi={test:e=>ec.test(e)||H5.test(e)||Yd.test(e),parse:e=>ec.test(e)?ec.parse(e):Yd.test(e)?Yd.parse(e):H5.parse(e),transform:e=>Ym(e)?e:e.hasOwnProperty("red")?ec.transform(e):Yd.transform(e)},Pn=(e,t,n)=>-n*e+n*t+e;function pC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rAe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=pC(l,a,e+1/3),o=pC(l,a,e),s=pC(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}const gC=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},iAe=[H5,ec,Yd],oAe=e=>iAe.find(t=>t.test(e));function AI(e){const t=oAe(e);let n=t.parse(e);return t===Yd&&(n=rAe(n)),n}const bj=(e,t)=>{const n=AI(e),r=AI(t),i={...n};return o=>(i.red=gC(n.red,r.red,o),i.green=gC(n.green,r.green,o),i.blue=gC(n.blue,r.blue,o),i.alpha=Pn(n.alpha,r.alpha,o),ec.transform(i))};function sAe(e){var t,n;return isNaN(e)&&Ym(e)&&(((t=e.match(_2))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(HV))===null||n===void 0?void 0:n.length)||0)>0}const Sj={regex:QTe,countKey:"Vars",token:"${v}",parse:tr},wj={regex:HV,countKey:"Colors",token:"${c}",parse:hi.parse},xj={regex:_2,countKey:"Numbers",token:"${n}",parse:jc.parse};function mC(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function C_(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&mC(n,Sj),mC(n,wj),mC(n,xj),n}function Cj(e){return C_(e).values}function Tj(e){const{values:t,numColors:n,numVars:r,tokenised:i}=C_(e),o=t.length;return s=>{let a=i;for(let l=0;l<o;l++)l<r?a=a.replace(Sj.token,s[l]):l<r+n?a=a.replace(wj.token,hi.transform(s[l])):a=a.replace(xj.token,Wp(s[l]));return a}}const aAe=e=>typeof e=="number"?0:e;function lAe(e){const t=Cj(e);return Tj(e)(t.map(aAe))}const lu={test:sAe,parse:Cj,createTransformer:Tj,getAnimatableNone:lAe},Ej=(e,t)=>n=>`${n>0?t:e}`;function Aj(e,t){return typeof e=="number"?n=>Pn(e,t,n):hi.test(e)?bj(e,t):e.startsWith("var(")?Ej(e,t):Rj(e,t)}const Pj=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,s)=>Aj(o,t[s]));return o=>{for(let s=0;s<r;s++)n[s]=i[s](o);return n}},uAe=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Aj(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},Rj=(e,t)=>{const n=lu.createTransformer(t),r=C_(e),i=C_(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?ql(Pj(r.values,i.values),n):Ej(e,t)},im=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},PI=(e,t)=>n=>Pn(e,t,n);function cAe(e){return typeof e=="number"?PI:typeof e=="string"?hi.test(e)?bj:Rj:Array.isArray(e)?Pj:typeof e=="object"?uAe:PI}function dAe(e,t,n){const r=[],i=n||cAe(e[0]),o=e.length-1;for(let s=0;s<o;s++){let a=i(e[s],e[s+1]);if(t){const l=Array.isArray(t)?t[s]||tr:t;a=ql(l,a)}r.push(a)}return r}function Oj(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(SA(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=dAe(t,r,i),a=s.length,l=u=>{let d=0;if(a>1)for(;d<e.length-2&&!(u<e[d+1]);d++);const f=im(e[d],e[d+1],u);return s[d](f)};return n?u=>l(au(e[0],e[o-1],u)):l}function fAe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=im(0,t,r);e.push(Pn(n,1,i))}}function hAe(e){const t=[0];return fAe(t,e.length-1),t}function pAe(e,t){return e.map(n=>n*t)}function gAe(e,t){return e.map(()=>t||pj).splice(0,e.length-1)}function T_({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=YEe(r)?r.map(EI):EI(r),o={done:!1,value:t[0]},s=pAe(n&&n.length===t.length?n:hAe(t),e),a=Oj(s,t,{ease:Array.isArray(i)?i:gAe(t,i)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}function kj(e,t){return t?e*(1e3/t):0}const mAe=5;function Ij(e,t,n){const r=Math.max(t-mAe,0);return kj(n-e(r),t-r)}const yC=.001,yAe=.01,RI=10,vAe=.05,_Ae=1;function bAe({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;zEe(e<=Kl(RI));let s=1-t;s=au(vAe,_Ae,s),e=au(yAe,RI,$a(e)),s<1?(i=u=>{const d=u*s,f=d*e,h=d-n,g=W5(u,s),m=Math.exp(-f);return yC-h/g*m},o=u=>{const f=u*s*e,h=f*n+n,g=Math.pow(s,2)*Math.pow(u,2)*e,m=Math.exp(-f),v=W5(Math.pow(u,2),s);return(-i(u)+yC>0?-1:1)*((h-g)*m)/v}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-yC+d*f},o=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const a=5/e,l=wAe(i,o,a);if(e=Kl(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const SAe=12;function wAe(e,t,n){let r=n;for(let i=1;i<SAe;i++)r=r-e(r)/t(r);return r}function W5(e,t){return e*Math.sqrt(1-t*t)}const xAe=["duration","bounce"],CAe=["stiffness","damping","mass"];function OI(e,t){return t.some(n=>e[n]!==void 0)}function TAe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!OI(e,CAe)&&OI(e,xAe)){const n=bAe(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function Mj({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],s={done:!1,value:i},{stiffness:a,damping:l,mass:u,velocity:d,duration:f,isResolvedFromDuration:h}=TAe(r),g=d?-$a(d):0,m=l/(2*Math.sqrt(a*u)),v=o-i,x=$a(Math.sqrt(a/u)),_=Math.abs(v)<5;n||(n=_?.01:2),t||(t=_?.005:.5);let b;if(m<1){const y=W5(x,m);b=S=>{const C=Math.exp(-m*x*S);return o-C*((g+m*x*v)/y*Math.sin(y*S)+v*Math.cos(y*S))}}else if(m===1)b=y=>o-Math.exp(-x*y)*(v+(g+x*v)*y);else{const y=x*Math.sqrt(m*m-1);b=S=>{const C=Math.exp(-m*x*S),T=Math.min(y*S,300);return o-C*((g+m*x*v)*Math.sinh(T)+y*v*Math.cosh(T))/y}}return{calculatedDuration:h&&f||null,next:y=>{const S=b(y);if(h)s.done=y>=f;else{let C=g;y!==0&&(m<1?C=Ij(b,y,S):C=0);const T=Math.abs(C)<=n,E=Math.abs(o-S)<=t;s.done=T&&E}return s.value=s.done?o:S,s}}}function kI({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},g=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let v=n*t;const x=f+v,_=s===void 0?x:s(x);_!==x&&(v=_-f);const b=P=>-v*Math.exp(-P/r),y=P=>_+b(P),S=P=>{const k=b(P),O=y(P);h.done=Math.abs(k)<=u,h.value=h.done?_:O};let C,T;const E=P=>{g(h.value)&&(C=P,T=Mj({keyframes:[h.value,m(h.value)],velocity:Ij(y,P,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:P=>{let k=!1;return!T&&C===void 0&&(k=!0,S(P),E(P)),C!==void 0&&P>C?T.next(P-C):(!k&&S(P),h)}}}const EAe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Sn.update(t,!0),stop:()=>Wa(t),now:()=>Zr.isProcessing?Zr.timestamp:performance.now()}},II=2e4;function MI(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<II;)t+=n,r=e.next(t);return t>=II?1/0:t}const AAe={decay:kI,inertia:kI,tween:T_,keyframes:T_,spring:Mj};function E_({autoplay:e=!0,delay:t=0,driver:n=EAe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:d,onUpdate:f,...h}){let g=1,m=!1,v,x;const _=()=>{x=new Promise(q=>{v=q})};_();let b;const y=AAe[i]||T_;let S;y!==T_&&typeof r[0]!="number"&&(S=Oj([0,100],r,{clamp:!1}),r=[0,100]);const C=y({...h,keyframes:r});let T;a==="mirror"&&(T=y({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let E="idle",P=null,k=null,O=null;C.calculatedDuration===null&&o&&(C.calculatedDuration=MI(C));const{calculatedDuration:M}=C;let V=1/0,B=1/0;M!==null&&(V=M+s,B=V*(o+1)-s);let A=0;const N=q=>{if(k===null)return;g>0&&(k=Math.min(k,q)),g<0&&(k=Math.min(q-B/g,k)),P!==null?A=P:A=Math.round(q-k)*g;const Z=A-t*(g>=0?1:-1),ee=g>=0?Z<0:Z>B;A=Math.max(Z,0),E==="finished"&&P===null&&(A=B);let ie=A,se=C;if(o){const fe=A/V;let pe=Math.floor(fe),ve=fe%1;!ve&&fe>=1&&(ve=1),ve===1&&pe--,pe=Math.min(pe,o+1);const ye=!!(pe%2);ye&&(a==="reverse"?(ve=1-ve,s&&(ve-=s/V)):a==="mirror"&&(se=T));let Je=au(0,1,ve);A>B&&(Je=a==="reverse"&&ye?1:0),ie=Je*V}const le=ee?{done:!1,value:r[0]}:se.next(ie);S&&(le.value=S(le.value));let{done:W}=le;!ee&&M!==null&&(W=g>=0?A>=B:A<=0);const ne=P===null&&(E==="finished"||E==="running"&&W);return f&&f(le.value),ne&&$(),le},D=()=>{b&&b.stop(),b=void 0},U=()=>{E="idle",D(),v(),_(),k=O=null},$=()=>{E="finished",d&&d(),D(),v()},j=()=>{if(m)return;b||(b=n(N));const q=b.now();l&&l(),P!==null?k=q-P:(!k||E==="finished")&&(k=q),E==="finished"&&_(),O=k,P=null,E="running",b.start()};e&&j();const G={then(q,Z){return x.then(q,Z)},get time(){return $a(A)},set time(q){q=Kl(q),A=q,P!==null||!b||g===0?P=q:k=b.now()-q/g},get duration(){const q=C.calculatedDuration===null?MI(C):C.calculatedDuration;return $a(q)},get speed(){return g},set speed(q){q===g||!b||(g=q,G.time=$a(A))},get state(){return E},play:j,pause:()=>{E="paused",P=A},stop:()=>{m=!0,E!=="idle"&&(E="idle",u&&u(),U())},cancel:()=>{O!==null&&N(O),U()},complete:()=>{E="finished"},sample:q=>(k=0,N(q))};return G}const PAe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ov=10,RAe=2e4,OAe=(e,t)=>t.type==="spring"||e==="backgroundColor"||!uj(t.ease);function kAe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(fj.waapi()&&PAe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let s=!1,a,l;const u=()=>{l=new Promise(_=>{a=_})};u();let{keyframes:d,duration:f=300,ease:h,times:g}=i;if(OAe(t,i)){const _=E_({...i,repeat:0,delay:0});let b={done:!1,value:d[0]};const y=[];let S=0;for(;!b.done&&S<RAe;)b=_.sample(S),y.push(b.value),S+=ov;g=void 0,d=y,f=S-ov,h="linear"}const m=jEe(e.owner.current,t,d,{...i,duration:f,ease:h,times:g}),v=()=>m.cancel(),x=()=>{Sn.update(v),a(),u()};return m.onfinish=()=>{e.set(GEe(d,i)),r&&r(),x()},{then(_,b){return l.then(_,b)},get time(){return $a(m.currentTime||0)},set time(_){m.currentTime=Kl(_)},get speed(){return m.playbackRate},set speed(_){m.playbackRate=_},get duration(){return $a(f)},play:()=>{s||(m.play(),Wa(v))},pause:()=>m.pause(),stop:()=>{if(s=!0,m.playState==="idle")return;const{currentTime:_}=m;if(_){const b=E_({...i,autoplay:!1});e.setWithVelocity(b.sample(_-ov).value,b.sample(_).value,ov)}x()},complete:()=>m.finish(),cancel:x}}function IAe({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:tr,pause:tr,stop:tr,then:o=>(o(),Promise.resolve()),cancel:tr,complete:tr});return t?E_({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const MAe={type:"spring",stiffness:500,damping:25,restSpeed:10},NAe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),LAe={type:"keyframes",duration:.8},DAe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$Ae=(e,{keyframes:t})=>t.length>2?LAe:Vc.has(e)?e.startsWith("scale")?NAe(t[1]):MAe:DAe,q5=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(lu.test(t)||t==="0")&&!t.startsWith("url(")),FAe=new Set(["brightness","contrast","saturate","opacity"]);function BAe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(_2)||[];if(!r)return e;const i=n.replace(r,"");let o=FAe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const UAe=/([a-z-]*)\(.*?\)/g,K5={...lu,getAnimatableNone:e=>{const t=e.match(UAe);return t?t.map(BAe).join(" "):e}},zAe={...WV,color:hi,backgroundColor:hi,outlineColor:hi,fill:hi,stroke:hi,borderColor:hi,borderTopColor:hi,borderRightColor:hi,borderBottomColor:hi,borderLeftColor:hi,filter:K5,WebkitFilter:K5},TA=e=>zAe[e];function Nj(e,t){let n=TA(e);return n!==K5&&(n=lu),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Lj=e=>/^0[^.\s]+$/.test(e);function VAe(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||Lj(e)}function jAe(e,t,n,r){const i=q5(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const s=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?s:o[u-1]),VAe(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(a=o[u]);if(i&&l.length&&a)for(let u=0;u<l.length;u++){const d=l[u];o[d]=Nj(t,a)}return o}function GAe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}function Dj(e,t){return e[t]||e.default||e}const EA=(e,t,n,r={})=>i=>{const o=Dj(r,e)||{},s=o.delay||r.delay||0;let{elapsed:a=0}=r;a=a-Kl(s);const l=jAe(t,e,n,o),u=l[0],d=l[l.length-1],f=q5(e,u),h=q5(e,d);let g={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:m=>{t.set(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(GAe(o)||(g={...g,...$Ae(e,g)}),g.duration&&(g.duration=Kl(g.duration)),g.repeatDelay&&(g.repeatDelay=Kl(g.repeatDelay)),!f||!h||VEe.current||o.type===!1)return IAe(g);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const m=kAe(t,e,g);if(m)return m}return E_(g)};function A_(e){return!!(zi(e)&&e.add)}const HAe=e=>/^\-?\d*\.?\d+$/.test(e);function AA(e,t){e.indexOf(t)===-1&&e.push(t)}function PA(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class RA{constructor(){this.subscriptions=[]}add(t){return AA(this.subscriptions,t),()=>PA(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const s=this.subscriptions[o];s&&s(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const WAe=e=>!isNaN(parseFloat(e));class qAe{constructor(t,n={}){this.version="10.12.22",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:s}=Zr;this.lastUpdated!==s&&(this.timeDelta=o,this.lastUpdated=s,Sn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Sn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=WAe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new RA);const r=this.events[t].add(n);return t==="change"?()=>{r(),Sn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?kj(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wf(e,t){return new qAe(e,t)}const $j=e=>t=>t.test(e),KAe={test:e=>e==="auto",parse:e=>e},Fj=[jc,He,qs,bl,tEe,eEe,KAe],_p=e=>Fj.find($j(e)),XAe=[...Fj,hi,lu],YAe=e=>XAe.find($j(e));function QAe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wf(n))}function ZAe(e,t){const n=S2(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const s in o){const a=gEe(o[s]);QAe(e,s,a)}}function JAe(e,t,n){var r,i;const o=Object.keys(t).filter(a=>!e.hasValue(a)),s=o.length;if(s)for(let a=0;a<s;a++){const l=o[a],u=t[l];let d=null;Array.isArray(u)&&(d=u[0]),d===null&&(d=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),d!=null&&(typeof d=="string"&&(HAe(d)||Lj(d))?d=parseFloat(d):!YAe(d)&&lu.test(u)&&(d=Nj(l,u)),e.addValue(l,Wf(d,{owner:e})),n[l]===void 0&&(n[l]=d),d!==null&&e.setBaseTarget(l,d))}}function e6e(e,t){return t?(t[e]||t.default||t).from:void 0}function t6e(e,t,n){const r={};for(const i in e){const o=e6e(i,t);if(o!==void 0)r[i]=o;else{const s=n.getValue(i);s&&(r[i]=s.get())}}return r}function n6e({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Bj(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in a){const h=e.getValue(f),g=a[f];if(!h||g===void 0||d&&n6e(d,f))continue;const m={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const x=e.getProps()[UEe];x&&(m.elapsed=window.HandoffAppearAnimations(x,f,h,Sn))}h.start(EA(f,h,g,e.shouldReduceMotion&&Vc.has(f)?{type:!1}:m));const v=h.animation;A_(l)&&(l.add(f),v.then(()=>l.remove(f))),u.push(v)}return s&&Promise.all(u).then(()=>{s&&ZAe(e,s)}),u}function X5(e,t,n={}){const r=S2(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Bj(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:f}=i;return r6e(e,t,u+l,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[o,s]:[s,o];return l().then(()=>u())}else return Promise.all([o(),s(n.delay)])}function r6e(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(i6e).forEach((u,d)=>{u.notify("AnimationStart",t),s.push(X5(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(s)}function i6e(e,t){return e.sortNodePosition(t)}function o6e(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>X5(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=X5(e,t,n);else{const i=typeof t=="function"?S2(e,t,n.custom):t;r=Promise.all(Bj(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const s6e=[...cA].reverse(),a6e=cA.length;function l6e(e){return t=>Promise.all(t.map(({animation:n,options:r})=>o6e(e,n,r)))}function u6e(e){let t=l6e(e);const n=d6e();let r=!0;const i=(l,u)=>{const d=S2(e,u);if(d){const{transition:f,transitionEnd:h,...g}=d;l={...l,...g,...h}}return l};function o(l){t=l(e)}function s(l,u){const d=e.getProps(),f=e.getVariantContext(!0)||{},h=[],g=new Set;let m={},v=1/0;for(let _=0;_<a6e;_++){const b=s6e[_],y=n[b],S=d[b]!==void 0?d[b]:f[b],C=nm(S),T=b===u?y.isActive:null;T===!1&&(v=_);let E=S===f[b]&&S!==d[b]&&C;if(E&&r&&e.manuallyAnimateOnMount&&(E=!1),y.protectedKeys={...m},!y.isActive&&T===null||!S&&!y.prevProp||y2(S)||typeof S=="boolean")continue;const P=c6e(y.prevProp,S);let k=P||b===u&&y.isActive&&!E&&C||_>v&&C;const O=Array.isArray(S)?S:[S];let M=O.reduce(i,{});T===!1&&(M={});const{prevResolvedValues:V={}}=y,B={...V,...M},A=N=>{k=!0,g.delete(N),y.needsAnimating[N]=!0};for(const N in B){const D=M[N],U=V[N];m.hasOwnProperty(N)||(D!==U?x_(D)&&x_(U)?!aj(D,U)||P?A(N):y.protectedKeys[N]=!0:D!==void 0?A(N):g.add(N):D!==void 0&&g.has(N)?A(N):y.protectedKeys[N]=!0)}y.prevProp=S,y.prevResolvedValues=M,y.isActive&&(m={...m,...M}),r&&e.blockInitialAnimation&&(k=!1),k&&!E&&h.push(...O.map(N=>({animation:N,options:{type:b,...l}})))}if(g.size){const _={};g.forEach(b=>{const y=e.getBaseTarget(b);y!==void 0&&(_[b]=y)}),h.push({animation:_})}let x=!!h.length;return r&&d.initial===!1&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(h):Promise.resolve()}function a(l,u,d){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(g=>{var m;return(m=g.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const h=s(d,l);for(const g in n)n[g].protectedKeys={};return h}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n}}function c6e(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aj(t,e):!1}function Fu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function d6e(){return{animate:Fu(!0),whileInView:Fu(),whileHover:Fu(),whileTap:Fu(),whileDrag:Fu(),whileFocus:Fu(),exit:Fu()}}class f6e extends xu{constructor(t){super(t),t.animationState||(t.animationState=u6e(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),y2(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let h6e=0;class p6e extends xu{constructor(){super(...arguments),this.id=h6e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const g6e={animation:{Feature:f6e},exit:{Feature:p6e}},NI=(e,t)=>Math.abs(e-t);function m6e(e,t){const n=NI(e.x,t.x),r=NI(e.y,t.y);return Math.sqrt(n**2+r**2)}class Uj{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=_C(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=m6e(u.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:h}=u,{timestamp:g}=Zr;this.history.push({...h,timestamp:g});const{onStart:m,onMove:v}=this.handlers;d||(m&&m(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=vC(d,this.transformPagePoint),Sn.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:h}=this.handlers,g=_C(u.type==="pointercancel"?this.lastMoveEventInfo:vC(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,g),h&&h(u,g)},!nj(t))return;this.handlers=n,this.transformPagePoint=r;const i=b2(t),o=vC(i,this.transformPagePoint),{point:s}=o,{timestamp:a}=Zr;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=n;l&&l(t,_C(o,this.history)),this.removeListeners=ql(Da(window,"pointermove",this.handlePointerMove),Da(window,"pointerup",this.handlePointerUp),Da(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wa(this.updatePoint)}}function vC(e,t){return t?{point:t(e.point)}:e}function LI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _C({point:e},t){return{point:e,delta:LI(e,zj(t)),offset:LI(e,y6e(t)),velocity:v6e(t,.1)}}function y6e(e){return e[0]}function zj(e){return e[e.length-1]}function v6e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=zj(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Kl(t)));)n--;if(!r)return{x:0,y:0};const o=$a(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function oo(e){return e.max-e.min}function Y5(e,t=0,n=.01){return Math.abs(e-t)<=n}function DI(e,t,n,r=.5){e.origin=r,e.originPoint=Pn(t.min,t.max,e.origin),e.scale=oo(n)/oo(t),(Y5(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Pn(n.min,n.max,e.origin)-e.originPoint,(Y5(e.translate)||isNaN(e.translate))&&(e.translate=0)}function qp(e,t,n,r){DI(e.x,t.x,n.x,r?r.originX:void 0),DI(e.y,t.y,n.y,r?r.originY:void 0)}function $I(e,t,n){e.min=n.min+t.min,e.max=e.min+oo(t)}function _6e(e,t,n){$I(e.x,t.x,n.x),$I(e.y,t.y,n.y)}function FI(e,t,n){e.min=t.min-n.min,e.max=e.min+oo(t)}function Kp(e,t,n){FI(e.x,t.x,n.x),FI(e.y,t.y,n.y)}function b6e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Pn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Pn(n,e,r.max):Math.min(e,n)),e}function BI(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function S6e(e,{top:t,left:n,bottom:r,right:i}){return{x:BI(e.x,n,i),y:BI(e.y,t,r)}}function UI(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function w6e(e,t){return{x:UI(e.x,t.x),y:UI(e.y,t.y)}}function x6e(e,t){let n=.5;const r=oo(e),i=oo(t);return i>r?n=im(t.min,t.max-r,e.min):r>i&&(n=im(e.min,e.max-i,t.min)),au(0,1,n)}function C6e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Q5=.35;function T6e(e=Q5){return e===!1?e=0:e===!0&&(e=Q5),{x:zI(e,"left","right"),y:zI(e,"top","bottom")}}function zI(e,t,n){return{min:VI(e,t),max:VI(e,n)}}function VI(e,t){return typeof e=="number"?e:e[t]||0}const jI=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qd=()=>({x:jI(),y:jI()}),GI=()=>({min:0,max:0}),Xn=()=>({x:GI(),y:GI()});function Ps(e){return[e("x"),e("y")]}function Vj({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function E6e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function A6e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function bC(e){return e===void 0||e===1}function Z5({scale:e,scaleX:t,scaleY:n}){return!bC(e)||!bC(t)||!bC(n)}function ju(e){return Z5(e)||jj(e)||e.z||e.rotate||e.rotateX||e.rotateY}function jj(e){return HI(e.x)||HI(e.y)}function HI(e){return e&&e!=="0%"}function P_(e,t,n){const r=e-n,i=t*r;return n+i}function WI(e,t,n,r,i){return i!==void 0&&(e=P_(e,i,r)),P_(e,n,r)+t}function J5(e,t=0,n=1,r,i){e.min=WI(e.min,t,n,r,i),e.max=WI(e.max,t,n,r,i)}function Gj(e,{x:t,y:n}){J5(e.x,t.translate,t.scale,t.originPoint),J5(e.y,n.translate,n.scale,n.originPoint)}function P6e(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a<i;a++){o=n[a],s=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Zd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,Gj(e,s)),r&&ju(o.latestValues)&&Zd(e,o.latestValues))}t.x=qI(t.x),t.y=qI(t.y)}function qI(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Tl(e,t){e.min=e.min+t,e.max=e.max+t}function KI(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,s=Pn(e.min,e.max,o);J5(e,t[n],t[r],s,t.scale)}const R6e=["x","scaleX","originX"],O6e=["y","scaleY","originY"];function Zd(e,t){KI(e.x,t,R6e),KI(e.y,t,O6e)}function Hj(e,t){return Vj(A6e(e.getBoundingClientRect(),t))}function k6e(e,t,n){const r=Hj(e,n),{scroll:i}=t;return i&&(Tl(r.x,i.offset.x),Tl(r.y,i.offset.y)),r}const I6e=new WeakMap;class M6e{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Xn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(b2(l,"page").point)},o=(l,u)=>{const{drag:d,dragPropagation:f,onDragStart:h}=this.getProps();if(d&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=ij(d),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ps(m=>{let v=this.getAxisMotionValue(m).get()||0;if(qs.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const _=x.layout.layoutBox[m];_&&(v=oo(_)*(parseFloat(v)/100))}}this.originPoint[m]=v}),h&&Sn.update(()=>h(l,u),!1,!0);const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},s=(l,u)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:h,onDrag:g}=this.getProps();if(!d&&!this.openGlobalLock)return;const{offset:m}=u;if(f&&this.currentDirection===null){this.currentDirection=N6e(m),this.currentDirection!==null&&h&&h(this.currentDirection);return}this.updateAxis("x",u.point,m),this.updateAxis("y",u.point,m),this.visualElement.render(),g&&g(l,u)},a=(l,u)=>this.stop(l,u);this.panSession=new Uj(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Sn.update(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!sv(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=b6e(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Xd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=S6e(r.layoutBox,t):this.constraints=!1,this.elastic=T6e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ps(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=C6e(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xd(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=k6e(r,i.root,this.visualElement.getTransformPagePoint());let s=w6e(i.layout.layoutBox,o);if(n){const a=n(E6e(s));this.hasMutatedConstraints=!!a,a&&(s=Vj(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ps(d=>{if(!sv(d,n,this.currentDirection))return;let f=l&&l[d]||{};s&&(f={min:0,max:0});const h=i?200:1e6,g=i?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(EA(t,r,0,n))}stopAnimation(){Ps(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ps(n=>{const{drag:r}=this.getProps();if(!sv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-Pn(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xd(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ps(s=>{const a=this.getAxisMotionValue(s);if(a){const l=a.get();i[s]=x6e({min:l,max:l},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ps(s=>{if(!sv(s,t,null))return;const a=this.getAxisMotionValue(s),{min:l,max:u}=this.constraints[s];a.set(Pn(l,u,i[s]))})}addListeners(){if(!this.visualElement.current)return;I6e.set(this.visualElement,this);const t=this.visualElement.current,n=Da(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Xd(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const s=ka(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ps(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=Q5,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function sv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function N6e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class L6e extends xu{constructor(t){super(t),this.removeGroupControls=tr,this.removeListeners=tr,this.controls=new M6e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tr}unmount(){this.removeGroupControls(),this.removeListeners()}}const XI=e=>(t,n)=>{e&&Sn.update(()=>e(t,n))};class D6e extends xu{constructor(){super(...arguments),this.removePointerDownListener=tr}onPointerDown(t){this.session=new Uj(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:XI(t),onStart:XI(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Sn.update(()=>i(o,s))}}}mount(){this.removePointerDownListener=Da(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function $6e(){const e=L.useContext(Km);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=L.useId();return L.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function XMe(){return F6e(L.useContext(Km))}function F6e(e){return e===null?!0:e.isPresent}const Gv={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function YI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(He.test(e))e=parseFloat(e);else return e;const n=YI(e,t.target.x),r=YI(e,t.target.y);return`${n}% ${r}%`}},B6e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=lu.parse(e);if(i.length>5)return r;const o=lu.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=l;const u=Pn(a,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=u),typeof i[3+s]=="number"&&(i[3+s]/=u),o(i)}};class U6e extends jt.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;qTe(z6e),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Gv.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Sn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Wj(e){const[t,n]=$6e(),r=L.useContext(fA);return jt.createElement(U6e,{...e,layoutGroup:r,switchLayoutGroup:L.useContext(zV),isPresent:t,safeToRemove:n})}const z6e={borderRadius:{...bp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bp,borderTopRightRadius:bp,borderBottomLeftRadius:bp,borderBottomRightRadius:bp,boxShadow:B6e},qj=["TopLeft","TopRight","BottomLeft","BottomRight"],V6e=qj.length,QI=e=>typeof e=="string"?parseFloat(e):e,ZI=e=>typeof e=="number"||He.test(e);function j6e(e,t,n,r,i,o){i?(e.opacity=Pn(0,n.opacity!==void 0?n.opacity:1,G6e(r)),e.opacityExit=Pn(t.opacity!==void 0?t.opacity:1,0,H6e(r))):o&&(e.opacity=Pn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;s<V6e;s++){const a=`border${qj[s]}Radius`;let l=JI(t,a),u=JI(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||ZI(l)===ZI(u)?(e[a]=Math.max(Pn(QI(l),QI(u),r),0),(qs.test(u)||qs.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Pn(t.rotate||0,n.rotate||0,r))}function JI(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const G6e=Kj(0,.5,wA),H6e=Kj(.5,.95,tr);function Kj(e,t,n){return r=>r<e?0:r>t?1:n(im(e,t,r))}function e7(e,t){e.min=t.min,e.max=t.max}function wo(e,t){e7(e.x,t.x),e7(e.y,t.y)}function t7(e,t,n,r,i){return e-=t,e=P_(e,1/n,r),i!==void 0&&(e=P_(e,1/i,r)),e}function W6e(e,t=0,n=1,r=.5,i,o=e,s=e){if(qs.test(t)&&(t=parseFloat(t),t=Pn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Pn(o.min,o.max,r);e===o&&(a-=t),e.min=t7(e.min,t,n,a,i),e.max=t7(e.max,t,n,a,i)}function n7(e,t,[n,r,i],o,s){W6e(e,t[n],t[r],t[i],t.scale,o,s)}const q6e=["x","scaleX","originX"],K6e=["y","scaleY","originY"];function r7(e,t,n,r){n7(e.x,t,q6e,n?n.x:void 0,r?r.x:void 0),n7(e.y,t,K6e,n?n.y:void 0,r?r.y:void 0)}function i7(e){return e.translate===0&&e.scale===1}function Xj(e){return i7(e.x)&&i7(e.y)}function e4(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function o7(e){return oo(e.x)/oo(e.y)}class X6e{constructor(){this.members=[]}add(t){AA(this.members,t),t.scheduleRender()}remove(t){if(PA(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function s7(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const s=e.x.scale*t.x,a=e.y.scale*t.y;return(s!==1||a!==1)&&(r+=`scale(${s}, ${a})`),r||"none"}const Y6e=(e,t)=>e.depth-t.depth;class Q6e{constructor(){this.children=[],this.isDirty=!1}add(t){AA(this.children,t),this.isDirty=!0}remove(t){PA(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Y6e),this.isDirty=!1,this.children.forEach(t)}}function Z6e(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Wa(r),e(o-t))};return Sn.read(r,!0),()=>Wa(r)}function J6e(e){window.MotionDebug&&window.MotionDebug.record(e)}function ePe(e){return e instanceof SVGElement&&e.tagName!=="svg"}function tPe(e,t,n){const r=zi(e)?e:Wf(e);return r.start(EA("",r,t,n)),r.animation}const a7=["","X","Y","Z"],l7=1e3;let nPe=0;const Gu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Yj({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=nPe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Gu.totalNodes=Gu.resolvedTargetDeltas=Gu.recalculatedProjection=0,this.nodes.forEach(oPe),this.nodes.forEach(cPe),this.nodes.forEach(dPe),this.nodes.forEach(sPe),J6e(Gu)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Q6e)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new RA),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const l=this.eventHandlers.get(s);l&&l.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ePe(s),this.instance=s;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Z6e(h,250),Gv.hasAnimatedSinceResize&&(Gv.hasAnimatedSinceResize=!1,this.nodes.forEach(c7))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:g,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||mPe,{onLayoutAnimationStart:x,onLayoutAnimationComplete:_}=d.getProps(),b=!this.targetLayout||!e4(this.targetLayout,m)||g,y=!h&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,y);const S={...Dj(v,"layout"),onPlay:x,onComplete:_};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else h||c7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wa(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fPe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(u7);return}this.isUpdating||this.nodes.forEach(lPe),this.isUpdating=!1,this.nodes.forEach(uPe),this.nodes.forEach(rPe),this.nodes.forEach(iPe),this.clearAllSnapshots();const a=performance.now();Zr.delta=au(0,1e3/60,a-Zr.timestamp),Zr.timestamp=a,Zr.isProcessing=!0,uC.update.process(Zr),uC.preRender.process(Zr),uC.render.process(Zr),Zr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(aPe),this.sharedNodes.forEach(hPe)}scheduleUpdateProjection(){Sn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Xn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:s,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!Xj(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;s&&(a||ju(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return s&&(l=this.removeTransform(l)),yPe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return Xn();const a=s.measureViewportBox(),{scroll:l}=this.root;return l&&(Tl(a.x,l.offset.x),Tl(a.y,l.offset.y)),a}removeElementScroll(s){const a=Xn();wo(a,s);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:d,options:f}=u;if(u!==this.root&&d&&f.layoutScroll){if(d.isRoot){wo(a,s);const{scroll:h}=this.root;h&&(Tl(a.x,-h.offset.x),Tl(a.y,-h.offset.y))}Tl(a.x,d.offset.x),Tl(a.y,d.offset.y)}}return a}applyTransform(s,a=!1){const l=Xn();wo(l,s);for(let u=0;u<this.path.length;u++){const d=this.path[u];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Zd(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ju(d.latestValues)&&Zd(l,d.latestValues)}return ju(this.latestValues)&&Zd(l,this.latestValues),l}removeTransform(s){const a=Xn();wo(a,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!ju(u.latestValues))continue;Z5(u.latestValues)&&u.updateSnapshot();const d=Xn(),f=u.measurePageBox();wo(d,f),r7(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ju(this.latestValues)&&r7(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Zr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(s||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=Zr.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Xn(),this.relativeTargetOrigin=Xn(),Kp(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Xn(),this.targetWithTransforms=Xn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),_6e(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):wo(this.target,this.layout.layoutBox),Gj(this.target,this.targetDelta)):wo(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Xn(),this.relativeTargetOrigin=Xn(),Kp(this.relativeTargetOrigin,this.target,g.target),wo(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Gu.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Z5(this.parent.latestValues)||jj(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var s;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Zr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||f))return;wo(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,g=this.treeScale.y;P6e(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox);const{target:m}=a;if(!m){this.projectionTransform&&(this.projectionDelta=Qd(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Qd(),this.projectionDeltaWithTransform=Qd());const v=this.projectionTransform;qp(this.projectionDelta,this.layoutCorrected,m,this.latestValues),this.projectionTransform=s7(this.projectionDelta,this.treeScale),(this.projectionTransform!==v||this.treeScale.x!==h||this.treeScale.y!==g)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),Gu.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(s,a=!1){const l=this.snapshot,u=l?l.latestValues:{},d={...this.latestValues},f=Qd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=Xn(),g=l?l.source:void 0,m=this.layout?this.layout.source:void 0,v=g!==m,x=this.getStack(),_=!x||x.members.length<=1,b=!!(v&&!_&&this.options.crossfade===!0&&!this.path.some(gPe));this.animationProgress=0;let y;this.mixTargetDelta=S=>{const C=S/1e3;d7(f.x,s.x,C),d7(f.y,s.y,C),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Kp(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),pPe(this.relativeTarget,this.relativeTargetOrigin,h,C),y&&e4(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Xn()),wo(y,this.relativeTarget)),v&&(this.animationValues=d,j6e(d,u,this.latestValues,C,b,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{Gv.hasAnimatedSinceResize=!0,this.currentAnimation=tPe(0,l7,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(l7),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=s;if(!(!a||!l||!u)){if(this!==s&&this.layout&&u&&Qj(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Xn();const f=oo(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+f;const h=oo(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+h}wo(a,l),Zd(a,d),qp(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new X6e),this.sharedNodes.get(s).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:l}=s;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let d=0;d<a7.length;d++){const f="rotate"+a7[d];l[f]&&(u[f]=l[f],s.setStaticValue(f,0))}s.render();for(const d in u)s.setStaticValue(d,u[d]);s.scheduleRender()}getProjectionStyles(s={}){var a,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const d=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=jv(s.pointerEvents)||"",u.transform=d?d(this.latestValues,""):"none",u;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=jv(s.pointerEvents)||""),this.hasProjected&&!ju(this.latestValues)&&(v.transform=d?d({},""):"none",this.hasProjected=!1),v}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=s7(this.projectionDeltaWithTransform,this.treeScale,h),d&&(u.transform=d(h,u.transform));const{x:g,y:m}=this.projectionDelta;u.transformOrigin=`${g.origin*100}% ${m.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const v in S_){if(h[v]===void 0)continue;const{correct:x,applyTo:_}=S_[v],b=u.transform==="none"?h[v]:x(h[v],f);if(_){const y=_.length;for(let S=0;S<y;S++)u[_[S]]=b}else u[v]=b}return this.options.layoutId&&(u.pointerEvents=f===this?jv(s.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(u7),this.root.sharedNodes.clear()}}}function rPe(e){e.updateLayout()}function iPe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Ps(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],g=oo(h);h.min=r[f].min,h.max=h.min+g}):Qj(o,n.layoutBox,r)&&Ps(f=>{const h=s?n.measuredBox[f]:n.layoutBox[f],g=oo(r[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const a=Qd();qp(a,r,n.layoutBox);const l=Qd();s?qp(l,e.applyTransform(i,!0),n.measuredBox):qp(l,r,n.layoutBox);const u=!Xj(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const m=Xn();Kp(m,n.layoutBox,h.layoutBox);const v=Xn();Kp(v,r,g.layoutBox),e4(m,v)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function oPe(e){Gu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function sPe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function aPe(e){e.clearSnapshot()}function u7(e){e.clearMeasurements()}function lPe(e){e.isLayoutDirty=!1}function uPe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function c7(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function cPe(e){e.resolveTargetDelta()}function dPe(e){e.calcProjection()}function fPe(e){e.resetRotation()}function hPe(e){e.removeLeadSnapshot()}function d7(e,t,n){e.translate=Pn(t.translate,0,n),e.scale=Pn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function f7(e,t,n,r){e.min=Pn(t.min,n.min,r),e.max=Pn(t.max,n.max,r)}function pPe(e,t,n,r){f7(e.x,t.x,n.x,r),f7(e.y,t.y,n.y,r)}function gPe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const mPe={duration:.45,ease:[.4,0,.1,1]};function h7(e){e.min=Math.round(e.min*2)/2,e.max=Math.round(e.max*2)/2}function yPe(e){h7(e.x),h7(e.y)}function Qj(e,t,n){return e==="position"||e==="preserve-aspect"&&!Y5(o7(t),o7(n),.2)}const vPe=Yj({attachResizeListener:(e,t)=>ka(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),SC={current:void 0},Zj=Yj({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!SC.current){const e=new vPe({});e.mount(window),e.setOptions({layoutScroll:!0}),SC.current=e}return SC.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_Pe={pan:{Feature:D6e},drag:{Feature:L6e,ProjectionNode:Zj,MeasureLayout:Wj}},bPe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function SPe(e){const t=bPe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function t4(e,t,n=1){const[r,i]=SPe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():j5(i)?t4(i,t,n+1):i}function wPe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!j5(o))return;const s=t4(o,r);s&&i.set(s)});for(const i in t){const o=t[i];if(!j5(o))continue;const s=t4(o,r);s&&(t[i]=s,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const xPe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Jj=e=>xPe.has(e),CPe=e=>Object.keys(e).some(Jj),p7=e=>e===jc||e===He,g7=(e,t)=>parseFloat(e.split(", ")[t]),m7=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return g7(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?g7(o[1],e):0}},TPe=new Set(["x","y","z"]),EPe=Xm.filter(e=>!TPe.has(e));function APe(e){const t=[];return EPe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const qf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:m7(4,13),y:m7(5,14)};qf.translateX=qf.x;qf.translateY=qf.y;const PPe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:s}=o,a={};s==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{a[u]=qf[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);d&&d.jump(a[u]),e[u]=qf[u](l,o)}),e},RPe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(Jj);let o=[],s=!1;const a=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],f=_p(d);const h=t[l];let g;if(x_(h)){const m=h.length,v=h[0]===null?1:0;d=h[v],f=_p(d);for(let x=v;x<m&&h[x]!==null;x++)g?SA(_p(h[x])===g):g=_p(h[x])}else g=_p(h);if(f!==g)if(p7(f)&&p7(g)){const m=u.get();typeof m=="string"&&u.set(parseFloat(m)),typeof h=="string"?t[l]=parseFloat(h):Array.isArray(h)&&g===He&&(t[l]=h.map(parseFloat))}else f!=null&&f.transform&&(g!=null&&g.transform)&&(d===0||h===0)?d===0?u.set(g.transform(d)):t[l]=f.transform(h):(s||(o=APe(e),s=!0),a.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(h))}),a.length){const l=a.indexOf("height")>=0?window.pageYOffset:null,u=PPe(t,e,a);return o.length&&o.forEach(([d,f])=>{e.getValue(d).set(f)}),e.render(),m2&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function OPe(e,t,n,r){return CPe(t)?RPe(e,t,n,r):{target:t,transitionEnd:r}}const kPe=(e,t,n,r)=>{const i=wPe(e,t,r);return t=i.target,r=i.transitionEnd,OPe(e,t,n,r)},n4={current:null},eG={current:!1};function IPe(){if(eG.current=!0,!!m2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>n4.current=e.matches;e.addListener(t),t()}else n4.current=!1}function MPe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],s=n[i];if(zi(o))e.addValue(i,o),A_(r)&&r.add(i);else if(zi(s))e.addValue(i,Wf(o,{owner:e})),A_(r)&&r.remove(i);else if(s!==o)if(e.hasValue(i)){const a=e.getValue(i);!a.hasAnimated&&a.set(o)}else{const a=e.getStaticValue(i);e.addValue(i,Wf(a!==void 0?a:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const y7=new WeakMap,tG=Object.keys(rm),NPe=tG.length,v7=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],LPe=dA.length;class DPe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Sn.render(this.render,!1,!0);const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=v2(n),this.isVariantNode=UV(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(n,{});for(const f in d){const h=d[f];a[f]!==void 0&&zi(h)&&(h.set(a[f],!1),A_(u)&&u.add(f))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,y7.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),eG.current||IPe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:n4.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){y7.delete(this.current),this.projection&&this.projection.unmount(),Wa(this.notifyUpdate),Wa(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Vc.has(t),i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Sn.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o){let s,a;for(let l=0;l<NPe;l++){const u=tG[l],{isEnabled:d,Feature:f,ProjectionNode:h,MeasureLayout:g}=rm[u];h&&(s=h),d(n)&&(!this.features[u]&&f&&(this.features[u]=new f(this)),g&&(a=g))}if(!this.projection&&s){this.projection=new s(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:d,dragConstraints:f,layoutScroll:h,layoutRoot:g}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!d||f&&Xd(f),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:h,layoutRoot:g})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Xn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<v7.length;r++){const i=v7[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=t["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=MPe(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<LPe;r++){const i=dA[r],o=this.props[i];(nm(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Wf(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=bA(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!zi(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new RA),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class nG extends DPe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let s=t6e(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),s&&(s=i(s))),o){JAe(this,r,s);const a=kPe(this,r,s,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function $Pe(e){return window.getComputedStyle(e)}class FPe extends nG{readValueFromInstance(t,n){if(Vc.has(n)){const r=TA(n);return r&&r.default||0}else{const r=$Pe(t),i=(GV(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Hj(t,n)}build(t,n,r,i){pA(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return _A(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;zi(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){YV(t,n,r,i)}}class BPe extends nG{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vc.has(n)){const r=TA(n);return r&&r.default||0}return n=QV.has(n)?n:vA(n),t.getAttribute(n)}measureInstanceViewportBox(){return Xn()}scrapeMotionValuesFromProps(t,n){return JV(t,n)}build(t,n,r,i){mA(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){ZV(t,n,r,i)}mount(t){this.isSVGTag=yA(t.tagName),super.mount(t)}}const UPe=(e,t)=>hA(e)?new BPe(t,{enableHardwareAcceleration:!1}):new FPe(t,{enableHardwareAcceleration:!0}),zPe={layout:{ProjectionNode:Zj,MeasureLayout:Wj}},VPe={...g6e,...DEe,..._Pe,...zPe},jPe=HTe((e,t)=>bEe(e,t,VPe,UPe));function rG(){const e=L.useRef(!1);return b_(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function GPe(){const e=rG(),[t,n]=L.useState(0),r=L.useCallback(()=>{e.current&&n(t+1)},[t]);return[L.useCallback(()=>Sn.postRender(r),[r]),t]}class HPe extends L.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function WPe({children:e,isPresent:t}){const n=L.useId(),r=L.useRef(null),i=L.useRef({width:0,height:0,top:0,left:0});return L.useInsertionEffect(()=>{const{width:o,height:s,top:a,left:l}=i.current;if(t||!r.current||!o||!s)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
|
||
[data-motion-pop-id="${n}"] {
|
||
position: absolute !important;
|
||
width: ${o}px !important;
|
||
height: ${s}px !important;
|
||
top: ${a}px !important;
|
||
left: ${l}px !important;
|
||
}
|
||
`),()=>{document.head.removeChild(u)}},[t]),L.createElement(HPe,{isPresent:t,childRef:r,sizeRef:i},L.cloneElement(e,{ref:r}))}const wC=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=ej(qPe),l=L.useId(),u=L.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{a.set(d,!0);for(const f of a.values())if(!f)return;r&&r()},register:d=>(a.set(d,!1),()=>a.delete(d))}),o?void 0:[n]);return L.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[n]),L.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=L.createElement(WPe,{isPresent:n},e)),L.createElement(Km.Provider,{value:u},e)};function qPe(){return new Map}function KPe(e){return L.useEffect(()=>()=>e(),[])}const Nd=e=>e.key||"";function XPe(e,t){e.forEach(n=>{const r=Nd(n);t.set(r,n)})}function YPe(e){const t=[];return L.Children.forEach(e,n=>{L.isValidElement(n)&&t.push(n)}),t}const QPe=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{const a=L.useContext(fA).forceRender||GPe()[0],l=rG(),u=YPe(e);let d=u;const f=L.useRef(new Map).current,h=L.useRef(d),g=L.useRef(new Map).current,m=L.useRef(!0);if(b_(()=>{m.current=!1,XPe(u,g),h.current=d}),KPe(()=>{m.current=!0,g.clear(),f.clear()}),m.current)return L.createElement(L.Fragment,null,d.map(b=>L.createElement(wC,{key:Nd(b),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:s},b)));d=[...d];const v=h.current.map(Nd),x=u.map(Nd),_=v.length;for(let b=0;b<_;b++){const y=v[b];x.indexOf(y)===-1&&!f.has(y)&&f.set(y,void 0)}return s==="wait"&&f.size&&(d=[]),f.forEach((b,y)=>{if(x.indexOf(y)!==-1)return;const S=g.get(y);if(!S)return;const C=v.indexOf(y);let T=b;if(!T){const E=()=>{g.delete(y),f.delete(y);const P=h.current.findIndex(k=>k.key===y);if(h.current.splice(P,1),!f.size){if(h.current=u,l.current===!1)return;a(),r&&r()}};T=L.createElement(wC,{key:Nd(S),isPresent:!1,onExitComplete:E,custom:t,presenceAffectsLayout:o,mode:s},S),f.set(y,T)}d.splice(C,0,T)}),d=d.map(b=>{const y=b.key;return f.has(y)?b:L.createElement(wC,{key:Nd(b),isPresent:!0,presenceAffectsLayout:o,mode:s},b)}),L.createElement(L.Fragment,null,f.size?d:d.map(b=>L.cloneElement(b)))};var ZPe=V5e({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),iG=zc((e,t)=>{const n=$V("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:s="transparent",className:a,...l}=MV(e),u=EV("chakra-spinner",a),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${ZPe} ${o} linear infinite`,...n};return ue.jsx(Cc.div,{ref:t,__css:d,className:u,...l,children:r&&ue.jsx(Cc.span,{srOnly:!0,children:r})})});iG.displayName="Spinner";var r4=zc(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...s}=t;return ue.jsx("img",{width:r,height:i,ref:n,alt:o,...s})});r4.displayName="NativeImage";function JPe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:s,sizes:a,ignoreFallback:l}=e,[u,d]=L.useState("pending");L.useEffect(()=>{d(n?"loading":"pending")},[n]);const f=L.useRef(),h=L.useCallback(()=>{if(!n)return;g();const m=new Image;m.src=n,s&&(m.crossOrigin=s),r&&(m.srcset=r),a&&(m.sizes=a),t&&(m.loading=t),m.onload=v=>{g(),d("loaded"),i==null||i(v)},m.onerror=v=>{g(),d("failed"),o==null||o(v)},f.current=m},[n,s,r,a,i,o,t]),g=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return j5e(()=>{if(!l)return u==="loading"&&h(),()=>{g()}},[u,h,l]),l?"loaded":u}var e8e=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function t8e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var OA=zc(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:s,align:a,fit:l,loading:u,ignoreFallback:d,crossOrigin:f,fallbackStrategy:h="beforeLoadOrError",referrerPolicy:g,...m}=t,v=r!==void 0||i!==void 0,x=u!=null||d||!v,_=JPe({...t,crossOrigin:f,ignoreFallback:x}),b=e8e(_,h),y={ref:n,objectFit:l,objectPosition:a,...x?m:t8e(m,["onError","onLoad"])};return b?i||ue.jsx(Cc.img,{as:r4,className:"chakra-image__placeholder",src:r,...y}):ue.jsx(Cc.img,{as:r4,src:o,srcSet:s,crossOrigin:f,loading:u,referrerPolicy:g,className:"chakra-image",...y})});OA.displayName="Image";var i4=zc(function(t,n){const r=$V("Heading",t),{className:i,...o}=MV(t);return ue.jsx(Cc.h2,{ref:n,className:EV("chakra-heading",t.className),...o,__css:r})});i4.displayName="Heading";var kA=Cc("div");kA.displayName="Box";var oG=zc(function(t,n){const{size:r,centerContent:i=!0,...o}=t,s=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return ue.jsx(kA,{ref:n,boxSize:r,__css:{...s,flexShrink:0,flexGrow:0},...o})});oG.displayName="Square";var n8e=zc(function(t,n){const{size:r,...i}=t;return ue.jsx(oG,{size:r,ref:n,borderRadius:"9999px",...i})});n8e.displayName="Circle";var IA=zc(function(t,n){const{direction:r,align:i,justify:o,wrap:s,basis:a,grow:l,shrink:u,...d}=t,f={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:u};return ue.jsx(Cc.div,{ref:n,__css:f,...d})});IA.displayName="Flex";const r8e=""+new URL("logo-13003d72.png",import.meta.url).href,i8e=()=>ue.jsxs(IA,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[ue.jsx(OA,{src:r8e,w:"8rem",h:"8rem"}),ue.jsx(iG,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),o8e=L.memo(i8e);function o4(e){"@babel/helpers - typeof";return o4=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},o4(e)}var sG=[],s8e=sG.forEach,a8e=sG.slice;function s4(e){return s8e.call(a8e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function aG(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":o4(XMLHttpRequest))==="object"}function l8e(e){return!!e&&typeof e.then=="function"}function u8e(e){return l8e(e)?e:Promise.resolve(e)}function c8e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var a4={exports:{}},av={exports:{}},_7;function d8e(){return _7||(_7=1,function(e,t){var n=typeof self<"u"?self:Ze,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(s){var a={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(A){return A&&DataView.prototype.isPrototypeOf(A)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(A){return A&&u.indexOf(Object.prototype.toString.call(A))>-1};function f(A){if(typeof A!="string"&&(A=String(A)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(A))throw new TypeError("Invalid character in header field name");return A.toLowerCase()}function h(A){return typeof A!="string"&&(A=String(A)),A}function g(A){var N={next:function(){var D=A.shift();return{done:D===void 0,value:D}}};return a.iterable&&(N[Symbol.iterator]=function(){return N}),N}function m(A){this.map={},A instanceof m?A.forEach(function(N,D){this.append(D,N)},this):Array.isArray(A)?A.forEach(function(N){this.append(N[0],N[1])},this):A&&Object.getOwnPropertyNames(A).forEach(function(N){this.append(N,A[N])},this)}m.prototype.append=function(A,N){A=f(A),N=h(N);var D=this.map[A];this.map[A]=D?D+", "+N:N},m.prototype.delete=function(A){delete this.map[f(A)]},m.prototype.get=function(A){return A=f(A),this.has(A)?this.map[A]:null},m.prototype.has=function(A){return this.map.hasOwnProperty(f(A))},m.prototype.set=function(A,N){this.map[f(A)]=h(N)},m.prototype.forEach=function(A,N){for(var D in this.map)this.map.hasOwnProperty(D)&&A.call(N,this.map[D],D,this)},m.prototype.keys=function(){var A=[];return this.forEach(function(N,D){A.push(D)}),g(A)},m.prototype.values=function(){var A=[];return this.forEach(function(N){A.push(N)}),g(A)},m.prototype.entries=function(){var A=[];return this.forEach(function(N,D){A.push([D,N])}),g(A)},a.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function v(A){if(A.bodyUsed)return Promise.reject(new TypeError("Already read"));A.bodyUsed=!0}function x(A){return new Promise(function(N,D){A.onload=function(){N(A.result)},A.onerror=function(){D(A.error)}})}function _(A){var N=new FileReader,D=x(N);return N.readAsArrayBuffer(A),D}function b(A){var N=new FileReader,D=x(N);return N.readAsText(A),D}function y(A){for(var N=new Uint8Array(A),D=new Array(N.length),U=0;U<N.length;U++)D[U]=String.fromCharCode(N[U]);return D.join("")}function S(A){if(A.slice)return A.slice(0);var N=new Uint8Array(A.byteLength);return N.set(new Uint8Array(A)),N.buffer}function C(){return this.bodyUsed=!1,this._initBody=function(A){this._bodyInit=A,A?typeof A=="string"?this._bodyText=A:a.blob&&Blob.prototype.isPrototypeOf(A)?this._bodyBlob=A:a.formData&&FormData.prototype.isPrototypeOf(A)?this._bodyFormData=A:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)?this._bodyText=A.toString():a.arrayBuffer&&a.blob&&l(A)?(this._bodyArrayBuffer=S(A.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(A)||d(A))?this._bodyArrayBuffer=S(A):this._bodyText=A=Object.prototype.toString.call(A):this._bodyText="",this.headers.get("content-type")||(typeof A=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(A)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var A=v(this);if(A)return A;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?v(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var A=v(this);if(A)return A;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function E(A){var N=A.toUpperCase();return T.indexOf(N)>-1?N:A}function P(A,N){N=N||{};var D=N.body;if(A instanceof P){if(A.bodyUsed)throw new TypeError("Already read");this.url=A.url,this.credentials=A.credentials,N.headers||(this.headers=new m(A.headers)),this.method=A.method,this.mode=A.mode,this.signal=A.signal,!D&&A._bodyInit!=null&&(D=A._bodyInit,A.bodyUsed=!0)}else this.url=String(A);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new m(N.headers)),this.method=E(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function k(A){var N=new FormData;return A.trim().split("&").forEach(function(D){if(D){var U=D.split("="),$=U.shift().replace(/\+/g," "),j=U.join("=").replace(/\+/g," ");N.append(decodeURIComponent($),decodeURIComponent(j))}}),N}function O(A){var N=new m,D=A.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(U){var $=U.split(":"),j=$.shift().trim();if(j){var G=$.join(":").trim();N.append(j,G)}}),N}C.call(P.prototype);function M(A,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new m(N.headers),this.url=N.url||"",this._initBody(A)}C.call(M.prototype),M.prototype.clone=function(){return new M(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},M.error=function(){var A=new M(null,{status:0,statusText:""});return A.type="error",A};var V=[301,302,303,307,308];M.redirect=function(A,N){if(V.indexOf(N)===-1)throw new RangeError("Invalid status code");return new M(null,{status:N,headers:{location:A}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(N,D){this.message=N,this.name=D;var U=Error(N);this.stack=U.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function B(A,N){return new Promise(function(D,U){var $=new P(A,N);if($.signal&&$.signal.aborted)return U(new s.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function G(){j.abort()}j.onload=function(){var q={status:j.status,statusText:j.statusText,headers:O(j.getAllResponseHeaders()||"")};q.url="responseURL"in j?j.responseURL:q.headers.get("X-Request-URL");var Z="response"in j?j.response:j.responseText;D(new M(Z,q))},j.onerror=function(){U(new TypeError("Network request failed"))},j.ontimeout=function(){U(new TypeError("Network request failed"))},j.onabort=function(){U(new s.DOMException("Aborted","AbortError"))},j.open($.method,$.url,!0),$.credentials==="include"?j.withCredentials=!0:$.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&a.blob&&(j.responseType="blob"),$.headers.forEach(function(q,Z){j.setRequestHeader(Z,q)}),$.signal&&($.signal.addEventListener("abort",G),j.onreadystatechange=function(){j.readyState===4&&$.signal.removeEventListener("abort",G)}),j.send(typeof $._bodyInit>"u"?null:$._bodyInit)})}return B.polyfill=!0,o.fetch||(o.fetch=B,o.Headers=m,o.Request=P,o.Response=M),s.Headers=m,s.Request=P,s.Response=M,s.fetch=B,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(av,av.exports)),av.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Ze<"u"&&Ze.fetch?n=Ze.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof c8e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||d8e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(a4,a4.exports);var lG=a4.exports;const uG=Tc(lG),b7=$7({__proto__:null,default:uG},[lG]);function R_(e){"@babel/helpers - typeof";return R_=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},R_(e)}var Fa;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Fa=global.fetch:typeof window<"u"&&window.fetch?Fa=window.fetch:Fa=fetch);var om;aG()&&(typeof global<"u"&&global.XMLHttpRequest?om=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(om=window.XMLHttpRequest));var O_;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?O_=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(O_=window.ActiveXObject));!Fa&&b7&&!om&&!O_&&(Fa=uG||b7);typeof Fa!="function"&&(Fa=void 0);var l4=function(t,n){if(n&&R_(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},S7=function(t,n,r){Fa(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},w7=!1,f8e=function(t,n,r,i){t.queryStringParams&&(n=l4(n,t.queryStringParams));var o=s4({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var s=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,a=s4({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},w7?{}:s);try{S7(n,a,i)}catch(l){if(!s||Object.keys(s).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(s).forEach(function(u){delete a[u]}),S7(n,a,i),w7=!0}catch(u){i(u)}}},h8e=function(t,n,r,i){r&&R_(r)==="object"&&(r=l4("",r).slice(1)),t.queryStringParams&&(n=l4(n,t.queryStringParams));try{var o;om?o=new om:o=new O_("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var s=t.customHeaders;if(s=typeof s=="function"?s():s,s)for(var a in s)o.setRequestHeader(a,s[a]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},p8e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Fa&&n.indexOf("file:")!==0)return f8e(t,n,r,i);if(aG()||typeof ActiveXObject=="function")return h8e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function sm(e){"@babel/helpers - typeof";return sm=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},sm(e)}function g8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x7(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,cG(r.key),r)}}function m8e(e,t,n){return t&&x7(e.prototype,t),n&&x7(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y8e(e,t,n){return t=cG(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cG(e){var t=v8e(e,"string");return sm(t)==="symbol"?t:String(t)}function v8e(e,t){if(sm(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sm(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _8e=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return y8e({},r,i||"")},parseLoadPayload:function(n,r){},request:p8e,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},dG=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};g8e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return m8e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=s4(i,this.options||{},_8e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,s){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=u8e(l),l.then(function(u){if(!u)return s(null,{});var d=a.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});a.loadUrl(d,s,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var s=this,a=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(a,l);this.options.request(this.options,n,u,function(d,f){if(f&&(f.status>=500&&f.status<600||!f.status))return r("failed loading "+n+"; status code: "+f.status,!0);if(f&&f.status>=400&&f.status<500)return r("failed loading "+n+"; status code: "+f.status,!1);if(!f&&d&&d.message&&d.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+d.message,!0);if(d)return r(d,!1);var h,g;try{typeof f.data=="string"?h=s.options.parse(f.data,i,o):h=f.data}catch{g="failed parsing "+n+" to json"}if(g)return r(g,!1);r(null,h)})}},{key:"create",value:function(n,r,i,o,s){var a=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],f=[];n.forEach(function(h){var g=a.options.addPath;typeof a.options.addPath=="function"&&(g=a.options.addPath(h,r));var m=a.services.interpolator.interpolate(g,{lng:h,ns:r});a.options.request(a.options,m,l,function(v,x){u+=1,d.push(v),f.push(x),u===n.length&&typeof s=="function"&&s(d,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,s=r.logger,a=i.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],u=function(f){var h=o.toResolveHierarchy(f);h.forEach(function(g){l.indexOf(g)<0&&l.push(g)})};u(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(f){i.read(d,f,"read",null,null,function(h,g){h&&s.warn("loading namespace ".concat(f," for language ").concat(d," failed"),h),!h&&g&&s.log("loaded namespace ".concat(f," for language ").concat(d),g),i.loaded("".concat(d,"|").concat(f),h,g)})})})}}}]),e}();dG.type="backend";const b8e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,S8e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},w8e=e=>S8e[e],x8e=e=>e.replace(b8e,w8e);let u4={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:x8e};function C8e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};u4={...u4,...e}}function QMe(){return u4}let fG;function T8e(e){fG=e}function ZMe(){return fG}const E8e={type:"3rdParty",init(e){C8e(e.options.react),T8e(e)}};oi.use(dG).use(E8e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const w2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function dh(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function MA(e){return"nodeType"in e}function xi(e){var t,n;return e?dh(e)?e:MA(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function NA(e){const{Document:t}=xi(e);return e instanceof t}function Jm(e){return dh(e)?!1:e instanceof xi(e).HTMLElement}function A8e(e){return e instanceof xi(e).SVGElement}function fh(e){return e?dh(e)?e.document:MA(e)?NA(e)?e:Jm(e)?e.ownerDocument:document:document:document}const Zs=w2?L.useLayoutEffect:L.useEffect;function x2(e){const t=L.useRef(e);return Zs(()=>{t.current=e}),L.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function P8e(){const e=L.useRef(null),t=L.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=L.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function am(e,t){t===void 0&&(t=[e]);const n=L.useRef(e);return Zs(()=>{n.current!==e&&(n.current=e)},t),n}function ey(e,t){const n=L.useRef();return L.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function k_(e){const t=x2(e),n=L.useRef(null),r=L.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function I_(e){const t=L.useRef();return L.useEffect(()=>{t.current=e},[e]),t.current}let xC={};function C2(e,t){return L.useMemo(()=>{if(t)return t;const n=xC[e]==null?0:xC[e]+1;return xC[e]=n,e+"-"+n},[e,t])}function hG(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,s)=>{const a=Object.entries(s);for(const[l,u]of a){const d=o[l];d!=null&&(o[l]=d+e*u)}return o},{...t})}}const wf=hG(1),M_=hG(-1);function R8e(e){return"clientX"in e&&"clientY"in e}function LA(e){if(!e)return!1;const{KeyboardEvent:t}=xi(e.target);return t&&e instanceof t}function O8e(e){if(!e)return!1;const{TouchEvent:t}=xi(e.target);return t&&e instanceof t}function lm(e){if(O8e(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return R8e(e)?{x:e.clientX,y:e.clientY}:null}const um=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[um.Translate.toString(e),um.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),C7="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k8e(e){return e.matches(C7)?e:e.querySelector(C7)}const I8e={display:"none"};function M8e(e){let{id:t,value:n}=e;return jt.createElement("div",{id:t,style:I8e},n)}const N8e={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function L8e(e){let{id:t,announcement:n}=e;return jt.createElement("div",{id:t,style:N8e,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function D8e(){const[e,t]=L.useState("");return{announce:L.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const pG=L.createContext(null);function $8e(e){const t=L.useContext(pG);L.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function F8e(){const[e]=L.useState(()=>new Set),t=L.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[L.useCallback(r=>{let{type:i,event:o}=r;e.forEach(s=>{var a;return(a=s[i])==null?void 0:a.call(s,o)})},[e]),t]}const B8e={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},U8e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function z8e(e){let{announcements:t=U8e,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=B8e}=e;const{announce:o,announcement:s}=D8e(),a=C2("DndLiveRegion"),[l,u]=L.useState(!1);if(L.useEffect(()=>{u(!0)},[]),$8e(L.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&o(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;o(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;o(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;o(t.onDragCancel({active:h,over:g}))}}),[o,t])),!l)return null;const d=jt.createElement(jt.Fragment,null,jt.createElement(M8e,{id:r,value:i.draggable}),jt.createElement(L8e,{id:a,announcement:s}));return n?Ms.createPortal(d,n):d}var fr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(fr||(fr={}));function N_(){}function T7(e,t){return L.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function V8e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return L.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ms=Object.freeze({x:0,y:0});function j8e(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function G8e(e,t){const n=lm(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function H8e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function W8e(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function q8e(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function K8e(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function X8e(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,d=s*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const Y8e=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=X8e(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(W8e)};function Q8e(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}const Z8e=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:s}=o,a=n.get(s);if(a&&Q8e(r,a)){const u=q8e(a).reduce((f,h)=>f+j8e(r,h),0),d=Number((u/4).toFixed(4));i.push({id:s,data:{droppableContainer:o,value:d}})}}return i.sort(H8e)};function J8e(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function gG(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ms}function e9e(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const t9e=e9e(1);function mG(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function n9e(e,t,n){const r=mG(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),u=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const r9e={ignoreTransform:!1};function ty(e,t){t===void 0&&(t=r9e);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=xi(e).getComputedStyle(e);u&&(n=n9e(n,u,d))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function E7(e){return ty(e,{ignoreTransform:!0})}function i9e(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function o9e(e,t){return t===void 0&&(t=xi(e).getComputedStyle(e)),t.position==="fixed"}function s9e(e,t){t===void 0&&(t=xi(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function DA(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(NA(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Jm(i)||A8e(i)||n.includes(i))return n;const o=xi(e).getComputedStyle(i);return i!==e&&s9e(i,o)&&n.push(i),o9e(i,o)?n:r(i.parentNode)}return e?r(e):n}function yG(e){const[t]=DA(e,1);return t??null}function CC(e){return!w2||!e?null:dh(e)?e:MA(e)?NA(e)||e===fh(e).scrollingElement?window:Jm(e)?e:null:null}function vG(e){return dh(e)?e.scrollX:e.scrollLeft}function _G(e){return dh(e)?e.scrollY:e.scrollTop}function c4(e){return{x:vG(e),y:_G(e)}}var xr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(xr||(xr={}));function bG(e){return!w2||!e?!1:e===document.scrollingElement}function SG(e){const t={x:0,y:0},n=bG(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const a9e={x:.2,y:.2};function l9e(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=a9e);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=SG(e),g={x:0,y:0},m={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+v.height?(g.y=xr.Backward,m.y=r*Math.abs((t.top+v.height-o)/v.height)):!d&&l>=t.bottom-v.height&&(g.y=xr.Forward,m.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(g.x=xr.Forward,m.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(g.x=xr.Backward,m.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:m}}function u9e(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function wG(e){return e.reduce((t,n)=>wf(t,c4(n)),ms)}function c9e(e){return e.reduce((t,n)=>t+vG(n),0)}function d9e(e){return e.reduce((t,n)=>t+_G(n),0)}function xG(e,t){if(t===void 0&&(t=ty),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);yG(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const f9e=[["x",["left","right"],c9e],["y",["top","bottom"],d9e]];class $A{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=DA(n),i=wG(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of f9e)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),d=i[o]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Xp{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function h9e(e){const{EventTarget:t}=xi(e);return e instanceof t?e:fh(e)}function TC(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Co;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Co||(Co={}));function A7(e){e.preventDefault()}function p9e(e){e.stopPropagation()}var on;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(on||(on={}));const CG={start:[on.Space,on.Enter],cancel:[on.Esc],end:[on.Space,on.Enter]},g9e=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case on.Right:return{...n,x:n.x+25};case on.Left:return{...n,x:n.x-25};case on.Down:return{...n,y:n.y+25};case on.Up:return{...n,y:n.y-25}}};class TG{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Xp(fh(n)),this.windowListeners=new Xp(xi(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Co.Resize,this.handleCancel),this.windowListeners.add(Co.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Co.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&xG(r),n(ms)}handleKeyDown(t){if(LA(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=CG,coordinateGetter:s=g9e,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:ms;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=M_(f,d),g={x:0,y:0},{scrollableAncestors:m}=r.current;for(const v of m){const x=t.code,{isTop:_,isRight:b,isLeft:y,isBottom:S,maxScroll:C,minScroll:T}=SG(v),E=u9e(v),P={x:Math.min(x===on.Right?E.right-E.width/2:E.right,Math.max(x===on.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(x===on.Down?E.bottom-E.height/2:E.bottom,Math.max(x===on.Down?E.top:E.top+E.height/2,f.y))},k=x===on.Right&&!b||x===on.Left&&!y,O=x===on.Down&&!S||x===on.Up&&!_;if(k&&P.x!==f.x){const M=v.scrollLeft+h.x,V=x===on.Right&&M<=C.x||x===on.Left&&M>=T.x;if(V&&!h.y){v.scrollTo({left:M,behavior:a});return}V?g.x=v.scrollLeft-M:g.x=x===on.Right?v.scrollLeft-C.x:v.scrollLeft-T.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(O&&P.y!==f.y){const M=v.scrollTop+h.y,V=x===on.Down&&M<=C.y||x===on.Up&&M>=T.y;if(V&&!h.x){v.scrollTo({top:M,behavior:a});return}V?g.y=v.scrollTop-M:g.y=x===on.Down?v.scrollTop-C.y:v.scrollTop-T.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,wf(M_(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}TG.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=CG,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function P7(e){return!!(e&&"distance"in e)}function R7(e){return!!(e&&"delay"in e)}class FA{constructor(t,n,r){var i;r===void 0&&(r=h9e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=fh(s),this.documentListeners=new Xp(this.document),this.listeners=new Xp(r),this.windowListeners=new Xp(xi(s)),this.initialCoordinates=(i=lm(o))!=null?i:ms,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Co.Resize,this.handleCancel),this.windowListeners.add(Co.DragStart,A7),this.windowListeners.add(Co.VisibilityChange,this.handleCancel),this.windowListeners.add(Co.ContextMenu,A7),this.documentListeners.add(Co.Keydown,this.handleKeydown),n){if(P7(n))return;if(R7(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Co.Click,p9e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Co.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=lm(t))!=null?n:ms,u=M_(i,l);if(!r&&a){if(R7(a))return TC(u,a.tolerance)?this.handleCancel():void 0;if(P7(a))return a.tolerance!=null&&TC(u,a.tolerance)?this.handleCancel():TC(u,a.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===on.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const m9e={move:{name:"pointermove"},end:{name:"pointerup"}};class EG extends FA{constructor(t){const{event:n}=t,r=fh(n.target);super(t,m9e,r)}}EG.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const y9e={move:{name:"mousemove"},end:{name:"mouseup"}};var d4;(function(e){e[e.RightClick=2]="RightClick"})(d4||(d4={}));class AG extends FA{constructor(t){super(t,y9e,fh(t.event.target))}}AG.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===d4.RightClick?!1:(r==null||r({event:n}),!0)}}];const EC={move:{name:"touchmove"},end:{name:"touchend"}};class PG extends FA{constructor(t){super(t,EC)}static setup(){return window.addEventListener(EC.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(EC.move.name,t)};function t(){}}}PG.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Yp;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Yp||(Yp={}));var L_;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(L_||(L_={}));function v9e(e){let{acceleration:t,activator:n=Yp.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=L_.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const g=b9e({delta:f,disabled:!o}),[m,v]=P8e(),x=L.useRef({x:0,y:0}),_=L.useRef({x:0,y:0}),b=L.useMemo(()=>{switch(n){case Yp.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Yp.DraggableRect:return i}},[n,i,l]),y=L.useRef(null),S=L.useCallback(()=>{const T=y.current;if(!T)return;const E=x.current.x*_.current.x,P=x.current.y*_.current.y;T.scrollBy(E,P)},[]),C=L.useMemo(()=>a===L_.TreeOrder?[...u].reverse():u,[a,u]);L.useEffect(()=>{if(!o||!u.length||!b){v();return}for(const T of C){if((r==null?void 0:r(T))===!1)continue;const E=u.indexOf(T),P=d[E];if(!P)continue;const{direction:k,speed:O}=l9e(T,P,b,t,h);for(const M of["x","y"])g[M][k[M]]||(O[M]=0,k[M]=0);if(O.x>0||O.y>0){v(),y.current=T,m(S,s),x.current=O,_.current=k;return}}x.current={x:0,y:0},_.current={x:0,y:0},v()},[t,S,r,v,o,s,JSON.stringify(b),JSON.stringify(g),m,u,C,d,JSON.stringify(h)])}const _9e={x:{[xr.Backward]:!1,[xr.Forward]:!1},y:{[xr.Backward]:!1,[xr.Forward]:!1}};function b9e(e){let{delta:t,disabled:n}=e;const r=I_(t);return ey(i=>{if(n||!r||!i)return _9e;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xr.Backward]:i.x[xr.Backward]||o.x===-1,[xr.Forward]:i.x[xr.Forward]||o.x===1},y:{[xr.Backward]:i.y[xr.Backward]||o.y===-1,[xr.Forward]:i.y[xr.Forward]||o.y===1}}},[n,t,r])}function S9e(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return ey(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function w9e(e,t){return L.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var cm;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(cm||(cm={}));var f4;(function(e){e.Optimized="optimized"})(f4||(f4={}));const O7=new Map;function x9e(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=L.useState(null),{frequency:a,measure:l,strategy:u}=i,d=L.useRef(e),f=x(),h=am(f),g=L.useCallback(function(_){_===void 0&&(_=[]),!h.current&&s(b=>b===null?_:b.concat(_.filter(y=>!b.includes(y))))},[h]),m=L.useRef(null),v=ey(_=>{if(f&&!n)return O7;if(!_||_===O7||d.current!==e||o!=null){const b=new Map;for(let y of e){if(!y)continue;if(o&&o.length>0&&!o.includes(y.id)&&y.rect.current){b.set(y.id,y.rect.current);continue}const S=y.node.current,C=S?new $A(l(S),S):null;y.rect.current=C,C&&b.set(y.id,C)}return b}return _},[e,o,n,f,l]);return L.useEffect(()=>{d.current=e},[e]),L.useEffect(()=>{f||g()},[n,f]),L.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),L.useEffect(()=>{f||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{g(),m.current=null},a))},[a,f,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:o!=null};function x(){switch(u){case cm.Always:return!1;case cm.BeforeDragging:return n;default:return!n}}}function BA(e,t){return ey(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function C9e(e,t){return BA(e,t)}function T9e(e){let{callback:t,disabled:n}=e;const r=x2(t),i=L.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return L.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function T2(e){let{callback:t,disabled:n}=e;const r=x2(t),i=L.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return L.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function E9e(e){return new $A(ty(e),e)}function k7(e,t,n){t===void 0&&(t=E9e);const[r,i]=L.useReducer(a,null),o=T9e({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),s=T2({callback:i});return Zs(()=>{i(),e?(s==null||s.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),o==null||o.disconnect())},[e]),r;function a(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d}}function A9e(e){const t=BA(e);return gG(e,t)}const I7=[];function P9e(e){const t=L.useRef(e),n=ey(r=>e?r&&r!==I7&&e&&t.current&&e.parentNode===t.current.parentNode?r:DA(e):I7,[e]);return L.useEffect(()=>{t.current=e},[e]),n}function R9e(e){const[t,n]=L.useState(null),r=L.useRef(e),i=L.useCallback(o=>{const s=CC(o.target);s&&n(a=>a?(a.set(s,c4(s)),new Map(a)):null)},[]);return L.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const u=CC(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,c4(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const u=CC(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),L.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>wf(o,s),ms):wG(e):ms,[e,t])}function M7(e,t){t===void 0&&(t=[]);const n=L.useRef(null);return L.useEffect(()=>{n.current=null},t),L.useEffect(()=>{const r=e!==ms;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?M_(e,n.current):ms}function O9e(e){L.useEffect(()=>{if(!w2)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function k9e(e,t){return L.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function RG(e){return L.useMemo(()=>e?i9e(e):null,[e])}const AC=[];function I9e(e,t){t===void 0&&(t=ty);const[n]=e,r=RG(n?xi(n):null),[i,o]=L.useReducer(a,AC),s=T2({callback:o});return e.length>0&&i===AC&&o(),Zs(()=>{e.length?e.forEach(l=>s==null?void 0:s.observe(l)):(s==null||s.disconnect(),o())},[e]),i;function a(){return e.length?e.map(l=>bG(l)?r:new $A(t(l),l)):AC}}function OG(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Jm(t)?t:e}function M9e(e){let{measure:t}=e;const[n,r]=L.useState(null),i=L.useCallback(u=>{for(const{target:d}of u)if(Jm(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),o=T2({callback:i}),s=L.useCallback(u=>{const d=OG(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),r(d?t(d):null)},[t,o]),[a,l]=k_(s);return L.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const N9e=[{sensor:EG,options:{}},{sensor:TG,options:{}}],L9e={current:{}},Hv={draggable:{measure:E7},droppable:{measure:E7,strategy:cm.WhileDragging,frequency:f4.Optimized},dragOverlay:{measure:ty}};class Qp extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const D9e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Qp,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:N_},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hv,measureDroppableContainers:N_,windowRect:null,measuringScheduled:!1},kG={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:N_,draggableNodes:new Map,over:null,measureDroppableContainers:N_},ny=L.createContext(kG),IG=L.createContext(D9e);function $9e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Qp}}}function F9e(e,t){switch(t.type){case fr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case fr.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case fr.DragEnd:case fr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case fr.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Qp(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case fr.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Qp(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case fr.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Qp(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function B9e(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=L.useContext(ny),o=I_(r),s=I_(n==null?void 0:n.id);return L.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!LA(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=k8e(d);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function MG(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function U9e(e){return L.useMemo(()=>({draggable:{...Hv.draggable,...e==null?void 0:e.draggable},droppable:{...Hv.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Hv.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function z9e(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=L.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Zs(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=gG(d,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=yG(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const E2=L.createContext({...ms,scaleX:1,scaleY:1});var El;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(El||(El={}));const V9e=L.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:d=N9e,collisionDetection:f=Y8e,measuring:h,modifiers:g,...m}=t;const v=L.useReducer(F9e,void 0,$9e),[x,_]=v,[b,y]=F8e(),[S,C]=L.useState(El.Uninitialized),T=S===El.Initialized,{draggable:{active:E,nodes:P,translate:k},droppable:{containers:O}}=x,M=E?P.get(E):null,V=L.useRef({initial:null,translated:null}),B=L.useMemo(()=>{var nn;return E!=null?{id:E,data:(nn=M==null?void 0:M.data)!=null?nn:L9e,rect:V}:null},[E,M]),A=L.useRef(null),[N,D]=L.useState(null),[U,$]=L.useState(null),j=am(m,Object.values(m)),G=C2("DndDescribedBy",s),q=L.useMemo(()=>O.getEnabled(),[O]),Z=U9e(h),{droppableRects:ee,measureDroppableContainers:ie,measuringScheduled:se}=x9e(q,{dragging:T,dependencies:[k.x,k.y],config:Z.droppable}),le=S9e(P,E),W=L.useMemo(()=>U?lm(U):null,[U]),ne=ia(),fe=C9e(le,Z.draggable.measure);z9e({activeNode:E?P.get(E):null,config:ne.layoutShiftCompensation,initialRect:fe,measure:Z.draggable.measure});const pe=k7(le,Z.draggable.measure,fe),ve=k7(le?le.parentElement:null),ye=L.useRef({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Je=O.getNodeFor((n=ye.current.over)==null?void 0:n.id),Fe=M9e({measure:Z.dragOverlay.measure}),Ae=(r=Fe.nodeRef.current)!=null?r:le,vt=T?(i=Fe.rect)!=null?i:pe:null,_e=!!(Fe.nodeRef.current&&Fe.rect),Qt=A9e(_e?null:pe),rr=RG(Ae?xi(Ae):null),qt=P9e(T?Je??le:null),ht=I9e(qt),At=MG(g,{transform:{x:k.x-Qt.x,y:k.y-Qt.y,scaleX:1,scaleY:1},activatorEvent:U,active:B,activeNodeRect:pe,containerNodeRect:ve,draggingNodeRect:vt,over:ye.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:qt,scrollableAncestorRects:ht,windowRect:rr}),un=W?wf(W,k):null,Gr=R9e(qt),Pr=M7(Gr),Ci=M7(Gr,[pe]),In=wf(At,Pr),gn=vt?t9e(vt,At):null,ir=B&&gn?f({active:B,collisionRect:gn,droppableRects:ee,droppableContainers:q,pointerCoordinates:un}):null,mn=K8e(ir,"id"),[Zt,Rr]=L.useState(null),Hr=_e?At:wf(At,Ci),si=J8e(Hr,(o=Zt==null?void 0:Zt.rect)!=null?o:null,pe),Vi=L.useCallback((nn,Ft)=>{let{sensor:or,options:qn}=Ft;if(A.current==null)return;const yr=P.get(A.current);if(!yr)return;const Or=nn.nativeEvent,kr=new or({active:A.current,activeNode:yr,event:Or,options:qn,context:ye,onStart(Ir){const sr=A.current;if(sr==null)return;const ji=P.get(sr);if(!ji)return;const{onDragStart:bs}=j.current,fo={active:{id:sr,data:ji.data,rect:V}};Ms.unstable_batchedUpdates(()=>{bs==null||bs(fo),C(El.Initializing),_({type:fr.DragStart,initialCoordinates:Ir,active:sr}),b({type:"onDragStart",event:fo})})},onMove(Ir){_({type:fr.DragMove,coordinates:Ir})},onEnd:co(fr.DragEnd),onCancel:co(fr.DragCancel)});Ms.unstable_batchedUpdates(()=>{D(kr),$(nn.nativeEvent)});function co(Ir){return async function(){const{active:ji,collisions:bs,over:fo,scrollAdjustedTranslate:tl}=ye.current;let Vo=null;if(ji&&tl){const{cancelDrop:Mr}=j.current;Vo={activatorEvent:Or,active:ji,collisions:bs,delta:tl,over:fo},Ir===fr.DragEnd&&typeof Mr=="function"&&await Promise.resolve(Mr(Vo))&&(Ir=fr.DragCancel)}A.current=null,Ms.unstable_batchedUpdates(()=>{_({type:Ir}),C(El.Uninitialized),Rr(null),D(null),$(null);const Mr=Ir===fr.DragEnd?"onDragEnd":"onDragCancel";if(Vo){const oa=j.current[Mr];oa==null||oa(Vo),b({type:Mr,event:Vo})}})}}},[P]),$n=L.useCallback((nn,Ft)=>(or,qn)=>{const yr=or.nativeEvent,Or=P.get(qn);if(A.current!==null||!Or||yr.dndKit||yr.defaultPrevented)return;const kr={active:Or};nn(or,Ft.options,kr)===!0&&(yr.dndKit={capturedBy:Ft.sensor},A.current=qn,Vi(or,Ft))},[P,Vi]),ai=w9e(d,$n);O9e(d),Zs(()=>{pe&&S===El.Initializing&&C(El.Initialized)},[pe,S]),L.useEffect(()=>{const{onDragMove:nn}=j.current,{active:Ft,activatorEvent:or,collisions:qn,over:yr}=ye.current;if(!Ft||!or)return;const Or={active:Ft,activatorEvent:or,collisions:qn,delta:{x:In.x,y:In.y},over:yr};Ms.unstable_batchedUpdates(()=>{nn==null||nn(Or),b({type:"onDragMove",event:Or})})},[In.x,In.y]),L.useEffect(()=>{const{active:nn,activatorEvent:Ft,collisions:or,droppableContainers:qn,scrollAdjustedTranslate:yr}=ye.current;if(!nn||A.current==null||!Ft||!yr)return;const{onDragOver:Or}=j.current,kr=qn.get(mn),co=kr&&kr.rect.current?{id:kr.id,rect:kr.rect.current,data:kr.data,disabled:kr.disabled}:null,Ir={active:nn,activatorEvent:Ft,collisions:or,delta:{x:yr.x,y:yr.y},over:co};Ms.unstable_batchedUpdates(()=>{Rr(co),Or==null||Or(Ir),b({type:"onDragOver",event:Ir})})},[mn]),Zs(()=>{ye.current={activatorEvent:U,active:B,activeNode:le,collisionRect:gn,collisions:ir,droppableRects:ee,draggableNodes:P,draggingNode:Ae,draggingNodeRect:vt,droppableContainers:O,over:Zt,scrollableAncestors:qt,scrollAdjustedTranslate:In},V.current={initial:vt,translated:gn}},[B,le,ir,gn,P,Ae,vt,ee,O,Zt,qt,In]),v9e({...ne,delta:k,draggingRect:gn,pointerCoordinates:un,scrollableAncestors:qt,scrollableAncestorRects:ht});const ra=L.useMemo(()=>({active:B,activeNode:le,activeNodeRect:pe,activatorEvent:U,collisions:ir,containerNodeRect:ve,dragOverlay:Fe,draggableNodes:P,droppableContainers:O,droppableRects:ee,over:Zt,measureDroppableContainers:ie,scrollableAncestors:qt,scrollableAncestorRects:ht,measuringConfiguration:Z,measuringScheduled:se,windowRect:rr}),[B,le,pe,U,ir,ve,Fe,P,O,ee,Zt,ie,qt,ht,Z,se,rr]),uo=L.useMemo(()=>({activatorEvent:U,activators:ai,active:B,activeNodeRect:pe,ariaDescribedById:{draggable:G},dispatch:_,draggableNodes:P,over:Zt,measureDroppableContainers:ie}),[U,ai,B,pe,_,G,P,Zt,ie]);return jt.createElement(pG.Provider,{value:y},jt.createElement(ny.Provider,{value:uo},jt.createElement(IG.Provider,{value:ra},jt.createElement(E2.Provider,{value:si},u)),jt.createElement(B9e,{disabled:(a==null?void 0:a.restoreFocus)===!1})),jt.createElement(z8e,{...a,hiddenTextDescribedById:G}));function ia(){const nn=(N==null?void 0:N.autoScrollEnabled)===!1,Ft=typeof l=="object"?l.enabled===!1:l===!1,or=T&&!nn&&!Ft;return typeof l=="object"?{...l,enabled:or}:{enabled:or}}}),j9e=L.createContext(null),N7="button",G9e="Droppable";function H9e(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=C2(G9e),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=L.useContext(ny),{role:g=N7,roleDescription:m="draggable",tabIndex:v=0}=i??{},x=(l==null?void 0:l.id)===t,_=L.useContext(x?E2:j9e),[b,y]=k_(),[S,C]=k_(),T=k9e(s,t),E=am(n);Zs(()=>(f.set(t,{id:t,key:o,node:b,activatorNode:S,data:E}),()=>{const k=f.get(t);k&&k.key===o&&f.delete(t)}),[f,t]);const P=L.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":x&&g===N7?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,g,v,x,m,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:P,isDragging:x,listeners:r?void 0:T,node:b,over:h,setNodeRef:y,setActivatorNodeRef:C,transform:_}}function W9e(){return L.useContext(IG)}const q9e="Droppable",K9e={timeout:25};function X9e(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=C2(q9e),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=L.useContext(ny),d=L.useRef({disabled:n}),f=L.useRef(!1),h=L.useRef(null),g=L.useRef(null),{disabled:m,updateMeasurementsFor:v,timeout:x}={...K9e,...i},_=am(v??r),b=L.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(_.current)?_.current:[_.current]),g.current=null},x)},[x]),y=T2({callback:b,disabled:m||!s}),S=L.useCallback((P,k)=>{y&&(k&&(y.unobserve(k),f.current=!1),P&&y.observe(P))},[y]),[C,T]=k_(S),E=am(t);return L.useEffect(()=>{!y||!C.current||(y.disconnect(),f.current=!1,y.observe(C.current))},[C,y]),Zs(()=>(a({type:fr.RegisterDroppable,element:{id:r,key:o,disabled:n,node:C,rect:h,data:E}}),()=>a({type:fr.UnregisterDroppable,key:o,id:r})),[r]),L.useEffect(()=>{n!==d.current.disabled&&(a({type:fr.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===r,node:C,over:l,setNodeRef:T}}function Y9e(e){let{animation:t,children:n}=e;const[r,i]=L.useState(null),[o,s]=L.useState(null),a=I_(n);return!n&&!r&&a&&i(a),Zs(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),jt.createElement(jt.Fragment,null,n,r?L.cloneElement(r,{ref:s}):null)}const Q9e={x:0,y:0,scaleX:1,scaleY:1};function Z9e(e){let{children:t}=e;return jt.createElement(ny.Provider,{value:kG},jt.createElement(E2.Provider,{value:Q9e},t))}const J9e={position:"fixed",touchAction:"none"},eRe=e=>LA(e)?"transform 250ms ease":void 0,tRe=L.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:s,rect:a,style:l,transform:u,transition:d=eRe}=e;if(!a)return null;const f=i?u:{...u,scaleX:1,scaleY:1},h={...J9e,width:a.width,height:a.height,top:a.top,left:a.left,transform:um.Transform.toString(f),transformOrigin:i&&r?G8e(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return jt.createElement(n,{className:s,style:h,ref:t},o)}),nRe=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:s}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},rRe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:um.Transform.toString(t)},{transform:um.Transform.toString(n)}]},iRe={duration:250,easing:"ease",keyframes:rRe,sideEffects:nRe({styles:{active:{opacity:"0"}}})};function oRe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return x2((o,s)=>{if(t===null)return;const a=n.get(o);if(!a)return;const l=a.node.current;if(!l)return;const u=OG(s);if(!u)return;const{transform:d}=xi(s).getComputedStyle(s),f=mG(d);if(!f)return;const h=typeof t=="function"?t:sRe(t);return xG(l,i.draggable.measure),h({active:{id:o,data:a.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:s,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function sRe(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...iRe,...e};return o=>{let{active:s,dragOverlay:a,transform:l,...u}=o;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-d.x,y:l.y-d.y,...f},g=i({...u,active:s,dragOverlay:a,transform:{initial:l,final:h}}),[m]=g,v=g[g.length-1];if(JSON.stringify(m)===JSON.stringify(v))return;const x=r==null?void 0:r({active:s,dragOverlay:a,...u}),_=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(b=>{_.onfinish=()=>{x==null||x(),b()}})}}let L7=0;function aRe(e){return L.useMemo(()=>{if(e!=null)return L7++,L7},[e])}const lRe=jt.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:s,wrapperElement:a="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:m,droppableContainers:v,dragOverlay:x,over:_,measuringConfiguration:b,scrollableAncestors:y,scrollableAncestorRects:S,windowRect:C}=W9e(),T=L.useContext(E2),E=aRe(f==null?void 0:f.id),P=MG(s,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:x.rect,over:_,overlayNodeRect:x.rect,scrollableAncestors:y,scrollableAncestorRects:S,transform:T,windowRect:C}),k=BA(h),O=oRe({config:r,draggableNodes:m,droppableContainers:v,measuringConfiguration:b}),M=k?x.setRef:void 0;return jt.createElement(Z9e,null,jt.createElement(Y9e,{animation:O},f&&E?jt.createElement(tRe,{key:E,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:k,style:{zIndex:u,...i},transform:P},n):null))}),uRe=e=>{let{activatorEvent:t,draggingNodeRect:n,transform:r}=e;if(n&&t){const i=lm(t);if(!i)return r;const o=i.x-n.left,s=i.y-n.top;return{...r,x:r.x+o-n.width/2,y:r.y+s-n.height/2}}return r},cRe=()=>Q$(),JMe=j$,lv=28,D7={w:lv,h:lv,maxW:lv,maxH:lv,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},dRe=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return ue.jsx(kA,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",cursor:"none"},children:ue.jsx(OA,{sx:{...D7},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?ue.jsxs(IA,{sx:{cursor:"none",userSelect:"none",position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...D7},children:[ue.jsx(i4,{children:e.dragData.payload.imageDTOs.length}),ue.jsx(i4,{size:"sm",children:"Images"})]}):null},fRe=L.memo(dRe);function eNe(e){return X9e(e)}function tNe(e){return H9e(e)}const nNe=(e,t)=>{if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROLNET_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:o}=t.data.current.payload,s=o.board_id??"none",a=e.context.boardId;return s!==a}return r==="IMAGE_DTOS"}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:o}=t.data.current.payload;return o.board_id!=="none"}return r==="IMAGE_DTOS"}default:return!1}};function hRe(e){return ue.jsx(V9e,{...e})}const pRe=e=>{const[t,n]=L.useState(null),r=ke("images"),i=cRe(),o=L.useCallback(d=>{r.trace({dragData:d.active.data.current},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),s=L.useCallback(d=>{var h;r.trace({dragData:d.active.data.current},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(iz({overData:f,activeData:t})),n(null))},[t,i,r]),a=T7(AG,{activationConstraint:{distance:10}}),l=T7(PG,{activationConstraint:{distance:10}}),u=V8e(a,l);return ue.jsxs(hRe,{onDragStart:o,onDragEnd:s,sensors:u,collisionDetection:Z8e,children:[e.children,ue.jsx(lRe,{dropAnimation:null,modifiers:[uRe],children:ue.jsx(QPe,{children:t&&ue.jsx(jPe.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:ue.jsx(fRe,{dragData:t})},"overlay-drag-image")})})]})},gRe=L.memo(pRe),mRe=L.lazy(()=>QN(()=>import("./App-7d912410.js"),["./App-7d912410.js","./menu-971c0572.js","./App-6125620a.css"],import.meta.url)),yRe=L.lazy(()=>QN(()=>import("./ThemeLocaleProvider-bc3e6f20.js"),["./ThemeLocaleProvider-bc3e6f20.js","./menu-971c0572.js","./ThemeLocaleProvider-5b992bc7.css"],import.meta.url)),vRe=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o})=>(L.useEffect(()=>(t&&Dg.set(t),e&&$g.set(e),o&&N1.set(o),HU(),i&&i.length>0?d5(Yk(),...i):d5(Yk()),()=>{$g.set(void 0),Dg.set(void 0),N1.set(void 0)}),[e,t,i,o]),ue.jsx(jt.StrictMode,{children:ue.jsx(Fde,{store:u3e,children:ue.jsx(jt.Suspense,{fallback:ue.jsx(o8e,{}),children:ue.jsx(yRe,{children:ue.jsx(gRe,{children:ue.jsx(mRe,{config:n,headerComponent:r})})})})})})),_Re=L.memo(vRe);PC.createRoot(document.getElementById("root")).render(ue.jsx(_Re,{}));export{KMe as $,L as A,ue as B,$o as C,Gn as D,mf as E,ii as F,rs as G,fme as H,Bi as I,Hl as J,Rs as K,i7e as L,CB as M,Ame as N,rye as O,gme as P,wpe as Q,Uf as R,Cg as S,G5e as T,zc as U,Cc as V,EV as W,FMe as X,LMe as Y,QPe as Z,jPe as _,VL as a,dQ as a$,MV as a0,iG as a1,$V as a2,DMe as a3,$Me as a4,j5e as a5,V5e as a6,BMe as a7,Ju as a8,Tc as a9,IA as aA,i4 as aB,OMe as aC,Kz as aD,_Ie as aE,R5e as aF,oA as aG,_V as aH,k5e as aI,Ms as aJ,HP as aK,sA as aL,Y7e as aM,sIe as aN,SIe as aO,wIe as aP,JIe as aQ,QIe as aR,Hu as aS,D_e as aT,JU as aU,M7e as aV,YIe as aW,nE as aX,OE as aY,eR as aZ,Cke as a_,U1 as aa,ZJ as ab,jt as ac,mTe as ad,qMe as ae,La as af,CV as ag,$6e as ah,VMe as ai,z5 as aj,NMe as ak,WMe as al,mi as am,PE as an,gb as ao,JMe as ap,s7e as aq,Bm as ar,oU as as,kU as at,fS as au,cRe as av,$7e as aw,Yn as ax,lc as ay,kA as az,CT as b,k7e as b$,xRe as b0,SRe as b1,wRe as b2,Ze as b3,dIe as b4,PIe as b5,AIe as b6,uIe as b7,XIe as b8,ZCe as b9,DRe as bA,lOe as bB,MRe as bC,YRe as bD,BRe as bE,mbe as bF,NRe as bG,oOe as bH,IRe as bI,hOe as bJ,$Re as bK,QRe as bL,FRe as bM,ZRe as bN,jRe as bO,eOe as bP,gbe as bQ,URe as bR,kO as bS,E7e as bT,A7e as bU,P7e as bV,GRe as bW,R7e as bX,HRe as bY,O7e as bZ,WRe as b_,eNe as ba,nNe as bb,WIe as bc,aIe as bd,lIe as be,gIe as bf,W3 as bg,cIe as bh,OA as bi,r8e as bj,NOe as bk,Ml as bl,T0 as bm,HIe as bn,jIe as bo,KIe as bp,GIe as bq,bRe as br,PRe as bs,RRe as bt,ORe as bu,kRe as bv,rOe as bw,iOe as bx,w7e as by,x7e as bz,Kte as c,kd as c$,Me as c0,mIe as c1,Efe as c2,T$ as c3,fke as c4,b$ as c5,ZIe as c6,tNe as c7,MMe as c8,rz as c9,D1e as cA,OOe as cB,FOe as cC,H7e as cD,que as cE,o7e as cF,D7e as cG,FT as cH,VIe as cI,BIe as cJ,UIe as cK,zIe as cL,t7e as cM,n7e as cN,$F as cO,aMe as cP,gc as cQ,CRe as cR,e7e as cS,DT as cT,ke as cU,VRe as cV,sMe as cW,PR as cX,NIe as cY,eE as cZ,vfe as c_,hIe as ca,j1 as cb,qIe as cc,pIe as cd,tR as ce,G1 as cf,RMe as cg,nMe as ch,IOe as ci,Z7e as cj,fIe as ck,bIe as cl,tE as cm,BT as cn,LRe as co,BOe as cp,oi as cq,j7e as cr,J7e as cs,Q7e as ct,p_e as cu,V7e as cv,W7e as cw,q7e as cx,Gue as cy,L1e as cz,Dae as d,bMe as d$,RR as d0,LIe as d1,DIe as d2,$Ie as d3,_fe as d4,FIe as d5,RF as d6,kIe as d7,MIe as d8,RIe as d9,uMe as dA,m$ as dB,TOe as dC,Hue as dD,Ns as dE,JRe as dF,cOe as dG,ARe as dH,Ale as dI,fOe as dJ,T7e as dK,EOe as dL,S7e as dM,ASe as dN,POe as dO,we as dP,Yi as dQ,Cn as dR,Gs as dS,rMe as dT,xOe as dU,Ele as dV,SOe as dW,wOe as dX,vOe as dY,_Oe as dZ,yOe as d_,NCe as da,QO as db,OIe as dc,COe as dd,pOe as de,bOe as df,nOe as dg,F7e as dh,Oc as di,U7e as dj,Aa as dk,CSe as dl,qRe as dm,zm as dn,lMe as dp,C7e as dq,iMe as dr,TMe as ds,h$ as dt,vMe as du,f1e as dv,tOe as dw,p$ as dx,oMe as dy,$ue as dz,VD as e,nke as e$,hMe as e0,X7e as e1,fMe as e2,CMe as e3,_Me as e4,K7e as e5,gMe as e6,pMe as e7,cMe as e8,yMe as e9,a7e as eA,l7e as eB,d7e as eC,c7e as eD,f7e as eE,y7e as eF,e0e as eG,rU as eH,jue as eI,gOe as eJ,qOe as eK,yke as eL,nIe as eM,sOe as eN,aOe as eO,gke as eP,vke as eQ,hz as eR,MQ as eS,ft as eT,kke as eU,Yke as eV,Xke as eW,cke as eX,Uke as eY,Zke as eZ,G_e as e_,ERe as ea,dMe as eb,mMe as ec,TRe as ed,qB as ee,LT as ef,SMe as eg,e_ as eh,Ue as ei,wMe as ej,NU as ek,zRe as el,xMe as em,j$ as en,Q$ as eo,b7e as ep,h7e as eq,p7e as er,g7e as es,xE as et,v7e as eu,_7e as ev,qg as ew,mb as ex,u7e as ey,e3e as ez,YL as f,PMe as f$,Eke as f0,mp as f1,wke as f2,rke as f3,gS as f4,Tke as f5,JOe as f6,xke as f7,eke as f8,ske as f9,Ske as fA,hke as fB,Mke as fC,Bke as fD,Nke as fE,uke as fF,tke as fG,Wke as fH,Hke as fI,$ke as fJ,Lke as fK,Dke as fL,rIe as fM,jke as fN,iIe as fO,bke as fP,_ke as fQ,ZOe as fR,QOe as fS,tIe as fT,dke as fU,V_e as fV,B_e as fW,U_e as fX,z_e as fY,WOe as fZ,AOe as f_,jOe as fa,VOe as fb,zOe as fc,Qke as fd,w$ as fe,Dg as ff,KOe as fg,XOe as fh,YOe as fi,Kke as fj,lke as fk,ake as fl,dce as fm,qke as fn,j_e as fo,ike as fp,OCe as fq,MCe as fr,pke as fs,Ike as ft,Oke as fu,Ake as fv,GOe as fw,HOe as fx,eMe as fy,tMe as fz,Rae as g,MOe as g0,y$ as g1,DOe as g2,LOe as g3,$Oe as g4,Cle as g5,N_e as g6,IMe as g7,TV as g8,HMe as g9,jMe as ga,UMe as gb,GMe as gc,Us as gd,zMe as ge,kMe as gf,pTe as gg,sTe as gh,XMe as gi,QMe as gj,ZMe as gk,oD as h,vi as i,Jf as j,hb as k,Er as l,fb as m,Tm as n,ps as o,gu as p,cb as q,Js as r,Am as s,vx as t,bT as u,KL as v,PT as w,LD as x,QL as y,Sle as z};
|